Go to the documentation of this file.
42 static bool PrefilterIcmpv6mtuIsPrefilterable(
const Signature *s);
64 static inline int DetectICMPv6mtuGetValue(
Packet *p, uint32_t *picmpv6mtu)
66 if (!(PacketIsICMPv6(p)))
68 const ICMPV6Hdr *icmpv6h = PacketGetICMPv6(p);
95 if (DetectICMPv6mtuGetValue(p, &picmpv6mtu) == 0) {
116 if (icmpv6mtud == NULL)
137 rs_detect_u32_free(ptr);
148 if (DetectICMPv6mtuGetValue(p, &picmpv6mtu) == 0) {
155 if (!PrefilterPacketHeaderExtraMatch(
ctx, p))
161 du32.mode =
ctx->v1.u8[0];
162 du32.arg1 =
ctx->v1.u32[1];
163 du32.arg2 =
ctx->v1.u32[2];
166 SCLogDebug(
"packet matches icmpv6.mtu/hl %u", picmpv6mtu);
167 PrefilterAddSids(&det_ctx->
pmq,
ctx->sigs_array,
ctx->sigs_cnt);
177 static bool PrefilterIcmpv6mtuIsPrefilterable(
const Signature *s)
#define SIG_MASK_REQUIRE_REAL_PKT
int DetectU32Match(const uint32_t parg, const DetectUintData_u32 *du32)
SigTableElmt * sigmatch_table
void(* Free)(DetectEngineCtx *, void *)
#define DETECT_PROTO_IPV6
#define PKT_IS_PSEUDOPKT(p)
return 1 if the packet is a pseudo packet
Container for matching data for a signature group.
DetectUintData_u32 * DetectU32Parse(const char *u32str)
This function is used to parse u32 options passed via some u32 keyword.
void PrefilterPacketU32Set(PrefilterPacketHeaderValue *v, void *smctx)
void DetectICMPv6mtuRegisterTests(void)
this function registers unit tests for DetectICMPv6mtu
main detection engine ctx
#define ICMPV6_HAS_MTU(icmp6h)
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
int(* SetupPrefilter)(DetectEngineCtx *de_ctx, struct SigGroupHead_ *sgh)
void DetectICMPv6mtuRegister(void)
Registration function for icmpv6.mtu: keyword.
void DetectICMPv6mtuFree(DetectEngineCtx *de_ctx, void *)
this function will free memory associated with DetectU32Data
#define ICMPV6_GET_CODE(icmp6h)
int PrefilterSetupPacketHeader(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))
bool PrefilterPacketU32Compare(PrefilterPacketHeaderValue v, void *smctx)
int(* Match)(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *)
Used to start a pointer to SigMatch context Should never be dereferenced without casting to something...
#define ICMPV6_GET_MTU(icmp6h)
DetectUintData_u32 DetectU32Data
bool(* SupportsPrefilter)(const Signature *s)
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