Skip to content

Commit f6a83b3

Browse files
committed
Allow users to access IP/TCP/UDP headers
This will allow users to access packet metadata without needing to parse the "parsedPacket" string, and will also allow them to access the packet data present after the headers for further computation, because the header addresses are now exposed. The IPHeader, TCPHeader, UDPHeader structs have been moved outside PacketFragmentArgs to allow definition of properties with the same name. They have been converted from structs to class to make them into reference types and therefore have the homonymic properties return null if the corresponding header was not successfully parsed by ParsePacket(). I am proposing this change because I need to parse DNS request/response in packets, and it is almost impossible to do it with the current class structure without duplicating the code of FIndIpHeader(), and I think that it's much cleaner to expose the headers themselves rather than just exposing FindIpHeader() and having the users duplicate the parsing logic.
1 parent 24e1fed commit f6a83b3

File tree

1 file changed

+304
-251
lines changed

1 file changed

+304
-251
lines changed

0 commit comments

Comments
 (0)