suricata
|
Go to the source code of this file.
Data Structures | |
struct | MpmThreadCtx_ |
struct | MpmPattern_ |
struct | MpmCtx_ |
struct | MpmCtxFactoryItem |
struct | MpmCtxFactoryContainer_ |
struct | MpmTableElmt_ |
Macros | |
#define | MPM_INIT_HASH_SIZE 65536 |
#define | MPMCTX_FLAGS_GLOBAL BIT_U8(0) |
#define | MPMCTX_FLAGS_NODEPTH BIT_U8(1) |
#define | MPM_CTX_FACTORY_UNIQUE_CONTEXT -1 |
#define | MPM_PATTERN_FLAG_NOCASE 0x01 |
#define | MPM_PATTERN_FLAG_DEPTH 0x04 |
#define | MPM_PATTERN_FLAG_OFFSET 0x08 |
#define | MPM_PATTERN_CTX_OWNS_ID 0x20 |
#define | MPM_PATTERN_FLAG_ENDSWITH 0x40 |
#define | MPM_FEATURE_FLAG_DEPTH BIT_U8(0) |
#define | MPM_FEATURE_FLAG_OFFSET BIT_U8(1) |
#define | MPM_FEATURE_FLAG_ENDSWITH BIT_U8(2) |
Typedefs | |
typedef uint32_t | MpmPatternIndex |
typedef struct MpmThreadCtx_ | MpmThreadCtx |
typedef struct MpmPattern_ | MpmPattern |
typedef struct MpmCtx_ | MpmCtx |
typedef struct MpmCtxFactoryItem | MpmCtxFactoryItem |
typedef struct MpmCtxFactoryContainer_ | MpmCtxFactoryContainer |
typedef struct MpmTableElmt_ | MpmTableElmt |
Enumerations | |
enum | { MPM_NOTSET = 0, MPM_AC, MPM_AC_KS, MPM_HS, MPM_TABLE_SIZE } |
Functions | |
int32_t | MpmFactoryRegisterMpmCtxProfile (struct DetectEngineCtx_ *, const char *, const int, const AppProto) |
Register a new Mpm Context. More... | |
void | MpmFactoryReClaimMpmCtx (const struct DetectEngineCtx_ *, MpmCtx *) |
MpmCtx * | MpmFactoryGetMpmCtxForProfile (const struct DetectEngineCtx_ *, int32_t, int) |
void | MpmFactoryDeRegisterAllMpmCtxProfiles (struct DetectEngineCtx_ *) |
int32_t | MpmFactoryIsMpmCtxAvailable (const struct DetectEngineCtx_ *, const MpmCtx *) |
void | MpmTableSetup (void) |
void | MpmRegisterTests (void) |
void | MpmInitCtx (MpmCtx *mpm_ctx, uint8_t matcher) |
void | MpmInitThreadCtx (MpmThreadCtx *mpm_thread_ctx, uint16_t) |
void | MpmDestroyThreadCtx (MpmThreadCtx *mpm_thread_ctx, const uint16_t matcher) |
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) |
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) |
void | MpmFreePattern (MpmCtx *mpm_ctx, MpmPattern *p) |
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) |
Variables | |
MpmTableElmt | mpm_table [MPM_TABLE_SIZE] |
uint8_t | mpm_default_matcher |
Definition in file util-mpm.h.
#define MPM_CTX_FACTORY_UNIQUE_CONTEXT -1 |
Definition at line 114 of file util-mpm.h.
#define MPM_FEATURE_FLAG_DEPTH BIT_U8(0) |
Definition at line 143 of file util-mpm.h.
#define MPM_FEATURE_FLAG_ENDSWITH BIT_U8(2) |
Definition at line 145 of file util-mpm.h.
#define MPM_FEATURE_FLAG_OFFSET BIT_U8(1) |
Definition at line 144 of file util-mpm.h.
#define MPM_INIT_HASH_SIZE 65536 |
Definition at line 31 of file util-mpm.h.
#define MPM_PATTERN_CTX_OWNS_ID 0x20 |
the ctx uses it's own internal id instead of what is passed through the API
Definition at line 140 of file util-mpm.h.
#define MPM_PATTERN_FLAG_DEPTH 0x04 |
pattern has a depth setting
Definition at line 135 of file util-mpm.h.
#define MPM_PATTERN_FLAG_ENDSWITH 0x40 |
Definition at line 141 of file util-mpm.h.
#define MPM_PATTERN_FLAG_NOCASE 0x01 |
pattern is case insensitive
Definition at line 133 of file util-mpm.h.
#define MPM_PATTERN_FLAG_OFFSET 0x08 |
pattern has an offset setting
Definition at line 137 of file util-mpm.h.
#define MPMCTX_FLAGS_GLOBAL BIT_U8(0) |
Definition at line 86 of file util-mpm.h.
#define MPMCTX_FLAGS_NODEPTH BIT_U8(1) |
Definition at line 87 of file util-mpm.h.
typedef struct MpmCtxFactoryContainer_ MpmCtxFactoryContainer |
typedef struct MpmCtxFactoryItem MpmCtxFactoryItem |
typedef struct MpmPattern_ MpmPattern |
typedef uint32_t MpmPatternIndex |
Definition at line 44 of file util-mpm.h.
typedef struct MpmTableElmt_ MpmTableElmt |
typedef struct MpmThreadCtx_ MpmThreadCtx |
anonymous enum |
Enumerator | |
---|---|
MPM_NOTSET | |
MPM_AC | |
MPM_AC_KS | |
MPM_HS | |
MPM_TABLE_SIZE |
Definition at line 32 of file util-mpm.h.
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 | ||
) |
Definition at line 439 of file util-mpm.c.
References flags, MPM_PATTERN_CTX_OWNS_ID, SCLogDebug, and SCLogWarning.
Referenced by SCACAddPatternCI(), SCACAddPatternCS(), SCACTileAddPatternCI(), and SCACTileAddPatternCS().
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 | ||
) |
Definition at line 259 of file util-mpm.c.
References MpmTableElmt_::AddPatternNocase, flags, mpm_table, MpmCtx_::mpm_type, and offset.
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 | ||
) |
Definition at line 250 of file util-mpm.c.
References MpmTableElmt_::AddPattern, flags, mpm_table, MpmCtx_::mpm_type, and offset.
void MpmDestroyThreadCtx | ( | MpmThreadCtx * | mpm_thread_ctx, |
const uint16_t | matcher | ||
) |
Definition at line 203 of file util-mpm.c.
References MpmTableElmt_::DestroyThreadCtx, and mpm_table.
Referenced by PatternMatchThreadDestroy().
void MpmFactoryDeRegisterAllMpmCtxProfiles | ( | struct DetectEngineCtx_ * | ) |
Definition at line 169 of file util-mpm.c.
References de_ctx, MpmTableElmt_::DestroyCtx, MpmCtxFactoryContainer_::items, DetectEngineCtx_::mpm_ctx_factory_container, MpmCtxFactoryItem::mpm_ctx_tc, MpmCtxFactoryItem::mpm_ctx_ts, MPM_NOTSET, mpm_table, MpmCtx_::mpm_type, next, MpmCtxFactoryItem::next, and SCFree.
Referenced by DetectEngineCtxFree().
MpmCtx* MpmFactoryGetMpmCtxForProfile | ( | const struct DetectEngineCtx_ * | , |
int32_t | , | ||
int | |||
) |
int32_t MpmFactoryIsMpmCtxAvailable | ( | const struct DetectEngineCtx_ * | , |
const MpmCtx * | |||
) |
void MpmFactoryReClaimMpmCtx | ( | const struct DetectEngineCtx_ * | , |
MpmCtx * | |||
) |
int32_t MpmFactoryRegisterMpmCtxProfile | ( | DetectEngineCtx * | de_ctx, |
const char * | name, | ||
const int | sm_list, | ||
const AppProto | alproto | ||
) |
Register a new Mpm Context.
name | A new profile to be registered to store this MpmCtx. |
sm_list | sm_list for this name (might be variable with xforms) |
alproto | app proto or ALPROTO_UNKNOWN if not for app-layer |
id | Return the id created for the new MpmCtx profile. |
Definition at line 59 of file util-mpm.c.
References MpmCtxFactoryItem::alproto, de_ctx, ENGINE_SGH_MPM_FACTORY_CONTEXT_START_ID_RANGE, FatalError, MpmCtx_::flags, MpmCtxFactoryItem::id, MpmCtxFactoryContainer_::items, MpmCtxFactoryContainer_::max_id, DetectEngineCtx_::mpm_ctx_factory_container, MpmCtxFactoryItem::mpm_ctx_tc, MpmCtxFactoryItem::mpm_ctx_ts, MPMCTX_FLAGS_GLOBAL, MpmCtxFactoryItem::name, MpmCtxFactoryItem::next, MpmCtxFactoryContainer_::no_of_items, SCCalloc, MpmCtxFactoryItem::sm_list, and unlikely.
Referenced by DetectAppLayerMpmRegisterByParentId(), and DetectEngineFrameMpmRegister().
void MpmFreePattern | ( | MpmCtx * | mpm_ctx, |
MpmPattern * | p | ||
) |
Definition at line 357 of file util-mpm.c.
References MpmPattern_::ci, MpmPattern_::cs, MpmPattern_::len, MpmCtx_::memory_cnt, MpmCtx_::memory_size, MpmPattern_::original_pat, SCFree, and MpmPattern_::sids.
Referenced by SCACDestroyCtx().
void MpmInitCtx | ( | MpmCtx * | mpm_ctx, |
uint8_t | matcher | ||
) |
Definition at line 210 of file util-mpm.c.
References MpmTableElmt_::InitCtx, mpm_table, and MpmCtx_::mpm_type.
void MpmInitThreadCtx | ( | MpmThreadCtx * | mpm_thread_ctx, |
uint16_t | |||
) |
Definition at line 196 of file util-mpm.c.
References MpmTableElmt_::InitThreadCtx, and mpm_table.
Referenced by PatternMatchThreadPrepare().
void MpmRegisterTests | ( | void | ) |
Definition at line 575 of file util-mpm.c.
References g_ut_modules, MPM_NOTSET, mpm_table, and MPM_TABLE_SIZE.
void MpmTableSetup | ( | void | ) |
Definition at line 225 of file util-mpm.c.
References DEFAULT_MPM, mpm_default_matcher, mpm_table, MpmACRegister(), MpmACTileRegister(), MpmHSRegister(), and SCLogInfo.
Referenced by ListAppLayerProtocols(), ListKeywords(), LLVMFuzzerTestOneInput(), PostConfLoadedSetup(), and RunUnittests().
uint8_t mpm_default_matcher |
Definition at line 48 of file util-mpm.c.
Referenced by MpmTableSetup(), and PatternMatchDefaultMatcher().
MpmTableElmt mpm_table[MPM_TABLE_SIZE] |
Definition at line 47 of file util-mpm.c.
Referenced by DetectMpmPrepareAppMpms(), DetectMpmPrepareBuiltinMpms(), DetectMpmPrepareFrameMpms(), DetectMpmPreparePktMpms(), MpmACRegister(), MpmACTileRegister(), MpmAddPatternCI(), MpmAddPatternCS(), MpmDestroyThreadCtx(), MpmFactoryDeRegisterAllMpmCtxProfiles(), MpmFactoryReClaimMpmCtx(), MpmInitCtx(), MpmInitThreadCtx(), MpmRegisterTests(), MpmTableSetup(), PatternMatchDefaultMatcher(), and PatternMatchDestroy().