ref: b54d8791c77a5c24a79e4a482c26de32756e21fa enie/README.md -rw-r--r-- 1.3 KiB
b54d8791 — mycognosist Modify Rationale 1 year, 8 months ago


Emit Network Interface Events (ENIE).

enie utilises RTNETLINK to subscribe to network interface state-change events from the kernel. Events matching the user-specified interface (for example, wlan0) are printed to stdout, allowing enie to be coupled with other systems.



gcc enie.c -o enie


./enie wlan0


Events are prefixed by an integer denoting event type and followed by the interface name and any other relevant variables (ie. state or IP address).


 0 - UP
 1 - DOWN
 2 - IP_ADD
 3 - IP_DEL


0_wlan0_UP_RUNNING or 0_wlan0_UP_NOT_RUNNING 1_wlan0 2_wlan0_192.168.1.12 3_wlan0


I've been thinking about network interface state and the most efficient way to access and share it. This is my attempt at experimentation with a push-based system, as well as a means of gaining deeper understanding of the Linux kernel and subsystems.