Go to the documentation of this file.
24 #ifndef SURICATA_DEFRAG_HASH_H
25 #define SURICATA_DEFRAG_HASH_H
38 #error Cannot enable both DRLOCK_SPIN and DRLOCK_MUTEX
43 #define DRLOCK_TYPE SCSpinlock
44 #define DRLOCK_INIT(fb) SCSpinInit(&(fb)->lock, 0)
45 #define DRLOCK_DESTROY(fb) SCSpinDestroy(&(fb)->lock)
46 #define DRLOCK_LOCK(fb) SCSpinLock(&(fb)->lock)
47 #define DRLOCK_TRYLOCK(fb) SCSpinTrylock(&(fb)->lock)
48 #define DRLOCK_UNLOCK(fb) SCSpinUnlock(&(fb)->lock)
49 #elif defined DRLOCK_MUTEX
50 #define DRLOCK_TYPE SCMutex
51 #define DRLOCK_INIT(fb) SCMutexInit(&(fb)->lock, NULL)
52 #define DRLOCK_DESTROY(fb) SCMutexDestroy(&(fb)->lock)
53 #define DRLOCK_LOCK(fb) SCMutexLock(&(fb)->lock)
54 #define DRLOCK_TRYLOCK(fb) SCMutexTrylock(&(fb)->lock)
55 #define DRLOCK_UNLOCK(fb) SCMutexUnlock(&(fb)->lock)
57 #error Enable DRLOCK_SPIN or DRLOCK_MUTEX
83 #define DEFRAG_CHECK_MEMCAP(size) \
84 ((((uint64_t)SC_ATOMIC_GET(defrag_memuse) + (uint64_t)(size)) <= SC_ATOMIC_GET(defrag_config.memcap)))
DefragTracker * DefragLookupTrackerFromHash(Packet *)
look up a tracker in the hash
struct DefragConfig_ DefragConfig
void DefragHashShutdown(void)
shutdown the flow engine
void DefragTrackerRelease(DefragTracker *)
void DefragTrackerMoveToSpare(DefragTracker *)
struct DefragTrackerHashRow_ DefragTrackerHashRow
DefragConfig defrag_config
uint64_t DefragTrackerGetMemuse(void)
Return memuse value.
Per thread variable structure.
void DefragInitConfig(bool quiet)
initialize the configuration
enum ExceptionPolicy DefragGetMemcapExceptionPolicy(void)
uint64_t DefragTrackerGetMemcap(void)
Return memcap value.
int DefragTrackerSetMemcap(uint64_t)
Update memcap value.
enum ExceptionPolicy memcap_policy
void DefragTrackerClearMemory(DefragTracker *)
DefragTrackerHashRow * defragtracker_hash
SC_ATOMIC_EXTERN(uint64_t, defrag_memuse)
Structure to hold thread specific data for all decode modules.
DefragTracker * DefragGetTrackerFromHash(ThreadVars *tv, DecodeThreadVars *dtv, Packet *)
SC_ATOMIC_DECLARE(uint64_t, memcap)