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)
 
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 responsibility

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 234 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 270 of file util-hashlist.c.

References HashListTable_::array_size.

◆ HashListTableGetListHead()

HashListTableBucket* HashListTableGetListHead ( HashListTable ht)

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

References HashListTable_::listhead.

Referenced by DumpPatterns(), 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()

◆ HashListTableRegisterTests()

void HashListTableRegisterTests ( void  )

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

References UtRegisterTest().

Here is the call graph for this function:

◆ HashListTableRemove()