Ethereal

Re: [ethereal-dev] plugins support
Google
 
Web Ethereal.com

Home | Introduction | Documentation | Lists | FAQ | Development | Wiki | Bugs

Ethereal-dev: November 1999


> > Dynamically allocating ETT_xxx values would not only be good for
> > plugins, it'd be good for compiled-in dissectors - it'd obviate the need
> > to add ETT_xxx values to "packet.h" if you add a new protocol with
> > subtrees, or add a new subtree to an existing protocol.
> 
> Well, I now have some code that does that.

Checked in.

To add a new subtree type, just add a

	static gint ett_hello_sailor = -1;

at the beginning of your dissector (if there isn't already a list of
them there, add it after the "proto_" and "hf_" values), and add a
pointer to it to the "ett" array in the appropriate "register" routine. 
(Most if not all "packet-*.c" files already register subtree types; copy
the code in an existing one if the code isn't in your "packet-*.c"
file.)  It's no longer necessary to add it to a list in "packet.h" (the
list isn't in "packet.h" any more).

This should also allow dynamically-loaded "plugin" dissectors to
register their own subtree types.


Powered by MHonArc 2.6.10