From: Victor Julien Date: Thu, 10 Apr 2014 06:13:38 +0000 (+0200) Subject: output: add Disable funcs to mirror Enable X-Git-Tag: suricata-2.0.1rc1~67 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9df045d086f9399eee25f63886c9fdaf84f10f66;p=thirdparty%2Fsuricata.git output: add Disable funcs to mirror Enable 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. --- diff --git a/src/output.c b/src/output.c index 1ab53c633b..eb005651d5 100644 --- a/src/output.c +++ b/src/output.c @@ -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--; +} diff --git a/src/output.h b/src/output.h index a68b02b91a..e62e2b1882 100644 --- a/src/output.h +++ b/src/output.h @@ -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__ */