|
|
|
@ -85,6 +85,7 @@
|
|
|
|
|
|
|
|
|
|
typedef struct RootLogger_ {
|
|
|
|
|
OutputLogFunc LogFunc;
|
|
|
|
|
OutputFlushFunc FlushFunc;
|
|
|
|
|
ThreadInitFunc ThreadInit;
|
|
|
|
|
ThreadDeinitFunc ThreadDeinit;
|
|
|
|
|
OutputGetActiveCountFunc ActiveCntFunc;
|
|
|
|
@ -167,10 +168,10 @@ error:
|
|
|
|
|
* \retval Returns 0 on success, -1 on failure.
|
|
|
|
|
*/
|
|
|
|
|
void OutputRegisterPacketModule(LoggerId id, const char *name, const char *conf_name,
|
|
|
|
|
OutputInitFunc InitFunc, PacketLogger PacketLogFunc, PacketLogCondition PacketConditionFunc,
|
|
|
|
|
ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
|
|
|
|
|
OutputInitFunc InitFunc, OutputPacketLoggerFunctions *output_module_functions)
|
|
|
|
|
{
|
|
|
|
|
if (unlikely(PacketLogFunc == NULL || PacketConditionFunc == NULL)) {
|
|
|
|
|
if (unlikely(output_module_functions->LogFunc == NULL ||
|
|
|
|
|
output_module_functions->ConditionFunc == NULL)) {
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -183,10 +184,11 @@ void OutputRegisterPacketModule(LoggerId id, const char *name, const char *conf_
|
|
|
|
|
module->name = name;
|
|
|
|
|
module->conf_name = conf_name;
|
|
|
|
|
module->InitFunc = InitFunc;
|
|
|
|
|
module->PacketLogFunc = PacketLogFunc;
|
|
|
|
|
module->PacketConditionFunc = PacketConditionFunc;
|
|
|
|
|
module->ThreadInit = ThreadInit;
|
|
|
|
|
module->ThreadDeinit = ThreadDeinit;
|
|
|
|
|
module->PacketLogFunc = output_module_functions->LogFunc;
|
|
|
|
|
module->PacketFlushFunc = output_module_functions->FlushFunc;
|
|
|
|
|
module->PacketConditionFunc = output_module_functions->ConditionFunc;
|
|
|
|
|
module->ThreadInit = output_module_functions->ThreadInitFunc;
|
|
|
|
|
module->ThreadDeinit = output_module_functions->ThreadDeinitFunc;
|
|
|
|
|
TAILQ_INSERT_TAIL(&output_modules, module, entries);
|
|
|
|
|
|
|
|
|
|
SCLogDebug("Packet logger \"%s\" registered.", name);
|
|
|
|
@ -204,11 +206,11 @@ error:
|
|
|
|
|
* \retval Returns 0 on success, -1 on failure.
|
|
|
|
|
*/
|
|
|
|
|
void OutputRegisterPacketSubModule(LoggerId id, const char *parent_name, const char *name,
|
|
|
|
|
const char *conf_name, OutputInitSubFunc InitFunc, PacketLogger PacketLogFunc,
|
|
|
|
|
PacketLogCondition PacketConditionFunc, ThreadInitFunc ThreadInit,
|
|
|
|
|
ThreadDeinitFunc ThreadDeinit)
|
|
|
|
|
const char *conf_name, OutputInitSubFunc InitFunc,
|
|
|
|
|
OutputPacketLoggerFunctions *output_logger_functions)
|
|
|
|
|
{
|
|
|
|
|
if (unlikely(PacketLogFunc == NULL || PacketConditionFunc == NULL)) {
|
|
|
|
|
if (unlikely(output_logger_functions->LogFunc == NULL ||
|
|
|
|
|
output_logger_functions->ConditionFunc == NULL)) {
|
|
|
|
|
goto error;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -222,10 +224,11 @@ void OutputRegisterPacketSubModule(LoggerId id, const char *parent_name, const c
|
|
|
|
|
module->conf_name = conf_name;
|
|
|
|
|
module->parent_name = parent_name;
|
|
|
|
|
module->InitSubFunc = InitFunc;
|
|
|
|
|
module->PacketLogFunc = PacketLogFunc;
|
|
|
|
|
module->PacketConditionFunc = PacketConditionFunc;
|
|
|
|
|
module->ThreadInit = ThreadInit;
|
|
|
|
|
module->ThreadDeinit = ThreadDeinit;
|
|
|
|
|
module->PacketLogFunc = output_logger_functions->LogFunc;
|
|
|
|
|
module->PacketFlushFunc = output_logger_functions->FlushFunc;
|
|
|
|
|
module->PacketConditionFunc = output_logger_functions->ConditionFunc;
|
|
|
|
|
module->ThreadInit = output_logger_functions->ThreadInitFunc;
|
|
|
|
|
module->ThreadDeinit = output_logger_functions->ThreadDeinitFunc;
|
|
|
|
|
TAILQ_INSERT_TAIL(&output_modules, module, entries);
|
|
|
|
|
|
|
|
|
|
SCLogDebug("Packet logger \"%s\" registered.", name);
|
|
|
|
|