This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Set the outside file of decoding from GUI configuration

0

I wrote a plugin for my protocol whose decoding depends on a file passed to it from the outside. Can I get that file can be properly set by acting directly on the properties of the plugin from the GUI of Wireshark?

Thank you in advance.

asked 13 May '14, 07:09

Junzo's gravatar image

Junzo
11348
accept rate: 100%


2 Answers:

2

I'm assuming here that you want to set the pathname of the file from the GUI.

If so, you want to register a "filename" preference, which is a string preference that also supports a "Browse" button, allowing the user to browse the file system through the GUI. See, for example, epan/dissectors/packet-kerberos.c, which registers a "filename" preference using prefs_register_filename_preference().

answered 14 May '14, 15:24

Guy%20Harris's gravatar image

Guy Harris ♦♦
17.4k335196
accept rate: 19%

Two questions:

Is the correct call every time the function of reading the string from the preferences by entering the function call in "dissect_myProto" or is there a way to invoke it only when the preference is changed?

How do I delete the preference, and then deallocate the string corresponding to the fie, when I close my wireshark?

(15 May '14, 03:29) Junzo

0

The TPNCP dissector does something similar. Use a text entry for your file.

answered 13 May '14, 23:30

Jaap's gravatar image

Jaap ♦
11.7k16101
accept rate: 14%