Ethereal-dev: Re: [Ethereal-dev] Problem with portnumber clash between two dissectors
On Mon, Aug 12, 2002 at 05:01:47PM +0200, andreas.sikkema@xxxxxxxxxxx wrote:
> Suppose I have a plugin that dissects TCP traffic on port 2600,
> the same port as the built-in protocol ZEBRA. Now, I'm naive and
> think, well, I can disable ZEBRA and then the plugin should kick
> in. No, nothing more than plain TCP traffic.
The current dissector handoff-registration stuff uses a hash table, and
only one dissector can be registered with a particular ID value in a
particular table; I'm not sure which one wins, but it might be the one
whose "proto_reg_handoff" routine gets called first, as the built-in
dissectors' "proto_reg_handoff" routines are called before plugins'
"proto_reg_handoff" routines.
In order to allow multiple dissectors with a given ID value (which
would cause a dissector to be chosen from the dissectors based on
1) whether the dissector is a built-in or a plugin
and
2) the name of the file in which it's defined if it's a
built-in, and the order in which its dynamic library file
appears in the plugins directory if it's a plugin
so it wouldn't necessarily return the answer you want), the table would
have to have a *list* of handles rather than a single handle as a hash
table entry, and "dissector_add()" would have to look for an entry in
the hash table, and
put the head of the list into the hash table if it doesn't find
one;
add the handle to the list if it does find one.