|
|
|
|
@ -53,9 +53,8 @@ TAILQ_HEAD(, OutputFileRolloverFlag_) output_file_rotation_flags =
|
|
|
|
|
*
|
|
|
|
|
* \retval Returns 0 on success, -1 on failure.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
OutputRegisterModule(const char *name, const char *conf_name,
|
|
|
|
|
OutputCtx *(*InitFunc)(ConfNode *))
|
|
|
|
|
void OutputRegisterModule(const char *name, const char *conf_name,
|
|
|
|
|
OutputInitFunc InitFunc)
|
|
|
|
|
{
|
|
|
|
|
OutputModule *module = SCCalloc(1, sizeof(*module));
|
|
|
|
|
if (unlikely(module == NULL))
|
|
|
|
|
@ -83,9 +82,8 @@ error:
|
|
|
|
|
*
|
|
|
|
|
* \retval Returns 0 on success, -1 on failure.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
OutputRegisterPacketModule(LoggerId id, const char *name, const char *conf_name,
|
|
|
|
|
OutputCtx *(*InitFunc)(ConfNode *),
|
|
|
|
|
void OutputRegisterPacketModule(LoggerId id, const char *name,
|
|
|
|
|
const char *conf_name, OutputInitFunc InitFunc,
|
|
|
|
|
PacketLogger PacketLogFunc, PacketLogCondition PacketConditionFunc,
|
|
|
|
|
ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
|
|
|
|
|
ThreadExitPrintStatsFunc ThreadExitPrintStats)
|
|
|
|
|
@ -125,10 +123,8 @@ error:
|
|
|
|
|
*
|
|
|
|
|
* \retval Returns 0 on success, -1 on failure.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
OutputRegisterPacketSubModule(LoggerId id, const char *parent_name,
|
|
|
|
|
const char *name, const char *conf_name,
|
|
|
|
|
OutputCtx *(*InitFunc)(ConfNode *, OutputCtx *parent_ctx),
|
|
|
|
|
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,
|
|
|
|
|
ThreadExitPrintStatsFunc ThreadExitPrintStats)
|
|
|
|
|
@ -170,12 +166,11 @@ error:
|
|
|
|
|
* \retval Returns 0 on success, -1 on failure.
|
|
|
|
|
*/
|
|
|
|
|
void OutputRegisterTxModuleWrapper(LoggerId id, const char *name,
|
|
|
|
|
const char *conf_name, OutputCtx *(*InitFunc)(ConfNode *),
|
|
|
|
|
AppProto alproto, TxLogger TxLogFunc, int tc_log_progress,
|
|
|
|
|
int ts_log_progress, TxLoggerCondition TxLogCondition,
|
|
|
|
|
TmEcode (*ThreadInit)(ThreadVars *t, void *, void **),
|
|
|
|
|
TmEcode (*ThreadDeinit)(ThreadVars *t, void *),
|
|
|
|
|
void (*ThreadExitPrintStats)(ThreadVars *, void *))
|
|
|
|
|
const char *conf_name, OutputInitFunc InitFunc, AppProto alproto,
|
|
|
|
|
TxLogger TxLogFunc, int tc_log_progress, int ts_log_progress,
|
|
|
|
|
TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit,
|
|
|
|
|
ThreadDeinitFunc ThreadDeinit,
|
|
|
|
|
ThreadExitPrintStatsFunc ThreadExitPrintStats)
|
|
|
|
|
{
|
|
|
|
|
if (unlikely(TxLogFunc == NULL)) {
|
|
|
|
|
goto error;
|
|
|
|
|
@ -208,13 +203,11 @@ error:
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OutputRegisterTxSubModuleWrapper(LoggerId id, const char *parent_name,
|
|
|
|
|
const char *name, const char *conf_name, OutputCtx *(*InitFunc)(ConfNode *,
|
|
|
|
|
OutputCtx *parent_ctx), AppProto alproto, TxLogger TxLogFunc,
|
|
|
|
|
int tc_log_progress, int ts_log_progress,
|
|
|
|
|
TxLoggerCondition TxLogCondition,
|
|
|
|
|
ThreadInitFunc ThreadInit,
|
|
|
|
|
ThreadDeinitFunc ThreadDeinit,
|
|
|
|
|
ThreadExitPrintStatsFunc ThreadExitPrintStats)
|
|
|
|
|
const char *name, const char *conf_name, OutputInitSubFunc InitFunc,
|
|
|
|
|
AppProto alproto, TxLogger TxLogFunc, int tc_log_progress,
|
|
|
|
|
int ts_log_progress, TxLoggerCondition TxLogCondition,
|
|
|
|
|
ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
|
|
|
|
|
ThreadExitPrintStatsFunc ThreadExitPrintStats)
|
|
|
|
|
{
|
|
|
|
|
if (unlikely(TxLogFunc == NULL)) {
|
|
|
|
|
goto error;
|
|
|
|
|
@ -256,7 +249,7 @@ error:
|
|
|
|
|
* \retval Returns 0 on success, -1 on failure.
|
|
|
|
|
*/
|
|
|
|
|
void OutputRegisterTxModuleWithCondition(LoggerId id, const char *name,
|
|
|
|
|
const char *conf_name, OutputCtx *(*InitFunc)(ConfNode *), AppProto alproto,
|
|
|
|
|
const char *conf_name, OutputInitFunc InitFunc, AppProto alproto,
|
|
|
|
|
TxLogger TxLogFunc, TxLoggerCondition TxLogCondition,
|
|
|
|
|
ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
|
|
|
|
|
ThreadExitPrintStatsFunc ThreadExitPrintStats)
|
|
|
|
|
@ -266,11 +259,11 @@ void OutputRegisterTxModuleWithCondition(LoggerId id, const char *name,
|
|
|
|
|
ThreadExitPrintStats);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OutputRegisterTxSubModuleWithCondition(LoggerId id, const char *parent_name,
|
|
|
|
|
const char *name, const char *conf_name,
|
|
|
|
|
OutputCtx *(*InitFunc)(ConfNode *, OutputCtx *parent_ctx), AppProto alproto,
|
|
|
|
|
TxLogger TxLogFunc, TxLoggerCondition TxLogCondition,
|
|
|
|
|
ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
|
|
|
|
|
void OutputRegisterTxSubModuleWithCondition(LoggerId id,
|
|
|
|
|
const char *parent_name, const char *name, const char *conf_name,
|
|
|
|
|
OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
|
|
|
|
|
TxLoggerCondition TxLogCondition, ThreadInitFunc ThreadInit,
|
|
|
|
|
ThreadDeinitFunc ThreadDeinit,
|
|
|
|
|
ThreadExitPrintStatsFunc ThreadExitPrintStats)
|
|
|
|
|
{
|
|
|
|
|
OutputRegisterTxSubModuleWrapper(id, parent_name, name, conf_name, InitFunc,
|
|
|
|
|
@ -287,21 +280,18 @@ void OutputRegisterTxSubModuleWithCondition(LoggerId id, const char *parent_name
|
|
|
|
|
* \retval Returns 0 on success, -1 on failure.
|
|
|
|
|
*/
|
|
|
|
|
void OutputRegisterTxModuleWithProgress(LoggerId id, const char *name,
|
|
|
|
|
const char *conf_name, OutputCtx *(*InitFunc)(ConfNode *),
|
|
|
|
|
AppProto alproto, TxLogger TxLogFunc, int tc_log_progress,
|
|
|
|
|
int ts_log_progress, ThreadInitFunc ThreadInit,
|
|
|
|
|
ThreadDeinitFunc ThreadDeinit,
|
|
|
|
|
const char *conf_name, OutputInitFunc InitFunc, AppProto alproto,
|
|
|
|
|
TxLogger TxLogFunc, int tc_log_progress, int ts_log_progress,
|
|
|
|
|
ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
|
|
|
|
|
ThreadExitPrintStatsFunc ThreadExitPrintStats)
|
|
|
|
|
{
|
|
|
|
|
OutputRegisterTxModuleWrapper(id, name, conf_name, InitFunc, alproto,
|
|
|
|
|
TxLogFunc, tc_log_progress, ts_log_progress,
|
|
|
|
|
NULL, ThreadInit, ThreadDeinit,
|
|
|
|
|
ThreadExitPrintStats);
|
|
|
|
|
TxLogFunc, tc_log_progress, ts_log_progress, NULL, ThreadInit,
|
|
|
|
|
ThreadDeinit, ThreadExitPrintStats);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OutputRegisterTxSubModuleWithProgress(LoggerId id, const char *parent_name,
|
|
|
|
|
const char *name, const char *conf_name,
|
|
|
|
|
OutputCtx *(*InitFunc)(ConfNode *, OutputCtx *parent_ctx),
|
|
|
|
|
const char *name, const char *conf_name, OutputInitSubFunc InitFunc,
|
|
|
|
|
AppProto alproto, TxLogger TxLogFunc, int tc_log_progress,
|
|
|
|
|
int ts_log_progress, ThreadInitFunc ThreadInit,
|
|
|
|
|
ThreadDeinitFunc ThreadDeinit,
|
|
|
|
|
@ -320,29 +310,26 @@ void OutputRegisterTxSubModuleWithProgress(LoggerId id, const char *parent_name,
|
|
|
|
|
*
|
|
|
|
|
* \retval Returns 0 on success, -1 on failure.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
OutputRegisterTxModule(LoggerId id, const char *name, const char *conf_name,
|
|
|
|
|
OutputCtx *(*InitFunc)(ConfNode *), AppProto alproto,
|
|
|
|
|
TxLogger TxLogFunc, TmEcode (*ThreadInit)(ThreadVars *, void *, void **),
|
|
|
|
|
TmEcode (*ThreadDeinit)(ThreadVars *, void *),
|
|
|
|
|
void (*ThreadExitPrintStats)(ThreadVars *, void *))
|
|
|
|
|
void OutputRegisterTxModule(LoggerId id, const char *name,
|
|
|
|
|
const char *conf_name, OutputInitFunc InitFunc, AppProto alproto,
|
|
|
|
|
TxLogger TxLogFunc, ThreadInitFunc ThreadInit,
|
|
|
|
|
ThreadDeinitFunc ThreadDeinit,
|
|
|
|
|
ThreadExitPrintStatsFunc ThreadExitPrintStats)
|
|
|
|
|
{
|
|
|
|
|
OutputRegisterTxModuleWrapper(id, name, conf_name, InitFunc, alproto,
|
|
|
|
|
TxLogFunc, -1, -1, NULL, ThreadInit,
|
|
|
|
|
ThreadDeinit, ThreadExitPrintStats);
|
|
|
|
|
TxLogFunc, -1, -1, NULL, ThreadInit, ThreadDeinit,
|
|
|
|
|
ThreadExitPrintStats);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OutputRegisterTxSubModule(LoggerId id, const char *parent_name,
|
|
|
|
|
const char *name, const char *conf_name,
|
|
|
|
|
OutputCtx *(*InitFunc)(ConfNode *, OutputCtx *parent_ctx),
|
|
|
|
|
AppProto alproto, TxLogger TxLogFunc, ThreadInitFunc ThreadInit,
|
|
|
|
|
ThreadDeinitFunc ThreadDeinit,
|
|
|
|
|
OutputInitSubFunc InitFunc, AppProto alproto, TxLogger TxLogFunc,
|
|
|
|
|
ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
|
|
|
|
|
ThreadExitPrintStatsFunc ThreadExitPrintStats)
|
|
|
|
|
{
|
|
|
|
|
OutputRegisterTxSubModuleWrapper(id, parent_name, name, conf_name,
|
|
|
|
|
InitFunc, alproto, TxLogFunc, -1, -1, NULL,
|
|
|
|
|
ThreadInit, ThreadDeinit,
|
|
|
|
|
ThreadExitPrintStats);
|
|
|
|
|
InitFunc, alproto, TxLogFunc, -1, -1, NULL, ThreadInit, ThreadDeinit,
|
|
|
|
|
ThreadExitPrintStats);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -353,9 +340,8 @@ void OutputRegisterTxSubModule(LoggerId id, const char *parent_name,
|
|
|
|
|
*
|
|
|
|
|
* \retval Returns 0 on success, -1 on failure.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
OutputRegisterFileModule(LoggerId id, const char *name, const char *conf_name,
|
|
|
|
|
OutputCtx *(*InitFunc)(ConfNode *), FileLogger FileLogFunc,
|
|
|
|
|
void OutputRegisterFileModule(LoggerId id, const char *name,
|
|
|
|
|
const char *conf_name, OutputInitFunc InitFunc, FileLogger FileLogFunc,
|
|
|
|
|
ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
|
|
|
|
|
ThreadExitPrintStatsFunc ThreadExitPrintStats)
|
|
|
|
|
{
|
|
|
|
|
@ -393,10 +379,8 @@ error:
|
|
|
|
|
*
|
|
|
|
|
* \retval Returns 0 on success, -1 on failure.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
OutputRegisterFileSubModule(LoggerId id, const char *parent_name,
|
|
|
|
|
const char *name, const char *conf_name,
|
|
|
|
|
OutputCtx *(*InitFunc)(ConfNode *, OutputCtx *),
|
|
|
|
|
void OutputRegisterFileSubModule(LoggerId id, const char *parent_name,
|
|
|
|
|
const char *name, const char *conf_name, OutputInitSubFunc InitFunc,
|
|
|
|
|
FileLogger FileLogFunc, ThreadInitFunc ThreadInit,
|
|
|
|
|
ThreadDeinitFunc ThreadDeinit,
|
|
|
|
|
ThreadExitPrintStatsFunc ThreadExitPrintStats)
|
|
|
|
|
@ -436,9 +420,8 @@ error:
|
|
|
|
|
*
|
|
|
|
|
* \retval Returns 0 on success, -1 on failure.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
OutputRegisterFiledataModule(LoggerId id, const char *name,
|
|
|
|
|
const char *conf_name, OutputCtx *(*InitFunc)(ConfNode *),
|
|
|
|
|
void OutputRegisterFiledataModule(LoggerId id, const char *name,
|
|
|
|
|
const char *conf_name, OutputInitFunc InitFunc,
|
|
|
|
|
FiledataLogger FiledataLogFunc, ThreadInitFunc ThreadInit,
|
|
|
|
|
ThreadDeinitFunc ThreadDeinit,
|
|
|
|
|
ThreadExitPrintStatsFunc ThreadExitPrintStats)
|
|
|
|
|
@ -477,10 +460,8 @@ error:
|
|
|
|
|
*
|
|
|
|
|
* \retval Returns 0 on success, -1 on failure.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
OutputRegisterFiledataSubModule(LoggerId id, const char *parent_name,
|
|
|
|
|
const char *name, const char *conf_name,
|
|
|
|
|
OutputCtx *(*InitFunc)(ConfNode *, OutputCtx *),
|
|
|
|
|
void OutputRegisterFiledataSubModule(LoggerId id, const char *parent_name,
|
|
|
|
|
const char *name, const char *conf_name, OutputInitSubFunc InitFunc,
|
|
|
|
|
FiledataLogger FiledataLogFunc, ThreadInitFunc ThreadInit,
|
|
|
|
|
ThreadDeinitFunc ThreadDeinit,
|
|
|
|
|
ThreadExitPrintStatsFunc ThreadExitPrintStats)
|
|
|
|
|
@ -520,9 +501,8 @@ error:
|
|
|
|
|
*
|
|
|
|
|
* \retval Returns 0 on success, -1 on failure.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
OutputRegisterFlowModule(LoggerId id, const char *name, const char *conf_name,
|
|
|
|
|
OutputCtx *(*InitFunc)(ConfNode *), FlowLogger FlowLogFunc,
|
|
|
|
|
void OutputRegisterFlowModule(LoggerId id, const char *name,
|
|
|
|
|
const char *conf_name, OutputInitFunc InitFunc, FlowLogger FlowLogFunc,
|
|
|
|
|
ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
|
|
|
|
|
ThreadExitPrintStatsFunc ThreadExitPrintStats)
|
|
|
|
|
{
|
|
|
|
|
@ -560,10 +540,8 @@ error:
|
|
|
|
|
*
|
|
|
|
|
* \retval Returns 0 on success, -1 on failure.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
OutputRegisterFlowSubModule(LoggerId id, const char *parent_name,
|
|
|
|
|
const char *name, const char *conf_name,
|
|
|
|
|
OutputCtx *(*InitFunc)(ConfNode *, OutputCtx *),
|
|
|
|
|
void OutputRegisterFlowSubModule(LoggerId id, const char *parent_name,
|
|
|
|
|
const char *name, const char *conf_name, OutputInitSubFunc InitFunc,
|
|
|
|
|
FlowLogger FlowLogFunc, ThreadInitFunc ThreadInit,
|
|
|
|
|
ThreadDeinitFunc ThreadDeinit,
|
|
|
|
|
ThreadExitPrintStatsFunc ThreadExitPrintStats)
|
|
|
|
|
@ -603,9 +581,8 @@ error:
|
|
|
|
|
*
|
|
|
|
|
* \retval Returns 0 on success, -1 on failure.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
OutputRegisterStreamingModule(LoggerId id, const char *name,
|
|
|
|
|
const char *conf_name, OutputCtx *(*InitFunc)(ConfNode *),
|
|
|
|
|
void OutputRegisterStreamingModule(LoggerId id, const char *name,
|
|
|
|
|
const char *conf_name, OutputInitFunc InitFunc,
|
|
|
|
|
StreamingLogger StreamingLogFunc,
|
|
|
|
|
enum OutputStreamingType stream_type, ThreadInitFunc ThreadInit,
|
|
|
|
|
ThreadDeinitFunc ThreadDeinit,
|
|
|
|
|
@ -646,10 +623,8 @@ error:
|
|
|
|
|
*
|
|
|
|
|
* \retval Returns 0 on success, -1 on failure.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
OutputRegisterStreamingSubModule(LoggerId id, const char *parent_name,
|
|
|
|
|
const char *name, const char *conf_name,
|
|
|
|
|
OutputCtx *(*InitFunc)(ConfNode *, OutputCtx *),
|
|
|
|
|
void OutputRegisterStreamingSubModule(LoggerId id, const char *parent_name,
|
|
|
|
|
const char *name, const char *conf_name, OutputInitSubFunc InitFunc,
|
|
|
|
|
StreamingLogger StreamingLogFunc, enum OutputStreamingType stream_type,
|
|
|
|
|
ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
|
|
|
|
|
ThreadExitPrintStatsFunc ThreadExitPrintStats)
|
|
|
|
|
@ -690,9 +665,8 @@ error:
|
|
|
|
|
*
|
|
|
|
|
* \retval Returns 0 on success, -1 on failure.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
OutputRegisterStatsModule(LoggerId id, const char *name, const char *conf_name,
|
|
|
|
|
OutputCtx *(*InitFunc)(ConfNode *), StatsLogger StatsLogFunc,
|
|
|
|
|
void OutputRegisterStatsModule(LoggerId id, const char *name,
|
|
|
|
|
const char *conf_name, OutputInitFunc InitFunc, StatsLogger StatsLogFunc,
|
|
|
|
|
ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
|
|
|
|
|
ThreadExitPrintStatsFunc ThreadExitPrintStats)
|
|
|
|
|
{
|
|
|
|
|
@ -730,10 +704,8 @@ error:
|
|
|
|
|
*
|
|
|
|
|
* \retval Returns 0 on success, -1 on failure.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
OutputRegisterStatsSubModule(LoggerId id, const char *parent_name,
|
|
|
|
|
const char *name, const char *conf_name,
|
|
|
|
|
OutputCtx *(*InitFunc)(ConfNode *, OutputCtx *),
|
|
|
|
|
void OutputRegisterStatsSubModule(LoggerId id, const char *parent_name,
|
|
|
|
|
const char *name, const char *conf_name, OutputInitSubFunc InitFunc,
|
|
|
|
|
StatsLogger StatsLogFunc, ThreadInitFunc ThreadInit,
|
|
|
|
|
ThreadDeinitFunc ThreadDeinit,
|
|
|
|
|
ThreadExitPrintStatsFunc ThreadExitPrintStats)
|
|
|
|
|
@ -771,8 +743,7 @@ error:
|
|
|
|
|
* \retval The OutputModule with the given name or NULL if no output module
|
|
|
|
|
* with the given name is registered.
|
|
|
|
|
*/
|
|
|
|
|
OutputModule *
|
|
|
|
|
OutputGetModuleByConfName(const char *conf_name)
|
|
|
|
|
OutputModule *OutputGetModuleByConfName(const char *conf_name)
|
|
|
|
|
{
|
|
|
|
|
OutputModule *module;
|
|
|
|
|
|
|
|
|
|
@ -787,8 +758,7 @@ OutputGetModuleByConfName(const char *conf_name)
|
|
|
|
|
/**
|
|
|
|
|
* \brief Deregister all modules. Useful for a memory clean exit.
|
|
|
|
|
*/
|
|
|
|
|
void
|
|
|
|
|
OutputDeregisterAll(void)
|
|
|
|
|
void OutputDeregisterAll(void)
|
|
|
|
|
{
|
|
|
|
|
OutputModule *module;
|
|
|
|
|
|
|
|
|
|
|