]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect: constify Signature/SigMatch use at runtime
authorVictor Julien <victor@inliniac.net>
Thu, 6 Oct 2016 08:49:14 +0000 (10:49 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 16 Feb 2017 09:35:36 +0000 (10:35 +0100)
120 files changed:
src/alert-unified2-alert.c
src/decode.h
src/detect-ack.c
src/detect-app-layer-event.c
src/detect-app-layer-protocol.c
src/detect-asn1.c
src/detect-base64-data.h
src/detect-base64-decode.c
src/detect-base64-decode.h
src/detect-bypass.c
src/detect-byte-extract.c
src/detect-byte-extract.h
src/detect-bytejump.c
src/detect-bytejump.h
src/detect-bytetest.c
src/detect-bytetest.h
src/detect-csum.c
src/detect-dce-iface.c
src/detect-dce-opnum.c
src/detect-detection-filter.c
src/detect-dnp3.c
src/detect-dsize.c
src/detect-engine-alert.c
src/detect-engine-alert.h
src/detect-engine-content-inspection.c
src/detect-engine-content-inspection.h
src/detect-engine-dcepayload.c
src/detect-engine-dcepayload.h
src/detect-engine-dns.c
src/detect-engine-dns.h
src/detect-engine-enip.c
src/detect-engine-enip.h
src/detect-engine-event.c
src/detect-engine-file.h
src/detect-engine-filedata-smtp.h
src/detect-engine-hcbd.h
src/detect-engine-hcd.c
src/detect-engine-hcd.h
src/detect-engine-hhd.c
src/detect-engine-hhd.h
src/detect-engine-hhhd.c
src/detect-engine-hhhd.h
src/detect-engine-hmd.c
src/detect-engine-hmd.h
src/detect-engine-hrhd.c
src/detect-engine-hrhd.h
src/detect-engine-hrhhd.c
src/detect-engine-hrhhd.h
src/detect-engine-hrud.c
src/detect-engine-hrud.h
src/detect-engine-hsbd.h
src/detect-engine-hscd.c
src/detect-engine-hscd.h
src/detect-engine-hsmd.c
src/detect-engine-hsmd.h
src/detect-engine-hua.c
src/detect-engine-hua.h
src/detect-engine-modbus.c
src/detect-engine-modbus.h
src/detect-engine-payload.c
src/detect-engine-payload.h
src/detect-engine-state.c
src/detect-engine-state.h
src/detect-engine-template.h
src/detect-engine-tls.c
src/detect-engine-tls.h
src/detect-engine-uri.h
src/detect-engine.c
src/detect-engine.h
src/detect-fileext.c
src/detect-filemagic.c
src/detect-filename.c
src/detect-filesize.c
src/detect-filestore.c
src/detect-filestore.h
src/detect-flags.c
src/detect-flow.c
src/detect-flowbits.c
src/detect-flowint.c
src/detect-flowvar.c
src/detect-fragbits.c
src/detect-fragoffset.c
src/detect-ftpbounce.c
src/detect-hostbits.c
src/detect-http-request-line.c
src/detect-http-response-line.c
src/detect-icmp-id.c
src/detect-icmp-seq.c
src/detect-icode.c
src/detect-id.c
src/detect-ipopts.c
src/detect-iprep.c
src/detect-itype.c
src/detect-lua.c
src/detect-lua.h
src/detect-mark.c
src/detect-pcre.c
src/detect-pcre.h
src/detect-pktvar.c
src/detect-rpc.c
src/detect-sameip.c
src/detect-seq.c
src/detect-ssh-proto-version.c
src/detect-ssh-software-version.c
src/detect-ssl-state.c
src/detect-ssl-version.c
src/detect-stream_size.c
src/detect-tag.c
src/detect-template.c
src/detect-threshold.c
src/detect-tls-version.c
src/detect-tls.c
src/detect-tos.c
src/detect-ttl.c
src/detect-window.c
src/detect-xbits.c
src/detect.c
src/detect.h
src/util-detect-file-hash.c
src/util-detect-file-hash.h

index b922fe8f5eeabd2da80728048912cb3da93df8d9..2628676fa64496265ccdd892f4848c7cd5621f0b 100644 (file)
@@ -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);
index dcf7e2e120f5e2a9736255015ebad3dc75b3709b..d11b1cf931ddfcc94e26c3aaaaaf04597e4825fa 100644 (file)
@@ -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;
 
index aaef98a964282bc0ccdd0cde22eb378fbe31f19e..79c33390dbba28c9fcf55349f091ecbef403cf08 100644 (file)
@@ -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;
 
index c237ecf4b282b75442940e9149f7eb6595391f9e..a7930dee85df8be86151eab1b7f254b11e061fb7 100644 (file)
 #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;
index 34c3be96026b514d3fa1a17e3e1f9db33e250b21..c28f5867b6e0f50fabc6c956d194b28190c922d4 100644 (file)
@@ -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();
 
index c9602bdb767e7469b92505ba8205d5256f76e557..5cb6e3bb9ee64c40b234246a901161a5c1da9010 100644 (file)
@@ -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;
 
index 12fa60de56e0bbc4dd23fd98f0ababe9c198bf3c..38bb93fc06915156b05fd46ae7ab69c30a4b30df 100644 (file)
@@ -20,6 +20,6 @@
 
 void DetectBase64DataRegister(void);
 int DetectBase64DataDoMatch(DetectEngineCtx *, DetectEngineThreadCtx *,
-    Signature *, Flow *);
+        const Signature *, Flow *);
 
 #endif /* __DETECT_BASE64_DATA_H__ */
index d0687780d43441537153f33f62c6ecdf088686b5..251a89f9cdfd3cfbd77e8bc3f0b0b95b72a6b615 100644 (file)
@@ -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;
index a1ce388f188ff5574074f2733d4a4b10525c14aa..e2f602313dadd94dddb908db71edeece829e28bc 100644 (file)
@@ -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__ */
index 9faaad13702d7b507578d5220568c9e1dc2147d7..dce7abe44ae047166b4c7ba9823bbece8ca14c75 100644 (file)
@@ -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);
 
index a4549a1d6d08deab34d8cfc8d79994913951b16a..7c1a50dd37889375aefd08e6d36077e35312d7fc 100644 (file)
@@ -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;
index 020494da0e5e2556654765a1a447ce0c737b1778..506b1eb773cecfdff1b575fed7ff9b4738ff114a 100644 (file)
@@ -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__ */
index cf89e9fca950318cd251b750f04d254a4f4f0e56..ebdd3c35f060262c03d87a92d8f99fbe3b161c7c 100644 (file)
@@ -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;
index 350514867c1ddf20f3a6a23ca4abceb2cff9325e..d88d8c82da14479a33d299ae430bb599926653ec 100644 (file)
@@ -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__ */
index 2eaddadb0fa715aae5c82e7e2e9cc77c3425d864..a6f08b642da6d423406f9ac580cc65c8aa5767b3 100644 (file)
@@ -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);
index 09d453fab6985671a8bce5cb486a1ca0c34164c5..261c30be7070e005410a6566826e360a44ce02fa 100644 (file)
@@ -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);
 
index badeebb512063d8f81371d287c400ab69d5eaaea..ab5ed748e84c8bba9a5af0eadb546b12e675cb97 100644 (file)
 #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;
 
index 10e79d399f64bb5765bc77d5d30fb41fca63e9bc..78c705ce35e9e1fb0ad52e4643e48a91cdb537b1 100644 (file)
@@ -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();
 
index 023e643b9f0b16d1992638024bbef66e2a33c089..e1435fba1eaa033281f4a855510bbea9aa9a5d3f 100644 (file)
@@ -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();
 
index e69d66fada3dbb6faf276a8dd598a46498384b82..56a5fad783c99249aba5b19021cb2383c74d8794 100644 (file)
@@ -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;
 }
index 3baf124f58b887c5b2975a34f6953af9d3ad8cf0..1a515905bb80e19c171b6524c987f90d0a1c9067 100644 (file)
@@ -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,
index 548ac3ced34f5a4c4f72a6ab814be4963a690df9..f07d812204ecd3a01255a9304883043626557bf8 100644 (file)
@@ -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;
index 21047a0df5cb93802eafca072802d759959c38d2..8bfd719f75add09163ac30ed7dad5addae5c31cd 100644 (file)
@@ -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;
 
index 6f200b268d4e82e7f1f783b4ef163d485e73896f..dc6687885cc068e2ad52089678b191146a4cf8d7 100644 (file)
@@ -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);
index af1b10346220883ceced7a27a33b05c826ae9e4c..95f4fc7fdb437fde436832e63250d9aee988c605 100644 (file)
@@ -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,
index 91b62d6c6b89989cacdd01e15114427837816aca..8ae5d76a458c173e0eb96e54c4af811b8580a346 100644 (file)
@@ -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,
index 5cdb10d35f2c252f5de3031c9e892a21d88160c6..c856408135b08d8fa781cd3e341ed95443e17e72 100644 (file)
@@ -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();
index ccc4794ba30338ad205ccf1b0818dba7fc18454c..da7dfb92996e22fbd9b3754707fe3212549808ac 100644 (file)
@@ -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);
 
index 0dac77734fbdca6a8195b9ec2f52236bea6e2059..b9a4ce39fa50770f11382f65dc1d6777f0e4282e 100644 (file)
@@ -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,
index 5b2367a6601051c7d197a59fe48d9b60ea27b346..56ebea25899ca56bd3ea0a4de1b5014e77f277aa 100644 (file)
 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__ */
index 2facecc08410886285f994f493c742fa171577c9..8160d0bae5d88b06dbe250a58dc6e15159b9338f 100644 (file)
@@ -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();
index 1d701d414d5a3239e1e031629e5965f0da813b3e..9e0e719d850b9b600d37f0ee0aa09b911ae7a798 100644 (file)
 #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);
index ebfe865acc1a2fdfc6ce5cc319652f0d8420b877..06fcfe1086d9e74f451a5d962ba739136a1e9d06 100644 (file)
@@ -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();
 
index 365ed8a99fb7bddc8625227b46f0a43db2c36420..4934ed0a2cbfec750b6c751439355e3c5f0dffad 100644 (file)
 
 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);
 
index f4f45af0df7a1089af14f547efd2431bc736f892..d659e22241628dcaffcc656ee10950e1115c6858 100644 (file)
@@ -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);
index 4ed0b5088590d877c248a7eb51134902f9f451cd..c990bb083dc90a863d4f12929af0cb7119fb2d7f 100644 (file)
@@ -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 *);
index 63ed33fe9391e40da9ae1e521f8545383570b4d3..4be2ba6903f7718566f9a535955bd90683b72bc3 100644 (file)
@@ -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)
 {
index f5c23514d867d340c887c0c3c004c3f64ff1dce2..9ed0e6c1d758033900415a0b1d0afc251bc77bf1 100644 (file)
@@ -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);
 
index c4146169cc5b2105ae316693f56fcf8b42aa4c58..41cb22d1ffb9f48a449f44c94081097023332f32 100644 (file)
@@ -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)
 {
index 9826dcda5ab22b951df5acdc04f3593339503bb5..e0da35b186cd8ec7abd7c22730dafe0a70a91c63 100644 (file)
@@ -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);
index b761a1fe6c43976e223f779f40db0417b0128ad0..5c53ef7097da505cf38cd337cc4e0d6ccffd05ed 100644 (file)
@@ -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)
 {
index dab5080d42f4d7446cf736f7ba46ecd98dfb1c1d..932a38f6d4f6d0ce68a3c7802fb44eb371382220 100644 (file)
@@ -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);
 
index 23b964cf984e5a58dbd3a889a4152d8ae7c2a1da..31df7e24ae9875f07aba2c3a6878b2f466e965c9 100644 (file)
@@ -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)
 {
index e2be754be4bcbfc3fe09e09b47b663b993d8b3ce..cf40eeba617cb0b89c886ceb24a58ebb9a3a48c2 100644 (file)
@@ -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);
 
index 3181d45bf313972a35fa0863897d77bce4e20bcb..526c6b1424ced47a7f7315d7a57336d8a6eee648 100644 (file)
@@ -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)
 {
index 6d043f3cf040e29397c32748474762f4047a09b2..99c379b225bdbca43f8737f80ed84e02f5ff50fe 100644 (file)
@@ -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);
index 02db16fe1a6faa6aaca0cfc91ad14197a4801b72..d6b265235de429efc8b35e7bc7bf11b33605130e 100644 (file)
@@ -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)
 {
index 9fd427247d2695bf6b719bc949a5f254427c4665..30aec3b8c702d860603e02d71e71b6c8a3121f08 100644 (file)
@@ -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);
 
index 4957f3292fee73520bc6b0b88a953f59fb1ca2d5..876dcc5e806e1d038864ce7d2039fadea1fe2688 100644 (file)
@@ -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)
 {
index 9418b077ca2f5c9dc98c53f84c57aa30b8fabd3f..4b7933badcf532ddb2f6090a1beb64e42035bb7e 100644 (file)
@@ -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);
index edb8d17d91cc601067c31f2a7636cecc3cf4b399..0512ba46615e6ab9e1727f62ef3e5bd7b5551bf0 100644 (file)
@@ -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);
index e8e94822d02f1b6d856377387e4b073089c12593..e9354a91b882552ef512d598020c9ac3d404c195 100644 (file)
@@ -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)
 {
index 73977eccec371734bbeb8cde41de5b6e3db8d25b..390abf5b9b04e5e5a5ac19cd1ab8218637971d3a 100644 (file)
@@ -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);
index 68811eea7ba996553f7567e6e71b60b9c6b75f53..4bee372dbc0e98197779f1b2f2d418781103e6b3 100644 (file)
@@ -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)
 {
index 2feddd3bdcd37f98a893c2ef28660f5472921813..075d34d7132e3a77b3f30698da2dc238224768e2 100644 (file)
@@ -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);
index 66c8859cb2e91db895e7931e00ad7ab83602fc0e..1cc2a394189e390c8d8d13f0f1ac19603e334798 100644 (file)
@@ -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)
 {
index eceddf97b137aa5864dd02f432ceb3857ffe9015..499539ee92b4c9e21662f6ba53b12671313c82ad 100644 (file)
@@ -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);
 
index 976e7d901f276c6edf75cacdd1debdf7cf8e8250..e08cde10d7ceeb372eb703902de9365536777f9c 100644 (file)
@@ -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,
index e140f975a5ec9b74e790f6c2b520d6706c682eda..ae0935c977a8696b4c1f3a2c33fc7cdd55f07def 100644 (file)
@@ -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);
index 70351e9aa4dcc4225a7024127f9cb9170b2ecc35..6cdb775adb2e19a83b290b89669553d8bb4e2c58 100644 (file)
@@ -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();
index 67d0be24656aa89a84dac5954a18545bfbfb4e6f..205f8523f494df2af5f1bfc78d7b90b7ed1a9fda 100644 (file)
@@ -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);
index 46ff40c825f9d58c77287b1b7ff566f313f6014e..fe7335a35e9737717235147eb66f43cd64b72ac9 100644 (file)
@@ -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);
 
index af4f87247e9a3d5bde8d206bb4be4a4fe562af8c..d61faa5b2c00ee693bbda466dd26452eb3cc80ca 100644 (file)
@@ -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);
 
 /**
index 98a17bf63d3fe77b8c1bc8bf51e6acd80e6a155a..e1f39065bdb2f2d0a9fa79358df6d8f95af19f2f 100644 (file)
@@ -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__ */
index 98eeab60e19bec742081b61593908c59438309ac..e3e7881e02108c7098013720d42ab7a021a4cf7c 100644 (file)
@@ -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)
 {
index 56bb63172df2d01c080f3faa247846999492eda2..e35281caf31e2448863c2538375c158ce77c9f59 100644 (file)
@@ -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__ */
index d5ba12298da540235de50746b054d0195735bdea..bc5933aa0d5497b7b4aff8e117f38cb621e0d451 100644 (file)
@@ -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);
index 05fe1a0f7648042a39cebb6114978d3517476647..06893021b854837666b84b5fff5a4619fae478c1 100644 (file)
@@ -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))
 {
index 608f0685d8077b9857fb8190dec0219bddb1c2f0..498dd22d8a417d553b1186aad097e0e9b7ce9fc6 100644 (file)
@@ -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));
 
index 568c97802ab38d8da52838d9c91cd78dd5e4f990..fc052e07691889d8f547c683d6870012e58d5f95 100644 (file)
@@ -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;
index 2c2c46f676f622d954a33be266a1b5103a628ab1..a64e1d180bb000f61373738a461de0f8956c09ee 100644 (file)
@@ -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;
index 35b27d17b45a98afb4468fa02265192ecb2a66a7..34722fb77f44ccbb75022ed4f09ba732f6de4b4e 100644 (file)
@@ -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;
index 12b4c18f25c5ad65ea8e8af2d8d5bffe49215012..b26c7a8fc66f55cf05e52d73e1b633bb597fcab3 100644 (file)
@@ -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();
 
index ab096573fd7d0ee2828fbfa0a534053b215d7fd4..4104fc694d478294616602cab3910fdf94485d93 100644 (file)
@@ -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;
 
index 1879b87532e2ee473e9865b1d153ddbf5aadc916..09d2e25f18dae48e01012980279c60568cb22b9f 100644 (file)
@@ -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__ */
index 28e01d1bfa220d7acd7fc955a66d275a82ec391a..be4232856b485610c6bc91db81e26f6759acc772 100644 (file)
@@ -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();
 
index 376944f678860d5f9e4be17f4fd0338436153459..a1d77ea17ffa35c1fd002f86bcdf911e3bfe5c74 100644 (file)
@@ -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();
 
index 9b1af1781124ea9cfbfe901b8172f3f5320b4876..41b249efebd500387e24bd46563bfdf80fdcb978 100644 (file)
@@ -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)
index 8b0389ef96177385d185742e1007128a4c41a5cd..6ceb7ca39e7f6757f2ad39e45d41df46902e8b03 100644 (file)
@@ -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;
index e662ad17abc55d0f39b625842c2cae80c97d5dbf..46741016b6969c367338fcc2151897e7f9172edc 100644 (file)
 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;
index 5c0e014ab76cb071d1fa07c1363cc02193acdf82..0677b5b7b402f10bcc6a8c5865ba323606d96c16 100644 (file)
@@ -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;
index aa43ced0a57b85a6e2ba7778b98947dca162ec12..ea65f860c64015d64d5f2959315308f2a5583687 100644 (file)
@@ -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;
index e6015a16c0122010b803360c2b802613d8cb601a..4c067d7d63d7a037d6dfcdfc68db9d1a29b879ee 100644 (file)
 #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;
index 229d7ada1ab8f837d4b350a0d36b29cbfd6479dc..e2fa800c6f68f192d13dfb0dbf260d358e125ebb 100644 (file)
@@ -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)
index 4d9cf2795dbaf4cb903968f437943a864e912d4b..6e316f568f84d6005f54cf4af4ded07c0d3a1609 100644 (file)
@@ -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)
 {
index 8887ce979ae740a16bf6a03d26eeb03bdf8edb16..606c740746886c896ae6c944c77e59eedea9378c 100644 (file)
@@ -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)
 {
index 22acfb3356b3e016d481b0fbf7054cdb29f6e8fc..147a86695e01786de13810b4f38a56d46d83202b 100644 (file)
@@ -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;
 
index 9ddd4e6b36cdf4f8059a1812da647ed24480e1a7..1cd6971dee5a42c5011dcc659e9fbfc990ffcb9b 100644 (file)
@@ -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;
 
index 8468c3aff67e5868cb3fcd69d6a300eba5455c25..f6a01ad9aa7afbdd7858a81eeb462181456b26da 100644 (file)
@@ -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;
index de2e21dd619488b28e3acba3a748f22b21b0a22e..8b6d4df75fdc8b1f4842e624ec7f94f45483cec7 100644 (file)
@@ -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;
 
index 21e8a4aa52debc21a1b8f9e5807cfa32af4f2559..33addb855b3b2a63626ee9c018238c78f7d4455c 100644 (file)
@@ -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;
 
index 10da976a86a8537af2fb2be9e765da0bee5c3298..7b0dfb78b6a76bfcf2c62d3e6338a2b4ed4cb696 100644 (file)
@@ -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)
index 35b962d53fa13b737dde3efab681c3e8f7e0f2b5..3d3a0e38960694dacc3ea88ae1090a8ab8e14ea9 100644 (file)
@@ -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;
index b3a8222b1e59ec747fb444d9c8b173d414376ab1..27351bfe4a30ae6410ea9888eb236494ea49cb94 100644 (file)
@@ -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);
 }
index d1259b3e66a4c784c22a20e1c7baaadc2fe31d07..18298aa20359e798ed6dd7a032b6f042ed2c36c3 100644 (file)
@@ -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);
 
index 83fa09690ab421d4f6c31fe293bcd10803978fed..de04203ce8818397bba5dccc0a733811f54264e2 100644 (file)
@@ -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;
index c43981ff6ab8a026be24c5f53eecdf5ffad51963..b8430149158fd1243b661270354a5e1f43c90075 100644 (file)
@@ -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();
index e0098cb1c024226705d4ce902f69e2a56eeeef18..52e6394b595e5b196284d5f95c0dea2bd3874971 100644 (file)
@@ -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);
index d319bd8882cfad61fe28a568a1016fee8aae98ad..930ceeeeaf748822f8021b63e3f0020148a29170 100644 (file)
@@ -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;
index b3052ce547b4af63b6651160f9531aff808568d5..b559ad6f07eb53c17e883597794c7da6e11362ae 100644 (file)
@@ -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;
index e22a943f384efbc1e304a15c59f5e417561d25ba..780832b8fef40d384c9d72dff278d4026968c22b 100644 (file)
@@ -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;
 }
index cb2bb9930f169be003ecf402954b0e7bd36530e3..f747d40a59e7276ab938fa06f33178d0e5a074f2 100644 (file)
@@ -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;
 
index 3df3dfe0b48d20ebf11d1093c2e4e2d9f693c696..f22cfe386f12d79eaf6265f0f92a7e21efad3ba8 100644 (file)
@@ -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();
 
index 1284bbc37e6e540ddcdfa7ef9cec3bcb1913871d..7a24703b980a5ca008efd18b9c8155b3463418d0 100644 (file)
@@ -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();
 
index a46d55c5405c66a1b896cc1f8966450ac82ac047..6be0204ebc42dd9f887f2dc4a5fab9e2b7d66a5e 100644 (file)
@@ -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;
index 52a5d4b72aff757483947efcd374b87e4a1c9ce9..a699b10926ff2dc8d933ece48b94754c80c6be0a 100644 (file)
@@ -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();
 
index d27dcd2dda518e2b55b43c0512006c3dc8b8b367..529139d5c83d0df899057255060ba46e8d7a9e61 100644 (file)
@@ -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;
index dfa762d190bb5f71f01cf51b6b405c99630721cb..b844deb7eefd0eb4560527c866627b50e5068a3b 100644 (file)
@@ -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;
index b3ffb08e79415e876eed34f3c4086fc6369886fe..b3aff67bde3e70c035e6eeb50f46a8644cede047 100644 (file)
@@ -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;
index 487de7685ad612424a1dee7c4e326fef6e11d327..2cefc1896bbded80e33edea0f674397e10eb6acb 100644 (file)
@@ -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;
 }
index 574ec7de4d71ecd1d9b8b702dfd14e68663bd22d..6482e9128224fe46ec456e24887b186a7c77cc6d 100644 (file)
@@ -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();
 
index b199b1fa175e34b63b9b66f0e974e989128644b1..c97b5fd9f7bd06c5e8e5d600fae522faa48407bc 100644 (file)
@@ -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();
 
index 9944546711718548cee8e9405ebee3213da46303..699d2474b11a7bf0ce8ed87031f0e80b59424e84 100644 (file)
@@ -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;
index 1c1e0e5b31886f9415245a2660ba68c9af71a818..9b711586455473624826a8844b0e3f808faf4cc9 100644 (file)
@@ -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))
index c9a81920eae3e7a04d06eb0741eaea7bcb87ce45..4c4468254412850f72830d8783bd165ce8b74f75 100644 (file)
@@ -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;
index 131e29e4a32f8d6c349f914c045aa668a2e7ec48..664f9451a3d15f669f0f6958659599a3673f81f6 100644 (file)
@@ -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)
index 5660c28339a2c16420aa9207459a61355ee81d42..d998e8db0d84a4d731977ba1b7e9221103284655 100644 (file)
@@ -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);
index 30d95f014be506e763f646d065dc67b6084ce242..3040c4875a1780b85f9caefa2f0b6c122e6a6bda 100644 (file)
@@ -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__ */
index 840f61c2bbbd2187d398042c3b4e5d5670840bf6..8bee60c42308d64d002c1b543254b5fa2e7e7698 100644 (file)
@@ -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;
index 0e9835bb4d786667a21b6631688707858e0f1698..c247fb5aa38720849039d225855bd7cb05b4946b 100644 (file)
@@ -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 *);