Ethereal-dev: [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: Mon, 04 Oct 1999 08:32:35 +0900
Hi,

I am thinking of two services that are needed in Ethereal.

1. State keeping

Here, I need a package that allows me to record state information. 

I need a hash table of some sort.

And, for a packet, in any dissect module, I think I need to be able to
retrieve information from lower layers for use in storing state information
in the hash table.

So, in dissect_smb, I want to do something like:

   src_ip = get_src_ip(packet);
   dst_ip = get_dst_ip(packet);
   src_port = get_src_port(packet);
   dst_port = get_dst_port(packet);

   state_block = hash_new_state(src_ip, dst_port, src_port, dst_port,
sizeof(state_block));

   state_block -> Transact_Command = command;

etc.

2. Name recording services

It would be useful if we could record name information.  When ever name
translation routines are called, they can enter the name into a name table
and record the type of address against them.

We could then have NetBIOS names, DNS names, IPX names, etc in the table,
and they could hold multiple address types, and we could have a routine
that searches out names and records info into the name table.

Any comments?

The one I am most keen to implement is the state stuff.

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