Go to the documentation of this file.
47 static void DetectITypeRegisterTests(
void);
52 static bool PrefilterITypeIsPrefilterable(
const Signature *s);
90 if (PacketIsICMPv4(p)) {
92 }
else if (PacketIsICMPv6(p)) {
93 const ICMPV6Hdr *icmpv6h = PacketGetICMPv6(p);
141 rs_detect_u8_free(itd);
151 Packet *p,
const void *pectx)
156 if (PacketIsICMPv4(p)) {
158 }
else if (PacketIsICMPv6(p)) {
159 const ICMPV6Hdr *icmpv6h = PacketGetICMPv6(p);
169 PrefilterAddSids(&det_ctx->
pmq, sa->
sigs, sa->
cnt);
179 static bool PrefilterITypeIsPrefilterable(
const Signature *s)
199 static int DetectITypeParseTest01(
void)
215 static int DetectITypeParseTest02(
void)
231 static int DetectITypeParseTest03(
void)
247 static int DetectITypeParseTest04(
void)
264 static int DetectITypeParseTest05(
void)
280 static int DetectITypeParseTest06(
void)
296 static int DetectITypeParseTest07(
void)
312 static int DetectITypeParseTest08(
void)
324 void DetectITypeRegisterTests(
void)
void DetectITypeRegister(void)
Registration function for itype: keyword.
void DetectITypeFree(DetectEngineCtx *, void *)
this function will free memory associated with DetectU8Data
#define FAIL_IF_NULL(expr)
Fail a test if expression evaluates to NULL.
#define SIG_MASK_REQUIRE_REAL_PKT
struct SigMatch_ * smlists[DETECT_SM_LIST_MAX]
SigTableElmt * sigmatch_table
void(* Free)(DetectEngineCtx *, void *)
#define PKT_IS_PSEUDOPKT(p)
return 1 if the packet is a pseudo packet
Container for matching data for a signature group.
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
main detection engine ctx
struct Packet_::@29::@36 icmp_s
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
#define FAIL_IF_NOT(expr)
Fail a test if expression evaluates to false.
int(* SetupPrefilter)(DetectEngineCtx *de_ctx, struct SigGroupHead_ *sgh)
DetectUintData_u8 * DetectU8Parse(const char *u8str)
This function is used to parse u8 options passed via some u8 keyword.
#define FAIL_IF_NOT_NULL(expr)
Fail a test if expression evaluates to non-NULL.
int PrefilterSetupPacketHeaderU8Hash(DetectEngineCtx *de_ctx, SigGroupHead *sgh, int sm_type, SignatureMask mask, void(*Set)(PrefilterPacketHeaderValue *v, void *), bool(*Compare)(PrefilterPacketHeaderValue v, void *), void(*Match)(DetectEngineThreadCtx *det_ctx, Packet *p, const void *pectx))
#define PASS
Pass the test.
DetectUintData_u8 DetectU8Data
void PrefilterPacketU8Set(PrefilterPacketHeaderValue *v, void *smctx)
SignatureInitData * init_data
int(* Match)(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *)
Used to start a pointer to SigMatch context Should never be dereferenced without casting to something...
int DetectU8Match(const uint8_t parg, const DetectUintData_u8 *du8)
bool(* SupportsPrefilter)(const Signature *s)
a single match condition for a signature
#define ICMPV6_GET_TYPE(icmp6h)
bool PrefilterPacketU8Compare(PrefilterPacketHeaderValue v, void *smctx)
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