What do the "interface names" of Windows look like?

There is a function called if_nametoindex () that converts the interface name to an interface index. This feature is available for Linux and Windows. On Linux, I assume that these interface names may look like "eth0" or "wlan0".

My question is: what do the Win32 interface names look like? And are there any calls that allow me to query which interface names are available?

+6
source share
3 answers

There is also if_indextoname . I have added the result below. This name style (e.g. loopback_0 ) is not a Win32 interface name. I assume that these names exist only for compatibility with rfc2553. Win32 actually uses interface names, for example \DEVICE\TCPIP_{846EE342-7039-11DE-9D20-806E6F6E6963} .

To list all the interfaces, you need to use GetIfTable and friends. if_nameindex not supported.

 loopback_0 tunnel_0 tunnel_2 tunnel_3 ppp_0 ethernet_0 ethernet_1 ethernet_4 ppp_1 wireless_0 ethernet_9 tunnel_4 tunnel_1 tunnel_7 tunnel_8 wireless_5 tunnel_5 tunnel_9 tunnel_10 tunnel_6 wireless_1 wireless_2 ethernet_2 ethernet_3 ethernet_5 ethernet_6 ethernet_7 wireless_3 wireless_4 wireless_6 wireless_7 wireless_8 
+5
source

They look like \Device\NPF_{506B4345-1FC0-43F4-BFCF-4FFAD7739AFF} . I don't know if there is a more direct way to get a list of interfaces, but I got this from wirehark, which uses winpcap ,

+2
source

getmac will list them on the windows command line

0
source

Source: https://habr.com/ru/post/906704/


All Articles