From bfd4bc82333a5d0990a5acd81283758e2c9e425c Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Thu, 6 Oct 2016 10:49:14 +0200 Subject: [PATCH] detect: constify Signature/SigMatch use at runtime --- src/alert-unified2-alert.c | 30 +++++++------- src/decode.h | 2 +- src/detect-ack.c | 4 +- src/detect-app-layer-event.c | 14 +++---- src/detect-app-layer-protocol.c | 2 +- src/detect-asn1.c | 4 +- src/detect-base64-data.h | 2 +- src/detect-base64-decode.c | 2 +- src/detect-base64-decode.h | 4 +- src/detect-bypass.c | 6 ++- src/detect-byte-extract.c | 12 +++--- src/detect-byte-extract.h | 6 +-- src/detect-bytejump.c | 4 +- src/detect-bytejump.h | 4 +- src/detect-bytetest.c | 6 ++- src/detect-bytetest.h | 4 +- src/detect-csum.c | 56 +++++++++++++------------- src/detect-dce-iface.c | 9 +++-- src/detect-dce-opnum.c | 9 +++-- src/detect-detection-filter.c | 6 ++- src/detect-dnp3.c | 4 +- src/detect-dsize.c | 6 ++- src/detect-engine-alert.c | 3 +- src/detect-engine-alert.h | 3 +- src/detect-engine-content-inspection.c | 2 +- src/detect-engine-content-inspection.h | 2 +- src/detect-engine-dcepayload.c | 2 +- src/detect-engine-dcepayload.h | 2 +- src/detect-engine-dns.c | 6 +-- src/detect-engine-dns.h | 6 +-- src/detect-engine-enip.c | 4 +- src/detect-engine-enip.h | 4 +- src/detect-engine-event.c | 6 ++- src/detect-engine-file.h | 4 +- src/detect-engine-filedata-smtp.h | 2 +- src/detect-engine-hcbd.h | 2 +- src/detect-engine-hcd.c | 2 +- src/detect-engine-hcd.h | 2 +- src/detect-engine-hhd.c | 2 +- src/detect-engine-hhd.h | 2 +- src/detect-engine-hhhd.c | 2 +- src/detect-engine-hhhd.h | 2 +- src/detect-engine-hmd.c | 2 +- src/detect-engine-hmd.h | 2 +- src/detect-engine-hrhd.c | 2 +- src/detect-engine-hrhd.h | 2 +- src/detect-engine-hrhhd.c | 2 +- src/detect-engine-hrhhd.h | 2 +- src/detect-engine-hrud.c | 2 +- src/detect-engine-hrud.h | 2 +- src/detect-engine-hsbd.h | 2 +- src/detect-engine-hscd.c | 2 +- src/detect-engine-hscd.h | 2 +- src/detect-engine-hsmd.c | 2 +- src/detect-engine-hsmd.h | 2 +- src/detect-engine-hua.c | 2 +- src/detect-engine-hua.h | 2 +- src/detect-engine-modbus.c | 2 +- src/detect-engine-modbus.h | 2 +- src/detect-engine-payload.c | 2 +- src/detect-engine-payload.h | 4 +- src/detect-engine-state.c | 20 ++++----- src/detect-engine-state.h | 5 ++- src/detect-engine-template.h | 2 +- src/detect-engine-tls.c | 2 +- src/detect-engine-tls.h | 8 ++-- src/detect-engine-uri.h | 2 +- src/detect-engine.c | 2 +- src/detect-engine.h | 2 +- src/detect-fileext.c | 4 +- src/detect-filemagic.c | 4 +- src/detect-filename.c | 4 +- src/detect-filesize.c | 4 +- src/detect-filestore.c | 6 +-- src/detect-filestore.h | 4 +- src/detect-flags.c | 6 ++- src/detect-flow.c | 6 ++- src/detect-flowbits.c | 6 ++- src/detect-flowint.c | 4 +- src/detect-flowvar.c | 11 +++-- src/detect-fragbits.c | 5 ++- src/detect-fragoffset.c | 6 ++- src/detect-ftpbounce.c | 18 ++++----- src/detect-hostbits.c | 6 ++- src/detect-http-request-line.c | 4 +- src/detect-http-response-line.c | 4 +- src/detect-icmp-id.c | 6 ++- src/detect-icmp-seq.c | 6 ++- src/detect-icode.c | 6 ++- src/detect-id.c | 8 ++-- src/detect-ipopts.c | 6 ++- src/detect-iprep.c | 6 ++- src/detect-itype.c | 6 ++- src/detect-lua.c | 11 ++--- src/detect-lua.h | 3 +- src/detect-mark.c | 6 ++- src/detect-pcre.c | 4 +- src/detect-pcre.h | 3 +- src/detect-pktvar.c | 6 ++- src/detect-rpc.c | 8 ++-- src/detect-sameip.c | 4 +- src/detect-seq.c | 4 +- src/detect-ssh-proto-version.c | 6 ++- src/detect-ssh-software-version.c | 6 ++- src/detect-ssl-state.c | 12 +++--- src/detect-ssl-version.c | 9 +++-- src/detect-stream_size.c | 6 ++- src/detect-tag.c | 6 ++- src/detect-template.c | 4 +- src/detect-threshold.c | 6 ++- src/detect-tls-version.c | 6 ++- src/detect-tls.c | 20 +++++---- src/detect-tos.c | 6 +-- src/detect-ttl.c | 6 ++- src/detect-window.c | 12 +++--- src/detect-xbits.c | 4 +- src/detect.c | 26 ++++++------ src/detect.h | 24 +++++------ src/util-detect-file-hash.c | 2 +- src/util-detect-file-hash.h | 2 +- 120 files changed, 384 insertions(+), 313 deletions(-) diff --git a/src/alert-unified2-alert.c b/src/alert-unified2-alert.c index b922fe8f5e..2628676fa6 100644 --- a/src/alert-unified2-alert.c +++ b/src/alert-unified2-alert.c @@ -1455,10 +1455,10 @@ static int Unified2Test01(void) memset(&s, 0, sizeof(Signature)); p->alerts.cnt++; + s.id = 1; + s.gid = 1; + s.rev = 1; p->alerts.alerts[p->alerts.cnt-1].s = &s; - p->alerts.alerts[p->alerts.cnt-1].s->id = 1; - p->alerts.alerts[p->alerts.cnt-1].s->gid = 1; - p->alerts.alerts[p->alerts.cnt-1].s->rev = 1; SET_PKT_LEN(p, sizeof(raw_ipv4_tcp)); FlowInitConfig(FLOW_QUIET); @@ -1546,10 +1546,10 @@ static int Unified2Test02(void) memset(&s, 0, sizeof(Signature)); p->alerts.cnt++; + s.id = 1; + s.gid = 1; + s.rev = 1; p->alerts.alerts[p->alerts.cnt-1].s = &s; - p->alerts.alerts[p->alerts.cnt-1].s->id = 1; - p->alerts.alerts[p->alerts.cnt-1].s->gid = 1; - p->alerts.alerts[p->alerts.cnt-1].s->rev = 1; SET_PKT_LEN(p, sizeof(raw_ipv6_tcp)); FlowInitConfig(FLOW_QUIET); @@ -1643,10 +1643,10 @@ static int Unified2Test03(void) memset(&s, 0, sizeof(Signature)); p->alerts.cnt++; + s.id = 1; + s.gid = 1; + s.rev = 1; p->alerts.alerts[p->alerts.cnt-1].s = &s; - p->alerts.alerts[p->alerts.cnt-1].s->id = 1; - p->alerts.alerts[p->alerts.cnt-1].s->gid = 1; - p->alerts.alerts[p->alerts.cnt-1].s->rev = 1; SET_PKT_LEN(p, sizeof(raw_gre)); FlowInitConfig(FLOW_QUIET); @@ -1740,10 +1740,10 @@ static int Unified2Test04(void) memset(&s, 0, sizeof(Signature)); p->alerts.cnt++; + s.id = 1; + s.gid = 1; + s.rev = 1; p->alerts.alerts[p->alerts.cnt-1].s = &s; - p->alerts.alerts[p->alerts.cnt-1].s->id = 1; - p->alerts.alerts[p->alerts.cnt-1].s->gid = 1; - p->alerts.alerts[p->alerts.cnt-1].s->rev = 1; SET_PKT_LEN(p, sizeof(raw_ppp)); FlowInitConfig(FLOW_QUIET); @@ -1828,10 +1828,10 @@ static int Unified2Test05(void) memset(&s, 0, sizeof(Signature)); p->alerts.cnt++; + s.id = 1; + s.gid = 1; + s.rev = 1; p->alerts.alerts[p->alerts.cnt-1].s = &s; - p->alerts.alerts[p->alerts.cnt-1].s->id = 1; - p->alerts.alerts[p->alerts.cnt-1].s->gid = 1; - p->alerts.alerts[p->alerts.cnt-1].s->rev = 1; SET_PKT_LEN(p, sizeof(raw_ipv4_tcp)); FlowInitConfig(FLOW_QUIET); diff --git a/src/decode.h b/src/decode.h index dcf7e2e120..d11b1cf931 100644 --- a/src/decode.h +++ b/src/decode.h @@ -260,7 +260,7 @@ typedef struct PacketAlert_ { SigIntId num; /* Internal num, used for sorting */ uint8_t action; /* Internal num, used for sorting */ uint8_t flags; - struct Signature_ *s; + const struct Signature_ *s; uint64_t tx_id; } PacketAlert; diff --git a/src/detect-ack.c b/src/detect-ack.c index aaef98a964..79c33390db 100644 --- a/src/detect-ack.c +++ b/src/detect-ack.c @@ -45,7 +45,7 @@ /* prototypes */ static int DetectAckSetup(DetectEngineCtx *, Signature *, char *); static int DetectAckMatch(ThreadVars *, DetectEngineThreadCtx *, - Packet *, Signature *, const SigMatchCtx *); + Packet *, const Signature *, const SigMatchCtx *); static void DetectAckRegisterTests(void); static void DetectAckFree(void *); static int PrefilterSetupTcpAck(SigGroupHead *sgh); @@ -79,7 +79,7 @@ void DetectAckRegister(void) * \retval 1 match */ static int DetectAckMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Packet *p, Signature *s, const SigMatchCtx *ctx) + Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectAckData *data = (const DetectAckData *)ctx; diff --git a/src/detect-app-layer-event.c b/src/detect-app-layer-event.c index c237ecf4b2..a7930dee85 100644 --- a/src/detect-app-layer-event.c +++ b/src/detect-app-layer-event.c @@ -49,16 +49,16 @@ #define MAX_ALPROTO_NAME 50 static int DetectAppLayerEventPktMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Packet *p, Signature *s, const SigMatchCtx *ctx); + Packet *p, const Signature *s, const SigMatchCtx *ctx); static int DetectAppLayerEventAppMatch(ThreadVars *, DetectEngineThreadCtx *, Flow *, - uint8_t, void *, Signature *, SigMatch *); + uint8_t, void *, const Signature *, const SigMatch *); static int DetectAppLayerEventSetupP1(DetectEngineCtx *, Signature *, char *); static void DetectAppLayerEventRegisterTests(void); static void DetectAppLayerEventFree(void *); static int DetectEngineAptEventInspect(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); /** @@ -89,7 +89,7 @@ void DetectAppLayerEventRegister(void) static int DetectEngineAptEventInspect(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id) { @@ -134,7 +134,7 @@ static int DetectEngineAptEventInspect(ThreadVars *tv, static int DetectAppLayerEventPktMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Packet *p, Signature *s, const SigMatchCtx *ctx) + Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectAppLayerEventData *aled = (const DetectAppLayerEventData *)ctx; @@ -143,8 +143,8 @@ static int DetectAppLayerEventPktMatch(ThreadVars *t, DetectEngineThreadCtx *det } static int DetectAppLayerEventAppMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Flow *f, uint8_t flags, void *state, Signature *s, - SigMatch *m) + Flow *f, uint8_t flags, void *state, const Signature *s, + const SigMatch *m) { SCEnter(); AppLayerDecoderEvents *decoder_events = NULL; diff --git a/src/detect-app-layer-protocol.c b/src/detect-app-layer-protocol.c index 34c3be9602..c28f5867b6 100644 --- a/src/detect-app-layer-protocol.c +++ b/src/detect-app-layer-protocol.c @@ -37,7 +37,7 @@ static void DetectAppLayerProtocolRegisterTests(void); static int DetectAppLayerProtocolPacketMatch(ThreadVars *tv, DetectEngineThreadCtx *det_ctx, - Packet *p, Signature *s, const SigMatchCtx *ctx) + Packet *p, const Signature *s, const SigMatchCtx *ctx) { SCEnter(); diff --git a/src/detect-asn1.c b/src/detect-asn1.c index c9602bdb76..5cb6e3bb9e 100644 --- a/src/detect-asn1.c +++ b/src/detect-asn1.c @@ -43,7 +43,7 @@ const char *ASN_DELIM = " \t,\n"; int DetectAsn1Match(ThreadVars *, DetectEngineThreadCtx *, Packet *, - Signature *, const SigMatchCtx *); + const Signature *, const SigMatchCtx *); static int DetectAsn1Setup (DetectEngineCtx *, Signature *, char *); void DetectAsn1RegisterTests(void); void DetectAsn1Free(void *); @@ -138,7 +138,7 @@ static uint8_t DetectAsn1Checks(Asn1Node *node, const DetectAsn1Data *ad) * \retval 1 match */ int DetectAsn1Match(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, - Signature *s, const SigMatchCtx *ctx) + const Signature *s, const SigMatchCtx *ctx) { uint8_t ret = 0; diff --git a/src/detect-base64-data.h b/src/detect-base64-data.h index 12fa60de56..38bb93fc06 100644 --- a/src/detect-base64-data.h +++ b/src/detect-base64-data.h @@ -20,6 +20,6 @@ void DetectBase64DataRegister(void); int DetectBase64DataDoMatch(DetectEngineCtx *, DetectEngineThreadCtx *, - Signature *, Flow *); + const Signature *, Flow *); #endif /* __DETECT_BASE64_DATA_H__ */ diff --git a/src/detect-base64-decode.c b/src/detect-base64-decode.c index d0687780d4..251a89f9cd 100644 --- a/src/detect-base64-decode.c +++ b/src/detect-base64-decode.c @@ -54,7 +54,7 @@ void DetectBase64DecodeRegister(void) DetectSetupParseRegexes(decode_pattern, &decode_pcre, &decode_pcre_study); } -int DetectBase64DecodeDoMatch(DetectEngineThreadCtx *det_ctx, Signature *s, +int DetectBase64DecodeDoMatch(DetectEngineThreadCtx *det_ctx, const Signature *s, const SigMatch *sm, uint8_t *payload, uint32_t payload_len) { DetectBase64Decode *data = (DetectBase64Decode *)sm->ctx; diff --git a/src/detect-base64-decode.h b/src/detect-base64-decode.h index a1ce388f18..e2f602313d 100644 --- a/src/detect-base64-decode.h +++ b/src/detect-base64-decode.h @@ -27,7 +27,7 @@ typedef struct DetectBase64Decode_ { } DetectBase64Decode; void DetectBase64DecodeRegister(void); -int DetectBase64DecodeDoMatch(DetectEngineThreadCtx *, Signature *, - const SigMatch *, uint8_t *, uint32_t); +int DetectBase64DecodeDoMatch(DetectEngineThreadCtx *, + const Signature *, const SigMatch *, uint8_t *, uint32_t); #endif /* __DETECT_BASE64_DECODE_H__ */ diff --git a/src/detect-bypass.c b/src/detect-bypass.c index 9faaad1370..dce7abe44a 100644 --- a/src/detect-bypass.c +++ b/src/detect-bypass.c @@ -49,7 +49,8 @@ #include "util-unittest-helper.h" #include "util-device.h" -int DetectBypassMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); +int DetectBypassMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, + const Signature *, const SigMatchCtx *); static int DetectBypassSetup(DetectEngineCtx *, Signature *, char *); static void DetectBypassRegisterTests(void); @@ -91,7 +92,8 @@ static int DetectBypassSetup(DetectEngineCtx *de_ctx, Signature *s, char *str) return 0; } -int DetectBypassMatch(ThreadVars *tv, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +int DetectBypassMatch(ThreadVars *tv, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx) { PacketBypassCallback(p); diff --git a/src/detect-byte-extract.c b/src/detect-byte-extract.c index a4549a1d6d..7c1a50dd37 100644 --- a/src/detect-byte-extract.c +++ b/src/detect-byte-extract.c @@ -90,7 +90,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; int DetectByteExtractMatch(ThreadVars *, DetectEngineThreadCtx *, - Packet *, Signature *, SigMatch *); + Packet *, const Signature *, const SigMatch *); int DetectByteExtractSetup(DetectEngineCtx *, Signature *, char *); void DetectByteExtractRegisterTests(void); void DetectByteExtractFree(void *); @@ -112,8 +112,8 @@ void DetectByteExtractRegister(void) DetectSetupParseRegexes(PARSE_REGEX, &parse_regex, &parse_regex_study); } -int DetectByteExtractDoMatch(DetectEngineThreadCtx *det_ctx, SigMatch *sm, - Signature *s, uint8_t *payload, +int DetectByteExtractDoMatch(DetectEngineThreadCtx *det_ctx, const SigMatch *sm, + const Signature *s, uint8_t *payload, uint16_t payload_len, uint64_t *value, uint8_t endian) { @@ -204,10 +204,8 @@ int DetectByteExtractDoMatch(DetectEngineThreadCtx *det_ctx, SigMatch *sm, int DetectByteExtractMatch(ThreadVars *tv, DetectEngineThreadCtx *det_ctx, - Packet *p, Signature *s, SigMatch *m) + Packet *p, const Signature *s, const SigMatch *m) { - goto end; - end: return 1; } @@ -756,7 +754,7 @@ void DetectByteExtractFree(void *ptr) * * \retval A pointer to the SigMatch if found, otherwise NULL. */ -SigMatch *DetectByteExtractRetrieveSMVar(const char *arg, Signature *s) +SigMatch *DetectByteExtractRetrieveSMVar(const char *arg, const Signature *s) { DetectByteExtractData *bed = NULL; int list; diff --git a/src/detect-byte-extract.h b/src/detect-byte-extract.h index 020494da0e..506b1eb773 100644 --- a/src/detect-byte-extract.h +++ b/src/detect-byte-extract.h @@ -63,9 +63,9 @@ void DetectByteExtractRegister(void); int DetectByteExtractSetup(DetectEngineCtx *, Signature *, char *); void DetectByteExtractFree(void *); int DetectByteExtractMatch(ThreadVars *, DetectEngineThreadCtx *, - Packet *, Signature *, SigMatch *); -SigMatch *DetectByteExtractRetrieveSMVar(const char *, Signature *); -int DetectByteExtractDoMatch(DetectEngineThreadCtx *, SigMatch *, Signature *, + Packet *, const Signature *, const SigMatch *); +SigMatch *DetectByteExtractRetrieveSMVar(const char *, const Signature *); +int DetectByteExtractDoMatch(DetectEngineThreadCtx *, const SigMatch *, const Signature *, uint8_t *, uint16_t, uint64_t *, uint8_t); #endif /* __DETECT_BYTEEXTRACT_H__ */ diff --git a/src/detect-bytejump.c b/src/detect-bytejump.c index cf89e9fca9..ebdd3c35f0 100644 --- a/src/detect-bytejump.c +++ b/src/detect-bytejump.c @@ -84,7 +84,7 @@ void DetectBytejumpRegister (void) * \retval 1 match * \retval 0 no match */ -int DetectBytejumpDoMatch(DetectEngineThreadCtx *det_ctx, Signature *s, +int DetectBytejumpDoMatch(DetectEngineThreadCtx *det_ctx, const Signature *s, const SigMatchCtx *ctx, uint8_t *payload, uint32_t payload_len, uint8_t flags, int32_t offset) { @@ -197,7 +197,7 @@ int DetectBytejumpDoMatch(DetectEngineThreadCtx *det_ctx, Signature *s, } int DetectBytejumpMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Packet *p, Signature *s, const SigMatchCtx *ctx) + Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectBytejumpData *data = (const DetectBytejumpData *)ctx; uint8_t *ptr = NULL; diff --git a/src/detect-bytejump.h b/src/detect-bytejump.h index 350514867c..d88d8c82da 100644 --- a/src/detect-bytejump.h +++ b/src/detect-bytejump.h @@ -113,8 +113,8 @@ DetectBytejumpData *DetectBytejumpParse(char *optstr, char **offset); * error as a match. */ int DetectBytejumpMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Packet *p, Signature *s, const SigMatchCtx *ctx); -int DetectBytejumpDoMatch(DetectEngineThreadCtx *, Signature *, const SigMatchCtx *, + Packet *p, const Signature *s, const SigMatchCtx *ctx); +int DetectBytejumpDoMatch(DetectEngineThreadCtx *, const Signature *, const SigMatchCtx *, uint8_t *, uint32_t, uint8_t, int32_t); #endif /* __DETECT_BYTEJUMP_H__ */ diff --git a/src/detect-bytetest.c b/src/detect-bytetest.c index 2eaddadb0f..a6f08b642d 100644 --- a/src/detect-bytetest.c +++ b/src/detect-bytetest.c @@ -89,7 +89,9 @@ void DetectBytetestRegister (void) * \retval 1 match * \retval 0 no match */ -int DetectBytetestDoMatch(DetectEngineThreadCtx *det_ctx, Signature *s, const SigMatchCtx *ctx, uint8_t *payload, uint32_t payload_len, +int DetectBytetestDoMatch(DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatchCtx *ctx, + uint8_t *payload, uint32_t payload_len, uint8_t flags, int32_t offset, uint64_t value) { SCEnter(); @@ -231,7 +233,7 @@ int DetectBytetestDoMatch(DetectEngineThreadCtx *det_ctx, Signature *s, const Si } int DetectBytetestMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Packet *p, Signature *s, const SigMatchCtx *ctx) + Packet *p, const Signature *s, const SigMatchCtx *ctx) { return DetectBytetestDoMatch(det_ctx, s, ctx, p->payload, p->payload_len, ((DetectBytetestData *)ctx)->flags, 0, 0); diff --git a/src/detect-bytetest.h b/src/detect-bytetest.h index 09d453fab6..261c30be70 100644 --- a/src/detect-bytetest.h +++ b/src/detect-bytetest.h @@ -121,8 +121,8 @@ DetectBytetestData *DetectBytetestParse(char *optstr, char **value, * \todo The return seems backwards. We should return a non-zero error code. One of the error codes is "no match". As-is if someone accidentally does: if (DetectBytetestMatch(...)) { match }, then they catch an error as a match. */ int DetectBytetestMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Packet *p, Signature *s, const SigMatchCtx *ctx); -int DetectBytetestDoMatch(DetectEngineThreadCtx *, Signature *, + Packet *p, const Signature *s, const SigMatchCtx *ctx); +int DetectBytetestDoMatch(DetectEngineThreadCtx *, const Signature *, const SigMatchCtx *ctx, uint8_t *, uint32_t, uint8_t, int32_t, uint64_t); diff --git a/src/detect-csum.c b/src/detect-csum.c index badeebb512..ab5ed748e8 100644 --- a/src/detect-csum.c +++ b/src/detect-csum.c @@ -40,44 +40,44 @@ #include "util-profiling.h" /* prototypes for the "ipv4-csum" rule keyword */ -int DetectIPV4CsumMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, - Signature *, const SigMatchCtx *); +static int DetectIPV4CsumMatch(ThreadVars *, DetectEngineThreadCtx *, + Packet *, const Signature *, const SigMatchCtx *); static int DetectIPV4CsumSetup(DetectEngineCtx *, Signature *, char *); void DetectIPV4CsumFree(void *); /* prototypes for the "tcpv4-csum" rule keyword */ -int DetectTCPV4CsumMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, - Signature *, const SigMatchCtx *); +static int DetectTCPV4CsumMatch(ThreadVars *, DetectEngineThreadCtx *, + Packet *, const Signature *, const SigMatchCtx *); static int DetectTCPV4CsumSetup(DetectEngineCtx *, Signature *, char *); void DetectTCPV4CsumFree(void *); /* prototypes for the "tcpv6-csum" rule keyword */ -int DetectTCPV6CsumMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, - Signature *, const SigMatchCtx *); +static int DetectTCPV6CsumMatch(ThreadVars *, DetectEngineThreadCtx *, + Packet *, const Signature *, const SigMatchCtx *); static int DetectTCPV6CsumSetup(DetectEngineCtx *, Signature *, char *); void DetectTCPV6CsumFree(void *); /* prototypes for the "udpv4-csum" rule keyword */ -int DetectUDPV4CsumMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, - Signature *, const SigMatchCtx *); +static int DetectUDPV4CsumMatch(ThreadVars *, DetectEngineThreadCtx *, + Packet *, const Signature *, const SigMatchCtx *); static int DetectUDPV4CsumSetup(DetectEngineCtx *, Signature *, char *); void DetectUDPV4CsumFree(void *); /* prototypes for the "udpv6-csum" rule keyword */ -int DetectUDPV6CsumMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, - Signature *, const SigMatchCtx *); +static int DetectUDPV6CsumMatch(ThreadVars *, DetectEngineThreadCtx *, + Packet *, const Signature *, const SigMatchCtx *); static int DetectUDPV6CsumSetup(DetectEngineCtx *, Signature *, char *); void DetectUDPV6CsumFree(void *); /* prototypes for the "icmpv4-csum" rule keyword */ -int DetectICMPV4CsumMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, - Signature *, const SigMatchCtx *); +static int DetectICMPV4CsumMatch(ThreadVars *, DetectEngineThreadCtx *, + Packet *, const Signature *, const SigMatchCtx *); static int DetectICMPV4CsumSetup(DetectEngineCtx *, Signature *, char *); void DetectICMPV4CsumFree(void *); /* prototypes for the "icmpv6-csum" rule keyword */ -int DetectICMPV6CsumMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, - Signature *, const SigMatchCtx *); +static int DetectICMPV6CsumMatch(ThreadVars *, DetectEngineThreadCtx *, + Packet *, const Signature *, const SigMatchCtx *); static int DetectICMPV6CsumSetup(DetectEngineCtx *, Signature *, char *); void DetectICMPV6CsumFree(void *); @@ -229,8 +229,8 @@ error: * * \retval 1 if the Packet contents match the keyword option; 0 otherwise */ -int DetectIPV4CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectIPV4CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, + Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectCsumData *cd = (const DetectCsumData *)ctx; @@ -323,8 +323,8 @@ void DetectIPV4CsumFree(void *ptr) * * \retval 1 if the Packet contents match the keyword option; 0 otherwise */ -int DetectTCPV4CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectTCPV4CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, + Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectCsumData *cd = (const DetectCsumData *)ctx; @@ -418,8 +418,8 @@ void DetectTCPV4CsumFree(void *ptr) * * \retval 1 if the Packet contents match the keyword option; 0 otherwise */ -int DetectTCPV6CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectTCPV6CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, + Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectCsumData *cd = (const DetectCsumData *)ctx; @@ -513,8 +513,8 @@ void DetectTCPV6CsumFree(void *ptr) * * \retval 1 if the Packet contents match the keyword option; 0 otherwise */ -int DetectUDPV4CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectUDPV4CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, + Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectCsumData *cd = (const DetectCsumData *)ctx; @@ -609,8 +609,8 @@ void DetectUDPV4CsumFree(void *ptr) * * \retval 1 if the Packet contents match the keyword option; 0 otherwise */ -int DetectUDPV6CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectUDPV6CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, + Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectCsumData *cd = (const DetectCsumData *)ctx; @@ -705,8 +705,8 @@ void DetectUDPV6CsumFree(void *ptr) * * \retval 1 if the Packet contents match the keyword option; 0 otherwise */ -int DetectICMPV4CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectICMPV4CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, + Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectCsumData *cd = (const DetectCsumData *)ctx; @@ -800,8 +800,8 @@ void DetectICMPV4CsumFree(void *ptr) * * \retval 1 if the Packet contents match the keyword option; 0 otherwise */ -int DetectICMPV6CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectICMPV6CsumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, + Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectCsumData *cd = (const DetectCsumData *)ctx; diff --git a/src/detect-dce-iface.c b/src/detect-dce-iface.c index 10e79d399f..78c705ce35 100644 --- a/src/detect-dce-iface.c +++ b/src/detect-dce-iface.c @@ -52,8 +52,8 @@ static pcre *parse_regex = NULL; static pcre_extra *parse_regex_study = NULL; -int DetectDceIfaceMatch(ThreadVars *, DetectEngineThreadCtx *, Flow *, uint8_t, - void *, Signature *, SigMatch *); +static int DetectDceIfaceMatch(ThreadVars *, DetectEngineThreadCtx *, Flow *, + uint8_t, void *, const Signature *, const SigMatch *); static int DetectDceIfaceSetup(DetectEngineCtx *, Signature *, char *); void DetectDceIfaceFree(void *); @@ -242,8 +242,9 @@ static inline int DetectDceIfaceMatchIfaceVersion(uint16_t version, * \retval 1 On Match. * \retval 0 On no match. */ -int DetectDceIfaceMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f, - uint8_t flags, void *state, Signature *s, SigMatch *m) +static int DetectDceIfaceMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, + Flow *f, uint8_t flags, void *state, + const Signature *s, const SigMatch *m) { SCEnter(); diff --git a/src/detect-dce-opnum.c b/src/detect-dce-opnum.c index 023e643b9f..e1435fba1e 100644 --- a/src/detect-dce-opnum.c +++ b/src/detect-dce-opnum.c @@ -52,8 +52,8 @@ static pcre *parse_regex = NULL; static pcre_extra *parse_regex_study = NULL; -int DetectDceOpnumMatch(ThreadVars *, DetectEngineThreadCtx *, Flow *, uint8_t, - void *, Signature *, SigMatch *); +static int DetectDceOpnumMatch(ThreadVars *, DetectEngineThreadCtx *, Flow *, uint8_t, + void *, const Signature *, const SigMatch *); static int DetectDceOpnumSetup(DetectEngineCtx *, Signature *, char *); void DetectDceOpnumFree(void *); @@ -237,8 +237,9 @@ static inline DetectDceOpnumData *DetectDceOpnumArgParse(const char *arg) * \retval 1 On Match. * \retval 0 On no match. */ -int DetectDceOpnumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f, - uint8_t flags, void *state, Signature *s, SigMatch *m) +static int DetectDceOpnumMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, + Flow *f, uint8_t flags, void *state, + const Signature *s, const SigMatch *m) { SCEnter(); diff --git a/src/detect-detection-filter.c b/src/detect-detection-filter.c index e69d66fada..56a5fad783 100644 --- a/src/detect-detection-filter.c +++ b/src/detect-detection-filter.c @@ -51,7 +51,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectDetectionFilterMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); +static int DetectDetectionFilterMatch(ThreadVars *, DetectEngineThreadCtx *, + Packet *, const Signature *, const SigMatchCtx *); static int DetectDetectionFilterSetup(DetectEngineCtx *, Signature *, char *); void DetectDetectionFilterRegisterTests(void); void DetectDetectionFilterFree(void *); @@ -74,7 +75,8 @@ void DetectDetectionFilterRegister (void) DetectSetupParseRegexes(PARSE_REGEX, &parse_regex, &parse_regex_study); } -int DetectDetectionFilterMatch (ThreadVars *thv, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectDetectionFilterMatch (ThreadVars *thv, DetectEngineThreadCtx *det_ctx, + Packet *p, const Signature *s, const SigMatchCtx *ctx) { return 1; } diff --git a/src/detect-dnp3.c b/src/detect-dnp3.c index 3baf124f58..1a515905bb 100644 --- a/src/detect-dnp3.c +++ b/src/detect-dnp3.c @@ -139,7 +139,7 @@ static char *TrimString(char *str) } static int DetectEngineInspectDNP3Data(ThreadVars *tv, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, Signature *s, Flow *f, uint8_t flags, + DetectEngineThreadCtx *det_ctx, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { SCEnter(); @@ -163,7 +163,7 @@ static int DetectEngineInspectDNP3Data(ThreadVars *tv, DetectEngineCtx *de_ctx, } static int DetectEngineInspectDNP3(ThreadVars *tv, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, Signature *s, Flow *f, uint8_t flags, + DetectEngineThreadCtx *det_ctx, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, f, flags, diff --git a/src/detect-dsize.c b/src/detect-dsize.c index 548ac3ced3..f07d812204 100644 --- a/src/detect-dsize.c +++ b/src/detect-dsize.c @@ -49,7 +49,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectDsizeMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); +static int DetectDsizeMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, + const Signature *, const SigMatchCtx *); static int DetectDsizeSetup (DetectEngineCtx *, Signature *s, char *str); void DsizeRegisterTests(void); static void DetectDsizeFree(void *); @@ -105,7 +106,8 @@ DsizeMatch(const uint16_t psize, const uint8_t mode, * \retval 0 no match * \retval 1 match */ -int DetectDsizeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectDsizeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx) { SCEnter(); int ret = 0; diff --git a/src/detect-engine-alert.c b/src/detect-engine-alert.c index 21047a0df5..8bfd719f75 100644 --- a/src/detect-engine-alert.c +++ b/src/detect-engine-alert.c @@ -186,7 +186,8 @@ int PacketAlertRemove(Packet *p, uint16_t pos) * \param flags alert flags * \param alert_msg ptr to StreamMsg object that the signature matched on */ -int PacketAlertAppend(DetectEngineThreadCtx *det_ctx, Signature *s, Packet *p, uint64_t tx_id, uint8_t flags) +int PacketAlertAppend(DetectEngineThreadCtx *det_ctx, const Signature *s, + Packet *p, uint64_t tx_id, uint8_t flags) { int i = 0; diff --git a/src/detect-engine-alert.h b/src/detect-engine-alert.h index 6f200b268d..dc6687885c 100644 --- a/src/detect-engine-alert.h +++ b/src/detect-engine-alert.h @@ -29,7 +29,8 @@ #include "detect.h" void PacketAlertFinalize(DetectEngineCtx *, DetectEngineThreadCtx *, Packet *); -int PacketAlertAppend(DetectEngineThreadCtx *, Signature *, Packet *, uint64_t tx_id, uint8_t); +int PacketAlertAppend(DetectEngineThreadCtx *, const Signature *, + Packet *, uint64_t tx_id, uint8_t); int PacketAlertCheck(Packet *, uint32_t); int PacketAlertRemove(Packet *, uint16_t); void PacketAlertTagInit(void); diff --git a/src/detect-engine-content-inspection.c b/src/detect-engine-content-inspection.c index af1b103462..95f4fc7fdb 100644 --- a/src/detect-engine-content-inspection.c +++ b/src/detect-engine-content-inspection.c @@ -99,7 +99,7 @@ * \retval 1 match */ int DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, SigMatch *sm, + const Signature *s, const SigMatch *sm, Flow *f, uint8_t *buffer, uint32_t buffer_len, uint32_t stream_start_offset, diff --git a/src/detect-engine-content-inspection.h b/src/detect-engine-content-inspection.h index 91b62d6c6b..8ae5d76a45 100644 --- a/src/detect-engine-content-inspection.h +++ b/src/detect-engine-content-inspection.h @@ -34,7 +34,7 @@ enum { }; int DetectEngineContentInspection(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, SigMatch *sm, + const Signature *s, const SigMatch *sm, Flow *f, uint8_t *buffer, uint32_t buffer_len, uint32_t stream_start_offset, diff --git a/src/detect-engine-dcepayload.c b/src/detect-engine-dcepayload.c index 5cdb10d35f..c856408135 100644 --- a/src/detect-engine-dcepayload.c +++ b/src/detect-engine-dcepayload.c @@ -62,7 +62,7 @@ * \retval 1 Match. */ int DetectEngineInspectDcePayload(DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, Signature *s, + DetectEngineThreadCtx *det_ctx, const Signature *s, Flow *f, uint8_t flags, void *alstate) { SCEnter(); diff --git a/src/detect-engine-dcepayload.h b/src/detect-engine-dcepayload.h index ccc4794ba3..da7dfb9299 100644 --- a/src/detect-engine-dcepayload.h +++ b/src/detect-engine-dcepayload.h @@ -25,7 +25,7 @@ #define __DETECT_ENGINE_DCEPAYLOAD_H__ int DetectEngineInspectDcePayload(DetectEngineCtx *, DetectEngineThreadCtx *, - Signature *, Flow *, uint8_t, void *); + const Signature *, Flow *, uint8_t, void *); void DcePayloadRegisterTests(void); diff --git a/src/detect-engine-dns.c b/src/detect-engine-dns.c index 0dac77734f..b9a4ce39fa 100644 --- a/src/detect-engine-dns.c +++ b/src/detect-engine-dns.c @@ -63,7 +63,7 @@ int DetectEngineInspectDnsQueryName(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { DNSTransaction *tx = (DNSTransaction *)txv; @@ -141,7 +141,7 @@ int PrefilterTxDnsQueryRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) int DetectEngineInspectDnsRequest(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, f, flags, @@ -152,7 +152,7 @@ int DetectEngineInspectDnsRequest(ThreadVars *tv, int DetectEngineInspectDnsResponse(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { return DetectEngineInspectGenericList(tv, de_ctx, det_ctx, s, f, flags, diff --git a/src/detect-engine-dns.h b/src/detect-engine-dns.h index 5b2367a660..56ebea2589 100644 --- a/src/detect-engine-dns.h +++ b/src/detect-engine-dns.h @@ -26,17 +26,17 @@ int PrefilterTxDnsQueryRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectDnsQueryName(ThreadVars *, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *, Signature *, + DetectEngineThreadCtx *, const Signature *, Flow *, uint8_t, void *, void *, uint64_t); int DetectEngineInspectDnsRequest(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); int DetectEngineInspectDnsResponse(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); #endif /* __DETECT_ENGINE_DNS_H__ */ diff --git a/src/detect-engine-enip.c b/src/detect-engine-enip.c index 2facecc084..8160d0bae5 100644 --- a/src/detect-engine-enip.c +++ b/src/detect-engine-enip.c @@ -218,7 +218,7 @@ int CIPServiceMatch(ENIPTransaction *enip_data, * \retval 0 no match or 1 match */ int DetectEngineInspectCIP(ThreadVars *tv, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, Signature *s, Flow *f, uint8_t flags, + DetectEngineThreadCtx *det_ctx, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { SCEnter(); @@ -258,7 +258,7 @@ int DetectEngineInspectCIP(ThreadVars *tv, DetectEngineCtx *de_ctx, */ int DetectEngineInspectENIP(ThreadVars *tv, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, Signature *s, Flow *f, uint8_t flags, + DetectEngineThreadCtx *det_ctx, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { SCEnter(); diff --git a/src/detect-engine-enip.h b/src/detect-engine-enip.h index 1d701d414d..9e0e719d85 100644 --- a/src/detect-engine-enip.h +++ b/src/detect-engine-enip.h @@ -24,11 +24,11 @@ #define __DETECT_ENGINE_ENIP_H__ int DetectEngineInspectCIP(ThreadVars *, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *, Signature *, + DetectEngineThreadCtx *, const Signature *, Flow *, uint8_t, void *, void *, uint64_t); int DetectEngineInspectENIP(ThreadVars *, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *, Signature *, + DetectEngineThreadCtx *, const Signature *, Flow *, uint8_t, void *, void *, uint64_t); void DetectEngineInspectENIPRegisterTests(void); diff --git a/src/detect-engine-event.c b/src/detect-engine-event.c index ebfe865acc..06fcfe1086 100644 --- a/src/detect-engine-event.c +++ b/src/detect-engine-event.c @@ -47,7 +47,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectEngineEventMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); +static int DetectEngineEventMatch (ThreadVars *, DetectEngineThreadCtx *, + Packet *, const Signature *, const SigMatchCtx *); static int DetectEngineEventSetup (DetectEngineCtx *, Signature *, char *); static int DetectDecodeEventSetup (DetectEngineCtx *, Signature *, char *); static int DetectStreamEventSetup (DetectEngineCtx *, Signature *, char *); @@ -92,7 +93,8 @@ void DetectEngineEventRegister (void) * \retval 0 no match * \retval 1 match */ -int DetectEngineEventMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectEngineEventMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, + Packet *p, const Signature *s, const SigMatchCtx *ctx) { SCEnter(); diff --git a/src/detect-engine-file.h b/src/detect-engine-file.h index 365ed8a99f..4934ed0a2c 100644 --- a/src/detect-engine-file.h +++ b/src/detect-engine-file.h @@ -26,11 +26,11 @@ int DetectFileInspectHttp(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, void *alstate, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); int DetectFileInspectSmtp(ThreadVars *tv, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, Signature *s, + DetectEngineThreadCtx *det_ctx, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); diff --git a/src/detect-engine-filedata-smtp.h b/src/detect-engine-filedata-smtp.h index f4f45af0df..d659e22241 100644 --- a/src/detect-engine-filedata-smtp.h +++ b/src/detect-engine-filedata-smtp.h @@ -30,7 +30,7 @@ int PrefilterTxSmtpFiledataRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectSMTPFiledata(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); void DetectEngineCleanSMTPBuffers(DetectEngineThreadCtx *det_ctx); diff --git a/src/detect-engine-hcbd.h b/src/detect-engine-hcbd.h index 4ed0b50885..c990bb083d 100644 --- a/src/detect-engine-hcbd.h +++ b/src/detect-engine-hcbd.h @@ -32,7 +32,7 @@ int PrefilterTxHttpRequestBodyRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpClientBody(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); void DetectEngineCleanHCBDBuffers(DetectEngineThreadCtx *); diff --git a/src/detect-engine-hcd.c b/src/detect-engine-hcd.c index 63ed33fe93..4be2ba6903 100644 --- a/src/detect-engine-hcd.c +++ b/src/detect-engine-hcd.c @@ -168,7 +168,7 @@ int PrefilterTxResponseCookieRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) int DetectEngineInspectHttpCookie(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-engine-hcd.h b/src/detect-engine-hcd.h index f5c23514d8..9ed0e6c1d7 100644 --- a/src/detect-engine-hcd.h +++ b/src/detect-engine-hcd.h @@ -31,7 +31,7 @@ int PrefilterTxResponseCookieRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpCookie(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); diff --git a/src/detect-engine-hhd.c b/src/detect-engine-hhd.c index c4146169cc..41cb22d1ff 100644 --- a/src/detect-engine-hhd.c +++ b/src/detect-engine-hhd.c @@ -384,7 +384,7 @@ int PrefilterTxHttpResponseHeadersRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) int DetectEngineInspectHttpHeader(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id) { diff --git a/src/detect-engine-hhd.h b/src/detect-engine-hhd.h index 9826dcda5a..e0da35b186 100644 --- a/src/detect-engine-hhd.h +++ b/src/detect-engine-hhd.h @@ -31,7 +31,7 @@ int PrefilterTxHttpResponseHeadersRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpHeader(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); void DetectEngineCleanHHDBuffers(DetectEngineThreadCtx *det_ctx); diff --git a/src/detect-engine-hhhd.c b/src/detect-engine-hhhd.c index b761a1fe6c..5c53ef7097 100644 --- a/src/detect-engine-hhhd.c +++ b/src/detect-engine-hhhd.c @@ -117,7 +117,7 @@ int PrefilterTxHostnameRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) int DetectEngineInspectHttpHH(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-engine-hhhd.h b/src/detect-engine-hhhd.h index dab5080d42..932a38f6d4 100644 --- a/src/detect-engine-hhhd.h +++ b/src/detect-engine-hhhd.h @@ -30,7 +30,7 @@ int PrefilterTxHostnameRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpHH(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); diff --git a/src/detect-engine-hmd.c b/src/detect-engine-hmd.c index 23b964cf98..31df7e24ae 100644 --- a/src/detect-engine-hmd.c +++ b/src/detect-engine-hmd.c @@ -114,7 +114,7 @@ int PrefilterTxMethodRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) int DetectEngineInspectHttpMethod(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-engine-hmd.h b/src/detect-engine-hmd.h index e2be754be4..cf40eeba61 100644 --- a/src/detect-engine-hmd.h +++ b/src/detect-engine-hmd.h @@ -28,7 +28,7 @@ int DetectEngineInspectHttpMethod(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); diff --git a/src/detect-engine-hrhd.c b/src/detect-engine-hrhd.c index 3181d45bf3..526c6b1424 100644 --- a/src/detect-engine-hrhd.c +++ b/src/detect-engine-hrhd.c @@ -165,7 +165,7 @@ int PrefilterTxResponseHeadersRawRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) int DetectEngineInspectHttpRawHeader(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-engine-hrhd.h b/src/detect-engine-hrhd.h index 6d043f3cf0..99c379b225 100644 --- a/src/detect-engine-hrhd.h +++ b/src/detect-engine-hrhd.h @@ -31,7 +31,7 @@ int PrefilterTxResponseHeadersRawRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpRawHeader(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); void DetectEngineHttpRawHeaderRegisterTests(void); diff --git a/src/detect-engine-hrhhd.c b/src/detect-engine-hrhhd.c index 02db16fe1a..d6b265235d 100644 --- a/src/detect-engine-hrhhd.c +++ b/src/detect-engine-hrhhd.c @@ -129,7 +129,7 @@ int PrefilterTxHostnameRawRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) int DetectEngineInspectHttpHRH(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-engine-hrhhd.h b/src/detect-engine-hrhhd.h index 9fd427247d..30aec3b8c7 100644 --- a/src/detect-engine-hrhhd.h +++ b/src/detect-engine-hrhhd.h @@ -30,7 +30,7 @@ int PrefilterTxHostnameRawRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpHRH(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); diff --git a/src/detect-engine-hrud.c b/src/detect-engine-hrud.c index 4957f3292f..876dcc5e80 100644 --- a/src/detect-engine-hrud.c +++ b/src/detect-engine-hrud.c @@ -114,7 +114,7 @@ int PrefilterTxRawUriRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) int DetectEngineInspectHttpRawUri(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-engine-hrud.h b/src/detect-engine-hrud.h index 9418b077ca..4b7933badc 100644 --- a/src/detect-engine-hrud.h +++ b/src/detect-engine-hrud.h @@ -31,7 +31,7 @@ int PrefilterTxRawUriRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpRawUri(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); void DetectEngineHttpRawUriRegisterTests(void); diff --git a/src/detect-engine-hsbd.h b/src/detect-engine-hsbd.h index edb8d17d91..0512ba4661 100644 --- a/src/detect-engine-hsbd.h +++ b/src/detect-engine-hsbd.h @@ -32,7 +32,7 @@ int PrefilterTxHttpResponseBodyRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpServerBody(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); void DetectEngineCleanHSBDBuffers(DetectEngineThreadCtx *det_ctx); diff --git a/src/detect-engine-hscd.c b/src/detect-engine-hscd.c index e8e94822d0..e9354a91b8 100644 --- a/src/detect-engine-hscd.c +++ b/src/detect-engine-hscd.c @@ -113,7 +113,7 @@ int PrefilterTxHttpStatCodeRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) int DetectEngineInspectHttpStatCode(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-engine-hscd.h b/src/detect-engine-hscd.h index 73977eccec..390abf5b9b 100644 --- a/src/detect-engine-hscd.h +++ b/src/detect-engine-hscd.h @@ -30,7 +30,7 @@ int PrefilterTxHttpStatCodeRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpStatCode(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); void DetectEngineHttpStatCodeRegisterTests(void); diff --git a/src/detect-engine-hsmd.c b/src/detect-engine-hsmd.c index 68811eea7b..4bee372dbc 100644 --- a/src/detect-engine-hsmd.c +++ b/src/detect-engine-hsmd.c @@ -113,7 +113,7 @@ int PrefilterTxHttpStatMsgRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) int DetectEngineInspectHttpStatMsg(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-engine-hsmd.h b/src/detect-engine-hsmd.h index 2feddd3bdc..075d34d713 100644 --- a/src/detect-engine-hsmd.h +++ b/src/detect-engine-hsmd.h @@ -30,7 +30,7 @@ int PrefilterTxHttpStatMsgRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpStatMsg(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); void DetectEngineHttpStatMsgRegisterTests(void); diff --git a/src/detect-engine-hua.c b/src/detect-engine-hua.c index 66c8859cb2..1cc2a39418 100644 --- a/src/detect-engine-hua.c +++ b/src/detect-engine-hua.c @@ -122,7 +122,7 @@ int PrefilterTxUARegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) int DetectEngineInspectHttpUA(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-engine-hua.h b/src/detect-engine-hua.h index eceddf97b1..499539ee92 100644 --- a/src/detect-engine-hua.h +++ b/src/detect-engine-hua.h @@ -30,7 +30,7 @@ int PrefilterTxUARegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpUA(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); diff --git a/src/detect-engine-modbus.c b/src/detect-engine-modbus.c index 976e7d901f..e08cde10d7 100644 --- a/src/detect-engine-modbus.c +++ b/src/detect-engine-modbus.c @@ -199,7 +199,7 @@ static int DetectEngineInspectModbusAddress(ModbusTransaction *tx, int DetectEngineInspectModbus(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, + const Signature *s, Flow *f, uint8_t flags, void *alstate, diff --git a/src/detect-engine-modbus.h b/src/detect-engine-modbus.h index e140f975a5..ae0935c977 100644 --- a/src/detect-engine-modbus.h +++ b/src/detect-engine-modbus.h @@ -34,7 +34,7 @@ #define __DETECT_ENGINE_MODBUS_H__ int DetectEngineInspectModbus(ThreadVars *, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *, Signature *, + DetectEngineThreadCtx *, const Signature *, Flow *, uint8_t, void *, void *, uint64_t); void DetectEngineInspectModbusRegisterTests(void); diff --git a/src/detect-engine-payload.c b/src/detect-engine-payload.c index 70351e9aa4..6cdb775adb 100644 --- a/src/detect-engine-payload.c +++ b/src/detect-engine-payload.c @@ -173,7 +173,7 @@ int DetectEngineInspectPacketPayload(DetectEngineCtx *de_ctx, * from the current packet here. */ int DetectEngineInspectStreamPayload(DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, Signature *s, Flow *f, + DetectEngineThreadCtx *det_ctx, const Signature *s, Flow *f, uint8_t *payload, uint32_t payload_len) { SCEnter(); diff --git a/src/detect-engine-payload.h b/src/detect-engine-payload.h index 67d0be2465..205f8523f4 100644 --- a/src/detect-engine-payload.h +++ b/src/detect-engine-payload.h @@ -28,9 +28,9 @@ int PrefilterPktPayloadRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int PrefilterPktStreamRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectPacketPayload(DetectEngineCtx *, - DetectEngineThreadCtx *, Signature *, Flow *, Packet *); + DetectEngineThreadCtx *, const Signature *, Flow *, Packet *); int DetectEngineInspectStreamPayload(DetectEngineCtx *, - DetectEngineThreadCtx *, Signature *, Flow *, + DetectEngineThreadCtx *, const Signature *, Flow *, uint8_t *, uint32_t); void PayloadRegisterTests(void); diff --git a/src/detect-engine-state.c b/src/detect-engine-state.c index 46ff40c825..fe7335a35e 100644 --- a/src/detect-engine-state.c +++ b/src/detect-engine-state.c @@ -161,7 +161,8 @@ static int DeStateSearchState(DetectEngineState *state, uint8_t direction, SigIn return 0; } -static void DeStateSignatureAppend(DetectEngineState *state, Signature *s, uint32_t inspect_flags, uint8_t direction) +static void DeStateSignatureAppend(DetectEngineState *state, + const Signature *s, uint32_t inspect_flags, uint8_t direction) { int jump = 0; int i = 0; @@ -202,9 +203,9 @@ static void DeStateSignatureAppend(DetectEngineState *state, Signature *s, uint3 return; } -static void DeStateFlowRuleAppend(DetectEngineStateFlow *state, Signature *s, - SigMatch *sm, uint32_t inspect_flags, - uint8_t direction) +static void DeStateFlowRuleAppend(DetectEngineStateFlow *state, const Signature *s, + const SigMatch *sm, uint32_t inspect_flags, + uint8_t direction) { int jump = 0; int i = 0; @@ -392,7 +393,8 @@ int DeStateFlowHasInspectableState(Flow *f, AppProto alproto, static int StoreState(DetectEngineThreadCtx *det_ctx, Flow *f, const uint8_t flags, const uint8_t alversion, - Signature *s, SigMatch *sm, const uint32_t inspect_flags, + const Signature *s, const SigMatch *sm, + const uint32_t inspect_flags, const uint16_t file_no_match) { if (f->de_state == NULL) { @@ -445,7 +447,7 @@ static void StoreStateTxFileOnly(DetectEngineThreadCtx *det_ctx, static void StoreStateTx(DetectEngineThreadCtx *det_ctx, Flow *f, const uint8_t flags, const uint8_t alversion, const uint64_t tx_id, void *tx, - Signature *s, SigMatch *sm, + const Signature *s, const SigMatch *sm, const uint32_t inspect_flags, const uint16_t file_no_match, int check_before_add) { if (AppLayerParserSupportsTxDetectState(f->proto, f->alproto)) { @@ -474,7 +476,7 @@ static void StoreStateTx(DetectEngineThreadCtx *det_ctx, int DeStateDetectStartDetection(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Packet *p, Flow *f, uint8_t flags, + const Signature *s, Packet *p, Flow *f, uint8_t flags, AppProto alproto, const uint8_t alversion) { SigMatch *sm = NULL; @@ -946,8 +948,8 @@ static int DoInspectFlowRule(ThreadVars *tv, uint32_t inspect_flags = item->flags; int total_matches = 0; int full_match = 0; - SigMatch *sm = NULL; - Signature *s = de_ctx->sig_array[item->sid]; + const SigMatch *sm = NULL; + const Signature *s = de_ctx->sig_array[item->sid]; RULE_PROFILING_START(p); diff --git a/src/detect-engine-state.h b/src/detect-engine-state.h index af4f87247e..d61faa5b2c 100644 --- a/src/detect-engine-state.h +++ b/src/detect-engine-state.h @@ -123,7 +123,7 @@ typedef struct DetectEngineState_ { /* FLOW BASED (AMATCH) */ typedef struct DeStateStoreFlowRule_ { - SigMatch *nm; + const SigMatch *nm; uint32_t flags; SigIntId sid; } DeStateStoreFlowRule; @@ -188,7 +188,8 @@ int DeStateFlowHasInspectableState(Flow *f, AppProto alproto, uint8_t alversion, */ int DeStateDetectStartDetection(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Packet *p, Flow *f, uint8_t flags, + const Signature *s, Packet *p, Flow *f, + uint8_t flags, AppProto alproto, uint8_t alversion); /** diff --git a/src/detect-engine-template.h b/src/detect-engine-template.h index 98a17bf63d..e1f39065bd 100644 --- a/src/detect-engine-template.h +++ b/src/detect-engine-template.h @@ -25,7 +25,7 @@ #define __DETECT_TEMPLATE_ENGINE_H__ int DetectEngineInspectTemplateBuffer(ThreadVars *, DetectEngineCtx *, - DetectEngineThreadCtx *, Signature *, Flow *, uint8_t, void *, void *, + DetectEngineThreadCtx *, const Signature *, Flow *, uint8_t, void *, void *, uint64_t); #endif /* __DETECT_TEMPLATE_ENGINE_H__ */ diff --git a/src/detect-engine-tls.c b/src/detect-engine-tls.c index 98eeab60e1..e3e7881e02 100644 --- a/src/detect-engine-tls.c +++ b/src/detect-engine-tls.c @@ -98,7 +98,7 @@ int PrefilterTxTlsSniRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx) * \retval 1 Match */ int DetectEngineInspectTlsSni(ThreadVars *tv, DetectEngineCtx *de_ctx, - DetectEngineThreadCtx *det_ctx, Signature *s, + DetectEngineThreadCtx *det_ctx, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-engine-tls.h b/src/detect-engine-tls.h index 56bb63172d..e35281caf3 100644 --- a/src/detect-engine-tls.h +++ b/src/detect-engine-tls.h @@ -29,22 +29,22 @@ int PrefilterTxTlsSubjectRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectTlsSni(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); int DetectEngineInspectTlsIssuer(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); int DetectEngineInspectTlsSubject(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); int DetectEngineInspectTlsValidity(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); #endif /* __DETECT_ENGINE_TLS_H__ */ diff --git a/src/detect-engine-uri.h b/src/detect-engine-uri.h index d5ba12298d..bc5933aa0d 100644 --- a/src/detect-engine-uri.h +++ b/src/detect-engine-uri.h @@ -29,7 +29,7 @@ int PrefilterTxUriRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx); int DetectEngineInspectHttpUri(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); void UriRegisterTests(void); diff --git a/src/detect-engine.c b/src/detect-engine.c index 05fe1a0f76..06893021b8 100644 --- a/src/detect-engine.c +++ b/src/detect-engine.c @@ -106,7 +106,7 @@ void DetectAppLayerInspectEngineRegister(AppProto alproto, int (*Callback)(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *sig, Flow *f, + const Signature *sig, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id)) { diff --git a/src/detect-engine.h b/src/detect-engine.h index 608f0685d8..498dd22d8a 100644 --- a/src/detect-engine.h +++ b/src/detect-engine.h @@ -89,7 +89,7 @@ void DetectAppLayerInspectEngineRegister(AppProto alproto, int (*Callback)(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *sig, Flow *f, + const Signature *sig, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id)); diff --git a/src/detect-fileext.c b/src/detect-fileext.c index 568c97802a..fc052e0769 100644 --- a/src/detect-fileext.c +++ b/src/detect-fileext.c @@ -52,7 +52,7 @@ #include "detect-fileext.h" static int DetectFileextMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, - uint8_t, File *, Signature *, SigMatch *); + uint8_t, File *, const Signature *, const SigMatch *); static int DetectFileextSetup (DetectEngineCtx *, Signature *, char *); static void DetectFileextRegisterTests(void); static void DetectFileextFree(void *); @@ -89,7 +89,7 @@ void DetectFileextRegister(void) * \retval 1 match */ static int DetectFileextMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Flow *f, uint8_t flags, File *file, Signature *s, SigMatch *m) + Flow *f, uint8_t flags, File *file, const Signature *s, const SigMatch *m) { SCEnter(); int ret = 0; diff --git a/src/detect-filemagic.c b/src/detect-filemagic.c index 2c2c46f676..a64e1d180b 100644 --- a/src/detect-filemagic.c +++ b/src/detect-filemagic.c @@ -76,7 +76,7 @@ void DetectFilemagicRegister(void) #else /* HAVE_MAGIC */ static int DetectFilemagicMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, - uint8_t, File *, Signature *, SigMatch *); + uint8_t, File *, const Signature *, const SigMatch *); static int DetectFilemagicSetup (DetectEngineCtx *, Signature *, char *); static void DetectFilemagicRegisterTests(void); static void DetectFilemagicFree(void *); @@ -176,7 +176,7 @@ int FilemagicThreadLookup(magic_t *ctx, File *file) * \retval 1 match */ static int DetectFilemagicMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Flow *f, uint8_t flags, File *file, Signature *s, SigMatch *m) + Flow *f, uint8_t flags, File *file, const Signature *s, const SigMatch *m) { SCEnter(); int ret = 0; diff --git a/src/detect-filename.c b/src/detect-filename.c index 35b27d17b4..34722fb77f 100644 --- a/src/detect-filename.c +++ b/src/detect-filename.c @@ -53,7 +53,7 @@ #include "app-layer-parser.h" static int DetectFilenameMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, - uint8_t, File *, Signature *, SigMatch *); + uint8_t, File *, const Signature *, const SigMatch *); static int DetectFilenameSetup (DetectEngineCtx *, Signature *, char *); static void DetectFilenameRegisterTests(void); static void DetectFilenameFree(void *); @@ -101,7 +101,7 @@ void DetectFilenameRegister(void) * \retval 1 match */ static int DetectFilenameMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Flow *f, uint8_t flags, File *file, Signature *s, SigMatch *m) + Flow *f, uint8_t flags, File *file, const Signature *s, const SigMatch *m) { SCEnter(); int ret = 0; diff --git a/src/detect-filesize.c b/src/detect-filesize.c index 12b4c18f25..b26c7a8fc6 100644 --- a/src/detect-filesize.c +++ b/src/detect-filesize.c @@ -49,7 +49,7 @@ static pcre_extra *parse_regex_study; /*prototypes*/ static int DetectFilesizeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f, - uint8_t flags, File *file, Signature *s, SigMatch *m); + uint8_t flags, File *file, const Signature *s, const SigMatch *m); static int DetectFilesizeSetup (DetectEngineCtx *, Signature *, char *); static void DetectFilesizeFree (void *); static void DetectFilesizeRegisterTests (void); @@ -87,7 +87,7 @@ void DetectFilesizeRegister(void) * \retval 1 match */ static int DetectFilesizeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f, - uint8_t flags, File *file, Signature *s, SigMatch *m) + uint8_t flags, File *file, const Signature *s, const SigMatch *m) { SCEnter(); diff --git a/src/detect-filestore.c b/src/detect-filestore.c index ab096573fd..4104fc694d 100644 --- a/src/detect-filestore.c +++ b/src/detect-filestore.c @@ -60,7 +60,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; static int DetectFilestoreMatch (ThreadVars *, DetectEngineThreadCtx *, - Flow *, uint8_t, File *, Signature *, SigMatch *); + Flow *, uint8_t, File *, const Signature *, const SigMatch *); static int DetectFilestoreSetup (DetectEngineCtx *, Signature *, char *); static void DetectFilestoreFree(void *); static void DetectFilestoreRegisterTests(void); @@ -180,7 +180,7 @@ static int FilestorePostMatchWithOptions(Packet *p, Flow *f, DetectFilestoreData * When we are sure all parts of the signature matched, we run this function * to finalize the filestore. */ -int DetectFilestorePostMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s) +int DetectFilestorePostMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s) { uint8_t flags = 0; @@ -247,7 +247,7 @@ int DetectFilestorePostMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Pack * needs to be put behind a api. */ static int DetectFilestoreMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f, - uint8_t flags, File *file, Signature *s, SigMatch *m) + uint8_t flags, File *file, const Signature *s, const SigMatch *m) { uint16_t file_id = 0; diff --git a/src/detect-filestore.h b/src/detect-filestore.h index 1879b87532..09d2e25f18 100644 --- a/src/detect-filestore.h +++ b/src/detect-filestore.h @@ -41,5 +41,7 @@ typedef struct DetectFilestoreData_ { /* prototypes */ void DetectFilestoreRegister (void); -int DetectFilestorePostMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *); +int DetectFilestorePostMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, + Packet *p, const Signature *); + #endif /* __DETECT_FILESTORE_H__ */ diff --git a/src/detect-flags.c b/src/detect-flags.c index 28e01d1bfa..be4232856b 100644 --- a/src/detect-flags.c +++ b/src/detect-flags.c @@ -58,7 +58,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectFlagsMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); +static int DetectFlagsMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, + const Signature *, const SigMatchCtx *); static int DetectFlagsSetup (DetectEngineCtx *, Signature *, char *); static void DetectFlagsFree(void *); @@ -138,7 +139,8 @@ static inline int FlagsMatch(const uint8_t pflags, const uint8_t modifier, * \retval 0 no match * \retval 1 match */ -static int DetectFlagsMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectFlagsMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx) { SCEnter(); diff --git a/src/detect-flow.c b/src/detect-flow.c index 376944f678..a1d77ea17f 100644 --- a/src/detect-flow.c +++ b/src/detect-flow.c @@ -49,7 +49,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectFlowMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); +int DetectFlowMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, + const Signature *, const SigMatchCtx *); static int DetectFlowSetup (DetectEngineCtx *, Signature *, char *); void DetectFlowRegisterTests(void); void DetectFlowFree(void *); @@ -132,7 +133,8 @@ static inline int FlowMatch(const uint32_t pflags, const uint8_t pflowflags, * \retval 0 no match * \retval 1 match */ -int DetectFlowMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +int DetectFlowMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx) { SCEnter(); diff --git a/src/detect-flowbits.c b/src/detect-flowbits.c index 9b1af17811..41b249efeb 100644 --- a/src/detect-flowbits.c +++ b/src/detect-flowbits.c @@ -49,7 +49,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectFlowbitMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); +int DetectFlowbitMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, + const Signature *, const SigMatchCtx *); static int DetectFlowbitSetup (DetectEngineCtx *, Signature *, char *); void DetectFlowbitFree (void *); void FlowBitsRegisterTests(void); @@ -122,7 +123,8 @@ static int DetectFlowbitMatchIsnotset (Packet *p, const DetectFlowbitsData *fd) * -1: error */ -int DetectFlowbitMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +int DetectFlowbitMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx) { const DetectFlowbitsData *fd = (const DetectFlowbitsData *)ctx; if (fd == NULL) diff --git a/src/detect-flowint.c b/src/detect-flowint.c index 8b0389ef96..6ceb7ca39e 100644 --- a/src/detect-flowint.c +++ b/src/detect-flowint.c @@ -54,7 +54,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; int DetectFlowintMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, - Signature *, const SigMatchCtx *); + const Signature *, const SigMatchCtx *); static int DetectFlowintSetup(DetectEngineCtx *, Signature *, char *); void DetectFlowintFree(void *); void DetectFlowintRegisterTests(void); @@ -87,7 +87,7 @@ void DetectFlowintRegister(void) * condition */ int DetectFlowintMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Packet *p, Signature *s, const SigMatchCtx *ctx) + Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectFlowintData *sfd = (const DetectFlowintData *)ctx; FlowVar *fv; diff --git a/src/detect-flowvar.c b/src/detect-flowvar.c index e662ad17ab..46741016b6 100644 --- a/src/detect-flowvar.c +++ b/src/detect-flowvar.c @@ -44,9 +44,11 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectFlowvarMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); +int DetectFlowvarMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, + const Signature *, const SigMatchCtx *); static int DetectFlowvarSetup (DetectEngineCtx *, Signature *, char *); -static int DetectFlowvarPostMatch(ThreadVars *tv, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx); +static int DetectFlowvarPostMatch(ThreadVars *tv, DetectEngineThreadCtx *det_ctx, + Packet *p, const Signature *s, const SigMatchCtx *ctx); static void DetectFlowvarDataFree(void *ptr); void DetectFlowvarRegister (void) @@ -93,7 +95,8 @@ static void DetectFlowvarDataFree(void *ptr) * -1: error */ -int DetectFlowvarMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +int DetectFlowvarMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx) { int ret = 0; DetectFlowvarData *fd = (DetectFlowvarData *)ctx; @@ -261,7 +264,7 @@ error: */ static int DetectFlowvarPostMatch(ThreadVars *tv, DetectEngineThreadCtx *det_ctx, - Packet *p, Signature *s, const SigMatchCtx *ctx) + Packet *p, const Signature *s, const SigMatchCtx *ctx) { DetectFlowvarList *fs, *prev; const DetectFlowvarData *fd; diff --git a/src/detect-fragbits.c b/src/detect-fragbits.c index 5c0e014ab7..0677b5b7b4 100644 --- a/src/detect-fragbits.c +++ b/src/detect-fragbits.c @@ -68,7 +68,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectFragBitsMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); +static int DetectFragBitsMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, + const Signature *, const SigMatchCtx *); static int DetectFragBitsSetup (DetectEngineCtx *, Signature *, char *); static void DetectFragBitsFree(void *); @@ -136,7 +137,7 @@ FragBitsMatch(const uint8_t pbits, const uint8_t modifier, * \retval 1 match */ static int DetectFragBitsMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Packet *p, Signature *s, const SigMatchCtx *ctx) + Packet *p, const Signature *s, const SigMatchCtx *ctx) { if (!ctx || !PKT_IS_IPV4(p) || PKT_IS_PSEUDOPKT(p)) return 0; diff --git a/src/detect-fragoffset.c b/src/detect-fragoffset.c index aa43ced0a5..ea65f860c6 100644 --- a/src/detect-fragoffset.c +++ b/src/detect-fragoffset.c @@ -44,7 +44,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectFragOffsetMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); +static int DetectFragOffsetMatch(ThreadVars *, DetectEngineThreadCtx *, + Packet *, const Signature *, const SigMatchCtx *); static int DetectFragOffsetSetup(DetectEngineCtx *, Signature *, char *); void DetectFragOffsetRegisterTests(void); void DetectFragOffsetFree(void *); @@ -102,7 +103,8 @@ static inline int FragOffsetMatch(const uint16_t poffset, const uint8_t mode, * \retval 1 match * */ -int DetectFragOffsetMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectFragOffsetMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, + Packet *p, const Signature *s, const SigMatchCtx *ctx) { uint16_t frag = 0; const DetectFragOffsetData *fragoff = (const DetectFragOffsetData *)ctx; diff --git a/src/detect-ftpbounce.c b/src/detect-ftpbounce.c index e6015a16c0..4c067d7d63 100644 --- a/src/detect-ftpbounce.c +++ b/src/detect-ftpbounce.c @@ -47,13 +47,11 @@ #include "stream-tcp.h" #include "util-byte.h" -int DetectFtpbounceMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, - Signature *, SigMatch *); -int DetectFtpbounceALMatch(ThreadVars *, DetectEngineThreadCtx *, Flow *, - uint8_t, void *, Signature *, SigMatch *); +static int DetectFtpbounceALMatch(ThreadVars *, DetectEngineThreadCtx *, Flow *, + uint8_t, void *, const Signature *, const SigMatch *); static int DetectFtpbounceSetup(DetectEngineCtx *, Signature *, char *); -int DetectFtpbounceMatchArgs(uint8_t *payload, uint16_t payload_len, - uint32_t ip_orig, uint16_t offset); +static int DetectFtpbounceMatchArgs(uint8_t *payload, uint16_t payload_len, + uint32_t ip_orig, uint16_t offset); void DetectFtpbounceRegisterTests(void); void DetectFtpbounceFree(void *); @@ -83,7 +81,7 @@ void DetectFtpbounceRegister(void) * * \retval 1 if ftpbounce detected, 0 if not */ -int DetectFtpbounceMatchArgs(uint8_t *payload, uint16_t payload_len, +static int DetectFtpbounceMatchArgs(uint8_t *payload, uint16_t payload_len, uint32_t ip_orig, uint16_t offset) { SCEnter(); @@ -168,9 +166,9 @@ int DetectFtpbounceMatchArgs(uint8_t *payload, uint16_t payload_len, * \retval 0 no match * \retval 1 match */ -int DetectFtpbounceALMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Flow *f, uint8_t flags, void *state, Signature *s, - SigMatch *m) +static int DetectFtpbounceALMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, + Flow *f, uint8_t flags, void *state, const Signature *s, + const SigMatch *m) { SCEnter(); FtpState *ftp_state =(FtpState *)state; diff --git a/src/detect-hostbits.c b/src/detect-hostbits.c index 229d7ada1a..e2fa800c6f 100644 --- a/src/detect-hostbits.c +++ b/src/detect-hostbits.c @@ -68,7 +68,8 @@ TODO: static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectHostbitMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); +static int DetectHostbitMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, + const Signature *, const SigMatchCtx *); static int DetectHostbitSetup (DetectEngineCtx *, Signature *, char *); void DetectHostbitFree (void *); void HostBitsRegisterTests(void); @@ -265,7 +266,8 @@ int DetectXbitMatchHost(Packet *p, const DetectXbitsData *xd) * -1: error */ -int DetectHostbitMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectHostbitMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx) { const DetectXbitsData *xd = (const DetectXbitsData *)ctx; if (xd == NULL) diff --git a/src/detect-http-request-line.c b/src/detect-http-request-line.c index 4d9cf2795d..6e316f568f 100644 --- a/src/detect-http-request-line.c +++ b/src/detect-http-request-line.c @@ -67,7 +67,7 @@ static int PrefilterTxHttpRequestLineRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx static int DetectEngineInspectHttpRequestLine(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); /** @@ -174,7 +174,7 @@ static int PrefilterTxHttpRequestLineRegister(SigGroupHead *sgh, MpmCtx *mpm_ctx static int DetectEngineInspectHttpRequestLine(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-http-response-line.c b/src/detect-http-response-line.c index 8887ce979a..606c740746 100644 --- a/src/detect-http-response-line.c +++ b/src/detect-http-response-line.c @@ -67,7 +67,7 @@ static int PrefilterTxHttpResponseLineRegister(SigGroupHead *sgh, MpmCtx *mpm_ct static int DetectEngineInspectHttpResponseLine(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id); @@ -175,7 +175,7 @@ static int PrefilterTxHttpResponseLineRegister(SigGroupHead *sgh, MpmCtx *mpm_ct int DetectEngineInspectHttpResponseLine(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, - Signature *s, Flow *f, uint8_t flags, + const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id) { diff --git a/src/detect-icmp-id.c b/src/detect-icmp-id.c index 22acfb3356..147a86695e 100644 --- a/src/detect-icmp-id.c +++ b/src/detect-icmp-id.c @@ -43,7 +43,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectIcmpIdMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); +static int DetectIcmpIdMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, + const Signature *, const SigMatchCtx *); static int DetectIcmpIdSetup(DetectEngineCtx *, Signature *, char *); void DetectIcmpIdRegisterTests(void); void DetectIcmpIdFree(void *); @@ -129,7 +130,8 @@ static inline _Bool GetIcmpId(Packet *p, uint16_t *id) * \retval 0 no match * \retval 1 match */ -int DetectIcmpIdMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectIcmpIdMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx) { uint16_t pid; diff --git a/src/detect-icmp-seq.c b/src/detect-icmp-seq.c index 9ddd4e6b36..1cd6971dee 100644 --- a/src/detect-icmp-seq.c +++ b/src/detect-icmp-seq.c @@ -43,7 +43,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectIcmpSeqMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); +static int DetectIcmpSeqMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, + const Signature *, const SigMatchCtx *); static int DetectIcmpSeqSetup(DetectEngineCtx *, Signature *, char *); void DetectIcmpSeqRegisterTests(void); void DetectIcmpSeqFree(void *); @@ -131,7 +132,8 @@ static inline _Bool GetIcmpSeq(Packet *p, uint16_t *seq) * \retval 0 no match * \retval 1 match */ -int DetectIcmpSeqMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectIcmpSeqMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx) { uint16_t seqn; diff --git a/src/detect-icode.c b/src/detect-icode.c index 8468c3aff6..f6a01ad9aa 100644 --- a/src/detect-icode.c +++ b/src/detect-icode.c @@ -46,7 +46,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectICodeMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); +static int DetectICodeMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, + const Signature *, const SigMatchCtx *); static int DetectICodeSetup(DetectEngineCtx *, Signature *, char *); void DetectICodeRegisterTests(void); void DetectICodeFree(void *); @@ -115,7 +116,8 @@ static inline int ICodeMatch(const uint8_t pcode, const uint8_t mode, * \retval 0 no match * \retval 1 match */ -int DetectICodeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectICodeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx) { if (PKT_IS_PSEUDOPKT(p)) return 0; diff --git a/src/detect-id.c b/src/detect-id.c index de2e21dd61..8b6d4df75f 100644 --- a/src/detect-id.c +++ b/src/detect-id.c @@ -49,8 +49,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectIdMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, - Signature *, const SigMatchCtx *); +static int DetectIdMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, + const Signature *, const SigMatchCtx *); static int DetectIdSetup (DetectEngineCtx *, Signature *, char *); void DetectIdRegisterTests(void); void DetectIdFree(void *); @@ -88,8 +88,8 @@ void DetectIdRegister (void) * \retval 0 no match * \retval 1 match */ -int DetectIdMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, - Signature *s, const SigMatchCtx *ctx) +static int DetectIdMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx) { const DetectIdData *id_d = (const DetectIdData *)ctx; diff --git a/src/detect-ipopts.c b/src/detect-ipopts.c index 21e8a4aa52..33addb855b 100644 --- a/src/detect-ipopts.c +++ b/src/detect-ipopts.c @@ -43,7 +43,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectIpOptsMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); +static int DetectIpOptsMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, + const Signature *, const SigMatchCtx *); static int DetectIpOptsSetup (DetectEngineCtx *, Signature *, char *); void IpOptsRegisterTests(void); void DetectIpOptsFree(void *); @@ -98,7 +99,8 @@ struct DetectIpOpts_ { * \retval 0 no match * \retval 1 match */ -int DetectIpOptsMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectIpOptsMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx) { const DetectIpOptsData *de = (const DetectIpOptsData *)ctx; diff --git a/src/detect-iprep.c b/src/detect-iprep.c index 10da976a86..7b0dfb78b6 100644 --- a/src/detect-iprep.c +++ b/src/detect-iprep.c @@ -52,7 +52,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectIPRepMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); +static int DetectIPRepMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, + const Signature *, const SigMatchCtx *); static int DetectIPRepSetup (DetectEngineCtx *, Signature *, char *); void DetectIPRepFree (void *); void IPRepRegisterTests(void); @@ -166,7 +167,8 @@ static inline int RepMatch(uint8_t op, uint8_t val1, uint8_t val2) * 1: match * -1: error */ -int DetectIPRepMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectIPRepMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx) { const DetectIPRepData *rd = (const DetectIPRepData *)ctx; if (rd == NULL) diff --git a/src/detect-itype.c b/src/detect-itype.c index 35b962d53f..3d3a0e3896 100644 --- a/src/detect-itype.c +++ b/src/detect-itype.c @@ -46,7 +46,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectITypeMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); +static int DetectITypeMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, + const Signature *, const SigMatchCtx *); static int DetectITypeSetup(DetectEngineCtx *, Signature *, char *); void DetectITypeRegisterTests(void); void DetectITypeFree(void *); @@ -115,7 +116,8 @@ static inline int ITypeMatch(const uint8_t ptype, const uint8_t mode, * \retval 0 no match * \retval 1 match */ -int DetectITypeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectITypeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx) { if (PKT_IS_PSEUDOPKT(p)) return 0; diff --git a/src/detect-lua.c b/src/detect-lua.c index b3a8222b1e..27351bfe4a 100644 --- a/src/detect-lua.c +++ b/src/detect-lua.c @@ -88,9 +88,9 @@ void DetectLuaRegister(void) #include "util-lua.h" static int DetectLuaMatch (ThreadVars *, DetectEngineThreadCtx *, - Packet *, Signature *, const SigMatchCtx *); + Packet *, const Signature *, const SigMatchCtx *); static int DetectLuaAppMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Flow *f, uint8_t flags, void *state, Signature *s, SigMatch *m); + Flow *f, uint8_t flags, void *state, const Signature *s, const SigMatch *m); static int DetectLuaAppTxMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, void *txv, const Signature *s, @@ -186,7 +186,7 @@ void LuaDumpStack(lua_State *state) } int DetectLuaMatchBuffer(DetectEngineThreadCtx *det_ctx, - Signature *s, SigMatch *sm, + const Signature *s, const SigMatch *sm, uint8_t *buffer, uint32_t buffer_len, uint32_t offset, Flow *f) { @@ -292,7 +292,7 @@ int DetectLuaMatchBuffer(DetectEngineThreadCtx *det_ctx, * \retval 1 match */ static int DetectLuaMatch (ThreadVars *tv, DetectEngineThreadCtx *det_ctx, - Packet *p, Signature *s, const SigMatchCtx *ctx) + Packet *p, const Signature *s, const SigMatchCtx *ctx) { SCEnter(); int ret = 0; @@ -537,7 +537,8 @@ static int DetectLuaAppMatchCommon (ThreadVars *t, DetectEngineThreadCtx *det_ct * \retval 1 match */ static int DetectLuaAppMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Flow *f, uint8_t flags, void *state, Signature *s, SigMatch *m) + Flow *f, uint8_t flags, void *state, + const Signature *s, const SigMatch *m) { return DetectLuaAppMatchCommon(t, det_ctx, f, flags, state, s, m->ctx); } diff --git a/src/detect-lua.h b/src/detect-lua.h index d1259b3e66..18298aa203 100644 --- a/src/detect-lua.h +++ b/src/detect-lua.h @@ -55,7 +55,8 @@ typedef struct DetectLuaData { /* prototypes */ void DetectLuaRegister (void); -int DetectLuaMatchBuffer(DetectEngineThreadCtx *det_ctx, Signature *s, SigMatch *sm, +int DetectLuaMatchBuffer(DetectEngineThreadCtx *det_ctx, + const Signature *s, const SigMatch *sm, uint8_t *buffer, uint32_t buffer_len, uint32_t offset, Flow *f); diff --git a/src/detect-mark.c b/src/detect-mark.c index 83fa09690a..de04203ce8 100644 --- a/src/detect-mark.c +++ b/src/detect-mark.c @@ -43,7 +43,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; static int DetectMarkSetup (DetectEngineCtx *, Signature *, char *); -int DetectMarkPacket(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx); +static int DetectMarkPacket(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx); void DetectMarkDataFree(void *ptr); /** @@ -217,7 +218,8 @@ void DetectMarkDataFree(void *ptr) } -int DetectMarkPacket(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectMarkPacket(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx) { #ifdef NFQ const DetectMarkData *nf_data = (const DetectMarkData *)ctx; diff --git a/src/detect-pcre.c b/src/detect-pcre.c index c43981ff6a..b843014915 100644 --- a/src/detect-pcre.c +++ b/src/detect-pcre.c @@ -171,8 +171,8 @@ void DetectPcreRegister (void) * \retval 1 Match. * \retval 0 No match. */ -int DetectPcrePayloadMatch(DetectEngineThreadCtx *det_ctx, Signature *s, - SigMatch *sm, Packet *p, Flow *f, uint8_t *payload, +int DetectPcrePayloadMatch(DetectEngineThreadCtx *det_ctx, const Signature *s, + const SigMatch *sm, Packet *p, Flow *f, uint8_t *payload, uint32_t payload_len) { SCEnter(); diff --git a/src/detect-pcre.h b/src/detect-pcre.h index e0098cb1c0..52e6394b59 100644 --- a/src/detect-pcre.h +++ b/src/detect-pcre.h @@ -44,7 +44,8 @@ typedef struct DetectPcreData_ { } DetectPcreData; /* prototypes */ -int DetectPcrePayloadMatch(DetectEngineThreadCtx *, Signature *, SigMatch *, Packet *, Flow *, uint8_t *, uint32_t); +int DetectPcrePayloadMatch(DetectEngineThreadCtx *, const Signature *, + const SigMatch *, Packet *, Flow *, uint8_t *, uint32_t); int DetectPcrePacketPayloadMatch(DetectEngineThreadCtx *, Packet *, Signature *, SigMatch *); int DetectPcrePayloadDoMatch(DetectEngineThreadCtx *, Signature *, SigMatch *, Packet *, uint8_t *, uint16_t); diff --git a/src/detect-pktvar.c b/src/detect-pktvar.c index d319bd8882..930ceeeeaf 100644 --- a/src/detect-pktvar.c +++ b/src/detect-pktvar.c @@ -39,7 +39,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectPktvarMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); +static int DetectPktvarMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, + const Signature *, const SigMatchCtx *); static int DetectPktvarSetup (DetectEngineCtx *, Signature *, char *); void DetectPktvarRegister (void) @@ -61,7 +62,8 @@ void DetectPktvarRegister (void) * -1: error */ -int DetectPktvarMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectPktvarMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx) { int ret = 0; const DetectPktvarData *pd = (const DetectPktvarData *)ctx; diff --git a/src/detect-rpc.c b/src/detect-rpc.c index b3052ce547..b559ad6f07 100644 --- a/src/detect-rpc.c +++ b/src/detect-rpc.c @@ -48,8 +48,9 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectRpcMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); -int DetectRpcSetup (DetectEngineCtx *, Signature *, char *); +static int DetectRpcMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, + const Signature *, const SigMatchCtx *); +static int DetectRpcSetup (DetectEngineCtx *, Signature *, char *); void DetectRpcRegisterTests(void); void DetectRpcFree(void *); @@ -86,7 +87,8 @@ void DetectRpcRegister (void) * \retval 0 no match * \retval 1 match */ -int DetectRpcMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectRpcMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx) { /* PrintRawDataFp(stdout, p->payload, p->payload_len); */ const DetectRpcData *rd = (const DetectRpcData *)ctx; diff --git a/src/detect-sameip.c b/src/detect-sameip.c index e22a943f38..780832b8fe 100644 --- a/src/detect-sameip.c +++ b/src/detect-sameip.c @@ -38,7 +38,7 @@ #include "util-unittest-helper.h" static int DetectSameipMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, - Signature *, const SigMatchCtx *); + const Signature *, const SigMatchCtx *); static int DetectSameipSetup(DetectEngineCtx *, Signature *, char *); static void DetectSameipRegisterTests(void); @@ -71,7 +71,7 @@ void DetectSameipRegister(void) * \retval 1 match */ static int DetectSameipMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Packet *p, Signature *s, const SigMatchCtx *ctx) + Packet *p, const Signature *s, const SigMatchCtx *ctx) { return CMP_ADDR(&p->src, &p->dst) ? 1 : 0; } diff --git a/src/detect-seq.c b/src/detect-seq.c index cb2bb9930f..f747d40a59 100644 --- a/src/detect-seq.c +++ b/src/detect-seq.c @@ -42,7 +42,7 @@ static int DetectSeqSetup(DetectEngineCtx *, Signature *, char *); static int DetectSeqMatch(ThreadVars *, DetectEngineThreadCtx *, - Packet *, Signature *, const SigMatchCtx *); + Packet *, const Signature *, const SigMatchCtx *); static void DetectSeqRegisterTests(void); static void DetectSeqFree(void *); static int PrefilterSetupTcpSeq(SigGroupHead *sgh); @@ -75,7 +75,7 @@ void DetectSeqRegister(void) * \retval 1 match */ static int DetectSeqMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Packet *p, Signature *s, const SigMatchCtx *ctx) + Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectSeqData *data = (const DetectSeqData *)ctx; diff --git a/src/detect-ssh-proto-version.c b/src/detect-ssh-proto-version.c index 3df3dfe0b4..f22cfe386f 100644 --- a/src/detect-ssh-proto-version.c +++ b/src/detect-ssh-proto-version.c @@ -62,7 +62,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectSshVersionMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, uint8_t, void *, Signature *, SigMatch *); +static int DetectSshVersionMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, + uint8_t, void *, const Signature *, const SigMatch *); static int DetectSshVersionSetup (DetectEngineCtx *, Signature *, char *); void DetectSshVersionRegisterTests(void); void DetectSshVersionFree(void *); @@ -93,7 +94,8 @@ void DetectSshVersionRegister(void) * \retval 0 no match * \retval 1 match */ -int DetectSshVersionMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, Signature *s, SigMatch *m) +static int DetectSshVersionMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f, + uint8_t flags, void *state, const Signature *s, const SigMatch *m) { SCEnter(); diff --git a/src/detect-ssh-software-version.c b/src/detect-ssh-software-version.c index 1284bbc37e..7a24703b98 100644 --- a/src/detect-ssh-software-version.c +++ b/src/detect-ssh-software-version.c @@ -66,7 +66,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectSshSoftwareVersionMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, uint8_t, void *, Signature *, SigMatch *); +static int DetectSshSoftwareVersionMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, + uint8_t, void *, const Signature *, const SigMatch *); static int DetectSshSoftwareVersionSetup (DetectEngineCtx *, Signature *, char *); void DetectSshSoftwareVersionRegisterTests(void); void DetectSshSoftwareVersionFree(void *); @@ -98,7 +99,8 @@ void DetectSshSoftwareVersionRegister(void) * \retval 0 no match * \retval 1 match */ -int DetectSshSoftwareVersionMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, Signature *s, SigMatch *m) +static int DetectSshSoftwareVersionMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f, + uint8_t flags, void *state, const Signature *s, const SigMatch *m) { SCEnter(); diff --git a/src/detect-ssl-state.c b/src/detect-ssl-state.c index a46d55c540..6be0204ebc 100644 --- a/src/detect-ssl-state.c +++ b/src/detect-ssl-state.c @@ -59,9 +59,9 @@ static pcre_extra *parse_regex1_study; static pcre *parse_regex2; static pcre_extra *parse_regex2_study; -int DetectSslStateMatch(ThreadVars *, DetectEngineThreadCtx *, Flow *, - uint8_t, void *, Signature *, SigMatch *); -int DetectSslStateSetup(DetectEngineCtx *, Signature *, char *); +static int DetectSslStateMatch(ThreadVars *, DetectEngineThreadCtx *, Flow *, + uint8_t, void *, const Signature *, const SigMatch *); +static int DetectSslStateSetup(DetectEngineCtx *, Signature *, char *); void DetectSslStateRegisterTests(void); void DetectSslStateFree(void *); @@ -95,9 +95,9 @@ void DetectSslStateRegister(void) * \retval 1 Match. * \retval 0 No match. */ -int DetectSslStateMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Flow *f, uint8_t flags, void *alstate, Signature *s, - SigMatch *m) +static int DetectSslStateMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, + Flow *f, uint8_t flags, void *alstate, const Signature *s, + const SigMatch *m) { DetectSslStateData *ssd = (DetectSslStateData *)m->ctx; SSLState *ssl_state = (SSLState *)alstate; diff --git a/src/detect-ssl-version.c b/src/detect-ssl-version.c index 52a5d4b72a..a699b10926 100644 --- a/src/detect-ssl-version.c +++ b/src/detect-ssl-version.c @@ -60,8 +60,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectSslVersionMatch(ThreadVars *, DetectEngineThreadCtx *, Flow *, - uint8_t, void *, Signature *, SigMatch *); +static int DetectSslVersionMatch(ThreadVars *, DetectEngineThreadCtx *, Flow *, + uint8_t, void *, const Signature *, const SigMatch *); static int DetectSslVersionSetup(DetectEngineCtx *, Signature *, char *); void DetectSslVersionRegisterTests(void); void DetectSslVersionFree(void *); @@ -92,8 +92,9 @@ void DetectSslVersionRegister(void) * \retval 0 no match * \retval 1 match */ -int DetectSslVersionMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Flow *f, uint8_t flags, void *state, Signature *s, SigMatch *m) +static int DetectSslVersionMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, + Flow *f, uint8_t flags, void *state, + const Signature *s, const SigMatch *m) { SCEnter(); diff --git a/src/detect-stream_size.c b/src/detect-stream_size.c index d27dcd2dda..529139d5c8 100644 --- a/src/detect-stream_size.c +++ b/src/detect-stream_size.c @@ -44,7 +44,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; /*prototypes*/ -int DetectStreamSizeMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); +static int DetectStreamSizeMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, + const Signature *, const SigMatchCtx *); static int DetectStreamSizeSetup (DetectEngineCtx *, Signature *, char *); void DetectStreamSizeFree(void *); void DetectStreamSizeRegisterTests(void); @@ -121,7 +122,8 @@ static int DetectStreamSizeCompare (uint32_t diff, uint32_t stream_size, uint8_t * \retval 0 no match * \retval 1 match */ -int DetectStreamSizeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectStreamSizeMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx) { int ret = 0; diff --git a/src/detect-tag.c b/src/detect-tag.c index dfa762d190..b844deb7ee 100644 --- a/src/detect-tag.c +++ b/src/detect-tag.c @@ -57,7 +57,8 @@ SC_ATOMIC_EXTERN(unsigned int, num_tags); static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectTagMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); +static int DetectTagMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, + const Signature *, const SigMatchCtx *); static int DetectTagSetup(DetectEngineCtx *, Signature *, char *); void DetectTagRegisterTests(void); void DetectTagDataFree(void *); @@ -88,7 +89,8 @@ void DetectTagRegister(void) * \retval 0 no match * \retval 1 match */ -int DetectTagMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectTagMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx) { const DetectTagData *td = (const DetectTagData *)ctx; DetectTagDataEntry tde; diff --git a/src/detect-template.c b/src/detect-template.c index b3ffb08e79..b3aff67bde 100644 --- a/src/detect-template.c +++ b/src/detect-template.c @@ -40,7 +40,7 @@ static pcre_extra *parse_regex_study; /* Prototypes of functions registered in DetectTemplateRegister below */ static int DetectTemplateMatch (ThreadVars *, DetectEngineThreadCtx *, - Packet *, Signature *, const SigMatchCtx *); + Packet *, const Signature *, const SigMatchCtx *); static int DetectTemplateSetup (DetectEngineCtx *, Signature *, char *); static void DetectTemplateFree (void *); static void DetectTemplateRegisterTests (void); @@ -84,7 +84,7 @@ void DetectTemplateRegister(void) { * \retval 1 match */ static int DetectTemplateMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, - Signature *s, const SigMatchCtx *ctx) + const Signature *s, const SigMatchCtx *ctx) { int ret = 0; const DetectTemplateData *templated = (const DetectTemplateData *) ctx; diff --git a/src/detect-threshold.c b/src/detect-threshold.c index 487de7685a..2cefc1896b 100644 --- a/src/detect-threshold.c +++ b/src/detect-threshold.c @@ -64,7 +64,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -static int DetectThresholdMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); +static int DetectThresholdMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, + const Signature *, const SigMatchCtx *); static int DetectThresholdSetup(DetectEngineCtx *, Signature *, char *); static void DetectThresholdFree(void *); @@ -87,7 +88,8 @@ void DetectThresholdRegister(void) DetectSetupParseRegexes(PARSE_REGEX, &parse_regex, &parse_regex_study); } -static int DetectThresholdMatch(ThreadVars *thv, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectThresholdMatch(ThreadVars *thv, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx) { return 1; } diff --git a/src/detect-tls-version.c b/src/detect-tls-version.c index 574ec7de4d..6482e91282 100644 --- a/src/detect-tls-version.c +++ b/src/detect-tls-version.c @@ -59,7 +59,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectTlsVersionMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, uint8_t, void *, Signature *, SigMatch *); +static int DetectTlsVersionMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, + uint8_t, void *, const Signature *, const SigMatch *); static int DetectTlsVersionSetup (DetectEngineCtx *, Signature *, char *); void DetectTlsVersionRegisterTests(void); void DetectTlsVersionFree(void *); @@ -92,7 +93,8 @@ void DetectTlsVersionRegister (void) * \retval 0 no match * \retval 1 match */ -int DetectTlsVersionMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, Signature *s, SigMatch *m) +static int DetectTlsVersionMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f, + uint8_t flags, void *state, const Signature *s, const SigMatch *m) { SCEnter(); diff --git a/src/detect-tls.c b/src/detect-tls.c index b199b1fa17..c97b5fd9f7 100644 --- a/src/detect-tls.c +++ b/src/detect-tls.c @@ -74,19 +74,19 @@ static pcre_extra *issuerdn_parse_regex_study; static pcre *fingerprint_parse_regex; static pcre_extra *fingerprint_parse_regex_study; -static int DetectTlsSubjectMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, uint8_t, void *, Signature *, SigMatch *); +static int DetectTlsSubjectMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, uint8_t, void *, const Signature *, const SigMatch *); static int DetectTlsSubjectSetup (DetectEngineCtx *, Signature *, char *); static void DetectTlsSubjectRegisterTests(void); static void DetectTlsSubjectFree(void *); -static int DetectTlsIssuerDNMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, uint8_t, void *, Signature *, SigMatch *); +static int DetectTlsIssuerDNMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, uint8_t, void *, const Signature *, const SigMatch *); static int DetectTlsIssuerDNSetup (DetectEngineCtx *, Signature *, char *); static void DetectTlsIssuerDNRegisterTests(void); static void DetectTlsIssuerDNFree(void *); -static int DetectTlsFingerprintMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, uint8_t, void *, Signature *, SigMatch *); +static int DetectTlsFingerprintMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, uint8_t, void *, const Signature *, const SigMatch *); static int DetectTlsFingerprintSetup (DetectEngineCtx *, Signature *, char *); static void DetectTlsFingerprintFree(void *); static int DetectTlsStoreSetup (DetectEngineCtx *, Signature *, char *); -static int DetectTlsStoreMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, uint8_t, void *, Signature *, SigMatch *); +static int DetectTlsStoreMatch (ThreadVars *, DetectEngineThreadCtx *, Flow *, uint8_t, void *, const Signature *, const SigMatch *); /** * \brief Registration function for keyword: tls.version @@ -149,7 +149,8 @@ void DetectTlsRegister (void) * \retval 0 no match * \retval 1 match */ -static int DetectTlsSubjectMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, Signature *s, SigMatch *m) +static int DetectTlsSubjectMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f, + uint8_t flags, void *state, const Signature *s, const SigMatch *m) { SCEnter(); @@ -359,7 +360,8 @@ static void DetectTlsSubjectRegisterTests(void) * \retval 0 no match * \retval 1 match */ -static int DetectTlsIssuerDNMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, Signature *s, SigMatch *m) +static int DetectTlsIssuerDNMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f, + uint8_t flags, void *state, const Signature *s, const SigMatch *m) { SCEnter(); @@ -641,7 +643,8 @@ error: * \retval 0 no match * \retval 1 match */ -static int DetectTlsFingerprintMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, Signature *s, SigMatch *m) +static int DetectTlsFingerprintMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f, + uint8_t flags, void *state, const Signature *s, const SigMatch *m) { SCEnter(); DetectTlsData *tls_data = (DetectTlsData *)m->ctx; @@ -793,7 +796,8 @@ error: } /** \warning modifies state */ -static int DetectTlsStoreMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, void *state, Signature *s, SigMatch *m) +static int DetectTlsStoreMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Flow *f, + uint8_t flags, void *state, const Signature *s, const SigMatch *m) { SCEnter(); diff --git a/src/detect-tos.c b/src/detect-tos.c index 9944546711..699d2474b1 100644 --- a/src/detect-tos.c +++ b/src/detect-tos.c @@ -50,7 +50,7 @@ static pcre_extra *parse_regex_study; static int DetectTosSetup(DetectEngineCtx *, Signature *, char *); static int DetectTosMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, - Signature *, const SigMatchCtx *); + const Signature *, const SigMatchCtx *); static void DetectTosRegisterTests(void); static void DetectTosFree(void *); @@ -82,8 +82,8 @@ void DetectTosRegister(void) * \retval 0 no match * \retval 1 match */ -int DetectTosMatch(ThreadVars *tv, DetectEngineThreadCtx *det_ctx, Packet *p, - Signature *s, const SigMatchCtx *ctx) +static int DetectTosMatch(ThreadVars *tv, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx) { const DetectTosData *tosd = (const DetectTosData *)ctx; int result = 0; diff --git a/src/detect-ttl.c b/src/detect-ttl.c index 1c1e0e5b31..9b71158645 100644 --- a/src/detect-ttl.c +++ b/src/detect-ttl.c @@ -43,7 +43,8 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; /*prototypes*/ -int DetectTtlMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); +static int DetectTtlMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, + const Signature *, const SigMatchCtx *); static int DetectTtlSetup (DetectEngineCtx *, Signature *, char *); void DetectTtlFree (void *); void DetectTtlRegisterTests (void); @@ -99,7 +100,8 @@ static inline int TtlMatch(const uint8_t pttl, const uint8_t mode, * \retval 0 no match * \retval 1 match */ -int DetectTtlMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectTtlMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx) { if (PKT_IS_PSEUDOPKT(p)) diff --git a/src/detect-window.c b/src/detect-window.c index c9a81920ea..4c44682544 100644 --- a/src/detect-window.c +++ b/src/detect-window.c @@ -47,8 +47,9 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectWindowMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); -int DetectWindowSetup(DetectEngineCtx *, Signature *, char *); +static int DetectWindowMatch(ThreadVars *, DetectEngineThreadCtx *, Packet *, + const Signature *, const SigMatchCtx *); +static int DetectWindowSetup(DetectEngineCtx *, Signature *, char *); void DetectWindowRegisterTests(void); void DetectWindowFree(void *); @@ -79,7 +80,8 @@ void DetectWindowRegister (void) * \retval 0 no match * \retval 1 match */ -int DetectWindowMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectWindowMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, + const Signature *s, const SigMatchCtx *ctx) { const DetectWindowData *wd = (const DetectWindowData *)ctx; @@ -102,7 +104,7 @@ int DetectWindowMatch(ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, * \retval wd pointer to DetectWindowData on success * \retval NULL on failure */ -DetectWindowData *DetectWindowParse(char *windowstr) +static DetectWindowData *DetectWindowParse(char *windowstr) { DetectWindowData *wd = NULL; #define MAX_SUBSTRINGS 30 @@ -169,7 +171,7 @@ error: * \retval 0 on Success * \retval -1 on Failure */ -int DetectWindowSetup (DetectEngineCtx *de_ctx, Signature *s, char *windowstr) +static int DetectWindowSetup (DetectEngineCtx *de_ctx, Signature *s, char *windowstr) { DetectWindowData *wd = NULL; SigMatch *sm = NULL; diff --git a/src/detect-xbits.c b/src/detect-xbits.c index 131e29e4a3..664f9451a3 100644 --- a/src/detect-xbits.c +++ b/src/detect-xbits.c @@ -57,7 +57,7 @@ static pcre *parse_regex; static pcre_extra *parse_regex_study; -int DetectXbitMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); +static int DetectXbitMatch (ThreadVars *, DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); static int DetectXbitSetup (DetectEngineCtx *, Signature *, char *); void DetectXbitFree (void *); void XBitsRegisterTests(void); @@ -161,7 +161,7 @@ static int DetectXbitMatchIPPair(Packet *p, const DetectXbitsData *xd) * -1: error */ -int DetectXbitMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, Signature *s, const SigMatchCtx *ctx) +static int DetectXbitMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, Packet *p, const Signature *s, const SigMatchCtx *ctx) { const DetectXbitsData *fd = (const DetectXbitsData *)ctx; if (fd == NULL) diff --git a/src/detect.c b/src/detect.c index 5660c28339..d998e8db0d 100644 --- a/src/detect.c +++ b/src/detect.c @@ -539,7 +539,7 @@ int SigLoadSignatures(DetectEngineCtx *de_ctx, char *sig_file, int sig_file_excl int SigMatchSignaturesRunPostMatch(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, Packet *p, - Signature *s) + const Signature *s) { /* run the packet match functions */ if (s->sm_arrays[DETECT_SM_LIST_POSTMATCH] != NULL) { @@ -1034,8 +1034,8 @@ int SigMatchSignatures(ThreadVars *th_v, DetectEngineCtx *de_ctx, DetectEngineTh int smatch = 0; /* signature match: 1, no match: 0 */ #endif uint8_t flow_flags = 0; /* flow/state flags */ - Signature *s = NULL; - Signature *next_s = NULL; + const Signature *s = NULL; + const Signature *next_s = NULL; uint8_t alversion = 0; int state_alert = 0; int alerts = 0; @@ -1791,7 +1791,7 @@ Signature *SigFindSignatureBySidGid(DetectEngineCtx *de_ctx, uint32_t sid, uint3 } -int SignatureIsAppLayer(DetectEngineCtx *de_ctx, Signature *s) +int SignatureIsAppLayer(DetectEngineCtx *de_ctx, const Signature *s) { if (s->alproto != 0) return 1; @@ -1807,7 +1807,7 @@ int SignatureIsAppLayer(DetectEngineCtx *de_ctx, Signature *s) * \retval 0 no * \retval 1 yes */ -int SignatureIsFilestoring(Signature *s) +int SignatureIsFilestoring(const Signature *s) { if (s == NULL) return 0; @@ -1826,7 +1826,7 @@ int SignatureIsFilestoring(Signature *s) * \retval 0 no * \retval 1 yes */ -int SignatureIsFilemagicInspecting(Signature *s) +int SignatureIsFilemagicInspecting(const Signature *s) { if (s == NULL) return 0; @@ -1845,7 +1845,7 @@ int SignatureIsFilemagicInspecting(Signature *s) * \retval 0 no * \retval 1 yes */ -int SignatureIsFileMd5Inspecting(Signature *s) +int SignatureIsFileMd5Inspecting(const Signature *s) { if ((s != NULL) && (s->file_flags & FILE_SIG_NEED_MD5)) return 1; @@ -1861,7 +1861,7 @@ int SignatureIsFileMd5Inspecting(Signature *s) * \retval 0 no * \retval 1 yes */ -int SignatureIsFileSha1Inspecting(Signature *s) +int SignatureIsFileSha1Inspecting(const Signature *s) { if ((s != NULL) && (s->file_flags & FILE_SIG_NEED_SHA1)) return 1; @@ -1877,7 +1877,7 @@ int SignatureIsFileSha1Inspecting(Signature *s) * \retval 0 no * \retval 1 yes */ -int SignatureIsFileSha256Inspecting(Signature *s) +int SignatureIsFileSha256Inspecting(const Signature *s) { if ((s != NULL) && (s->file_flags & FILE_SIG_NEED_SHA256)) return 1; @@ -1893,7 +1893,7 @@ int SignatureIsFileSha256Inspecting(Signature *s) * \retval 0 no * \retval 1 yes */ -int SignatureIsFilesizeInspecting(Signature *s) +int SignatureIsFilesizeInspecting(const Signature *s) { if (s == NULL) return 0; @@ -1910,7 +1910,7 @@ int SignatureIsFilesizeInspecting(Signature *s) * \retval 1 sig is ip only * \retval 0 sig is not ip only */ -int SignatureIsIPOnly(DetectEngineCtx *de_ctx, Signature *s) +int SignatureIsIPOnly(DetectEngineCtx *de_ctx, const Signature *s) { if (s->alproto != ALPROTO_UNKNOWN) return 0; @@ -2108,7 +2108,7 @@ static int SignatureIsPDOnly(const Signature *s) * \retval 1 sig is inspecting the payload * \retval 0 sig is not inspecting the payload */ -static int SignatureIsInspectingPayload(DetectEngineCtx *de_ctx, Signature *s) +static int SignatureIsInspectingPayload(DetectEngineCtx *de_ctx, const Signature *s) { if (s->sm_lists[DETECT_SM_LIST_PMATCH] != NULL) { @@ -2138,7 +2138,7 @@ static int SignatureIsInspectingPayload(DetectEngineCtx *de_ctx, Signature *s) * \retval 0 not a DEOnly sig * \retval 1 DEOnly sig */ -static int SignatureIsDEOnly(DetectEngineCtx *de_ctx, Signature *s) +static int SignatureIsDEOnly(DetectEngineCtx *de_ctx, const Signature *s) { if (s->alproto != ALPROTO_UNKNOWN) { SCReturnInt(0); diff --git a/src/detect.h b/src/detect.h index 30d95f014b..3040c4875a 100644 --- a/src/detect.h +++ b/src/detect.h @@ -393,7 +393,7 @@ typedef struct DetectEngineAppInspectionEngine_ { */ int (*Callback)(ThreadVars *tv, struct DetectEngineCtx_ *de_ctx, struct DetectEngineThreadCtx_ *det_ctx, - struct Signature_ *sig, Flow *f, uint8_t flags, void *alstate, + const struct Signature_ *sig, Flow *f, uint8_t flags, void *alstate, void *tx, uint64_t tx_id); struct DetectEngineAppInspectionEngine_ *next; @@ -958,10 +958,10 @@ typedef struct DetectEngineThreadCtx_ { */ typedef struct SigTableElmt_ { /** Packet match function pointer */ - int (*Match)(ThreadVars *, DetectEngineThreadCtx *, Packet *, Signature *, const SigMatchCtx *); + int (*Match)(ThreadVars *, DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *); /** AppLayer match function pointer */ - int (*AppLayerMatch)(ThreadVars *, DetectEngineThreadCtx *, Flow *, uint8_t flags, void *alstate, Signature *, SigMatch *); + int (*AppLayerMatch)(ThreadVars *, DetectEngineThreadCtx *, Flow *, uint8_t flags, void *alstate, const Signature *, const SigMatch *); /** AppLayer TX match function pointer */ int (*AppLayerTxMatch)(ThreadVars *, DetectEngineThreadCtx *, Flow *, @@ -972,7 +972,7 @@ typedef struct SigTableElmt_ { int (*FileMatch)(ThreadVars *, /**< thread local vars */ DetectEngineThreadCtx *, Flow *, /**< *LOCKED* flow */ - uint8_t flags, File *, Signature *, SigMatch *); + uint8_t flags, File *, const Signature *, const SigMatch *); /** keyword setup function pointer */ int (*Setup)(DetectEngineCtx *, Signature *, char *); @@ -1377,24 +1377,24 @@ void SigTableSetup(void); int SigMatchSignatures(ThreadVars *th_v, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, Packet *p); -int SignatureIsIPOnly(DetectEngineCtx *de_ctx, Signature *s); +int SignatureIsIPOnly(DetectEngineCtx *de_ctx, const Signature *s); SigGroupHead *SigMatchSignaturesGetSgh(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, Packet *p); Signature *DetectGetTagSignature(void); -int SignatureIsFilestoring(Signature *); -int SignatureIsFilemagicInspecting(Signature *); -int SignatureIsFileMd5Inspecting(Signature *); -int SignatureIsFileSha1Inspecting(Signature *s); -int SignatureIsFileSha256Inspecting(Signature *s); -int SignatureIsFilesizeInspecting(Signature *); +int SignatureIsFilestoring(const Signature *); +int SignatureIsFilemagicInspecting(const Signature *); +int SignatureIsFileMd5Inspecting(const Signature *); +int SignatureIsFileSha1Inspecting(const Signature *s); +int SignatureIsFileSha256Inspecting(const Signature *s); +int SignatureIsFilesizeInspecting(const Signature *); int DetectRegisterThreadCtxFuncs(DetectEngineCtx *, const char *name, void *(*InitFunc)(void *), void *data, void (*FreeFunc)(void *), int); void *DetectThreadCtxGetKeywordThreadCtx(DetectEngineThreadCtx *, int); int SigMatchSignaturesRunPostMatch(ThreadVars *tv, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, Packet *p, - Signature *s); + const Signature *s); void DetectSignatureApplyActions(Packet *p, const Signature *s); #endif /* __DETECT_H__ */ diff --git a/src/util-detect-file-hash.c b/src/util-detect-file-hash.c index 840f61c2bb..8bee60c423 100644 --- a/src/util-detect-file-hash.c +++ b/src/util-detect-file-hash.c @@ -147,7 +147,7 @@ static int HashMatchHashTable(ROHashTable *hash_table, uint8_t *hash, * \retval 1 match */ int DetectFileHashMatch (ThreadVars *t, DetectEngineThreadCtx *det_ctx, - Flow *f, uint8_t flags, File *file, Signature *s, SigMatch *m) + Flow *f, uint8_t flags, File *file, const Signature *s, const SigMatch *m) { SCEnter(); int ret = 0; diff --git a/src/util-detect-file-hash.h b/src/util-detect-file-hash.h index 0e9835bb4d..c247fb5aa3 100644 --- a/src/util-detect-file-hash.h +++ b/src/util-detect-file-hash.h @@ -38,7 +38,7 @@ int ReadHashString(uint8_t *, char *, char *, int, uint16_t); int LoadHashTable(ROHashTable *, char *, char *, int, uint32_t); int DetectFileHashMatch(ThreadVars *, DetectEngineThreadCtx *, Flow *, uint8_t, - File *, Signature *, SigMatch *); + File *, const Signature *, const SigMatch *); int DetectFileHashSetup(DetectEngineCtx *, Signature *, char *, uint32_t); void DetectFileHashFree(void *);