I don't want to use the ifconfig
because the output is not same in all distros: I want a consistent way to find the IP address of all the interfaces.
I was planning to get the interface name by parsing the /proc/net/dev
and then using interface name to find the IP address using the siocgifconf ioctl found here . But that too is said, not to work on all version of Linux.
I'm looking something that doesn't use any non-default Python libraries like netifaces
. And the ioctl is said not to work in all the versions of Linux.