]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
runmodes: query the active runmode with a function call
authorLukas Sismis <lsismis@oisf.net>
Sun, 8 Dec 2024 14:26:27 +0000 (15:26 +0100)
committerVictor Julien <victor@inliniac.net>
Sat, 7 Jun 2025 08:36:43 +0000 (10:36 +0200)
src/runmodes.c
src/runmodes.h

index 7527b31e979aa857598c227b9ccf701d4c69bae1..800365f8e5220c67c4274d9fcfcb8e37d1f9a1ac 100644 (file)
@@ -201,6 +201,16 @@ char *RunmodeGetActive(void)
     return active_runmode;
 }
 
+bool RunmodeIsWorkers(void)
+{
+    return RunmodeGetActive() && (strcmp(RunmodeGetActive(), "workers") == 0);
+}
+
+bool RunmodeIsAutofp(void)
+{
+    return RunmodeGetActive() && (strcmp(RunmodeGetActive(), "autofp") == 0);
+}
+
 /**
  * Return the running mode
  *
index 6afffee4e4ffde6287a89689adab78eb8883277e..1c8a659e4eb5514c187ce77ffa7686ced92e12bb 100644 (file)
@@ -78,6 +78,8 @@ extern const char *thread_name_counter_wakeup;
 extern const char *thread_name_heartbeat;
 
 char *RunmodeGetActive(void);
+bool RunmodeIsWorkers(void);
+bool RunmodeIsAutofp(void);
 const char *RunModeGetMainMode(void);
 
 void RunModeListRunmodes(void);