exit(EXIT_FAILURE);
}
+/**
+ * \brief Register a packet output sub-module.
+ *
+ * This function will register an output module so it can be
+ * configured with the configuration file.
+ *
+ * \retval Returns 0 on success, -1 on failure.
+ */
+void
+OutputRegisterPacketSubModule(const char *parent_name, char *name, char *conf_name,
+ OutputCtx *(*InitFunc)(ConfNode *, OutputCtx *parent_ctx),
+ PacketLogger PacketLogFunc, PacketLogCondition PacketConditionFunc)
+{
+ if (unlikely(PacketLogFunc == NULL || PacketConditionFunc == NULL)) {
+ goto error;
+ }
+
+ OutputModule *module = SCCalloc(1, sizeof(*module));
+ if (unlikely(module == NULL)) {
+ goto error;
+ }
+
+ module->name = SCStrdup(name);
+ if (unlikely(module->name == NULL))
+ goto error;
+ module->conf_name = SCStrdup(conf_name);
+ if (unlikely(module->conf_name == NULL))
+ goto error;
+ module->parent_name = SCStrdup(parent_name);
+ if (unlikely(module->conf_name == NULL))
+ goto error;
+ module->InitSubFunc = InitFunc;
+ module->PacketLogFunc = PacketLogFunc;
+ module->PacketConditionFunc = PacketConditionFunc;
+ TAILQ_INSERT_TAIL(&output_modules, module, entries);
+
+ SCLogDebug("Packet logger \"%s\" registered.", name);
+ return;
+error:
+ SCLogError(SC_ERR_FATAL, "Fatal error encountered. Exiting...");
+ exit(EXIT_FAILURE);
+}
+
/**
* \brief Register a tx output module.
*
exit(EXIT_FAILURE);
}
+/**
+ * \brief Register a file output sub-module.
+ *
+ * This function will register an output module so it can be
+ * configured with the configuration file.
+ *
+ * \retval Returns 0 on success, -1 on failure.
+ */
+void
+OutputRegisterFileSubModule(const char *parent_name, char *name, char *conf_name,
+ OutputCtx *(*InitFunc)(ConfNode *, OutputCtx *), FileLogger FileLogFunc)
+{
+ if (unlikely(FileLogFunc == NULL)) {
+ goto error;
+ }
+
+ OutputModule *module = SCCalloc(1, sizeof(*module));
+ if (unlikely(module == NULL)) {
+ goto error;
+ }
+
+ module->name = SCStrdup(name);
+ if (unlikely(module->name == NULL))
+ goto error;
+ module->conf_name = SCStrdup(conf_name);
+ if (unlikely(module->conf_name == NULL))
+ goto error;
+ module->parent_name = SCStrdup(parent_name);
+ if (unlikely(module->parent_name == NULL))
+ goto error;
+ module->InitSubFunc = InitFunc;
+ module->FileLogFunc = FileLogFunc;
+ TAILQ_INSERT_TAIL(&output_modules, module, entries);
+
+ SCLogDebug("File logger \"%s\" registered.", name);
+ return;
+error:
+ SCLogError(SC_ERR_FATAL, "Fatal error encountered. Exiting...");
+ exit(EXIT_FAILURE);
+}
+
/**
* \brief Register a file data output module.
*
exit(EXIT_FAILURE);
}
+/**
+ * \brief Register a file data output sub-module.
+ *
+ * This function will register an output module so it can be
+ * configured with the configuration file.
+ *
+ * \retval Returns 0 on success, -1 on failure.
+ */
+void
+OutputRegisterFiledataSubModule(const char *parent_name, char *name, char *conf_name,
+ OutputCtx *(*InitFunc)(ConfNode *, OutputCtx *), FiledataLogger FiledataLogFunc)
+{
+ if (unlikely(FiledataLogFunc == NULL)) {
+ goto error;
+ }
+
+ OutputModule *module = SCCalloc(1, sizeof(*module));
+ if (unlikely(module == NULL)) {
+ goto error;
+ }
+
+ module->name = SCStrdup(name);
+ if (unlikely(module->name == NULL))
+ goto error;
+ module->conf_name = SCStrdup(conf_name);
+ if (unlikely(module->conf_name == NULL))
+ goto error;
+ module->parent_name = SCStrdup(parent_name);
+ if (unlikely(module->parent_name == NULL))
+ goto error;
+ module->InitSubFunc = InitFunc;
+ module->FiledataLogFunc = FiledataLogFunc;
+ TAILQ_INSERT_TAIL(&output_modules, module, entries);
+
+ SCLogDebug("Filedata logger \"%s\" registered.", name);
+ return;
+error:
+ SCLogError(SC_ERR_FATAL, "Fatal error encountered. Exiting...");
+ exit(EXIT_FAILURE);
+}
+
/**
* \brief Get an output module by name.
*
void OutputRegisterPacketModule(char *name, char *conf_name,
OutputCtx *(*InitFunc)(ConfNode *),
PacketLogger LogFunc, PacketLogCondition ConditionFunc);
+void OutputRegisterPacketSubModule(const char *parent_name, char *name, char *conf_name,
+ OutputCtx *(*InitFunc)(ConfNode *, OutputCtx *),
+ PacketLogger LogFunc, PacketLogCondition ConditionFunc);
+
void OutputRegisterTxModule(char *name, char *conf_name,
OutputCtx *(*InitFunc)(ConfNode *), uint16_t alproto,
TxLogger TxLogFunc);
void OutputRegisterTxSubModule(const char *parent_name, char *name, char *conf_name,
OutputCtx *(*InitFunc)(ConfNode *, OutputCtx *parent_ctx), uint16_t alproto,
TxLogger TxLogFunc);
+
void OutputRegisterFileModule(char *name, char *conf_name,
OutputCtx *(*InitFunc)(ConfNode *), FileLogger FileLogFunc);
+void OutputRegisterFileSubModule(const char *parent_name, char *name, char *conf_name,
+ OutputCtx *(*InitFunc)(ConfNode *, OutputCtx *), FileLogger FileLogFunc);
+
void OutputRegisterFiledataModule(char *name, char *conf_name,
OutputCtx *(*InitFunc)(ConfNode *), FiledataLogger FiledataLogFunc);
+void OutputRegisterFiledataSubModule(const char *parent_name, char *name, char *conf_name,
+ OutputCtx *(*InitFunc)(ConfNode *, OutputCtx *), FiledataLogger FiledataLogFunc);
OutputModule *OutputGetModuleByConfName(char *name);
void OutputDeregisterAll(void);