Im refactoring my current dissector by splitting it up in different lua modules. The implemented protocol has multiple subprotocols. Which protocol is decided by a field in the top protocol. I created a lua module for each subprotocol, but I am unable to load the module into the wireshark. the file structure
A module
The line of code to call the module in the main plugin
Other information
How can i load the module? asked 09 Jan '15, 06:21 Maarten edited 09 Jan '15, 06:22 |
2 Answers:
If you're using Wireshark 1.12.0 or newer, then you can create a sub-directory for your module files in the personal plugins directory - let's call that new sub-directory "
answered 09 Jan '15, 10:26 Hadriel |
A bit of a guess but if you are placing two files in plugins directory they both will be executed by lua. I'd maybe try to 1) place second file one directory above in separate directory ie: my_custom_lib 2) then try something like
command in your code in proto.lua answered 09 Jan '15, 06:31 izopizo dofile is not neccesary when it the files are in the wireshark plugin directory. (09 Jan '15, 07:10) Maarten Yes, that's what I was guessing that will happen. Btw if you are looking at packaging there's pretty good example here (09 Jan '15, 08:53) izopizo never thought of doing dofile() somewhere else than in the init.lua file. Great example! (12 Jan '15, 01:30) Maarten |
Confirmed, compiled the source (1.12.3) with the --with-lua options. Prepend path isnt neccesary. Wireshark is able to find the file.