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 
72 void PrefilterInit(DetectEngineCtx *de_ctx);
73 void PrefilterDeinit(DetectEngineCtx *de_ctx);
74 
76  SigGroupHead *sgh, MpmCtx *mpm_ctx,
77  const DetectMpmAppLayerRegistery *mpm_reg, int list_id);
78 
79 #endif
void(* FreeFunc)(void *)
void PrefilterCleanupRuleGroup(const DetectEngineCtx *de_ctx, SigGroupHead *sgh)
uint16_t flags
one time registration of keywords at start up
Definition: detect.h:590
Container for matching data for a signature group.
Definition: detect.h:1321
const char * PrefilterStoreGetName(const uint32_t id)
uint16_t AppProto
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)
main detection engine ctx
Definition: detect.h:743
int PrefilterGenericMpmRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectMpmAppLayerRegistery *mpm_reg, int list_id)
struct PrefilterStore_ PrefilterStore
Data structures and function prototypes for keeping state for the detection engine.
void PrefilterDeinit(DetectEngineCtx *de_ctx)
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
void PrefilterSetupRuleGroup(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
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)
void Prefilter(DetectEngineThreadCtx *, const SigGroupHead *, Packet *p, const uint8_t flags)
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)
void PrefilterInit(DetectEngineCtx *de_ctx)
Flow data structure.
Definition: flow.h:325
void PrefilterFreeEnginesList(PrefilterEngineList *list)