Ethereal-dev: Re: [Ethereal-dev] dissector registration question

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, 23 Sep 2004 10:04:30 -0700
Filonenko Alexander-AAF013 wrote:

My question is - how to link dissector of an application protocol to the framing protocol dissector by TCP port number.

See how the HTTP dissector does it - it has a routine "http_dissector_add()", which takes a port number and a dissector handle, and:

	registers the HTTP dissector with "tcp.port" for that port number;
registers the specified dissector handle in its own dissector table for that port.

When dissecting the body of an HTTP request, it looks up the port number in that table to see if it has a dissector for that port number, and calls that dissector if it does.