Ethereal-dev: Re: [ethereal-dev] Binding multiple ports to one dissector

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

From: Glen Turner <glen.turner@xxxxxxxxxxxxx>
Date: Sat, 26 Aug 2000 17:19:17 +0930
Gilbert_Ramirez@xxxxxxxxxx wrote:
> 
> There needs to be a singular dialogue for all port assignments for all
> protocols. It's beyond the scope of an individual dissector or set of
> dissectors.

A lot of packet decoders do this through the packet filtering
interface.

  Condition:  ip.tcp.port == 80
  Action:     Accept
  Decoder:    HTTP

Under the hood, the code for TCP decoding also contains the
pointers to the (common) filtering modules.  For sparse scalars
like port, that tends to be implemented as an ordered array of
  { port, *action, *decoder }
which is searched using a binary search.  The decoder can select
the filtering module that is the best fit for each variable.

Glen