Ethereal-dev: Re: [ethereal-dev] Dissector exceptions

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: Thu, 11 May 2000 00:48:23 -0700
> A couple of minutes ago I realized I shot myself in the foot with all
> those ideas I supplied lately. There should also be a way to let 
> dissectors "tell" the proto_tree where some values can be found, instead of
> telling the proto_tree where they should be extracted from. From what I 
> understand the new tvbuff is intended for the latter case right?

Not only that - there are routines to extract the values directly
(which, as I note, is necessary), and there'd still be routines to put
an entry in the protocol tree with a specified offset and length *and* a
specified value, where the routine wouldn't itself extract the value
from the tree (such as "proto_tree_add_item()", although it may be
better to have different "proto_tree_add_XXX()" routines, along the
lines of the "proto_tree_add_XXX_format()" routines, so that the item
value can be passed as a regular argument rather than a "varargs"
argument so that compile-time checking can be done - I think I've seen
some errors that would've been caught by that sort of compile-time
checking; this would also let me name the routine that extracts the
value from the tvbuff *and* add it to the tree just
"proto_tree_add_item()").