From owner-freebsd-net@FreeBSD.ORG Mon May 16 22:46:39 2005 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CF4FE16A4CE for ; Mon, 16 May 2005 22:46:39 +0000 (GMT) Received: from ylpvm29.prodigy.net (ylpvm29-ext.prodigy.net [207.115.57.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id 43D0543D8B for ; Mon, 16 May 2005 22:46:39 +0000 (GMT) (envelope-from kbyanc@posi.net) Received: from pimout7-ext.prodigy.net (pimout7-ext.prodigy.net [207.115.63.58])j4GMkSIE012826 for ; Mon, 16 May 2005 18:46:29 -0400 X-ORBL: [68.120.137.218] Received: from gateway.posi.net (adsl-68-120-137-218.dsl.snfc21.pacbell.net [68.120.137.218])j4GMkNMG393754; Mon, 16 May 2005 18:46:28 -0400 Received: from localhost (localhost [127.0.0.1]) by gateway.posi.net (Postfix) with ESMTP id 069FC75E05F; Mon, 16 May 2005 16:49:57 -0700 (PDT) Date: Mon, 16 May 2005 16:49:57 -0700 (PDT) From: Kelly Yancey To: Bruce M Simpson In-Reply-To: <20050516123817.GF828@empiric.icir.org> Message-ID: <20050516164614.R68432@gateway.posi.net> References: <20050513111013.41905e73.spe@phear.org> <20050516094309.GD777@obiwan.tataz.chchile.org> <20050516123817.GF828@empiric.icir.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-net@freebsd.org cc: jeremie@le-hen.org cc: Sebastien Petit Subject: Re: SIOCGIFMEDIA problems X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 May 2005 22:46:40 -0000 On Mon, 16 May 2005, Bruce M Simpson wrote: > On Mon, May 16, 2005 at 02:31:36PM +0200, Sebastien Petit wrote: > > As I can see in kqueue man, I can only monitor events by file descriptor (read/write), a process id, a signal or a timer (under NetBSD 2) > > How I can use it for monitoring link status change on a network card ? > > You need to use EVFILT_NETDEV and that may only be implemented on FreeBSD > to the best of my knowledge. See kqueue(2) on FreeBSD for more details. > Couldn't the same be accomplished simply by reading a routing socket? Of course, one could use kqueue(2), libevent, or whatever to get event-driven notification of routing socket updates. That is exactly what I do at work since before EVFILT_NETDEV was added. As far as I can tell, the only advantage EVFILT_NETDEV has is that you don't have to weed through routing messages to get the interface messages. But using a routing socket has the advantage of being more portable. Kelly -- Kelly Yancey - kbyanc@{posi.net,FreeBSD.org} - kelly@nttmcl.com FreeBSD, The Power To Serve: http://www.freebsd.org/