Didier Verna wrote:
Glynn> There isn't a system address; addresses are associated
with individual
Glynn> network interfaces. `(interface-address IFNAME)' would be more
Glynn> meaningful.
Or a list of these maybe? At first I thought we could use the call to
gethostbyname already done in init_system_name, but it doesn't give you
information on the interface names, right ?
Right. And it will only give you what's listed in the DNS (or NIS,
/etc/hosts etc). It's conceivable that a host has addresses which
aren't listed in any of these.
Maybe we should just use the output of ifconfig ? (that's what
ipconfig does in net-utils, I think).
How standard is the format of ifconfig's output? OTOH, does anyone
know how standard the SIOCGIFCONF and SIOCGIFADDR ioctl()s are?
Also, what about IPv6 addresses (or even IPX, DECnet, AppleTalk, ...)?
--
Glynn Clements <glynn(a)sensei.co.uk>