From: Victor Julien Date: Fri, 10 Jan 2014 12:02:19 +0000 (+0100) Subject: app-layer: API calls to check for TX aware proto X-Git-Tag: suricata-2.0rc1~206 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2d420bed4f7ca9cf62154cc71dd446d306a19fd;p=thirdparty%2Fsuricata.git app-layer: API calls to check for TX aware proto Introduce AppLayerParserProtocolIsTxAware which returns 1 if protocol is Tx aware, 0 if not. --- diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index a25acfaa81..e526618e2b 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -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(); diff --git a/src/app-layer-parser.h b/src/app-layer-parser.h index 1028bcfe03..69f94b62b6 100644 --- a/src/app-layer-parser.h +++ b/src/app-layer-parser.h @@ -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);