I have a .lua script that has GUI dependencies that I would like to remove. In other words, the .lua script makes calls to functions such as Field.new(), TextWindow.new(), etc. I want to either remove GUI altogether or automate the GUI in some way. Are there non-GUI alternatives to passing in pcap files to a lua script and processing the file without using Field.new(), TextWindow.new(), and Listener.new()? or is there a way I can have my .lua script open the gui and then execute on the newly opened gui? Ideally I would never have to open wireshark to run my .lua script. Thanks for the help asked 16 Feb '16, 17:35 testname0110 |
2 Answers:
I figured it out. To input a pcap file to a lua script you do the following: "tshark -X lua_script:file.lua -r file.pcap -o rtp.heuristic_rtp -w out" the -w out keeps the terminal from showing stdout, which speeds up the process from 10 minutes to 1ms. answered 17 Feb '16, 14:20 testname0110 |
answered 16 Feb '16, 18:08 Guy Harris ♦♦ |
Thanks, that's very helpful. But I still don't understand how Listener.new(), Field.new() are getting inputs from my pcap file.
They're getting the inputs because the file is being read by Wireshark or TShark and the Lua interpreter embedded inside Wireshark and TShark is given those objects from Wireshark or TShark.
If you want to be able to access them in a version of Lua that is NOT embedded inside Wireshark or TShark, such as the one in the
lua
command, that will NOT work.Ok I got it. I was piping the input pcap file incorrectly, but thanks for the help!