Ethereal-dev: RE: [Ethereal-dev] Create new tvbuff

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: Mon, 2 Apr 2001 07:55:36 -0500
From: Frank Singleton [mailto:frank.singleton@xxxxxxxxxxxx]
Sent: Monday, April 02, 2001 6:42 AM

......

> Ok, thanks. But I have no src_tvb yet. Remember I am reading data 
> from a file BEFORE I ever receive/parse any packet data. In fact, 
> I wish to decode the few IOR's in a file  in the giop_init() part.
> 
> This way, my data structures are poplulated with IOR info, BEFORE
>I ever decode any packet (or tvbuff). This is a requirement,  if giop
>is to handle stringified IOR's read from file.
>
> How does one handle this case. Is there a  "dummy parent tvbuff" 
> that poor orphan souls like I can attach to :) 


OK,  

1) Create your tvbuffer
2) Call the dissector routines to do the processing
3) Call tvb_free_chain to release the tvbuffer and any that are
	created from it.

You have to be careful where you place this routine.  If you place
it in the proto_register_XXX routine, there is no guarantee that 
the sub-dissectors are registered.  If you place it in the init 
routine, register_init_routine, it will be call when a redissection
takes place.  I don't know it that is really what you want. So,
you may have to add a static flag variable to only process the data
file once during the init routine.


Jeff Foster
jfoste@xxxxxxxxxxxx