I'm programming an offline packets decoding program in C under Windows 7 x86.
I wonder how it is possible to know packet protocol, either if it is UDP or TCP? 
You can know by checking the IP packet header, there is a Protocol field in the packet header that is used to indicate the type of the packet according to its value :
1 is ICMP6 is TCP17 is UDPand so on. More information on this is available on Wikipedia
Edit: Here's the list of all the possible values for that field.
P.S: I'm assuming IPv4 here, I don't know if things are the same with IPv6
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With