Ethereal-dev: Re: [ethereal-dev] Getting rid of "proto_tree_add_item()"?

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: Sun, 14 May 2000 11:23:33 -0700
On Sun, May 14, 2000 at 10:36:54AM -0700, Guy Harris wrote:
> I suspect we should do the same for "proto_tree_add_item()" and
> "proto_tree_add_item_hidden()" - especially given that we're already
> changing all the dissectors anyway to handle tvbuffs - and I suspect
> we'll catch a number of bugs by doing so.

An alternative would be to make "proto_tree_add_item()" and
"proto_tree_add_item_hidden()" not take the value to be added as an
argument - just have it extract the value from the frame *itself*, based
on the offset and length supplied, and the type of the item - as per
suggestions I'd made elsewhere.

They should use the tvbuff calls to extract data from the frame, as
that'd automatically tvbuffify a lot of the dissection code.

(There are probably places where a value not directly extracted from the
frame is passed to "proto_tree_add_item()" or
"proto_tree_add_item_hidden()"; in those cases, we'd introduce
"proto_tree_add_item_<type>()" or "proto_tree_add_item_hidden_<type>()"
calls, as per my previous message, and use them.)