From owner-freebsd-hackers Wed Jan 10 8:11:24 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from fledge.watson.org (fledge.watson.org [204.156.12.50]) by hub.freebsd.org (Postfix) with ESMTP id 72B6037B69E; Wed, 10 Jan 2001 08:11:03 -0800 (PST) Received: from fledge.watson.org (robert@fledge.pr.watson.org [192.0.2.3]) by fledge.watson.org (8.11.1/8.11.1) with SMTP id f0AGAa780127; Wed, 10 Jan 2001 11:10:36 -0500 (EST) (envelope-from robert@fledge.watson.org) Date: Wed, 10 Jan 2001 11:10:35 -0500 (EST) From: Robert Watson X-Sender: robert@fledge.watson.org To: Josef Karthauser Cc: Samuel Tardieu , hackers@FreeBSD.ORG, n_hibma@FreeBSD.ORG Subject: Re: Link up/down events In-Reply-To: <20010110155134.B524@tao.org.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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