Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
537 views
in Technique[技术] by (71.8m points)

winsock2 - 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

GetAdaptersAddresses() does this.

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...