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

Reload capture when clicking on a custom Lua menu

1

I've made the example mytap_menu() of https://wiki.wireshark.org/Lua/Taps

  1. I click on the menu and window opens
  2. I reload the capture manually to make the Lua script works

How can I reload the capture directly in the Lua script and have the results directly when clicking on the menu.

asked 12 Oct '16, 03:21

TomLaBaude's gravatar image

TomLaBaude
66171724
accept rate: 66%


One Answer:

1

There seems to be a reload_packets() function according to Wireshark's Lua API Reference manual. Have you tried that?

If you are developing a new Lua dissector, note that the Analyze menu has a Reload Lua Plugins (Ctrl+Shift+L) option that will automatically reload the Lua script and capture file as needed.

answered 16 Oct '16, 13:42

Lekensteyn's gravatar image

Lekensteyn
2.2k3724
accept rate: 30%

2

Try retap_packets() first, if the goal is to run the tap so it can process the packets and display the results; if the tap doesn't actually affect the dissection of packets, that's cheaper, as it doesn't cause a redisplay.

(16 Oct '16, 19:36) Guy Harris ♦♦

Thanks guys, both worked, I'll keep in mind the difference

(16 Oct '16, 20:57) TomLaBaude