Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] proto_add_tree_item versus proto_add_tree_string

From: "Neely Grady-W30566" <grady.neely@xxxxxxxxxxxx>
Date: Tue, 13 Mar 2007 18:53:42 -0400
That works perfectly.  Thanks Guy.

-----Original Message-----
From: wireshark-dev-bounces@xxxxxxxxxxxxx [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On Behalf Of Guy Harris
Sent: Monday, March 12, 2007 8:13 PM
To: Developer support list for Wireshark
Subject: Re: [Wireshark-dev] proto_add_tree_item versus proto_add_tree_string


On Mar 12, 2007, at 5:46 PM, Neely Grady-W30566 wrote:

> I built a function called tvb_get_bits8 based on some work someone  
> else has done, and it handles incrementing the tvb offset and  
> grabbing the bits I want, even if the straddle byte boundaries.   
> However, this only works if I retrieve the value.  Seems like their  
> ought to be a way to do this without retrieving the value and  
> printing it via a proto_add_text or _string.

There is - retrieving the value and adding it to the tree with  
proto_tree_add_uint().

That way:

	1) it's a registered field;

	2) it's an integral field, not a string;

	3) you don't have to worry about bit masks in the fields.

The fields, in this case, would *not* have bit masks, and would have a  
size that's the size of the field rounded up to the lowest of (8, 16,  
24, 32, 64).
_______________________________________________
Wireshark-dev mailing list
Wireshark-dev@xxxxxxxxxxxxx
http://www.wireshark.org/mailman/listinfo/wireshark-dev