Ask Your Question

Revision history [back]

As you have declared the field as FT_UINT8 the field will be displayed and filtered as an unsigned integer.

To have the field displayed as a string, declare a field as a string (FT_STRING) and use proto_tree_add_string() setting the last parameter (value) to point to the appropriate strings in your code. Note that the item is then marked as generated to show that the string doesn't exist in the packet, but is generated from other values:

proto_item *pi = proto_tree_add_string(rtcp_stats_tree, hf_EventTypeString, tvb, nOffset, 1, EventType ? "Stop" : "Start");
proto_item_set_generated(pi);

...

{ &hf_EventTypeString, { "Event Type String", "rtcp_stats.event_type_string", FT_STRING, STR_ASCII, NULL, 0x0, NULL, HFILL }  }