Ethereal-dev: RE: [ethereal-dev] TCP/UDP protcol dissector lookups

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

From: Jeff Foster <jfoste@xxxxxxxxxxxx>
Date: Mon, 20 Mar 2000 09:09:43 -0600
> From Guy:
>
>However, it's probably better to use "GUINT_TO_POINTER()" rather than
>"GINT_TO_POINTER()", as the pattern is an unsigned integer.

Good idea.  I'm not familiar enough with glib and didn't see the
GUINT_TO_POINTER.

>I also changed "register_dissector_table()" to return the
>"dissector_table_t" for the table - the routine that will be using the
>table can just keep a private copy - and modified "dissector_lookup()"
>to take that "dissector_table_t" as an argument, which avoids a lookup.

I did that originally, but changed it to make the dissector as clean as
possible.  I didn't think the lookup overhead would be very large.  I can
go either way on this.

>  Last night I was thinking about how to handle these "hand-offs", or how
>  one protocol hands off processing to the next protocol. There could
>  be some functionality added to the protocol registry, or an entirely new
>  section of code, that allows protocols to register the fact that they
wish
>  to be called under certain circumstances.
>
>  For example, the proto_register_http() function could say:
>
>	proto_register_handoff(proto_http, "tcp.port", TCP_PORT_HTTP);
>	proto_register_handoff(proto_http, "tcp.port", TCP_ALT_PORT_HTTP);
>	proto_register_handoff(proto_http, "tcp.port", 631);

I think this is a excellent idea.


> Currently, "register_dissector_table()" takes a field ID; perhaps it
> should take a field name instead.

A field name would be good... 


Jeff F.