Re: Knowing different network interfaces of the system

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

 



On Fri, 17 Sep 2004 12:21:40 +0530
vijay kalkoti <vijayck@gmail.com> wrote:

> Hi all,
> 
> I have 2 queries ;
> 
> 1. How to find out the different network interfaces on the system in a
> C program. ( assuming more than 1 network interfaces are present in
> the system.) i.e, are there any system calls or any mechanism of
> knowing this in a program.
> (NOT BY SHELL COMMAND ifconfig or so.. )

You could also use sysfs and look in /sys/class/net.  There is a library
to do it as well (libsysfs).

> 2. How to know the Layer 3 protocol running on the netowork interface.

Addressing is managed at the Layer 3 protocol. So you really need to look
at info from each protocol and map that to devices.
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux