/* 0 - to_server, 1 - to_client. */
AppLayerParserFPtr Parser[2];
bool logger;
+ uint32_t logger_bits; /**< registered loggers for this proto */
void *(*StateAlloc)(void);
void (*StateFree)(void *);
SCReturn;
}
+void AppLayerParserRegisterLoggerBits(uint8_t ipproto, AppProto alproto, LoggerId bits)
+{
+ SCEnter();
+
+ alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].logger_bits = bits;
+
+ SCReturn;
+}
+
void AppLayerParserRegisterLogger(uint8_t ipproto, AppProto alproto)
{
SCEnter();
int (*StateGetTxLogged)(void *, void *, uint32_t),
void (*StateSetTxLogged)(void *, void *, uint32_t));
void AppLayerParserRegisterLogger(uint8_t ipproto, AppProto alproto);
+void AppLayerParserRegisterLoggerBits(uint8_t ipproto, AppProto alproto, LoggerId bits);
void AppLayerParserRegisterTruncateFunc(uint8_t ipproto, AppProto alproto,
void (*Truncate)(void *, uint8_t));
void AppLayerParserRegisterGetStateProgressFunc(uint8_t ipproto, AppProto alproto,
#include "detect.h"
#include "detect-engine.h"
#include "detect-engine-mpm.h"
+#include "app-layer-parser.h"
#include "tm-threads.h"
#include "util-debug.h"
#include "util-time.h"
static int file_logger_count = 0;
static int filedata_logger_count = 0;
+static LoggerId logger_bits[ALPROTO_MAX];
int RunModeOutputFileEnabled(void)
{
module->ts_log_progress, module->TxLogCondition,
module->ThreadInit, module->ThreadDeinit,
module->ThreadExitPrintStats);
+ logger_bits[module->alproto] |= (1<<module->logger_id);
} else if (module->FiledataLogFunc) {
SCLogDebug("%s is a filedata logger", module->name);
OutputRegisterFiledataLogger(module->logger_id, module->name,
char tls_log_enabled = 0;
char tls_store_present = 0;
+ memset(&logger_bits, 0, sizeof(logger_bits));
+
TAILQ_FOREACH(output, &outputs->head, next) {
output_config = ConfNodeLookupChild(output, output->val);
}
}
+ /* register the logger bits to the app-layer */
+ int a;
+ for (a = 0; a < ALPROTO_MAX; a++) {
+ if (logger_bits[a] == 0)
+ continue;
+
+ const int tcp = AppLayerParserProtocolHasLogger(IPPROTO_TCP, a);
+ const int udp = AppLayerParserProtocolHasLogger(IPPROTO_UDP, a);
+
+ SCLogDebug("logger for %s: %s %s", AppProtoToString(a),
+ tcp ? "true" : "false", udp ? "true" : "false");
+
+ SCLogDebug("logger bits for %s: %08x", AppProtoToString(a), logger_bits[a]);
+ if (tcp)
+ AppLayerParserRegisterLoggerBits(IPPROTO_TCP, a, logger_bits[a]);
+ if (udp)
+ AppLayerParserRegisterLoggerBits(IPPROTO_UDP, a, logger_bits[a]);
+
+ }
}
float threading_detect_ratio = 1;