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

Go to the source code of this file.

Data Structures

struct  IPPairQueue_
 

Macros

#define HQLOCK_MUTEX
 
#define HQLOCK_INIT(q)   SCMutexInit(&(q)->m, NULL)
 
#define HQLOCK_DESTROY(q)   SCMutexDestroy(&(q)->m)
 
#define HQLOCK_LOCK(q)   SCMutexLock(&(q)->m)
 
#define HQLOCK_TRYLOCK(q)   SCMutexTrylock(&(q)->m)
 
#define HQLOCK_UNLOCK(q)   SCMutexUnlock(&(q)->m)
 

Typedefs

typedef struct IPPairQueue_ IPPairQueue
 

Functions

IPPairQueueIPPairQueueNew (void)
 
IPPairQueueIPPairQueueInit (IPPairQueue *)
 
void IPPairQueueDestroy (IPPairQueue *)
 Destroy a ippair queue. More...
 
void IPPairEnqueue (IPPairQueue *, IPPair *)
 add a ippair to a queue More...
 
IPPairIPPairDequeue (IPPairQueue *)
 remove a ippair from the queue More...
 

Detailed Description

Macro Definition Documentation

◆ HQLOCK_DESTROY

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

Definition at line 67 of file ippair-queue.h.

◆ HQLOCK_INIT

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

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

◆ HQLOCK_LOCK

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

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

◆ HQLOCK_MUTEX

#define HQLOCK_MUTEX

Spinlocks or Mutex for the ippair queues.

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

◆ HQLOCK_TRYLOCK

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

Definition at line 69 of file ippair-queue.h.

◆ HQLOCK_UNLOCK

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

Definition at line 70 of file ippair-queue.h.

Typedef Documentation

◆ IPPairQueue

typedef struct IPPairQueue_ IPPairQueue

Function Documentation

◆ IPPairDequeue()

IPPair* IPPairDequeue ( IPPairQueue q)

remove a ippair from the queue

Parameters
qqueue
Return values
hippair or NULL if empty list.

Definition at line 102 of file ippair-queue.c.

References IPPairQueue_::bot, BUG_ON, HQLOCK_LOCK, HQLOCK_UNLOCK, IPPairQueue_::len, IPPair_::lnext, IPPair_::lprev, and IPPairQueue_::top.

Referenced by IPPairShutdown().

Here is the caller graph for this function:

◆ IPPairEnqueue()

void IPPairEnqueue ( IPPairQueue q,
IPPair h 
)

add a ippair to a queue

Parameters
qqueue
hippair

Definition at line 69 of file ippair-queue.c.

References IPPairQueue_::bot, BUG_ON, HQLOCK_LOCK, HQLOCK_UNLOCK, IPPairQueue_::len, IPPair_::lnext, IPPair_::lprev, and IPPairQueue_::top.

Referenced by IPPairMoveToSpare().

Here is the caller graph for this function:

◆ IPPairQueueDestroy()

void IPPairQueueDestroy ( IPPairQueue q)

Destroy a ippair queue.

Parameters
qthe ippair queue to destroy

Definition at line 58 of file ippair-queue.c.

References HQLOCK_DESTROY.

◆ IPPairQueueInit()

IPPairQueue* IPPairQueueInit ( IPPairQueue )

Definition at line 33 of file ippair-queue.c.

References HQLOCK_INIT.

Referenced by IPPairQueueNew().

Here is the caller graph for this function:

◆ IPPairQueueNew()

IPPairQueue* IPPairQueueNew ( void  )

Definition at line 42 of file ippair-queue.c.

References IPPairQueueInit(), SCLogError, and SCMalloc.

Here is the call graph for this function: