Ethereal-dev: Re: [Ethereal-dev] desegment TCP streams with unknown size

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

From: Peter Johansson <Peter.xc.Johansson@xxxxxxxxxxxx>
Date: Mon, 19 Sep 2005 15:36:42 +0200
Dickson Law wrote:

Hi there I have a need to reassembly muitlple PDUs into something usable for dissection. The trouble is the target protocol does not compute the lenght of the message sent, but only a terminating byte 0x03 is used. I presume I would not be able to using the tcp_dissect_pdus functions as per README.developer but I am having problem understanding the alternative method described.

The code fragment I am trying to use:

      int offset=0;
/* Looking for 0x03*/

       len = tvb_find_guint8(tvb, offset, -1, 0x03);
       fprintf(stderr,"0x03 found at %d\n",len);
                   if ( len = -1 ) {
              /* get 1 more byte*/
               pinfo->desegment_offset = offset;
               pinfo->desegment_len = 1;
               return;
       }


what this gets me is it completely scrambled my dissectors, which has been working fine up till then.


Can anyone help?

thanks

dickson

If this really is the code you tried (and its not just a copy and paste typo) I guess the line "if( len = -1)" will get you into trouble as it always assigns -1 to len and constantly asks for additional data.

/ Peter