Go to the documentation of this file.
24 #ifndef SURICATA_FLOW_HASH_H
25 #define SURICATA_FLOW_HASH_H
35 #error Cannot enable both FBLOCK_SPIN and FBLOCK_MUTEX
51 #elif defined FBLOCK_SPIN
54 #error Enable FBLOCK_SPIN or FBLOCK_MUTEX
65 #define FBLOCK_INIT(fb) SCSpinInit(&(fb)->s, 0)
66 #define FBLOCK_DESTROY(fb) SCSpinDestroy(&(fb)->s)
67 #define FBLOCK_LOCK(fb) SCSpinLock(&(fb)->s)
68 #define FBLOCK_TRYLOCK(fb) SCSpinTrylock(&(fb)->s)
69 #define FBLOCK_UNLOCK(fb) SCSpinUnlock(&(fb)->s)
70 #elif defined FBLOCK_MUTEX
71 #define FBLOCK_INIT(fb) SCMutexInit(&(fb)->m, NULL)
72 #define FBLOCK_DESTROY(fb) SCMutexDestroy(&(fb)->m)
73 #define FBLOCK_LOCK(fb) SCMutexLock(&(fb)->m)
74 #define FBLOCK_TRYLOCK(fb) SCMutexTrylock(&(fb)->m)
75 #define FBLOCK_UNLOCK(fb) SCMutexUnlock(&(fb)->m)
77 #error Enable FBLOCK_SPIN or FBLOCK_MUTEX
90 static inline void RemoveFromHash(
Flow *f,
Flow *prev_f)
92 FlowBucket *fb = f->
fb;
SC_ATOMIC_DECLARE(uint32_t, next_ts)
uint32_t FlowKeyGetHash(FlowKey *flow_key)
Flow * FlowGetFlowFromHash(ThreadVars *tv, FlowLookupStruct *tctx, Packet *, Flow **)
Get Flow for packet.
Per thread variable structure.
Flow * FlowGetExistingFlowFromFlowId(int64_t flow_id)
Look for existing Flow using a flow id value.
Flow * FlowGetFromFlowKey(FlowKey *key, struct timespec *ttime, const uint32_t hash)
Get or create a Flow using a FlowKey.
uint32_t FlowGetIpPairProtoHash(const Packet *p)
struct FlowBucket_ __attribute__((aligned(CLS))) FlowBucket