cross-platform network interface enumeration

146 views Asked by At

I need to enumerate local network interfaces (IPv4, IPv6), getting their addresses and netmasks. The code which should run both under Linux and newly under Windows (mingw64).

I was looking at getaddrinfo which is somewhat cross-platform (both POSIX and in ws2tcpip.h) but could not obtain the netmask part.

The Linux part currently uses getifaddrs. I am deciding whether to use native APIs (getifaddrs in Linux, GetInterfaceInfo in Windows) or a cross-platform layer.

The code already uses glib/gio heavily: does it have cross-platform layer for network interface enumeration?

0

There are 0 answers