Ethereal-dev: Re: [ethereal-dev] Adding an item to the tree without a data pane length

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

From: Guy Harris <guy@xxxxxxxxxx>
Date: Tue, 3 Oct 2000 16:18:04 -0700 (PDT)
> I would like to add the item, as it seems I cannot build a tree and then
> add it to the protocol tree, and then go back and add the length of the
> data it refers to ...

Yes, you can.  Set the length to 0, initially, and then use
"proto_item_set_len()".

See also "proto_item_set_text()", which is useful if the subtree header
is to contain a summary of the items in that subtree; you initially
create the item with "proto_tree_add_notext()", and then set the text
later.  (Make sure you *always* set the text.)

See "packet_dns()" for some examples of how those are used.