SIOCGIFMEDIA problems
Kelly Yancey
kbyanc at posi.net
Mon May 16 15:46:40 PDT 2005
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 at nttmcl.com
FreeBSD, The Power To Serve: http://www.freebsd.org/
More information about the freebsd-net
mailing list