Go to the documentation of this file.
41 #define PARSE_REGEX "\\S[A-z]"
49 static void IpOptsRegisterTests(
void);
163 int ret = 0, found = 0;
167 SCLogError(
"pcre_exec parse error, ret %" PRId32
", string %s", ret, rawstr);
172 if((strcasecmp(
ipopts[i].ipopt_name,rawstr)) == 0) {
210 de = DetectIpOptsParse(rawstr);
252 static int IpOptsTestParse01 (
void)
266 static int IpOptsTestParse02 (
void)
280 static int IpOptsTestParse03 (
void)
288 memset(&ip4h, 0,
sizeof(
IPV4Hdr));
314 static int IpOptsTestParse04 (
void)
322 memset(&ip4h, 0,
sizeof(
IPV4Hdr));
336 FAIL_IF(DetectIpOptsMatch(NULL, p, NULL, sm->
ctx));
348 void IpOptsRegisterTests(
void)
#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 *)
#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(* 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.
#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 SigMatchAppendSMToList(Signature *s, SigMatch *new, int list)
Append a SigMatch to the list type.
void(* RegisterTests)(void)
#define SIG_FLAG_REQUIRE_PACKET