You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Packet packet = Packet.ParsePacket( LinkLayers.Ethernet, raw_capture.Data ) ;
Debug.Assert( packet is EthernetPacket ) ; // OK.
Debug.Assert( packet.PayloadPacket is IPv4Packet ) ; // OK
Debug.Assert( packet.PayloadPacket.ParentPacket != null ) ; // Nop. it is always null.
In my thought, packet.PayloadPacket should be IPv4Packet, and packet.PayloadPacket.ParentPacket must be packet itself. Isn't it?
But, in my code, packet.PayloadPacket is IPv4Packet, but packet.PayloadPacket.ParentPacket is always null.
It is null even I try with ARP packet.
What should I do or check?
My PacketDotNet is downloaded from nuget.org and its version is v1.1.1.
The text was updated successfully, but these errors were encountered:
Is there a strong reason you want to do this? Just not sure the rationale here. I tested it as well, and see the same behavior that you see.
For example, when I work with UdpPacket, I will create List<UdpPacket>. I don't want create List<Packet>, because Packet.Extract() must be used whenever I need to access UdpPacket.
In this situation, UdpPacket.ParentPacket and/or UdpPacket.ParentPacket.ParentPacket is null. So I cannot get IpPacket or EthernetPacket from UdpPacket to find source ip or mac address.
Hello?
When I try to parse udp packet like this:
In my thought, packet.PayloadPacket should be IPv4Packet, and packet.PayloadPacket.ParentPacket must be packet itself. Isn't it?
But, in my code, packet.PayloadPacket is IPv4Packet, but packet.PayloadPacket.ParentPacket is always null.
It is null even I try with ARP packet.
What should I do or check?
My PacketDotNet is downloaded from nuget.org and its version is v1.1.1.
The text was updated successfully, but these errors were encountered: