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...
 
uint32_t HostQueueLen (HostQueue *)
 

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

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

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

Referenced by HostQueueDestroy(), IPPairQueueDestroy(), and THashDataQueueNew().

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

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

Referenced by HostQueueInit(), and IPPairQueueInit().

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

Spinlocks or Mutex for the host queues.

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

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

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

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

Typedef Documentation

typedef struct HostQueue_ HostQueue

Function Documentation

Host* HostDequeue ( HostQueue q)

remove a host from the queue

Parameters
qqueue
Return values
hhost or NULL if empty list.

Definition at line 103 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:

void HostEnqueue ( HostQueue q,
Host h 
)

add a host to a queue

Parameters
qqueue
hhost

Definition at line 70 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 HostInitConfig(), and HostMoveToSpare().

Here is the caller graph for this function:

void HostQueueDestroy ( HostQueue q)

Destroy a host queue.

Parameters
qthe host queue to destroy

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

References HQLOCK_DESTROY.

Referenced by HostShutdown().

Here is the caller graph for this function:

HostQueue* HostQueueInit ( HostQueue )

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

References HQLOCK_INIT.

Referenced by HostInitConfig(), and HostQueueNew().

Here is the caller graph for this function:

uint32_t HostQueueLen ( HostQueue )

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

References HQLOCK_LOCK, HQLOCK_UNLOCK, HostQueue_::len, and len.

Referenced by HostSpareQueueGetSize().

Here is the caller graph for this function:

HostQueue* HostQueueNew ( void  )

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

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

Here is the call graph for this function: