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: Richard Sharpe <sharpe@xxxxxxxxxx>
Date: Thu, 07 Oct 1999 04:43:16 +0900
At 07:16 PM 10/5/99 -0700, Guy Harris <guy@xxxxxxxxxx> wrote:
>> Hmmm, my initial thoughts were that I would associate it with IP addresses
>> and TCP ports, but the frame number could be added as well.
>
>Wouldn't you *have* to associate it with more than just an IP address
>and port?  The same TCP connection might get more than one Transact
>command going over it, so you'd have to index it by multiplexor ID as
>well.

Indeed, I will have to watch out for these things...

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.

Something along the lines of:

struct hash_struct {

  uint32 src_ip;       /* Excuse the non-portability */
  uint32 dst_ip;    
  uint16 src_port;
  uint16 dst_port;
  uint16 mid;

} hash_struct;

hash_struct.src_ip = source_ip; ... etc

hash_insert(hash_struct, info_block);

inf_block = hash_find(hash_struct);  etc ...

Now glib has routines for maintaining a hash etc.  Does anyone know how
they should be called?  Any examples around?


Regards
-------
Richard Sharpe, sharpe@xxxxxxxxxx, Master Linux Administrator :-),
Samba (Team member, www.samba.org), Ethereal (Team member, www.zing.org)
Co-author, SAMS Teach Yourself Samba in 24 Hours
Author: First Australian 5-day, intensive, hands-on Linux SysAdmin course