static pcre *parse_regex;
static pcre_extra *parse_regex_study;
-int byte_extract_max_local_id = 0;
-
int DetectByteExtractMatch(ThreadVars *, DetectEngineThreadCtx *,
Packet *, Signature *, SigMatch *);
int DetectByteExtractSetup(DetectEngineCtx *, Signature *, char *);
} else {
bed->local_id = ((DetectByteExtractData *)prev_bed_sm->ctx)->local_id + 1;
}
- if (bed->local_id > byte_extract_max_local_id)
- byte_extract_max_local_id = bed->local_id;
+ if (bed->local_id > de_ctx->byte_extract_max_local_id)
+ de_ctx->byte_extract_max_local_id = bed->local_id;
/* check bytetest modifiers against the signature alproto. In case they conflict
* chuck out invalid signature */
} DetectByteExtractData;
-/* the max local id used amongst all sigs */
-extern int byte_extract_max_local_id;
-
void DetectByteExtractRegister(void);
int DetectByteExtractSetup(DetectEngineCtx *, Signature *, char *);
void DetectByteExtractFree(void *);
/* this detection engine context belongs to this thread instance */
det_ctx->tv = tv;
- det_ctx->bj_values = SCMalloc(sizeof(*det_ctx->bj_values) * (byte_extract_max_local_id + 1));
+ det_ctx->bj_values = SCMalloc(sizeof(*det_ctx->bj_values) * de_ctx->byte_extract_max_local_id);
if (det_ctx->bj_values == NULL) {
return TM_ECODE_FAILED;
}
int32_t sgh_mpm_context_huad;
int32_t sgh_mpm_context_app_proto_detect;
+ /* the max local id used amongst all sigs */
+ int32_t byte_extract_max_local_id;
+
/** sgh for signatures that match against invalid packets. In those cases
* we can't lookup by proto, address, port as we don't have these */
struct SigGroupHead_ *decoder_event_sgh;