This Part of the User Guide describes the Wireshark specific functions in the embedded Lua.
Creates a file to write packets. Dumper:new_for_current() will probably be a better choice.
The name of the capture file to be created
The type of the file to be created
The encapsulation to be used in the file to be created
Dumps an arbitrary packet. Note: Dumper:dump_current() will fit best in most cases.
Creates a capture file using the same encapsulation as the one of the cuurrent packet
A pseudoheader to be used to save captured frames.
Creates an ethernet pseudoheader
Creates an ATM pseudoheader
AAL number
VPI
VCI
Channel
Number of cells in the PDU
AAL5 User to User indicator
AAL5 Len
A Field extractor to to obtain field values.
Create a Field extractor
An extracted Field
Checks whether lhs is within rhs
Checks whether the end byte of rhs is before the beginning of rhs
Manages a progress bar dialog.
Creates a new TextWindow.
Title of the new window, defaults to "Progress".
Current task, defaults to "".
Appends text
Part done ( e.g. 0.75 ).
Current task, defaults to "".
Checks wheher the user has pressed the stop button.
Manages a text window.
Creates a new TextWindow.
Set the function that will be called when the window closes
Sets the text.
Appends text
Prepends text
Erases all text in the window.
Get the text of the window
Make this window editable
Checks whether the GUI facility is enabled.
Register a menu item in one of the main menus.
The name of the menu item. The submenus are to be separated by '/'s. (string)
The function to be called when the menu item is invoked. (function taking no arguments and returning nothing)
The menu group into which the menu item is to be inserted. If omitted, defaults to MENU_STAT_GENERIC. One of MENU_STAT_UNSORTED (Statistics), MENU_STAT_GENERIC (Statistics, first section), MENU_STAT_CONVERSATION (Statistics/Conversation List), MENU_STAT_ENDPOINT (Statistics/Endpoint List), MENU_STAT_RESPONSE (Statistics/Service Response Time), MENU_STAT_TELEPHONY (Telephony), MENU_ANALYZE (Analyze), MENU_ANALYZE_CONVERSATION (Analyze/Conversation Filter), MENU_TOOLS_UNSORTED (Tools). (number)
Pops up a new dialog
Title of the dialog's window.
Action to be performed when OKd.
A series of strings to be used as labels of the dialog's fields
Copy a string into the clipboard
Open and display a capture file
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.
Creates a new Listener listener
The name of this tap
A filter that when matches the tap.packet function gets called (use nil to be called for every packet)
A function that will be called once every packet matches the Listener listener filter. function tap.packet(pinfo,tvb,userdata) ... end
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
Represents an address
Creates an Address Object representing an IP address.
A Column in the packet list
Sets the text of a Column
Appends text to a Column
The Columns of the packet list.
Packet information
Estimated number of additional bytes required for completing the PDU
Offset in the tvbuff at which the dissector will continue processing when next called
A refererence to a dissector, used to call a dissector against a packet or a part of it.
Obtains a dissector reference by name
A table of subdissectors of a particular protocol (e.g. TCP subdissectors like http, smtp, sip are added to table "tcp.port"). Useful to add more dissectors to a table so that they appear in the Decode As... dialog.
Creates a new DissectorTable for your dissector's use.
The short name of the table.
The name of the table in the User Interface (defaults to the name given).
Either FT_UINT* or FT_STRING (defaults to FT_UINT32)
Either BASE_NONE, BASE_DEC, BASE_HEX, BASE_OCT, BASE_DEC_HEX or BASE_HEX_DEC (defaults to BASE_DEC)
Obtain a reference to an existing dissector table.
Add a dissector to a table.
Remove a dissector from a table
Try to call a dissector from a table
A preference of a Protocol.
Creates a boolean preference to be added to a Protocol's prefs table.
Creates an (unsigned) integer preference to be added to a Protocol's prefs table.
Creates a string preference to be added to a Protocol's prefs table.
Creates an enum preference to be added to a Protocol's prefs table.
Creates a range preference to be added to a Protocol's prefs table.
The table of preferences of a protocol
Creates a new preference
The abbreviation of this preference
A valid but still unassigned Pref object
A new protocol in wireshark. Protocols have more uses, the main one is to dissect a protocol. But they can be just dummies used to register preferences for other purposes.
The name of the protocol
A Long Text description of the protocol (usually lowercase)
A Protocol field (to be used when adding items to the dissection tree)
Creates a new field to be used in a protocol.
Actual name of the field (the string that appears in the tree).
Filter name of the field (the string that is used in filters).
Field Type (FT_*).
A VoidString object.
The representation BASE_*.
The bitmask to be used.
The description of the field.
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
One of base.DEC, base.HEX or base.OCT
A table containing the text that corresponds to the values
Integer mask of this field
Description of the field
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
One of base.DEC, base.HEX or base.OCT
A table containing the text that corresponds to the values
Integer mask of this field
Description of the field
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
One of base.DEC, base.HEX or base.OCT
A table containing the text that corresponds to the values
Integer mask of this field
Description of the field
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
One of base.DEC, base.HEX or base.OCT
A table containing the text that corresponds to the values
Integer mask of this field
Description of the field
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
One of base.DEC, base.HEX or base.OCT
A table containing the text that corresponds to the values
Integer mask of this field
Description of the field
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
One of base.DEC, base.HEX or base.OCT
A table containing the text that corresponds to the values
Integer mask of this field
Description of the field
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
One of base.DEC, base.HEX or base.OCT
A table containing the text that corresponds to the values
Integer mask of this field
Description of the field
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
One of base.DEC, base.HEX or base.OCT
A table containing the text that corresponds to the values
Integer mask of this field
Description of the field
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
One of base.DEC, base.HEX or base.OCT
A table containing the text that corresponds to the values
Integer mask of this field
Description of the field
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
One of base.DEC, base.HEX or base.OCT
A table containing the text that corresponds to the values
Integer mask of this field
Description of the field
A frame number (for hyperlinks between frames)
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
One of base.DEC, base.HEX or base.OCT
A table containing the text that corresponds to the values
Integer mask of this field
Description of the field
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
how wide the parent bitfield is (BASE_NONE is used for NULL-value)
A table containing the text that corresponds to the values
Integer mask of this field
Description of the field
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
Description of the field
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
Description of the field
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
Description of the field
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
Description of the field
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
Description of the field
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
Description of the field
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
Description of the field
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
Description of the field
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
Description of the field
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
Description of the field
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
Description of the field
Abbreviated name of the field (the string used in filters)
Actual name of the field (the string that appears in the tree)
Description of the field
TreeItems represent information in the packet-details pane. A root TreeItem is passed to dissectors as first argument.
Adds an child item to a given item, returning the child. tree_item:add([proto_field | proto], [tvbrange], [label], ...) if the proto_field represents a numeric value (int, uint or float) is to be treated as a Big Endian (network order) Value.
Adds (and returns) an child item to a given item, returning the child. tree_item:add([proto_field | proto], [tvbrange], [label], ...) if the proto_field represents a numeric value (int, uint or float) is to be treated as a Little Endian Value.
Sets the text of the label
Appends text to the label
Sets the expert flags of the item.
Sets the expert flags of the item and adds expert info to the packet.
Marks the TreeItem as a generated field (with data infered but not contained in the packet).
Creates a ByteArray Object
A string consisting of hexadecimal bytes like "00 B1 A2" or "1a2b3c4d"
Concatenate two ByteArrays
Prepend a ByteArray to this ByteArray
Append a ByteArray to this ByteArray
Sets the size of a ByteArray, either truncating it or filling it with zeros.
Sets the value of an index of a ByteArray.
Get the value of a byte in a ByteArray
Obtain the length of a ByteArray
Int64 represents a 64 bit integer. Lua uses one single number representation which can be chosen at compile time and since it is often set to IEEE 754 double precision floating point, we cannot store a 64 bit integer with full precision. For details, see: http://lua-users.org/wiki/FloatingPoint
A Tvb represents the packet's buffer. It is passed as an argument to listeners and dissectors, and can be used to extract information (via TvbRange) from the packet's data. Beware that Tvbs are usable only by the current listener or dissector call and are destroyed as soon as the listener/dissector returns, so references to them are unusable once the function has returned. To create a tvbrange the tvb must be called with offset and length as optional arguments ( the offset defaults to 0 and the length to tvb:len() )
Creates a new Tvb from a bytearray (it gets added to the current frame too)
The data source for this Tvb.
The name to be given to the new data-source.
Creates a (sub)Tvb from using a TvbRange
Convert the bytes of a Tvb into a string, to be used for debugging purposes as '...' will be appended in case the string is too long.
Returns the raw offset (from the beginning of the source Tvb) of a sub Tvb.
A TvbRange represents an usable range of a Tvb and is used to extract data from the Tvb that generated it TvbRanges are created by calling a tvb (e.g. tvb(offset,length)). If the TvbRange span is outside the Tvb's range the creation will cause a runtime error.
Creates a tvbr from this Tvb. This is used also as the Tvb:__call() metamethod.
The offset (in octets) from the begining of the Tvb. Defaults to 0.
The length (in octets) of the range. Defaults to until the end of the Tvb.
Get a Big Endian (network order) unsigned integer from a TvbRange. The range must be 1, 2, 3 or 4 octets long.
Get a Little Endian unsigned integer from a TvbRange. The range must be 1, 2, 3 or 4 octets long.
Get a Big Endian (network order) unsigned 64 bit integer from a TvbRange. The range must be 1-8 octets long.
Get a Little Endian unsigned 64 bit integer from a TvbRange. The range must be 1-8 octets long.
Get a Big Endian (network order) signed integer from a TvbRange. The range must be 1, 2 or 4 octets long.
Get a Little Endian signed integer from a TvbRange. The range must be 1, 2 or 4 octets long.
Get a Big Endian (network order) signed 64 bit integer from a TvbRange. The range must be 1-8 octets long.
Get a Little Endian signed 64 bit integer from a TvbRange. The range must be 1-8 octets long.
Get a Big Endian (network order) floating point number from a TvbRange. The range must be 4 or 8 octets long.
Get a Little Endian floating point number from a TvbRange. The range must be 4 or 8 octets long.
Get an IPv4 Address from a TvbRange.
Get an Little Endian IPv4 Address from a TvbRange.
Get an Ethernet Address from a TvbRange.
Obtain a zero terminated string from a TvbRange
Get a bitfield from a TvbRange.
The bit offset from the begining of the TvbRange. Defaults to 0.
The length (in bits) of the field. Defaults to 1.
Creates a sub-TvbRange from this TvbRange. This is used also as the TvbRange:__call() metamethod.
The offset (in octets) from the begining of the TvbRange. Defaults to 0.
The length (in octets) of the range. Defaults to until the end of the TvbRange.
A Directory
Usage: for filename in Dir.open(path) do ... end
The pathname of the directory
If given, only file with this extension will be returned
Formats an absolute timestamp into a human readable date
Formats a relative timestamp in a human readable form
Will add a log entry with critical severity
Will add a log entry with warn severity
Will add a log entry with message severity
Will add a log entry with info severity
Will add a log entry with debug severity
Lua's loadfile() has been modified so that if a file does not exist in the current directory it will look for it in wireshark's user and system directories
Lua's dofile() has been modified so that if a file does not exist in the current directory it will look for it in wireshark's user and system directories