0

我正在使用 Sharp Pcap 捕获数据包,我可以轻松检查 IPpacket 或 ARP 数据包的 IP:

Dim ip1 As IpPacket = IpPacket.GetEncapsulated(pack)
Dim arp As ARPPacket = ARPPacket.GetEncapsulated(pack)

    If (Not ip1 Is Nothing) Then
        log1.WriteLine("Received IP packet from {0}", ip1.SourceAddress.ToString)
    End If

    If (Not arp Is Nothing) Then
        log1.WriteLine("Received ARP packet from {0}", arp.SenderProtocolAddress.ToString)
    End If

我想找到 ICMPPacket 的属性,但没有运气。如何检查 ICMPPacket 的源/目标地址?

4

1 回答 1

0

ICMP数据包是IP数据包的一部分,因此要获取ICMPPacket的源IP,您必须获取IP数据包的源地址然后检查它是否是ICMPPacket

于 2014-04-23T17:34:41.667 回答