Ethereal-dev: Re: [ethereal-dev] How to add a UDP base protocol

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

From: Gilbert Ramirez <gram@xxxxxxxxxx>
Date: Fri, 2 Jul 1999 15:42:23 -0500
On Fri, Jul 02, 1999 at 03:17:33PM -0500, Andrew S. Howell wrote:
> 
> 
> Hello,
> 
>         I have a UDP based protocol that we use internally that I
> would like to add support for. From what what I gather so far, I have
> to:
> 
>         - write packet-myproto.[ch]
>         - call udp_hash_add(UDP_PORT_MYPROTO, dissect_myproto);
> 
> However, the UDP port that is used varies, in fact, I may have a
> number of ports running the same protocol. Is there some mechanism for
> saying that port 5678 is of protocol type MYPROTO?

No, currently there is no mechanism to do that.
 
> Also, down deeper into MYPROTO, on different ports I have different
> subtypes. I would like to say:
> 
>         port 5678 type MYPROTO subtype 1
>         port 5679 type MYPROTO subtype 2

Are the subtypes different enough that you'll have two separate
dissect_myproto() functions? Or will one dissect function handle both?
And if so, can the dissect function itself decide which subtype the
protocol is, or does it need help (like, which UDP port it's on?)?

--gilbert