Ethereal-dev: Re: [Ethereal-dev] Dissecting with variable length fields

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

From: Kees Cook <kees@xxxxxxxxxxx>
Date: Fri, 26 May 2006 15:38:41 -0700
On Fri, May 26, 2006 at 03:31:58PM -0700, Stephen Fisher wrote:
> I am writing a new dissector for the exec/rexec protocol and am new to 
> Ethereal development.  What is the best way to dissect a protocol whose 
> fields are variable length null terminated strings?

tvb_get_stringz() works great for this.  See doc/README.developer:

guint8 *tvb_get_stringz(tvbuff_t *tvb, gint offset, gint *lengthp);
guint8 *tvb_get_ephemeral_stringz(tvbuff_t *tvb, gint offset, gint *lengthp);

-- 
Kees Cook                                            @outflux.net
_______________________________________________
Ethereal-dev mailing list
Ethereal-dev@xxxxxxxxxxxx
http://www.ethereal.com/mailman/listinfo/ethereal-dev