Ethereal-dev: Re: [ethereal-dev] IIOP dissector

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: Sat, 26 Aug 2000 19:30:21 -0700
> When FT_STRINGZ is done, proto_tree_add_item() will search for a
> terminating NUL in the tvbuff, up to a maximum length that is passed in
> by you as the length parameter, and use the string if it finds the
> terminating NUL.

Should a dissector that uses "proto_tree_add_item()" to add an
FT_STRINGZ item find out how many bytes the NUL-terminated string takes
(including the NUL, if any), so that it can advance an offset variable,
by using "proto_item_get_len()" after adding the item?

(Note that the protocol tree tvbuff cursor stuff in "ptvcursor.c" can do
this for you; a ptvcursor has a pointer to a protocol tree, a pointer to
a tvbuff, and an offset, and "ptvcursor_add()" adds an item, whose data
is at the current offset in the ptvcursor and whose length, byte order,
and field handle are specified in the call, to the protocol tree, and
advances the offset for you.)