Go to the documentation of this file.
38 #define PARSE_REGEX "^\\s*([0-9]+)?\\s*,s*([0-9]+)?\\s*$"
99 if (PacketIsIPv4(p)) {
101 }
else if (PacketIsIPv6(p)) {
133 pcre2_match_data *match = NULL;
136 SCLogError(
"parse error, ret %" PRId32
"", ret);
140 size_t pcre2len =
sizeof(arg1);
141 ret = pcre2_substring_copy_bynumber(match, 1, (PCRE2_UCHAR8 *)arg1, &pcre2len);
143 SCLogError(
"pcre2_substring_copy_bynumber failed");
148 pcre2len =
sizeof(arg2);
149 ret = pcre2_substring_copy_bynumber(match, 2, (PCRE2_UCHAR8 *)arg2, &pcre2len);
151 SCLogError(
"pcre2_substring_copy_bynumber failed");
168 pcre2_match_data_free(match);
173 pcre2_match_data_free(match);
192 if (templated == NULL)
197 DetectTemplateFree(
de_ctx, templated);
void DetectTemplateRegister(void)
Registration function for template: keyword.
SigTableElmt * sigmatch_table
void(* Free)(DetectEngineCtx *, void *)
#define PKT_IS_PSEUDOPKT(p)
return 1 if the packet is a pseudo packet
main detection engine ctx
int DetectParsePcreExec(DetectParseRegex *parse_regex, pcre2_match_data **match, const char *str, int start_offset, int options)
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
void DetectSetupParseRegexes(const char *parse_str, DetectParseRegex *detect_parse)
int(* Match)(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *)
Used to start a pointer to SigMatch context Should never be dereferenced without casting to something...
int ByteExtractStringUint8(uint8_t *res, int base, size_t len, const char *str)
#define PARSE_REGEX
Regex for parsing our keyword options.
#define SCLogError(...)
Macro used to log ERROR messages.
SigMatch * SigMatchAppendSMToList(DetectEngineCtx *de_ctx, Signature *s, uint16_t type, SigMatchCtx *ctx, const int list)
Append a SigMatch to the list type.
void DetectTemplateRegisterTests(void)
this function registers unit tests for DetectTemplate
void(* RegisterTests)(void)
#define SIG_FLAG_REQUIRE_PACKET