|
suricata
|
#include "suricata-common.h"#include "conf.h"#include "defrag-hash.h"#include "defrag-stack.h"#include "defrag-config.h"#include "defrag-timeout.h"#include "util-random.h"#include "util-byte.h"#include "util-misc.h"#include "util-hash-lookup3.h"#include "util-validate.h"
Go to the source code of this file.
Data Structures | |
| struct | DefragHashKey4_ |
| struct | DefragHashKey6_ |
Macros | |
| #define | DefragTrackerIncrUsecnt(dt) SC_ATOMIC_ADD((dt)->use_cnt, 1) |
| #define | DefragTrackerDecrUsecnt(dt) SC_ATOMIC_SUB((dt)->use_cnt, 1) |
| #define | DEFRAG_DEFAULT_HASHSIZE 4096 |
| #define | DEFRAG_DEFAULT_MEMCAP 16777216 |
| #define | DEFRAG_DEFAULT_PREALLOC 1000 |
| #define | CMP_DEFRAGTRACKER(d1, d2, id) |
Typedefs | |
| typedef struct DefragHashKey4_ | DefragHashKey4 |
| typedef struct DefragHashKey6_ | DefragHashKey6 |
Functions | |
| SC_ATOMIC_DECLARE (uint64_t, defrag_memuse) | |
| SC_ATOMIC_DECLARE (unsigned int, defragtracker_counter) | |
| SC_ATOMIC_DECLARE (unsigned int, defragtracker_prune_idx) | |
| int | DefragTrackerSetMemcap (uint64_t size) |
| Update memcap value. More... | |
| uint64_t | DefragTrackerGetMemcap (void) |
| Return memcap value. More... | |
| uint64_t | DefragTrackerGetMemuse (void) |
| Return memuse value. More... | |
| enum ExceptionPolicy | DefragGetMemcapExceptionPolicy (void) |
| void | DefragTrackerMoveToSpare (DefragTracker *h) |
| void | DefragTrackerRelease (DefragTracker *t) |
| void | DefragTrackerClearMemory (DefragTracker *dt) |
| void | DefragInitConfig (bool quiet) |
| initialize the configuration More... | |
| void | DefragHashShutdown (void) |
| shutdown the flow engine More... | |
| DefragTracker * | DefragGetTrackerFromHash (ThreadVars *tv, DecodeThreadVars *dtv, Packet *p) |
| DefragTracker * | DefragLookupTrackerFromHash (Packet *p) |
| look up a tracker in the hash More... | |
Variables | |
| DefragTrackerHashRow * | defragtracker_hash |
| DefragConfig | defrag_config |
| #define CMP_DEFRAGTRACKER | ( | d1, | |
| d2, | |||
| id | |||
| ) |
Definition at line 433 of file defrag-hash.c.
| #define DEFRAG_DEFAULT_HASHSIZE 4096 |
Definition at line 164 of file defrag-hash.c.
| #define DEFRAG_DEFAULT_MEMCAP 16777216 |
Definition at line 165 of file defrag-hash.c.
| #define DEFRAG_DEFAULT_PREALLOC 1000 |
Definition at line 166 of file defrag-hash.c.
| #define DefragTrackerDecrUsecnt | ( | dt | ) | SC_ATOMIC_SUB((dt)->use_cnt, 1) |
Definition at line 125 of file defrag-hash.c.
| #define DefragTrackerIncrUsecnt | ( | dt | ) | SC_ATOMIC_ADD((dt)->use_cnt, 1) |
Definition at line 123 of file defrag-hash.c.
| typedef struct DefragHashKey4_ DefragHashKey4 |
| typedef struct DefragHashKey6_ DefragHashKey6 |
| enum ExceptionPolicy DefragGetMemcapExceptionPolicy | ( | void | ) |
Definition at line 74 of file defrag-hash.c.
| DefragTracker* DefragGetTrackerFromHash | ( | ThreadVars * | tv, |
| DecodeThreadVars * | dtv, | ||
| Packet * | p | ||
| ) |
Definition at line 525 of file defrag-hash.c.
| void DefragHashShutdown | ( | void | ) |
shutdown the flow engine
Definition at line 292 of file defrag-hash.c.
References DefragTrackerDequeue().
Referenced by DefragDestroy().


| void DefragInitConfig | ( | bool | quiet | ) |
initialize the configuration
set config values for memcap, prealloc and hash_size
Definition at line 169 of file defrag-hash.c.
References defrag_config, DefragTrackerStackInit(), SC_ATOMIC_INIT, and SCLogDebug.

| DefragTracker* DefragLookupTrackerFromHash | ( | Packet * | p | ) |
look up a tracker in the hash
| a | address to look up |
| h | LOCKED tracker or NULL |
Definition at line 620 of file defrag-hash.c.
| void DefragTrackerClearMemory | ( | DefragTracker * | dt | ) |
Definition at line 158 of file defrag-hash.c.
References DefragTrackerFreeFrags().

| uint64_t DefragTrackerGetMemcap | ( | void | ) |
Return memcap value.
| memcap | value |
Definition at line 63 of file defrag-hash.c.
References defrag_config, and SC_ATOMIC_GET.
| uint64_t DefragTrackerGetMemuse | ( | void | ) |
Return memuse value.
| memuse | value |
Definition at line 74 of file defrag-hash.c.
References SC_ATOMIC_GET.
| void DefragTrackerMoveToSpare | ( | DefragTracker * | h | ) |
Definition at line 85 of file defrag-hash.c.
References DefragTrackerEnqueue().

| void DefragTrackerRelease | ( | DefragTracker * | t | ) |
Definition at line 152 of file defrag-hash.c.
References DefragTrackerDecrUsecnt, DefragTracker_::lock, and SCMutexUnlock.
| int DefragTrackerSetMemcap | ( | uint64_t | size | ) |
Update memcap value.
| size | new memcap value |
Definition at line 48 of file defrag-hash.c.
References defrag_config, SC_ATOMIC_GET, and SC_ATOMIC_SET.
| SC_ATOMIC_DECLARE | ( | uint64_t | , |
| defrag_memuse | |||
| ) |
| SC_ATOMIC_DECLARE | ( | unsigned int | , |
| defragtracker_counter | |||
| ) |
| SC_ATOMIC_DECLARE | ( | unsigned int | , |
| defragtracker_prune_idx | |||
| ) |
| DefragConfig defrag_config |
Definition at line 32 of file defrag-hash.c.
Referenced by DefragInitConfig(), DefragTimeoutHash(), DefragTrackerGetMemcap(), and DefragTrackerSetMemcap().
| DefragTrackerHashRow* defragtracker_hash |
defrag tracker hash table
Definition at line 31 of file defrag-hash.c.
Referenced by DefragTimeoutHash().