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

Display a version number for Lua dissector?

0

Is it possible to set the version number for a Lua dissector so that is will show up in the Help | About on the Plugins page?

Is there a different mechanism that can be used for Lua dissectors?

Thanks, Frank

asked 19 Jun '15, 09:00

flomby's gravatar image

flomby
6113
accept rate: 0%

There is no such thing available right now (though you can make your own as izopizo points out in the answer), but it's not a bad idea to add such functionality in a future Wireshark. So I've added it to bugs.wireshark.org.

(27 Jun '15, 18:04) Hadriel

2 Answers:

1

example in Lua-script:

local my_info = 
{
    version = "1.0.1",
    author = "Jane Doe",
    description = "this plugin parses rainbows",
    repository = "https://github.com/octocat/Spoon-Knife"
}

set_plugin_info(my_info)

C-code from wirshark source:

WSLUA_FUNCTION wslua_set_plugin_info(lua_State* L) {
55     /*  Set a Lua table with meta-data about the plugin, such as version.
56
57         The passed-in Lua table entries need to be keyed/indexed by the following:
58          * "version" with a string value identifying the plugin version (required)
59          * "description" with a string value describing the plugin (optional)
60          * "author" with a string value of the author's name(s) (optional)
61          * "repository" with a string value of a URL to a repository (optional)
62
63         Not all of the above key entries need to be in the table. The 'version'
64         entry is required, however. The others are not currently used for anything, but
65         might be in the future and thus using them might be useful. Table entries keyed
66         by other strings are ignored, and do not cause an error.

Copy-pasted from: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=blob;f=epan/wslua/wslua_util.c;h=4175c0f170fd3ed87392e0dc6a9df200803f610a;hb=23163520ad2a96aa9c22ebae8f3fcc91e93d2461

which in turn is from: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=23163520ad2a96aa9c22ebae8f3fcc91e93d2461

answered 03 May ‘16, 03:44

KamratKalasson's gravatar image

KamratKalasson
213
accept rate: 0%

0

I'd suggest installing and checking out cloudshark wireshark plugin (written in lua)

https://support.cloudshark.org/wireshark-plugin/using-the-wireshark-plugin.html

And then when you have it installed have a look at their source code.

They've added their own menu, preferences settings and their own about window.

answered 19 Jun '15, 09:04

izopizo's gravatar image

izopizo
2024714
accept rate: 0%

edited 19 Jun '15, 09:04

and their own about window

But they should also do what @KamratKalasson suggested, so that the plugin's version number etc. show up in Wireshark's About window. I'll look at fixing that and making a pull request.

(03 May '16, 15:48) Guy Harris ♦♦