Ethereal-dev: Re: [ethereal-dev] plugins support

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

From: Guy Harris <gharris@xxxxxxxxxxxx>
Date: Tue, 16 Nov 1999 03:52:46 -0800
> > 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.