Ethereal-dev: Re: [ethereal-dev] Ethereal dissector developers notes

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

From: Laurent Deniel <deniel@xxxxxxxxxxx>
Date: Mon, 11 Oct 1999 20:29:05 +0200
Jeff Foster wrote:

> /* Add your subtree for detail display */
> 
> /* Add the first item for your subtree*/
>         proto_tree_add_text( local_tree, offset, 2, "Op code: %u (%s)",
> Temp16,
>         ( Temp16 == 1 ? "Write Mail slot" : "Unknown"));
> 

Try to use the other proto_tree_add_xxx routines (e.g. proto_tree_add_item
and proto_tree_add_item_format) which enable the use of display filters
instead of proto_tree_add_text.

See <ethereal>/doc/proto_tree for more information.

> Registering the protocol  -
> 
> Add a static int in your code -
>         proto_MY_PROTOCOL = -1;
> 
> Add a routine in your code that is a call to protocol_register
> 
>         void proto_register_MY_PROTOCOL( void) {
> 
>                  proto_MY_PROTOCOL = proto_register_protocol( NAME,
> ABBREVIATION);
>         }

And do not forget to register your fields, if you use the above mentioned
routines with the proto_register_field_array routine.

--
Laurent DENIEL        | E-mail: deniel@xxxxxxxxxxx
Paris, FRANCE         |         laurent.deniel@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
                      | WWW   : http://www.worldnet.fr/~deniel
    All above opinions are personal, unless stated otherwise.