File: frame-count.lua

package info (click to toggle)
wireshark 4.6.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 351,352 kB
  • sloc: ansic: 3,102,875; cpp: 129,717; xml: 100,972; python: 56,513; perl: 24,575; sh: 5,874; lex: 4,383; pascal: 4,304; makefile: 166; ruby: 113; objc: 91; tcl: 35
file content (17 lines) | stat: -rw-r--r-- 389 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
do
    packets = 0;
    local function init_listener()
        local tap = Listener.new("frame")
        function tap.reset()
            packets = 0;
        end
        function tap.packet(pinfo,tvb, ip)
            packets = packets + 1
        end
        function tap.draw()
           print("Packet count:", packets)
           os.exit(0)
        end
    end
    init_listener()
end