Go to the documentation of this file.
41 #define PARSE_REGEX "\\S[A-z]"
49 static void IpOptsRegisterTests(
void);
198 pcre2_match_data *match = NULL;
201 SCLogError(
"pcre_exec parse error, ret %" PRId32
", string %s", ret, rawstr);
206 if((strcasecmp(
ipopts[i].ipopt_name,rawstr)) == 0) {
221 pcre2_match_data_free(match);
226 pcre2_match_data_free(match);
248 de = DetectIpOptsParse(rawstr);
290 static int IpOptsTestParse01 (
void)
304 static int IpOptsTestParse02 (
void)
318 static int IpOptsTestParse03 (
void)
326 memset(&ip4h, 0,
sizeof(
IPV4Hdr));
352 static int IpOptsTestParse04 (
void)
360 memset(&ip4h, 0,
sizeof(
IPV4Hdr));
374 FAIL_IF(DetectIpOptsMatch(NULL, p, NULL, sm->
ctx));
386 void IpOptsRegisterTests(
void)
#define FAIL_IF_NULL(expr)
Fail a test if expression evaluates to NULL.
void SigMatchAppendSMToList(Signature *s, SigMatch *new, const int list)
Append a SigMatch to the list type.
void(* Free)(DetectEngineCtx *, void *)
#define PKT_IS_PSEUDOPKT(p)
return 1 if the packet is a pseudo packet
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
main detection engine ctx
void DetectIpOptsRegister(void)
Registration function for ipopts: keyword.
int DetectParsePcreExec(DetectParseRegex *parse_regex, pcre2_match_data **match, const char *str, int start_offset, int options)
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
#define FAIL_IF_NOT(expr)
Fail a test if expression evaluates to false.
struct DetectIpOpts_ ipopts[]
#define FAIL_IF_NOT_NULL(expr)
Fail a test if expression evaluates to non-NULL.
const char * IpOptsFlagToString(uint16_t flag)
Return human readable value for ipopts flag.
#define PASS
Pass the test.
void DetectSetupParseRegexes(const char *parse_str, DetectParseRegex *detect_parse)
Per thread variable structure.
int(* Match)(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *)
SigMatch * SigMatchAlloc(void)
void DetectIpOptsFree(DetectEngineCtx *, void *)
Used to start a pointer to SigMatch context Should never be dereferenced without casting to something...
#define FAIL_IF(expr)
Fail a test if expression evaluates to true.
SigTableElmt sigmatch_table[DETECT_TBLSIZE]
Packet * PacketGetFromAlloc(void)
Get a malloced packet.
#define SCLogError(...)
Macro used to log ERROR messages.
a single match condition for a signature
void(* RegisterTests)(void)
#define SIG_FLAG_REQUIRE_PACKET