From: Philippe Antoine Date: Fri, 3 Jun 2022 14:08:34 +0000 (+0200) Subject: detect: change InspectEngineFuncPtr2 to return uint8_t X-Git-Tag: suricata-7.0.0-beta1~465 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8524e70d97f52222cba5992e2354bf783abef5d;p=thirdparty%2Fsuricata.git detect: change InspectEngineFuncPtr2 to return uint8_t --- diff --git a/src/detect-app-layer-event.c b/src/detect-app-layer-event.c index 174e25827b..a581812e21 100644 --- a/src/detect-app-layer-event.c +++ b/src/detect-app-layer-event.c @@ -55,7 +55,7 @@ static int DetectAppLayerEventSetupP1(DetectEngineCtx *, Signature *, const char static void DetectAppLayerEventRegisterTests(void); #endif static void DetectAppLayerEventFree(DetectEngineCtx *, void *); -static int DetectEngineAptEventInspect(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, +static uint8_t DetectEngineAptEventInspect(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); static int g_applayer_events_list_id = 0; @@ -85,7 +85,7 @@ void DetectAppLayerEventRegister(void) g_applayer_events_list_id = DetectBufferTypeGetByName("app-layer-events"); } -static int DetectEngineAptEventInspect(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, +static uint8_t DetectEngineAptEventInspect(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id) { diff --git a/src/detect-dce-iface.c b/src/detect-dce-iface.c index d87fd57b9b..6631e685f9 100644 --- a/src/detect-dce-iface.c +++ b/src/detect-dce-iface.c @@ -62,7 +62,7 @@ static void DetectDceIfaceRegisterTests(void); #endif static int g_dce_generic_list_id = 0; -static int InspectDceGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, +static uint8_t InspectDceGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -94,7 +94,7 @@ void DetectDceIfaceRegister(void) "dce_generic", ALPROTO_SMB, SIG_FLAG_TOCLIENT, 0, InspectDceGeneric, NULL); } -static int InspectDceGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, +static uint8_t InspectDceGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-dnp3.c b/src/detect-dnp3.c index fa54c8d42f..ee73ebf89f 100644 --- a/src/detect-dnp3.c +++ b/src/detect-dnp3.c @@ -175,7 +175,7 @@ static InspectionBuffer *GetDNP3Data(DetectEngineThreadCtx *det_ctx, return buffer; } -static int DetectEngineInspectDNP3(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, +static uint8_t DetectEngineInspectDNP3(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-dns-opcode.c b/src/detect-dns-opcode.c index e4356c47bf..8e71ab6f0c 100644 --- a/src/detect-dns-opcode.c +++ b/src/detect-dns-opcode.c @@ -74,7 +74,7 @@ static int DetectDnsOpcodeMatch(DetectEngineThreadCtx *det_ctx, return rs_dns_opcode_match(txv, (void *)ctx, flags); } -static int DetectEngineInspectRequestGenericDnsOpcode(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectRequestGenericDnsOpcode(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-dns-query.c b/src/detect-dns-query.c index 9c688cd8b2..8faa935fe4 100644 --- a/src/detect-dns-query.c +++ b/src/detect-dns-query.c @@ -94,11 +94,9 @@ static InspectionBuffer *DnsQueryGetData(DetectEngineThreadCtx *det_ctx, SCReturnPtr(buffer, "InspectionBuffer"); } -static int DetectEngineInspectDnsQuery( - DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const DetectEngineAppInspectionEngine *engine, - const Signature *s, - Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) +static uint8_t DetectEngineInspectDnsQuery(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, + void *alstate, void *txv, uint64_t tx_id) { uint32_t local_id = 0; @@ -199,17 +197,17 @@ static int PrefilterMpmDnsQueryRegister(DetectEngineCtx *de_ctx, } #ifdef HAVE_LUA -static int DetectEngineInspectDnsRequest(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, - uint8_t flags, void *alstate, void *txv, uint64_t tx_id) +static uint8_t DetectEngineInspectDnsRequest(DetectEngineCtx *de_ctx, + DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { return DetectEngineInspectGenericList( de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id); } -static int DetectEngineInspectDnsResponse(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, - uint8_t flags, void *alstate, void *txv, uint64_t tx_id) +static uint8_t DetectEngineInspectDnsResponse(DetectEngineCtx *de_ctx, + DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { return DetectEngineInspectGenericList( de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id); diff --git a/src/detect-engine-content-inspection.c b/src/detect-engine-content-inspection.c index a34b492222..d0be34ca0d 100644 --- a/src/detect-engine-content-inspection.c +++ b/src/detect-engine-content-inspection.c @@ -100,12 +100,9 @@ * \retval 0 no match * \retval 1 match */ -int DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const Signature *s, const SigMatchData *smd, - Packet *p, Flow *f, - const uint8_t *buffer, uint32_t buffer_len, - uint32_t stream_start_offset, uint8_t flags, - uint8_t inspection_mode) +uint8_t DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatchData *smd, Packet *p, Flow *f, const uint8_t *buffer, + uint32_t buffer_len, uint32_t stream_start_offset, uint8_t flags, uint8_t inspection_mode) { SCEnter(); KEYWORD_PROFILING_START; @@ -343,9 +340,8 @@ int DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx /* see if the next buffer keywords match. If not, we will * search for another occurrence of this content and see * if the others match then until we run out of matches */ - int r = DetectEngineContentInspection(de_ctx, det_ctx, s, smd+1, - p, f, buffer, buffer_len, stream_start_offset, flags, - inspection_mode); + uint8_t r = DetectEngineContentInspection(de_ctx, det_ctx, s, smd + 1, p, f, + buffer, buffer_len, stream_start_offset, flags, inspection_mode); if (r == 1) { SCReturnInt(1); } @@ -609,7 +605,7 @@ int DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx } else if (smd->type == DETECT_AL_URILEN) { SCLogDebug("inspecting uri len"); - int r = 0; + uint8_t r = 0; DetectUrilenData *urilend = (DetectUrilenData *) smd->ctx; switch (urilend->mode) { @@ -680,9 +676,8 @@ match: * the buffer portion of the signature matched. */ if (!smd->is_last) { KEYWORD_PROFILING_END(det_ctx, smd->type, 1); - int r = DetectEngineContentInspection(de_ctx, det_ctx, s, smd+1, - p, f, buffer, buffer_len, stream_start_offset, flags, - inspection_mode); + uint8_t r = DetectEngineContentInspection(de_ctx, det_ctx, s, smd + 1, p, f, buffer, + buffer_len, stream_start_offset, flags, inspection_mode); SCReturnInt(r); } final_match: diff --git a/src/detect-engine-content-inspection.h b/src/detect-engine-content-inspection.h index 149109e60e..ae1e8ed5bf 100644 --- a/src/detect-engine-content-inspection.h +++ b/src/detect-engine-content-inspection.h @@ -46,12 +46,9 @@ enum { * inspection function contains both start and end of the data. */ #define DETECT_CI_FLAGS_SINGLE (DETECT_CI_FLAGS_START|DETECT_CI_FLAGS_END) -int DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const Signature *s, const SigMatchData *smd, - Packet *p, Flow *f, - const uint8_t *buffer, uint32_t buffer_len, - uint32_t stream_start_offset, uint8_t flags, - uint8_t inspection_mode); +uint8_t DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatchData *smd, Packet *p, Flow *f, const uint8_t *buffer, + uint32_t buffer_len, uint32_t stream_start_offset, uint8_t flags, uint8_t inspection_mode); void DetectEngineContentInspectionRegisterTests(void); diff --git a/src/detect-engine-dcepayload.h b/src/detect-engine-dcepayload.h index d67a3cffe0..dc2fcd809b 100644 --- a/src/detect-engine-dcepayload.h +++ b/src/detect-engine-dcepayload.h @@ -24,7 +24,7 @@ #ifndef __DETECT_ENGINE_DCEPAYLOAD_H__ #define __DETECT_ENGINE_DCEPAYLOAD_H__ -//int DetectEngineInspectDcePayload(DetectEngineCtx *, DetectEngineThreadCtx *, +// uint8_t DetectEngineInspectDcePayload(DetectEngineCtx *, DetectEngineThreadCtx *, // const Signature *, Flow *, uint8_t, void *); void DcePayloadRegisterTests(void); diff --git a/src/detect-engine-enip.c b/src/detect-engine-enip.c index c6f5d570ea..5e5ccaf1ed 100644 --- a/src/detect-engine-enip.c +++ b/src/detect-engine-enip.c @@ -217,7 +217,7 @@ static int CIPServiceMatch(ENIPTransaction *enip_data, * * \retval 0 no match or 1 match */ -int DetectEngineInspectCIP(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, +uint8_t DetectEngineInspectCIP(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { @@ -256,7 +256,7 @@ int DetectEngineInspectCIP(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_c * \retval 0 no match or 1 match */ -int DetectEngineInspectENIP(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, +uint8_t DetectEngineInspectENIP(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-engine-enip.h b/src/detect-engine-enip.h index 4ef333b200..3c263f9997 100644 --- a/src/detect-engine-enip.h +++ b/src/detect-engine-enip.h @@ -23,11 +23,11 @@ #ifndef __DETECT_ENGINE_ENIP_H__ #define __DETECT_ENGINE_ENIP_H__ -int DetectEngineInspectCIP(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *, +uint8_t DetectEngineInspectCIP(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *, const struct DetectEngineAppInspectionEngine_ *, const Signature *, Flow *, uint8_t, void *, void *, uint64_t); -int DetectEngineInspectENIP(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *, +uint8_t DetectEngineInspectENIP(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *, const struct DetectEngineAppInspectionEngine_ *, const Signature *, Flow *, uint8_t, void *, void *, uint64_t); diff --git a/src/detect-engine-file.c b/src/detect-engine-file.c index 87034c6475..84a1809e91 100644 --- a/src/detect-engine-file.c +++ b/src/detect-engine-file.c @@ -64,10 +64,10 @@ * \retval 2 can't match * \retval 3 can't match filestore signature */ -static int DetectFileInspect(DetectEngineThreadCtx *det_ctx, Flow *f, const Signature *s, +static uint8_t DetectFileInspect(DetectEngineThreadCtx *det_ctx, Flow *f, const Signature *s, const SigMatchData *smd, uint8_t flags, FileContainer *ffc) { - int r = 0; + uint8_t r = 0; int match = 0; int store_r = 0; @@ -213,7 +213,7 @@ static int DetectFileInspect(DetectEngineThreadCtx *det_ctx, Flow *f, const Sign * * \note flow is not locked at this time */ -int DetectFileInspectGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, +uint8_t DetectFileInspectGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *_alstate, void *tx, uint64_t tx_id) { @@ -226,8 +226,8 @@ int DetectFileInspectGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det SCReturnInt(DETECT_ENGINE_INSPECT_SIG_NO_MATCH); } - int r = DETECT_ENGINE_INSPECT_SIG_NO_MATCH; - int match = DetectFileInspect(det_ctx, f, s, engine->smd, flags, ffc); + uint8_t r = DETECT_ENGINE_INSPECT_SIG_NO_MATCH; + uint8_t match = DetectFileInspect(det_ctx, f, s, engine->smd, flags, ffc); if (match == DETECT_ENGINE_INSPECT_SIG_MATCH) { r = DETECT_ENGINE_INSPECT_SIG_MATCH; } else if (match == DETECT_ENGINE_INSPECT_SIG_CANT_MATCH) { diff --git a/src/detect-engine-file.h b/src/detect-engine-file.h index d5cfa9f1f2..3705a8f6e6 100644 --- a/src/detect-engine-file.h +++ b/src/detect-engine-file.h @@ -24,7 +24,7 @@ #ifndef __DETECT_ENGINE_FILE_H__ #define __DETECT_ENGINE_FILE_H__ -int DetectFileInspectGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, +uint8_t DetectFileInspectGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *_alstate, void *tx, uint64_t tx_id); diff --git a/src/detect-engine-payload.c b/src/detect-engine-payload.c index 65cdf076da..110ac6c26f 100644 --- a/src/detect-engine-payload.c +++ b/src/detect-engine-payload.c @@ -145,8 +145,8 @@ int PrefilterPktPayloadRegister(DetectEngineCtx *de_ctx, * \retval 0 no match * \retval 1 match */ -int DetectEngineInspectPacketPayload(DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, const Signature *s, Flow *f, Packet *p) +uint8_t DetectEngineInspectPacketPayload(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const Signature *s, Flow *f, Packet *p) { SCEnter(); int r = 0; @@ -186,10 +186,9 @@ int DetectEngineInspectPacketPayload(DetectEngineCtx *de_ctx, * \retval 0 no match * \retval 1 match */ -static int DetectEngineInspectStreamUDPPayload(DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const Signature *s, const SigMatchData *smd, - Flow *f, Packet *p) +static uint8_t DetectEngineInspectStreamUDPPayload(DetectEngineCtx *de_ctx, + DetectEngineThreadCtx *det_ctx, const Signature *s, const SigMatchData *smd, Flow *f, + Packet *p) { SCEnter(); int r = 0; @@ -314,7 +313,7 @@ static int StreamContentInspectEngineFunc( * * Returns "can't match" if depth is reached. */ -int DetectEngineInspectStream(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, +uint8_t DetectEngineInspectStream(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-engine-payload.h b/src/detect-engine-payload.h index d10ee66a85..7ef29db6c6 100644 --- a/src/detect-engine-payload.h +++ b/src/detect-engine-payload.h @@ -29,12 +29,12 @@ int PrefilterPktPayloadRegister(DetectEngineCtx *de_ctx, int PrefilterPktStreamRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx); -int DetectEngineInspectPacketPayload(DetectEngineCtx *, - DetectEngineThreadCtx *, const Signature *, Flow *, Packet *); +uint8_t DetectEngineInspectPacketPayload( + DetectEngineCtx *, DetectEngineThreadCtx *, const Signature *, Flow *, Packet *); int DetectEngineInspectStreamPayload(DetectEngineCtx *, DetectEngineThreadCtx *, const Signature *, Flow *, Packet *); -int DetectEngineInspectStream(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, +uint8_t DetectEngineInspectStream(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); diff --git a/src/detect-engine.c b/src/detect-engine.c index b969db79b4..2189721f79 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -1946,9 +1946,9 @@ int DetectEngineReloadIsIdle(void) * \retval 0 no match * \retval 1 match */ -int DetectEngineInspectGenericList(const DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const Signature *s, const SigMatchData *smd, Flow *f, const uint8_t flags, void *alstate, - void *txv, uint64_t tx_id) +uint8_t DetectEngineInspectGenericList(const DetectEngineCtx *de_ctx, + DetectEngineThreadCtx *det_ctx, const Signature *s, const SigMatchData *smd, Flow *f, + const uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { SCLogDebug("running match functions, sm %p", smd); if (smd != NULL) { @@ -1988,11 +1988,9 @@ int DetectEngineInspectGenericList(const DetectEngineCtx *de_ctx, DetectEngineTh * \retval 1 match. * \retval 2 Sig can't match. */ -int DetectEngineInspectBufferGeneric( - DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const DetectEngineAppInspectionEngine *engine, - const Signature *s, - Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) +uint8_t DetectEngineInspectBufferGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, + void *alstate, void *txv, uint64_t tx_id) { const int list_id = engine->sm_list; SCLogDebug("running inspect on %d", list_id); diff --git a/src/detect-engine.h b/src/detect-engine.h index 018149f7d3..a55b140d95 100644 --- a/src/detect-engine.h +++ b/src/detect-engine.h @@ -134,14 +134,12 @@ int DetectEngineTentantUnregisterVlanId(uint32_t tenant_id, uint16_t vlan_id); int DetectEngineTentantRegisterPcapFile(uint32_t tenant_id); int DetectEngineTentantUnregisterPcapFile(uint32_t tenant_id); -int DetectEngineInspectGenericList(const DetectEngineCtx *, DetectEngineThreadCtx *, +uint8_t DetectEngineInspectGenericList(const DetectEngineCtx *, DetectEngineThreadCtx *, const Signature *, const SigMatchData *, Flow *, const uint8_t, void *, void *, uint64_t); -int DetectEngineInspectBufferGeneric( - DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const DetectEngineAppInspectionEngine *engine, - const Signature *s, - Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); +uint8_t DetectEngineInspectBufferGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, + void *alstate, void *txv, uint64_t tx_id); int DetectEngineInspectPktBufferGeneric( DetectEngineThreadCtx *det_ctx, diff --git a/src/detect-file-data.c b/src/detect-file-data.c index 4c15e448d4..0904b7c527 100644 --- a/src/detect-file-data.c +++ b/src/detect-file-data.c @@ -66,16 +66,14 @@ static int PrefilterMpmHTTPFiledataRegister(DetectEngineCtx *de_ctx, SigGroupHea MpmCtx *mpm_ctx, const DetectBufferMpmRegistery *mpm_reg, int list_id); /* file API */ -static int DetectEngineInspectFiledata( - DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const DetectEngineAppInspectionEngine *engine, - const Signature *s, - Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); +static uint8_t DetectEngineInspectFiledata(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, + void *alstate, void *txv, uint64_t tx_id); int PrefilterMpmFiledataRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistery *mpm_reg, int list_id); -static int DetectEngineInspectBufferHttpBody(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectBufferHttpBody(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -401,7 +399,7 @@ static InspectionBuffer *HttpServerBodyGetDataCallback(DetectEngineThreadCtx *de SCReturnPtr(buffer, "InspectionBuffer"); } -static int DetectEngineInspectBufferHttpBody(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectBufferHttpBody(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { @@ -596,11 +594,9 @@ static InspectionBuffer *FiledataGetDataCallback(DetectEngineThreadCtx *det_ctx, } } -static int DetectEngineInspectFiledata( - DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const DetectEngineAppInspectionEngine *engine, - const Signature *s, - Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) +static uint8_t DetectEngineInspectFiledata(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, + void *alstate, void *txv, uint64_t tx_id) { int r = 0; int match = 0; diff --git a/src/detect-filemagic.c b/src/detect-filemagic.c index 93ac153d86..8b40f06ab4 100644 --- a/src/detect-filemagic.c +++ b/src/detect-filemagic.c @@ -93,11 +93,9 @@ static int g_file_magic_buffer_id = 0; static int PrefilterMpmFilemagicRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistery *mpm_reg, int list_id); -static int DetectEngineInspectFilemagic( - DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const DetectEngineAppInspectionEngine *engine, - const Signature *s, - Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); +static uint8_t DetectEngineInspectFilemagic(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, + void *alstate, void *txv, uint64_t tx_id); static int g_magic_thread_ctx_id = -1; @@ -465,11 +463,9 @@ static InspectionBuffer *FilemagicGetDataCallback(DetectEngineThreadCtx *det_ctx SCReturnPtr(buffer, "InspectionBuffer"); } -static int DetectEngineInspectFilemagic( - DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const DetectEngineAppInspectionEngine *engine, - const Signature *s, - Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) +static uint8_t DetectEngineInspectFilemagic(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, + void *alstate, void *txv, uint64_t tx_id) { const DetectEngineTransforms *transforms = NULL; if (!engine->mpm) { @@ -481,7 +477,7 @@ static int DetectEngineInspectFilemagic( return DETECT_ENGINE_INSPECT_SIG_NO_MATCH; } - int r = DETECT_ENGINE_INSPECT_SIG_NO_MATCH; + uint8_t r = DETECT_ENGINE_INSPECT_SIG_NO_MATCH; int local_file_id = 0; for (File *file = ffc->head; file != NULL; file = file->next) { if (file->txid != tx_id) diff --git a/src/detect-filename.c b/src/detect-filename.c index 63f5085dd3..382881034e 100644 --- a/src/detect-filename.c +++ b/src/detect-filename.c @@ -68,11 +68,9 @@ static int g_file_name_buffer_id = 0; static int PrefilterMpmFilenameRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistery *mpm_reg, int list_id); -static int DetectEngineInspectFilename( - DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const DetectEngineAppInspectionEngine *engine, - const Signature *s, - Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); +static uint8_t DetectEngineInspectFilename(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, + void *alstate, void *txv, uint64_t tx_id); /** * \brief Registration function for keyword: filename @@ -371,11 +369,9 @@ static InspectionBuffer *FilenameGetDataCallback(DetectEngineThreadCtx *det_ctx, SCReturnPtr(buffer, "InspectionBuffer"); } -static int DetectEngineInspectFilename( - DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const DetectEngineAppInspectionEngine *engine, - const Signature *s, - Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) +static uint8_t DetectEngineInspectFilename(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, + void *alstate, void *txv, uint64_t tx_id) { const DetectEngineTransforms *transforms = NULL; if (!engine->mpm) { @@ -387,7 +383,7 @@ static int DetectEngineInspectFilename( return DETECT_ENGINE_INSPECT_SIG_NO_MATCH; } - int r = DETECT_ENGINE_INSPECT_SIG_NO_MATCH; + uint8_t r = DETECT_ENGINE_INSPECT_SIG_NO_MATCH; int local_file_id = 0; for (File *file = ffc->head; file != NULL; file = file->next) { if (file->txid != tx_id) diff --git a/src/detect-ftpbounce.c b/src/detect-ftpbounce.c index fd09968320..3f556cedaa 100644 --- a/src/detect-ftpbounce.c +++ b/src/detect-ftpbounce.c @@ -57,7 +57,7 @@ static void DetectFtpbounceRegisterTests(void); #endif static int g_ftp_request_list_id = 0; -static int InspectFtpRequest(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, +static uint8_t InspectFtpRequest(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -83,7 +83,7 @@ void DetectFtpbounceRegister(void) "ftp_request", ALPROTO_FTP, SIG_FLAG_TOSERVER, 0, InspectFtpRequest, NULL); } -static int InspectFtpRequest(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, +static uint8_t InspectFtpRequest(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-ftpdata.c b/src/detect-ftpdata.c index 15ba03c4b4..f058264dc1 100644 --- a/src/detect-ftpdata.c +++ b/src/detect-ftpdata.c @@ -49,7 +49,7 @@ static void DetectFtpdataFree (DetectEngineCtx *, void *); #ifdef UNITTESTS static void DetectFtpdataRegisterTests (void); #endif -static int DetectEngineInspectFtpdataGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectFtpdataGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); static int g_ftpdata_buffer_id = 0; @@ -87,7 +87,7 @@ void DetectFtpdataRegister(void) { DetectSetupParseRegexes(PARSE_REGEX, &parse_regex); } -static int DetectEngineInspectFtpdataGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectFtpdataGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-http-client-body.c b/src/detect-http-client-body.c index 8fe1802bf6..f451195763 100644 --- a/src/detect-http-client-body.c +++ b/src/detect-http-client-body.c @@ -68,7 +68,7 @@ static void DetectHttpClientBodySetupCallback(const DetectEngineCtx *de_ctx, Signature *s); static int g_http_client_body_buffer_id = 0; -static int DetectEngineInspectBufferHttpBody(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectBufferHttpBody(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -295,7 +295,7 @@ static InspectionBuffer *HttpRequestBodyGetDataCallback(DetectEngineThreadCtx *d SCReturnPtr(buffer, "InspectionBuffer"); } -static int DetectEngineInspectBufferHttpBody(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectBufferHttpBody(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-http-header.c b/src/detect-http-header.c index bedee8f0c7..ea692c604e 100644 --- a/src/detect-http-header.c +++ b/src/detect-http-header.c @@ -166,11 +166,9 @@ static InspectionBuffer *GetBuffer2ForTX(DetectEngineThreadCtx *det_ctx, /** \internal * \brief custom inspect function to utilize the cached headers */ -static int DetectEngineInspectBufferHttpHeader( - DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const DetectEngineAppInspectionEngine *engine, - const Signature *s, - Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) +static uint8_t DetectEngineInspectBufferHttpHeader(DetectEngineCtx *de_ctx, + DetectEngineThreadCtx *det_ctx, const DetectEngineAppInspectionEngine *engine, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { SCEnter(); diff --git a/src/detect-http2.c b/src/detect-http2.c index e0682e05b1..75af58c43f 100644 --- a/src/detect-http2.c +++ b/src/detect-http2.c @@ -86,21 +86,17 @@ static int DetectHTTP2headerNameSetup(DetectEngineCtx *de_ctx, Signature *s, con static int PrefilterMpmHttp2HeaderNameRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistery *mpm_reg, int list_id); -static int DetectEngineInspectHttp2HeaderName( - DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const DetectEngineAppInspectionEngine *engine, - const Signature *s, - Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); +static uint8_t DetectEngineInspectHttp2HeaderName(DetectEngineCtx *de_ctx, + DetectEngineThreadCtx *det_ctx, const DetectEngineAppInspectionEngine *engine, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); static int DetectHTTP2headerSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg); static int PrefilterMpmHttp2HeaderRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistery *mpm_reg, int list_id); -static int DetectEngineInspectHttp2Header( - DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const DetectEngineAppInspectionEngine *engine, - const Signature *s, - Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); +static uint8_t DetectEngineInspectHttp2Header(DetectEngineCtx *de_ctx, + DetectEngineThreadCtx *det_ctx, const DetectEngineAppInspectionEngine *engine, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); static bool DetectHttp2HeaderValidateCallback(const Signature *s, const char **sigerror); #ifdef UNITTESTS @@ -111,7 +107,7 @@ static int g_http2_match_buffer_id = 0; static int g_http2_header_name_buffer_id = 0; static int g_http2_header_buffer_id = 0; -static int DetectEngineInspectHTTP2(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, +static uint8_t DetectEngineInspectHTTP2(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { @@ -759,11 +755,9 @@ static int PrefilterMpmHttp2HeaderNameRegister(DetectEngineCtx *de_ctx, pectx, PrefilterMpmHttp2HNameFree, mpm_reg->name); } -static int DetectEngineInspectHttp2HeaderName( - DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const DetectEngineAppInspectionEngine *engine, - const Signature *s, - Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) +static uint8_t DetectEngineInspectHttp2HeaderName(DetectEngineCtx *de_ctx, + DetectEngineThreadCtx *det_ctx, const DetectEngineAppInspectionEngine *engine, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { uint32_t local_id = 0; @@ -891,11 +885,9 @@ static int PrefilterMpmHttp2HeaderRegister(DetectEngineCtx *de_ctx, pectx, PrefilterMpmHttp2HeaderFree, mpm_reg->name); } -static int DetectEngineInspectHttp2Header( - DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const DetectEngineAppInspectionEngine *engine, - const Signature *s, - Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) +static uint8_t DetectEngineInspectHttp2Header(DetectEngineCtx *de_ctx, + DetectEngineThreadCtx *det_ctx, const DetectEngineAppInspectionEngine *engine, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { uint32_t local_id = 0; diff --git a/src/detect-ike-chosen-sa.c b/src/detect-ike-chosen-sa.c index 92b965c98c..3b2932e17f 100644 --- a/src/detect-ike-chosen-sa.c +++ b/src/detect-ike-chosen-sa.c @@ -56,7 +56,7 @@ static int DetectIkeChosenSaSetup(DetectEngineCtx *, Signature *s, const char *s static void DetectIkeChosenSaFree(DetectEngineCtx *, void *); static int g_ike_chosen_sa_buffer_id = 0; -static int DetectEngineInspectIkeChosenSaGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectIkeChosenSaGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -87,7 +87,7 @@ void DetectIkeChosenSaRegister(void) g_ike_chosen_sa_buffer_id = DetectBufferTypeGetByName("ike.chosen_sa_attribute"); } -static int DetectEngineInspectIkeChosenSaGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectIkeChosenSaGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-ike-exch-type.c b/src/detect-ike-exch-type.c index 729d584864..13cb7e6282 100644 --- a/src/detect-ike-exch-type.c +++ b/src/detect-ike-exch-type.c @@ -41,7 +41,7 @@ static int DetectIkeExchTypeSetup(DetectEngineCtx *, Signature *s, const char *s static void DetectIkeExchTypeFree(DetectEngineCtx *, void *); static int g_ike_exch_type_buffer_id = 0; -static int DetectEngineInspectIkeExchTypeGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectIkeExchTypeGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -70,7 +70,7 @@ void DetectIkeExchTypeRegister(void) g_ike_exch_type_buffer_id = DetectBufferTypeGetByName("ike.exchtype"); } -static int DetectEngineInspectIkeExchTypeGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectIkeExchTypeGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-ike-key-exchange-payload-length.c b/src/detect-ike-key-exchange-payload-length.c index 5fbb615ada..84961bf8e3 100644 --- a/src/detect-ike-key-exchange-payload-length.c +++ b/src/detect-ike-key-exchange-payload-length.c @@ -40,7 +40,7 @@ static int DetectIkeKeyExchangePayloadLengthSetup(DetectEngineCtx *, Signature * static void DetectIkeKeyExchangePayloadLengthFree(DetectEngineCtx *, void *); static int g_ike_key_exch_payload_length_buffer_id = 0; -static int DetectEngineInspectIkeKeyExchangePayloadLengthGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectIkeKeyExchangePayloadLengthGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -75,7 +75,7 @@ void DetectIkeKeyExchangePayloadLengthRegister(void) DetectBufferTypeGetByName("ike.key_exchange_payload_length"); } -static int DetectEngineInspectIkeKeyExchangePayloadLengthGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectIkeKeyExchangePayloadLengthGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-ike-nonce-payload-length.c b/src/detect-ike-nonce-payload-length.c index 7ec7b2ce0d..b29a8d2ef7 100644 --- a/src/detect-ike-nonce-payload-length.c +++ b/src/detect-ike-nonce-payload-length.c @@ -40,7 +40,7 @@ static int DetectIkeNoncePayloadLengthSetup(DetectEngineCtx *, Signature *s, con static void DetectIkeNoncePayloadLengthFree(DetectEngineCtx *, void *); static int g_ike_nonce_payload_length_buffer_id = 0; -static int DetectEngineInspectIkeNoncePayloadLengthGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectIkeNoncePayloadLengthGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -70,7 +70,7 @@ void DetectIkeNoncePayloadLengthRegister(void) g_ike_nonce_payload_length_buffer_id = DetectBufferTypeGetByName("ike.nonce_payload_length"); } -static int DetectEngineInspectIkeNoncePayloadLengthGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectIkeNoncePayloadLengthGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-ike-vendor.c b/src/detect-ike-vendor.c index eaa1d52ed8..73c2c0a7bf 100644 --- a/src/detect-ike-vendor.c +++ b/src/detect-ike-vendor.c @@ -132,7 +132,7 @@ static int PrefilterMpmIkeVendorRegister(DetectEngineCtx *de_ctx, SigGroupHead * mpm_reg->app_v2.tx_min_progress, pectx, PrefilterMpmIkeVendorFree, mpm_reg->pname); } -static int DetectEngineInspectIkeVendor(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, +static uint8_t DetectEngineInspectIkeVendor(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-krb5-cname.c b/src/detect-krb5-cname.c index 9ae593a8f2..a7a2710178 100644 --- a/src/detect-krb5-cname.c +++ b/src/detect-krb5-cname.c @@ -81,11 +81,9 @@ static InspectionBuffer *GetKrb5CNameData(DetectEngineThreadCtx *det_ctx, SCReturnPtr(buffer, "InspectionBuffer"); } -static int DetectEngineInspectKrb5CName( - DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const DetectEngineAppInspectionEngine *engine, - const Signature *s, - Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) +static uint8_t DetectEngineInspectKrb5CName(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, + void *alstate, void *txv, uint64_t tx_id) { uint32_t local_id = 0; diff --git a/src/detect-krb5-errcode.c b/src/detect-krb5-errcode.c index 8484daebd6..c39f18c543 100644 --- a/src/detect-krb5-errcode.c +++ b/src/detect-krb5-errcode.c @@ -49,9 +49,9 @@ static void DetectKrb5ErrCodeFree (DetectEngineCtx *, void *); static void DetectKrb5ErrCodeRegisterTests (void); #endif -static int DetectEngineInspectKRB5Generic(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, - uint8_t flags, void *alstate, void *txv, uint64_t tx_id); +static uint8_t DetectEngineInspectKRB5Generic(DetectEngineCtx *de_ctx, + DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); static int g_krb5_err_code_list_id = 0; @@ -86,9 +86,9 @@ void DetectKrb5ErrCodeRegister(void) SCLogDebug("g_krb5_err_code_list_id %d", g_krb5_err_code_list_id); } -static int DetectEngineInspectKRB5Generic(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, - uint8_t flags, void *alstate, void *txv, uint64_t tx_id) +static uint8_t DetectEngineInspectKRB5Generic(DetectEngineCtx *de_ctx, + DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { return DetectEngineInspectGenericList( de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id); diff --git a/src/detect-krb5-msgtype.c b/src/detect-krb5-msgtype.c index 4c661f38d6..ee5d7f0618 100644 --- a/src/detect-krb5-msgtype.c +++ b/src/detect-krb5-msgtype.c @@ -49,9 +49,9 @@ static void DetectKrb5MsgTypeFree (DetectEngineCtx *, void *); static void DetectKrb5MsgTypeRegisterTests (void); #endif -static int DetectEngineInspectKRB5Generic(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, - void *alstate, void *txv, uint64_t tx_id); +static uint8_t DetectEngineInspectKRB5Generic(DetectEngineCtx *de_ctx, + DetectEngineThreadCtx *det_ctx, const DetectEngineAppInspectionEngine *engine, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); static int g_krb5_msg_type_list_id = 0; @@ -86,9 +86,9 @@ void DetectKrb5MsgTypeRegister(void) SCLogDebug("g_krb5_msg_type_list_id %d", g_krb5_msg_type_list_id); } -static int DetectEngineInspectKRB5Generic(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, - void *alstate, void *txv, uint64_t tx_id) +static uint8_t DetectEngineInspectKRB5Generic(DetectEngineCtx *de_ctx, + DetectEngineThreadCtx *det_ctx, const DetectEngineAppInspectionEngine *engine, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { return DetectEngineInspectGenericList( de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id); diff --git a/src/detect-krb5-sname.c b/src/detect-krb5-sname.c index 6adb73695f..318484b086 100644 --- a/src/detect-krb5-sname.c +++ b/src/detect-krb5-sname.c @@ -81,11 +81,9 @@ static InspectionBuffer *GetKrb5SNameData(DetectEngineThreadCtx *det_ctx, SCReturnPtr(buffer, "InspectionBuffer"); } -static int DetectEngineInspectKrb5SName( - DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const DetectEngineAppInspectionEngine *engine, - const Signature *s, - Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) +static uint8_t DetectEngineInspectKrb5SName(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, + void *alstate, void *txv, uint64_t tx_id) { uint32_t local_id = 0; diff --git a/src/detect-lua.c b/src/detect-lua.c index b94f19f931..4d055981ed 100644 --- a/src/detect-lua.c +++ b/src/detect-lua.c @@ -103,7 +103,7 @@ static void DetectLuaRegisterTests(void); static void DetectLuaFree(DetectEngineCtx *, void *); static int g_smtp_generic_list_id = 0; -static int InspectSmtpGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, +static uint8_t InspectSmtpGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -134,7 +134,7 @@ void DetectLuaRegister(void) return; } -static int InspectSmtpGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, +static uint8_t InspectSmtpGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-modbus.c b/src/detect-modbus.c index 6940a333a8..1c542ce391 100644 --- a/src/detect-modbus.c +++ b/src/detect-modbus.c @@ -133,7 +133,7 @@ static int DetectModbusMatch(DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t fl * * \retval 0 no match or 1 match */ -static int DetectEngineInspectModbus(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, +static uint8_t DetectEngineInspectModbus(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-mqtt-connack-sessionpresent.c b/src/detect-mqtt-connack-sessionpresent.c index b209c75558..b27ce2b99a 100644 --- a/src/detect-mqtt-connack-sessionpresent.c +++ b/src/detect-mqtt-connack-sessionpresent.c @@ -45,7 +45,7 @@ static int DetectMQTTConnackSessionPresentSetup (DetectEngineCtx *, Signature *, void MQTTConnackSessionPresentRegisterTests(void); void DetectMQTTConnackSessionPresentFree(DetectEngineCtx *de_ctx, void *); -static int DetectEngineInspectMQTTConnackSessionPresentGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectMQTTConnackSessionPresentGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -72,7 +72,7 @@ void DetectMQTTConnackSessionPresentRegister (void) mqtt_connack_session_present_id = DetectBufferTypeGetByName("mqtt.connack.session_present"); } -static int DetectEngineInspectMQTTConnackSessionPresentGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectMQTTConnackSessionPresentGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-mqtt-connect-flags.c b/src/detect-mqtt-connect-flags.c index 5084a2e172..476d8756e9 100644 --- a/src/detect-mqtt-connect-flags.c +++ b/src/detect-mqtt-connect-flags.c @@ -45,7 +45,7 @@ static int DetectMQTTConnectFlagsSetup (DetectEngineCtx *, Signature *, const ch void MQTTConnectFlagsRegisterTests(void); void DetectMQTTConnectFlagsFree(DetectEngineCtx *de_ctx, void *); -static int DetectEngineInspectMQTTConnectFlagsGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectMQTTConnectFlagsGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -80,7 +80,7 @@ void DetectMQTTConnectFlagsRegister (void) mqtt_connect_flags_id = DetectBufferTypeGetByName("mqtt.connect.flags"); } -static int DetectEngineInspectMQTTConnectFlagsGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectMQTTConnectFlagsGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-mqtt-flags.c b/src/detect-mqtt-flags.c index 3169a84601..0a6560da37 100644 --- a/src/detect-mqtt-flags.c +++ b/src/detect-mqtt-flags.c @@ -45,7 +45,7 @@ static int DetectMQTTFlagsSetup (DetectEngineCtx *, Signature *, const char *); void MQTTFlagsRegisterTests(void); void DetectMQTTFlagsFree(DetectEngineCtx *de_ctx, void *); -static int DetectEngineInspectMQTTFlagsGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectMQTTFlagsGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -76,7 +76,7 @@ void DetectMQTTFlagsRegister (void) mqtt_flags_id = DetectBufferTypeGetByName("mqtt.flags"); } -static int DetectEngineInspectMQTTFlagsGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectMQTTFlagsGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-mqtt-protocol-version.c b/src/detect-mqtt-protocol-version.c index 0483bfa3e2..7e5d26bc40 100644 --- a/src/detect-mqtt-protocol-version.c +++ b/src/detect-mqtt-protocol-version.c @@ -44,7 +44,7 @@ static int DetectMQTTProtocolVersionSetup (DetectEngineCtx *, Signature *, const void MQTTProtocolVersionRegisterTests(void); void DetectMQTTProtocolVersionFree(DetectEngineCtx *de_ctx, void *); -static int DetectEngineInspectMQTTProtocolVersionGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectMQTTProtocolVersionGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -69,7 +69,7 @@ void DetectMQTTProtocolVersionRegister (void) mqtt_protocol_version_id = DetectBufferTypeGetByName("mqtt.protocol_version"); } -static int DetectEngineInspectMQTTProtocolVersionGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectMQTTProtocolVersionGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-mqtt-qos.c b/src/detect-mqtt-qos.c index a5da29729d..2b28d04048 100644 --- a/src/detect-mqtt-qos.c +++ b/src/detect-mqtt-qos.c @@ -43,7 +43,7 @@ static int DetectMQTTQosSetup (DetectEngineCtx *, Signature *, const char *); void MQTTQosRegisterTests(void); void DetectMQTTQosFree(DetectEngineCtx *de_ctx, void *); -static int DetectEngineInspectMQTTQosGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectMQTTQosGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -68,7 +68,7 @@ void DetectMQTTQosRegister (void) mqtt_qos_id = DetectBufferTypeGetByName("mqtt.qos"); } -static int DetectEngineInspectMQTTQosGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectMQTTQosGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-mqtt-reason-code.c b/src/detect-mqtt-reason-code.c index b5eb8e741f..ec6c7e7255 100644 --- a/src/detect-mqtt-reason-code.c +++ b/src/detect-mqtt-reason-code.c @@ -46,7 +46,7 @@ static int DetectMQTTReasonCodeSetup (DetectEngineCtx *, Signature *, const char void MQTTReasonCodeRegisterTests(void); void DetectMQTTReasonCodeFree(DetectEngineCtx *de_ctx, void *); -static int DetectEngineInspectMQTTReasonCodeGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectMQTTReasonCodeGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -74,7 +74,7 @@ void DetectMQTTReasonCodeRegister (void) mqtt_reason_code_id = DetectBufferTypeGetByName("mqtt.reason_code"); } -static int DetectEngineInspectMQTTReasonCodeGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectMQTTReasonCodeGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-mqtt-subscribe-topic.c b/src/detect-mqtt-subscribe-topic.c index 32d7b16083..1e88259f19 100644 --- a/src/detect-mqtt-subscribe-topic.c +++ b/src/detect-mqtt-subscribe-topic.c @@ -89,11 +89,9 @@ static InspectionBuffer *MQTTSubscribeTopicGetData(DetectEngineThreadCtx *det_ct SCReturnPtr(buffer, "InspectionBuffer"); } -static int DetectEngineInspectMQTTSubscribeTopic( - DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const DetectEngineAppInspectionEngine *engine, - const Signature *s, - Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) +static uint8_t DetectEngineInspectMQTTSubscribeTopic(DetectEngineCtx *de_ctx, + DetectEngineThreadCtx *det_ctx, const DetectEngineAppInspectionEngine *engine, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { uint32_t local_id = 0; diff --git a/src/detect-mqtt-type.c b/src/detect-mqtt-type.c index 8c21e11bbe..af01e21463 100644 --- a/src/detect-mqtt-type.c +++ b/src/detect-mqtt-type.c @@ -42,7 +42,7 @@ static int DetectMQTTTypeSetup (DetectEngineCtx *, Signature *, const char *); void MQTTTypeRegisterTests(void); void DetectMQTTTypeFree(DetectEngineCtx *de_ctx, void *); -static int DetectEngineInspectMQTTTypeGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectMQTTTypeGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -67,7 +67,7 @@ void DetectMQTTTypeRegister (void) mqtt_type_id = DetectBufferTypeGetByName("mqtt.type"); } -static int DetectEngineInspectMQTTTypeGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectMQTTTypeGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-mqtt-unsubscribe-topic.c b/src/detect-mqtt-unsubscribe-topic.c index 671cfebaf4..94283fd4f4 100644 --- a/src/detect-mqtt-unsubscribe-topic.c +++ b/src/detect-mqtt-unsubscribe-topic.c @@ -89,11 +89,9 @@ static InspectionBuffer *MQTTUnsubscribeTopicGetData(DetectEngineThreadCtx *det_ SCReturnPtr(buffer, "InspectionBuffer"); } -static int DetectEngineInspectMQTTUnsubscribeTopic( - DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const DetectEngineAppInspectionEngine *engine, - const Signature *s, - Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) +static uint8_t DetectEngineInspectMQTTUnsubscribeTopic(DetectEngineCtx *de_ctx, + DetectEngineThreadCtx *det_ctx, const DetectEngineAppInspectionEngine *engine, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { uint32_t local_id = 0; diff --git a/src/detect-nfs-procedure.c b/src/detect-nfs-procedure.c index 782ac9486c..0f3d33a637 100644 --- a/src/detect-nfs-procedure.c +++ b/src/detect-nfs-procedure.c @@ -76,7 +76,7 @@ static void DetectNfsProcedureRegisterTests(void); #endif static int g_nfs_request_buffer_id = 0; -static int DetectEngineInspectNfsRequestGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectNfsRequestGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -110,7 +110,7 @@ void DetectNfsProcedureRegister (void) SCLogDebug("g_nfs_request_buffer_id %d", g_nfs_request_buffer_id); } -static int DetectEngineInspectNfsRequestGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectNfsRequestGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-nfs-version.c b/src/detect-nfs-version.c index f30c308743..758c627833 100644 --- a/src/detect-nfs-version.c +++ b/src/detect-nfs-version.c @@ -76,7 +76,7 @@ static void DetectNfsVersionRegisterTests(void); #endif static int g_nfs_request_buffer_id = 0; -static int DetectEngineInspectNfsRequestGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectNfsRequestGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -109,7 +109,7 @@ void DetectNfsVersionRegister (void) SCLogDebug("g_nfs_request_buffer_id %d", g_nfs_request_buffer_id); } -static int DetectEngineInspectNfsRequestGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectNfsRequestGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-quic-cyu-hash.c b/src/detect-quic-cyu-hash.c index 010a115610..50a8170ac1 100644 --- a/src/detect-quic-cyu-hash.c +++ b/src/detect-quic-cyu-hash.c @@ -80,7 +80,7 @@ static InspectionBuffer *QuicHashGetData(DetectEngineThreadCtx *det_ctx, SCReturnPtr(buffer, "InspectionBuffer"); } -static int DetectEngineInspectQuicHash(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, +static uint8_t DetectEngineInspectQuicHash(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-quic-cyu-string.c b/src/detect-quic-cyu-string.c index 9fa8d4d822..7e27ecd698 100644 --- a/src/detect-quic-cyu-string.c +++ b/src/detect-quic-cyu-string.c @@ -80,9 +80,9 @@ static InspectionBuffer *QuicStringGetData(DetectEngineThreadCtx *det_ctx, SCReturnPtr(buffer, "InspectionBuffer"); } -static int DetectEngineInspectQuicString(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, - void *alstate, void *txv, uint64_t tx_id) +static uint8_t DetectEngineInspectQuicString(DetectEngineCtx *de_ctx, + DetectEngineThreadCtx *det_ctx, const DetectEngineAppInspectionEngine *engine, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { uint32_t local_id = 0; diff --git a/src/detect-rfb-secresult.c b/src/detect-rfb-secresult.c index f6e58ca751..bb5f53e771 100644 --- a/src/detect-rfb-secresult.c +++ b/src/detect-rfb-secresult.c @@ -47,7 +47,7 @@ static void RfbSecresultRegisterTests(void); #endif void DetectRfbSecresultFree(DetectEngineCtx *, void *); -static int DetectEngineInspectRfbSecresultGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectRfbSecresultGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -77,7 +77,7 @@ void DetectRfbSecresultRegister (void) rfb_secresult_id = DetectBufferTypeGetByName("rfb.secresult"); } -static int DetectEngineInspectRfbSecresultGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectRfbSecresultGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-rfb-sectype.c b/src/detect-rfb-sectype.c index f6ac936c60..67eb5cf005 100644 --- a/src/detect-rfb-sectype.c +++ b/src/detect-rfb-sectype.c @@ -56,7 +56,7 @@ static int DetectRfbSectypeSetup (DetectEngineCtx *, Signature *s, const char *s static void DetectRfbSectypeFree(DetectEngineCtx *, void *); static int g_rfb_sectype_buffer_id = 0; -static int DetectEngineInspectRfbSectypeGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectRfbSectypeGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -84,7 +84,7 @@ void DetectRfbSectypeRegister (void) g_rfb_sectype_buffer_id = DetectBufferTypeGetByName("rfb.sectype"); } -static int DetectEngineInspectRfbSectypeGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectRfbSectypeGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-snmp-pdu_type.c b/src/detect-snmp-pdu_type.c index 82d79342ed..8284ad09cf 100644 --- a/src/detect-snmp-pdu_type.c +++ b/src/detect-snmp-pdu_type.c @@ -49,7 +49,7 @@ static void DetectSNMPPduTypeRegisterTests(void); #endif static int g_snmp_pdu_type_buffer_id = 0; -static int DetectEngineInspectSNMPRequestGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectSNMPRequestGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -81,7 +81,7 @@ void DetectSNMPPduTypeRegister(void) g_snmp_pdu_type_buffer_id = DetectBufferTypeGetByName("snmp.pdu_type"); } -static int DetectEngineInspectSNMPRequestGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectSNMPRequestGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-snmp-version.c b/src/detect-snmp-version.c index d42f3eef0d..0212007589 100644 --- a/src/detect-snmp-version.c +++ b/src/detect-snmp-version.c @@ -58,7 +58,7 @@ static void DetectSNMPVersionRegisterTests(void); #endif static int g_snmp_version_buffer_id = 0; -static int DetectEngineInspectSNMPRequestGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectSNMPRequestGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -93,7 +93,7 @@ void DetectSNMPVersionRegister (void) g_snmp_version_buffer_id = DetectBufferTypeGetByName("snmp.version"); } -static int DetectEngineInspectSNMPRequestGeneric(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectSNMPRequestGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-ssh-software-version.c b/src/detect-ssh-software-version.c index da6708fe72..35be28ee44 100644 --- a/src/detect-ssh-software-version.c +++ b/src/detect-ssh-software-version.c @@ -76,7 +76,7 @@ static void DetectSshSoftwareVersionRegisterTests(void); static void DetectSshSoftwareVersionFree(DetectEngineCtx *de_ctx, void *); static int g_ssh_banner_list_id = 0; -static int InspectSshBanner(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, +static uint8_t InspectSshBanner(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-ssl-state.c b/src/detect-ssl-state.c index b9cbc3d631..61674ad494 100644 --- a/src/detect-ssl-state.c +++ b/src/detect-ssl-state.c @@ -66,7 +66,7 @@ static void DetectSslStateRegisterTests(void); #endif static void DetectSslStateFree(DetectEngineCtx *, void *); -static int InspectTlsGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, +static uint8_t InspectTlsGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -100,7 +100,7 @@ void DetectSslStateRegister(void) "tls_generic", ALPROTO_TLS, SIG_FLAG_TOCLIENT, 0, InspectTlsGeneric, NULL); } -static int InspectTlsGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, +static uint8_t InspectTlsGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-template-rust-buffer.c b/src/detect-template-rust-buffer.c index dda9647180..5e118655aa 100644 --- a/src/detect-template-rust-buffer.c +++ b/src/detect-template-rust-buffer.c @@ -43,7 +43,7 @@ static int DetectTemplateRustBufferSetup(DetectEngineCtx *, Signature *, const char *); -static int DetectEngineInspectTemplateRustBuffer(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectTemplateRustBuffer(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); #ifdef UNITTESTS @@ -92,11 +92,11 @@ static int DetectTemplateRustBufferSetup(DetectEngineCtx *de_ctx, Signature *s, return 0; } -static int DetectEngineInspectTemplateRustBuffer(DetectEngineCtx *de_ctx, +static uint8_t DetectEngineInspectTemplateRustBuffer(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { - int ret = 0; + uint8_t ret = 0; const uint8_t *data = NULL; uint32_t data_len = 0; diff --git a/src/detect-tls-cert-validity.c b/src/detect-tls-cert-validity.c index 7be4d5bdf8..a15e0b94c4 100644 --- a/src/detect-tls-cert-validity.c +++ b/src/detect-tls-cert-validity.c @@ -75,9 +75,9 @@ static void TlsValidRegisterTests(void); static void DetectTlsValidityFree(DetectEngineCtx *, void *); static int g_tls_validity_buffer_id = 0; -static int DetectEngineInspectTlsValidity(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, - uint8_t flags, void *alstate, void *txv, uint64_t tx_id); +static uint8_t DetectEngineInspectTlsValidity(DetectEngineCtx *de_ctx, + DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); /** * \brief Registration function for tls validity keywords. @@ -134,9 +134,9 @@ void DetectTlsValidityRegister (void) g_tls_validity_buffer_id = DetectBufferTypeGetByName("tls_validity"); } -static int DetectEngineInspectTlsValidity(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, - uint8_t flags, void *alstate, void *txv, uint64_t tx_id) +static uint8_t DetectEngineInspectTlsValidity(DetectEngineCtx *de_ctx, + DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { return DetectEngineInspectGenericList( de_ctx, det_ctx, s, engine->smd, f, flags, alstate, txv, tx_id); diff --git a/src/detect-tls-certs.c b/src/detect-tls-certs.c index 8e8fd8c0f7..b6f748f34c 100644 --- a/src/detect-tls-certs.c +++ b/src/detect-tls-certs.c @@ -59,11 +59,9 @@ static int DetectTlsCertsSetup(DetectEngineCtx *, Signature *, const char *); #ifdef UNITTESTS static void DetectTlsCertsRegisterTests(void); #endif -static int DetectEngineInspectTlsCerts(DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const DetectEngineAppInspectionEngine *engine, - const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, - uint64_t tx_id); +static uint8_t DetectEngineInspectTlsCerts(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, + void *alstate, void *txv, uint64_t tx_id); static int PrefilterMpmTlsCertsRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistery *mpm_reg, int list_id); @@ -162,11 +160,9 @@ static InspectionBuffer *TlsCertsGetData(DetectEngineThreadCtx *det_ctx, SCReturnPtr(buffer, "InspectionBuffer"); } -static int DetectEngineInspectTlsCerts(DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, - const DetectEngineAppInspectionEngine *engine, - const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, - uint64_t tx_id) +static uint8_t DetectEngineInspectTlsCerts(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, + const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, + void *alstate, void *txv, uint64_t tx_id) { const DetectEngineTransforms *transforms = NULL; if (!engine->mpm) { diff --git a/src/detect-tls.c b/src/detect-tls.c index 9af57dab6c..afa4a34a60 100644 --- a/src/detect-tls.c +++ b/src/detect-tls.c @@ -95,7 +95,7 @@ static int DetectTlsStorePostMatch (DetectEngineThreadCtx *det_ctx, static int g_tls_cert_list_id = 0; -static int InspectTlsCert(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, +static uint8_t InspectTlsCert(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect.c b/src/detect.c index 71ee309bb0..9916134864 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1137,7 +1137,7 @@ static bool DetectRunTxInspectRule(ThreadVars *tv, } /* run callback: but bypass stream callback if we can */ - int match; + uint8_t match; if (unlikely(engine->stream && can->stream_stored)) { match = can->stream_result; TRACE_SID_TXS(s->id, tx, "stream skipped, stored result %d used instead", match); @@ -1149,8 +1149,7 @@ static bool DetectRunTxInspectRule(ThreadVars *tv, TRACE_SID_TXS(s->id, tx, "engine %p match %d", engine, match); if (engine->stream) { can->stream_stored = true; - // TODO change Callback prototype ? - can->stream_result = (uint8_t)match; + can->stream_result = match; TRACE_SID_TXS(s->id, tx, "stream ran, store result %d for next tx (if any)", match); } } diff --git a/src/detect.h b/src/detect.h index b01c6edf91..586da2bd67 100644 --- a/src/detect.h +++ b/src/detect.h @@ -392,11 +392,10 @@ typedef InspectionBuffer *(*InspectionBufferGetDataPtr)( void *txv, const int list_id); struct DetectEngineAppInspectionEngine_; -typedef int (*InspectEngineFuncPtr2)( - struct DetectEngineCtx_ *de_ctx, struct DetectEngineThreadCtx_ *det_ctx, - const struct DetectEngineAppInspectionEngine_ *engine, - const struct Signature_ *s, - Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); +typedef uint8_t (*InspectEngineFuncPtr2)(struct DetectEngineCtx_ *de_ctx, + struct DetectEngineThreadCtx_ *det_ctx, + const struct DetectEngineAppInspectionEngine_ *engine, const struct Signature_ *s, Flow *f, + uint8_t flags, void *alstate, void *txv, uint64_t tx_id); typedef struct DetectEngineAppInspectionEngine_ { AppProto alproto;