]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
runmodes: add funcs to check if file loggers enabled
authorVictor Julien <victor@inliniac.net>
Fri, 23 Jan 2015 09:20:37 +0000 (10:20 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 4 Feb 2015 10:39:36 +0000 (11:39 +0100)
Add functions to check if file/filedata loggers are enabled.

src/runmodes.c
src/runmodes.h

index 4f658ce56e000770d9410f61a18e84d2bcca1ec4..ce84f78c01e53cd6c9d3c932a6bf4a138701ddf5 100644 (file)
@@ -436,6 +436,16 @@ static TmModule *file_logger_module = NULL;
 static TmModule *filedata_logger_module = NULL;
 static TmModule *streaming_logger_module = NULL;
 
+int RunModeOutputFileEnabled(void)
+{
+    return (file_logger_module != NULL);
+}
+
+int RunModeOutputFiledataEnabled(void)
+{
+    return (filedata_logger_module != NULL);
+}
+
 /**
  * Cleanup the run mode.
  */
index caf09a945747c50395bc428cde572c84ee71cc78..ba155c713477af214b5bebf0e0a15eb0f4b463a1 100644 (file)
@@ -72,6 +72,11 @@ void RunModeInitializeOutputs(void);
 void SetupOutputs(ThreadVars *);
 void RunModeShutDown(void);
 
+/* bool indicating if file logger is enabled */
+int RunModeOutputFileEnabled(void);
+/* bool indicating if filedata logger is enabled */
+int RunModeOutputFiledataEnabled(void);
+
 #include "runmode-pcap.h"
 #include "runmode-pcap-file.h"
 #include "runmode-pfring.h"