suricata
|
#include "suricata-common.h"
#include "conf.h"
#include "util-debug.h"
#include "host.h"
#include "host-storage.h"
#include "host-bit.h"
#include "util-random.h"
#include "util-misc.h"
#include "util-byte.h"
#include "util-validate.h"
#include "host-queue.h"
#include "detect-tag.h"
#include "detect-engine-tag.h"
#include "detect-engine-threshold.h"
#include "util-hash-lookup3.h"
Go to the source code of this file.
Macros | |
#define | HOST_DEFAULT_HASHSIZE 4096 |
#define | HOST_DEFAULT_MEMCAP 16777216 |
#define | HOST_DEFAULT_PREALLOC 1000 |
Functions | |
SC_ATOMIC_DECLARE (uint64_t, host_memuse) | |
SC_ATOMIC_DECLARE (uint32_t, host_counter) | |
SC_ATOMIC_DECLARE (uint32_t, host_prune_idx) | |
int | HostSetMemcap (uint64_t size) |
Update memcap value. More... | |
uint64_t | HostGetMemcap (void) |
Return memcap value. More... | |
uint64_t | HostGetMemuse (void) |
Return memuse value. More... | |
void | HostMoveToSpare (Host *h) |
Host * | HostAlloc (void) |
void | HostFree (Host *h) |
void | HostClearMemory (Host *h) |
void | HostInitConfig (bool quiet) |
initialize the configuration More... | |
void | HostPrintStats (void) |
print some host stats More... | |
void | HostShutdown (void) |
shutdown the flow engine More... | |
void | HostCleanup (void) |
Cleanup the host engine. More... | |
void | HostRelease (Host *h) |
void | HostLock (Host *h) |
void | HostUnlock (Host *h) |
Host * | HostGetHostFromHash (Address *a) |
Host * | HostLookupHostFromHash (Address *a) |
look up a host in the hash More... | |
void | HostRegisterUnittests (void) |
Variables | |
HostHashRow * | host_hash |
HostConfig | host_config |
Information about hosts.
Definition in file host.c.
Host* HostAlloc | ( | void | ) |
Definition at line 106 of file host.c.
References HOST_CHECK_MEMCAP.
void HostCleanup | ( | void | ) |
Cleanup the host engine.
Cleanup the host engine from tag and threshold.
Definition at line 332 of file host.c.
References HostConfig_::hash_size, Host_::hnext, host_config, host_hash, HostClearMemory(), HostFreeStorage(), HostMoveToSpare(), Host_::hprev, HRLOCK_LOCK, HRLOCK_UNLOCK, Host_::iprep, and SC_ATOMIC_GET.
void HostClearMemory | ( | Host * | h | ) |
Definition at line 150 of file host.c.
References BUG_ON, HostFreeStorage(), HostStorageSize(), Host_::iprep, SC_ATOMIC_GET, and SRepFreeHostData().
Referenced by HostCleanup(), and HostFree().
void HostFree | ( | Host * | h | ) |
Definition at line 125 of file host.c.
References HostClearMemory(), Host_::m, SC_ATOMIC_SUB, SCFree, and SCMutexDestroy.
Definition at line 486 of file host.c.
Referenced by TagHashAddTag().
uint64_t HostGetMemcap | ( | void | ) |
Return memcap value.
memcap | value |
Definition at line 83 of file host.c.
References host_config, and SC_ATOMIC_GET.
uint64_t HostGetMemuse | ( | void | ) |
Return memuse value.
memuse | value |
Definition at line 94 of file host.c.
References SC_ATOMIC_GET.
void HostInitConfig | ( | bool | quiet | ) |
initialize the configuration
set config values for memcap, prealloc and hash_size
Definition at line 168 of file host.c.
References DEBUG_VALIDATE_BUG_ON, HostStorageSize(), and SCLogDebug.
void HostLock | ( | Host * | h | ) |
Definition at line 467 of file host.c.
References Host_::m, and SCMutexLock.
void HostMoveToSpare | ( | Host * | h | ) |
Definition at line 100 of file host.c.
References HostEnqueue().
Referenced by HostCleanup().
void HostPrintStats | ( | void | ) |
print some host stats
Definition at line 284 of file host.c.
References host_config, SC_ATOMIC_GET, and SCLogPerf.
Referenced by HostShutdown().
void HostRegisterUnittests | ( | void | ) |
Definition at line 717 of file host.c.
References RegisterHostStorageTests().
void HostRelease | ( | Host * | h | ) |
Definition at line 461 of file host.c.
References HostDecrUsecnt, Host_::m, and SCMutexUnlock.
int HostSetMemcap | ( | uint64_t | size | ) |
Update memcap value.
size | new memcap value |
Definition at line 68 of file host.c.
References host_config, SC_ATOMIC_GET, and SC_ATOMIC_SET.
void HostShutdown | ( | void | ) |
shutdown the flow engine
Definition at line 296 of file host.c.
References HostDequeue(), and HostPrintStats().
Referenced by GlobalsDestroy().
void HostUnlock | ( | Host * | h | ) |
Definition at line 472 of file host.c.
References Host_::m, and SCMutexUnlock.
SC_ATOMIC_DECLARE | ( | uint32_t | , |
host_counter | |||
) |
SC_ATOMIC_DECLARE | ( | uint32_t | , |
host_prune_idx | |||
) |
SC_ATOMIC_DECLARE | ( | uint64_t | , |
host_memuse | |||
) |
HostConfig host_config |
Definition at line 53 of file host.c.
Referenced by HostCleanup(), HostGetMemcap(), HostPrintStats(), HostSetMemcap(), and HostTimeoutHash().
HostHashRow* host_hash |
host hash table
Definition at line 50 of file host.c.
Referenced by HostCleanup(), and HostTimeoutHash().