Wireshark-dev: Re: [Wireshark-dev] Plugin GUI menu and selected packet
From: Tomáš Kukosa <keksa@xxxxxxxx>
Date: Tue, 21 Jul 2020 18:07:26 +0200

Hi Roland,

thank you for your answer. It looks more difficult than I expected.

I am giving it up for now.

Best regards,

  Tomas

On 19/07/2020 13:39, Roland Knall wrote:
It's tricky. Due to the plugin being in a different execution context from the main application, a direct connection cannot be made. It would have to be a callback, similar then the ones from the plugin to select a certain packet. Those have not yet been implemented. Even if they were, you would hardly get more out of the packetlist then the frame number. An alternative route would be to link your plugin against the wireshark application itself, and cast QCoreApplication::instance() to WiresharkApplication. From there you would be able to attach your code onto MainWindow's signals. But again, more than a frame-number would not be possible, due to the same memory constraints mentioned above. The packet-info itself is, once again, part of the wrong execution context, therefore on most operating systems access would lead to an access violation error.

The reason tap's work is that they were designed to be working like that from the beginning. They also provide a specific object, not packet_info. I tried to implement something similar then what you are trying now in the past when I wrote the plugin interface. In the end I gave up due to too many headaches involved.

cheers
Roland

Am So., 19. Juli 2020 um 10:49 Uhr schrieb Tomáš Kukosa <keksa@xxxxxxxx>:
Hi,

the plugin can introduce own menu item to menu bar or toolbar.

When the menu callback is invoked is it possible to access selected
packet anyhow?

What I would like to achieve is to call external program with parameters
based on selected packet.

Thanks for any hint,

Tomas

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe