Go to the documentation of this file.
37 #define PARSE_REGEX "^\\s*(src_ip|dest_ip)\\s*$"
44 static void DetectTargetRegisterTests (
void);
82 static int DetectTargetParse(
Signature *s,
const char *targetstr)
94 pcre2len =
sizeof(value);
95 res = pcre2_substring_copy_bynumber(parse_regex.
match, 1, (PCRE2_UCHAR8 *)value, &pcre2len);
102 if (!strcmp(value,
"src_ip")) {
105 "Conflicting values of target keyword");
109 }
else if (!strcmp(value,
"dest_ip")) {
112 "Conflicting values of target keyword");
136 int ret = DetectTargetParse(s, targetstr);
145 static int DetectTargetSignatureTest01(
void)
160 static void DetectTargetRegisterTests(
void)
163 DetectTargetSignatureTest01);
#define FAIL_IF_NULL(expr)
Fail a test if expression evaluates to NULL.
int DetectParsePcreExec(DetectParseRegex *parse_regex, const char *str, int start_offset, int options)
void(* Free)(DetectEngineCtx *, void *)
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
#define SIG_FLAG_DEST_IS_TARGET
main detection engine ctx
void DetectEngineCtxFree(DetectEngineCtx *)
Free a DetectEngineCtx::
@ SC_ERR_PCRE_GET_SUBSTRING
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
void DetectTargetRegister(void)
Registration function for target keyword.
#define PASS
Pass the test.
void DetectSetupParseRegexes(const char *parse_str, DetectParseRegex *detect_parse)
#define PARSE_REGEX
Regex for parsing our keyword options.
#define SIG_FLAG_SRC_IS_TARGET
int(* Match)(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *)
Signature * DetectEngineAppendSig(DetectEngineCtx *de_ctx, const char *sigstr)
Parse and append a Signature into the Detection Engine Context signature list.
SigTableElmt sigmatch_table[DETECT_TBLSIZE]
#define SCLogError(err_code,...)
Macro used to log ERROR messages.
DetectEngineCtx * DetectEngineCtxInit(void)
void(* RegisterTests)(void)
@ SC_ERR_CONFLICTING_RULE_KEYWORDS