how can a program get network interface up/down event notifications in Linux
Hi,
I am writing a program on Linux ( kernel 2.4.19). This is a routing protocol written in C. This program needs to know the following things:
1. at program startup it should be able to find out all the up network interfaces, including loopbacks.
2. If a new interface comes up at runtime, somehow this program need to get a notification.
3. If a network intercae goes down, again this program need to get a notification.
I need your help here. Any suggestion how can I go about getting these information. Is there some library or some other entry points to the kernel from where this program can get the information.
I am working alone in the project and plan to release it as OSS. Any help will be greatly appreciated.
Thanks,
Manas
|