Ethereal-dev: RE: [Ethereal-dev] Printing an array of bytes to the tree?

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

From: "Yaniv Kaul" <ykaul@xxxxxxxxxxxxxxxx>
Date: Thu, 15 Aug 2002 09:31:17 +0200
Thanks.

tvb_bytes_to_str() is not documented in doc/README.developer.

> -----Original Message-----
> From: Guy Harris [mailto:guy@xxxxxxxxxx]
> Sent: Mon, August 12, 2002 7:39 PM
> To: Yaniv Kaul
> Cc: Ethereal-Dev@xxxxxxxxxxxx
> Subject: Re: [Ethereal-dev] Printing an array of bytes to the tree?
> 
> 
> On Mon, Aug 12, 2002 at 05:46:12PM +0200, Yaniv Kaul wrote:
> > Is there an intelligent way to print an array of bytes to the tree?
> > I'd like to have something like:
> > 
> > "array: 0x0102030405060708090A"
> 
> If the array of bytes is a named field, just make it a field of type
> FT_BYTES.
> 
> If it's not a named field, and you're putting it into the protocol tree
> with "proto_tree_add_text()", use "tvb_bytes_to_str()".
> 
> Doing one of those won't put a leading "0x" in there, and will just put
> in a "..." after 16 bytes rather than showing ever single byte (16 is
> 1/2 the value of the #define MAX_BYTE_STR_LEN in epan/strutil.c -
> MAX_BYTE_STR_LEN is the number of characters in the display, and each
> byte is shown as 2 hex digits - so it could be increased), but it's the
> type of thing you're asking for .
>