Ethereal-dev: Re: [ethereal-dev] dissector port range register

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, 15 Sep 2000 10:41:17 -0400
On Fri, Sep 15, 2000 at 08:19:43AM -0500, Frank Singleton wrote:
> Hi,
> 
> Ok, now I have some dissectors that instead
> of using a few "well known" port numbers,
> are actually want to register for a range
> instead. 
> 
> eg: 10100 - 10120  protocol xyz
> 
> Does there exist a way to register a range via
> dissector_add(); instead of explicitly doing
> a dissector_add() for each port.

No, not yet. One way would be to add a function which
registered many ports for you, given a range:

dissect_add_range(...., guint32 min, guint32 max)


Another way would be to have the dissector tables maintain
not only a hash of port numbers, but also a list of port ranges

struct port_range {
	guint32	min;
	guint32 max;
}


I imagine that the first idea might not be so bad, performance-wise.

--gilbert