Date: Mon, 16 May 2005 16:49:57 -0700 (PDT) From: Kelly Yancey <kbyanc@posi.net> To: Bruce M Simpson <bms@spc.org> Cc: Sebastien Petit <spe@phear.org> Subject: Re: SIOCGIFMEDIA problems Message-ID: <20050516164614.R68432@gateway.posi.net> In-Reply-To: <20050516123817.GF828@empiric.icir.org> References: <20050513111013.41905e73.spe@phear.org> <m2wtq3cnkz.wl%gnn@neville-neil.com> <20050516094309.GD777@obiwan.tataz.chchile.org> <20050516123817.GF828@empiric.icir.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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/
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050516164614.R68432>