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

Go to the source code of this file.

Data Structures

struct  HostQueue_
 

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 HostQueue_ HostQueue
 

Functions

HostQueueHostQueueNew (void)
 
HostQueueHostQueueInit (HostQueue *)
 
void HostQueueDestroy (HostQueue *)
 Destroy a host queue. More...
 
void HostEnqueue (HostQueue *, Host *)
 add a host to a queue More...
 
HostHostDequeue (HostQueue *)
 remove a host from the queue More...
 

Detailed Description

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

Definition in file host-queue.h.

Macro Definition Documentation

◆ HQLOCK_DESTROY

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

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

◆ HQLOCK_INIT

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

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

◆ HQLOCK_LOCK

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

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

◆ HQLOCK_MUTEX

#define HQLOCK_MUTEX

Spinlocks or Mutex for the host queues.

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

◆ HQLOCK_TRYLOCK

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

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

◆ HQLOCK_UNLOCK

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

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

Typedef Documentation

◆ HostQueue

typedef struct HostQueue_ HostQueue

Function Documentation

◆ HostDequeue()

Host* HostDequeue ( HostQueue q)

remove a host from the queue

Parameters
qqueue
Return values
hhost or NULL if empty list.

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

References HostQueue_::bot, BUG_ON, HQLOCK_LOCK, HQLOCK_UNLOCK, HostQueue_::len, Host_::lnext, Host_::lprev, and HostQueue_::top.

Referenced by HostShutdown().

Here is the caller graph for this function:

◆ HostEnqueue()

void HostEnqueue ( HostQueue q,
Host h 
)

add a host to a queue

Parameters
qqueue
hhost

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

References HostQueue_::bot, BUG_ON, HQLOCK_LOCK, HQLOCK_UNLOCK, HostQueue_::len, Host_::lnext, Host_::lprev, and HostQueue_::top.

Referenced by HostMoveToSpare().

Here is the caller graph for this function:

◆ HostQueueDestroy()

void HostQueueDestroy ( HostQueue q)

Destroy a host queue.

Parameters
qthe host queue to destroy

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

References HQLOCK_DESTROY.

◆ HostQueueInit()

HostQueue* HostQueueInit ( HostQueue )

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

References HQLOCK_INIT.

Referenced by HostQueueNew().

Here is the caller graph for this function:

◆ HostQueueNew()

HostQueue* HostQueueNew ( void  )

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

References HostQueueInit(), SCLogError, and SCMalloc.

Here is the call graph for this function: