24#ifndef SURICATA_DETECT_H
25#define SURICATA_DETECT_H
46#define DETECT_MAX_RULE_SIZE 8192
48#define DETECT_TRANSFORMS_MAX 16
52#define DETECT_DEFAULT_PRIO 3
55#define PACKET_ALERT_NOTX UINT64_MAX
144#define DETECT_SM_LIST_NOTSET INT_MAX
162#define ADDRESS_FLAG_NOT 0x01
215#define PORT_FLAG_ANY 0x01
216#define PORT_FLAG_NOT 0x02
217#define PORT_SIGGROUPHEAD_COPY 0x04
241#define SIG_FLAG_SRC_ANY BIT_U32(0)
242#define SIG_FLAG_DST_ANY BIT_U32(1)
243#define SIG_FLAG_SP_ANY BIT_U32(2)
244#define SIG_FLAG_DP_ANY BIT_U32(3)
246#define SIG_FLAG_FIREWALL BIT_U32(4)
248#define SIG_FLAG_DSIZE BIT_U32(5)
249#define SIG_FLAG_APPLAYER BIT_U32(6)
250#define SIG_FLAG_TXBOTHDIR BIT_U32(7)
254#define SIG_FLAG_REQUIRE_PACKET BIT_U32(9)
255#define SIG_FLAG_REQUIRE_STREAM BIT_U32(10)
257#define SIG_FLAG_MPM_NEG BIT_U32(11)
259#define SIG_FLAG_FLUSH BIT_U32(12)
261#define SIG_FLAG_REQUIRE_STREAM_ONLY \
267#define SIG_FLAG_REQUIRE_FLOWVAR BIT_U32(17)
269#define SIG_FLAG_FILESTORE BIT_U32(18)
271#define SIG_FLAG_TOSERVER BIT_U32(19)
272#define SIG_FLAG_TOCLIENT BIT_U32(20)
274#define SIG_FLAG_TLSSTORE BIT_U32(21)
276#define SIG_FLAG_BYPASS BIT_U32(22)
278#define SIG_FLAG_PREFILTER BIT_U32(23)
283#define SIG_FLAG_SRC_IS_TARGET BIT_U32(25)
285#define SIG_FLAG_DEST_IS_TARGET BIT_U32(26)
287#define SIG_FLAG_HAS_TARGET (SIG_FLAG_DEST_IS_TARGET|SIG_FLAG_SRC_IS_TARGET)
291#define SIG_FLAG_INIT_PACKET BIT_U32(1)
292#define SIG_FLAG_INIT_FLOW BIT_U32(2)
293#define SIG_FLAG_INIT_BIDIREC BIT_U32(3)
294#define SIG_FLAG_INIT_FIRST_IPPROTO_SEEN \
296#define SIG_FLAG_INIT_STATE_MATCH BIT_U32(6)
297#define SIG_FLAG_INIT_NEED_FLUSH BIT_U32(7)
298#define SIG_FLAG_INIT_PRIO_EXPLICIT \
300#define SIG_FLAG_INIT_FILEDATA BIT_U32(9)
301#define SIG_FLAG_INIT_FORCE_TOCLIENT BIT_U32(10)
302#define SIG_FLAG_INIT_FORCE_TOSERVER BIT_U32(11)
304#define SIG_FLAG_INIT_TXDIR_STREAMING_TOSERVER \
306#define SIG_FLAG_INIT_TXDIR_FAST_TOCLIENT \
311#define SIG_MASK_REQUIRE_PAYLOAD BIT_U8(0)
312#define SIG_MASK_REQUIRE_FLOW BIT_U8(1)
313#define SIG_MASK_REQUIRE_FLAGS_INITDEINIT BIT_U8(2)
314#define SIG_MASK_REQUIRE_FLAGS_UNUSUAL BIT_U8(3)
315#define SIG_MASK_REQUIRE_NO_PAYLOAD BIT_U8(4)
316#define SIG_MASK_REQUIRE_REAL_PKT BIT_U8(5)
318#define SIG_MASK_REQUIRE_ENGINE_EVENT BIT_U8(7)
320#define FILE_SIG_NEED_FILE 0x01
321#define FILE_SIG_NEED_FILENAME 0x02
322#define FILE_SIG_NEED_MAGIC 0x04
323#define FILE_SIG_NEED_FILECONTENT 0x08
324#define FILE_SIG_NEED_MD5 0x10
325#define FILE_SIG_NEED_SHA1 0x20
326#define FILE_SIG_NEED_SHA256 0x40
327#define FILE_SIG_NEED_SIZE 0x80
400 Flow *f,
const uint8_t flow_flags,
401 void *txv,
const int list_id);
404 const void *txv,
const uint8_t flow_flags,
const uint8_t **buf, uint32_t *buf_len);
407 const void *txv,
const uint8_t flow_flags, uint32_t local_id,
const uint8_t **buf,
414 uint8_t
flags,
void *alstate,
void *txv, uint64_t tx_id);
475 Packet *p, uint8_t *alert_flags);
561#define DETECT_TABLE_PACKET_PRE_FLOW_FLAG BIT_U8(DETECT_TABLE_PACKET_PRE_FLOW)
562#define DETECT_TABLE_PACKET_PRE_STREAM_FLAG BIT_U8(DETECT_TABLE_PACKET_PRE_STREAM)
563#define DETECT_TABLE_PACKET_FILTER_FLAG BIT_U8(DETECT_TABLE_PACKET_FILTER)
564#define DETECT_TABLE_PACKET_TD_FLAG BIT_U8(DETECT_TABLE_PACKET_TD)
565#define DETECT_TABLE_APP_FILTER_FLAG BIT_U8(DETECT_TABLE_APP_FILTER)
566#define DETECT_TABLE_APP_TD_FLAG BIT_U8(DETECT_TABLE_APP_TD)
587#define SIG_ALPROTO_MAX 4
722 uint16_t profiling_id;
822#define DETECT_VAR_TYPE_FLOW_POSTMATCH 1
823#define DETECT_VAR_TYPE_PKT_POSTMATCH 2
886 void *(*InitFunc)(
void *);
929 uint8_t original_action, uint8_t new_action,
void *arg);
1042 struct SCProfileDetectCtx_ *profile_ctx;
1186#define ENGINE_SGH_MPM_FACTORY_CONTEXT_START_ID_RANGE (ENGINE_SGH_MPM_FACTORY_CONTEXT_AUTO + 1)
1189#define DETECT_FILESTORE_MAX 15
1231#define SIG_JSON_CONTENT_ARRAY_LEN 16
1232#define SIG_JSON_CONTENT_ITEM_LEN 1024
1233#define SIG_JSON_CONTENT_KEY_LEN 32
1388 uint64_t pkt_stream_add_cnt;
1389 uint64_t payload_mpm_cnt;
1390 uint64_t payload_mpm_size;
1391 uint64_t stream_mpm_cnt;
1392 uint64_t stream_mpm_size;
1393 uint64_t payload_persig_cnt;
1394 uint64_t payload_persig_size;
1395 uint64_t stream_persig_cnt;
1396 uint64_t stream_persig_size;
1399 struct SCProfileData_ *rule_perf_data;
1400 int rule_perf_data_size;
1401 uint32_t rule_perf_last_sync;
1425 uint8_t
flags,
void *alstate,
void *txv,
1438 void (*
TransformId)(
const uint8_t **data, uint32_t *length,
void *context);
1488#define SIG_GROUP_HEAD_HAVERAWSTREAM BIT_U16(0)
1490#define SIG_GROUP_HEAD_HAVEFILEMAGIC BIT_U16(1)
1492#define SIG_GROUP_HEAD_HAVEFILEMD5 BIT_U16(2)
1493#define SIG_GROUP_HEAD_HAVEFILESIZE BIT_U16(3)
1494#define SIG_GROUP_HEAD_HAVEFILESHA1 BIT_U16(4)
1495#define SIG_GROUP_HEAD_HAVEFILESHA256 BIT_U16(5)
1523 const struct Frames *frames,
const struct Frame *frame);
1651#define SIGMATCH_NOOPT BIT_U16(0)
1653#define SIGMATCH_IPONLY_COMPAT BIT_U16(1)
1655#define SIGMATCH_DEONLY_COMPAT BIT_U16(2)
1661#define SIGMATCH_OPTIONAL_OPT BIT_U16(4)
1664#define SIGMATCH_QUOTES_OPTIONAL BIT_U16(5)
1668#define SIGMATCH_QUOTES_MANDATORY BIT_U16(6)
1672#define SIGMATCH_HANDLE_NEGATION BIT_U16(7)
1674#define SIGMATCH_INFO_CONTENT_MODIFIER BIT_U16(8)
1676#define SIGMATCH_INFO_STICKY_BUFFER BIT_U16(9)
1678#define SIGMATCH_INFO_DEPRECATED BIT_U16(10)
1680#define SIGMATCH_STRICT_PARSING BIT_U16(11)
1682#define SIGMATCH_SUPPORT_FIREWALL BIT_U16(12)
1684#define SIGMATCH_SUPPORT_DIR BIT_U16(13)
struct HtpBodyChunk_ * next
struct AppLayerTxData AppLayerTxData
struct SignatureInitData_ SignatureInitData
struct DetectMatchAddressIPv6_ DetectMatchAddressIPv6
@ SIGNATURE_HOOK_PKT_NOT_SET
@ SIGNATURE_HOOK_PKT_PRE_STREAM
@ SIGNATURE_HOOK_PKT_PRE_FLOW
@ SIGNATURE_HOOK_PKT_FLOW_START
void DumpPatterns(DetectEngineCtx *de_ctx)
bool(* InspectionSingleBufferGetDataPtr)(const void *txv, const uint8_t flow_flags, const uint8_t **buf, uint32_t *buf_len)
void DisableDetectFlowFileFlags(Flow *f)
disable file features we don't need Called if we have no detection engine.
struct SigGroupHeadInitData_ SigGroupHeadInitData
struct SCDetectRequiresStatus SCDetectRequiresStatus
uint8_t DetectPreFlow(ThreadVars *tv, DetectEngineThreadCtx *det_ctx, Packet *p)
DetectEnginePrefilterSetting
struct IPOnlyCIDRItem_ IPOnlyCIDRItem
@ DETECT_ENGINE_TYPE_DD_STUB
@ DETECT_ENGINE_TYPE_MT_STUB
@ DETECT_ENGINE_TYPE_NORMAL
@ DETECT_ENGINE_TYPE_TENANT
int(* InspectionBufferPktInspectFunc)(struct DetectEngineThreadCtx_ *, const struct DetectEnginePktInspectionEngine *engine, const struct Signature_ *s, Packet *p, uint8_t *alert_flags)
struct MpmStore_ MpmStore
struct Signature_ Signature
Signature container.
char * DetectLoadCompleteSigPath(const DetectEngineCtx *, const char *sig_file)
Create the path if default-rule-path was specified.
struct TransformIdData_ TransformIdData
DetectEngineTenantSelectors
@ TENANT_SELECTOR_LIVEDEV
@ TENANT_SELECTOR_UNKNOWN
struct DetectAddress_ DetectAddress
address structure for use in the detection engine.
uint8_t(* DetectPacketHookFunc)(ThreadVars *tv, DetectEngineThreadCtx *det_ctx, Packet *p)
struct DetectEngineTenantMapping_ DetectEngineTenantMapping
InspectionBuffer *(* InspectionBufferGetPktDataPtr)(struct DetectEngineThreadCtx_ *det_ctx, const DetectEngineTransforms *transforms, Packet *p, const int list_id)
#define SIG_JSON_CONTENT_ITEM_LEN
#define DETECT_FILESTORE_MAX
struct DetectEngineMasterCtx_ DetectEngineMasterCtx
struct DetectEngineLookupFlow_ DetectEngineLookupFlow
struct DetectEngineAppInspectionEngine_ DetectEngineAppInspectionEngine
const struct SignatureProperties signature_properties[SIG_TYPE_MAX]
InspectionBuffer *(* InspectionBufferGetDataPtr)(struct DetectEngineThreadCtx_ *det_ctx, const DetectEngineTransforms *transforms, Flow *f, const uint8_t flow_flags, void *txv, const int list_id)
@ ENGINE_SGH_MPM_FACTORY_CONTEXT_SINGLE
@ ENGINE_SGH_MPM_FACTORY_CONTEXT_AUTO
@ ENGINE_SGH_MPM_FACTORY_CONTEXT_FULL
const SigGroupHead * SigMatchSignaturesGetSgh(const DetectEngineCtx *de_ctx, const Packet *p)
Get the SigGroupHead for a packet.
struct SignatureInitDataBuffer_ SignatureInitDataBuffer
void(* PrefilterFrameFn)(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p, const struct Frames *frames, const struct Frame *frame)
struct DetectVarList_ DetectVarList
TmEcode Detect(ThreadVars *tv, Packet *p, void *data)
Detection engine thread wrapper.
struct PrefilterEngine_ PrefilterEngine
void RuleMatchCandidateTxArrayInit(DetectEngineThreadCtx *det_ctx, uint32_t size)
@ DETECT_TABLE_PACKET_PRE_FLOW
@ DETECT_TABLE_PACKET_FILTER
@ DETECT_TABLE_APP_FILTER
@ DETECT_TABLE_PACKET_PRE_STREAM
void DetectMetadataHashFree(DetectEngineCtx *de_ctx)
struct SignatureNonPrefilterStore_ SignatureNonPrefilterStore
struct DetectEngineIPOnlyCtx_ DetectEngineIPOnlyCtx
IP only rules matching ctx.
void SCDetectEngineRegisterRateFilterCallback(SCDetectRateFilterFunc cb, void *arg)
Register a callback when a rate_filter has been applied to an alert.
struct SigMatchCtx_ SigMatchCtx
Used to start a pointer to SigMatch context Should never be dereferenced without casting to something...
void SigMatchSignatures(ThreadVars *th_v, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, Packet *p)
wrapper for old tests
struct SigGroupHead_ SigGroupHead
Container for matching data for a signature group.
SigMatch * SigMatchAlloc(void)
uint8_t(* SCDetectRateFilterFunc)(const Packet *p, uint32_t sid, uint32_t gid, uint32_t rev, uint8_t original_action, uint8_t new_action, void *arg)
Function type for rate filter callback.
struct DetectMatchAddressIPv4_ DetectMatchAddressIPv4
#define DETECT_TRANSFORMS_MAX
void DetectEngineSetEvent(DetectEngineThreadCtx *det_ctx, uint8_t e)
int SignatureIsIPOnly(DetectEngineCtx *de_ctx, const Signature *s)
Test is a initialized signature is IP only.
int SigLoadSignatures(DetectEngineCtx *, char *, bool)
Load signatures.
void * DetectThreadCtxGetKeywordThreadCtx(DetectEngineThreadCtx *, int)
Retrieve thread local keyword ctx by id.
struct SigString_ SigString
@ FILE_DECODER_EVENT_NO_MEM
@ FILE_DECODER_EVENT_LZMA_IO_ERROR
@ FILE_DECODER_EVENT_LZMA_HEADER_TOO_SHORT_ERROR
@ FILE_DECODER_EVENT_Z_UNKNOWN_ERROR
@ DETECT_EVENT_POST_MATCH_QUEUE_FAILED
@ FILE_DECODER_EVENT_LZMA_UNKNOWN_ERROR
@ FILE_DECODER_EVENT_Z_BUF_ERROR
@ DETECT_EVENT_TOO_MANY_BUFFERS
@ FILE_DECODER_EVENT_LZMA_XZ_ERROR
@ FILE_DECODER_EVENT_INVALID_SWF_VERSION
@ FILE_DECODER_EVENT_LZMA_DECODER_ERROR
@ FILE_DECODER_EVENT_INVALID_SWF_LENGTH
@ FILE_DECODER_EVENT_Z_STREAM_ERROR
@ FILE_DECODER_EVENT_LZMA_MEMLIMIT_ERROR
@ FILE_DECODER_EVENT_Z_DATA_ERROR
struct SignatureHook_ SignatureHook
struct DetectEngineThreadCtx_ DetectEngineThreadCtx
struct SCFPSupportSMList_ SCFPSupportSMList
void(* PrefilterTxFn)(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p, Flow *f, void *tx, const uint64_t tx_id, const AppLayerTxData *tx_data, const uint8_t flags)
struct DetectBufferType_ DetectBufferType
Signature * SigFindSignatureBySidGid(DetectEngineCtx *, uint32_t, uint32_t)
Find a specific signature by sid and gid.
struct DetectReplaceList_ DetectReplaceList
void SigMatchFree(DetectEngineCtx *, SigMatch *sm)
free a SigMatch
SignaturePropertyFlowAction
@ SIG_PROP_FLOW_ACTION_FLOW
@ SIG_PROP_FLOW_ACTION_PACKET
@ SIG_PROP_FLOW_ACTION_FLOW_IF_STATEFUL
struct DetectBufferMpmRegistry_ DetectBufferMpmRegistry
one time registration of keywords at start up
bool(* InspectionMultiBufferGetDataPtr)(struct DetectEngineThreadCtx_ *det_ctx, const void *txv, const uint8_t flow_flags, uint32_t local_id, const uint8_t **buf, uint32_t *buf_len)
void(* PrefilterPktFn)(DetectEngineThreadCtx *det_ctx, Packet *p, const void *pectx)
struct DetectEngineThreadKeywordCtxItem_ DetectEngineThreadKeywordCtxItem
int DetectFlowbitsAnalyze(DetectEngineCtx *de_ctx)
uint8_t DetectPreStream(ThreadVars *tv, DetectEngineThreadCtx *det_ctx, Packet *p)
void * DetectGetInnerTx(void *tx_ptr, AppProto alproto, AppProto engine_alproto, uint8_t flow_flags)
struct SigMatch_ SigMatch
a single match condition for a signature
struct SigFileLoaderStat_ SigFileLoaderStat
Signature loader statistics.
struct DetectPort_ DetectPort
Port structure for detection engine.
struct SigMatchData_ SigMatchData
Data needed for Match()
struct PrefilterEngineList_ PrefilterEngineList
struct DetectAddressHead_ DetectAddressHead
struct TransformData_ TransformData
@ DETECT_SM_LIST_BASE64_DATA
@ DETECT_SM_LIST_THRESHOLD
@ DETECT_SM_LIST_SUPPRESS
@ DETECT_SM_LIST_POSTMATCH
@ DETECT_SM_LIST_DYNAMIC_START
int DetectUnregisterThreadCtxFuncs(DetectEngineCtx *, void *data, const char *name)
Remove Thread keyword context registration.
struct SigTableElmt_ SigTableElmt
element in sigmatch type table.
@ SIGNATURE_HOOK_TYPE_PKT
@ SIGNATURE_HOOK_TYPE_APP
@ SIGNATURE_HOOK_TYPE_NOT_SET
SigTableElmt * sigmatch_table
@ DETECT_BUFFER_MPM_TYPE_FRAME
@ DETECT_BUFFER_MPM_TYPE_APP
@ DETECT_BUFFER_MPM_TYPE_SIZE
@ DETECT_BUFFER_MPM_TYPE_PKT
int(* InspectionBufferFrameInspectFunc)(struct DetectEngineThreadCtx_ *, const struct DetectEngineFrameInspectionEngine *engine, const struct Signature_ *s, Packet *p, const struct Frames *frames, const struct Frame *frame)
int DetectMetadataHashInit(DetectEngineCtx *de_ctx)
void SigRegisterTests(void)
int DetectRegisterThreadCtxFuncs(DetectEngineCtx *, const char *name, void *(*InitFunc)(void *), void *data, void(*FreeFunc)(void *), int)
Register Thread keyword context Funcs.
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)
void RuleMatchCandidateTxArrayFree(DetectEngineThreadCtx *det_ctx)
struct DetectEngineCtx_ DetectEngineCtx
main detection engine ctx
Data structure to store app layer decoder events.
DetectAddress * ipv6_head
DetectAddress * ipv4_head
address structure for use in the detection engine.
struct DetectAddress_ * next
struct DetectAddress_ * prev
one time registration of keywords at start up
InspectionMultiBufferGetDataPtr GetMultiData
InspectionBufferGetDataPtr GetData
struct DetectBufferMpmRegistry_::@98::@102 frame_v1
struct DetectBufferMpmRegistry_::@98::@101 pkt_v1
enum DetectBufferMpmType type
DetectEngineTransforms transforms
struct DetectBufferMpmRegistry_::@98::@100 app_v2
struct DetectBufferMpmRegistry_ * next
InspectionSingleBufferGetDataPtr GetDataSingle
InspectionBufferGetPktDataPtr GetData
int(* PrefilterRegisterWithListId)(struct DetectEngineCtx_ *de_ctx, struct SigGroupHead_ *sgh, MpmCtx *mpm_ctx, const struct DetectBufferMpmRegistry_ *mpm_reg, int list_id)
bool(* ValidateCallback)(const struct Signature_ *, const char **sigerror, const struct DetectBufferType_ *)
void(* SetupCallback)(const struct DetectEngineCtx_ *, struct Signature_ *)
DetectEngineTransforms transforms
TransformIdData xform_id[DETECT_TRANSFORMS_MAX]
const DetectEngineTransforms * transforms
InspectionBufferGetDataPtr GetData
InspectionMultiBufferGetDataPtr GetMultiData
struct DetectEngineAppInspectionEngine_ * next
InspectEngineFuncPtr Callback
struct DetectEngineAppInspectionEngine_::@90 v2
InspectionSingleBufferGetDataPtr GetDataSingle
main detection engine ctx
int32_t sgh_mpm_context_proto_other_packet
struct EngineAnalysisCtx_ * ea
DetectEngineFrameInspectionEngine * frame_inspect_engines
SpmGlobalThreadCtx * spm_global_thread_ctx
HashListTable * address_table
pcre2_match_data * reference_conf_regex_match
DetectBufferMpmRegistry * pkt_mpms_list
DetectBufferMpmRegistry * app_mpms_list
HashListTable * prefilter_hash_table
DetectEngineIPOnlyCtx io_ctx
HashTable * reference_conf_ht
HashTable * class_conf_ht
struct SigGroupHead_ * pre_stream_sgh[2]
DetectFileDataCfg * filedata_config
DetectPacketHookFunc PreFlowHook
int inspection_recursion_limit
bool * sm_types_silent_error
uint32_t frame_mpms_list_cnt
struct SCProfileKeywordDetectCtx_ * profile_keyword_ctx
int32_t sgh_mpm_context_stream
const char * firewall_rule_file_exclusive
uint32_t pkt_mpms_list_cnt
struct SigGroupHead_ ** sgh_array
DetectPort * udp_priorityports
SigFileLoaderStat sig_stat
enum DetectEnginePrefilterSetting prefilter_setting
HashListTable * buffer_type_hash_name
HashListTable * buffer_type_hash_id
pcre2_code * reference_conf_regex
HashListTable * pattern_hash_table
struct SCProfileKeywordDetectCtx_ ** profile_keyword_ctx_per_list
struct SCSigOrderFunc_ * sc_sig_order_funcs
HashListTable * dport_hash_table
void * rate_filter_callback_arg
uint32_t profile_match_logging_threshold
int32_t byte_extract_max_local_id
SCFPSupportSMList * fp_support_smlist_list
struct SigGroupHead_ * pre_flow_sgh
int32_t sgh_mpm_context_proto_tcp_packet
int32_t sgh_mpm_context_proto_udp_packet
uint8_t guess_applayer_log_limit
MpmCtxFactoryContainer * mpm_ctx_factory_container
bool * sm_types_prefilter
DetectPort * tcp_priorityports
uint16_t max_uniq_toclient_groups
uint16_t base64_decode_max_len
uint16_t max_uniq_toserver_groups
SCDetectRequiresStatus * requirements
HashListTable * dup_sig_hash_table
DetectBufferMpmRegistry * frame_mpms_list
struct SCProfilePrefilterDetectCtx_ * profile_prefilter_ctx
pcre2_code * class_conf_regex
enum DetectEngineType type
struct SigGroupHead_ * decoder_event_sgh
HashListTable * keyword_hash
HashTable * metadata_table
DetectEngineAppInspectionEngine * app_inspect_engines
uint32_t app_mpms_list_cnt
SRepCIDRTree * srepCIDR_ctx
DetectEngineLookupFlow flow_gh[FLOW_STATES]
struct DetectEngineCtx_ * next
DetectPacketHookFunc PreStreamHook
SCDetectRateFilterFunc RateFilterCallback
struct SCProfileSghDetectCtx_ * profile_sgh_ctx
HashTable * non_pf_engine_names
int filemagic_thread_ctx_id
HashListTable * mpm_hash_table
HashListTable * sgh_hash_table
pcre2_match_data * class_conf_regex_match
struct timeval last_reload
DetectEnginePktInspectionEngine * pkt_inspect_engines
struct DetectEngineFrameInspectionEngine * next
InspectionBufferFrameInspectFunc Callback
struct DetectEngineFrameInspectionEngine::@94 v1
const DetectEngineTransforms * transforms
IP only rules matching ctx.
SCRadix6Tree tree_ipv6dst
SCRadix4Tree tree_ipv4src
SCRadix6Tree tree_ipv6src
uint32_t sig_mapping_size
SCRadix4Tree tree_ipv4dst
struct SigGroupHead_ * sgh[256]
DetectEngineTenantMapping * tenant_mapping_list
enum DetectEngineTenantSelectors tenant_selector
DetectEngineThreadKeywordCtxItem * keyword_list
DetectEngineCtx * free_list
InspectionBufferGetPktDataPtr GetData
struct DetectEnginePktInspectionEngine * next
InspectionBufferPktInspectFunc Callback
const DetectEngineTransforms * transforms
struct DetectEnginePktInspectionEngine::@93 v1
struct DetectEngineTenantMapping_ * next
uint16_t alert_queue_size
SpmThreadCtx * spm_thread_ctx
uint32_t(* TenantGetId)(const void *, const Packet *p)
uint32_t tx_candidates_size
RuleMatchCandidateTx * tx_candidates
uint16_t counter_nonmpm_list
int global_keyword_ctxs_size
uint16_t alert_queue_capacity
uint32_t * to_clear_queue
PacketAlert * alert_queue
uint32_t tenant_array_size
uint16_t counter_match_list
struct SCProfileSghData_ * sgh_perf_data
HashTable * mt_det_ctxs_hash
uint16_t lua_blocked_function_errors
struct SCProfileKeywordData_ ** keyword_perf_data_per_list
uint16_t lua_memory_limit_errors
struct SCProfileKeywordData_ * keyword_perf_data
uint16_t counter_fnonmpm_list
struct DetectEngineThreadCtx_ ** mt_det_ctxs
uint64_t frame_inspect_progress
struct DetectEngineThreadCtx_::@110 multi_inspect
struct DetectEngineThreadCtx_::@111 filestore[DETECT_FILESTORE_MAX]
void ** keyword_ctxs_array
uint32_t pcre_match_start_offset
uint64_t prefilter_bytes_called
uint16_t counter_alerts_suppressed
uint16_t lua_instruction_limit_errors
void ** global_keyword_ctxs_array
struct DetectEngineThreadCtx_::@109 inspect
SC_ATOMIC_DECLARE(int, so_far_used_by_detect)
struct SCProfilePrefilterData_ * prefilter_perf_data
SigJsonContent * json_content
uint16_t counter_alerts_overflow
PostRuleMatchWorkQueue post_rule_work_queue
AppLayerDecoderEvents * decoder_events
struct DetectEngineTenantMapping_ * tenant_array
DetectReplaceList * replist
uint64_t raw_stream_progress
uint16_t counter_mpm_list
InspectionBuffer * buffers
InspectionBufferMultipleForList * buffers
uint8_t json_content_capacity
struct DetectEngineThreadKeywordCtxItem_ * next
uint32_t content_inspect_min_size
const struct DetectContentData_ * cd
Port structure for detection engine.
struct DetectPort_ * next
struct DetectPort_ * last
struct DetectPort_ * prev
struct SigGroupHead_ * sh
Signature reference list.
const struct DetectContentData_ * cd
struct DetectReplaceList_ * next
struct DetectVarList_ * next
struct IPOnlyCIDRItem_ * next
InspectionBuffer * inspection_buffers
enum MpmBuiltinBuffers buffer
PostRuleMatchWorkQueueItem * q
PrefilterTxFn PrefilterTx
enum SignatureHookPkt pkt_hook
PrefilterFrameFn PrefilterFrame
struct PrefilterEngineList_ * next
void(* PrefilterPostRule)(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p, Flow *f)
void(* Free)(void *pectx)
union PrefilterEngine_::@113 cb
PrefilterTxFn PrefilterTx
bool is_last_for_progress
union PrefilterEngine_::@112 ctx
void(* PrefilterPostRule)(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p, Flow *f)
PrefilterFrameFn PrefilterFrame
struct PrefilterEngine_::@112::@114 pkt
structure for storing potential rule matches
struct SCFPSupportSMList_ * next
Structure for the radix tree.
Structure for the radix tree.
Structure holding the signature ordering function used by the signature ordering module.
Signature loader statistics.
TAILQ_HEAD(, SigString_) failed_sigs
MpmStore mpm_store[MPMB_MAX]
PrefilterEngineList * frame_engines
PrefilterEngineList * post_rule_match_engines
PrefilterEngineList * pkt_engines
PrefilterEngineList * tx_engines
PrefilterEngineList * payload_engines
Container for matching data for a signature group.
PrefilterEngine * payload_engines
SigGroupHeadInitData * init
PrefilterEngine * frame_engines
PrefilterEngine * tx_engines
PrefilterEngine * post_rule_match_engines
PrefilterEngine * pkt_engines
char json_content[SIG_JSON_CONTENT_ITEM_LEN]
Used to start a pointer to SigMatch context Should never be dereferenced without casting to something...
a single match condition for a signature
TAILQ_ENTRY(SigString_) next
element in sigmatch type table.
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
int(* SetupPrefilter)(DetectEngineCtx *de_ctx, struct SigGroupHead_ *sgh)
void(* Free)(DetectEngineCtx *, void *)
int(* AppLayerTxMatch)(DetectEngineThreadCtx *, Flow *, uint8_t flags, void *alstate, void *txv, const Signature *, const SigMatchCtx *)
void(* RegisterTests)(void)
int(* Match)(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *)
void(* Cleanup)(struct SigTableElmt_ *)
bool(* TransformValidate)(const uint8_t *content, uint16_t content_len, void *context)
void(* TransformId)(const uint8_t **data, uint32_t *length, void *context)
void(* Transform)(DetectEngineThreadCtx *, InspectionBuffer *, void *context)
int(* FileMatch)(DetectEngineThreadCtx *, Flow *, uint8_t flags, File *, const Signature *, const SigMatchCtx *)
bool(* SupportsPrefilter)(const Signature *s)
struct SignatureHook_::@95::@97 pkt
union SignatureHook_::@95 t
struct SignatureHook_::@95::@96 app
enum SignatureHookType type
uint32_t max_content_list_id
uint32_t * rule_state_dependant_sids_array
bool is_rule_state_dependant
uint32_t rule_state_flowbits_ids_size
bool has_possible_prefilter
bool src_contains_negation
struct SigMatch_ * smlists[DETECT_SM_LIST_MAX]
bool dst_contains_negation
uint32_t * rule_state_flowbits_ids_array
AppProto alprotos[SIG_ALPROTO_MAX]
struct SigMatch_ * smlists_tail[DETECT_SM_LIST_MAX]
uint32_t rule_state_dependant_sids_idx
const DetectAddressHead * dst
IPOnlyCIDRItem * cidr_dst
IPOnlyCIDRItem * cidr_src
const DetectAddressHead * src
SignatureInitDataBuffer * buffers
uint32_t rule_state_dependant_sids_size
DetectEngineTransforms transforms
SignatureInitDataBuffer * curbuf
enum SignaturePropertyFlowAction flow_action
DetectEngineFrameInspectionEngine * frame_inspect
SignatureInitData * init_data
DetectEnginePktInspectionEngine * pkt_inspect
uint16_t addr_dst_match6_cnt
DetectReference * references
DetectMatchAddressIPv4 * addr_src_match4
uint16_t addr_src_match4_cnt
uint16_t addr_src_match6_cnt
uint16_t addr_dst_match4_cnt
DetectEngineAppInspectionEngine * app_inspect
DetectMetadataHead * metadata
DetectMatchAddressIPv6 * addr_dst_match6
const struct DetectFilestoreData_ * filestore_ctx
DetectMatchAddressIPv6 * addr_src_match6
uint8_t app_progress_hook
SigMatchData * sm_arrays[DETECT_SM_LIST_MAX]
DetectMatchAddressIPv4 * addr_dst_match4
Per thread variable structure.