suricata
|
#include "suricata-common.h"
#include "conf.h"
#include "defrag-hash.h"
#include "defrag-queue.h"
#include "defrag-config.h"
#include "util-random.h"
#include "util-byte.h"
#include "util-misc.h"
#include "util-hash-lookup3.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... | |
uint32_t | DefragTrackerSpareQueueGetSize (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 (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 446 of file defrag-hash.c.
#define DEFRAG_DEFAULT_HASHSIZE 4096 |
Definition at line 161 of file defrag-hash.c.
#define DEFRAG_DEFAULT_MEMCAP 16777216 |
Definition at line 162 of file defrag-hash.c.
#define DEFRAG_DEFAULT_PREALLOC 1000 |
Definition at line 163 of file defrag-hash.c.
#define DefragTrackerDecrUsecnt | ( | dt | ) | SC_ATOMIC_SUB((dt)->use_cnt, 1) |
Definition at line 124 of file defrag-hash.c.
#define DefragTrackerIncrUsecnt | ( | dt | ) | SC_ATOMIC_ADD((dt)->use_cnt, 1) |
Definition at line 122 of file defrag-hash.c.
typedef struct DefragHashKey4_ DefragHashKey4 |
typedef struct DefragHashKey6_ DefragHashKey6 |
DefragTracker* DefragGetTrackerFromHash | ( | Packet * | p | ) |
Definition at line 535 of file defrag-hash.c.
void DefragHashShutdown | ( | void | ) |
shutdown the flow engine
Definition at line 302 of file defrag-hash.c.
Referenced by DefragDestroy().
void DefragInitConfig | ( | bool | quiet | ) |
initialize the configuration
set config values for memcap, prealloc and hash_size
Definition at line 166 of file defrag-hash.c.
References defrag_config, DefragTrackerQueueInit(), 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 634 of file defrag-hash.c.
void DefragTrackerClearMemory | ( | DefragTracker * | dt | ) |
Definition at line 155 of file defrag-hash.c.
References DefragTrackerFreeFrags().
uint64_t DefragTrackerGetMemcap | ( | void | ) |
Return memcap value.
memcap | value |
Definition at line 60 of file defrag-hash.c.
References defrag_config, and SC_ATOMIC_GET.
uint64_t DefragTrackerGetMemuse | ( | void | ) |
Return memuse value.
memuse | value |
Definition at line 71 of file defrag-hash.c.
References SC_ATOMIC_GET.
void DefragTrackerMoveToSpare | ( | DefragTracker * | h | ) |
Definition at line 82 of file defrag-hash.c.
References DefragTrackerEnqueue().
void DefragTrackerRelease | ( | DefragTracker * | t | ) |
Definition at line 149 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 45 of file defrag-hash.c.
References defrag_config, SC_ATOMIC_GET, and SC_ATOMIC_SET.
uint32_t DefragTrackerSpareQueueGetSize | ( | void | ) |
Definition at line 77 of file defrag-hash.c.
References DefragTrackerQueueLen().
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 30 of file defrag-hash.c.
Referenced by DefragInitConfig(), DefragTrackerGetMemcap(), and DefragTrackerSetMemcap().
DefragTrackerHashRow* defragtracker_hash |
defrag tracker hash table
Definition at line 29 of file defrag-hash.c.