windows - Windows "interface names"是什么样子的?

标签 windows winapi networking

有一个名为 if_nametoindex() 的函数可以将接口(interface)名称转换为接口(interface)索引。此功能似乎在 Linux 和 Windows 上可用。在 Linux 上,我想这些接口(interface)名称可能类似于“eth0”或“wlan0”。

我的问题是:Win32 接口(interface)名称是什么样的?是否有任何调用可以让我查询可用的接口(interface)名称?

最佳答案

还有 if_indextoname。我在下面添加了输出。这种名称风格(例如 loopback_0)不是 Win32 接口(interface)名称。我想这些名称的存在只是为了与 rfc2553 兼容。 Win32 实际上使用像 \DEVICE\TCPIP_{846EE342-7039-11DE-9D20-806E6F6E6963} 这样的接口(interface)名称。

要枚举您需要使用GetIfTable 和 friend 的所有接口(interface)。不支持 if_nameindex

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

关于windows - Windows "interface names"是什么样子的?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8978670/

相关文章:

windows - 同一系统上的 64 位和 32 位非托管 dll - 最佳实践?

c++ - 在不移动光标的情况下模拟鼠标点击

c++ - 为什么在 C++ 中我们使用 DWORD 而不是 unsigned int?

python - Pyside 客户端和服务器

c - execvp 的阻塞版本 (windows)

windows - 从服务器备份,文件夹到 ftp 和传递问题

c++ - 为 CustomDraw ListView 设置 EditCtrl 位置

C TCP 套接字 - 获取数据包目标名称

ubuntu - 设置 kubernetes 时端口 6443 连接被拒绝

linux - 部署守护进程的过程和位置