Ethereal-dev: Re: [ethereal-dev] Added "proto_tree_add_notext()" and "proto_item_set_text()"

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: Fri, 21 Jan 2000 21:50:19 -0800
> 	"proto_item_set_text()" - lets you set the text for an item, by
> 	passing a format string and arguments for that string.

I used that to put, in the protocol tree items for NFS READDIR and
READDIRPLUS entries, the file name from the entry (and, for V2 READDIR,
the file ID; it should perhaps be added for V3 as well).

This involved adding an extra "char **" argument to
"dissect_rpc_string()"; if non-null, a pointer to the displayed version
of the string is returned (which should ultimately be freed by the
routine higher up the call tree that uses it), otherwise it's freed, as
always.

This might be useful in other RPC protocols.

(It's often useful to put, in interior nodes of the protocol tree, a
summary of the items underneath it, giving the most important bits of
data; that way, you may not have to open all the interior nodes to know,
in general, what's under them, and can perhaps thus open only the ones
of interest.)