我正在使用Sharp Pcap捕获数据包,我可以轻松检查IP包或IP数据包的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的源/目标地址?
答案 0 :(得分:0)
ICMP数据包是IP数据包的一部分,因此要获取ICMPPacket的源IP,您必须获取IP数据包的源地址,然后检查它是否是ICMPPacket