Glynn Clements <glynn(a)sensei.co.uk> writes in xemacs-beta(a)xemacs.org:
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.
Right. Getting all the IP#s a host is known by is black magic at
best.
> 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?
It's not. It's changed radically on Linux in the last few months for
that matter. It used to be the default was to list all IP aliases and
now it isn't. There also isn't a standard calling convention for it --
`ifconfig' with no parameters fails with a usage message on DEC OSF
for example.
OTOH, does anyone know how standard the SIOCGIFCONF and SIOCGIFADDR
ioctl()s are?
That might be the best place to start. At least you can detect their
presence or absence with configure.
Also, what about IPv6 addresses (or even IPX, DECnet, AppleTalk,
...)?
IPv6 numbers are a different size. DECnet uses small integers for
node numbers. I don't know about IPX or AppleTalk.