java如何获得wlan mac,获取收到的数据包的ip / mac地址的方法(WLAN --adhoc)

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.

解决方案

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...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值