Ask Your Question

Revision history [back]

How to handle 6 byte unsigned integer field in lua dissector?

Certain exchange protocols have started sending their timestamp fields as a 6 byte unsigned integer. these fields contain nanoseconds since midnight. If I promote this value to a uint64 I get:

Lua Error: [...]:370: calling 'add' on bad self (string expected, got userdata)

Is there a way to use the internal field parsers to handle 6 bytes as an integer? Do I need to write a custom function for this data?

How to handle 6 byte unsigned integer field in lua dissector?

Certain exchange protocols have started sending their timestamp fields as a 6 byte unsigned integer. these fields contain The field data contains nanoseconds since midnight. If I promote this value to a uint64 I get:

Lua Error: [...]:370: calling 'add' on bad self (string expected, got userdata)

Is there a way to use the internal field parsers to handle 6 bytes as an integer? Do I need to write a custom function for this data?

How to handle 6 byte unsigned integer field in lua dissector?

Certain exchange protocols have started sending their timestamp fields as a 6 byte unsigned integer. The field data contains nanoseconds since midnight. If I promote this value to a uint64 via:

local range = buffer(offset, 6)
local value = range::uint64()
local display = "Timestamp"..value

parent:add(fields.timestamp, range, value, display)

I get:

Lua Error: [...]:370: calling 'add' on bad self (string expected, got userdata)

userdata)

Is there a way to use the internal field parsers to handle 6 bytes as an integer? Do I need to write a custom function for this data?

How to handle 6 byte unsigned integer field in lua dissector?

Certain exchange protocols have started sending their timestamp fields as a 6 byte unsigned integer. The field data contains nanoseconds since midnight. If I promote this value to a uint64 via:

local range = buffer(offset, 6)
local value = range::uint64()
local display = "Timestamp"..value

parent:add(fields.timestamp, range, value, display)

I get:

Lua Error: [...]:370: calling 'add' on bad self (string expected, got userdata)

Is there a way to use the internal field parsers to handle 6 bytes as an integer? Do I need to write a custom function for this data?

How to handle 6 byte unsigned integer field in lua dissector?

Certain exchange protocols have started sending their timestamp fields as a 6 byte unsigned integer. The field data contains nanoseconds since midnight. If I promote this value to a uint64 via:

local range = buffer(offset, 6)
local value = range::uint64()
range:uint64()
local display = "Timestamp"..value

parent:add(fields.timestamp, range, value, display)

I get:

Lua Error: [...]:370: calling 'add' on bad self (string expected, got userdata)

Is there a way to use the internal field parsers to handle 6 bytes as an integer? Do I need to write a custom function for this data?