2

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.

Community
  • 1
  • 1
OJW
  • 4,514
  • 6
  • 40
  • 48

1 Answers1

7

GetAdaptersAddresses() does this.

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

alk
  • 69,737
  • 10
  • 105
  • 255