Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

As of Wireshark 4.4.5, there are two bugs that are hindering this:

  1. DissectorTable:get_dissector() is broken for "payload" dissector tables like this one declared with ftypes.NONE. I submitted merge request #19169.
  2. DissectorTable.new() had a use-after-free bug described in issue #20418 which messed up the Decode As window.

Then, my Lua code had a slight flaw. When calling out to the sub-dissector with dissector:call(), the first argument needs to be a Tvb, not a TvbRange. That requires a minor tweak:

function proto.dissector(tvb, pinfo, tree)
    -- Dispatch payload to sub-dissector
    local dissector = dissector_table:get_dissector()
    if dissector then
        dissector:call(tvb:range(0):tvb(), pinfo, tree)
    end
end