Parsing Wireshark Capture Files
When trying to parse .pcap files from wireshark, collecting TCP packets. I am attempting to parse these files using the information listed here: https://wiki.wireshark.org/Developmen...
The TCP packets being sent accross have a paramerater state the size of the packet. However, often this size is greater than the wireshark packet header is set on top of each packet. However these packet sizes are much less then the snap len global packet header (which if I understand is the greatest a packet captured could be).
Is there a property of TCP I am not seeing? I don't understand how wireshark could be capturing less than the packet size itself.
What do you mean by "the size of the packet"? The pcap header has two size values, one of which is the size of the link-layer frame on the network, and the other is the number of bytes of the frame that were captured. The latter may be less than the former if the capture was done with a snapshot length less than the size of the frame on the network.
@Guy Harris Okay. I'm probably just misunderstanding it then. So for example, when logging the output of my parser:
Wireshark Incl Size: 1514 Bytes Wireshark Orig Size: 1514 Bytes Snaplen Size (found via .pcap global header): 65535
However, the packets I am parsing.. which I guess would be the TCP packets payload, has its own size in the payload header which is 16244 Bytes. Is it a safe assumption to just assume we should be chaining these TCP Packets together? How would I know my next packet is a TCP packet