24#ifndef SURICATA_FLOW_QUEUE_H
25#define SURICATA_FLOW_QUEUE_H
35 #error Cannot enable both FQLOCK_SPIN and FQLOCK_MUTEX
53#elif defined FQLOCK_SPIN
56 #error Enable FQLOCK_SPIN or FQLOCK_MUTEX
64 #define FQLOCK_INIT(q) SCSpinInit(&(q)->s, 0)
65 #define FQLOCK_DESTROY(q) SCSpinDestroy(&(q)->s)
66 #define FQLOCK_LOCK(q) SCSpinLock(&(q)->s)
67 #define FQLOCK_TRYLOCK(q) SCSpinTrylock(&(q)->s)
68 #define FQLOCK_UNLOCK(q) SCSpinUnlock(&(q)->s)
69#elif defined FQLOCK_MUTEX
70 #define FQLOCK_INIT(q) SCMutexInit(&(q)->m, NULL)
71 #define FQLOCK_DESTROY(q) SCMutexDestroy(&(q)->m)
72 #define FQLOCK_LOCK(q) SCMutexLock(&(q)->m)
73 #define FQLOCK_TRYLOCK(q) SCMutexTrylock(&(q)->m)
74 #define FQLOCK_UNLOCK(q) SCMutexUnlock(&(q)->m)
76 #error Enable FQLOCK_SPIN or FQLOCK_MUTEX
struct FlowQueue_ FlowQueue
void FlowQueuePrivatePrependFlow(FlowQueuePrivate *fqc, Flow *f)
void FlowQueuePrivateAppendFlow(FlowQueuePrivate *fqc, Flow *f)
void FlowEnqueue(FlowQueue *, Flow *)
add a flow to a queue
FlowQueue * FlowQueueNew(void)
void FlowQueueRemove(FlowQueue *fq, Flow *f)
struct FlowQueuePrivate_ FlowQueuePrivate
FlowQueuePrivate FlowQueueExtractPrivate(FlowQueue *fq)
FlowQueue * FlowQueueInit(FlowQueue *)
Flow * FlowQueuePrivateGetFromTop(FlowQueuePrivate *fqp)
void FlowQueuePrivateAppendPrivate(FlowQueuePrivate *dest, FlowQueuePrivate *src)
void FlowQueueAppendPrivate(FlowQueue *fq, FlowQueuePrivate *fqp)
Flow * FlowDequeue(FlowQueue *)
remove a flow from the queue
void FlowQueueDestroy(FlowQueue *)
Destroy a flow queue.
SC_ATOMIC_DECLARE(bool, non_empty)