一种获取已接收数据包的ip/mac地址的方法(WLAN --adhoc) [英] a way to get ip /mac address of a received packet(WLAN --adhoc)

查看:473
本文介绍了一种获取已接收数据包的ip/mac地址的方法(WLAN --adhoc)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我必须制作一个mac过滤模块.为此,我需要获取传入请求数据包(WLAN)的mac/ip地址.我必须在Windows中进行编程.有人可以建议我怎么做吗?

我通过研究获得的理解是,要从微型端口驱动程序中获取mac地址,有没有办法直接从应用程序级别获取它?

请帮忙!

在此先感谢.

Hello,
I gotto make a mac filtering module.For this i need to fetch the mac/ip addresses of the incoming request packets(WLAN).I have to program this in windows.Can anyone please suggest me how to go about?

The understanding that i gained through research says to fetch the mac address from the miniport driver,is there a way to get it directly from application level??

Please help!

Thanks in advance.

推荐答案

在应用程序级别没有可靠的方法. Ip位于3级,而MAC位于2级.在驱动程序(或固件)中实现2级.即使您在会话建立时成功获取了MAC地址,也无法保证这是客户端的mac地址. (路由器,网桥将替换其MAC地址).
最好的选择是构建一个筛选器驱动程序.或者,使用WMI查询arp表.
关于IP地址:在当今的大多数家庭网络中,PC都将使用IPV6相互通信(Windows 7中的整个媒体堆栈默认情况下都使用IPV6),因此请做好准备,以使您的IP地址看起来不熟悉.

告诉我们更多有关您正在尝试做的事情.这是针对某个特定应用程序的过滤器吗?在这种情况下,如果特定的应用程序仅绑定到IPV4,则应该没有问题.如果您要构建某种防火墙,则可以使用过滤器驱动程序...
There is no reliable way of doing this at the application level. Ip is on level 3, and MAC is on level 2. Level 2 is implemented in the driver (or in the firmware)). Even if you succeed in getting the MAC address at session establishment, there is no guarantee that this is the mac address of the client. (routers, bridges will substitute their MAC Address).
Your best bet is to build a filter driver. Alternatively, use WMI to query the arp table.
About IP addresses: on most home networks nowadays, PC''s will talk to each other using IPV6 ( the whole media stack in windows 7 uses IPV6 by default) so be prepared that your ip adresses may not look familiar.

Tell us some more on what you''re attempting to do. Is this a filter for one particular application? In that case, if the particular app only binds to IPV4, you should have no trouble. If you''re building some kind of firewall, filter drivers are the way to...


这篇关于一种获取已接收数据包的ip/mac地址的方法(WLAN --adhoc)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆