Wireshark - 1.5 User Guide

Page of 244
Lua Support in Wireshark
193
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. Tvb.new_real(bytearray, name)
Creates a new Tvb from a bytearray (it gets added to the current frame too)
11.12.3.1.1. Arguments
bytearray
The data source for this Tvb.
name
The name to be given to the new data-source.
11.12.3.1.2. Returns
The created Tvb.
11.12.3.2. Tvb.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.
11.12.3.3. tvb:__tostring()
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.
11.12.3.3.1. Returns
The string.
11.12.3.4. tvb:len()
Obtain the length of a TVB
11.12.3.4.1. Returns
The length of the Tvb.
11.12.3.5. tvb:offset()
Returns the raw offset (from the beginning of the source Tvb) of a sub Tvb.
11.12.3.5.1. Returns
The raw offset of the Tvb.
11.12.3.6. tvb:__call()
Equivalent to tvb:range(...)