suricata
detect-fast-pattern.c File Reference
#include "suricata-common.h"
#include "detect.h"
#include "flow.h"
#include "detect-content.h"
#include "detect-parse.h"
#include "detect-engine.h"
#include "detect-engine-mpm.h"
#include "detect-engine-build.h"
#include "detect-fast-pattern.h"
#include "util-error.h"
#include "util-byte.h"
#include "util-debug.h"
#include "util-unittest.h"
#include "util-unittest-helper.h"
#include "detect-engine-alert.h"
Include dependency graph for detect-fast-pattern.c:

Go to the source code of this file.

Macros

#define PARSE_REGEX   "^(\\s*only\\s*)|\\s*([0-9]+)\\s*,\\s*([0-9]+)\\s*$"
 

Functions

int FastPatternSupportEnabledForSigMatchList (const DetectEngineCtx *de_ctx, const int list_id)
 Checks if a particular buffer is in the list of lists that need to be searched for a keyword that has fp support. More...
 
void SupportFastPatternForSigMatchList (int list_id, int priority)
 Lets one add a sm list id to be searched for potential fp supported keywords later. More...
 
void DetectEngineRegisterFastPatternForId (DetectEngineCtx *de_ctx, int list_id, int priority)
 
void SupportFastPatternForSigMatchTypes (void)
 Registers the keywords(SMs) that should be given fp support. More...
 
void DetectEngineInitializeFastPatternList (DetectEngineCtx *de_ctx)
 
void DetectEngineFreeFastPatternList (DetectEngineCtx *de_ctx)
 
void DetectFastPatternRegister (void)
 Registration function for fast_pattern keyword. More...
 

Detailed Description

Author
Anoop Saldanha anoop.nosp@m.sald.nosp@m.anha@.nosp@m.gmai.nosp@m.l.com

Implements the fast_pattern keyword

Definition in file detect-fast-pattern.c.

Macro Definition Documentation

◆ PARSE_REGEX

#define PARSE_REGEX   "^(\\s*only\\s*)|\\s*([0-9]+)\\s*,\\s*([0-9]+)\\s*$"

Definition at line 43 of file detect-fast-pattern.c.

Function Documentation

◆ DetectEngineFreeFastPatternList()

void DetectEngineFreeFastPatternList ( DetectEngineCtx de_ctx)

Definition at line 172 of file detect-fast-pattern.c.

References de_ctx, DetectEngineCtx_::fp_support_smlist_list, next, HtpBodyChunk_::next, and SCFree.

Referenced by DetectEngineCtxFree().

Here is the caller graph for this function:

◆ DetectEngineInitializeFastPatternList()

void DetectEngineInitializeFastPatternList ( DetectEngineCtx de_ctx)

Definition at line 150 of file detect-fast-pattern.c.

◆ DetectEngineRegisterFastPatternForId()

void DetectEngineRegisterFastPatternForId ( DetectEngineCtx de_ctx,
int  list_id,
int  priority 
)

◆ DetectFastPatternRegister()

void DetectFastPatternRegister ( void  )

Registration function for fast_pattern keyword.

Definition at line 185 of file detect-fast-pattern.c.

References SigTableElmt_::desc, DETECT_FAST_PATTERN, SigTableElmt_::Match, SigTableElmt_::name, SigTableElmt_::Setup, sigmatch_table, and SigTableElmt_::url.

Referenced by SigTableSetup().

Here is the caller graph for this function:

◆ FastPatternSupportEnabledForSigMatchList()

int FastPatternSupportEnabledForSigMatchList ( const DetectEngineCtx de_ctx,
const int  list_id 
)

Checks if a particular buffer is in the list of lists that need to be searched for a keyword that has fp support.

Parameters
list_idThe list id.
Return values
1If supported.
0If not.

Definition at line 64 of file detect-fast-pattern.c.

References de_ctx, DETECT_SM_LIST_PMATCH, DetectEngineBufferTypeSupportsMpmGetById(), and DetectEngineCtx_::fp_support_smlist_list.

Referenced by RetrieveFPForSig().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SupportFastPatternForSigMatchList()

void SupportFastPatternForSigMatchList ( int  list_id,
int  priority 
)

Lets one add a sm list id to be searched for potential fp supported keywords later.

Parameters
list_idSM list id.
priorityPriority for this list.

Definition at line 130 of file detect-fast-pattern.c.

Referenced by SupportFastPatternForSigMatchTypes().

Here is the caller graph for this function:

◆ SupportFastPatternForSigMatchTypes()

void SupportFastPatternForSigMatchTypes ( void  )

Registers the keywords(SMs) that should be given fp support.

Definition at line 143 of file detect-fast-pattern.c.

References DETECT_SM_LIST_PMATCH, and SupportFastPatternForSigMatchList().

Referenced by GlobalsInitPreConfig().

Here is the call graph for this function:
Here is the caller graph for this function: