|
suricata
|

Go to the source code of this file.
Data Structures | |
| struct | ROHashTable_ |
Typedefs | |
| typedef struct ROHashTable_ | ROHashTable |
Functions | |
| ROHashTable * | ROHashInit (uint8_t hash_bits, uint16_t item_size) |
| initialize a new rohash More... | |
| int | ROHashInitFinalize (ROHashTable *table) |
| create final hash data structure More... | |
| void | ROHashFree (ROHashTable *table) |
| int | ROHashInitQueueValue (ROHashTable *table, void *value, uint16_t size) |
| Add a new value to the hash. More... | |
| uint32_t | ROHashMemorySize (ROHashTable *table) |
| void * | ROHashLookup (ROHashTable *table, void *data, uint16_t size) |
Definition in file util-rohash.h.
| typedef struct ROHashTable_ ROHashTable |
| void ROHashFree | ( | ROHashTable * | table | ) |
Definition at line 91 of file util-rohash.c.
References ROHashTable_::data, and SCFree.
Referenced by DetectFileHashFree().

| ROHashTable* ROHashInit | ( | uint8_t | hash_bits, |
| uint16_t | item_size | ||
| ) |
initialize a new rohash
| hash_bits | hash size as 2^hash_bits, so power of 2, max 31 |
| item_size | size of the data to store |
| table | ptr or NULL on error |
Definition at line 64 of file util-rohash.c.
References ROHashTable_::hash_bits, hashsize, ROHashTable_::item_size, ROHashTable_::items, SCCalloc, SCLogError, TAILQ_INIT, and unlikely.
| int ROHashInitFinalize | ( | ROHashTable * | table | ) |
create final hash data structure
| table | the hash table |
| 0 | error |
| 1 | ok |
Definition at line 181 of file util-rohash.c.
References ROHashTableOffsets_::cnt, ROHashTable_::data, ROHashTable_::hash_bits, hashmask, hashsize, hashword(), ROHashTable_::item_size, ROHashTable_::items, ROHashTable_::locked, next, offset, ROHashTableOffsets_::offset, ROHashTableItem_::pos, SCCalloc, SCFree, SCLogError, TAILQ_FIRST, TAILQ_FOREACH, and TAILQ_REMOVE.

| int ROHashInitQueueValue | ( | ROHashTable * | table, |
| void * | value, | ||
| uint16_t | size | ||
| ) |
Add a new value to the hash.
| table | the hash table |
| value | value to add |
| size | value size. MUST match table item_size |
| 0 | error |
| 1 | ok |
Definition at line 151 of file util-rohash.c.
References ROHashTable_::item_size, ROHashTable_::locked, next, SCCalloc, SCLogError, and TAILQ_INSERT_TAIL.
Referenced by LoadHashTable().

| void* ROHashLookup | ( | ROHashTable * | table, |
| void * | data, | ||
| uint16_t | size | ||
| ) |
| NULL | not found |
| ptr | found |
Definition at line 113 of file util-rohash.c.
References ROHashTableOffsets_::cnt, ROHashTable_::data, ROHashTable_::hash_bits, hashmask, hashword(), ROHashTable_::item_size, offset, ROHashTableOffsets_::offset, SCMemcmp, and SCReturnPtr.

| uint32_t ROHashMemorySize | ( | ROHashTable * | table | ) |
Definition at line 102 of file util-rohash.c.
References ROHashTable_::hash_bits, hashsize, ROHashTable_::item_size, and ROHashTable_::items.