From 051a14acd30b31eccc3ca96a58240cd7be89142d Mon Sep 17 00:00:00 2001 From: Jeff Lucovsky Date: Thu, 27 Jul 2023 09:30:09 -0400 Subject: [PATCH] general/bool: Use bool for file support --- src/app-layer-parser.c | 6 ++---- src/app-layer-parser.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/app-layer-parser.c b/src/app-layer-parser.c index 7783c076b6..572e15f628 100644 --- a/src/app-layer-parser.c +++ b/src/app-layer-parser.c @@ -1184,16 +1184,14 @@ uint64_t AppLayerParserGetTransactionActive(const Flow *f, SCReturnCT(active_id, "uint64_t"); } -int AppLayerParserSupportsFiles(uint8_t ipproto, AppProto alproto) +bool AppLayerParserSupportsFiles(uint8_t ipproto, AppProto alproto) { // Custom case for only signature-only protocol so far if (alproto == ALPROTO_HTTP) { return AppLayerParserSupportsFiles(ipproto, ALPROTO_HTTP1) || AppLayerParserSupportsFiles(ipproto, ALPROTO_HTTP2); } - if (alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].GetTxFiles != NULL) - return TRUE; - return FALSE; + return alp_ctx.ctxs[FlowGetProtoMapping(ipproto)][alproto].GetTxFiles != NULL; } AppLayerTxData *AppLayerParserGetTxData(uint8_t ipproto, AppProto alproto, void *tx) diff --git a/src/app-layer-parser.h b/src/app-layer-parser.h index d27a08c851..e9f8cf55e9 100644 --- a/src/app-layer-parser.h +++ b/src/app-layer-parser.h @@ -253,7 +253,7 @@ uint64_t AppLayerParserGetTransactionActive(const Flow *f, AppLayerParserState * uint8_t AppLayerParserGetFirstDataDir(uint8_t ipproto, AppProto alproto); -int AppLayerParserSupportsFiles(uint8_t ipproto, AppProto alproto); +bool AppLayerParserSupportsFiles(uint8_t ipproto, AppProto alproto); AppLayerTxData *AppLayerParserGetTxData(uint8_t ipproto, AppProto alproto, void *tx); uint64_t AppLayerParserGetTxDetectFlags(AppLayerTxData *txd, const uint8_t dir);