Wireshark-dev: [Wireshark-dev] Help with adding/displaying a particular type of field to a subt

Date: Thu, 4 Jun 2009 19:50:28 +0000 (UTC)
Group,

I'm having problems trying to figure out how to add/display a particular type field to a subtree.  It seems no matter what I try I keep getting the following error in the Packets Detail windows:

     [Dissector bug, protocol SMART: proto.c:1006: failed assertion "DISSECTOR_ASSERT_NOT_REACHED"]

I've tried to find code examples in other dissectors but I don't know just what type of field most of the dissectors are trying to deal with.  I think I'm just having a mental block about this one!  Any suggestions to get me over this hump will be greatly appreciated!

Field description:

     The protocol contains the length of the field - in my example it's 17 bytes.

     In hex the data in the field looks like:

          50 53 46 00 00 02 00 00 6f 44 63 69 6d 2e 66  6c 65

     (ASCII bytes with NULL bytes embedded within the ASCII bytes)

Code example:

     I have tried a number of different FT types with the same type of "failed assertion" error.

       ...
     { &hf_test,
        { "Field test", "test.test",
            FT_UINT_BYTES, BASE_HEX, NULL, 0x0,         
            "Field test", HFILL}}
     ...
     field_length = 17;
     offset = current_offset;
     proto_tree_add_item(tree, hf_test, tvb, offset, field_length, FALSE);

Should I be using the proto_tree_add_item() call for displaying?  If so, which FT type would be appropriate?

Many thanks,

Frank Schorr
     ..