The classes/functions defined in this module are for using a Dumper object to
make Wireshark save a capture file to disk. Dumper represents Wireshark’s built-in
file format writers (see the wtap_name_to_file_type_subtype function).
(The wtap_filetypes table is deprecated, and should
only be used in code that must run on Wireshark 3.4.3 and earlier 3.4
releases or in Wireshark 3.2.11 and earlier 3.2.x releases.)
To have a Lua script create its own file format writer, see the chapter titled "Custom file format reading/writing".
Creates a file to write packets.
Dumper:new_for_current() will probably be a better choice, especially for file types other than pcapng.
wtap_name_to_file_type_subtype(). Defaults to pcapng.
(The wtap_filetypes table
is deprecated, and should only be used
in code that must run on Wireshark 3.4.3 and earlier 3.4.x releases
or in Wireshark 3.2.11 and earlier
3.2.x releases.)
wtap_encaps table.
Defaults to per-packet encapsulation for pcapng
(which doesn’t have file-level encapsulation;
this will create IDBs on demand as necessary)
and Ethernet encapsulation for other file types.
The newly created Dumper object
Dumps an arbitrary packet. Note: Dumper:dump_current() will fit best in most cases.
PseudoHeader to use.
Creates a capture file using the same encapsulation as the one of the current packet.
The newly created Dumper Object
Returns a short label of the form
Dumper: file_type=<name> encap=<name> while open, or
Dumper: (closed) once Dumper:close() has run. Like the
read-only attributes above, this deliberately bypasses
checkDumper so a closed dumper is still inspectable from the
debugger’s Variables view.
The string.
Mode: Retrieve only.
True while the dumper is open, false once Dumper:close() has run.
Mode: Retrieve only.
The numeric wiretap file-type- subtype (as returned by wtap_name_to_file_type_subtype()), or nil if the dumper is closed.
Mode: Retrieve only.
Short wiretap name of the file type (e.g. "pcapng"), or nil if the dumper is closed.
Mode: Retrieve only.
Human-readable description of the file type (e.g. "Wireshark/… - pcapng"), or nil if the dumper is closed.
Mode: Retrieve only.
The numeric WTAP_ENCAP_* chosen at open time, or nil if the dumper is closed.
Mode: Retrieve only.
Short wiretap name of the encapsulation (e.g. "ETHERNET"), or nil if the dumper is closed.
A pseudoheader to be used to save captured frames.
Creates an ethernet pseudoheader.
The ethernet pseudoheader
Creates an ATM pseudoheader.
The ATM pseudoheader
Creates an MTP2 PseudoHeader.
The MTP2 pseudoheader
Iterate over the variant-specific fields of the pseudoheader (for
example fcs_len on Ethernet pseudoheaders or aal/vpi/vci
on ATM ones). Nothing is yielded for PseudoHeader.none.
Mode: Retrieve only.
The pseudoheader variant as the
internal lua_pseudoheader_type enum value (integer). Use
PseudoHeader.type_name for the short string form ("none", "eth",
"atm", …).