Lua ProtoField.ipv4 input data syntax
I'm writing a dissector in Lua (https://github.com/markkuleinio/wires...) and trying to use a ProtoField.ipv4
field. The problem is that the value is not from a TVB buffer (so I cannot use the usual buffer(x, y)
syntax) but inside the data (maybe uncompressed or otherwise generated), and I cannot figure out the correct data syntax to use tree:add(p_addr, ipv4addr)
(where ipv4addr
is the IPv4 address in whatever format is required).
The error message in Wireshark is "userdata expected, got string" (or whatever syntax I try).
The original data is an IPv4 address as dotted decimal string ("10.1.2.3"), but I've also tried to use it as converted to uint32 (generated with a string.gmatch()
loop), or as an array of bytes (bytes[1] = 10, bytes[2] = 1, ...). Any ideas how should I format the data so that a can add that value to the dissector tree?
Markku
Oh, the day has been long and I only now found this: https://osqa-ask.wireshark.org/questi...
local b = ByteArray.new(decipheredFrame) local bufFrame = ByteArray.tvb(b, "My Tvb")
I'll try that tomorrow.