Wireshark-dev: [Wireshark-dev] Field type for 96 bit integer?
From: David Arnold <davida@xxxxxxxxx>
Date: Wed, 20 Jul 2016 17:56:58 +1000
I’m writing a dissector for a protocol that includes a 96 bit (12 byte) big-endian integer value.

I’d like to display it as a decimal number.  I’m happy to write a BASE_CUSTOM renderer for it, but how should it be described in the hf_register_info array?

In my dissect() function, I have

            proto_tree_add_item(ouch_asx_tree,
                                hf_ouch_asx_match_id,
                                tvb, offset, 12,
                                ENC_BIG_ENDIAN);
            offset += 12;

In the hf_register_info array, I’d have something like

        { &hf_ouch_asx_match_id,
          { "Match ID", "ouch_asx.match_id",
            FT_BYTES, BASE_CUSTOM, CF_FUNC(format_match_id), 0x0, NULL, HFILL }},

except that generates a runtime error:

        Err  Field 'Match ID' (ouch-asx.match_id) has a 'strings' value but is of type FT_BYTES (which is not allowed to have strings)

Quick hint, someone?

Thanks in advance,




d

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail