diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index 660289e66d..00b16a29e0 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -1341,10 +1341,10 @@ bool AppLayerParserHasDecoderEvents(AppLayerParserState *pstate) return false; } -/** \brief simpler way to globally test if a alproto is registered +/** \brief simple way to globally test if a alproto is registered * and fully enabled in the configuration. */ -int AppLayerParserIsTxAware(AppProto alproto) +int AppLayerParserIsEnabled(AppProto alproto) { return (alp_ctx.ctxs[FLOW_PROTO_DEFAULT][alproto] .StateGetProgressCompletionStatus != NULL); diff --git a/src/app-layer-parser.h b/src/app-layer-parser.h index 02a1ee5485..0b08768309 100644 --- a/src/app-layer-parser.h +++ b/src/app-layer-parser.h @@ -230,7 +230,6 @@ int AppLayerParserParse(ThreadVars *tv, AppLayerParserThreadCtx *tctx, Flow *f, uint8_t flags, const uint8_t *input, uint32_t input_len); void AppLayerParserSetEOF(AppLayerParserState *pstate); bool AppLayerParserHasDecoderEvents(AppLayerParserState *pstate); -int AppLayerParserIsTxAware(AppProto alproto); int AppLayerParserProtocolIsTxEventAware(uint8_t ipproto, AppProto alproto); int AppLayerParserProtocolHasLogger(uint8_t ipproto, AppProto alproto); LoggerId AppLayerParserProtocolGetLoggerBits(uint8_t ipproto, AppProto alproto); @@ -238,6 +237,7 @@ void AppLayerParserTriggerRawStreamReassembly(Flow *f, int direction); void AppLayerParserSetStreamDepth(uint8_t ipproto, AppProto alproto, uint32_t stream_depth); uint32_t AppLayerParserGetStreamDepth(const Flow *f); void AppLayerParserSetStreamDepthFlag(uint8_t ipproto, AppProto alproto, void *state, uint64_t tx_id, uint8_t flags); +int AppLayerParserIsEnabled(AppProto alproto); /***** Cleanup *****/ diff --git a/src/detect-engine.c b/src/detect-engine.c index 969e070c93..98fa0975d3 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -171,7 +171,7 @@ void DetectAppLayerInspectEngineRegister(const char *name, AppProto alproto, uint32_t dir, int progress, InspectEngineFuncPtr Callback) { - if (AppLayerParserIsTxAware(alproto)) { + if (AppLayerParserIsEnabled(alproto)) { if (!AppLayerParserSupportsTxDetectFlags(alproto)) { FatalError(SC_ERR_INITIALIZATION, "Inspect engine registered for app-layer protocol without " diff --git a/src/output-tx.c b/src/output-tx.c index 6368cee91e..61b93d6097 100644 --- a/src/output-tx.c +++ b/src/output-tx.c @@ -72,12 +72,11 @@ int OutputRegisterTxLogger(LoggerId id, const char *name, AppProto alproto, ThreadDeinitFunc ThreadDeinit, void (*ThreadExitPrintStats)(ThreadVars *, void *)) { - if (alproto != ALPROTO_UNKNOWN && !(AppLayerParserIsTxAware(alproto))) { + if (alproto != ALPROTO_UNKNOWN && !(AppLayerParserIsEnabled(alproto))) { SCLogNotice("%s logger not enabled: protocol %s is disabled", name, AppProtoToString(alproto)); return -1; } - OutputTxLogger *op = SCMalloc(sizeof(*op)); if (op == NULL) return -1;