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

Wireshark-dev: Re: [Wireshark-dev] Dissect using val_to_str from external file

From: Bill Meier <wmeier@xxxxxxxxxxx>
Date: Mon, 9 Nov 2015 11:59:53 -0500
On 11/9/2015 10:49 AM, Jo wrote:
Hello,

In my protocol, one TLV is called "proto" and contains the IANA number
of a well-known protocol. How can I display the value together with the
string and using the available data from <epan/ipproto.h>, for example?

I know how to do it via val_to_str() but I am failing on importing the
existing definitions.


See epan/dissectors/packet-rohc for 2 examples of how to access ipproto_val_ext from your dissector. ( from an hf[] array entry or using val_to_str_ext()).