There is a function called if_nametoindex() that converts an interface name into an interface index. This function appears to be available on Linux and Windows. On Linux, I imagine these interface names might look like “eth0” or “wlan0”.
My question is: what do Win32 interface names look like? And are there any calls that let me query what interface names are available?
There’s also
if_indextoname. I’ve added the output below. This style of name (e.g.loopback_0) is not the Win32 interface name. I guess these names only exist for compatibility with rfc2553. Win32 actually uses interface names like\DEVICE\TCPIP_{846EE342-7039-11DE-9D20-806E6F6E6963}.To enumerate all the interfaces you need to use
GetIfTableand friends.if_nameindexis not supported.