Go to the documentation of this file.
48 static bool PrefilterTtlIsPrefilterable(
const Signature *s);
87 if (PacketIsIPv4(p)) {
88 const IPV4Hdr *ip4h = PacketGetIPv4(p);
90 }
else if (PacketIsIPv6(p)) {
91 const IPV6Hdr *ip6h = PacketGetIPv6(p);
134 rs_detect_u8_free(ptr);
145 if (PacketIsIPv4(p)) {
146 const IPV4Hdr *ip4h = PacketGetIPv4(p);
148 }
else if (PacketIsIPv6(p)) {
149 const IPV6Hdr *ip6h = PacketGetIPv6(p);
157 if (!PrefilterPacketHeaderExtraMatch(
ctx, p))
161 du8.mode =
ctx->v1.u8[0];
162 du8.arg1 =
ctx->v1.u8[1];
163 du8.arg2 =
ctx->v1.u8[2];
166 PrefilterAddSids(&det_ctx->
pmq,
ctx->sigs_array,
ctx->sigs_cnt);
176 static bool PrefilterTtlIsPrefilterable(
const Signature *s)
#define SIG_MASK_REQUIRE_REAL_PKT
struct SigMatch_ * smlists[DETECT_SM_LIST_MAX]
SigTableElmt * sigmatch_table
#define IPV6_GET_RAW_HLIM(ip6h)
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.
main detection engine ctx
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
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.
DetectUintData_u8 DetectU8Data
void PrefilterPacketU8Set(PrefilterPacketHeaderValue *v, void *smctx)
#define IPV4_GET_RAW_IPTTL(ip4h)
SignatureInitData * init_data
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))
int(* Match)(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *)
Used to start a pointer to SigMatch context Should never be dereferenced without casting to something...
void DetectTtlRegisterTests(void)
this function registers unit tests for DetectTtl
int DetectU8Match(const uint8_t parg, const DetectUintData_u8 *du8)
bool(* SupportsPrefilter)(const Signature *s)
void DetectTtlFree(DetectEngineCtx *, void *)
this function will free memory associated with DetectU8Data
a single match condition for a signature
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.
void DetectTtlRegister(void)
Registration function for ttl: keyword.
#define DEBUG_VALIDATE_BUG_ON(exp)
void(* RegisterTests)(void)
#define SIG_FLAG_REQUIRE_PACKET