문제

I'm trying to send a raw UDP packet with Packet.Net but the device.SendPacket() function only seems to accept link level PDUs which means I have to figure out the source and destination MAC addresses myself. (Using ARP or something)

How can I create an IP packet with Packet.Net but have the correct Ethernet frame generated for me?

도움이 되었습니까?

해결책

You'll have to know the destination mac address. As you suggested the best approach is to use arp to discover the mac address. The source address you can get from the adapter itself. There are examples for both arp and building packets in the source releases of sharppcap and packet.net.

Chris

Author of sharppcap/packet.net

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top