Ethereal-dev: Re: [Ethereal-dev] getting data from subdissectors

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

From: Ed Warnicke <hagbard@xxxxxxxxxxxxxxxxxxx>
Date: 15 Dec 2001 23:38:50 -0500
Hmm... how expensive is generating a protocol tree...  many dissectors 
parse most of the packet data anyway to either build their column info 
or to generate conversations or decide how to call subdissectors.  Given
that, how much more work is it to construct the protocol tree?

Ed
On Sat, 2001-12-15 at 16:48, Guy Harris wrote:
> On Sat, Dec 15, 2001 at 03:43:31PM -0500, Ed Warnicke wrote:
> > I'm trying to augment the MGCP dissector to create appropriate
> > conversations for the RTP streams created and destroyed by MGCP 
> > signalling.  
> > 
> > My problem is that MGCP uses SDP to encode the actual descriptions of 
> > the rtp sessions to be created or destroyed, but the information
> > about whether we are creating, destroying, or just redundantly
> > mentioning an rtp session is coded in the MGCP message.  
> > 
> > As a result the conversation must be set up in the MGCP dissector 
> > based on the results of running the SDP dissector.  
> 
> Or, if the MGCP dissector has the information necessary to indicate
> whether the SDP dissector should create the conversation by the time it
> calls the SDP dissector, the SDP dissector could get that information
> from the dissector that calls it.
> 
> > My initial instinct is to query the proto_tree from the mgcp dissector
> > after having run the SDP dissector to make any decisions about setting 
> > up the RTP conversations.  Is this really the correct way to go about
> > it?
> 
> No, because there's no guarantee that, on the first pass through the
> packets, when the capture file is being read in, there *is* a protocol
> tree.  (Generating a protocol tree takes work, so we do *not* do it on
> the first pass unless we need to.)
> 
> An alternative is to use "pinfo->private_data" to communicate
> information out-of-band between the MGCP and SDP dissectors.
> 
> As the SDP dissector has many callers, I'd be inclined to make
> "pinfo->private_data" point to a data structure defined by the SDP
> dissector, and:
> 
> 	have the MGCP dissector declare such a structure, and set
> 	"pinfo->private_data" to point to it;
> 
> 	have other dissectors that call the SDP dissector either do so
> 	as well, or just set "pinfo->private_data" to NULL;
> 
> 	have the SDP dissector fill in that structure if
> 	"pinfo->private_data" is non-null.
> 
> _______________________________________________
> Ethereal-dev mailing list
> Ethereal-dev@xxxxxxxxxxxx
> http://www.ethereal.com/mailman/listinfo/ethereal-dev

Attachment: pgpvL0COosFOh.pgp
Description: PGP signature