events when (de)associating or when cable is (un)plugged

Suleiman Souhlal refugee at segfaulted.com
Fri Mar 26 15:17:14 PST 2004


Hi,

On Fri, 26 Mar 2004 23:30:46 +0100
Dirk-Willem van Gulik <dirkx at webweaving.org> wrote:

> Looking for suggestions on a 'clean' and generic way to allow for
> notifications when a 802.11 association is made or lost, or when
> a ethernet cable is (un)plugged. I.e.akin to the events 'usbd(8) get
> when you sit on /dev/usb. This is for 5.2.1 or beyond.

I am not too sure about 802.11, but to detect when the ethernet cable is
(un)plugged, you can use kqueue(2) with the EVFILT_NETDEV filter.

Later,
  Suleiman Souhlal


More information about the freebsd-hackers mailing list