Wireshark mailing list archives

Re: running a lua function via tshark


From: Tony Trinh <tony19 () gmail com>
Date: Sun, 15 Jan 2012 11:31:59 -0500

On Sun, Jan 15, 2012 at 11:04 AM, Maayan Zadik <
maayanz () designartnetworks com> wrote:

I have a lua script range_check.lua

It has a function range_check(), which checks the ranges of the fields of
each packet in a pcap file, and it is registered to the menu
“MENU_TOOLS_UNSORTED”****



I tried running:****

tshark -X lua_script:range_check.lua -q -r my_capture.pcap****

but “-X lua_script:range_check.lua” just loads reange_check, it does no
run the function “range_check()” on the pcap.****

** **

Is there a way to run “range_check()“on a given pcap file via tshark?


I'm guessing the Listener/Tap is only registered in the menu callback. In
TShark, you want the tap to auto-register. If you're indeed doing this
already, please provide a snippet.

Your script should check
gui_enabled<http://wiki.wireshark.org/LuaAPI/GUI#gui_enabled.28.29>
() (or the variable GUI_ENABLED) to determine whether the tap registration
should occur by menu or automatically (see similar
example<http://www.wireshark.org/lists/wireshark-users/201201/msg00048.html>
).
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: