Ethereal-dev: [ethereal-dev] Changes checked in to register handoffs in protocol source files
I checked in changes to move the "dissector_add()" calls out of
"packet-udp.c" and "packet-tcp.c" and into handoff registration routines
in the source files for the dissectors being registered.
Some questions came up when I looked into what would be involved in
doing that for other protocols:
1) It might be useful if, for a given "selector" value, the handoff
registration routine for a protocol could not only register a dissector,
but also register a protocol name.
In many cases, the "selector" field is a field with a "value_string"
table associated with it; if "dissector_add()" took a protocol name
argument, we could conceivably allocate a new "value_string" table, with
one more element than the existing one, and add an entry with the value
being the "selector" value and the name being the protocol name, and
replace the existing "value_string" table pointer for that field with
the new one.
Alternatively, "dissector_add()" could take the "proto_XXX" value for
the protocol, and get the protocol name argument from the
header_field_info structure for the protocol.
2) For some protocols, we'd want to register a "capture" routine as well
as a dissector - that routine is called in the micro-dissection done on
all captured frames in order to bump the counters in the dialog box
that's up during a capture.