简体   繁体   中英

How can I get the MAC/IP address of a packet device in pcap.net/SharpPcap?

I'm using the PacketDevice or LivePacketDevce in order to send and receive packets. I have 2 network interfaces that I have to use and I can't find an attribute of Packet Device that has it's MAC or IP address. It's a problem using the destination of incoming packets as I am relying on arp broadcasts. Is there any way to get the IP or MAC addresss of a packet device in pcap.net or using SharpPacap? thanks

ICaptureDevice.MacAddress应该为您提供适配器的mac地址,因此您的活动设备的MacAddress属性为。

Pcap.Net中 ,有一个扩展方法:

public static MacAddress GetMacAddress(this LivePacketDevice livePacketDevice)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM