From 1f63e7b7c0e965ba8b6414fbdcc07eb807ece2d2 Mon Sep 17 00:00:00 2001 From: Jason Ish Date: Thu, 29 Aug 2024 16:33:03 -0600 Subject: [PATCH] examples: add tx logger to custom logger example However, its disabled due to issue https://redmine.openinfosecfoundation.org/issues/7236. Ticket: #7227 --- .../plugins/c-custom-loggers/custom-logger.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/examples/plugins/c-custom-loggers/custom-logger.c b/examples/plugins/c-custom-loggers/custom-logger.c index fbebbd5e9870..d533b8830dec 100644 --- a/examples/plugins/c-custom-loggers/custom-logger.c +++ b/examples/plugins/c-custom-loggers/custom-logger.c @@ -20,6 +20,7 @@ #include "output-packet.h" #include "output-flow.h" +#include "output-tx.h" #include "util-print.h" static int CustomPacketLogger(ThreadVars *tv, void *thread_data, const Packet *p) @@ -78,6 +79,15 @@ static int CustomFlowLogger(ThreadVars *tv, void *thread_data, Flow *f) return 0; } +#if 0 +static int CustomDnsLogger(ThreadVars *tv, void *thread_data, const Packet *p, Flow *f, void *state, + void *tx, uint64_t tx_id) +{ + SCLogNotice("We have a DNS transaction"); + return 0; +} +#endif + static TmEcode ThreadInit(ThreadVars *tv, const void *initdata, void **data) { return TM_ECODE_OK; @@ -96,6 +106,15 @@ static void Init(void) CustomPacketLoggerCondition, NULL, ThreadInit, ThreadDeinit); SCOutputRegisterFlowLogger( "custom-flow-logger", CustomFlowLogger, NULL, ThreadInit, ThreadDeinit); + + /* Register a custom DNS transaction logger. + * + * Currently disabled due to https://redmine.openinfosecfoundation.org/issues/7236. + */ +#if 0 + OutputRegisterTxLogger(LOGGER_USER, "custom-dns-logger", ALPROTO_DNS, CustomDnsLogger, NULL, -1, + -1, NULL, ThreadInit, ThreadDeinit); +#endif } const SCPlugin PluginRegistration = {