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.


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

Victor Julien

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

◆ HashListTableAdd()

◆ HashListTableDefaultCompare()

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:

◆ HashListTableFree()

◆ HashListTableGenericHash()

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

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

References HashListTable_::array_size.

◆ HashListTableGetListHead()

HashListTableBucket* HashListTableGetListHead ( HashListTable ht)

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

References HashListTable_::listhead.

Referenced by FeatureDump(), and MpmStoreReportStats().

Here is the caller graph for this function:

◆ HashListTableInit()

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

◆ HashListTableLookup()

void* HashListTableLookup ( HashListTable ht,
void *  data,
uint16_t  datalen 

◆ HashListTablePrint()

void HashListTablePrint ( HashListTable ht)

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

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

◆ HashListTableRegisterTests()

void HashListTableRegisterTests ( void  )

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

References UtRegisterTest().

Here is the call graph for this function:

◆ HashListTableRemove()