Wireshark-dev: Re: [Wireshark-dev] filtering not working
From: Brian Oleksa <oleksab@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 26 Jan 2010 10:23:43 -0500
Stig

Yes.... that did work.

But now I am confused. I am trying to fix up my code to adhere to the wireshark coding standards. I thought that if you had a string that you have to use ( proto_tree_add_string )..??

Here is another example (which filtering does not work).

{ &hf_helen_sequence_num,
{ "Sequence Number", "helen.sequenceNumber", FT_UINT32, BASE_DEC, NULL, 0x0,
        "Sequence Number", HFILL}},

guint32 seq;
seq = tvb_get_ntohl(tvb,offset);

proto_tree_add_uint_format(helen_sub_tree, hf_helen_sequence_num, tvb, offset, 4, 0,
        "Sequence #: %d", seq);

To get this to work....are you telling me that I need to change it to:

proto_tree_add_item(helen_sub_tree, hf_helen_sequence_num, tvb, offset, 4, FALSE);

Looks like I have to change all of my ( proto_tree_add ) routines for filtering to work correctly..??

Thanks,
Brian




Stig Bjørlykke wrote:
On Tue, Jan 26, 2010 at 3:58 PM, Brian Oleksa
<oleksab@xxxxxxxxxxxxxxxxxxxxxx> wrote:
proto_tree_add_string_format(helen_sub_tree, hf_helen_flowname, tvb,
offset, 8, 0,
      "Flowname: %s", flowname);

You feed proto_tree_add_string_format with value = 0, and a pointer to
NULL will not match "SA_EX" .  Try this:

proto_tree_add_item(helen_sub_tree, hf_helen_flowname, tvb, offset, 8, FALSE);