output: allow more than one TLS logger

pull/2081/head
Mats Klepsland 9 years ago committed by Victor Julien
parent e9074bc829
commit 47a4daeeb8

@ -82,8 +82,6 @@ enum {
#define SSL_AL_FLAG_STATE_SERVER_KEYX 0x1000
#define SSL_AL_FLAG_STATE_UNKNOWN 0x2000
#define SSL_AL_FLAG_STATE_LOGGED 0x4000
/* flag to indicate that session is finished */
#define SSL_AL_FLAG_STATE_FINISHED 0x4000

@ -194,8 +194,6 @@ static TmEcode LogTlsLogThreadDeinit(ThreadVars *t, void *data)
static void LogTlsLogDeInitCtx(OutputCtx *output_ctx)
{
OutputTlsLoggerDisable();
LogTlsFileCtx *tlslog_ctx = (LogTlsFileCtx *) output_ctx->data;
LogFileFreeCtx(tlslog_ctx->file_ctx);
SCFree(tlslog_ctx);
@ -218,12 +216,6 @@ static void LogTlsLogExitPrintStats(ThreadVars *tv, void *data)
* */
static OutputCtx *LogTlsLogInitCtx(ConfNode *conf)
{
if (OutputTlsLoggerEnable() != 0) {
SCLogError(SC_ERR_CONF_YAML_ERROR, "only one 'tls' logger "
"can be enabled");
return NULL;
}
LogFileCtx* file_ctx = LogFileNewCtx();
if (file_ctx == NULL) {

@ -213,8 +213,6 @@ static TmEcode JsonTlsLogThreadDeinit(ThreadVars *t, void *data)
static void OutputTlsLogDeinit(OutputCtx *output_ctx)
{
OutputTlsLoggerDisable();
OutputTlsCtx *tls_ctx = output_ctx->data;
LogFileCtx *logfile_ctx = tls_ctx->file_ctx;
LogFileFreeCtx(logfile_ctx);
@ -225,12 +223,6 @@ static void OutputTlsLogDeinit(OutputCtx *output_ctx)
#define DEFAULT_LOG_FILENAME "tls.json"
OutputCtx *OutputTlsLogInit(ConfNode *conf)
{
if (OutputTlsLoggerEnable() != 0) {
SCLogError(SC_ERR_CONF_YAML_ERROR, "only one 'tls' logger "
"can be enabled");
return NULL;
}
LogFileCtx *file_ctx = LogFileNewCtx();
if(file_ctx == NULL) {
SCLogError(SC_ERR_TLS_LOG_GENERIC, "couldn't create new file_ctx");
@ -277,8 +269,6 @@ OutputCtx *OutputTlsLogInit(ConfNode *conf)
static void OutputTlsLogDeinitSub(OutputCtx *output_ctx)
{
OutputTlsLoggerDisable();
OutputTlsCtx *tls_ctx = output_ctx->data;
SCFree(tls_ctx);
SCFree(output_ctx);
@ -288,12 +278,6 @@ OutputCtx *OutputTlsLogInitSub(ConfNode *conf, OutputCtx *parent_ctx)
{
OutputJsonCtx *ojc = parent_ctx->data;
if (OutputTlsLoggerEnable() != 0) {
SCLogError(SC_ERR_CONF_YAML_ERROR, "only one 'tls' logger "
"can be enabled");
return NULL;
}
OutputTlsCtx *tls_ctx = SCMalloc(sizeof(OutputTlsCtx));
if (unlikely(tls_ctx == NULL))
return NULL;

@ -647,22 +647,6 @@ void OutputDropLoggerDisable(void)
drop_loggers--;
}
static int tls_loggers = 0;
int OutputTlsLoggerEnable(void)
{
if (tls_loggers)
return -1;
tls_loggers++;
return 0;
}
void OutputTlsLoggerDisable(void)
{
if (tls_loggers)
tls_loggers--;
}
static int ssh_loggers = 0;
int OutputSshLoggerEnable(void)

@ -121,9 +121,6 @@ void OutputDeregisterAll(void);
int OutputDropLoggerEnable(void);
void OutputDropLoggerDisable(void);
int OutputTlsLoggerEnable(void);
void OutputTlsLoggerDisable(void);
int OutputSshLoggerEnable(void);
void OutputSshLoggerDisable(void);

Loading…
Cancel
Save