]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
app-layer: API calls to check for TX aware proto
authorVictor Julien <victor@inliniac.net>
Fri, 10 Jan 2014 12:02:19 +0000 (13:02 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 13 Jan 2014 10:19:00 +0000 (11:19 +0100)
Introduce AppLayerParserProtocolIsTxAware which returns 1 if protocol
is Tx aware, 0 if not.

src/app-layer-parser.c
src/app-layer-parser.h

index a25acfaa81a745ac81da33a197c8f2859915e1f2..e526618e2b1a4d630195218fb471a45263e669fc 100644 (file)
@@ -881,6 +881,14 @@ int AppLayerParserHasDecoderEvents(uint8_t ipproto, AppProto alproto,
     SCReturnInt(1);
 }
 
+int AppLayerParserProtocolIsTxAware(uint8_t ipproto, AppProto alproto)
+{
+    SCEnter();
+    int ipproto_map = FlowGetProtoMapping(ipproto);
+    int r = (alp_ctx.ctxs[ipproto_map][alproto].StateGetTx == NULL) ? 0 : 1;
+    SCReturnInt(r);
+}
+
 int AppLayerParserProtocolIsTxEventAware(uint8_t ipproto, AppProto alproto)
 {
     SCEnter();
index 1028bcfe037cdc2d2f22c63cc9035f8e31756cb9..69f94b62b6b05c241a2cdaa7d9cf9896234f0f1e 100644 (file)
@@ -175,6 +175,7 @@ int AppLayerParserParse(AppLayerParserThreadCtx *tctx, Flow *f, AppProto alproto
 void AppLayerParserSetEOF(AppLayerParserState *pstate);
 int AppLayerParserHasDecoderEvents(uint8_t ipproto, AppProto alproto, void *alstate, AppLayerParserState *pstate,
                         uint8_t flags);
+int AppLayerParserProtocolIsTxAware(uint8_t ipproto, AppProto alproto);
 int AppLayerParserProtocolIsTxEventAware(uint8_t ipproto, AppProto alproto);
 int AppLayerParserProtocolSupportsTxs(uint8_t ipproto, AppProto alproto);
 void AppLayerParserTriggerRawStreamReassembly(Flow *f);