See <linux/netdevice.h>, in particular, the netdev notification chain information. You can call register_netdevice_notifier()to register a callback that (among many other types of events) will receive events NETDEV_UPand NETDEV_DOWN.
source
share