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