suricata
detect-engine.h
Go to the documentation of this file.
1 /* Copyright (C) 2007-2021 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 SURICATA_DETECT_ENGINE_H
25 #define SURICATA_DETECT_ENGINE_H
26 
27 #include "detect.h"
28 #include "suricata.h"
29 
30 void InspectionBufferInit(InspectionBuffer *buffer, uint32_t initial_size);
31 void InspectionBufferSetup(DetectEngineThreadCtx *det_ctx, const int list_id,
32  InspectionBuffer *buffer, const uint8_t *data, const uint32_t data_len);
34 void *InspectionBufferCheckAndExpand(InspectionBuffer *buffer, uint32_t min_size);
35 void InspectionBufferTruncate(InspectionBuffer *buffer, uint32_t buf_len);
36 void InspectionBufferCopy(InspectionBuffer *buffer, uint8_t *buf, uint32_t buf_len);
38  const DetectEngineTransforms *transforms);
40 InspectionBuffer *InspectionBufferGet(DetectEngineThreadCtx *det_ctx, const int list_id);
43  const uint8_t *data, const uint32_t data_len);
45  DetectEngineThreadCtx *det_ctx, const int list_id, uint32_t local_id);
46 
47 /* start up registry funcs */
48 
49 int DetectBufferTypeRegister(const char *name);
50 int DetectBufferTypeGetByName(const char *name);
51 void DetectBufferTypeSupportsMpm(const char *name);
52 void DetectBufferTypeSupportsPacket(const char *name);
53 void DetectBufferTypeSupportsFrames(const char *name);
54 void DetectBufferTypeSupportsTransformations(const char *name);
55 void DetectBufferTypeSupportsMultiInstance(const char *name);
56 int DetectBufferTypeMaxId(void);
58 void DetectBufferTypeSetDescriptionByName(const char *name, const char *desc);
59 const char *DetectBufferTypeGetDescriptionByName(const char *name);
60 void DetectBufferTypeRegisterSetupCallback(const char *name,
61  void (*Callback)(const DetectEngineCtx *, Signature *));
62 void DetectBufferTypeRegisterValidateCallback(const char *name,
63  bool (*ValidateCallback)(const Signature *, const char **sigerror));
64 
65 /* detect engine related buffer funcs */
66 
68  const int direction, const AppProto alproto, const uint8_t frame_type);
70 const char *DetectEngineBufferTypeGetNameById(const DetectEngineCtx *de_ctx, const int id);
75  const DetectEngineCtx *de_ctx, const int id);
77 const char *DetectEngineBufferTypeGetDescriptionById(const DetectEngineCtx *de_ctx, const int id);
79  DetectEngineCtx *de_ctx, const int id, TransformData *transforms, int transform_cnt);
82  const DetectEngineCtx *de_ctx, const int id, const Signature *s, const char **sigerror);
84  const uint8_t *content, uint16_t content_len, const char **namestr);
89 
90 /* prototypes */
91 DetectEngineCtx *DetectEngineCtxInitWithPrefix(const char *prefix, uint32_t tenant_id);
96 
97 int DetectRegisterThreadCtxGlobalFuncs(const char *name,
98  void *(*InitFunc)(void *), void *data, void (*FreeFunc)(void *));
100 
101 TmEcode DetectEngineThreadCtxInit(ThreadVars *, void *, void **);
103 //inline uint32_t DetectEngineGetMaxSigId(DetectEngineCtx *);
104 /* faster as a macro than a inline function on my box -- VJ */
105 #define DetectEngineGetMaxSigId(de_ctx) ((de_ctx)->signum)
107 void DetectEngineRegisterTests(void);
109 
110 uint32_t DetectEngineGetVersion(void);
111 void DetectEngineBumpVersion(void);
114 DetectEngineCtx *DetectEngineGetByTenantId(uint32_t tenant_id);
115 void DetectEnginePruneFreeList(void);
117 void DetectEngineClearMaster(void);
120 int DetectEngineReload(const SCInstance *suri);
121 int DetectEngineEnabled(void);
122 int DetectEngineMTApply(void);
124 int DetectEngineMultiTenantSetup(const bool unix_socket);
125 
126 int DetectEngineReloadStart(void);
127 int DetectEngineReloadIsStart(void);
128 void DetectEngineReloadSetIdle(void);
129 int DetectEngineReloadIsIdle(void);
130 
131 int DetectEngineLoadTenantBlocking(uint32_t tenant_id, const char *yaml);
132 int DetectEngineReloadTenantBlocking(uint32_t tenant_id, const char *yaml, int reload_cnt);
133 int DetectEngineReloadTenantsBlocking(const int reload_cnt);
134 
135 int DetectEngineTenantRegisterLivedev(uint32_t tenant_id, int device_id);
136 int DetectEngineTenantRegisterVlanId(uint32_t tenant_id, uint16_t vlan_id);
137 int DetectEngineTenantUnregisterVlanId(uint32_t tenant_id, uint16_t vlan_id);
138 int DetectEngineTenantRegisterPcapFile(uint32_t tenant_id);
139 int DetectEngineTenantUnregisterPcapFile(uint32_t tenant_id);
140 
142  const struct DetectEngineAppInspectionEngine_ *, const Signature *, Flow *, uint8_t, void *,
143  void *, uint64_t);
144 
146  const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags,
147  void *alstate, void *txv, uint64_t tx_id);
148 
151  const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
152 
154  DetectEngineThreadCtx *det_ctx,
155  const DetectEnginePktInspectionEngine *engine,
156  const Signature *s, Packet *p, uint8_t *alert_flags);
157 
158 /**
159  * \brief Registers an app inspection engine.
160  *
161  * \param name Name of the detection list
162  * \param alproto App layer protocol for which we will register the engine.
163  * \param direction The direction for the engine: SIG_FLAG_TOSERVER or
164  * SIG_FLAG_TOCLIENT
165  * \param progress Minimal progress value for inspect engine to run
166  * \param Callback The engine callback.
167  */
168 void DetectAppLayerInspectEngineRegister(const char *name, AppProto alproto, uint32_t dir,
169  int progress, InspectEngineFuncPtr Callback2, InspectionBufferGetDataPtr GetData);
170 
171 void DetectAppLayerMultiRegister(const char *name, AppProto alproto, uint32_t dir, int progress,
172  InspectionMultiBufferGetDataPtr GetData, int priority, int tx_min_progress);
173 
174 void DetectPktInspectEngineRegister(const char *name,
177 
178 void DetectEngineFrameInspectEngineRegister(DetectEngineCtx *de_ctx, const char *name, int dir,
179  InspectionBufferFrameInspectFunc Callback, AppProto alproto, uint8_t type);
180 
183 
185  DetectEngineThreadCtx *det_ctx, const Signature *s,
186  Flow *f, Packet *p,
187  uint8_t *alert_flags);
189 
193 
194 bool DetectBufferIsPresent(const Signature *s, const uint32_t buf_id);
195 
198 SigMatch *DetectBufferGetFirstSigMatch(const Signature *s, const uint32_t buf_id);
199 SigMatch *DetectBufferGetLastSigMatch(const Signature *s, const uint32_t buf_id);
200 
202  ThreadVars *tv, DetectEngineCtx *new_de_ctx, int mt);
203 
204 void DetectRunStoreStateTx(const SigGroupHead *sgh, Flow *f, void *tx, uint64_t tx_id,
205  const Signature *s, uint32_t inspect_flags, uint8_t flow_flags,
206  const uint16_t file_no_match);
207 
209 
210 void DeStateRegisterTests(void);
211 
212 #endif /* SURICATA_DETECT_ENGINE_H */
DetectEngineMultiTenantSetup
int DetectEngineMultiTenantSetup(const bool unix_socket)
setup multi-detect / multi-tenancy
Definition: detect-engine.c:4280
DetectEngineAppInspectionEngine_
Definition: detect.h:429
DetectEngineReloadIsIdle
int DetectEngineReloadIsIdle(void)
Definition: detect-engine.c:2088
DetectBufferTypeRegister
int DetectBufferTypeRegister(const char *name)
Definition: detect-engine.c:1030
DetectEnginePktInspectionEngine
Definition: detect.h:488
DetectEngineBufferTypeRegister
int DetectEngineBufferTypeRegister(DetectEngineCtx *de_ctx, const char *name)
Definition: detect-engine.c:1181
InspectionBufferGet
InspectionBuffer * InspectionBufferGet(DetectEngineThreadCtx *det_ctx, const int list_id)
Definition: detect-engine.c:1501
SigGroupHead_
Container for matching data for a signature group.
Definition: detect.h:1465
DetectAppLayerInspectEngineRegister
void DetectAppLayerInspectEngineRegister(const char *name, AppProto alproto, uint32_t dir, int progress, InspectEngineFuncPtr Callback2, InspectionBufferGetDataPtr GetData)
Registers an app inspection engine.
Definition: detect-engine.c:240
DetectBufferTypeGetByName
int DetectBufferTypeGetByName(const char *name)
Definition: detect-engine.c:1094
DetectEngineTransforms
Definition: detect.h:408
DetectEnginePktInspectionRun
bool DetectEnginePktInspectionRun(ThreadVars *tv, DetectEngineThreadCtx *det_ctx, const Signature *s, Flow *f, Packet *p, uint8_t *alert_flags)
Definition: detect-engine.c:1970
InspectionBufferMultipleForListGet
InspectionBuffer * InspectionBufferMultipleForListGet(DetectEngineThreadCtx *det_ctx, const int list_id, uint32_t local_id)
for a InspectionBufferMultipleForList get a InspectionBuffer
Definition: detect-engine.c:1521
DetectBufferTypeSetDescriptionByName
void DetectBufferTypeSetDescriptionByName(const char *name, const char *desc)
Definition: detect-engine.c:1191
DetectEngineBufferTypeSupportsFrames
void DetectEngineBufferTypeSupportsFrames(DetectEngineCtx *de_ctx, const char *name)
Definition: detect-engine.c:1220
AppProto
uint16_t AppProto
Definition: app-layer-protos.h:81
InspectionMultiBufferGetDataPtr
InspectionBuffer *(* InspectionMultiBufferGetDataPtr)(struct DetectEngineThreadCtx_ *det_ctx, const DetectEngineTransforms *transforms, Flow *f, const uint8_t flow_flags, void *txv, const int list_id, const uint32_t local_id)
Definition: detect.h:419
InspectionBuffer
Definition: detect.h:373
DetectEngineTenantUnregisterPcapFile
int DetectEngineTenantUnregisterPcapFile(uint32_t tenant_id)
Definition: detect-engine.c:4582
Flow_
Flow data structure.
Definition: flow.h:356
DetectEngineInspectGenericList
uint8_t DetectEngineInspectGenericList(DetectEngineCtx *, DetectEngineThreadCtx *, const struct DetectEngineAppInspectionEngine_ *, const Signature *, Flow *, uint8_t, void *, void *, uint64_t)
Do the content inspection & validation for a signature.
Definition: detect-engine.c:2112
InspectionBufferFree
void InspectionBufferFree(InspectionBuffer *buffer)
Definition: detect-engine.c:1615
DetectEngineReference
DetectEngineCtx * DetectEngineReference(DetectEngineCtx *)
Definition: detect-engine.c:3851
InspectionBufferGetDataPtr
InspectionBuffer *(* InspectionBufferGetDataPtr)(struct DetectEngineThreadCtx_ *det_ctx, const DetectEngineTransforms *transforms, Flow *f, const uint8_t flow_flags, void *txv, const int list_id)
Definition: detect.h:414
DetectEngineAppInspectionEngine2Signature
int DetectEngineAppInspectionEngine2Signature(DetectEngineCtx *de_ctx, Signature *s)
Definition: detect-engine.c:729
DetectThreadCtxGetGlobalKeywordThreadCtx
void * DetectThreadCtxGetGlobalKeywordThreadCtx(DetectEngineThreadCtx *det_ctx, int id)
Retrieve thread local keyword ctx by id.
Definition: detect-engine.c:3783
DetectEngineCtx_
main detection engine ctx
Definition: detect.h:843
InspectionBufferCheckAndExpand
void * InspectionBufferCheckAndExpand(InspectionBuffer *buffer, uint32_t min_size)
make sure that the buffer has at least 'min_size' bytes Expand the buffer if necessary
Definition: detect-engine.c:1627
DetectEngineBufferTypeGetDescriptionById
const char * DetectEngineBufferTypeGetDescriptionById(const DetectEngineCtx *de_ctx, const int id)
Definition: detect-engine.c:1202
DetectEngineReloadIsStart
int DetectEngineReloadIsStart(void)
Definition: detect-engine.c:2068
DetectEngineResetMaxSigId
void DetectEngineResetMaxSigId(DetectEngineCtx *)
Definition: detect-engine.c:3043
InspectionBufferClean
void InspectionBufferClean(DetectEngineThreadCtx *det_ctx)
Definition: detect-engine.c:1473
InspectionBufferGetPktDataPtr
InspectionBuffer *(* InspectionBufferGetPktDataPtr)(struct DetectEngineThreadCtx_ *det_ctx, const DetectEngineTransforms *transforms, Packet *p, const int list_id)
Definition: detect.h:483
DetectEngineCtxInitWithPrefix
DetectEngineCtx * DetectEngineCtxInitWithPrefix(const char *prefix, uint32_t tenant_id)
Definition: detect-engine.c:2589
DetectEngineBufferTypeSupportsMultiInstanceGetById
bool DetectEngineBufferTypeSupportsMultiInstanceGetById(const DetectEngineCtx *de_ctx, const int id)
Definition: detect-engine.c:1252
DetectEnginePktInspectionSetup
int DetectEnginePktInspectionSetup(Signature *s)
Definition: detect-engine.c:2018
DetectBufferType_
Definition: detect.h:456
DetectEngineReload
int DetectEngineReload(const SCInstance *suri)
Reload the detection engine.
Definition: detect-engine.c:4770
DetectEngineLoadTenantBlocking
int DetectEngineLoadTenantBlocking(uint32_t tenant_id, const char *yaml)
Load a tenant and wait for loading to complete.
Definition: detect-engine.c:4117
DetectEngineCtxInit
DetectEngineCtx * DetectEngineCtxInit(void)
Definition: detect-engine.c:2584
DetectEngineTenantRegisterLivedev
int DetectEngineTenantRegisterLivedev(uint32_t tenant_id, int device_id)
Definition: detect-engine.c:4560
TransformData_
Definition: detect.h:403
DetectEnginePruneFreeList
void DetectEnginePruneFreeList(void)
Definition: detect-engine.c:4713
DetectEngineBufferTypeSupportsMpm
void DetectEngineBufferTypeSupportsMpm(DetectEngineCtx *de_ctx, const char *name)
Definition: detect-engine.c:1236
DetectBufferTypeGetDescriptionByName
const char * DetectBufferTypeGetDescriptionByName(const char *name)
Definition: detect-engine.c:1211
DetectBufferTypeRegisterSetupCallback
void DetectBufferTypeRegisterSetupCallback(const char *name, void(*Callback)(const DetectEngineCtx *, Signature *))
Definition: detect-engine.c:1288
InspectionBufferTruncate
void InspectionBufferTruncate(InspectionBuffer *buffer, uint32_t buf_len)
Definition: detect-engine.c:1647
DetectEngineCtxFree
void DetectEngineCtxFree(DetectEngineCtx *)
Free a DetectEngineCtx::
Definition: detect-engine.c:2623
DetectRunStoreStateTx
void DetectRunStoreStateTx(const SigGroupHead *sgh, Flow *f, void *tx, uint64_t tx_id, const Signature *s, uint32_t inspect_flags, uint8_t flow_flags, const uint16_t file_no_match)
Definition: detect-engine-state.c:214
DetectEngineGetByTenantId
DetectEngineCtx * DetectEngineGetByTenantId(uint32_t tenant_id)
Definition: detect-engine.c:4593
DetectEngineTenantUnregisterVlanId
int DetectEngineTenantUnregisterVlanId(uint32_t tenant_id, uint16_t vlan_id)
Definition: detect-engine.c:4571
DetectEngineThreadCtxInit
TmEcode DetectEngineThreadCtxInit(ThreadVars *, void *, void **)
initialize thread specific detection engine context
Definition: detect-engine.c:3365
DetectBufferTypeSupportsFrames
void DetectBufferTypeSupportsFrames(const char *name)
Definition: detect-engine.c:1054
DetectEngineUnsetParseMetadata
void DetectEngineUnsetParseMetadata(void)
Definition: detect-engine.c:4952
InspectionBufferSetup
void InspectionBufferSetup(DetectEngineThreadCtx *det_ctx, const int list_id, InspectionBuffer *buffer, const uint8_t *data, const uint32_t data_len)
setup the buffer with our initial data
Definition: detect-engine.c:1596
InspectionBufferPktInspectFunc
int(* InspectionBufferPktInspectFunc)(struct DetectEngineThreadCtx_ *, const struct DetectEnginePktInspectionEngine *engine, const struct Signature_ *s, Packet *p, uint8_t *alert_flags)
Definition: detect.h:476
DetectEngineBufferTypeSupportsTransformations
void DetectEngineBufferTypeSupportsTransformations(DetectEngineCtx *de_ctx, const char *name)
Definition: detect-engine.c:1244
DetectEngineBufferTypeSupportsMpmGetById
bool DetectEngineBufferTypeSupportsMpmGetById(const DetectEngineCtx *de_ctx, const int id)
Definition: detect-engine.c:1270
DetectSigmatchListEnumToString
const char * DetectSigmatchListEnumToString(enum DetectSigmatchListEnum type)
Definition: detect-engine.c:4962
DetectEngineBufferTypeGetByIdTransforms
int DetectEngineBufferTypeGetByIdTransforms(DetectEngineCtx *de_ctx, const int id, TransformData *transforms, int transform_cnt)
Definition: detect-engine.c:1825
de_ctx
DetectEngineCtx * de_ctx
Definition: fuzz_siginit.c:17
DetectEngineBufferTypeSupportsFramesGetById
bool DetectEngineBufferTypeSupportsFramesGetById(const DetectEngineCtx *de_ctx, const int id)
Definition: detect-engine.c:1279
DetectEngineReloadTenantBlocking
int DetectEngineReloadTenantBlocking(uint32_t tenant_id, const char *yaml, int reload_cnt)
Reload a tenant and wait for loading to complete.
Definition: detect-engine.c:4131
InspectionBufferCopy
void InspectionBufferCopy(InspectionBuffer *buffer, uint8_t *buf, uint32_t buf_len)
Definition: detect-engine.c:1656
DetectEngineThreadCtx_
Definition: detect.h:1098
DetectEngineReloadSetIdle
void DetectEngineReloadSetIdle(void)
Definition: detect-engine.c:2080
DetectEngineGetCurrent
DetectEngineCtx * DetectEngineGetCurrent(void)
Definition: detect-engine.c:3828
DetectEngineCtxInitStubForMT
DetectEngineCtx * DetectEngineCtxInitStubForMT(void)
Definition: detect-engine.c:2574
DetectEngineBufferTypeGetNameById
const char * DetectEngineBufferTypeGetNameById(const DetectEngineCtx *de_ctx, const int id)
Definition: detect-engine.c:1124
detect.h
ThreadVars_
Per thread variable structure.
Definition: threadvars.h:58
InspectionBufferApplyTransforms
void InspectionBufferApplyTransforms(InspectionBuffer *buffer, const DetectEngineTransforms *transforms)
Definition: detect-engine.c:1712
DetectEngineThreadCtxDeinit
TmEcode DetectEngineThreadCtxDeinit(ThreadVars *, void *)
Definition: detect-engine.c:3592
DetectEngineBufferRunValidateCallback
bool DetectEngineBufferRunValidateCallback(const DetectEngineCtx *de_ctx, const int id, const Signature *s, const char **sigerror)
Definition: detect-engine.c:1316
DetectEngineClearMaster
void DetectEngineClearMaster(void)
Definition: detect-engine.c:4743
DetectEngineDeReference
void DetectEngineDeReference(DetectEngineCtx **de_ctx)
Definition: detect-engine.c:4619
DetectEngineInspectBufferGeneric
uint8_t DetectEngineInspectBufferGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
Do the content inspection & validation for a signature.
Definition: detect-engine.c:2155
DetectEngineMustParseMetadata
int DetectEngineMustParseMetadata(void)
Definition: detect-engine.c:4957
DetectEngineInspectMultiBufferGeneric
uint8_t DetectEngineInspectMultiBufferGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const DetectEngineAppInspectionEngine *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
Definition: detect-engine.c:2214
InspectionBufferSetupMulti
void InspectionBufferSetupMulti(InspectionBuffer *buffer, const DetectEngineTransforms *transforms, const uint8_t *data, const uint32_t data_len)
setup the buffer with our initial data
Definition: detect-engine.c:1581
DetectEngineFrameInspectEngineRegister
void DetectEngineFrameInspectEngineRegister(DetectEngineCtx *de_ctx, const char *name, int dir, InspectionBufferFrameInspectFunc Callback, AppProto alproto, uint8_t type)
register inspect engine at start up time
Definition: detect-engine.c:379
DetectEngineGetVersion
uint32_t DetectEngineGetVersion(void)
Definition: detect-engine.c:3809
DetectEngineTenantRegisterVlanId
int DetectEngineTenantRegisterVlanId(uint32_t tenant_id, uint16_t vlan_id)
Definition: detect-engine.c:4566
DetectBufferGetActiveList
int DetectBufferGetActiveList(DetectEngineCtx *de_ctx, Signature *s)
Definition: detect-engine.c:1425
DetectBufferTypeSupportsTransformations
void DetectBufferTypeSupportsTransformations(const char *name)
Definition: detect-engine.c:1084
Packet_
Definition: decode.h:476
type
uint16_t type
Definition: decode-vlan.c:107
InspectionBufferFrameInspectFunc
int(* InspectionBufferFrameInspectFunc)(struct DetectEngineThreadCtx_ *, const struct DetectEngineFrameInspectionEngine *engine, const struct Signature_ *s, Packet *p, const struct Frames *frames, const struct Frame *frame)
Definition: detect.h:509
DetectEngineReloadStart
int DetectEngineReloadStart(void)
Definition: detect-engine.c:2054
DetectBufferTypeSupportsPacket
void DetectBufferTypeSupportsPacket(const char *name)
Definition: detect-engine.c:1064
TmEcode
TmEcode
Definition: tm-threads-common.h:79
InspectionBufferInit
void InspectionBufferInit(InspectionBuffer *buffer, uint32_t initial_size)
Definition: detect-engine.c:1558
InspectionBufferSetupMultiEmpty
void InspectionBufferSetupMultiEmpty(InspectionBuffer *buffer)
setup the buffer empty
Definition: detect-engine.c:1568
DetectEngineAddToMaster
int DetectEngineAddToMaster(DetectEngineCtx *de_ctx)
Definition: detect-engine.c:4643
DetectEngineBufferTypeSupportsPacketGetById
bool DetectEngineBufferTypeSupportsPacketGetById(const DetectEngineCtx *de_ctx, const int id)
Definition: detect-engine.c:1261
DetectBufferGetFirstSigMatch
SigMatch * DetectBufferGetFirstSigMatch(const Signature *s, const uint32_t buf_id)
Definition: detect-engine.c:1326
DetectEngineThreadCtxInitForReload
DetectEngineThreadCtx * DetectEngineThreadCtxInitForReload(ThreadVars *tv, DetectEngineCtx *new_de_ctx, int mt)
Definition: detect-engine.c:3444
DetectEngineStateResetTxs
void DetectEngineStateResetTxs(Flow *f)
Reset de state for active tx' To be used on detect engine reload.
Definition: detect-engine-state.c:260
InspectEngineFuncPtr
uint8_t(* InspectEngineFuncPtr)(struct DetectEngineCtx_ *de_ctx, struct DetectEngineThreadCtx_ *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const struct Signature_ *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
Definition: detect.h:424
flags
uint8_t flags
Definition: decode-gre.h:0
DetectPktInspectEngineRegister
void DetectPktInspectEngineRegister(const char *name, InspectionBufferGetPktDataPtr GetPktData, InspectionBufferPktInspectFunc Callback)
register inspect engine at start up time
Definition: detect-engine.c:130
DetectBufferTypeMaxId
int DetectBufferTypeMaxId(void)
Definition: detect-engine.c:922
DetectEngineSetParseMetadata
void DetectEngineSetParseMetadata(void)
Definition: detect-engine.c:4947
DetectEngineBufferTypeSupportsPacket
void DetectEngineBufferTypeSupportsPacket(DetectEngineCtx *de_ctx, const char *name)
Definition: detect-engine.c:1228
DetectEngineBufferRunSetupCallback
void DetectEngineBufferRunSetupCallback(const DetectEngineCtx *de_ctx, const int id, Signature *s)
Definition: detect-engine.c:1298
DetectEngineEnabled
int DetectEngineEnabled(void)
Check if detection is enabled.
Definition: detect-engine.c:3795
DetectEngineCtxInitStubForDD
DetectEngineCtx * DetectEngineCtxInitStubForDD(void)
Definition: detect-engine.c:2579
DetectBufferGetLastSigMatch
SigMatch * DetectBufferGetLastSigMatch(const Signature *s, const uint32_t buf_id)
Definition: detect-engine.c:1336
DetectBufferTypeCloseRegistration
void DetectBufferTypeCloseRegistration(void)
Definition: detect-engine.c:1818
tv
ThreadVars * tv
Definition: fuzz_decodepcapfile.c:32
DetectRegisterThreadCtxGlobalFuncs
int DetectRegisterThreadCtxGlobalFuncs(const char *name, void *(*InitFunc)(void *), void *data, void(*FreeFunc)(void *))
Register Thread keyword context Funcs (Global)
Definition: detect-engine.c:3739
DetectEngineMultiTenantEnabled
int DetectEngineMultiTenantEnabled(void)
Definition: detect-engine.c:3860
DetectEngineMoveToFreeList
int DetectEngineMoveToFreeList(DetectEngineCtx *de_ctx)
Definition: detect-engine.c:4703
Signature_
Signature container.
Definition: detect.h:603
SigMatch_
a single match condition for a signature
Definition: detect.h:349
DetectEngineMTApply
int DetectEngineMTApply(void)
Definition: detect-engine.c:4890
DetectEngineRegisterTests
void DetectEngineRegisterTests(void)
Definition: detect-engine.c:5199
DetectEngineReloadTenantsBlocking
int DetectEngineReloadTenantsBlocking(const int reload_cnt)
Reload all tenants and wait for loading to complete.
Definition: detect-engine.c:4145
suricata.h
DetectEngineBufferTypeRegisterWithFrameEngines
int DetectEngineBufferTypeRegisterWithFrameEngines(DetectEngineCtx *de_ctx, const char *name, const int direction, const AppProto alproto, const uint8_t frame_type)
Definition: detect-engine.c:1147
DetectEngineBufferTypeValidateTransform
bool DetectEngineBufferTypeValidateTransform(DetectEngineCtx *de_ctx, int sm_list, const uint8_t *content, uint16_t content_len, const char **namestr)
Check content byte array compatibility with transforms.
Definition: detect-engine.c:1687
DetectEngineInspectPktBufferGeneric
int DetectEngineInspectPktBufferGeneric(DetectEngineThreadCtx *det_ctx, const DetectEnginePktInspectionEngine *engine, const Signature *s, Packet *p, uint8_t *alert_flags)
Do the content inspection & validation for a signature.
Definition: detect-engine.c:2262
SCInstance_
Definition: suricata.h:123
DetectBufferIsPresent
bool DetectBufferIsPresent(const Signature *s, const uint32_t buf_id)
Definition: detect-engine.c:1347
DetectBufferTypeSupportsMpm
void DetectBufferTypeSupportsMpm(const char *name)
Definition: detect-engine.c:1074
DetectEngineBumpVersion
void DetectEngineBumpVersion(void)
Definition: detect-engine.c:3819
DetectSigmatchListEnum
DetectSigmatchListEnum
Definition: detect.h:112
DeStateRegisterTests
void DeStateRegisterTests(void)
Definition: detect-engine-state.c:1440
DetectEngineAppInspectionEngineSignatureFree
void DetectEngineAppInspectionEngineSignatureFree(DetectEngineCtx *, Signature *s)
free app inspect engines for a signature
Definition: detect-engine.c:816
DetectAppLayerMultiRegister
void DetectAppLayerMultiRegister(const char *name, AppProto alproto, uint32_t dir, int progress, InspectionMultiBufferGetDataPtr GetData, int priority, int tx_min_progress)
Definition: detect-engine.c:2205
DetectEngineTenantRegisterPcapFile
int DetectEngineTenantRegisterPcapFile(uint32_t tenant_id)
Definition: detect-engine.c:4576
DetectBufferSetActiveList
int WARN_UNUSED DetectBufferSetActiveList(DetectEngineCtx *de_ctx, Signature *s, const int list)
Definition: detect-engine.c:1357
WARN_UNUSED
#define WARN_UNUSED
Definition: suricata-common.h:403
DetectEngineBufferTypeGetById
const DetectBufferType * DetectEngineBufferTypeGetById(const DetectEngineCtx *de_ctx, const int id)
Definition: detect-engine.c:1114
DetectBufferTypeSupportsMultiInstance
void DetectBufferTypeSupportsMultiInstance(const char *name)
Definition: detect-engine.c:1044
DetectBufferTypeRegisterValidateCallback
void DetectBufferTypeRegisterValidateCallback(const char *name, bool(*ValidateCallback)(const Signature *, const char **sigerror))
Definition: detect-engine.c:1306