suricata
detect-engine-prefilter.h
Go to the documentation of this file.
1 /* Copyright (C) 2016 Open Information Security Foundation
2  *
3  * You can copy, redistribute or modify this Program under the terms of
4  * the GNU General Public License version 2 as published by the Free
5  * Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * version 2 along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17 
18 /**
19  * \file
20  *
21  * \author Victor Julien <victor@inliniac.net>
22  */
23 
24 #ifndef __DETECT_ENGINE_PREFILTER_H__
25 #define __DETECT_ENGINE_PREFILTER_H__
26 
27 #include "detect-engine-state.h"
28 
29 typedef struct PrefilterStore_ {
30  const char *name;
31  void (*FreeFunc)(void *);
32  uint32_t id;
34 
36  const uint8_t flags);
37 
39  void (*Prefilter)(DetectEngineThreadCtx *det_ctx, Packet *p, const void *pectx),
40  void *pectx, void (*FreeFunc)(void *pectx),
41  const char *name);
43  void (*Prefilter)(DetectEngineThreadCtx *det_ctx, Packet *p, const void *pectx),
44  void *pectx, void (*FreeFunc)(void *pectx),
45  const char *name);
47  void (*PrefilterTx)(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p, Flow *f,
48  void *tx, const uint64_t idx, const uint8_t flags),
49  const AppProto alproto, const int tx_min_progress, void *pectx,
50  void (*FreeFunc)(void *pectx), const char *name);
52  PrefilterFrameFn PrefilterFrameFunc, AppProto alproto, uint8_t frame_type, void *pectx,
53  void (*FreeFunc)(void *pectx), const char *name);
54 
56  const SigGroupHead *sgh,
57  Packet *p,
58  const uint8_t ipproto,
59  const uint8_t flow_flags,
60  const AppProto alproto,
61  void *alstate,
62  DetectTransaction *tx);
63 
65 
68 
69 #ifdef PROFILING
70 const char *PrefilterStoreGetName(const uint32_t id);
71 #endif
72 
75 
77  SigGroupHead *sgh, MpmCtx *mpm_ctx,
78  const DetectBufferMpmRegistery *mpm_reg, int list_id);
79 
81  SigGroupHead *sgh, MpmCtx *mpm_ctx,
82  const DetectBufferMpmRegistery *mpm_reg, int list_id);
83 
84 
85 #endif
PrefilterGenericMpmRegister
int PrefilterGenericMpmRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistery *mpm_reg, int list_id)
Definition: detect-engine-prefilter.c:753
PrefilterStore_::FreeFunc
void(* FreeFunc)(void *)
Definition: detect-engine-prefilter.h:31
PrefilterStore_
Definition: detect-engine-prefilter.h:29
SigGroupHead_
Container for matching data for a signature group.
Definition: detect.h:1407
DetectRunPrefilterTx
void DetectRunPrefilterTx(DetectEngineThreadCtx *det_ctx, const SigGroupHead *sgh, Packet *p, const uint8_t ipproto, const uint8_t flow_flags, const AppProto alproto, void *alstate, DetectTransaction *tx)
run prefilter engines on a transaction
Definition: detect-engine-prefilter.c:93
AppProto
uint16_t AppProto
Definition: app-layer-protos.h:78
Flow_
Flow data structure.
Definition: flow.h:353
PrefilterDeinit
void PrefilterDeinit(DetectEngineCtx *de_ctx)
Definition: detect-engine-prefilter.c:625
DetectEngineCtx_
main detection engine ctx
Definition: detect.h:801
PrefilterAppendFrameEngine
int PrefilterAppendFrameEngine(DetectEngineCtx *de_ctx, SigGroupHead *sgh, PrefilterFrameFn PrefilterFrameFunc, AppProto alproto, uint8_t frame_type, void *pectx, void(*FreeFunc)(void *pectx), const char *name)
Definition: detect-engine-prefilter.c:309
DetectBufferMpmRegistery_
one time registration of keywords at start up
Definition: detect.h:632
PrefilterAppendTxEngine
int PrefilterAppendTxEngine(DetectEngineCtx *de_ctx, SigGroupHead *sgh, void(*PrefilterTx)(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p, Flow *f, void *tx, const uint64_t idx, const uint8_t flags), const AppProto alproto, const int tx_min_progress, void *pectx, void(*FreeFunc)(void *pectx), const char *name)
Definition: detect-engine-prefilter.c:270
PrefilterStore_::id
uint32_t id
Definition: detect-engine-prefilter.h:32
PrefilterAppendPayloadEngine
int PrefilterAppendPayloadEngine(DetectEngineCtx *de_ctx, SigGroupHead *sgh, void(*Prefilter)(DetectEngineThreadCtx *det_ctx, Packet *p, const void *pectx), void *pectx, void(*FreeFunc)(void *pectx), const char *name)
Definition: detect-engine-prefilter.c:236
PrefilterCleanupRuleGroup
void PrefilterCleanupRuleGroup(const DetectEngineCtx *de_ctx, SigGroupHead *sgh)
Definition: detect-engine-prefilter.c:380
de_ctx
DetectEngineCtx * de_ctx
Definition: fuzz_siginit.c:17
DetectEngineThreadCtx_
Definition: detect.h:1050
PrefilterFreeEnginesList
void PrefilterFreeEnginesList(PrefilterEngineList *list)
Definition: detect-engine-prefilter.c:352
PrefilterFrameFn
void(* PrefilterFrameFn)(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p, const struct Frames *frames, const struct Frame *frame, const uint32_t idx)
Definition: detect.h:1312
PrefilterStoreGetName
const char * PrefilterStoreGetName(const uint32_t id)
Definition: detect-engine-prefilter.c:697
PrefilterStore
struct PrefilterStore_ PrefilterStore
Packet_
Definition: decode.h:420
detect-engine-state.h
Data structures and function prototypes for keeping state for the detection engine.
PrefilterInit
void PrefilterInit(DetectEngineCtx *de_ctx)
Definition: detect-engine-prefilter.c:632
Prefilter
void Prefilter(DetectEngineThreadCtx *, const SigGroupHead *, Packet *p, const uint8_t flags)
Definition: detect-engine-prefilter.c:143
flags
uint8_t flags
Definition: decode-gre.h:0
DetectTransaction_
Definition: detect-engine-state.h:98
PrefilterEngineList_
Definition: detect.h:1315
PrefilterAppendEngine
int PrefilterAppendEngine(DetectEngineCtx *de_ctx, SigGroupHead *sgh, void(*Prefilter)(DetectEngineThreadCtx *det_ctx, Packet *p, const void *pectx), void *pectx, void(*FreeFunc)(void *pectx), const char *name)
Definition: detect-engine-prefilter.c:202
PrefilterStore_::name
const char * name
Definition: detect-engine-prefilter.h:30
PrefilterSetupRuleGroup
void PrefilterSetupRuleGroup(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
Definition: detect-engine-prefilter.c:415
PrefilterGenericMpmPktRegister
int PrefilterGenericMpmPktRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistery *mpm_reg, int list_id)
Definition: detect-engine-prefilter.c:823
MpmCtx_
Definition: util-mpm.h:88