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,
48  Packet *p, Flow *f, void *tx,
49  const uint64_t idx, const uint8_t flags),
50  const AppProto alproto, const int tx_min_progress,
51  void *pectx, void (*FreeFunc)(void *pectx),
52  const char *name);
53 
55  const SigGroupHead *sgh,
56  Packet *p,
57  const uint8_t ipproto,
58  const uint8_t flow_flags,
59  const AppProto alproto,
60  void *alstate,
61  DetectTransaction *tx);
62 
64 
67 
68 #ifdef PROFILING
69 const char *PrefilterStoreGetName(const uint32_t id);
70 #endif
71 
74 
76  SigGroupHead *sgh, MpmCtx *mpm_ctx,
77  const DetectBufferMpmRegistery *mpm_reg, int list_id);
78 
80  SigGroupHead *sgh, MpmCtx *mpm_ctx,
81  const DetectBufferMpmRegistery *mpm_reg, int list_id);
82 
83 
84 #endif
PrefilterGenericMpmRegister
int PrefilterGenericMpmRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistery *mpm_reg, int list_id)
Definition: detect-engine-prefilter.c:611
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:1347
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:90
AppProto
uint16_t AppProto
Definition: app-layer-protos.h:73
Flow_
Flow data structure.
Definition: flow.h:347
PrefilterDeinit
void PrefilterDeinit(DetectEngineCtx *de_ctx)
Definition: detect-engine-prefilter.c:483
DetectEngineCtx_
main detection engine ctx
Definition: detect.h:767
DetectBufferMpmRegistery_
one time registration of keywords at start up
Definition: detect.h:611
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:257
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:223
PrefilterCleanupRuleGroup
void PrefilterCleanupRuleGroup(const DetectEngineCtx *de_ctx, SigGroupHead *sgh)
Definition: detect-engine-prefilter.c:332
de_ctx
DetectEngineCtx * de_ctx
Definition: fuzz_siginit.c:17
DetectEngineThreadCtx_
Definition: detect.h:1010
PrefilterFreeEnginesList
void PrefilterFreeEnginesList(PrefilterEngineList *list)
Definition: detect-engine-prefilter.c:304
PrefilterStoreGetName
const char * PrefilterStoreGetName(const uint32_t id)
Definition: detect-engine-prefilter.c:555
PrefilterStore
struct PrefilterStore_ PrefilterStore
Packet_
Definition: decode.h:414
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:490
Prefilter
void Prefilter(DetectEngineThreadCtx *, const SigGroupHead *, Packet *p, const uint8_t flags)
Definition: detect-engine-prefilter.c:139
flags
uint8_t flags
Definition: decode-gre.h:0
DetectTransaction_
Definition: detect-engine-state.h:97
PrefilterEngineList_
Definition: detect.h:1272
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:189
PrefilterStore_::name
const char * name
Definition: detect-engine-prefilter.h:30
PrefilterSetupRuleGroup
void PrefilterSetupRuleGroup(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
Definition: detect-engine-prefilter.c:348
PrefilterGenericMpmPktRegister
int PrefilterGenericMpmPktRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistery *mpm_reg, int list_id)
Definition: detect-engine-prefilter.c:681
MpmCtx_
Definition: util-mpm.h:88