ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: [Wireshark-dev] dissector/decoder and value strings

From: Bill Fassler <bill.fassler@xxxxxxxxx>
Date: Wed, 28 Feb 2007 11:44:00 -0800 (PST)
I was just modifying a dissector plugin that I wrote a few months back and am having some problems where I least expected them. Since this is similar to what I already have working I am perplexed.  Here is a value string that is not printing out in the dissection.  Can anyone see a reason?

1) As you can see the value string data is not in numerical order per se, does it have to be? (if so, then I'm screwed)

2)Also this is the only value string where I directly insert the hex number, could this
be the problem?

(snippets of only the suspect code...)

static int hf_tx_gain             = -1;

static const value_string legerity_tx_gain[] = {
    {0x0000,      "14  dB" },
    {0x2000,      "13  dB" },
//blah blah blah
    {0xB1B1,      " 3  dB" },
    {0x3352,      " 2  dB" },

//truncated - .. you get the point
    {0x42F8,      "-40 dB" },
    {     0,           NULL}};

 switch( cmdcode ) {
         case VPPN_COMMAND__SLAC_TX_GAIN:
                 proto_tree_add_item(vppn_tree, hf_tx_gain, tvb, offset, 2, FALSE);
                 break;

    { &hf_tx_gain,
      { "Control Channel Data",
        "vppn.chnl",
        FT_UINT16, BASE_HEX, VALS(legerity_tx_gain), 0x0,
        "Control Channel Data", HFILL }},

Regards,
Bill


TV dinner still cooling?
Check out "Tonight's Picks" on Yahoo! TV.