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.

Date: Fri, 25 Aug 2000 12:29:22 -0500

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.

--gilbert

David Frascone <dave@xxxxxxxxxxxx> on 08/25/2000 11:48:22 AM

To:   Guy Harris <gharris@xxxxxxxxxxxx>
cc:   Richard Sharpe <sharpe@xxxxxxxxxx>, ethereal-dev@xxxxxxxx (bcc: Gilbert
      Ramirez/Tivoli Systems)
Subject:  Re: [ethereal-dev] Binding multiple ports to one dissector




Actually, I think doing it like I did it in packet-diameter.c is the wrong
way to do it.  Once several dissectors do this, the preferences dialog is
going to get un-wieldly.

I think a higher up package needs to create the tab, and different dissectors
need to add their ports to it.  Maybe packet-tcp and packet-udp?

Just my $.02 worth

On Fri, Aug 25, 2000 at 09:28:38AM -0700, Guy Harris wrote:
> On Wed, Aug 23, 2000 at 06:28:45PM +0900, Richard Sharpe wrote:
> > I am still not sure whether or not it is easy to bind multiple ports to a
> > single dissector.
>
> It is.  Take a look at "packet-http.c", for example, which binds 80,
> 8080, 3128, and 3132 to "dissect_http()", and "packet-ipp.c", which
> binds port 631 to "dissect_http()" as well.
>
> > It would be good if one could do it via $HOME/.ethereal/preferences via:
> >
> > http.tcp.port: 80, 4444, 8888
>
> That would be done in a fashion similar to the way it's done in
> "packet-diameter.c", except that you'd have to
>
>    define the preference as a string rather than as a number;
>
>    use some routine to carve the port string up into tokens,
>    convert each string to a number, and register that number;
>
>    keep track of all the port numbers you registered, so you can
>    unregister them all if that preference changes.