[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Q:How can I determine if an if is up in C/C++ only?



Isaac Aaron wrote:

> How can I determine if a network interface is up in C/C++ only?

in short, you use various ioctl calls to get the list of interfaces from
the kernel and to get the flags for a specific interface, or you can
parse /proc/net/dev and see if the interface you need appears there. 

to see how it's done, check out the net-tools source package, file
lib/interface.c

> I need something that will give something like what ifconfig does in
> C/C++.

then why not check the ifconfig sources? that's the beauty of open
source.

> Thanks in advance
> Isaac Aaron

-- 
mulix

linux/reboot.h: #define LINUX_REBOOT_MAGIC1 0xfee1dead

=================================================================
To unsubscribe, send mail to linux-il-request@linux.org.il with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail linux-il-request@linux.org.il