Ask Your Question
0

Add custom option to toolbar in wireshark GUI

asked 2018-02-09 12:57:03 +0000

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

I want to create a custom plugin which gets displayed on the tool bar in wireshark GUI. When the user clicks on the new custom option, then the custom lua script should be executed.

How can I achieve this?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2018-03-26 01:15:40 +0000

MarkoPaul0 gravatar image

updated 2018-03-31 03:18:38 +0000

Assuming I understand your question, this should not be too difficult. Here you go:

In your plugin Lua file (which you should make sure Wireshark loads), start by adding a function which does the job your plugin should do:

local function runPlugin()
    --here your plugin does its thing
end

Then you register the runPlugin function to be launched from the Wireshark toolbar:

register_menu("Lua/Launch my plugin", launhing_function, MENU_TOOLS_UNSORTED);

Now when you open Wireshark and click on Tools > Lua > Launch my plugin the runPlugin() function is called.

Hope this helps!

edit flag offensive delete link more
0

answered 2018-03-26 02:38:04 +0000

Guy Harris gravatar image

There's currently no mechanism to allow plugins to register toolbar icons; at best, you can, as noted, register items to be available in a menu item.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-02-09 12:57:03 +0000

Seen: 674 times

Last updated: Mar 31 '18