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

Go to the source code of this file.

Data Structures

struct  DefragTrackerQueue_
 

Macros

#define DQLOCK_MUTEX
 
#define DQLOCK_INIT(q)   SCMutexInit(&(q)->m, NULL)
 
#define DQLOCK_DESTROY(q)   SCMutexDestroy(&(q)->m)
 
#define DQLOCK_LOCK(q)   SCMutexLock(&(q)->m)
 
#define DQLOCK_TRYLOCK(q)   SCMutexTrylock(&(q)->m)
 
#define DQLOCK_UNLOCK(q)   SCMutexUnlock(&(q)->m)
 

Typedefs

typedef struct DefragTrackerQueue_ DefragTrackerQueue
 

Functions

DefragTrackerQueueDefragTrackerQueueNew (void)
 
DefragTrackerQueueDefragTrackerQueueInit (DefragTrackerQueue *)
 
void DefragTrackerQueueDestroy (DefragTrackerQueue *)
 Destroy a tracker queue. More...
 
void DefragTrackerEnqueue (DefragTrackerQueue *, DefragTracker *)
 add a tracker to a queue More...
 
DefragTrackerDefragTrackerDequeue (DefragTrackerQueue *)
 remove a tracker from the queue More...
 
uint32_t DefragTrackerQueueLen (DefragTrackerQueue *)
 

Detailed Description

Macro Definition Documentation

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

Definition at line 66 of file defrag-queue.h.

Referenced by DefragTrackerQueueDestroy().

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

Definition at line 65 of file defrag-queue.h.

Referenced by DefragTrackerQueueInit().

#define DQLOCK_LOCK (   q)    SCMutexLock(&(q)->m)
#define DQLOCK_MUTEX

Spinlocks or Mutex for the defrag tracker queues.

Definition at line 32 of file defrag-queue.h.

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

Definition at line 68 of file defrag-queue.h.

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

Typedef Documentation

Function Documentation

DefragTracker* DefragTrackerDequeue ( DefragTrackerQueue q)

remove a tracker from the queue

Parameters
qqueue
Return values
dttracker or NULL if empty list.

Definition at line 103 of file defrag-queue.c.

References DefragTrackerQueue_::bot, BUG_ON, DQLOCK_LOCK, DQLOCK_UNLOCK, DefragTrackerQueue_::len, DefragTracker_::lnext, DefragTracker_::lprev, and DefragTrackerQueue_::top.

Referenced by DefragHashShutdown().

Here is the caller graph for this function:

void DefragTrackerEnqueue ( DefragTrackerQueue q,
DefragTracker dt 
)

add a tracker to a queue

Parameters
qqueue
dttracker

Definition at line 70 of file defrag-queue.c.

References DefragTrackerQueue_::bot, BUG_ON, DQLOCK_LOCK, DQLOCK_UNLOCK, DefragTrackerQueue_::len, DefragTracker_::lnext, DefragTracker_::lprev, and DefragTrackerQueue_::top.

Referenced by DefragInitConfig(), and DefragTrackerMoveToSpare().

Here is the caller graph for this function:

void DefragTrackerQueueDestroy ( DefragTrackerQueue q)

Destroy a tracker queue.

Parameters
qthe tracker queue to destroy

Definition at line 59 of file defrag-queue.c.

References DQLOCK_DESTROY.

Referenced by DefragHashShutdown().

Here is the caller graph for this function:

DefragTrackerQueue* DefragTrackerQueueInit ( DefragTrackerQueue )

Definition at line 34 of file defrag-queue.c.

References DQLOCK_INIT.

Referenced by DefragInitConfig(), and DefragTrackerQueueNew().

Here is the caller graph for this function:

uint32_t DefragTrackerQueueLen ( DefragTrackerQueue )

Definition at line 136 of file defrag-queue.c.

References DQLOCK_LOCK, DQLOCK_UNLOCK, DefragTrackerQueue_::len, and len.

Referenced by DefragTrackerSpareQueueGetSize().

Here is the caller graph for this function:

DefragTrackerQueue* DefragTrackerQueueNew ( void  )

Definition at line 43 of file defrag-queue.c.

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

Here is the call graph for this function: