I would like to produce a list of all the interfaces available on a [Linux] system, and for each interface, produce a list of available IP addresses. I was hoping to do this in a more graceful fashion than parsing the output of the
ip command while still avoiding the hassle of
ioctl() and friends.
/sys/class/net/INTERFACE contains link-level addressing information (such as the interface MAC address), it does not contain any ip addressing information. Nor do any of the files in
/proc contain this information.
Before I go off and make my Python code look a lot more like C, are there better tools for this? Something like
ip that produces structured output would be nice.