The ThreadExitPrintStats callback was never being used, remove.
Ticket: #7227
static void Init(void)
{
OutputRegisterPacketLogger(LOGGER_USER, "custom-packet-logger", CustomPacketLogger,
- CustomPacketLoggerCondition, NULL, ThreadInit, ThreadDeinit, NULL);
- OutputRegisterFlowLogger("custom-flow-logger", CustomFlowLogger, NULL, ThreadInit, ThreadDeinit);
+ CustomPacketLoggerCondition, NULL, ThreadInit, ThreadDeinit);
+ OutputRegisterFlowLogger(
+ "custom-flow-logger", CustomFlowLogger, NULL, ThreadInit, ThreadDeinit);
}
const SCPlugin PluginRegistration = {
void AlertDebugLogRegister(void)
{
- OutputRegisterPacketModule(LOGGER_ALERT_DEBUG, MODULE_NAME, "alert-debug",
- AlertDebugLogInitCtx, AlertDebugLogLogger, AlertDebugLogCondition,
- AlertDebugLogThreadInit, AlertDebugLogThreadDeinit, NULL);
+ OutputRegisterPacketModule(LOGGER_ALERT_DEBUG, MODULE_NAME, "alert-debug", AlertDebugLogInitCtx,
+ AlertDebugLogLogger, AlertDebugLogCondition, AlertDebugLogThreadInit,
+ AlertDebugLogThreadDeinit);
}
void AlertFastLogRegister(void)
{
- OutputRegisterPacketModule(LOGGER_ALERT_FAST, MODULE_NAME, "fast",
- AlertFastLogInitCtx, AlertFastLogger, AlertFastLogCondition,
- AlertFastLogThreadInit, AlertFastLogThreadDeinit, NULL);
+ OutputRegisterPacketModule(LOGGER_ALERT_FAST, MODULE_NAME, "fast", AlertFastLogInitCtx,
+ AlertFastLogger, AlertFastLogCondition, AlertFastLogThreadInit,
+ AlertFastLogThreadDeinit);
AlertFastLogRegisterTests();
}
void AlertSyslogRegister (void)
{
#ifndef OS_WIN32
- OutputRegisterPacketModule(LOGGER_ALERT_SYSLOG, MODULE_NAME, "syslog",
- AlertSyslogInitCtx, AlertSyslogLogger, AlertSyslogCondition,
- AlertSyslogThreadInit, AlertSyslogThreadDeinit, NULL);
+ OutputRegisterPacketModule(LOGGER_ALERT_SYSLOG, MODULE_NAME, "syslog", AlertSyslogInitCtx,
+ AlertSyslogLogger, AlertSyslogCondition, AlertSyslogThreadInit,
+ AlertSyslogThreadDeinit);
#endif /* !OS_WIN32 */
}
void PcapLogRegister(void)
{
- OutputRegisterPacketModule(LOGGER_PCAP, MODULE_NAME, "pcap-log",
- PcapLogInitCtx, PcapLog, PcapLogCondition, PcapLogDataInit,
- PcapLogDataDeinit, NULL);
+ OutputRegisterPacketModule(LOGGER_PCAP, MODULE_NAME, "pcap-log", PcapLogInitCtx, PcapLog,
+ PcapLogCondition, PcapLogDataInit, PcapLogDataDeinit);
PcapLogProfileSetup();
SC_ATOMIC_INIT(thread_cnt);
SC_ATOMIC_SET(thread_cnt, 1); /* first id is 1 */
{
OutputRegisterPacketSubModule(LOGGER_JSON_STREAM, "eve-log", MODULE_NAME, "eve-log.stream",
EveStreamLogInitCtxSub, EveStreamLogger, EveStreamLogCondition, EveStreamLogThreadInit,
- EveStreamLogThreadDeinit, NULL);
+ EveStreamLogThreadDeinit);
}
void JsonAlertLogRegister (void)
{
- OutputRegisterPacketSubModule(LOGGER_JSON_ALERT, "eve-log", MODULE_NAME,
- "eve-log.alert", JsonAlertLogInitCtxSub, JsonAlertLogger,
- JsonAlertLogCondition, JsonAlertLogThreadInit, JsonAlertLogThreadDeinit,
- NULL);
+ OutputRegisterPacketSubModule(LOGGER_JSON_ALERT, "eve-log", MODULE_NAME, "eve-log.alert",
+ JsonAlertLogInitCtxSub, JsonAlertLogger, JsonAlertLogCondition, JsonAlertLogThreadInit,
+ JsonAlertLogThreadDeinit);
}
void JsonAnomalyLogRegister (void)
{
- OutputRegisterPacketSubModule(LOGGER_JSON_ANOMALY, "eve-log", MODULE_NAME,
- "eve-log.anomaly", JsonAnomalyLogInitCtxSub, JsonAnomalyLogger,
- JsonAnomalyLogCondition, JsonAnomalyLogThreadInit, JsonAnomalyLogThreadDeinit,
- NULL);
+ OutputRegisterPacketSubModule(LOGGER_JSON_ANOMALY, "eve-log", MODULE_NAME, "eve-log.anomaly",
+ JsonAnomalyLogInitCtxSub, JsonAnomalyLogger, JsonAnomalyLogCondition,
+ JsonAnomalyLogThreadInit, JsonAnomalyLogThreadDeinit);
OutputRegisterTxSubModule(LOGGER_JSON_ANOMALY, "eve-log", MODULE_NAME,
"eve-log.anomaly", JsonAnomalyLogInitCtxHelper, ALPROTO_UNKNOWN,
{
OutputRegisterPacketSubModule(LOGGER_JSON_ARP, "eve-log", "JsonArpLog", "eve-log.arp",
OutputJsonLogInitSub, JsonArpLogger, JsonArpLogCondition, JsonLogThreadInit,
- JsonLogThreadDeinit, NULL);
+ JsonLogThreadDeinit);
SCLogDebug("ARP JSON logger registered.");
}
void JsonDropLogRegister (void)
{
- OutputRegisterPacketSubModule(LOGGER_JSON_DROP, "eve-log", MODULE_NAME,
- "eve-log.drop", JsonDropLogInitCtxSub, JsonDropLogger,
- JsonDropLogCondition, JsonDropLogThreadInit, JsonDropLogThreadDeinit,
- NULL);
+ OutputRegisterPacketSubModule(LOGGER_JSON_DROP, "eve-log", MODULE_NAME, "eve-log.drop",
+ JsonDropLogInitCtxSub, JsonDropLogger, JsonDropLogCondition, JsonDropLogThreadInit,
+ JsonDropLogThreadDeinit);
}
{
OutputRegisterPacketSubModule(LOGGER_JSON_FRAME, "eve-log", MODULE_NAME, "eve-log.frame",
JsonFrameLogInitCtxSub, JsonFrameLogger, JsonFrameLogCondition, JsonFrameLogThreadInit,
- JsonFrameLogThreadDeinit, NULL);
+ JsonFrameLogThreadDeinit);
}
{
OutputRegisterPacketSubModule(LOGGER_JSON_METADATA, "eve-log", MODULE_NAME, "eve-log.metadata",
OutputJsonLogInitSub, JsonMetadataLogger, JsonMetadataLogCondition, JsonLogThreadInit,
- JsonLogThreadDeinit, NULL);
+ JsonLogThreadDeinit);
/* Kept for compatibility. */
OutputRegisterPacketSubModule(LOGGER_JSON_METADATA, "eve-log", MODULE_NAME, "eve-log.vars",
OutputJsonLogInitSub, JsonMetadataLogger, JsonMetadataLogCondition, JsonLogThreadInit,
- JsonLogThreadDeinit, NULL);
+ JsonLogThreadDeinit);
}
LoggerId logger_id;
ThreadInitFunc ThreadInit;
ThreadDeinitFunc ThreadDeinit;
- ThreadExitPrintStatsFunc ThreadExitPrintStats;
} OutputPacketLogger;
static OutputPacketLogger *list = NULL;
int OutputRegisterPacketLogger(LoggerId logger_id, const char *name, PacketLogger LogFunc,
PacketLogCondition ConditionFunc, void *initdata, ThreadInitFunc ThreadInit,
- ThreadDeinitFunc ThreadDeinit, ThreadExitPrintStatsFunc ThreadExitPrintStats)
+ ThreadDeinitFunc ThreadDeinit)
{
OutputPacketLogger *op = SCCalloc(1, sizeof(*op));
if (op == NULL)
op->name = name;
op->ThreadInit = ThreadInit;
op->ThreadDeinit = ThreadDeinit;
- op->ThreadExitPrintStats = ThreadExitPrintStats;
op->logger_id = logger_id;
if (list == NULL)
return TM_ECODE_OK;
}
-static void OutputPacketLogExitPrintStats(ThreadVars *tv, void *thread_data)
-{
- OutputPacketLoggerThreadData *op_thread_data = (OutputPacketLoggerThreadData *)thread_data;
- OutputLoggerThreadStore *store = op_thread_data->store;
- OutputPacketLogger *logger = list;
-
- while (logger && store) {
- if (logger->ThreadExitPrintStats) {
- logger->ThreadExitPrintStats(tv, store->thread_data);
- }
-
- logger = logger->next;
- store = store->next;
- }
-}
-
static uint32_t OutputPacketLoggerGetActiveCount(void)
{
uint32_t cnt = 0;
void OutputPacketLoggerRegister(void)
{
- OutputRegisterRootLogger(OutputPacketLogThreadInit,
- OutputPacketLogThreadDeinit, OutputPacketLogExitPrintStats,
- OutputPacketLog, OutputPacketLoggerGetActiveCount);
+ OutputRegisterRootLogger(OutputPacketLogThreadInit, OutputPacketLogThreadDeinit, NULL,
+ OutputPacketLog, OutputPacketLoggerGetActiveCount);
}
void OutputPacketShutdown(void)
typedef bool (*PacketLogCondition)(ThreadVars *, void *thread_data, const Packet *);
int OutputRegisterPacketLogger(LoggerId logger_id, const char *name, PacketLogger LogFunc,
- PacketLogCondition ConditionFunc, void *initdata, ThreadInitFunc, ThreadDeinitFunc,
- ThreadExitPrintStatsFunc);
+ PacketLogCondition ConditionFunc, void *initdata, ThreadInitFunc, ThreadDeinitFunc);
void OutputPacketLoggerRegister(void);
*
* \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,
- ThreadExitPrintStatsFunc ThreadExitPrintStats)
+void OutputRegisterPacketModule(LoggerId id, const char *name, const char *conf_name,
+ OutputInitFunc InitFunc, PacketLogger PacketLogFunc, PacketLogCondition PacketConditionFunc,
+ ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit)
{
if (unlikely(PacketLogFunc == NULL || PacketConditionFunc == NULL)) {
goto error;
module->PacketConditionFunc = PacketConditionFunc;
module->ThreadInit = ThreadInit;
module->ThreadDeinit = ThreadDeinit;
- module->ThreadExitPrintStats = ThreadExitPrintStats;
TAILQ_INSERT_TAIL(&output_modules, module, entries);
SCLogDebug("Packet logger \"%s\" registered.", name);
*
* \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,
- ThreadExitPrintStatsFunc ThreadExitPrintStats)
+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)
{
if (unlikely(PacketLogFunc == NULL || PacketConditionFunc == NULL)) {
goto error;
module->PacketConditionFunc = PacketConditionFunc;
module->ThreadInit = ThreadInit;
module->ThreadDeinit = ThreadDeinit;
- module->ThreadExitPrintStats = ThreadExitPrintStats;
TAILQ_INSERT_TAIL(&output_modules, module, entries);
SCLogDebug("Packet logger \"%s\" registered.", name);
void OutputRegisterModule(const char *, const char *, OutputInitFunc);
-void OutputRegisterPacketModule(LoggerId id, const char *name,
- const char *conf_name, OutputInitFunc InitFunc, PacketLogger LogFunc,
- PacketLogCondition ConditionFunc, ThreadInitFunc, ThreadDeinitFunc,
- ThreadExitPrintStatsFunc);
-void OutputRegisterPacketSubModule(LoggerId id, const char *parent_name,
- const char *name, const char *conf_name, OutputInitSubFunc InitFunc,
- PacketLogger LogFunc, PacketLogCondition ConditionFunc,
- ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit,
- ThreadExitPrintStatsFunc ThreadExitPrintStats);
+void OutputRegisterPacketModule(LoggerId id, const char *name, const char *conf_name,
+ OutputInitFunc InitFunc, PacketLogger LogFunc, PacketLogCondition ConditionFunc,
+ ThreadInitFunc, ThreadDeinitFunc);
+void OutputRegisterPacketSubModule(LoggerId id, const char *parent_name, const char *name,
+ const char *conf_name, OutputInitSubFunc InitFunc, PacketLogger LogFunc,
+ PacketLogCondition ConditionFunc, ThreadInitFunc ThreadInit, ThreadDeinitFunc ThreadDeinit);
void OutputRegisterTxModule(LoggerId id, const char *name,
const char *conf_name, OutputInitFunc InitFunc, AppProto alproto,
SCLogDebug("%s is a packet logger", module->name);
OutputRegisterPacketLogger(module->logger_id, module->name,
module->PacketLogFunc, module->PacketConditionFunc, output_ctx,
- module->ThreadInit, module->ThreadDeinit,
- module->ThreadExitPrintStats);
+ module->ThreadInit, module->ThreadDeinit);
} else if (module->TxLogFunc) {
SCLogDebug("%s is a tx logger", module->name);
OutputRegisterTxLogger(module->logger_id, module->name, module->alproto,