ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Ethereal-dev: RE: [Ethereal-dev] Desegmentation atop TCP problem

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Jeff Foster" <jfoste@xxxxxxxxxxxx>
Date: Tue, 31 Aug 2004 16:26:35 -0500
> I have a dissector that is added to handle tcp.port == 14000 which works 
> well until segmented PDUs are received.
> I read section 2.7 "Reassembly/desegmentation" in the README.developer 
> but cannot seem to get it work the way I want.

<text deleted/>

> If the data_length was 3 in the first call to the dissector I return 
> that I want 1 additional byte from offset 3 in the next received tvb. 
> This is probably where I have misunderstood something. The next tvb I 
> receive contains the additional bytes that I requested, but only those. 
> Hence the 3 bytes received the first time are now lost.
> I thought that I should be able to handle the PDU in its entirety. What >
> am I missing?

The pinfo->desegment_offset value is where the next data segment should start.
So the desegment code will skip over the number of bytes indicated in the offset
and give the number of bytes in the length. 

If you want those three bytes on the next call you will have to set the offset
to the beginning of the three byte location. 

This is exactly what I ran into, I wanted to decode the entire PDU in one go so
I set the desegment_offset to 0 and set the desegment_len to tvb_len + 1.

Jeff F>


***
The information in this e-mail is confidential and intended solely for the individual or entity to whom it is addressed.  If you have received this e-mail in error, please notify the sender by return e-mail, delete this e-mail, and refrain from any disclosure or action based on the information.
***