Main Page | Modules | Class List | Directories | File List | Class Members | File Members | Related Pages

flow_hash.h File Reference

hash function for FLOW keys More...

#include "sfhashfcn.h"
#include "flow.h"

Go to the source code of this file.

Functions

unsigned flowkey_hashfcn1 (SFHASHFCN *p, unsigned char *d, int n)
unsigned flowkey_hashfcn2 (SFHASHFCN *p, unsigned char *d, int n)


Detailed Description

hash function for FLOW keys

Author:
Chris Green <cmg@sourcefire.com>
Date:
Thu Jun 19 11:42:49 2003
We can save a bit of work in the hash stage by having a hash function that understands FLOWS better than hash(sizeof(FLOWKEY))

Definition in file flow_hash.h.


Function Documentation

unsigned flowkey_hashfcn1 SFHASHFCN p,
unsigned char *  d,
int  n
 

hash function that implements sfhashfcn for only the portions a Flowkey that are relevant

Parameters:
p 
d 
n 
Returns:
the hash

Definition at line 30 of file flow_hash.c.

References _SFHASHFCN::hardener, _FLOWKEY::init_address, _FLOWKEY::init_port, _FLOWKEY::protocol, _FLOWKEY::resp_address, _FLOWKEY::resp_port, _SFHASHFCN::scale, and _SFHASHFCN::seed.

Referenced by flowcache_init().

unsigned flowkey_hashfcn2 SFHASHFCN p,
unsigned char *  d,
int  n
 

One that performs less calculations because it doesn't treat each byte of the entity as unique. This is probably less resistant to collisions but the hardener stages should be randomly chosen so that complexity attacks shouldn't succeed without a lot of prior knowledge

Parameters:
p 
d 
n 
Returns:
the hash

Definition at line 82 of file flow_hash.c.

References _SFHASHFCN::hardener, _FLOWKEY::init_address, _FLOWKEY::init_port, _FLOWKEY::protocol, _FLOWKEY::resp_address, _FLOWKEY::resp_port, _SFHASHFCN::scale, and _SFHASHFCN::seed.

Referenced by flowcache_init().


Generated on Sun May 14 14:51:24 2006 by  doxygen 1.4.2