On Wed, Dec 27, 2000 at 04:53:17AM -0800, Guy Harris wrote:
> I'd still prefer that there be a separate LAPB-over-Ethernet dissector,
> which extracts the length field and then calls an unmodified LAPB
> dissector, along the lines of, for example, the X.25-over-TCP dissector.
One advantage of having dissectors have only one protocol associated
with them is that some stuff I've been working on for a while (it's only
partially completed, and could take some time to finish) gets rid of
most of the CHECK_DISPLAY_AS_DATA() calls from dissectors - instead, all
dissectors are registered with a protocol handle (as returned by
"proto_register_protocol()"), and the code to call dissectors through:
a dissector table;
a heuristic dissector table;
a dissector handle;
checks, before calling a dissector, whether the protocol with which it's
associated has had dissection disabled and, if it has been disabled,
just calls "dissect_data()".
In addition, protocols themselves are registered with an additional
name, which is a display abbreviation, e.g. ARP is registered with:
"Address Resolution Protocol" as its long name;
"arp" as its filter name;
"ARP" as its display abbreviation;
and the code to call dissectors through those mechanisms sets
"pinfo->current_proto" to the protocol's display abbreviation before the
protocol's dissector is called.
There are some other ways in which we can use the additional information
this scheme provides as well.
This, however, doesn't work well if the same dissector routine is
associated with multiple separately-named and separately-disableable
protocols.