1 | initial version |
But i display it as a string with the function proto_tree_add_uint_format_value
Don't do that.
Instead, display it as a string and a number by doing
static const value_string event_type_vals[] = {
{ 0, "Start" },
{ 1, "Stop" },
{ 0, NULL },
};
...
{ &hf_EventType,
{ "Event Type", "rtcp_stats.event_type", FT_UINT8, BASE_DEC,
VALS(event_type_vals), 0x0, NULL, HFILL } }
and just add it to the protocol tree with
proto_tree_add_item(rtcp_stats_tree, hf_EventType, tvb,
nOffset, 1, ENC_NA);
and let the Wireshark dissector core do the work of showing it as a string for you.
That will also allow doing
rtcp_stats.event_type=="Start"
in a packet-matching expression.