cwinsock2windows-networking

List of network interface names, using C with Winsock?


In Windows' C API, how can you get a list of network interface names? (Equivalent to getifaddrs() in Linux)

The WSAIoctl(sock, SIO_GET_INTERFACE_LIST_EX, ...) function seems to only return IP addresses, plus a little metadata.


Solution

  • GetAdaptersAddresses() does this.

    Use GetIpAddrTable() if you are interested in IPv4 addresses only.