From: Stephen Hemminger <shemminger@osdl.org>
To: Filipe Abrantes <fla@inescporto.pt>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Detecting link up
Date: Wed, 18 May 2005 11:20:31 -0700 [thread overview]
Message-ID: <428B876F.8080802@osdl.org> (raw)
In-Reply-To: <428B1A60.6030505@inescporto.pt>
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.
next prev parent reply other threads:[~2005-05-18 18:21 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 [this message]
2005-05-18 22:20 ` Baruch Even
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=428B876F.8080802@osdl.org \
--to=shemminger@osdl.org \
--cc=fla@inescporto.pt \
--cc=linux-kernel@vger.kernel.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