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);
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);
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);
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);
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);
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;
/* 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);
* \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;
#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);
/**
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)
{
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;
}
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;
static int DetectAppLayerProtocolPacketMatch(ThreadVars *tv,
DetectEngineThreadCtx *det_ctx,
- Packet *p, Signature *s, const SigMatchCtx *ctx)
+ Packet *p, const Signature *s, const SigMatchCtx *ctx)
{
SCEnter();
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 *);
* \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;
void DetectBase64DataRegister(void);
int DetectBase64DataDoMatch(DetectEngineCtx *, DetectEngineThreadCtx *,
- Signature *, Flow *);
+ const Signature *, Flow *);
#endif /* __DETECT_BASE64_DATA_H__ */
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;
} 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__ */
#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);
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);
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 *);
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)
{
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;
}
*
* \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;
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__ */
* \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)
{
}
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;
* 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__ */
* \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();
}
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);
* \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);
#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 *);
*
* \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;
*
* \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;
*
* \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;
*
* \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;
*
* \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;
*
* \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;
*
* \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;
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 *);
* \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();
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 *);
* \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();
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 *);
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;
}
}
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();
}
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,
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 *);
* \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;
* \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;
#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);
* \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,
};
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,
* \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();
#define __DETECT_ENGINE_DCEPAYLOAD_H__
int DetectEngineInspectDcePayload(DetectEngineCtx *, DetectEngineThreadCtx *,
- Signature *, Flow *, uint8_t, void *);
+ const Signature *, Flow *, uint8_t, void *);
void DcePayloadRegisterTests(void);
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;
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,
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,
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__ */
* \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();
*/
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();
#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);
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 *);
* \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();
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);
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);
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 *);
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)
{
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);
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)
{
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);
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)
{
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);
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)
{
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);
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)
{
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);
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)
{
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);
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)
{
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);
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);
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)
{
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);
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)
{
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);
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)
{
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);
int DetectEngineInspectModbus(ThreadVars *tv,
DetectEngineCtx *de_ctx,
DetectEngineThreadCtx *det_ctx,
- Signature *s,
+ const Signature *s,
Flow *f,
uint8_t flags,
void *alstate,
#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);
* 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();
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);
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;
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;
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) {
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)) {
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;
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);
/* FLOW BASED (AMATCH) */
typedef struct DeStateStoreFlowRule_ {
- SigMatch *nm;
+ const SigMatch *nm;
uint32_t flags;
SigIntId sid;
} DeStateStoreFlowRule;
*/
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);
/**
#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__ */
* \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)
{
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__ */
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);
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))
{
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));
#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 *);
* \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;
#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 *);
* \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;
#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 *);
* \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;
/*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);
* \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();
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);
* 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;
* 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;
/* 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__ */
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 *);
* \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();
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 *);
* \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();
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);
* -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)
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);
* 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;
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)
* -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;
*/
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;
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 *);
* \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;
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 *);
* \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;
#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 *);
*
* \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();
* \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;
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);
* -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)
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);
/**
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)
{
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);
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)
{
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 *);
* \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;
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 *);
* \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;
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 *);
* \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;
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 *);
* \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;
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 *);
* \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;
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);
* 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)
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 *);
* \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;
#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,
}
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)
{
* \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;
* \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);
}
/* 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);
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);
/**
}
-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;
* \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();
} 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);
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)
* -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;
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 *);
* \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;
#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);
* \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;
}
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);
* \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;
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 *);
* \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();
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 *);
* \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();
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 *);
* \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;
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 *);
* \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();
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);
* \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;
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 *);
* \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;
/* 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);
* \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;
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 *);
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;
}
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 *);
* \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();
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
* \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();
* \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();
* \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;
}
/** \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();
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 *);
* \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;
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);
* \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))
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 *);
* \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;
* \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
* \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;
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);
* -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)
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) {
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;
}
-int SignatureIsAppLayer(DetectEngineCtx *de_ctx, Signature *s)
+int SignatureIsAppLayer(DetectEngineCtx *de_ctx, const Signature *s)
{
if (s->alproto != 0)
return 1;
* \retval 0 no
* \retval 1 yes
*/
-int SignatureIsFilestoring(Signature *s)
+int SignatureIsFilestoring(const Signature *s)
{
if (s == NULL)
return 0;
* \retval 0 no
* \retval 1 yes
*/
-int SignatureIsFilemagicInspecting(Signature *s)
+int SignatureIsFilemagicInspecting(const Signature *s)
{
if (s == NULL)
return 0;
* \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;
* \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;
* \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;
* \retval 0 no
* \retval 1 yes
*/
-int SignatureIsFilesizeInspecting(Signature *s)
+int SignatureIsFilesizeInspecting(const Signature *s)
{
if (s == NULL)
return 0;
* \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;
* \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) {
* \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);
*/
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;
*/
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 *,
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 *);
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__ */
* \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;
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 *);