From: Baruch Even <baruch@ev-en.org>
To: Stephen Hemminger <shemminger@osdl.org>
Cc: Filipe Abrantes <fla@inescporto.pt>, linux-kernel@vger.kernel.org
Subject: Re: Detecting link up
Date: Wed, 18 May 2005 23:20:35 +0100 [thread overview]
Message-ID: <428BBFB3.4090702@ev-en.org> (raw)
In-Reply-To: <428B876F.8080802@osdl.org>
Stephen Hemminger wrote:
> Filipe Abrantes wrote:
>
>> Hi all,
>>
>> I need to detect when an interface (wired ethernet) has link up/down.
>> Is there a system signal which is sent when this happens? What is the
>> best way to this programatically?
>>
>> Best Regards
>>
>> Filipe
>>
>>
>
> The best way is to open a netlink socket and look for the mesaages about
> link up/down there. Read iproute2 http://developer.osdl.org/dev/iproute2
> source for ip command (ipmonitor.c).
>
> This works for almost all devices unlike ethtool and mii which only
> work on a small subset of devices.
And libnl is a very good library to get just that information without
the need to manually parse netlink messages.
Baruch
prev parent reply other threads:[~2005-05-18 22:26 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-18 10:35 Detecting link up Filipe Abrantes
2005-05-18 11:40 ` Martin Zwickel
2005-05-18 13:11 ` Vaibhav Nivargi
2005-05-18 13:57 ` Richard B. Johnson
2005-05-18 14:37 ` Max Kellermann
2005-05-18 15:00 ` Oliver Neukum
2005-05-18 15:06 ` Coywolf Qi Hunt
2005-05-18 15:11 ` Richard B. Johnson
2005-05-18 17:33 ` Michael Tokarev
2005-05-18 18:20 ` Stephen Hemminger
2005-05-18 22:20 ` Baruch Even [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=428BBFB3.4090702@ev-en.org \
--to=baruch@ev-en.org \
--cc=fla@inescporto.pt \
--cc=linux-kernel@vger.kernel.org \
--cc=shemminger@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox