如何扫描无线网络并显示所有连接的计算机和设备的列表
我需要构建一个非常类似于“无线网络观察器”的工具(c ++),它是一个小实用程序,可以扫描您的无线网络并显示当前连接到您的网络的所有计算机和设备的列表。 这是现有的工具 http://www.nirsoft.net/utils/wireless_network_watcher.html
我需要知道用于构建此类功能的 win32 sdk 函数是什么:扫描我连接到的无线网络并显示连接到它的所有计算机和设备。
I need to build a tool (c++) very much like "Wireless Network Watcher" which is a small utility that scans your wireless network and displays the list of all computers and devices that are currently connected to your network.
here's the existing tool http://www.nirsoft.net/utils/wireless_network_watcher.html
I need to know what are the win32 sdk functions to use to build this kind of functionality: scan the wireless network I am connected to and display all computers and devices connected to it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
好的,看起来是这样完成的:首先向网络中每个可能的 IP 地址发送一个 ARP 请求数据包(您根据网络掩码和接口 ip 计算它们),对于这一步您可以使用 SendARP 函数。然后,您必须为之前响应的每个 IP 调用 getnameinfo,或者您可以发送 NetBios 请求数据包(端口 137)来检索设备的名称(如果有),或者知道如何响应该请求。
对于某些网络,这可能需要一段时间(非常长的时间)。
ok, it seems is done this way: first sent an ARP request packet to each possible IP address in the network (you calculate them based on the net mask and the interface ip), for this step you can use SendARP functions. Then you have to call getnameinfo for each IP that responded previously, or you can send an NetBios request packet (port 137) to retreive the name of the device, if it has one, or know how to respond to that request.
for some networks this can take awhile (very long time).
结果:
反向查找域名:router.asus.com
192.168.2.1
反向查找域:DESKTOP-CMK0J2S
192.168.2.10
反向查找域:User255
192.168.2.14
result:
Reverse Lookup domain: router.asus.com
192.168.2.1
Reverse Lookup domain: DESKTOP-CMK0J2S
192.168.2.10
Reverse Lookup domain: User255
192.168.2.14
非常模糊的问题,Windows、无线甚至一般网络都没有单一的“查找所有设备”功能。您需要扫描某些服务,如 netbios (139)、UPNP 等。此外,这些都不是特定于无线连接的。
Very vague question, there is no single "find all devices" feature to Windows, wireless or even networking in general. You need to scan fer certain services like netbios (139), UPNP, etc. Also, none of this is specific to wireless conenctions.