Ethereal-dev: Re: [Ethereal-dev] Arbitrarily choosing a protocol

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxx>
Date: Thu, 17 Feb 2005 11:51:44 -0800
Yann Samama wrote:

Is it possible to call an upper-level dissector from a lower-level dissector even if the upper-level dissector has not registered itself by its name?

Not unless the upper-level dissector has registered itself in a dissector table and your lower-level dissector can use that dissector table. For example, if the lower-level protocol header includes an Ethernet type field, it can use the dissector table for Ethernet types (and, in fact, *should* do so, rather than handling the Ethernet type itself).

My goal is to achieve this without modifying the source code of the upper-level dissector.

Given that Ethereal is free software, why is that a goal? If you need some particular dissector to register itself by name, you could just modify Ethereal to do that, and send us a patch so that, in the next release, you don't have to modify Ethereal. This means that your lower-level dissector won't work with an unmodified Ethereal, so you might have to build it yourself for the platforms on which it needs to run until a release comes out with your change, but if you can live with that restriction....