From: Victor Julien Date: Wed, 29 Jan 2020 09:37:44 +0000 (+0100) Subject: host: fix global declarations X-Git-Tag: suricata-5.0.2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0fce01762ad1c23b709c41c2f6d72b4af379124e;p=thirdparty%2Fsuricata.git host: fix global declarations --- diff --git a/src/host.c b/src/host.c index 548b31abbb..4e79be14da 100644 --- a/src/host.c +++ b/src/host.c @@ -45,8 +45,15 @@ static Host *HostGetUsedHost(void); +/** host hash table */ +HostHashRow *host_hash; /** queue with spare hosts */ static HostQueue host_spare_q; +HostConfig host_config; + +SC_ATOMIC_DECLARE(uint64_t,host_memuse); +SC_ATOMIC_DECLARE(uint32_t,host_counter); +SC_ATOMIC_DECLARE(uint32_t,host_prune_idx); /** size of the host object. Maybe updated in HostInitConfig to include * the storage APIs additions. */ diff --git a/src/host.h b/src/host.h index 9a7b811b2a..e44cc5368a 100644 --- a/src/host.h +++ b/src/host.h @@ -87,7 +87,7 @@ typedef struct HostHashRow_ { } __attribute__((aligned(CLS))) HostHashRow; /** host hash table */ -HostHashRow *host_hash; +extern HostHashRow *host_hash; #define HOST_VERBOSE 0 #define HOST_QUIET 1 @@ -128,10 +128,10 @@ typedef struct HostConfig_ { } \ } while (0) -HostConfig host_config; -SC_ATOMIC_DECLARE(uint64_t,host_memuse); -SC_ATOMIC_DECLARE(uint32_t,host_counter); -SC_ATOMIC_DECLARE(uint32_t,host_prune_idx); +extern HostConfig host_config; +SC_ATOMIC_EXTERN(uint64_t,host_memuse); +SC_ATOMIC_EXTERN(uint32_t,host_counter); +SC_ATOMIC_EXTERN(uint32_t,host_prune_idx); void HostInitConfig(char quiet); void HostShutdown(void);