Ethereal-dev: Re: [Ethereal-dev] tcp_dissect_pdus() doesn't work properly

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

From: Guy Harris <gharris@xxxxxxxxx>
Date: Thu, 20 Apr 2006 00:01:50 -0700
Sofia Altieri wrote:

I'm using tcp_dissect_pdus() to reassemble TCP fragments. It seems to work fine, that is, it shows me:

- my proto packet containing the'link' to its completing TCP fragment.
- It separates those packets not aligned to the TCP frags.

Now, I would like to be shown the reassembled packet. What I do is setting the TCP preference "Allow subdissector to reassemble...." and it *apparently* works because the reassembled tvbuff is *bigger* than expected because it contains the portion of my_proto packet belonging to my next proto packet.

I've enclosed a text file to clear you things up

So TCP1 and TCP2 are TCP segments, with TCP2 being the segment right after TCP1?

And presumably the first packet for your protocol consists of myproto Header1 followed by the data in TCP1 and at the front of TCP2, and the second packet consists of myproto Header2 and the data after that?

If so, then presumably the get_pdu_len routine returns, for the first packet, the length of myproto Header1 *AND* the data following it, and returns, for the second packet, the length of myproto Header2 *AND* the data following it. If not, that's a bug in your dissector; tcp_dissect_pdus() assumes the TCP byte stream is divided into a sequence of PDUs, not a sequence of packet headers mixed with packet data.