Ethereal-dev: [Ethereal-dev] Re: problem in protocol item tree header field display

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

From: "Ravi Kondamuru" <ravikondamuru@xxxxxxxxx>
Date: Sat, 20 May 2006 00:19:57 -0700
Further investigation is showing me that the following are the values in hfinfo:
1. hfinfo->flags = 1, indicating that it is HIDDEN.
I have no where in my declarations set hf_ns_nicno to be HIDDEN. Is that the default setting or have I not set any flag elsewhere to make it visible?

2. hfinfo->ref_count = 0, making TRY_TO_FAKE_THIS_ITEM macro return without setting value in proto_tree_add_uint(...)
When is the ref_count incremented?

thanks,
Ravi.

On 5/19/06, Ravi Kondamuru <ravikondamuru@xxxxxxxxx> wrote:
Hi,

I am trying to add a new dissector. I am having a problem displaying a header field in the protocol item tree.

ti = proto_tree_add_protocol_format(tree, proto_ns, tvb, 0, 0, "NS");
ns_tree = proto_item_add_subtree(ti, ett_ns);
proto_tree_add_uint(nstree, hf_ns_nicno, tvb, 0, 0, pinfo->pseudo_header->nstr.nicno);

While I can see that nicno has a value 3 while stepping through in gdb; it shows up as 0 in the actual GUI display.

static hf_register_info hf[] = {
                { &hf_ns_nicno, { "Nic", "ns.nicno", FT_UINT8, BASE_DEC,NULL, 0x0, "", HFILL } }
};

I cant figure out why the value 3 is not showing up.

Any help will be much appreciated.

thanks,
Ravi.



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