suricata
util-hash-lookup3.c File Reference
#include <stdio.h>
#include <time.h>
#include <stdint.h>
#include <sys/param.h>
#include "util-hash-lookup3.h"
Include dependency graph for util-hash-lookup3.c:

Go to the source code of this file.

Macros

#define HASH_LITTLE_ENDIAN   0
 
#define HASH_BIG_ENDIAN   0
 
#define hashsize(n)   ((uint32_t)1<<(n))
 
#define hashmask(n)   (hashsize(n)-1)
 
#define rot(x, k)   (((x)<<(k)) | ((x)>>(32-(k))))
 
#define mix(a, b, c)
 
#define final(a, b, c)
 

Functions

uint32_t hashword (const uint32_t *k, size_t length, uint32_t initval)
 
void hashword2 (const uint32_t *k, size_t length, uint32_t *pc, uint32_t *pb)
 
uint32_t hashlittle (const void *key, size_t length, uint32_t initval)
 
uint32_t hashlittle_safe (const void *key, size_t length, uint32_t initval)
 
void hashlittle2 (const void *key, size_t length, uint32_t *pc, uint32_t *pb)
 
uint32_t hashbig (const void *key, size_t length, uint32_t initval)
 

Macro Definition Documentation

#define final (   a,
  b,
 
)
Value:
{ \
c ^= b; c -= rot(b,14); \
a ^= c; a -= rot(c,11); \
b ^= a; b -= rot(a,25); \
c ^= b; c -= rot(b,16); \
a ^= c; a -= rot(c,4); \
b ^= a; b -= rot(a,14); \
c ^= b; c -= rot(b,24); \
}
#define rot(x, k)

Definition at line 150 of file util-hash-lookup3.c.

#define HASH_BIG_ENDIAN   0

Definition at line 64 of file util-hash-lookup3.c.

Referenced by hashbig().

#define HASH_LITTLE_ENDIAN   0

Definition at line 63 of file util-hash-lookup3.c.

Referenced by hashlittle(), hashlittle2(), and hashlittle_safe().

#define hashmask (   n)    (hashsize(n)-1)

Definition at line 68 of file util-hash-lookup3.c.

Referenced by ROHashInitFinalize(), and ROHashLookup().

#define hashsize (   n)    ((uint32_t)1<<(n))

Definition at line 67 of file util-hash-lookup3.c.

Referenced by ROHashInit(), ROHashInitFinalize(), and ROHashMemorySize().

#define mix (   a,
  b,
 
)
Value:
{ \
a -= c; a ^= rot(c, 4); c += b; \
b -= a; b ^= rot(a, 6); a += c; \
c -= b; c ^= rot(b, 8); b += a; \
a -= c; a ^= rot(c,16); c += b; \
b -= a; b ^= rot(a,19); a += c; \
c -= b; c ^= rot(b, 4); b += a; \
}
#define rot(x, k)

Definition at line 115 of file util-hash-lookup3.c.

Referenced by hashbig(), hashlittle(), hashlittle2(), hashlittle_safe(), hashword(), and hashword2().

#define rot (   x,
 
)    (((x)<<(k)) | ((x)>>(32-(k))))

Definition at line 69 of file util-hash-lookup3.c.

Function Documentation

uint32_t hashbig ( const void *  key,
size_t  length,
uint32_t  initval 
)

Definition at line 818 of file util-hash-lookup3.c.

References HASH_BIG_ENDIAN, hashlittle(), hashlittle2(), hashword(), hashword2(), len, m, main(), and mix.

Here is the call graph for this function:

uint32_t hashlittle ( const void *  key,
size_t  length,
uint32_t  initval 
)

Definition at line 283 of file util-hash-lookup3.c.

References HASH_LITTLE_ENDIAN, and mix.

Referenced by hashbig().

Here is the caller graph for this function:

void hashlittle2 ( const void *  key,
size_t  length,
uint32_t *  pc,
uint32_t *  pb 
)

Definition at line 637 of file util-hash-lookup3.c.

References HASH_LITTLE_ENDIAN, mix, and pc.

Referenced by hashbig().

Here is the caller graph for this function:

uint32_t hashlittle_safe ( const void *  key,
size_t  length,
uint32_t  initval 
)

Definition at line 484 of file util-hash-lookup3.c.

References HASH_LITTLE_ENDIAN, and mix.

Referenced by DetectBufferTypeMaxId().

Here is the caller graph for this function:

uint32_t hashword ( const uint32_t *  k,
size_t  length,
uint32_t  initval 
)

Definition at line 174 of file util-hash-lookup3.c.

References mix.

Referenced by FlowKeyGetHash(), hashbig(), HostCleanup(), IPPairCleanup(), ROHashInitFinalize(), and ROHashLookup().

Here is the caller graph for this function:

void hashword2 ( const uint32_t *  k,
size_t  length,
uint32_t *  pc,
uint32_t *  pb 
)

Definition at line 218 of file util-hash-lookup3.c.

References mix.

Referenced by hashbig().

Here is the caller graph for this function: