User Guide

Lua Support in Wireshark
202
11.12.1.8.1. Returns
The length of the ByteArray.
11.12.1.9. bytearray:subset(offset, length)
Obtain a segment of a ByteArray
11.12.1.9.1. Arguments
offset The position of the first byte
length The length of the segment
11.12.1.9.2. Returns
A ByteArray contaning the requested segment.
A string contaning a representaion of the ByteArray.
11.12.2. Int
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
11.12.3. Tvb
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() )
11.12.3.1. ByteArray.tvb(name)
Creates a new Tvb from a bytearray (it gets added to the current frame too)
11.12.3.1.1. Arguments
name The name to be given to the new data-source.
11.12.3.1.2. Returns
The created Tvb.
11.12.3.2. TvbRange.tvb(range)
Creates a (sub)Tvb from using a TvbRange
11.12.3.2.1. Arguments
range The TvbRange from which to create the new Tvb.