Go to the documentation of this file.
25 SCDetectVlanIdFree(ptr);
37 DetectVlanIdFree(
de_ctx, vdata);
49 DetectVlanIdDataPrefilter vdata;
50 vdata.du16.mode =
ctx->v1.u8[0];
51 vdata.layer =
ctx->v1.u8[1];
52 vdata.du16.arg1 =
ctx->v1.u16[2];
53 vdata.du16.arg2 =
ctx->v1.u16[3];
56 PrefilterAddSids(&det_ctx->
pmq,
ctx->sigs_array,
ctx->sigs_cnt);
62 const DetectVlanIdDataPrefilter a = SCDetectVlanIdPrefilter(smctx);
63 v->
u8[0] = a.du16.mode;
65 v->
u16[2] = a.du16.arg1;
66 v->
u16[3] = a.du16.arg2;
71 const DetectVlanIdDataPrefilter a = SCDetectVlanIdPrefilter(smctx);
72 if (v.
u8[0] == a.du16.mode && v.
u8[1] == a.layer && v.
u16[2] == a.du16.arg1 &&
73 v.
u16[3] == a.du16.arg2)
81 PrefilterPacketVlanIdSet, PrefilterPacketVlanIdCompare, PrefilterPacketVlanIdMatch);
84 static bool PrefilterVlanIdIsPrefilterable(
const Signature *s)
89 return SCDetectVlanIdPrefilterable(sm->
ctx);
95 static int DetectVlanIdMatch(
113 static int DetectVlanLayersMatch(
137 SCLogError(
"number of layers out of range %s", rawstr);
138 DetectVlanLayersFree(
de_ctx, du8);
144 DetectVlanLayersFree(
de_ctx, du8);
152 static void PrefilterPacketVlanLayersMatch(
158 du8.mode =
ctx->v1.u8[0];
159 du8.arg1 =
ctx->v1.u8[1];
160 du8.arg2 =
ctx->v1.u8[2];
162 if (DetectVlanLayersMatch(det_ctx, p, NULL, (
const SigMatchCtx *)&du8)) {
163 PrefilterAddSids(&det_ctx->
pmq,
ctx->sigs_array,
ctx->sigs_cnt);
173 static bool PrefilterVlanLayersIsPrefilterable(
const Signature *s)
#define SIGMATCH_INFO_UINT16
#define SIG_MASK_REQUIRE_REAL_PKT
struct SigMatch_ * smlists[DETECT_SM_LIST_MAX]
SigTableElmt * sigmatch_table
void(* Free)(DetectEngineCtx *, void *)
Container for matching data for a signature group.
main detection engine ctx
void DetectVlanLayersRegister(void)
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.
#define SIGMATCH_INFO_MULTI_UINT
SigMatch * SCSigMatchAppendSMToList(DetectEngineCtx *de_ctx, Signature *s, uint16_t type, SigMatchCtx *ctx, const int list)
Append a SigMatch to the list type.
DetectUintData_u8 DetectU8Data
void PrefilterPacketU8Set(PrefilterPacketHeaderValue *v, void *smctx)
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...
int DetectU8Match(const uint8_t parg, const DetectUintData_u8 *du8)
#define SCLogError(...)
Macro used to log ERROR messages.
bool(* SupportsPrefilter)(const Signature *s)
a single match condition for a signature
#define SIGMATCH_INFO_UINT8
bool PrefilterPacketU8Compare(PrefilterPacketHeaderValue v, void *smctx)
void DetectVlanIdRegister(void)
uint16_t vlan_id[VLAN_MAX_LAYERS]
#define SIG_FLAG_REQUIRE_PACKET