Custom sub protocols registering with a custom protocol's dissector table
Hi, I am writing lua dissectors for a) A custom protocol b) A (many) custom sub-protocols.
In the custom protocol:
The custom protocol can be used with its registration to the udp.port. DissectorTable.get("udp.port"):add_for_decode_as(CUSTOM_PROTO)
It creates a table for the sub protocols to register with dissectorTable = DissectorTable.new("myCustomProtocol", "Custom Protocol");
In the custom sub-protocol:
The custom sub-protocol tries to register with the custom protocol DissectorTable.get("myCustomProtocol"):add_for_decode_as(CUSTOM_SUB_PROTO)
Error:
When loading the dissectors at startup, wireshark says "bad argument #1 to 'get' (DissectorTable_get: no such dissector_table)"
What am I doing wrong/not doing?
Thanks Madhav.
In the custom sub-protocol, can you try adding an
init()
function, and perform the dissector table registration within that function instead?Ref: See Lekensteyn's answer to the question, How to add to a Lua DissectorTable? over at StackOverflow.