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)
207 uint16_t
offset, uint16_t depth,
main detection engine ctx
const char * cache_dir_path
MpmCtxFactoryItem * items
struct MpmCtxFactoryItem * next
struct MpmPattern_ * next
void(* RegisterUnittests)(void)
int(* Prepare)(MpmConfig *, struct MpmCtx_ *)
int(* AddPattern)(struct MpmCtx_ *, uint8_t *, uint16_t, uint16_t, uint16_t, uint32_t, SigIntId, uint8_t)
void(* InitCtx)(struct MpmCtx_ *)
void(* PrintCtx)(struct MpmCtx_ *)
void(* InitThreadCtx)(struct MpmCtx_ *, struct MpmThreadCtx_ *)
uint32_t(* Search)(const struct MpmCtx_ *, struct MpmThreadCtx_ *, PrefilterRuleStore *, const uint8_t *, uint32_t)
void(* DestroyCtx)(struct MpmCtx_ *)
int(* AddPatternNocase)(struct MpmCtx_ *, const uint8_t *, uint16_t, uint16_t, uint16_t, uint32_t, SigIntId, uint8_t)
int(* CacheRuleset)(MpmConfig *)
void(* PrintThreadCtx)(struct MpmThreadCtx_ *)
void(* ConfigDeinit)(MpmConfig **)
void(* ConfigCacheDirSet)(MpmConfig *, const char *dir_path)
void(* DestroyThreadCtx)(struct MpmCtx_ *, struct MpmThreadCtx_ *)
structure for storing potential rule matches
void MpmFreePattern(MpmCtx *mpm_ctx, MpmPattern *p)
MpmTableElmt mpm_table[MPM_TABLE_SIZE]
void MpmRegisterTests(void)
int32_t MpmFactoryRegisterMpmCtxProfile(struct DetectEngineCtx_ *, const char *, const int, const AppProto)
Register a new Mpm Context.
uint8_t mpm_default_matcher
struct MpmConfig_ MpmConfig
int32_t MpmFactoryIsMpmCtxAvailable(const struct DetectEngineCtx_ *, const MpmCtx *)
struct MpmTableElmt_ MpmTableElmt
void MpmFactoryDeRegisterAllMpmCtxProfiles(struct DetectEngineCtx_ *)
MpmCtx * MpmFactoryGetMpmCtxForProfile(const struct DetectEngineCtx_ *, int32_t, int)
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)
void MpmFactoryReClaimMpmCtx(const struct DetectEngineCtx_ *, MpmCtx *)
void MpmInitThreadCtx(MpmThreadCtx *mpm_thread_ctx, uint16_t)
void MpmDestroyThreadCtx(MpmThreadCtx *mpm_thread_ctx, const uint16_t matcher)
struct MpmThreadCtx_ MpmThreadCtx
struct MpmPattern_ MpmPattern
int MpmAddPatternCI(MpmCtx *mpm_ctx, const uint8_t *pat, uint16_t patlen, uint16_t offset, uint16_t depth, uint32_t pid, SigIntId sid, uint8_t flags)
int MpmAddPattern(MpmCtx *mpm_ctx, const uint8_t *pat, uint16_t patlen, uint16_t offset, uint16_t depth, uint32_t pid, SigIntId sid, uint8_t flags)
struct MpmCtxFactoryContainer_ MpmCtxFactoryContainer
void MpmInitCtx(MpmCtx *mpm_ctx, uint8_t matcher)