47 #define PARSE_REGEX "\\S[0-9A-z_]+[.][A-z0-9_+.]+$"
61 static bool PrefilterEventIsPrefilterable(
const Signature *s,
int smtype)
65 if (sm->
type == smtype) {
71 static bool PrefilterStreamEventIsPrefilterable(
const Signature *s)
76 static bool PrefilterDecodeEventIsPrefilterable(
const Signature *s)
92 DetectUintData_u8 du8;
102 for (uint8_t u = 0; u < p->
events.
cnt; u++) {
105 PrefilterAddSids(&det_ctx->
pmq, sa->
sigs, sa->
cnt);
114 PrefilterPacketEventMatch);
121 PrefilterPacketEventMatch);
182 static bool OutdatedEvent(
const char *raw)
184 if (strcmp(raw,
"decoder.udp.hlen_invalid") == 0) {
202 int res = 0, found = 0;
204 pcre2_match_data *match = NULL;
208 SCLogError(
"pcre_exec parse error, ret %" PRId32
", string %s", ret, rawstr);
212 char copy_str[128] =
"";
213 pcre2len =
sizeof(copy_str);
214 res = pcre2_substring_copy_bynumber(match, 0, (PCRE2_UCHAR8 *)copy_str, &pcre2len);
217 SCLogError(
"pcre2_substring_copy_bynumber failed");
222 if (strcasecmp(
DEvents[i].event_name,copy_str) == 0) {
229 SCLogError(
"unknown decode event \"%s\"", copy_str);
243 if (OutdatedEvent(rawstr)) {
245 SCLogError(
"decode-event keyword no longer supports event \"%s\"", rawstr);
248 SCLogWarning(
"decode-event keyword no longer supports event \"%s\"", rawstr);
252 pcre2_match_data_free(match);
259 pcre2_match_data_free(match);
274 static int DetectEngineEventSetupDo(
316 char drawstr[64] =
"decoder.";
319 strlcat(drawstr, rawstr,
sizeof(drawstr));
329 char srawstr[64] =
"stream.";
331 if (strcmp(rawstr,
"est_synack_resend_with_different_ack") == 0) {
332 rawstr =
"est_synack_resend_with_diff_ack";
333 }
else if (strcmp(rawstr,
"3whs_synack_resend_with_different_ack") == 0) {
334 rawstr =
"3whs_synack_resend_with_diff_ack";
338 strlcat(srawstr, rawstr,
sizeof(srawstr));
351 static int EngineEventTestParse01 (
void)
357 DetectEngineEventFree(NULL,
de);
366 static int EngineEventTestParse02 (
void)
372 DetectEngineEventFree(NULL,
de);
380 static int EngineEventTestParse03 (
void)
386 DetectEngineEventFree(NULL,
de);
394 static int EngineEventTestParse04 (
void)
400 DetectEngineEventFree(NULL,
de);
408 static int EngineEventTestParse05 (
void)
414 DetectEngineEventFree(NULL,
de);
422 static int EngineEventTestParse06 (
void)