Ethereal-dev: Re: [ethereal-dev] Keeping state and name tables

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

From: Bibek Sahu <scorpio@xxxxxxxxx>
Date: Thu, 7 Oct 1999 00:50:50 -0500 (CDT)
On Thu, 7 Oct 1999, Richard Sharpe wrote:

> I was thinking that to keep the hashing routines more general, I would need
> something that allows me to create a hash from a block of memory or a
> structure.
> 
> The user of the routines would be responsible for interpreting the hash field.
[...]
> Now glib has routines for maintaining a hash etc.  Does anyone know how
> they should be called?  Any examples around?

	http://www.gtk.org/rdp/glib/glib-hash-tables.html

	As surprising as it is for glib/gtk, _all_ of the functions and
structures for hash tables are documented in that page.

	As far as comparing the structures goes, I would recommend wrapping
memcmp() [which should be part of most unices; if not, it'd be trivial to
implement].

	The structure you mentioned would be a pretty good key, IMHO. 
Anyone wanting more than that can keep the other information in the data.

	Thanks for mentioning that -- I hadn't even realized that glib
implemented hash tables. :-)

- Bibek