*/
static OutputCtx *LogDropLogInitCtx(ConfNode *conf)
{
+ if (OutputDropLoggerEnable() != 0) {
+ SCLogError(SC_ERR_CONF_YAML_ERROR, "only one 'drop' logger "
+ "can be enabled");
+ return NULL;
+ }
+
LogFileCtx *logfile_ctx = LogFileNewCtx();
if (logfile_ctx == NULL) {
SCLogDebug("LogDropLogInitCtx: Could not create new LogFileCtx");
* */
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) {
#define DEFAULT_LOG_FILENAME "drop.json"
static OutputCtx *JsonDropLogInitCtx(ConfNode *conf)
{
+ if (OutputDropLoggerEnable() != 0) {
+ SCLogError(SC_ERR_CONF_YAML_ERROR, "only one 'drop' logger "
+ "can be enabled");
+ return NULL;
+ }
+
LogFileCtx *logfile_ctx = LogFileNewCtx();
if (logfile_ctx == NULL) {
return NULL;
static OutputCtx *JsonDropLogInitCtxSub(ConfNode *conf, OutputCtx *parent_ctx)
{
+ if (OutputDropLoggerEnable() != 0) {
+ SCLogError(SC_ERR_CONF_YAML_ERROR, "only one 'drop' logger "
+ "can be enabled");
+ return NULL;
+ }
+
AlertJsonThread *ajt = parent_ctx->data;
OutputCtx *output_ctx = SCCalloc(1, sizeof(OutputCtx));
#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_HTTP_LOG_GENERIC, "couldn't create new file_ctx");
{
AlertJsonThread *ajt = 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;
SCFree(module);
}
}
+
+static int drop_loggers = 0;
+
+int OutputDropLoggerEnable(void) {
+ if (drop_loggers)
+ return -1;
+ drop_loggers++;
+ return 0;
+}
+
+static int tls_loggers = 0;
+
+int OutputTlsLoggerEnable(void) {
+ if (tls_loggers)
+ return -1;
+ tls_loggers++;
+ return 0;
+}
+
OutputModule *OutputGetModuleByConfName(const char *name);
void OutputDeregisterAll(void);
+int OutputDropLoggerEnable(void);
+int OutputTlsLoggerEnable(void);
+
#endif /* ! __OUTPUT_H__ */