[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?
- To: Isaac Aaron <iaaron(at-nospam)internet-zahav.net>
- Subject: Re: Q:How can I determine if an if is up in C/C++ only?
- From: mulix <mulix(at-nospam)actcom.co.il>
- Date: Thu, 14 Dec 2000 20:53:01 +0200
- CC: linux-il(at-nospam)linux.org.il
- Delivered-To: linux.org.il-linux-il@linux.org.il
- References: <3A387F45.1A9F2C0B@internet-zahav.net>
- Sender: mulix(at-nospam)lmail.actcom.co.il
- Sender: linux-il-bounce(at-nospam)cs.huji.ac.il
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