User Guide

Lua Support in Wireshark
171
11.8. Post-dissection packet analysis
11.8.1. Listener
A Listener, is called once for every packet that matches a certain filter or has a certain tap. It can read the
tree, the packet's Tvb eventually the tapped data but it cannot add elements to the tree.
11.8.1.1. Listener.new([tap], [filter])
Creates a new Listener listener
11.8.1.1.1. Arguments
tap (optional) The name of this tap
filter (optional) A filter that when matches the tap.packet function gets called (use nil to be
called for every packet)
11.8.1.1.2. Returns
The newly created Listener listener object
11.8.1.1.3. Errors
tap registration error
11.8.1.2. listener:remove()
Removes a tap listener
11.8.1.3. listener.packet
A function that will be called once every packet matches the Listener listener filter. function
tap.packet(pinfo,tvb,userdata) ... end
11.8.1.4. listener.draw
A function that will be called once every few seconds to redraw the gui objects in tshark this funtion is
called oly at the very end of the capture file. function tap.draw(userdata) ... end
11.8.1.5. listener.reset
A function that will be called at the end of the capture run. function tap.reset(userdata) ... end
11.9. Obtaining packet information
11.9.1. Address
Represents an address
11.9.1.1. Address.ip(hostname)
Creates an Address Object representing an IP address.