Find dissector table entry responsible for dissector call

asked 2018-06-25 08:51:55 +0000

I have a Lua dissector that I register in a considerable number of dissector table entries, like so:

local proto = Proto("fooproto", "fooproto")

-- dissector goes here...

DissectorTable.get("the_table"):add("whatiwant", proto)
DissectorTable.get("the_table"):add("somethingelse", proto)
-- and then some more table entries

My problem is that now proto:dissector gets called, but I don't know which dissector table entry is responsible. The surrounding protocol dissector field structure makes it difficult to find this information.

For me it would be sufficient if I could register the dissectors with an optional argument like this

 DissectorTable.get("the_table"):add("whatiwant", proto, {"whatiwant", "mux", "serdes"})

Where the table {"whatiwant", "mux", "serdes"} would get passed to the dissector on every call in order to identify the responsible dissector table entry. Additional parameters to the DissectorTable's add method get ignored, however.

Is there a way to find which dissector table entry is responsible for calling a dissector?

edit retag flag offensive close merge delete