Do an strace on ifconfig to see how it does it. My guess there is three options 1. Read from /proc/net/dev 2. Use the ioctl interface used by ifconfig 3. Use netlink as used by the iproute tools These's documentation on each of these, look it up. On Mon, Sep 13, 2004 at 05:37:32PM +0530, vijay kalkoti wrote: > Hi all, > > How to find different network interfaces present in the system, using > a C program (Not by ifconfig shell command). > > And also how to find which protocol (IPv4 or IPv6), is supporting the interface. > > Thanks & Regards > vijayck > - > : 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 -- Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/ > Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a > tool for doing 5% of the work and then sitting around waiting for someone > else to do the other 95% so you can sue them.
Attachment:
pgpnqouMUh0EA.pgp
Description: PGP signature