Wireshark-dev: Re: [Wireshark-dev] Disectors & conversations

From: "Cook, Timothy" <tcook@xxxxxxxxxxxxxxxxxx>
Date: Thu, 22 Jun 2006 15:03:26 -0400
Title: Re: [Wireshark-dev] Disectors & conversations
For the most part, directly from the README.developer!!
 

/* create display subtree for the protocol */
ti = proto_tree_add_item(tree, proto_cwrio, tvb, 0, -1, FALSE);

cwrio_tree =
proto_item_add_subtree(ti, ett_cwrio);

/* add an item to the subtree, see section 1.6 for more information */

proto_tree_add_item(cwrio_tree,
hf_cwrio_MsgType, tvb, offset,
1, FALSE);

proto_tree_add_item(cwrio_tree,
hf_cwrio_MsgHdrSize, tvb, offset+
1, 1, FALSE);

proto_tree_add_item(cwrio_tree,

-Tim



From: wireshark-dev-bounces@xxxxxxxxxxxxx [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On Behalf Of Kukosa, Tomas
Sent: Thursday, June 22, 2006 2:04 PM
To: Developer support list for Wireshark
Subject: RE: [Wireshark-dev] Disectors & conversations

It is strange. I have no clue where the number in parenthese goes from.
How does the code arround proto_tree_add_item() look like?


Od: wireshark-dev-bounces@xxxxxxxxxxxxx za uživatele Cook, Timothy
Odesláno: čt 22.6.2006 19:11
Komu: Developer support list for Wireshark
Předmět: Re: [Wireshark-dev] Disectors & conversations

That was my assumption!  I've included the fragment of the array for the value in question.  Refer to the attached Wireshark decode.

static hf_register_info hf[] = {
{ &hf_cwrio_MsgType,
{ "Message Type", "cwrio.MsgType"
,FT_INT8, BASE_HEX, NULL, 0x0,
"CW Host aligns even # of bytes", HFILL }

},

-Tim



From: wireshark-dev-bounces@xxxxxxxxxxxxx [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On Behalf Of Kukosa, Tomas
Sent: Thursday, June 22, 2006 12:52 PM
To: Developer support list for Wireshark
Subject: RE: [Wireshark-dev] Disectors & conversations

It seems you use BASE_HEX_DEC for the field. If you use BASE_HEX it shoudl disply only hexadecimal variant.
 


Od: wireshark-dev-bounces@xxxxxxxxxxxxx za uživatele Cook, Timothy
Odesláno: čt 22.6.2006 17:05
Komu: Developer support list for Wireshark
Předmět: Re: [Wireshark-dev] Disectors & conversations

Thanks for the info.

I have yet another question.

Using the routine proto_tree_add_item() to add a signed value to the
Protocol tree displays the value in HEX (as expected) & a decimal value
in parens.  How can I prevent the decimal value from being displayed?

-Tim


 

<SNIP>