Pregunta

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?

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top