On Wed, 19 Nov 2003 01:25:06 -0800
Ben Greear <greearb@xxxxxxxxxxxxxxx> wrote:
Is there a method already written that will tell me if an IP exists on
a netdevice?
If not, I am quite sure the answer lies in the in_ifaddr
list, but which field holds the IP address for the device?
Call getifaddrs(), walk the list finding the each and every list entry
with the 'ifa_name' name matching the device you want. If there are
multiple addresses attached to an interface there will be multiple
in_ifaddr list entries with the 'ifa_name' of your interface.
In each of those entry, check the sockaddr pointed to by the 'ifa_addr'
field.