SL Baur <steve(a)xemacs.org> writes:
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.
'netstat -i' is much more uniform across platforms. I used this in our
perl admin tool for our server before just giving up and using C and
ioctls, etc.
-bp