|
suricata
|


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 | |
| HostQueue * | HostQueueNew (void) |
| HostQueue * | HostQueueInit (HostQueue *) |
| void | HostQueueDestroy (HostQueue *) |
| Destroy a host queue. More... | |
| void | HostEnqueue (HostQueue *, Host *) |
| add a host to a queue More... | |
| Host * | HostDequeue (HostQueue *) |
| remove a host from the queue More... | |
Definition in file host-queue.h.
| #define HQLOCK_DESTROY | ( | q | ) | SCMutexDestroy(&(q)->m) |
Definition at line 67 of file host-queue.h.
| #define HQLOCK_INIT | ( | q | ) | SCMutexInit(&(q)->m, NULL) |
Definition at line 66 of file host-queue.h.
| #define HQLOCK_LOCK | ( | q | ) | SCMutexLock(&(q)->m) |
Definition at line 68 of file host-queue.h.
| #define HQLOCK_MUTEX |
Spinlocks or Mutex for the host queues.
Definition at line 33 of file host-queue.h.
| #define HQLOCK_TRYLOCK | ( | q | ) | SCMutexTrylock(&(q)->m) |
Definition at line 69 of file host-queue.h.
| #define HQLOCK_UNLOCK | ( | q | ) | SCMutexUnlock(&(q)->m) |
Definition at line 70 of file host-queue.h.
| typedef struct HostQueue_ HostQueue |
remove a host from the queue
| q | queue |
| h | host 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().

add a host to a queue
| q | queue |
| h | host |
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().

| void HostQueueDestroy | ( | HostQueue * | q | ) |
Destroy a host queue.
| q | the host queue to destroy |
Definition at line 58 of file host-queue.c.
References HQLOCK_DESTROY.
Definition at line 33 of file host-queue.c.
References HQLOCK_INIT.
Referenced by HostQueueNew().

| HostQueue* HostQueueNew | ( | void | ) |
Definition at line 42 of file host-queue.c.
References HostQueueInit(), SCLogError, and SCMalloc.
