Ethereal-dev: Re: [Ethereal-dev] Choosing any protocol when clicking on "Decode As"

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

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Wed, 5 Nov 2003 02:40:00 -0800
On Wed, Nov 05, 2003 at 11:31:44AM +0100, Yann Samama wrote:
> What can be done to the SCCP dissector to make it appear in this list?

Add a call

	dissector_add("tcp.port", 3000, sccp_handle);

although note that, as TCP is a byte-stream protocol, the dissector
might have to operate differently over TCP (e.g., doing byte-stream
reassembly stuff based on a length computed from information in the
packet header).

> More generally, what could be done in the Ethereal code so that we could
> select any protocol at any level (link, network, transport) ?

Well, that depends on what you mean by "any".

If you mean that, for any lower-level protocol that has one or more
dissector tables to let you say "this value of this dissector table's
field means the next protocol is this protocol", we could

	make every dissector register itself by name;

	have a file that hold {dissector table, value, dissector}
	triplets, and have Ethereal/Tethereal read that file at startup
	and register the dissectors appropriately;

although note that, as indicated, dissectors that you want to run over
TCP might need to register special "over TCP" dissectors - DNS is one
example, as the actual *packet format* is different (DNS packets have no
length field, so DNS-over-TCP has to add one), as is ONC RPC, but even
protocols that do have length fields need to do reassembly differently
when running over byte-stream protocols.