Go to the documentation of this file.
40 static void IpOptsRegisterTests(
void);
165 if (!
de || !PacketIsIPv4(p))
182 if (rawstr == NULL || strlen(rawstr) == 0)
188 if((strcasecmp(
ipopts[i].ipopt_name,rawstr)) == 0) {
195 SCLogError(
"unknown IP option specified \"%s\"", rawstr);
260 static int IpOptsTestParse01 (
void)
274 static int IpOptsTestParse02 (
void)
288 static int IpOptsTestParse03 (
void)
296 memset(&ip4h, 0,
sizeof(
IPV4Hdr));
322 static int IpOptsTestParse04 (
void)
330 memset(&ip4h, 0,
sizeof(
IPV4Hdr));
344 FAIL_IF(DetectIpOptsMatch(NULL, p, NULL, sm->
ctx));
356 static int IpOptsTestParse05(
void)
361 de = DetectIpOptsParse(NULL);
370 void IpOptsRegisterTests(
void)
#define IPV4_OPT_FLAG_NOP
#define FAIL_IF_NULL(expr)
Fail a test if expression evaluates to NULL.
SigTableElmt * sigmatch_table
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.
#define IPV4_OPT_FLAG_SSRR
void UTHSetIPV4Hdr(Packet *p, IPV4Hdr *ip4h)
main detection engine ctx
#define IPV4_OPT_FLAG_SEC
void DetectIpOptsRegister(void)
Registration function for ipopts: keyword.
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
#define IPV4_OPT_FLAG_ESEC
#define FAIL_IF_NOT(expr)
Fail a test if expression evaluates to false.
struct DetectIpOpts_ ipopts[]
#define IPV4_OPT_FLAG_LSRR
#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.
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.
Packet * PacketGetFromAlloc(void)
Get a malloced packet.
#define SCLogError(...)
Macro used to log ERROR messages.
#define IPV4_OPT_FLAG_EOL
a single match condition for a signature
#define IPV4_OPT_FLAG_SID
SigMatch * SigMatchAppendSMToList(DetectEngineCtx *de_ctx, Signature *s, uint16_t type, SigMatchCtx *ctx, const int list)
Append a SigMatch to the list type.
#define DEBUG_VALIDATE_BUG_ON(exp)
void(* RegisterTests)(void)
#define SIG_FLAG_REQUIRE_PACKET