suricata
flow-queue.c File Reference
#include "suricata-common.h"
#include "threads.h"
#include "debug.h"
#include "flow-private.h"
#include "flow-queue.h"
#include "flow-util.h"
#include "util-error.h"
#include "util-debug.h"
#include "util-print.h"
Include dependency graph for flow-queue.c:

Go to the source code of this file.

Functions

FlowQueueFlowQueueNew ()
 
FlowQueueFlowQueueInit (FlowQueue *q)
 
void FlowQueueDestroy (FlowQueue *q)
 Destroy a flow queue. More...
 
void FlowEnqueue (FlowQueue *q, Flow *f)
 add a flow to a queue More...
 
FlowFlowDequeue (FlowQueue *q)
 remove a flow from the queue More...
 
void FlowMoveToSpare (Flow *f)
 Transfer a flow from a queue to the spare queue. More...
 

Detailed Description

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

Flow queue handler functions

Definition in file flow-queue.c.

Function Documentation

Flow* FlowDequeue ( FlowQueue q)

remove a flow from the queue

Parameters
qqueue
Return values
fflow or NULL if empty list.

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

References FlowQueue_::bot, BUG_ON, FQLOCK_LOCK, FQLOCK_UNLOCK, FlowQueue_::len, Flow_::lnext, Flow_::lprev, and FlowQueue_::top.

Referenced by FlowSetupPacket(), FlowShutdown(), and FlowUpdateSpareFlows().

Here is the caller graph for this function:

void FlowEnqueue ( FlowQueue q,
Flow f 
)

add a flow to a queue

Parameters
qqueue
fflow

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

References FlowQueue_::bot, BUG_ON, FQLOCK_LOCK, FQLOCK_UNLOCK, FlowQueue_::len, Flow_::lnext, Flow_::lprev, and FlowQueue_::top.

Referenced by FlowDisableFlowManagerThread(), FlowInitConfig(), and FlowUpdateSpareFlows().

Here is the caller graph for this function:

void FlowMoveToSpare ( Flow f)

Transfer a flow from a queue to the spare queue.

Parameters
fthe flow to be transfered
qthe source queue, where the flow will be removed. This queue is locked.
Note
spare queue needs locking

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

References FlowQueue_::bot, flow_spare_q, FQLOCK_LOCK, FQLOCK_UNLOCK, FlowQueue_::len, Flow_::lnext, Flow_::lprev, and FlowQueue_::top.

void FlowQueueDestroy ( FlowQueue q)

Destroy a flow queue.

Parameters
qthe flow queue to destroy

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

References FQLOCK_DESTROY.

Referenced by FlowShutdown(), and TmModuleFlowRecyclerRegister().

Here is the caller graph for this function:

FlowQueue* FlowQueueInit ( FlowQueue q)

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

References FQLOCK_INIT.

Referenced by FlowInitConfig(), FlowQueueNew(), and TmModuleFlowRecyclerRegister().

Here is the caller graph for this function:

FlowQueue* FlowQueueNew ( void  )

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

References FlowQueueInit(), SC_ERR_FATAL, SCLogError, and SCMalloc.

Here is the call graph for this function: