Functions for handling packet data

{i} Since a Tvb can only be created from (or passed into) a dissector or listener, these functions can only be called from a dissector or listener. Attempting to use the functions outside of that context results in an error message.


Tvb

A Tvb ("Testy Virtual Buffer") 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.

function

description

tvb:__tostring()

Gets a string representation of the Tvb

tvb:__call()

Creates a TvbRange from this Tvb. Same as tvb:range()

tvb:len()

Gets the number of bytes in the Tvb

tvb:offset()

Gets the raw offset (from the beginning of the source Tvb) of the Tvb

tvb:range([offset] [,length])

Creates a TvbRange from a subset of this Tvb


Tvb.new_real(bytearray, name)


tvb:len()


tvb:offset()


tvb:range([offset] [,length])


tvb:__tostring()


tvb:__call()


TvbRange

A range of bytes within a Tvb that is used to extract data. A TvbRange is created from tvb:__call() or tvb:range([offset] [,length]).

function

description

tvbrange:tvb()

Creates a new Tvb from this TvbRange

tvbrange:uint()

Gets a Big Endian (network order) unsigned integer from the TvbRange

tvbrange:le_uint()

Gets a Little Endian unsigned integer from the TvbRange

tvbrange:uint64()

Gets a Big Endian (network order) unsigned 64-bit integer from the TvbRange

tvbrange:le_uint64()

Gets a Little Endian unsigned 64-bit integer from the TvbRange

tvbrange:int()

Gets a Big Endian (network order) signed integer from the TvbRange

tvbrange:le_int()

Gets a Little Endian signed integer from the TvbRange

tvbrange:int64()

Gets a Big Endian (network order) signed 64-bit integer from the TvbRange

tvbrange:le_int64()

Gets a Little Endian signed 64-bit integer from the TvbRange

tvbrange:float()

Gets a Big Endian (network order) floating-point number from the TvbRange

tvbrange:le_float()

Gets a Little Endian floating-point number from the TvbRange

tvbrange:ipv4()

Gets an IPv4 Address from the TvbRange

tvbrange:le_ipv4()

Gets a Little Endian IPv4 Address from the TvbRange

tvbrange:ether()

Gets an Ethernet Address from the TvbRange

tvbrange:string()

Gets a string from the TvbRange

tvbrange:stringz()

Gets a zero-terminated string from the TvbRange

tvbrange:ustring()

Gets a UTF-16 (Big Endian) string from the TvbRange

tvbrange:ustringz()

Gets a zero-terminated UTF-16 (Big Endian) string from the TvbRange

tvbrange:le_ustring()

Gets a UTF-16 (Little Endian) string from the TvbRange

tvbrange:le_ustringz()

Gets a zero-terminated UTF-16 (Little Endian) string from the TvbRange

tvbrange:bytes()

Gets a ByteArray composed of the bytes in the TvbRange

tvbrange:bitfield([offset], [length])

Gets a bitfield from the TvbRange

tvbrange:len()

Gets the number of bytes in the TvbRange

tvbrange:offset()

Gets the raw offset of the TvbRange

tvbrange:__tostring()

Gets the string representation of the TvbRange


tvbrange:tvb()


tvbrange:uint()


tvbrange:le_uint()


tvbrange:uint64()


tvbrange:le_uint64()


tvbrange:int()


tvbrange:le_int()


tvbrange:int64()


tvbrange:le_int64()


tvbrange:float()


tvbrange:le_float()


tvbrange:ipv4()


tvbrange:le_ipv4()


tvbrange:ether()


tvbrange:string()


tvbrange:stringz()


tvbrange:ustring()


tvbrange:ustringz()


tvbrange:le_ustring()


tvbrange:le_ustringz()


tvbrange:bytes()


tvbrange:bitfield([offset], [length])


tvbrange:len()


tvbrange:offset()


tvbrange:__tostring()

LuaAPI/Tvb (last edited 2014-02-08 19:32:46 by TonyTrinh)