40static 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);
260static int IpOptsTestParse01 (
void)
274static int IpOptsTestParse02 (
void)
288static int IpOptsTestParse03 (
void)
296 memset(&ip4h, 0,
sizeof(
IPV4Hdr));
322static int IpOptsTestParse04 (
void)
330 memset(&ip4h, 0,
sizeof(
IPV4Hdr));
344 FAIL_IF(DetectIpOptsMatch(NULL, p, NULL, sm->
ctx));
356static int IpOptsTestParse05(
void)
361 de = DetectIpOptsParse(NULL);
370void IpOptsRegisterTests(
void)
#define IPV4_OPT_FLAG_LSRR
#define IPV4_OPT_FLAG_SEC
#define IPV4_OPT_FLAG_EOL
#define IPV4_OPT_FLAG_ESEC
#define IPV4_OPT_FLAG_SID
#define IPV4_OPT_FLAG_SSRR
#define IPV4_OPT_FLAG_NOP
#define PKT_IS_PSEUDOPKT(p)
return 1 if the packet is a pseudo packet
void DetectIpOptsRegister(void)
Registration function for ipopts: keyword.
void DetectIpOptsFree(DetectEngineCtx *, void *)
const char * IpOptsFlagToString(uint16_t flag)
Return human readable value for ipopts flag.
struct DetectIpOpts_ ipopts[]
SigMatch * SigMatchAlloc(void)
SigMatch * SCSigMatchAppendSMToList(DetectEngineCtx *de_ctx, Signature *s, uint16_t type, SigMatchCtx *ctx, const int list)
Append a SigMatch to the list type.
SigTableElmt * sigmatch_table
#define SIG_FLAG_REQUIRE_PACKET
#define FAIL_IF_NULL(expr)
Fail a test if expression evaluates to NULL.
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
#define FAIL_IF_NOT(expr)
Fail a test if expression evaluates to false.
#define PASS
Pass the test.
#define FAIL_IF(expr)
Fail a test if expression evaluates to true.
#define FAIL_IF_NOT_NULL(expr)
Fail a test if expression evaluates to non-NULL.
Packet * PacketGetFromAlloc(void)
Get a malloced packet.
main detection engine ctx
Used to start a pointer to SigMatch context Should never be dereferenced without casting to something...
a single match condition for a signature
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
void(* Free)(DetectEngineCtx *, void *)
void(* RegisterTests)(void)
int(* Match)(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *)
Per thread variable structure.
#define SCLogError(...)
Macro used to log ERROR messages.
void UTHSetIPV4Hdr(Packet *p, IPV4Hdr *ip4h)
#define DEBUG_VALIDATE_BUG_ON(exp)