]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
output: add Disable funcs to mirror Enable
authorVictor Julien <victor@inliniac.net>
Thu, 10 Apr 2014 06:13:38 +0000 (08:13 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 10 Apr 2014 06:13:38 +0000 (08:13 +0200)
For the loggers that we allow only one instance for: tls, ssh, drop, we
track active loggers through Output*Enable functions. Add Disable
functions to mirror this. They are to be called from the shutdown funcs
those loggers use.

src/output.c
src/output.h

index 1ab53c633ba51783b398e3603912b02f7e7238e1..eb005651d5c82580682e756fe7a472252930399f 100644 (file)
@@ -384,6 +384,11 @@ int OutputDropLoggerEnable(void) {
     return 0;
 }
 
+void OutputDropLoggerDisable(void) {
+    if (drop_loggers)
+        drop_loggers--;
+}
+
 static int tls_loggers = 0;
 
 int OutputTlsLoggerEnable(void) {
@@ -393,6 +398,11 @@ int OutputTlsLoggerEnable(void) {
     return 0;
 }
 
+void OutputTlsLoggerDisable(void) {
+    if (tls_loggers)
+        tls_loggers--;
+}
+
 static int ssh_loggers = 0;
 
 int OutputSshLoggerEnable(void) {
@@ -401,3 +411,8 @@ int OutputSshLoggerEnable(void) {
     ssh_loggers++;
     return 0;
 }
+
+void OutputSshLoggerDisable(void) {
+    if (ssh_loggers)
+        ssh_loggers--;
+}
index a68b02b91ad92e09582f8cb5454ab9b3402b86db..e62e2b1882621835ee531497b52fd12a570025c9 100644 (file)
@@ -84,7 +84,12 @@ OutputModule *OutputGetModuleByConfName(const char *name);
 void OutputDeregisterAll(void);
 
 int OutputDropLoggerEnable(void);
+void OutputDropLoggerDisable(void);
+
 int OutputTlsLoggerEnable(void);
+void OutputTlsLoggerDisable(void);
+
 int OutputSshLoggerEnable(void);
+void OutputSshLoggerDisable(void);
 
 #endif /* ! __OUTPUT_H__ */