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 * DefragGetTrackerFromHash(ThreadVars *tv, DecodeThreadVars *dtv, Packet *)
DefragConfig defrag_config
uint64_t DefragTrackerGetMemcap(void)
Return memcap value.
void DefragTrackerClearMemory(DefragTracker *)
struct DefragTrackerHashRow_ DefragTrackerHashRow
void DefragTrackerRelease(DefragTracker *)
DefragTracker * DefragLookupTrackerFromHash(Packet *)
look up a tracker in the hash
uint64_t DefragTrackerGetMemuse(void)
Return memuse value.
void DefragTrackerMoveToSpare(DefragTracker *)
enum ExceptionPolicy DefragGetMemcapExceptionPolicy(void)
struct DefragConfig_ DefragConfig
void DefragInitConfig(bool quiet)
initialize the configuration
DefragTrackerHashRow * defragtracker_hash
void DefragHashShutdown(void)
shutdown the flow engine
int DefragTrackerSetMemcap(uint64_t)
Update memcap value.
Structure to hold thread specific data for all decode modules.
enum ExceptionPolicy memcap_policy
SC_ATOMIC_DECLARE(uint64_t, memcap)
Per thread variable structure.
#define SC_ATOMIC_EXTERN(type, name)
wrapper for referencing an atomic variable declared on another file.