Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 Jan 2001 11:10:35 -0500 (EST)
From:      Robert Watson <rwatson@FreeBSD.ORG>
To:        Josef Karthauser <joe@tao.org.uk>
Cc:        Samuel Tardieu <sam@inf.enst.fr>, hackers@FreeBSD.ORG, n_hibma@FreeBSD.ORG
Subject:   Re: Link up/down events
Message-ID:  <Pine.NEB.3.96L.1010110110600.79828B-100000@fledge.watson.org>
In-Reply-To: <20010110155134.B524@tao.org.uk>

next in thread | previous in thread | raw e-mail | index | archive | help

On Wed, 10 Jan 2001, Josef Karthauser wrote:

> On Wed, Jan 10, 2001 at 08:57:14AM -0500, Robert Watson wrote:
> > On Wed, 10 Jan 2001, Samuel Tardieu wrote:
> > 
> > > Is there a way to be warned about ethernet link up/down events? I have a
> > > laptop with an internal fxp0 interface, and I'd like to launch/kill
> > > dhclient whenever the link goes up/down. 
> > 
> > I've been wondering about this also -- Darwin has this, and it's pretty
> > cool to watch dhclient run as soon as the ethernet cable is stuck in, and
> > not have to dig around to find out how to pursuade the system to make the
> > change.  Windows 2000 also appears to do this for appropriate ethernet
> > cards.  The traditional means of notifying userland processes of
> > interface/network events has been the routing socket -- presumably we want
> > to notify on interface arrive / depart, as well as for condition changes,
> > including a link up / down (differentiated from administrative up / down).
> 
> There's an ongoing discussion about building a generic devd (device
> daemon) to deal with this kind of thing.  Nick Hibma proposed a spec for
> one, but as far as I'm aware there's been no feedback to him yet.

I would argue that, for this question, a devd interface would be the wrong
answer.  This may be a deficiency in the device API, but it's also a
deficiency in the network API, which is different.  Recall that there are
network interfaces that are not associated with actually devices (lo0,
vpn's, etc, for example), where it may be desirable to monitor link state
asynchronously without using our platform-specific device API.  Using
routing sockets to monitor network conditions is a portable and fairly
well-defined interface, and it's arguable that monitoring link state would
be an appropriate additional event to provide via the interface.
Presumably at some point in the stack, that notification is translated
from a hardware event, which might be associated with devd in some manner
(and possibly also exposed there).

Robert N M Watson             FreeBSD Core Team, TrustedBSD Project
robert@fledge.watson.org      NAI Labs, Safeport Network Services





To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1010110110600.79828B-100000>