Monday, August 21, 2017

Device managment using netlink and the libnl open source library

The netlink interface into the kernel is useful to get status of the interfaces.  However, netlink can be complicated.  The libnl libraries can make it easier.  It is not short of complications, even when using an abstraction layer like libnl.

I created a set of functions to capture the interface and report changes as they occur.  Also, I show an interface to the uevent mechanism to get device plug and unplug events.

A more powerful utility called udev provides a better solution but I was looking for a minimum implementation without the extra baggage that comes with udev.