Go to the documentation of this file.
24 #ifndef SURICATA_UTIL_MPM_H
25 #define SURICATA_UTIL_MPM_H
30 #define MPM_INIT_HASH_SIZE 65536
85 #define MPMCTX_FLAGS_GLOBAL BIT_U8(0)
86 #define MPMCTX_FLAGS_NODEPTH BIT_U8(1)
87 #define MPMCTX_FLAGS_CACHE_TO_DISK BIT_U8(2)
118 #define MPM_CTX_FACTORY_UNIQUE_CONTEXT -1
136 #define MPM_PATTERN_FLAG_NOCASE 0x01
138 #define MPM_PATTERN_FLAG_DEPTH 0x04
140 #define MPM_PATTERN_FLAG_OFFSET 0x08
143 #define MPM_PATTERN_CTX_OWNS_ID 0x20
144 #define MPM_PATTERN_FLAG_ENDSWITH 0x40
146 #define MPM_FEATURE_FLAG_DEPTH BIT_U8(0)
147 #define MPM_FEATURE_FLAG_OFFSET BIT_U8(1)
148 #define MPM_FEATURE_FLAG_ENDSWITH BIT_U8(2)
206 uint16_t
offset, uint16_t depth,
209 uint16_t
offset, uint16_t depth,
215 uint16_t
offset, uint16_t depth, uint32_t pid,
void(* PrintThreadCtx)(struct MpmThreadCtx_ *)
void(* InitThreadCtx)(struct MpmCtx_ *, struct MpmThreadCtx_ *)
int MpmAddPattern(MpmCtx *mpm_ctx, uint8_t *pat, uint16_t patlen, uint16_t offset, uint16_t depth, uint32_t pid, SigIntId sid, uint8_t flags)
structure for storing potential rule matches
struct MpmConfig_ MpmConfig
int MpmAddPatternCI(struct MpmCtx_ *mpm_ctx, uint8_t *pat, uint16_t patlen, uint16_t offset, uint16_t depth, uint32_t pid, SigIntId sid, uint8_t flags)
struct MpmCtxFactoryContainer_ MpmCtxFactoryContainer
struct MpmTableElmt_ MpmTableElmt
int MpmAddPatternCS(struct MpmCtx_ *mpm_ctx, uint8_t *pat, uint16_t patlen, uint16_t offset, uint16_t depth, uint32_t pid, SigIntId sid, uint8_t flags)
main detection engine ctx
int(* AddPatternNocase)(struct MpmCtx_ *, uint8_t *, uint16_t, uint16_t, uint16_t, uint32_t, SigIntId, uint8_t)
int(* AddPattern)(struct MpmCtx_ *, uint8_t *, uint16_t, uint16_t, uint16_t, uint32_t, SigIntId, uint8_t)
MpmTableElmt mpm_table[MPM_TABLE_SIZE]
struct MpmCtxFactoryItem MpmCtxFactoryItem
struct MpmThreadCtx_ MpmThreadCtx
void(* InitCtx)(struct MpmCtx_ *)
const char * cache_dir_path
void MpmInitThreadCtx(MpmThreadCtx *mpm_thread_ctx, uint16_t)
void(* PrintCtx)(struct MpmCtx_ *)
struct MpmPattern_ MpmPattern
struct MpmPattern_ * next
int32_t MpmFactoryIsMpmCtxAvailable(const struct DetectEngineCtx_ *, const MpmCtx *)
uint8_t mpm_default_matcher
MpmCtxFactoryItem * items
void MpmFreePattern(MpmCtx *mpm_ctx, MpmPattern *p)
int(* CacheRuleset)(MpmConfig *)
uint32_t(* Search)(const struct MpmCtx_ *, struct MpmThreadCtx_ *, PrefilterRuleStore *, const uint8_t *, uint32_t)
struct MpmCtxFactoryItem * next
void MpmFactoryReClaimMpmCtx(const struct DetectEngineCtx_ *, MpmCtx *)
void MpmRegisterTests(void)
void MpmFactoryDeRegisterAllMpmCtxProfiles(struct DetectEngineCtx_ *)
int(* Prepare)(MpmConfig *, struct MpmCtx_ *)
void(* DestroyCtx)(struct MpmCtx_ *)
void(* ConfigDeinit)(MpmConfig **)
void(* ConfigCacheDirSet)(MpmConfig *, const char *dir_path)
int32_t MpmFactoryRegisterMpmCtxProfile(struct DetectEngineCtx_ *, const char *, const int, const AppProto)
Register a new Mpm Context.
void(* DestroyThreadCtx)(struct MpmCtx_ *, struct MpmThreadCtx_ *)
void MpmInitCtx(MpmCtx *mpm_ctx, uint8_t matcher)
MpmCtx * MpmFactoryGetMpmCtxForProfile(const struct DetectEngineCtx_ *, int32_t, int)
void(* RegisterUnittests)(void)
void MpmDestroyThreadCtx(MpmThreadCtx *mpm_thread_ctx, const uint16_t matcher)