From: Victor Julien Date: Sat, 28 Sep 2019 06:16:45 +0000 (+0200) Subject: stats: add global way to check if API is enabled X-Git-Tag: suricata-5.0.0~127 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d381f93f3f215f54cc97cee624e31f1522bb4b4;p=thirdparty%2Fsuricata.git stats: add global way to check if API is enabled --- diff --git a/src/counters.c b/src/counters.c index e7f624990d..0bc808dfd3 100644 --- a/src/counters.c +++ b/src/counters.c @@ -116,6 +116,11 @@ static int stats_loggers_active = 1; static uint16_t counters_global_id = 0; +bool StatsEnabled(void) +{ + return (stats_enabled == TRUE); +} + static void StatsPublicThreadContextInit(StatsPublicThreadContext *t) { SCMutexInit(&t->m, NULL); diff --git a/src/counters.h b/src/counters.h index 0035d20f71..d59cdbc581 100644 --- a/src/counters.h +++ b/src/counters.h @@ -109,6 +109,7 @@ void StatsSetupPostConfigPreOutput(void); void StatsSetupPostConfigPostOutput(void); void StatsSpawnThreads(void); void StatsRegisterTests(void); +bool StatsEnabled(void); /* functions used to free the resources alloted by the Stats API */ void StatsReleaseResources(void);