Is there any getifaddrs() alternative on HP-UX, Solaris or AIX?

2.2k views Asked by At

I'm trying to implement a application that uses the getifaddrs() function from <ifaddrs.h> across multiple platforms. My goal is to retrieve network interface related info (IP, IPv6, Netmask, Broadcast, Scope, and HWAddress).

I have successfully implemented it on Linux, but it seems that the ifaddrs.h header isn't present on the above platforms (HP-UX, AIX, Solaris).

What is the recommended approach for these platforms?

1

There are 1 answers

1
alanc On BEST ANSWER

Solaris 11 and later have getifaddrs() already in libsocket. For older Solaris releases, see the answer to Solaris: Programmatic interface to ifconfig? here on StackOverflow.