Hi, is there a possibility to create / open a message box from my own wireshark plugin? asked 06 Feb '12, 07:41 Nic |
One Answer:
There is a possibility to report an error that, IF your dissector is running in Wireshark, will appear as a message box. If it's running in TShark, it will appear as text on the standard output. The following functions are declared in To report an arbitrary message, call
It takes, as arguments, a printf-style format string and arguments. To report an error from an attempt to open a file, call
It takes, as arguments:
To report an error from an attempt to open a file for reading, call
It takes the pathname of the file and an To report an error from an attempt to open a file for writing, call
It takes the pathname of the file and an answered 06 Feb '12, 09:03 Guy Harris ♦♦ |
Hi Guy,
thank you for your answer. This works fine. But is there a possibility to add a dialog with some labels and checkboxes? I tried to use the GtkWidget but this has errors while compiling.
That's a different question, and the answer to it is "no". We do not, and never will, support GUI functions in dissectors, as dissectors can run in command-line programs or Web servers or....
If you want the user to be able to configure options for a dissector, you can register a dissector preference; a checkbox sounds like a Boolean preference, which will show up in the entry for a dissector in the Preferences dialog box as a checkbox. They can also be set from the command line with the "-o" flag.
It's actually possible to open a dialog from a Lua dissector, but IMO dialogs should be spawned from outside a dissector (or postdissector or tap) to avoid bugs like repeatedly opening a dialog based on a trigger that occurs multiple times in a pcap.
One would hope that people aren't opening dialogs in dissectors to provide an option better implemented as a preference.