suricata
util-hashlist.c File Reference
#include "suricata-common.h"
#include "util-hashlist.h"
#include "util-unittest.h"
#include "util-debug.h"
#include "util-memcmp.h"
Include dependency graph for util-hashlist.c:

Go to the source code of this file.

Functions

HashListTableHashListTableInit (uint32_t size, uint32_t(*Hash)(struct HashListTable_ *, void *, uint16_t), char(*Compare)(void *, uint16_t, void *, uint16_t), void(*Free)(void *))
 
void HashListTableFree (HashListTable *ht)
 
void HashListTablePrint (HashListTable *ht)
 
int HashListTableAdd (HashListTable *ht, void *data, uint16_t datalen)
 
int HashListTableRemove (HashListTable *ht, void *data, uint16_t datalen)
 
char HashListTableDefaultCompare (void *data1, uint16_t len1, void *data2, uint16_t len2)
 
void * HashListTableLookup (HashListTable *ht, void *data, uint16_t datalen)
 
uint32_t HashListTableGenericHash (HashListTable *ht, void *data, uint16_t datalen)
 
HashListTableBucketHashListTableGetListHead (HashListTable *ht)
 
void HashListTableRegisterTests (void)
 

Detailed Description

Author
Victor Julien victo.nosp@m.r@in.nosp@m.linia.nosp@m.c.ne.nosp@m.t

Chained hash table implementation

The 'Free' pointer can be used to have the API free your hashed data. If it's NULL it's the callers responsebility

Definition in file util-hashlist.c.

Function Documentation

char HashListTableDefaultCompare ( void *  data1,
uint16_t  len1,
void *  data2,
uint16_t  len2 
)

Definition at line 237 of file util-hashlist.c.

References SCMemcmp.

Referenced by HashListTableInit().

Here is the caller graph for this function:

uint32_t HashListTableGenericHash ( HashListTable ht,
void *  data,
uint16_t  datalen 
)

Definition at line 273 of file util-hashlist.c.

References HashListTable_::array_size.

Referenced by HashListTableGetListHead().

Here is the caller graph for this function:

HashListTable* HashListTableInit ( uint32_t  size,
uint32_t(*)(struct HashListTable_ *, void *, uint16_t)  Hash,
char(*)(void *, uint16_t, void *, uint16_t)  Compare,
void(*)(void *)  Free 
)
void HashListTablePrint ( HashListTable ht)

Definition at line 108 of file util-hashlist.c.

References HashListTable_::array_size, and HashListTable_::Hash.

void HashListTableRegisterTests ( void  )

Definition at line 501 of file util-hashlist.c.

References UtRegisterTest().

Here is the call graph for this function: