suricata
flow-queue.h File Reference
#include "suricata-common.h"
#include "flow.h"
Include dependency graph for flow-queue.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  FlowQueuePrivate_
 
struct  FlowQueue_
 

Macros

#define FQLOCK_MUTEX
 
#define qtop   priv.top
 
#define qbot   priv.bot
 
#define qlen   priv.len
 
#define FQLOCK_INIT(q)   SCMutexInit(&(q)->m, NULL)
 
#define FQLOCK_DESTROY(q)   SCMutexDestroy(&(q)->m)
 
#define FQLOCK_LOCK(q)   SCMutexLock(&(q)->m)
 
#define FQLOCK_TRYLOCK(q)   SCMutexTrylock(&(q)->m)
 
#define FQLOCK_UNLOCK(q)   SCMutexUnlock(&(q)->m)
 

Typedefs

typedef struct FlowQueuePrivate_ FlowQueuePrivate
 
typedef struct FlowQueue_ FlowQueue
 

Functions

FlowQueueFlowQueueNew (void)
 
FlowQueueFlowQueueInit (FlowQueue *)
 
void FlowQueueDestroy (FlowQueue *)
 Destroy a flow queue. More...
 
void FlowEnqueue (FlowQueue *, Flow *)
 add a flow to a queue More...
 
FlowFlowDequeue (FlowQueue *)
 remove a flow from the queue More...
 
void FlowQueueRemove (FlowQueue *fq, Flow *f)
 
void FlowQueuePrivateAppendFlow (FlowQueuePrivate *fqc, Flow *f)
 
void FlowQueuePrivatePrependFlow (FlowQueuePrivate *fqc, Flow *f)
 
void FlowQueueAppendPrivate (FlowQueue *fq, FlowQueuePrivate *fqp)
 
void FlowQueuePrivateAppendPrivate (FlowQueuePrivate *dest, FlowQueuePrivate *src)
 
FlowQueuePrivate FlowQueueExtractPrivate (FlowQueue *fq)
 
FlowFlowQueuePrivateGetFromTop (FlowQueuePrivate *fqp)
 

Detailed Description

Author
Victor Julien victo.nosp@m.r@in.nosp@m.linia.nosp@m.c.ne.nosp@m.t

Definition in file flow-queue.h.

Macro Definition Documentation

◆ FQLOCK_DESTROY

#define FQLOCK_DESTROY (   q)    SCMutexDestroy(&(q)->m)

Definition at line 73 of file flow-queue.h.

◆ FQLOCK_INIT

#define FQLOCK_INIT (   q)    SCMutexInit(&(q)->m, NULL)

Definition at line 72 of file flow-queue.h.

◆ FQLOCK_LOCK

#define FQLOCK_LOCK (   q)    SCMutexLock(&(q)->m)

Definition at line 74 of file flow-queue.h.

◆ FQLOCK_MUTEX

#define FQLOCK_MUTEX

Spinlocks or Mutex for the flow queues.

Definition at line 33 of file flow-queue.h.

◆ FQLOCK_TRYLOCK

#define FQLOCK_TRYLOCK (   q)    SCMutexTrylock(&(q)->m)

Definition at line 75 of file flow-queue.h.

◆ FQLOCK_UNLOCK

#define FQLOCK_UNLOCK (   q)    SCMutexUnlock(&(q)->m)

Definition at line 76 of file flow-queue.h.

◆ qbot

#define qbot   priv.bot

Definition at line 62 of file flow-queue.h.

◆ qlen

#define qlen   priv.len

Definition at line 63 of file flow-queue.h.

◆ qtop

#define qtop   priv.top

Definition at line 61 of file flow-queue.h.

Typedef Documentation

◆ FlowQueue

typedef struct FlowQueue_ FlowQueue

◆ FlowQueuePrivate

Function Documentation

◆ FlowDequeue()

Flow* FlowDequeue ( FlowQueue q)

remove a flow from the queue

Parameters
qqueue
Return values
fflow or NULL if empty list.

Definition at line 191 of file flow-queue.c.

References FlowQueuePrivateGetFromTop(), FQLOCK_LOCK, and FlowQueue_::priv.

Referenced by FlowShutdown().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FlowEnqueue()

void FlowEnqueue ( FlowQueue q,
Flow f 
)

add a flow to a queue

Parameters
qqueue
fflow

Definition at line 173 of file flow-queue.c.

References BUG_ON, FlowQueuePrivateAppendFlow(), FQLOCK_LOCK, and FlowQueue_::priv.

Here is the call graph for this function:

◆ FlowQueueAppendPrivate()

void FlowQueueAppendPrivate ( FlowQueue fq,
FlowQueuePrivate fqp 
)

◆ FlowQueueDestroy()

void FlowQueueDestroy ( FlowQueue q)

Destroy a flow queue.

Parameters
qthe flow queue to destroy

Definition at line 60 of file flow-queue.c.

References FQLOCK_DESTROY.

Referenced by FlowShutdown().

Here is the caller graph for this function:

◆ FlowQueueExtractPrivate()

FlowQueuePrivate FlowQueueExtractPrivate ( FlowQueue fq)

Definition at line 140 of file flow-queue.c.

References FQLOCK_LOCK, and FlowQueue_::priv.

◆ FlowQueueInit()

FlowQueue* FlowQueueInit ( FlowQueue )

Definition at line 46 of file flow-queue.c.

References FQLOCK_INIT.

Referenced by FlowInitConfig(), and FlowQueueNew().

Here is the caller graph for this function:

◆ FlowQueueNew()

FlowQueue* FlowQueueNew ( void  )

Definition at line 35 of file flow-queue.c.

References FlowQueueInit(), SCLogError, and SCMalloc.

Here is the call graph for this function:

◆ FlowQueuePrivateAppendFlow()

void FlowQueuePrivateAppendFlow ( FlowQueuePrivate fqc,
Flow f 
)

Definition at line 65 of file flow-queue.c.

References FlowQueuePrivate_::bot, FlowQueuePrivate_::len, Flow_::next, and FlowQueuePrivate_::top.

Referenced by FlowEnqueue().

Here is the caller graph for this function:

◆ FlowQueuePrivateAppendPrivate()

void FlowQueuePrivateAppendPrivate ( FlowQueuePrivate dest,
FlowQueuePrivate src 
)

◆ FlowQueuePrivateGetFromTop()

Flow* FlowQueuePrivateGetFromTop ( FlowQueuePrivate fqp)

Definition at line 151 of file flow-queue.c.

References FlowQueuePrivate_::bot, FlowQueuePrivate_::len, Flow_::next, and FlowQueuePrivate_::top.

Referenced by FlowDequeue(), and UTHBuildPacketOfFlows().

Here is the caller graph for this function:

◆ FlowQueuePrivatePrependFlow()

void FlowQueuePrivatePrependFlow ( FlowQueuePrivate fqc,
Flow f 
)

◆ FlowQueueRemove()

void FlowQueueRemove ( FlowQueue fq,
Flow f 
)