How can header transitions based on multiple fields be implemented in Wireshark dissector using Lua?

asked 2019-09-30 14:23:16 +0000

Hi I'm trying to create a Wireshark dissector in Lua in order to define my custom header. I have 3 custom headers, for example, h1, h2, and h3. there are 2 fields in h1 which their values together determine whether the next header is h2 or h3. I know if it was just one field I should have used something like this:

local h1_type = DissectorTable.get("h1.type")
h1_type:add(tostring(0x17), h2)

but know that it is based on 2 fields (e.g. type1 and type2) I don't know what should I do.

edit retag flag offensive close merge delete