Hi Michael,
> a user just asked how to get the IP address of (any) interface. So I
> found out that we currently have no way to fetch the address anywhere.
>
> /proc/net/dev does not contain any IP addresses.
>
> plugin_ppp uses an ioctl() for PPP stats, but I found nothing about IP
> addresses there.
>
> anyone knows how to (easily) found out such things like addresses, MAC,
> netmask, ... all this things ifconfig reports? (I don't want to solve
> this using an exec 'ifconfig')
The IP-Address (as well as MAC address and other stuff reported by
ifconfig) can be read by using ioctl calls (on a socket file-handle).
To implement that, it would basically need the same code as what Xavier
is working on at the moment for getting wireless stats (Xavier - I
haven't forgotten you, I'll hopefully have some time to go over and test
your new plugin today - I didn't have access to my wireless-testbox in
the last few days).
Shouldn't be too hard to implement, even if the individual IOCTL calls
seem to not be documented terribly well.
Martin
--
You think that's tough? Try herding cats!
|