Go to the documentation of this file.
47 static void DetectITypeRegisterTests(
void);
52 static bool PrefilterITypeIsPrefilterable(
const Signature *s);
91 if (PacketIsICMPv4(p)) {
93 }
else if (PacketIsICMPv6(p)) {
94 const ICMPV6Hdr *icmpv6h = PacketGetICMPv6(p);
152 Packet *p,
const void *pectx)
157 if (PacketIsICMPv4(p)) {
159 }
else if (PacketIsICMPv6(p)) {
160 const ICMPV6Hdr *icmpv6h = PacketGetICMPv6(p);
170 PrefilterAddSids(&det_ctx->
pmq, sa->
sigs, sa->
cnt);
180 static bool PrefilterITypeIsPrefilterable(
const Signature *s)
200 static int DetectITypeParseTest01(
void)
216 static int DetectITypeParseTest02(
void)
232 static int DetectITypeParseTest03(
void)
248 static int DetectITypeParseTest04(
void)
265 static int DetectITypeParseTest05(
void)
281 static int DetectITypeParseTest06(
void)
297 static int DetectITypeParseTest07(
void)
313 static int DetectITypeParseTest08(
void)
325 void DetectITypeRegisterTests(
void)
struct Packet_::@24::@31 icmp_s
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
#define SIGMATCH_SUPPORT_FIREWALL
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