From: Victor Julien Date: Fri, 16 Sep 2016 12:39:56 +0000 (+0200) Subject: app-layer: add function to check if app-layer supports files X-Git-Tag: suricata-3.2beta1~394 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bcfa484bce226cda03c88edaadd82752156b95ee;p=thirdparty%2Fsuricata.git app-layer: add function to check if app-layer supports files --- diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index 4c0e9b8ee7..4d95fe12b3 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -861,6 +861,13 @@ uint64_t AppLayerParserGetTransactionActive(uint8_t ipproto, AppProto alproto, SCReturnCT(active_id, "uint64_t"); } +int AppLayerParserSupportsFiles(uint8_t ipproto, AppProto alproto) +{ + if (alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].StateGetFiles != NULL) + return TRUE; + return FALSE; +} + int AppLayerParserSupportsTxDetectState(uint8_t ipproto, AppProto alproto) { if (alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].GetTxDetectState != NULL) diff --git a/src/app-layer-parser.h b/src/app-layer-parser.h index cad9ec3182..ae7f89b6be 100644 --- a/src/app-layer-parser.h +++ b/src/app-layer-parser.h @@ -185,6 +185,7 @@ uint64_t AppLayerParserGetTransactionActive(uint8_t ipproto, AppProto alproto, A uint8_t AppLayerParserGetFirstDataDir(uint8_t ipproto, AppProto alproto); +int AppLayerParserSupportsFiles(uint8_t ipproto, AppProto alproto); int AppLayerParserSupportsTxDetectState(uint8_t ipproto, AppProto alproto); int AppLayerParserHasTxDetectState(uint8_t ipproto, AppProto alproto, void *alstate); DetectEngineState *AppLayerParserGetTxDetectState(uint8_t ipproto, AppProto alproto, void *tx);