]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
app-layer: all protocols are tx aware now
authorVictor Julien <victor@inliniac.net>
Tue, 26 Feb 2019 09:42:24 +0000 (10:42 +0100)
committerVictor Julien <victor@inliniac.net>
Tue, 11 Feb 2020 14:04:28 +0000 (15:04 +0100)
So remove the runtime check for it.

src/app-layer-parser.c
src/app-layer-parser.h
src/detect-engine.c
src/output-tx.c

index 660289e66d3acfca9b85bf654608d245e7ed4c79..00b16a29e04e3502b8e4942e34d403df7ea34f70 100644 (file)
@@ -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);
index 02a1ee5485ff3a8e1d46be847ca5cd5471a6157c..0b087683093577a1661719151e2b432161980f03 100644 (file)
@@ -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 *****/
 
index 969e070c932ceb71648d2e5543e7941c971cd6c3..98fa0975d3ffee515e0ec21e23eccd5fe5d507a9 100644 (file)
@@ -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 "
index 6368cee91e794ee7eac2dca28d37aacce1b0c12e..61b93d60978ad3e8573864015dd9a480f732307b 100644 (file)
@@ -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;