Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: [Wireshark-dev] Dissecting multiple protocol headers in a single plugin

From: Bob Doolittle <Robert.Doolittle@xxxxxxx>
Date: Tue, 03 Apr 2007 13:49:51 -0400
Hi,

I've got a plugin dissector working for the top-level header of a
multi-layer protocol, and I need to add the subdissectors for the
subsequent layers.

I've tried doing this as separate plugins, and in a single plugin
with multiple registered dissectors.  However, whenever I
call add_dissector for the second layer of the protocol, I get
an error:
Err  file packet.c: line 672: assertion failed: (sub_dissectors)

Looking at packet.c, it appears that the type of the HF name
I'm passing as the first arg doesn't map to an acceptable type,
but in fact I've declared that field with type FT_UINT8,
which should be fine.  Another possibility is that the
fields haven't been registered yet so aren't recognized (it
would be nice if this were a separate, distinguishable
assertion error :(), but I only call the proto_register_*
routine for the sub-layer after the proto_register_*
for the higher layer has returned successfully, so I'd expect
the fields to be registered at that point.

Any clues as to what might be going wrong?

Thanks,
   Bob