Re: [OxLUG] List network interfaces and find their address/n…

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Bob Dunlop
Date:  
To: Oxfordshire Linux User Group Discussion List
Subject: Re: [OxLUG] List network interfaces and find their address/netmask in C
On Thu, Oct 15 at 11:54, Chris Wareham wrote:
> I don't have my copy of the Stevens network programming book to hand,
> but I need to write a C program to list all the network devices on a
> Linux machine, and then query them for IP address and netmask. A few
> function names to set me off down the right path would be greatly
> appreciated!


man getifaddrs

The manpage even includes your program as a worked example.

-- 
        Bob Dunlop