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: Wed, 10 May 2000 22:55:35 -0700
> For a sequential accessor to work, you'd really want to combine
> the proto_tree and tvbuff routines (Guy, this is your cue...)
> so that the proto_tree routines do the data extraction from the tvbuff for
> you.

He's referring to something I've prototyped (emphasis on "prototype" -
it's a quick proof-of-concept hack right now), wherein there'd be a
routine which adds an item to the protocol tree *without* being passed
the value for the item - instead, it'd be handed a pointer to the packet
data, or, in Gilbert's new scheme, a pointer to the tvbuff, and use
that, as well as the offset and length, and the type of the item, to
figure out what it needs to do to extract the data from the packet, and
would extract it for you.

(In at least some protocols - X11 and DCE RPC, for example, I think -
it'd have to be told explicitly what the byte order of the data is, as,
if I remember correctly, neither of those protocols use a standard byte
order.  We could add the byte order as a flag to the header field info
structure (or to one of the fields in that structure), and obviate the
need to pass it in most cases.)

There would, I think, still need to be routines to add values supplied
by the dissector, as I think there are some cases where the dissector
doesn't put into the tree a value directly extracted from the packet -
it modifies that value in some cases - and there would definitely still
need to be routines to extract data without adding it to the tree, for
example for fields whose value affects how the dissector handles other
stuff in the packet.