suricata
detect.h
Go to the documentation of this file.
1 /* Copyright (C) 2007-2025 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_H
25 #define SURICATA_DETECT_H
26 
27 #include "suricata-common.h"
28 #include "flow.h"
29 
30 #include "detect-engine-proto.h"
31 #include "detect-reference.h"
32 #include "detect-metadata.h"
33 #include "detect-engine-register.h"
34 
35 #include "util-prefilter.h"
36 #include "util-mpm.h"
37 #include "util-spm.h"
38 #include "util-hash.h"
39 #include "util-hashlist.h"
40 #include "util-radix4-tree.h"
41 #include "util-radix6-tree.h"
42 #include "util-file.h"
43 #include "reputation.h"
44 
45 #define DETECT_MAX_RULE_SIZE 8192
46 
47 #define DETECT_TRANSFORMS_MAX 16
48 
49 /** default rule priority if not set through priority keyword or via
50  * classtype. */
51 #define DETECT_DEFAULT_PRIO 3
52 
53 // tx_id value to use when there is no transaction
54 #define PACKET_ALERT_NOTX UINT64_MAX
55 
56 /* forward declaration for sigorder logic in detect-engine-sigorder.[ch] */
57 struct SCSigOrderFunc_;
58 
59 /* Forward declarations for structures from Rust. */
61 
62 // rule types documentation tag start: SignatureType
65  SIG_TYPE_IPONLY, // rule is handled by IPONLY engine
66  SIG_TYPE_LIKE_IPONLY, // rule is handled by pkt engine, has action effect like ip-only
67  /** Proto detect only signature.
68  * Inspected once per direction when protocol detection is done. */
69  SIG_TYPE_PDONLY, // rule is handled by PDONLY engine
74 
75  SIG_TYPE_APPLAYER, // app-layer but not tx, e.g. appproto
76  SIG_TYPE_APP_TX, // rule is handled by TX engine
77 
79 };
80 // rule types documentation tag end: SignatureType
81 
86 };
87 
90 };
91 
93 
94 /*
95  The detection engine groups similar signatures/rules together. Internally a
96  tree of different types of data is created on initialization. This is it's
97  global layout:
98 
99  For TCP/UDP
100 
101  - Flow direction
102  -- Protocol
103  -=- Dst port
104 
105  For the other protocols
106 
107  - Flow direction
108  -- Protocol
109 */
110 
111 /* holds the values for different possible lists in struct Signature.
112  * These codes are access points to particular lists in the array
113  * Signature->init_data->smlists[DETECT_SM_LIST_MAX]. */
115  /* list for non-payload per packet matches, e.g. ttl, flow keyword */
117  /* list for payload and stream match */
119 
120  /* base64_data keyword uses some hardcoded logic so consider
121  * built-in
122  * TODO convert to inspect engine */
124 
125  /* list for post match actions: flowbit set, flowint increment, etc */
127 
128  DETECT_SM_LIST_TMATCH, /**< post-detection tagging */
129 
130  /* lists for alert thresholding and suppression */
133 
135 
136  /* start of dynamically registered lists */
138 };
139 
140 /* used for Signature->list, which indicates which list
141  * we're adding keywords to in cases of sticky buffers like
142  * file_data */
143 #define DETECT_SM_LIST_NOTSET INT_MAX
144 
145 /*
146  * DETECT ADDRESS
147  */
148 
149 /* a is ... than b */
150 enum {
151  ADDRESS_ER = -1, /**< error e.g. compare ipv4 and ipv6 */
152  ADDRESS_LT, /**< smaller [aaa] [bbb] */
153  ADDRESS_LE, /**< smaller with overlap [aa[bab]bb] */
154  ADDRESS_EQ, /**< exactly equal [abababab] */
155  ADDRESS_ES, /**< within [bb[aaa]bb] and [[abab]bbb] and [bbb[abab]] */
156  ADDRESS_EB, /**< completely overlaps [aa[bbb]aa] and [[baba]aaa] and [aaa[baba]] */
157  ADDRESS_GE, /**< bigger with overlap [bb[aba]aa] */
158  ADDRESS_GT, /**< bigger [bbb] [aaa] */
159 };
160 
161 #define ADDRESS_FLAG_NOT 0x01 /**< address is negated */
162 
163 /** \brief address structure for use in the detection engine.
164  *
165  * Contains the address information and matching information.
166  */
167 typedef struct DetectAddress_ {
168  /** address data for this group */
171 
172  /** flags affecting this address */
173  uint8_t flags;
174 
175  /** ptr to the previous address in the list */
177  /** ptr to the next address in the list */
180 
181 /** Address grouping head. IPv4 and IPv6 are split out */
182 typedef struct DetectAddressHead_ {
186 
187 
188 typedef struct DetectMatchAddressIPv4_ {
189  uint32_t ip; /**< address in host order, start of range */
190  uint32_t ip2; /**< address in host order, end of range */
192 
193 typedef struct DetectMatchAddressIPv6_ {
194  uint32_t ip[4];
195  uint32_t ip2[4];
197 
198 /*
199  * DETECT PORT
200  */
201 
202 /* a is ... than b */
203 enum {
204  PORT_ER = -1, /* error */
205  PORT_LT, /* smaller [aaa] [bbb] */
206  PORT_LE, /* smaller with overlap [aa[bab]bb] */
207  PORT_EQ, /* exactly equal [abababab] */
208  PORT_ES, /* within [bb[aaa]bb] and [[abab]bbb] and [bbb[abab]] */
209  PORT_EB, /* completely overlaps [aa[bbb]aa] and [[baba]aaa] and [aaa[baba]] */
210  PORT_GE, /* bigger with overlap [bb[aba]aa] */
211  PORT_GT, /* bigger [bbb] [aaa] */
212 };
213 
214 #define PORT_FLAG_ANY 0x01 /**< 'any' special port */
215 #define PORT_FLAG_NOT 0x02 /**< negated port */
216 #define PORT_SIGGROUPHEAD_COPY 0x04 /**< sgh is a ptr copy */
217 
218 /** \brief Port structure for detection engine */
219 typedef struct DetectPort_ {
220  uint16_t port;
221  uint16_t port2;
222 
223  uint8_t flags; /**< flags for this port */
224 
225  /* signatures that belong in this group
226  *
227  * If the PORT_SIGGROUPHEAD_COPY flag is set, we don't own this pointer
228  * (memory is freed elsewhere).
229  */
230  struct SigGroupHead_ *sh;
231 
232  struct DetectPort_ *prev;
233  struct DetectPort_ *next;
234  struct DetectPort_ *last; /* Pointer to the last node in the list */
236 
237 /* Signature flags */
238 /** \note: additions should be added to the rule analyzer as well */
239 
240 #define SIG_FLAG_SRC_ANY BIT_U32(0) /**< source is any */
241 #define SIG_FLAG_DST_ANY BIT_U32(1) /**< destination is any */
242 #define SIG_FLAG_SP_ANY BIT_U32(2) /**< source port is any */
243 #define SIG_FLAG_DP_ANY BIT_U32(3) /**< destination port is any */
244 
245 #define SIG_FLAG_FIREWALL BIT_U32(4) /**< sig is a firewall rule */
246 
247 #define SIG_FLAG_DSIZE BIT_U32(5) /**< signature has a dsize setting */
248 #define SIG_FLAG_APPLAYER BIT_U32(6) /**< signature applies to app layer instead of packets */
249 #define SIG_FLAG_TXBOTHDIR BIT_U32(7) /**< signature needs tx with both directions to match */
250 
251 // vacancy
252 
253 #define SIG_FLAG_REQUIRE_PACKET BIT_U32(9) /**< signature is requiring packet match */
254 #define SIG_FLAG_REQUIRE_STREAM BIT_U32(10) /**< signature is requiring stream match */
255 
256 #define SIG_FLAG_MPM_NEG BIT_U32(11)
257 
258 #define SIG_FLAG_FLUSH BIT_U32(12) /**< detection logic needs stream flush notification */
259 
260 #define SIG_FLAG_REQUIRE_STREAM_ONLY \
261  BIT_U32(13) /**< signature is requiring stream match. Stream match is not optional, so no \
262  fallback to packet payload. */
263 
264 // vacancies
265 
266 #define SIG_FLAG_REQUIRE_FLOWVAR BIT_U32(17) /**< signature can only match if a flowbit, flowvar or flowint is available. */
267 
268 #define SIG_FLAG_FILESTORE BIT_U32(18) /**< signature has filestore keyword */
269 
270 #define SIG_FLAG_TOSERVER BIT_U32(19)
271 #define SIG_FLAG_TOCLIENT BIT_U32(20)
272 
273 #define SIG_FLAG_TLSSTORE BIT_U32(21)
274 
275 #define SIG_FLAG_BYPASS BIT_U32(22)
276 
277 #define SIG_FLAG_PREFILTER BIT_U32(23) /**< sig is part of a prefilter engine */
278 
279 // vacancy
280 
281 /** Info for Source and Target identification */
282 #define SIG_FLAG_SRC_IS_TARGET BIT_U32(25)
283 /** Info for Source and Target identification */
284 #define SIG_FLAG_DEST_IS_TARGET BIT_U32(26)
285 
286 #define SIG_FLAG_HAS_TARGET (SIG_FLAG_DEST_IS_TARGET|SIG_FLAG_SRC_IS_TARGET)
287 
288 /* signature init flags */
289 // available 0
290 #define SIG_FLAG_INIT_PACKET BIT_U32(1) /**< signature has matches against a packet (as opposed to app layer) */
291 #define SIG_FLAG_INIT_FLOW BIT_U32(2) /**< signature has a flow setting */
292 #define SIG_FLAG_INIT_BIDIREC BIT_U32(3) /**< signature has bidirectional operator */
293 #define SIG_FLAG_INIT_FIRST_IPPROTO_SEEN \
294  BIT_U32(4) /** < signature has seen the first ip_proto keyword */
295 #define SIG_FLAG_INIT_STATE_MATCH BIT_U32(6) /**< signature has matches that require stateful inspection */
296 #define SIG_FLAG_INIT_NEED_FLUSH BIT_U32(7)
297 #define SIG_FLAG_INIT_PRIO_EXPLICIT \
298  BIT_U32(8) /**< priority is explicitly set by the priority keyword */
299 #define SIG_FLAG_INIT_FILEDATA BIT_U32(9) /**< signature has filedata keyword */
300 #define SIG_FLAG_INIT_FORCE_TOCLIENT BIT_U32(10) /**< signature now takes keywords toclient */
301 #define SIG_FLAG_INIT_FORCE_TOSERVER BIT_U32(11) /**< signature now takes keywords toserver */
302 // Two following flags are meant to be mutually exclusive
303 #define SIG_FLAG_INIT_TXDIR_STREAMING_TOSERVER \
304  BIT_U32(12) /**< transactional signature uses a streaming buffer to server */
305 #define SIG_FLAG_INIT_TXDIR_FAST_TOCLIENT \
306  BIT_U32(13) /**< transactional signature uses a fast pattern to client */
307 
308 /* signature mask flags */
309 /** \note: additions should be added to the rule analyzer as well */
310 #define SIG_MASK_REQUIRE_PAYLOAD BIT_U8(0)
311 #define SIG_MASK_REQUIRE_FLOW BIT_U8(1)
312 #define SIG_MASK_REQUIRE_FLAGS_INITDEINIT BIT_U8(2) /* SYN, FIN, RST */
313 #define SIG_MASK_REQUIRE_FLAGS_UNUSUAL BIT_U8(3) /* URG, ECN, CWR */
314 #define SIG_MASK_REQUIRE_NO_PAYLOAD BIT_U8(4)
315 #define SIG_MASK_REQUIRE_REAL_PKT BIT_U8(5)
316 // vacancy 1x
317 #define SIG_MASK_REQUIRE_ENGINE_EVENT BIT_U8(7)
318 
319 #define FILE_SIG_NEED_FILE 0x01
320 #define FILE_SIG_NEED_FILENAME 0x02
321 #define FILE_SIG_NEED_MAGIC 0x04 /**< need the start of the file */
322 #define FILE_SIG_NEED_FILECONTENT 0x08
323 #define FILE_SIG_NEED_MD5 0x10
324 #define FILE_SIG_NEED_SHA1 0x20
325 #define FILE_SIG_NEED_SHA256 0x40
326 #define FILE_SIG_NEED_SIZE 0x80
327 
328 /* Detection Engine flags */
329 #define DE_QUIET 0x01 /**< DE is quiet (esp for unittests) */
330 #define DE_HAS_FIREWALL 0x02 /**< firewall rules loaded, default policies active */
331 
332 typedef struct IPOnlyCIDRItem_ {
333  /* address data for this item */
334  uint8_t family;
335  /* netmask in CIDR values (ex. /16 /18 /24..) */
336  uint8_t netmask;
337  /* If this host or net is negated for the signum */
338  uint8_t negated;
339 
340  uint32_t ip[4];
341  SigIntId signum; /**< our internal id */
342 
343  /* linked list, the header should be the biggest network */
345 
347 
348 /** \brief Used to start a pointer to SigMatch context
349  * Should never be dereferenced without casting to something else.
350  */
351 typedef struct SigMatchCtx_ {
352  int foo;
354 
355 /** \brief a single match condition for a signature */
356 typedef struct SigMatch_ {
357  uint16_t type; /**< match type */
358  uint16_t idx; /**< position in the signature */
359  SigMatchCtx *ctx; /**< plugin specific data */
360  struct SigMatch_ *next;
361  struct SigMatch_ *prev;
363 
364 /** \brief Data needed for Match() */
365 typedef struct SigMatchData_ {
366  uint16_t type; /**< match type */
367  bool is_last; /**< Last element of the list */
368  SigMatchCtx *ctx; /**< plugin specific data */
370 
371 struct DetectEngineThreadCtx_;// DetectEngineThreadCtx;
372 
373 /* inspection buffer is a simple structure that is passed between prefilter,
374  * transformation functions and inspection functions.
375  * Initially setup with 'orig' ptr and len, transformations can then take
376  * then and fill the 'buf'. Multiple transformations can update the buffer,
377  * both growing and shrinking it.
378  * Prefilter and inspection will only deal with 'inspect'. */
379 
380 typedef struct InspectionBuffer {
381  const uint8_t *inspect; /**< active pointer, points either to ::buf or ::orig */
382  uint64_t inspect_offset;
383  uint32_t inspect_len; /**< size of active data. See to ::len or ::orig_len */
384  bool initialized; /**< is initialized. ::inspect might be NULL if transform lead to 0 size */
385  uint8_t flags; /**< DETECT_CI_FLAGS_* for use with DetectEngineContentInspection */
386 #ifdef DEBUG_VALIDATION
387  bool multi;
388 #endif
389  uint32_t len; /**< how much is in use */
390  uint8_t *buf;
391  uint32_t size; /**< size of the memory allocation */
392 
393  uint32_t orig_len;
394  const uint8_t *orig;
396 
397 /* inspection buffers are kept per tx (in det_ctx), but some protocols
398  * need a bit more. A single TX might have multiple buffers, e.g. files in
399  * SMTP or DNS queries. Since all prefilters+transforms run before the
400  * individual rules need the same buffers, we need a place to store the
401  * transformed data. This array of arrays is that place. */
402 
405  uint32_t size; /**< size in number of elements */
406  uint32_t max:31; /**< max id in use in this run */
407  uint32_t init:1; /**< first time used this run. Used for clean logic */
409 
410 typedef struct TransformData_ {
412  void *options;
414 
415 typedef struct DetectEngineTransforms {
417  int cnt;
419 
420 /** callback for getting the buffer we need to prefilter/inspect */
421 typedef InspectionBuffer *(*InspectionBufferGetDataPtr)(
422  struct DetectEngineThreadCtx_ *det_ctx,
423  const DetectEngineTransforms *transforms,
424  Flow *f, const uint8_t flow_flags,
425  void *txv, const int list_id);
426 typedef InspectionBuffer *(*InspectionMultiBufferGetDataPtr)(struct DetectEngineThreadCtx_ *det_ctx,
427  const DetectEngineTransforms *transforms, Flow *f, const uint8_t flow_flags, void *txv,
428  const int list_id, const uint32_t local_id);
430 
431 typedef uint8_t (*InspectEngineFuncPtr)(struct DetectEngineCtx_ *de_ctx,
432  struct DetectEngineThreadCtx_ *det_ctx,
433  const struct DetectEngineAppInspectionEngine_ *engine, const struct Signature_ *s, Flow *f,
434  uint8_t flags, void *alstate, void *txv, uint64_t tx_id);
435 
438  uint8_t dir;
439  uint8_t id; /**< per sig id used in state keeping */
440  bool mpm;
441  bool stream;
442  /** will match on a NULL buffer (so an absent buffer) */
444  uint16_t sm_list;
445  uint16_t sm_list_base; /**< base buffer being transformed */
446  int16_t progress;
447 
448  struct {
449  union {
452  };
454  /** pointer to the transforms in the 'DetectBuffer entry for this list */
456  } v2;
457 
459 
462 
463 typedef struct DetectBufferType_ {
464  char name[64];
465  char description[128];
466  int id;
468  bool mpm;
469  bool packet; /**< compat to packet matches */
470  bool frame; /**< is about Frame inspection */
472  bool multi_instance; /**< buffer supports multiple buffer instances per tx */
473  void (*SetupCallback)(const struct DetectEngineCtx_ *, struct Signature_ *);
475  const struct Signature_ *, const char **sigerror, const struct DetectBufferType_ *);
478 
480 
481 /**
482  * \param alert_flags[out] for setting PACKET_ALERT_FLAG_*
483  */
485  struct DetectEngineThreadCtx_ *,
486  const struct DetectEnginePktInspectionEngine *engine,
487  const struct Signature_ *s,
488  Packet *p, uint8_t *alert_flags);
489 
490 /** callback for getting the buffer we need to prefilter/inspect */
491 typedef InspectionBuffer *(*InspectionBufferGetPktDataPtr)(
492  struct DetectEngineThreadCtx_ *det_ctx,
493  const DetectEngineTransforms *transforms,
494  Packet *p, const int list_id);
495 
498  bool mpm;
499  uint16_t sm_list;
500  uint16_t sm_list_base;
501  struct {
504  /** pointer to the transforms in the 'DetectBuffer entry for this list */
506  } v1;
509 
510 struct Frame;
511 struct Frames;
513 
514 /**
515  * \param alert_flags[out] for setting PACKET_ALERT_FLAG_*
516  */
518  const struct DetectEngineFrameInspectionEngine *engine, const struct Signature_ *s,
519  Packet *p, const struct Frames *frames, const struct Frame *frame);
520 
523  uint8_t dir;
524  uint8_t type;
525  bool mpm;
526  uint16_t sm_list;
527  uint16_t sm_list_base;
528  struct {
530  /** pointer to the transforms in the 'DetectBuffer entry for this list */
532  } v1;
536 
537 typedef struct SignatureInitDataBuffer_ {
538  uint32_t id; /**< buffer id */
539  bool sm_init; /**< initialized by sigmatch, which is likely something like `urilen:10; http.uri;
540  content:"abc";`. These need to be in the same list. Unset once `http.uri` is
541  set up. */
542  bool multi_capable; /**< true if we can have multiple instances of this buffer, so e.g. for
543  http.uri. */
544  bool only_tc; /**< true if we can only used toclient. */
545  bool only_ts; /**< true if we can only used toserver. */
546  /* sig match list */
550 
554  SIGNATURE_HOOK_PKT_ALL, /**< match each packet */
555 };
556 
561 };
562 
568 };
569 
570 // dns:request_complete should add DetectBufferTypeGetByName("dns:request_complete");
571 // TODO to json
572 typedef struct SignatureHook_ {
573  enum SignatureHookType type;
574  int sm_list; /**< list id for the hook's generic list. e.g. for dns:request_complete:generic */
575  union {
576  struct {
578  /** progress value of the app-layer hook specified in the rule. Sets the app_proto
579  * specific progress value. */
581  } app;
582  struct {
583  enum SignatureHookPkt ph;
584  } pkt;
585  } t;
587 
588 #define SIG_ALPROTO_MAX 4
589 
590 typedef struct SignatureInitData_ {
592 
593  /** Number of sigmatches. Used for assigning SigMatch::idx */
594  uint16_t sm_cnt;
595 
596  /** option was prefixed with '!'. Only set for sigmatches that
597  * have the SIGMATCH_HANDLE_NEGATION flag set. */
598  bool negated;
599 
600  /* track if we saw any negation in the addresses. If so, we
601  * skip it for ip-only */
604 
605  /** see if any of the sigmatches supports an enabled prefilter */
607 
608  /* used to hold flags that are used during init */
609  uint32_t init_flags;
610  /* coccinelle: SignatureInitData:init_flags:SIG_FLAG_INIT_ */
611 
612  /* alproto mask if multiple protocols are possible */
614 
615  /* used at init to determine max dsize */
617 
618  /** netblocks and hosts specified at the sid, in CIDR format */
620 
621  /* list id for `mpm_sm`. Should always match `SigMatchListSMBelongsTo(s, mpm_sm)`. */
623  /* the fast pattern added from this signature */
625  /* used to speed up init of prefilter */
627 
628  /* SigMatch list used for adding content and friends. E.g. file_data; */
629  int list;
630  bool list_set;
631 
633 
634  /** score to influence rule grouping. A higher value leads to a higher
635  * likelihood of a rulegroup with this sig ending up as a contained
636  * group. */
637  int score;
638 
639  /** address settings for this signature */
641 
642  /* holds built-in sm lists */
644  /* holds built-in sm lists' tails */
646 
647  /* Storage for buffers. */
649  uint32_t buffer_index;
650  uint32_t buffers_size;
652 
653  /* highest list/buffer id which holds a DETECT_CONTENT */
655 
656  /* inter-signature state dependency */
663 
664  /* Signature is a "firewall" rule. */
667 
668 /** \brief Signature container */
669 typedef struct Signature_ {
670  uint32_t flags;
671  /* coccinelle: Signature:flags:SIG_FLAG_ */
672  enum SignatureType type;
673 
675 
676  uint16_t dsize_low;
677  uint16_t dsize_high;
678  uint8_t dsize_mode;
679 
681  SigIntId num; /**< signature number, internal id */
682 
683  /** inline -- action */
684  uint8_t action;
685  uint8_t file_flags;
686 
687  /** addresses, ports and proto this sig matches on */
689 
690  /* scope setting for the action: enum ActionScope */
691  uint8_t action_scope;
692 
693  /** ipv4 match arrays */
698 
699  /** classification id **/
700  uint16_t class_id;
701 
702  /** firewall: pseudo table this rule is part of (enum FirewallTable) */
703  uint8_t firewall_table;
704 
705  /** firewall: progress value for this signature */
707 
710  /** ipv6 match arrays */
713 
714  uint32_t id; /**< sid, set by the 'sid' rule keyword */
715  uint32_t gid; /**< generator id */
716  uint32_t rev;
717  int prio;
718 
719  /** port settings for this signature */
721 
722 #ifdef PROFILE_RULES
723  uint16_t profiling_id;
724 #endif
725 
729 
730  /* Matching structures for the built-ins. The others are in
731  * their inspect engines. */
733 
734  /* memory is still owned by the sm_lists/sm_arrays entry */
736 
737  char *msg;
738 
739  /** classification message */
740  char *class_msg;
741  /** Reference */
743  /** Metadata */
745 
746  char *sig_str;
747 
749 
750  /** ptr to the next sig in the list */
751  struct Signature_ *next;
753 
758  /* must be last */
760 };
761 
762 /** \brief one time registration of keywords at start up */
763 typedef struct DetectBufferMpmRegistry_ {
764  const char *name;
765  char pname[32]; /**< name used in profiling */
766  int direction; /**< SIG_FLAG_TOSERVER or SIG_FLAG_TOCLIENT */
767  int16_t sm_list;
768  int16_t sm_list_base;
769  int priority;
770  int id; /**< index into this array and result arrays */
773 
775  MpmCtx *mpm_ctx, const struct DetectBufferMpmRegistry_ *mpm_reg, int list_id);
777 
778  union {
779  /* app-layer matching: use if type == DETECT_BUFFER_MPM_TYPE_APP */
780  struct {
781  union {
784  };
788 
789  /* pkt matching: use if type == DETECT_BUFFER_MPM_TYPE_PKT */
790  struct {
792  struct SigGroupHead_ *sgh, MpmCtx *mpm_ctx,
793  const struct DetectBufferMpmRegistry_ *mpm_reg, int list_id);
796 
797  /* frame matching: use if type == DETECT_BUFFER_MPM_TYPE_FRAME */
798  struct {
800  uint8_t type;
802  };
803 
806 
807 /* helper structure to track pattern stats and assign pattern id's. */
808 typedef struct DetectPatternTracker {
809  const struct DetectContentData_ *cd;
810  int sm_list;
811  uint32_t cnt;
812  uint32_t mpm;
814 
815 typedef struct DetectReplaceList_ {
816  const struct DetectContentData_ *cd;
817  uint8_t *found;
820 
821 /** only execute flowvar storage if rule matched */
822 #define DETECT_VAR_TYPE_FLOW_POSTMATCH 1
823 #define DETECT_VAR_TYPE_PKT_POSTMATCH 2
824 
825 /** list for flowvar store candidates, to be stored from
826  * post-match function */
827 typedef struct DetectVarList_ {
828  uint16_t type; /**< type of store candidate POSTMATCH or ALWAYS */
829  uint8_t pad[2];
830  uint32_t idx; /**< flowvar name idx */
831  uint16_t len; /**< data len */
832  uint16_t key_len;
833  uint8_t *key;
834  uint8_t *buffer; /**< alloc'd buffer, may be freed by
835  post-match, post-non-match */
838 
839 typedef struct SCFPSupportSMList_ {
840  int list_id;
841  int priority;
844 
845 /** \brief IP only rules matching ctx. */
846 typedef struct DetectEngineIPOnlyCtx_ {
847  /* Lookup trees */
850 
851  /* Used to build the radix trees */
853  uint32_t max_idx;
854 
855  /* Used to map large signums to smaller values to compact the bitsets
856  * stored in the radix trees */
857  uint32_t *sig_mapping;
860 
861 typedef struct DetectEngineLookupFlow_ {
864  struct SigGroupHead_ *sgh[256];
866 
867 typedef struct SigString_ {
868  char *filename;
869  char *sig_str;
870  char *sig_error;
871  int line;
874 
875 /** \brief Signature loader statistics */
876 typedef struct SigFileLoaderStat_ {
877  TAILQ_HEAD(, SigString_) failed_sigs;
884 
886  void *(*InitFunc)(void *);
887  void (*FreeFunc)(void *);
888  void *data;
890  int id;
891  const char *name; /* keyword name, for error printing */
893 
895 {
896  DETECT_PREFILTER_MPM = 0, /**< use only mpm / fast_pattern */
897  DETECT_PREFILTER_AUTO = 1, /**< use mpm + keyword prefilters */
898 };
899 
901 {
903  DETECT_ENGINE_TYPE_DD_STUB = 1, /* delayed detect stub: can be reloaded */
904  DETECT_ENGINE_TYPE_MT_STUB = 2, /* multi-tenant stub: cannot be reloaded */
906 };
907 
908 /* Flow states:
909  * toserver
910  * toclient
911  */
912 #define FLOW_STATES 2
913 
914 typedef struct {
915  uint32_t content_limit;
918 
919 /** \brief main detection engine ctx */
920 typedef struct DetectEngineCtx_ {
922  uint8_t flags; /**< only DE_QUIET */
923  uint8_t mpm_matcher; /**< mpm matcher this ctx uses */
925  uint8_t spm_matcher; /**< spm matcher this ctx uses */
926 
927  uint32_t tenant_id;
928 
930  uint32_t sig_cnt;
931 
932  /* version of the srep data */
933  uint32_t srep_version;
934 
935  /* reputation for netblocks */
937 
939  uint32_t sig_array_len; /* size in array members */
940 
941  uint32_t signum;
942 
943  /* used by the signature ordering module */
945 
946  /* main sigs */
948 
949  /* init phase vars */
951 
954 
955  /* hash table used to cull out duplicate sigs */
957 
959 
960  /* maximum recursion depth for content inspection */
962 
963  /* maximum number of times a tx will get logged for rules not using app-layer keywords */
965 
966  /* force app-layer tx finding for alerts with signatures not having app-layer keywords */
968 
969  /* registration id for per thread ctx for the filemagic/file.magic keywords */
971 
972  /* spm thread context prototype, built as spm matchers are constructed and
973  * later used to construct thread context for each thread. */
975 
976  /* Config options */
977 
980 
981  /* max flowbit id that is used */
982  uint32_t max_fb_id;
983 
985 
986  /* array containing all sgh's in use so we can loop
987  * through it in Stage4. */
989  uint32_t sgh_array_cnt;
990  uint32_t sgh_array_size;
991 
996 
997  /* the max local id used amongst all sigs */
999 
1000  /** version of the detect engine. The version is incremented on reloads */
1001  uint32_t version;
1002 
1003  /** sgh for signatures that match against invalid packets. In those cases
1004  * we can't lookup by proto, address, port as we don't have these */
1006 
1007  /* Maximum size of the buffer for decoded base64 data. */
1009 
1010  /** Store rule file and line so that parsers can use them in errors. */
1012  const char *rule_file;
1013  const char *sigerror;
1016 
1017  /** The rule errored out due to missing requirements. */
1019 
1020  /* specify the configuration for mpm context factory */
1022 
1024  /** hash list of keywords that need thread local ctxs */
1026 
1028 
1029 #ifdef PROFILE_RULES
1030  struct SCProfileDetectCtx_ *profile_ctx;
1031 #endif
1032 #ifdef PROFILING
1038 #endif
1039  char config_prefix[64];
1040 
1041  enum DetectEngineType type;
1042 
1043  /** how many de_ctx' are referencing this */
1044  uint32_t ref_cnt;
1045  /** list in master: either active or freelist */
1047 
1048  /** id of loader thread 'owning' this de_ctx */
1050 
1051  /** are we using just mpm or also other prefilters */
1053 
1055 
1058 
1059  /** table for storing the string representation with the parsers result */
1061 
1062  /** table to store metadata keys and values */
1064 
1065  /* hash tables with rule-time buffer registration. Start time registration
1066  * is in detect-engine.c::g_buffer_type_hash */
1069  uint32_t buffer_type_id;
1070 
1073  /* list with app inspect engines. Both the start-time registered ones and
1074  * the rule-time registered ones. */
1082 
1083  uint32_t prefilter_id;
1085 
1086  /** time of last ruleset reload */
1087  struct timeval last_reload;
1088 
1089  /** signatures stats */
1091 
1092  /* list of Fast Pattern registrations. Initially filled using a copy of
1093  * `g_fp_support_smlist_list`, then extended at rule loading time if needed */
1095 
1096  /** per keyword flag indicating if a prefilter has been
1097  * set for it. If true, the setup function will have to
1098  * run. */
1101 
1102  /* classification config parsing */
1103 
1104  /* hash table used for holding the classification config info */
1106  pcre2_code *class_conf_regex;
1107  pcre2_match_data *class_conf_regex_match;
1108 
1109  /* reference config parsing */
1110 
1111  /* hash table used for holding the reference config info */
1114  pcre2_match_data *reference_conf_regex_match;
1115 
1116  /* --engine-analysis */
1118 
1119  /* path to the tenant yaml for this engine */
1121 
1122  /* Track rule requirements for reporting after loading rules. */
1124 
1125  /* number of signatures using filestore, limited as u16 */
1126  uint16_t filestore_cnt;
1127 
1128  /* name store for non-prefilter engines. Used in profiling but
1129  * part of the API, so hash is always used. */
1131 
1134 
1135 /* Engine groups profiles (low, medium, high, custom) */
1136 enum {
1142 };
1143 
1144 /* Siggroup mpm context profile */
1145 enum {
1149 #define ENGINE_SGH_MPM_FACTORY_CONTEXT_START_ID_RANGE (ENGINE_SGH_MPM_FACTORY_CONTEXT_AUTO + 1)
1150 };
1151 
1152 #define DETECT_FILESTORE_MAX 15
1159 
1160 /** array of TX inspect rule candidates */
1161 typedef struct RuleMatchCandidateTx {
1162  SigIntId id; /**< internal signature id */
1163  uint32_t *flags; /**< inspect flags ptr */
1164  union {
1165  struct {
1167  uint8_t stream_result;
1168  };
1169  uint32_t stream_reset;
1170  };
1171 
1172  const Signature *s; /**< ptr to sig */
1174 
1175 /** Stores a single u32 for a rule match of the type `sm_type`. Used by
1176  * flowbits prefilter to register DETECT_FLOWBITS,<flowbit id> for post
1177  * match handling. */
1179  int sm_type; /**< sigmatch type e.g. DETECT_FLOWBITS */
1180  uint32_t value; /**< value to be interpreted by the sm_type
1181  * implementation. E.g. flowbit id. */
1182 #ifdef DEBUG
1183  SigIntId id;
1184 #endif
1186 
1187 /** Array of PostRuleMatchWorkQueueItem's. */
1188 typedef struct PostRuleMatchWorkQueue {
1189  PostRuleMatchWorkQueueItem *q; /**< array pointer */
1190  uint32_t len; /**< number of array elements in use. */
1191  uint32_t size; /**< allocation size in number of elements. */
1193 
1194 /**
1195  * Detection engine thread data.
1196  */
1197 typedef struct DetectEngineThreadCtx_ {
1198  /** \note multi-tenant hash lookup code from Detect() *depends*
1199  * on this being the first member */
1200  uint32_t tenant_id;
1201 
1202  SC_ATOMIC_DECLARE(int, so_far_used_by_detect);
1203 
1204  /* the thread to which this detection engine thread belongs */
1206 
1210 
1213 
1214  uint32_t (*TenantGetId)(const void *, const Packet *p);
1215 
1216  /* detection engine variables */
1217 
1219 
1220  /** offset into the payload of the end of the last match by: content, pcre, etc */
1221  uint32_t buffer_offset;
1222 
1223  /** used by pcre match function alone: normally in sync with buffer_offset, but
1224  * points to 1 byte after the start of the last pcre match if a pcre match happened. */
1226 
1227  /** SPM thread context used for scanning. This has been cloned from the
1228  * prototype held by DetectEngineCtx. */
1230 
1231  /* byte_* values */
1232  uint64_t *byte_values;
1233 
1234  /* counter for the filestore array below -- up here for cache reasons. */
1235  uint16_t filestore_cnt;
1236 
1237  /** id for alert counter */
1238  uint16_t counter_alerts;
1239  /** id for discarded alerts counter */
1241  /** id for suppressed alerts counter */
1243 #ifdef PROFILING
1248 #endif
1249 
1250  struct {
1252  uint32_t buffers_size; /**< in number of elements */
1253  uint32_t to_clear_idx;
1254  uint32_t *to_clear_queue;
1256 
1257  struct {
1258  /** inspection buffers for more complex case. As we can inspect multiple
1259  * buffers in parallel, we need this extra wrapper struct */
1261  uint32_t buffers_size; /**< in number of elements */
1262  uint32_t to_clear_idx;
1263  uint32_t *to_clear_queue;
1265 
1266  /* true if tx_id is set */
1268  /** ID of the transaction currently being inspected. */
1269  uint64_t tx_id;
1270  int64_t frame_id;
1271  uint64_t frame_inspect_progress; /**< used to set Frame::inspect_progress after all inspection
1272  on a frame is complete. */
1274 
1275  uint8_t *base64_decoded;
1277 
1281 
1282  /** array of signature pointers we're going to inspect in the detection
1283  * loop. */
1285  /** size of the array in items (mem size if * sizeof(Signature *)
1286  * Only used during initialization. */
1288  /** size in use */
1290 
1293 
1294  MpmThreadCtx mtc; /**< thread ctx for the mpm */
1295  /* work queue for post-rule matching affecting prefilter */
1297 
1299 
1300  /* string to replace */
1302  /* vars to store in post match function */
1304 
1305  /* Array in which the filestore keyword stores file id and tx id. If the
1306  * full signature matches, these are processed by a post-match filestore
1307  * function to finalize the store. */
1308  struct {
1309  uint32_t file_id;
1310  uint64_t tx_id;
1312 
1314  /** store for keyword contexts that need a per thread storage. Per de_ctx. */
1317  /** store for keyword contexts that need a per thread storage. Global. */
1320 
1322  uint16_t events;
1323 
1324  /** stats id for lua rule errors */
1326 
1327  /** stats id for lua blocked function counts */
1329 
1330  /** stats if for lua instruction limit errors */
1332 
1333  /** stat of lua memory limit errors. */
1335 
1336 #ifdef DEBUG
1337  uint64_t pkt_stream_add_cnt;
1338  uint64_t payload_mpm_cnt;
1339  uint64_t payload_mpm_size;
1340  uint64_t stream_mpm_cnt;
1341  uint64_t stream_mpm_size;
1342  uint64_t payload_persig_cnt;
1343  uint64_t payload_persig_size;
1344  uint64_t stream_persig_cnt;
1345  uint64_t stream_persig_size;
1346 #endif
1347 #ifdef PROFILE_RULES
1348  struct SCProfileData_ *rule_perf_data;
1349  int rule_perf_data_size;
1350  uint32_t rule_perf_last_sync;
1351 #endif
1352 #ifdef PROFILING
1355  int keyword_perf_list; /**< list we're currently inspecting, DETECT_SM_LIST_* */
1357 
1359  /** bytes inspected by current prefilter callback call */
1361  /** number of times we inspected a buffer */
1363 #endif
1365 
1366 /** \brief element in sigmatch type table.
1367  */
1368 typedef struct SigTableElmt_ {
1369  /** Packet match function pointer */
1370  int (*Match)(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *);
1371 
1372  /** AppLayer TX match function pointer */
1374  uint8_t flags, void *alstate, void *txv,
1375  const Signature *, const SigMatchCtx *);
1376 
1377  /** File match function pointer */
1379  Flow *, /**< *LOCKED* flow */
1380  uint8_t flags, File *, const Signature *, const SigMatchCtx *);
1381 
1382  /** InspectionBuffer transformation callback */
1383  void (*Transform)(DetectEngineThreadCtx *, InspectionBuffer *, void *context);
1384  bool (*TransformValidate)(const uint8_t *content, uint16_t content_len, void *context);
1385 
1386  /** keyword setup function pointer */
1387  int (*Setup)(DetectEngineCtx *, Signature *, const char *);
1388 
1389  bool (*SupportsPrefilter)(const Signature *s);
1391 
1392  void (*Free)(DetectEngineCtx *, void *);
1393 #ifdef UNITTESTS
1394  void (*RegisterTests)(void);
1395 #endif
1396  uint16_t flags;
1397  /* coccinelle: SigTableElmt:flags:SIGMATCH_ */
1398 
1399  /** better keyword to replace the current one */
1400  uint16_t alternative;
1401 
1402  const char *name; /**< keyword name alias */
1403  const char *alias; /**< name alias */
1404  const char *desc;
1405  const char *url;
1406 
1408 
1409 /* event code */
1410 enum {
1424 
1427 };
1428 
1429 #define SIG_GROUP_HEAD_HAVERAWSTREAM BIT_U16(0)
1430 #ifdef HAVE_MAGIC
1431 #define SIG_GROUP_HEAD_HAVEFILEMAGIC BIT_U16(1)
1432 #endif
1433 #define SIG_GROUP_HEAD_HAVEFILEMD5 BIT_U16(2)
1434 #define SIG_GROUP_HEAD_HAVEFILESIZE BIT_U16(3)
1435 #define SIG_GROUP_HEAD_HAVEFILESHA1 BIT_U16(4)
1436 #define SIG_GROUP_HEAD_HAVEFILESHA256 BIT_U16(5)
1447 };
1448 
1449 typedef struct MpmStore_ {
1450  uint8_t *sid_array;
1451  uint32_t sid_array_size;
1452 
1455  int sm_list;
1459 
1461 
1462 typedef void (*PrefilterPktFn)(DetectEngineThreadCtx *det_ctx, Packet *p, const void *pectx);
1463 typedef void (*PrefilterFrameFn)(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p,
1464  const struct Frames *frames, const struct Frame *frame);
1465 
1466 typedef struct AppLayerTxData AppLayerTxData;
1467 typedef void (*PrefilterTxFn)(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p, Flow *f,
1468  void *tx, const uint64_t tx_id, const AppLayerTxData *tx_data, const uint8_t flags);
1469 
1470 typedef struct PrefilterEngineList_ {
1471  uint16_t id;
1472 
1473  /** App Proto this engine applies to: only used with Tx Engines */
1475  /** Minimal Tx progress we need before running the engine. Only used
1476  * with Tx Engine. Set to -1 for all states. */
1478 
1479  uint8_t frame_type;
1480 
1481  SignatureMask pkt_mask; /**< mask for pkt engines */
1482 
1484 
1485  /** Context for matching. Might be MpmCtx for MPM engines, other ctx'
1486  * for other engines. */
1487  void *pectx;
1488 
1493  DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p, Flow *f);
1494 
1496 
1497  /** Free function for pectx data. If NULL the memory is not freed. */
1498  void (*Free)(void *pectx);
1499 
1500  const char *name;
1501  /* global id for this prefilter */
1502  uint32_t gid;
1504 
1505 typedef struct PrefilterEngine_ {
1506  uint16_t local_id;
1507 
1508  /** App Proto this engine applies to: only used with Tx Engines */
1510 
1511  union {
1512  struct {
1513  SignatureMask mask; /**< mask for pkt engines */
1514  uint8_t hook; /**< enum SignatureHookPkt */
1515  } pkt;
1516  /** Minimal Tx progress we need before running the engine. Only used
1517  * with Tx Engine. Set to -1 for all states. */
1519  uint8_t frame_type;
1520  } ctx;
1521 
1522  bool is_last;
1524 
1525  /** Context for matching. Might be MpmCtx for MPM engines, other ctx'
1526  * for other engines. */
1527  void *pectx;
1528 
1529  union {
1534  DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p, Flow *f);
1535  } cb;
1536 
1537  /* global id for this prefilter */
1538  uint32_t gid;
1540 
1541 typedef struct SigGroupHeadInitData_ {
1543 
1544  uint8_t *sig_array; /**< bit array of sig nums (internal id's) */
1545  uint32_t sig_size; /**< size in bytes */
1546 
1547  uint8_t protos[256]; /**< proto(s) this sgh is for */
1548  uint32_t direction; /**< set to SIG_FLAG_TOSERVER, SIG_FLAG_TOCLIENT or both */
1549  int score; /**< try to make this group a unique one */
1550  uint32_t max_sig_id; /**< max signature idx for this sgh */
1551 
1555 
1561 
1562  /** number of sigs in this group */
1564 
1565  /** Array with sig ptrs... size is sig_cnt * sizeof(Signature *) */
1568 
1569 /** \brief Container for matching data for a signature group */
1570 typedef struct SigGroupHead_ {
1571  uint16_t flags;
1572  /* coccinelle: SigGroupHead:flags:SIG_GROUP_HEAD_ */
1573 
1574  /** the number of signatures in this sgh that have the filestore keyword
1575  * set. */
1576  uint16_t filestore_cnt;
1577 
1578  uint32_t id; /**< unique id used to index sgh_array for stats */
1579 
1584  PrefilterEngine *post_rule_match_engines; /**< engines to run after rules modified a state */
1585 
1586  /* ptr to our init data we only use at... init :) */
1588 
1590 
1591 /** sigmatch has no options, so the parser shouldn't expect any */
1592 #define SIGMATCH_NOOPT BIT_U16(0)
1593 /** sigmatch is compatible with a ip only rule */
1594 #define SIGMATCH_IPONLY_COMPAT BIT_U16(1)
1595 /** sigmatch is compatible with a decode event only rule */
1596 #define SIGMATCH_DEONLY_COMPAT BIT_U16(2)
1597 /**< Flag to indicate that the signature is not built-in */
1598 #define SIGMATCH_NOT_BUILT BIT_U16(3)
1599 /** sigmatch may have options, so the parser should be ready to
1600  * deal with both cases */
1601 #define SIGMATCH_OPTIONAL_OPT BIT_U16(4)
1602 /** input may be wrapped in double quotes. They will be stripped before
1603  * input data is passed to keyword parser */
1604 #define SIGMATCH_QUOTES_OPTIONAL BIT_U16(5)
1605 /** input MUST be wrapped in double quotes. They will be stripped before
1606  * input data is passed to keyword parser. Missing double quotes lead to
1607  * error and signature invalidation. */
1608 #define SIGMATCH_QUOTES_MANDATORY BIT_U16(6)
1609 /** negation parsing is handled by the rule parser. Signature::init_data::negated
1610  * will be set to true or false prior to calling the keyword parser. Exclamation
1611  * mark is stripped from the input to the keyword parser. */
1612 #define SIGMATCH_HANDLE_NEGATION BIT_U16(7)
1613 /** keyword is a content modifier */
1614 #define SIGMATCH_INFO_CONTENT_MODIFIER BIT_U16(8)
1615 /** keyword is a sticky buffer */
1616 #define SIGMATCH_INFO_STICKY_BUFFER BIT_U16(9)
1617 /** keyword is deprecated: used to suggest an alternative */
1618 #define SIGMATCH_INFO_DEPRECATED BIT_U16(10)
1619 /** strict parsing is enabled */
1620 #define SIGMATCH_STRICT_PARSING BIT_U16(11)
1621 /** keyword supported by firewall rules */
1622 #define SIGMATCH_SUPPORT_FIREWALL BIT_U16(12)
1625 {
1626  TENANT_SELECTOR_UNKNOWN = 0, /**< not set */
1627  TENANT_SELECTOR_DIRECT, /**< method provides direct tenant id */
1628  TENANT_SELECTOR_VLAN, /**< map vlan to tenant id */
1629  TENANT_SELECTOR_LIVEDEV, /**< map livedev to tenant id */
1630 };
1631 
1633  uint32_t tenant_id;
1634 
1635  /* traffic id that maps to the tenant id */
1636  uint32_t traffic_id;
1637 
1640 
1641 typedef struct DetectEngineMasterCtx_ {
1643 
1644  /** enable multi tenant mode */
1646 
1647  /** version, incremented after each 'apply to threads' */
1648  uint32_t version;
1649 
1650  /** list of active detection engines. This list is used to generate the
1651  * threads det_ctx's */
1653 
1654  /** free list, containing detection engines that will be removed but may
1655  * still be referenced by det_ctx's. Freed as soon as all references are
1656  * gone. */
1658 
1660 
1661  /** list of tenant mappings. Updated under lock. Used to generate lookup
1662  * structures. */
1664 
1665  /** list of keywords that need thread local ctxs,
1666  * only updated by keyword registration at start up. Not
1667  * covered by the lock. */
1671 
1672 /* Table with all SigMatch registrations */
1674 
1675 /** Remember to add the options in SignatureIsIPOnly() at detect.c otherwise it wont be part of a signature group */
1676 
1677 /* detection api */
1678 TmEcode Detect(ThreadVars *tv, Packet *p, void *data);
1679 
1680 SigMatch *SigMatchAlloc(void);
1681 Signature *SigFindSignatureBySidGid(DetectEngineCtx *, uint32_t, uint32_t);
1683 
1684 void SigRegisterTests(void);
1685 
1687 char *DetectLoadCompleteSigPath(const DetectEngineCtx *, const char *sig_file);
1688 int SigLoadSignatures(DetectEngineCtx *, char *, bool);
1690  DetectEngineThreadCtx *det_ctx, Packet *p);
1691 
1694 
1695 int DetectUnregisterThreadCtxFuncs(DetectEngineCtx *, void *data, const char *name);
1696 int DetectRegisterThreadCtxFuncs(DetectEngineCtx *, const char *name, void *(*InitFunc)(void *), void *data, void (*FreeFunc)(void *), int);
1698 void *DetectGetInnerTx(void *tx_ptr, AppProto alproto, AppProto engine_alproto, uint8_t flow_flags);
1699 
1700 void RuleMatchCandidateTxArrayInit(DetectEngineThreadCtx *det_ctx, uint32_t size);
1702 
1704 
1707 
1708 /* events */
1709 void DetectEngineSetEvent(DetectEngineThreadCtx *det_ctx, uint8_t e);
1710 
1712 
1713 #endif /* SURICATA_DETECT_H */
DetectEngineThreadCtx_::byte_values
uint64_t * byte_values
Definition: detect.h:1232
DetectEngineCtx_::sgh_hash_table
HashListTable * sgh_hash_table
Definition: detect.h:950
DetectEngineCtx_::pkt_mpms_list_cnt
uint32_t pkt_mpms_list_cnt
Definition: detect.h:1078
DetectEngineAppInspectionEngine_::stream
bool stream
Definition: detect.h:441
DetectEngineCtx_::frame_mpms_list_cnt
uint32_t frame_mpms_list_cnt
Definition: detect.h:1081
SCFPSupportSMList
struct SCFPSupportSMList_ SCFPSupportSMList
SigFileLoaderStat_::bad_files
int bad_files
Definition: detect.h:878
DETECT_EVENT_TOO_MANY_BUFFERS
@ DETECT_EVENT_TOO_MANY_BUFFERS
Definition: detect.h:1425
SIG_TYPE_STREAM
@ SIG_TYPE_STREAM
Definition: detect.h:73
DetectEngineTenantMapping_
Definition: detect.h:1632
SignatureInitData_::max_content_list_id
uint32_t max_content_list_id
Definition: detect.h:654
DetectAddress_::ip
Address ip
Definition: detect.h:169
SigMatchSignaturesGetSgh
const SigGroupHead * SigMatchSignaturesGetSgh(const DetectEngineCtx *de_ctx, const Packet *p)
Get the SigGroupHead for a packet.
Definition: detect.c:232
PrefilterEngine_::mask
SignatureMask mask
Definition: detect.h:1513
DetectPatternTracker
Definition: detect.h:808
SignatureInitData_::rule_state_dependant_sids_idx
uint32_t rule_state_dependant_sids_idx
Definition: detect.h:660
PrefilterEngineList_::frame_type
uint8_t frame_type
Definition: detect.h:1479
SCFPSupportSMList_
Definition: detect.h:839
DetectEngineThreadCtx_::keyword_perf_data_per_list
struct SCProfileKeywordData_ ** keyword_perf_data_per_list
Definition: detect.h:1354
SigGroupHead_::tx_engines
PrefilterEngine * tx_engines
Definition: detect.h:1582
SigMatchAlloc
SigMatch * SigMatchAlloc(void)
Definition: detect-parse.c:350
DetectEngineAppInspectionEngine_
Definition: detect.h:436
SigTableElmt_::url
const char * url
Definition: detect.h:1405
DetectBufferType_::supports_transforms
bool supports_transforms
Definition: detect.h:471
SigLoadSignatures
int SigLoadSignatures(DetectEngineCtx *, char *, bool)
Load signatures.
Definition: detect-engine-loader.c:368
MPMB_UDP_TS
@ MPMB_UDP_TS
Definition: detect.h:1443
SignatureInitDataBuffer_::head
SigMatch * head
Definition: detect.h:547
SigMatch_::prev
struct SigMatch_ * prev
Definition: detect.h:361
DetectEngineAppInspectionEngine_::mpm
bool mpm
Definition: detect.h:440
SCProfileKeywordData_
Definition: util-profiling-keywords.c:41
DetectBufferType_::mpm
bool mpm
Definition: detect.h:468
PrefilterEngineList_::Prefilter
PrefilterPktFn Prefilter
Definition: detect.h:1489
SignatureInitDataBuffer_::sm_init
bool sm_init
Definition: detect.h:539
RuleMatchCandidateTx::stream_stored
bool stream_stored
Definition: detect.h:1166
DetectReplaceList_::cd
const struct DetectContentData_ * cd
Definition: detect.h:816
DetectEngineThreadCtx_::alert_queue_size
uint16_t alert_queue_size
Definition: detect.h:1278
DetectEngineThreadCtx_::buffer_offset
uint32_t buffer_offset
Definition: detect.h:1221
DETECT_SM_LIST_PMATCH
@ DETECT_SM_LIST_PMATCH
Definition: detect.h:118
DetectBufferMpmRegistry_::direction
int direction
Definition: detect.h:766
DetectEngineThreadCtx_::to_clear_idx
uint32_t to_clear_idx
Definition: detect.h:1253
SignatureInitDataBuffer
struct SignatureInitDataBuffer_ SignatureInitDataBuffer
SigMatchFree
void SigMatchFree(DetectEngineCtx *, SigMatch *sm)
free a SigMatch
Definition: detect-parse.c:364
DetectEngineCtx_::class_conf_ht
HashTable * class_conf_ht
Definition: detect.h:1105
SignatureInitData_::smlists
struct SigMatch_ * smlists[DETECT_SM_LIST_MAX]
Definition: detect.h:643
DetectBufferMpmRegistry_::frame_v1
struct DetectBufferMpmRegistry_::@87::@91 frame_v1
detect-engine-proto.h
DetectEngineThreadCtx_::keyword_perf_data
struct SCProfileKeywordData_ * keyword_perf_data
Definition: detect.h:1353
DetectEngineThreadCtx_::match_array_cnt
SigIntId match_array_cnt
Definition: detect.h:1289
DetectVarList_::idx
uint32_t idx
Definition: detect.h:830
MpmStore_::sid_array_size
uint32_t sid_array_size
Definition: detect.h:1451
PrefilterEngine_::PrefilterPostRule
void(* PrefilterPostRule)(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p, Flow *f)
Definition: detect.h:1533
SignatureHook_
Definition: detect.h:572
SigTableElmt_::desc
const char * desc
Definition: detect.h:1404
SignatureInitData_::list_set
bool list_set
Definition: detect.h:630
Signature_::addr_src_match6
DetectMatchAddressIPv6 * addr_src_match6
Definition: detect.h:712
DetectEngineThreadCtx_::SC_ATOMIC_DECLARE
SC_ATOMIC_DECLARE(int, so_far_used_by_detect)
Signature_::sig_str
char * sig_str
Definition: detect.h:746
MpmStore_::sid_array
uint8_t * sid_array
Definition: detect.h:1450
DetectEngineThreadKeywordCtxItem
struct DetectEngineThreadKeywordCtxItem_ DetectEngineThreadKeywordCtxItem
DetectEngineCtx_::sgh_mpm_context_proto_tcp_packet
int32_t sgh_mpm_context_proto_tcp_packet
Definition: detect.h:992
DetectEngineIPOnlyCtx_::tree_ipv6dst
SCRadix6Tree tree_ipv6dst
Definition: detect.h:849
SIG_TYPE_APP_TX
@ SIG_TYPE_APP_TX
Definition: detect.h:76
DetectVarList_::buffer
uint8_t * buffer
Definition: detect.h:834
SigTableElmt_::Free
void(* Free)(DetectEngineCtx *, void *)
Definition: detect.h:1392
IPOnlyCIDRItem
struct IPOnlyCIDRItem_ IPOnlyCIDRItem
util-hashlist.h
DetectEngineCtx_::decoder_event_sgh
struct SigGroupHead_ * decoder_event_sgh
Definition: detect.h:1005
SignatureHook_::sm_list
int sm_list
Definition: detect.h:574
DetectEngineCtx_::flow_gh
DetectEngineLookupFlow flow_gh[FLOW_STATES]
Definition: detect.h:947
SCFPSupportSMList_::next
struct SCFPSupportSMList_ * next
Definition: detect.h:842
DetectEngineThreadCtx_::counter_match_list
uint16_t counter_match_list
Definition: detect.h:1247
SigString
struct SigString_ SigString
DetectEnginePktInspectionEngine
Definition: detect.h:496
DetectEngineMasterCtx_::tenant_mapping_list
DetectEngineTenantMapping * tenant_mapping_list
Definition: detect.h:1663
Signature_::filestore_ctx
const struct DetectFilestoreData_ * filestore_ctx
Definition: detect.h:735
DetectEngineAppInspectionEngine_::next
struct DetectEngineAppInspectionEngine_ * next
Definition: detect.h:460
SigGroupHead_::flags
uint16_t flags
Definition: detect.h:1571
PrefilterEngine_::ctx
union PrefilterEngine_::@101 ctx
SignatureIsIPOnly
int SignatureIsIPOnly(DetectEngineCtx *de_ctx, const Signature *s)
Test is a initialized signature is IP only.
Definition: detect-engine-build.c:209
PostRuleMatchWorkQueue::len
uint32_t len
Definition: detect.h:1190
PostRuleMatchWorkQueueItem::sm_type
int sm_type
Definition: detect.h:1179
SCFPSupportSMList_::list_id
int list_id
Definition: detect.h:840
SigTableElmt_::name
const char * name
Definition: detect.h:1402
DetectEngineMasterCtx_::list
DetectEngineCtx * list
Definition: detect.h:1652
SignatureInitData_::smlists_tail
struct SigMatch_ * smlists_tail[DETECT_SM_LIST_MAX]
Definition: detect.h:645
InspectionBuffer::initialized
bool initialized
Definition: detect.h:384
MpmThreadCtx_
Definition: util-mpm.h:46
DetectPatternTracker::mpm
uint32_t mpm
Definition: detect.h:812
Signature_::num
SigIntId num
Definition: detect.h:681
DetectEngineCtx
struct DetectEngineCtx_ DetectEngineCtx
main detection engine ctx
IPOnlyCIDRItem_::netmask
uint8_t netmask
Definition: detect.h:336
DetectEngineCtx_::type
enum DetectEngineType type
Definition: detect.h:1041
SigGroupHead_
Container for matching data for a signature group.
Definition: detect.h:1570
DetectEngineCtx_::pattern_hash_table
HashListTable * pattern_hash_table
Definition: detect.h:953
DetectEngineThreadCtx_::sgh_perf_data
struct SCProfileSghData_ * sgh_perf_data
Definition: detect.h:1356
DetectEngineCtx_::firewall_rule_file_exclusive
const char * firewall_rule_file_exclusive
Definition: detect.h:1132
DetectEngineCtx_::guess_applayer
bool guess_applayer
Definition: detect.h:967
PostRuleMatchWorkQueueItem
Definition: detect.h:1178
DetectEngineIPOnlyCtx_::tree_ipv4dst
SCRadix4Tree tree_ipv4dst
Definition: detect.h:848
PORT_LT
@ PORT_LT
Definition: detect.h:205
DetectEngineTransforms
Definition: detect.h:415
PrefilterEngineList_::id
uint16_t id
Definition: detect.h:1471
DetectBufferMpmRegistry_::sm_list_base
int16_t sm_list_base
Definition: detect.h:768
SigGroupHeadInitData_::sig_array
uint8_t * sig_array
Definition: detect.h:1544
SCProfileSghDetectCtx_
Definition: util-profiling-rulegroups.c:49
Signature_::app_progress_hook
uint8_t app_progress_hook
Definition: detect.h:706
DetectAddress_
address structure for use in the detection engine.
Definition: detect.h:167
DetectEngineCtx_::max_uniq_toclient_groups
uint16_t max_uniq_toclient_groups
Definition: detect.h:978
DetectEngineThreadCtx_::buffers
InspectionBufferMultipleForList * buffers
Definition: detect.h:1260
SignatureInitData_::prefilter_sm
SigMatch * prefilter_sm
Definition: detect.h:626
PrefilterRuleStore_
structure for storing potential rule matches
Definition: util-prefilter.h:34
SignatureInitData_::src_contains_negation
bool src_contains_negation
Definition: detect.h:602
FILE_DECODER_EVENT_LZMA_UNKNOWN_ERROR
@ FILE_DECODER_EVENT_LZMA_UNKNOWN_ERROR
Definition: detect.h:1423
DetectEngineCtx_::ref_cnt
uint32_t ref_cnt
Definition: detect.h:1044
DetectEngineCtx_::sigerror_silent
bool sigerror_silent
Definition: detect.h:1014
DetectEngineAppInspectionEngine_::Callback
InspectEngineFuncPtr Callback
Definition: detect.h:453
Signature_::alproto
AppProto alproto
Definition: detect.h:674
SignatureInitData_::is_rule_state_dependant
bool is_rule_state_dependant
Definition: detect.h:657
SignatureNonPrefilterStore_::id
SigIntId id
Definition: detect.h:1155
SigString_
Definition: detect.h:867
DetectAddressHead_
Definition: detect.h:182
MPMB_OTHERIP
@ MPMB_OTHERIP
Definition: detect.h:1445
DETECT_EVENT_POST_MATCH_QUEUE_FAILED
@ DETECT_EVENT_POST_MATCH_QUEUE_FAILED
Definition: detect.h:1426
DetectEngineCtx_::filedata_config
DetectFileDataCfg * filedata_config
Definition: detect.h:1027
next
struct HtpBodyChunk_ * next
Definition: app-layer-htp.h:0
DetectEngineFrameInspectionEngine::sm_list_base
uint16_t sm_list_base
Definition: detect.h:527
DetectPort_::port
uint16_t port
Definition: detect.h:220
SigMatchData_::is_last
bool is_last
Definition: detect.h:367
DetectEngineIPOnlyCtx_::ip_src
IPOnlyCIDRItem * ip_src
Definition: detect.h:852
AppProto
uint16_t AppProto
Definition: app-layer-protos.h:85
DETECT_SM_LIST_DYNAMIC_START
@ DETECT_SM_LIST_DYNAMIC_START
Definition: detect.h:137
IPOnlyCIDRItem_
Definition: detect.h:332
DetectFileDataCfg
Definition: detect.h:914
DetectEngineThreadCtx_::tx_id
uint64_t tx_id
Definition: detect.h:1269
DetectEngineThreadCtx_::decoder_events
AppLayerDecoderEvents * decoder_events
Definition: detect.h:1321
SigMatchData_::ctx
SigMatchCtx * ctx
Definition: detect.h:368
DetectBufferMpmRegistry_::pkt_v1
struct DetectBufferMpmRegistry_::@87::@90 pkt_v1
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:426
InspectionBuffer
Definition: detect.h:380
DetectVarList_::key_len
uint16_t key_len
Definition: detect.h:832
MpmStore_::sm_list
int sm_list
Definition: detect.h:1455
DetectEngineAppInspectionEngine_::GetData
InspectionBufferGetDataPtr GetData
Definition: detect.h:450
DetectEngineThreadKeywordCtxItem_
Definition: detect.h:885
DetectEngineCtx_::pkt_mpms_list
DetectBufferMpmRegistry * pkt_mpms_list
Definition: detect.h:1077
DETECT_BUFFER_MPM_TYPE_FRAME
@ DETECT_BUFFER_MPM_TYPE_FRAME
Definition: detect.h:757
Frame
Definition: app-layer-frames.h:45
Flow_
Flow data structure.
Definition: flow.h:356
SigTableElmt_::FileMatch
int(* FileMatch)(DetectEngineThreadCtx *, Flow *, uint8_t flags, File *, const Signature *, const SigMatchCtx *)
Definition: detect.h:1378
DetectVarList_
Definition: detect.h:827
DETECT_SM_LIST_THRESHOLD
@ DETECT_SM_LIST_THRESHOLD
Definition: detect.h:132
DetectReplaceList_::found
uint8_t * found
Definition: detect.h:817
PrefilterEngine_::tx_min_progress
int8_t tx_min_progress
Definition: detect.h:1518
DetectEngineThreadKeywordCtxItem_::data
void * data
Definition: detect.h:888
DetectEngineThreadCtx_::pmq
PrefilterRuleStore pmq
Definition: detect.h:1298
util-hash.h
EngineAnalysisCtx_
Definition: detect-engine-analyzer.c:83
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:421
SigGroupHeadInitData_::mpm_store
MpmStore mpm_store[MPMB_MAX]
Definition: detect.h:1542
ADDRESS_EB
@ ADDRESS_EB
Definition: detect.h:156
SigTableElmt_::flags
uint16_t flags
Definition: detect.h:1396
SigFindSignatureBySidGid
Signature * SigFindSignatureBySidGid(DetectEngineCtx *, uint32_t, uint32_t)
Find a specific signature by sid and gid.
Definition: detect-engine-build.c:79
DetectEngineIPOnlyCtx_::tree_ipv4src
SCRadix4Tree tree_ipv4src
Definition: detect.h:848
DetectEngineCtx_::inspection_recursion_limit
int inspection_recursion_limit
Definition: detect.h:961
PrefilterEngineList_::name
const char * name
Definition: detect.h:1500
DetectVarList_::len
uint16_t len
Definition: detect.h:831
DetectEngineFrameInspectionEngine::transforms
const DetectEngineTransforms * transforms
Definition: detect.h:531
DetectEngineCtx_
main detection engine ctx
Definition: detect.h:920
FILE_DECODER_EVENT_LZMA_DECODER_ERROR
@ FILE_DECODER_EVENT_LZMA_DECODER_ERROR
Definition: detect.h:1420
DetectEnginePktInspectionEngine::smd
SigMatchData * smd
Definition: detect.h:497
DetectPatternTracker
struct DetectPatternTracker DetectPatternTracker
SCProfilePrefilterDetectCtx_
Definition: util-profiling-prefilter.c:48
SIG_TYPE_PKT_STREAM
@ SIG_TYPE_PKT_STREAM
Definition: detect.h:72
DetectEngineThreadCtx_::lua_blocked_function_errors
uint16_t lua_blocked_function_errors
Definition: detect.h:1328
SigMatchSignatures
void SigMatchSignatures(ThreadVars *th_v, DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, Packet *p)
wrapper for old tests
Definition: detect.c:2319
DetectEngineThreadCtx_::global_keyword_ctxs_array
void ** global_keyword_ctxs_array
Definition: detect.h:1319
TransformData_::options
void * options
Definition: detect.h:412
DetectEngineFrameInspectionEngine::mpm
bool mpm
Definition: detect.h:525
detect-engine-register.h
SIGNATURE_HOOK_PKT_NOT_SET
@ SIGNATURE_HOOK_PKT_NOT_SET
Definition: detect.h:552
InspectionBuffer::orig
const uint8_t * orig
Definition: detect.h:394
DetectEngineCtx_::reference_conf_regex_match
pcre2_match_data * reference_conf_regex_match
Definition: detect.h:1114
RuleMatchCandidateTxArrayFree
void RuleMatchCandidateTxArrayFree(DetectEngineThreadCtx *det_ctx)
Definition: detect.c:1037
DetectEngineThreadCtx_::p
Packet * p
Definition: detect.h:1273
DetectEngineAppInspectionEngine_::v2
struct DetectEngineAppInspectionEngine_::@79 v2
SigTableElmt_::AppLayerTxMatch
int(* AppLayerTxMatch)(DetectEngineThreadCtx *, Flow *, uint8_t flags, void *alstate, void *txv, const Signature *, const SigMatchCtx *)
Definition: detect.h:1373
DetectEngineThreadCtx_::keyword_perf_list
int keyword_perf_list
Definition: detect.h:1355
DetectEngineCtx_::mpm_cfg
MpmConfig * mpm_cfg
Definition: detect.h:924
InspectionBufferGetPktDataPtr
InspectionBuffer *(* InspectionBufferGetPktDataPtr)(struct DetectEngineThreadCtx_ *det_ctx, const DetectEngineTransforms *transforms, Packet *p, const int list_id)
Definition: detect.h:491
DetectEngineCtx_::keyword_id
int keyword_id
Definition: detect.h:1023
RuleMatchCandidateTx::id
SigIntId id
Definition: detect.h:1162
Detect
TmEcode Detect(ThreadVars *tv, Packet *p, void *data)
Detection engine thread wrapper.
Definition: detect.c:2240
DetectBufferMpmRegistry_::type
uint8_t type
Definition: detect.h:800
SignatureProperties
Definition: detect.h:88
FILE_DECODER_EVENT_Z_UNKNOWN_ERROR
@ FILE_DECODER_EVENT_Z_UNKNOWN_ERROR
Definition: detect.h:1417
DetectBufferMpmRegistry_::next
struct DetectBufferMpmRegistry_ * next
Definition: detect.h:804
HashTable_
Definition: util-hash.h:35
DetectPatternTracker::cnt
uint32_t cnt
Definition: detect.h:811
DetectEngineTenantMapping_::next
struct DetectEngineTenantMapping_ * next
Definition: detect.h:1638
DetectEngineThreadCtx_::buffers_size
uint32_t buffers_size
Definition: detect.h:1252
DetectEngineCtx_::srep_version
uint32_t srep_version
Definition: detect.h:933
DetectEngineCtx_::profile_sgh_ctx
struct SCProfileSghDetectCtx_ * profile_sgh_ctx
Definition: detect.h:1036
Frames
Definition: app-layer-frames.h:60
DetectBufferMpmRegistry_
one time registration of keywords at start up
Definition: detect.h:763
ENGINE_SGH_MPM_FACTORY_CONTEXT_AUTO
@ ENGINE_SGH_MPM_FACTORY_CONTEXT_AUTO
Definition: detect.h:1148
DetectPort_::next
struct DetectPort_ * next
Definition: detect.h:233
DetectEngineCtx_::tcp_priorityports
DetectPort * tcp_priorityports
Definition: detect.h:1056
DetectReplaceList_
Definition: detect.h:815
MPMB_TCP_STREAM_TS
@ MPMB_TCP_STREAM_TS
Definition: detect.h:1441
DetectEngineAppInspectionEngine_::sm_list_base
uint16_t sm_list_base
Definition: detect.h:445
ENGINE_PROFILE_LOW
@ ENGINE_PROFILE_LOW
Definition: detect.h:1138
Address_
Definition: decode.h:112
DetectPatternTracker::cd
const struct DetectContentData_ * cd
Definition: detect.h:809
DetectEngineCtx_::sigerror_requires
bool sigerror_requires
Definition: detect.h:1018
InspectionBuffer::size
uint32_t size
Definition: detect.h:391
DetectEngineThreadCtx_::spm_thread_ctx
SpmThreadCtx * spm_thread_ctx
Definition: detect.h:1229
DetectAddressHead
struct DetectAddressHead_ DetectAddressHead
InspectionBuffer::flags
uint8_t flags
Definition: detect.h:385
DetectEngineCtx_::dport_hash_table
HashListTable * dport_hash_table
Definition: detect.h:1054
SignatureInitDataBuffer_::multi_capable
bool multi_capable
Definition: detect.h:542
Signature_::sm_arrays
SigMatchData * sm_arrays[DETECT_SM_LIST_MAX]
Definition: detect.h:732
SigGroupHead_::payload_engines
PrefilterEngine * payload_engines
Definition: detect.h:1581
DetectEngineCtx_::mpm_ctx_factory_container
MpmCtxFactoryContainer * mpm_ctx_factory_container
Definition: detect.h:984
DetectEngineCtx_::prefilter_setting
enum DetectEnginePrefilterSetting prefilter_setting
Definition: detect.h:1052
SignatureInitData_::init_flags
uint32_t init_flags
Definition: detect.h:609
DetectEngineCtx_::reference_conf_regex
pcre2_code * reference_conf_regex
Definition: detect.h:1113
DetectBufferType_
Definition: detect.h:463
DetectPort_::sh
struct SigGroupHead_ * sh
Definition: detect.h:230
DetectEngineCtx_::udp_priorityports
DetectPort * udp_priorityports
Definition: detect.h:1057
DetectContentData_
Definition: detect-content.h:93
DetectEngineSetEvent
void DetectEngineSetEvent(DetectEngineThreadCtx *det_ctx, uint8_t e)
Definition: detect-engine.c:5150
SigFileLoaderStat_::TAILQ_HEAD
TAILQ_HEAD(, SigString_) failed_sigs
PostRuleMatchWorkQueue::size
uint32_t size
Definition: detect.h:1191
FILE_DECODER_EVENT_LZMA_XZ_ERROR
@ FILE_DECODER_EVENT_LZMA_XZ_ERROR
Definition: detect.h:1422
DetectEngineCtx_::sigerror_ok
bool sigerror_ok
Definition: detect.h:1015
DetectEngineCtx_::class_conf_regex
pcre2_code * class_conf_regex
Definition: detect.h:1106
PrefilterEngine_::local_id
uint16_t local_id
Definition: detect.h:1506
ADDRESS_GT
@ ADDRESS_GT
Definition: detect.h:158
PrefilterEngineList_::Free
void(* Free)(void *pectx)
Definition: detect.h:1498
DetectEngineThreadCtx_::lua_instruction_limit_errors
uint16_t lua_instruction_limit_errors
Definition: detect.h:1331
PostRuleMatchWorkQueueItem
struct PostRuleMatchWorkQueueItem PostRuleMatchWorkQueueItem
RuleMatchCandidateTxArrayInit
void RuleMatchCandidateTxArrayInit(DetectEngineThreadCtx *det_ctx, uint32_t size)
Definition: detect.c:1024
MPMB_MAX
@ MPMB_MAX
Definition: detect.h:1446
SigTableElmt_
element in sigmatch type table.
Definition: detect.h:1368
SCDetectRequiresStatus
struct SCDetectRequiresStatus SCDetectRequiresStatus
Definition: detect.h:60
SigMatchData_
Data needed for Match()
Definition: detect.h:365
InspectionBufferMultipleForList::init
uint32_t init
Definition: detect.h:407
SigTableElmt_::Setup
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
Definition: detect.h:1387
DetectEngineCtx_::sgh_mpm_context_proto_udp_packet
int32_t sgh_mpm_context_proto_udp_packet
Definition: detect.h:993
DetectPort
struct DetectPort_ DetectPort
Port structure for detection engine.
RuleMatchCandidateTx::s
const Signature * s
Definition: detect.h:1172
DetectEngineCtx_::reference_conf_ht
HashTable * reference_conf_ht
Definition: detect.h:1112
DetectBufferMpmRegistry_::transforms
DetectEngineTransforms transforms
Definition: detect.h:776
SIG_TYPE_APPLAYER
@ SIG_TYPE_APPLAYER
Definition: detect.h:75
DetectEngineThreadCtx_::counter_fnonmpm_list
uint16_t counter_fnonmpm_list
Definition: detect.h:1246
SigMatchData_::type
uint16_t type
Definition: detect.h:366
DetectEngineCtx_::version
uint32_t version
Definition: detect.h:1001
DetectMatchAddressIPv4_::ip
uint32_t ip
Definition: detect.h:189
DETECT_TRANSFORMS_MAX
#define DETECT_TRANSFORMS_MAX
Definition: detect.h:47
InspectionBuffer::orig_len
uint32_t orig_len
Definition: detect.h:393
DetectEngineThreadCtx_::varlist
DetectVarList * varlist
Definition: detect.h:1303
Signature_::dsize_low
uint16_t dsize_low
Definition: detect.h:676
DetectPort_::port2
uint16_t port2
Definition: detect.h:221
DetectEngineCtx_::non_pf_engine_names
HashTable * non_pf_engine_names
Definition: detect.h:1130
SignatureNonPrefilterStore_
Definition: detect.h:1154
DetectEngineThreadCtx_::counter_nonmpm_list
uint16_t counter_nonmpm_list
Definition: detect.h:1245
MPMB_TCP_STREAM_TC
@ MPMB_TCP_STREAM_TC
Definition: detect.h:1442
DetectEngineThreadCtx_::events
uint16_t events
Definition: detect.h:1322
AppLayerDecoderEvents_
Data structure to store app layer decoder events.
Definition: app-layer-events.h:36
SigGroupHead
struct SigGroupHead_ SigGroupHead
Container for matching data for a signature group.
DetectMatchAddressIPv6
struct DetectMatchAddressIPv6_ DetectMatchAddressIPv6
DetectUnregisterThreadCtxFuncs
int DetectUnregisterThreadCtxFuncs(DetectEngineCtx *, void *data, const char *name)
Remove Thread keyword context registration.
Definition: detect-engine.c:3860
TransformData_
Definition: detect.h:410
FLOW_STATES
#define FLOW_STATES
Definition: detect.h:912
Signature_::frame_inspect
DetectEngineFrameInspectionEngine * frame_inspect
Definition: detect.h:728
FIREWALL_TABLE_APP_FILTER
@ FIREWALL_TABLE_APP_FILTER
Definition: detect.h:566
DetectEngineIPOnlyCtx_::tree_ipv6src
SCRadix6Tree tree_ipv6src
Definition: detect.h:849
DetectEnginePktInspectionEngine::transforms
const DetectEngineTransforms * transforms
Definition: detect.h:505
MpmBuiltinBuffers
MpmBuiltinBuffers
Definition: detect.h:1438
DetectPort_::flags
uint8_t flags
Definition: detect.h:223
SigRegisterTests
void SigRegisterTests(void)
Definition: detect.c:4960
DetectThreadCtxGetKeywordThreadCtx
void * DetectThreadCtxGetKeywordThreadCtx(DetectEngineThreadCtx *, int)
Retrieve thread local keyword ctx by id.
Definition: detect-engine.c:3878
DetectEngineFrameInspectionEngine::Callback
InspectionBufferFrameInspectFunc Callback
Definition: detect.h:529
InspectionBufferMultipleForList::size
uint32_t size
Definition: detect.h:405
DetectEngineThreadCtx_::mt_det_ctxs_hash
HashTable * mt_det_ctxs_hash
Definition: detect.h:1209
DetectAddress_::prev
struct DetectAddress_ * prev
Definition: detect.h:176
DETECT_PREFILTER_AUTO
@ DETECT_PREFILTER_AUTO
Definition: detect.h:897
DetectEngineThreadCtx_::keyword_ctxs_size
int keyword_ctxs_size
Definition: detect.h:1316
PrefilterEngine_::is_last_for_progress
bool is_last_for_progress
Definition: detect.h:1523
detect-reference.h
Signature_::gid
uint32_t gid
Definition: detect.h:715
DetectEngineThreadCtx_::lua_rule_errors
uint16_t lua_rule_errors
Definition: detect.h:1325
DetectEngineCtx_::prefilter_id
uint32_t prefilter_id
Definition: detect.h:1083
DetectEngineCtx_::sgh_array_size
uint32_t sgh_array_size
Definition: detect.h:990
SigGroupHeadInitData_::pkt_mpms
MpmCtx ** pkt_mpms
Definition: detect.h:1553
SigString_::sig_error
char * sig_error
Definition: detect.h:870
DetectMatchAddressIPv6_::ip2
uint32_t ip2[4]
Definition: detect.h:195
DetectEngineAppInspectionEngine_::id
uint8_t id
Definition: detect.h:439
SCRadix4Tree_
Structure for the radix tree.
Definition: util-radix4-tree.h:66
PrefilterEngineList_::next
struct PrefilterEngineList_ * next
Definition: detect.h:1495
DetectEngineThreadCtx_::counter_alerts_suppressed
uint16_t counter_alerts_suppressed
Definition: detect.h:1242
SigTableElmt_::SetupPrefilter
int(* SetupPrefilter)(DetectEngineCtx *de_ctx, struct SigGroupHead_ *sgh)
Definition: detect.h:1390
DetectEngineCtx_::base64_decode_max_len
uint16_t base64_decode_max_len
Definition: detect.h:1008
SIGNATURE_HOOK_TYPE_APP
@ SIGNATURE_HOOK_TYPE_APP
Definition: detect.h:560
Signature_::next
struct Signature_ * next
Definition: detect.h:751
DetectEngineCtx_::sgh_mpm_context_proto_other_packet
int32_t sgh_mpm_context_proto_other_packet
Definition: detect.h:994
DetectVarList
struct DetectVarList_ DetectVarList
DetectEngineAppInspectionEngine_::sm_list
uint16_t sm_list
Definition: detect.h:444
DetectEngineThreadCtx_::filestore
struct DetectEngineThreadCtx_::@100 filestore[DETECT_FILESTORE_MAX]
TENANT_SELECTOR_UNKNOWN
@ TENANT_SELECTOR_UNKNOWN
Definition: detect.h:1626
DetectEngineTenantMapping_::tenant_id
uint32_t tenant_id
Definition: detect.h:1633
InspectionBufferMultipleForList
Definition: detect.h:403
SigFileLoaderStat_::skipped_sigs_total
int skipped_sigs_total
Definition: detect.h:882
DetectBufferMpmType
DetectBufferMpmType
Definition: detect.h:754
DETECT_SM_LIST_POSTMATCH
@ DETECT_SM_LIST_POSTMATCH
Definition: detect.h:126
PrefilterEngine_::cb
union PrefilterEngine_::@102 cb
DetectEngineTenantMapping
struct DetectEngineTenantMapping_ DetectEngineTenantMapping
DetectEngineCtx_::prefilter_hash_table
HashListTable * prefilter_hash_table
Definition: detect.h:1084
ENGINE_PROFILE_HIGH
@ ENGINE_PROFILE_HIGH
Definition: detect.h:1140
SigGroupHeadInitData_::score
int score
Definition: detect.h:1549
DetectReplaceList
struct DetectReplaceList_ DetectReplaceList
SignaturePropertyFlowAction
SignaturePropertyFlowAction
Definition: detect.h:82
SigString_::TAILQ_ENTRY
TAILQ_ENTRY(SigString_) next
DetectEngineTenantSelectors
DetectEngineTenantSelectors
Definition: detect.h:1625
DetectBufferMpmRegistry_::GetData
InspectionBufferGetDataPtr GetData
Definition: detect.h:782
DetectFileDataCfg::content_inspect_min_size
uint32_t content_inspect_min_size
Definition: detect.h:916
InspectionBufferPktInspectFunc
int(* InspectionBufferPktInspectFunc)(struct DetectEngineThreadCtx_ *, const struct DetectEnginePktInspectionEngine *engine, const struct Signature_ *s, Packet *p, uint8_t *alert_flags)
Definition: detect.h:484
DetectBufferType
struct DetectBufferType_ DetectBufferType
DetectEngineCtx_::class_conf_regex_match
pcre2_match_data * class_conf_regex_match
Definition: detect.h:1107
DetectEngineThreadCtx_::tx_candidates
RuleMatchCandidateTx * tx_candidates
Definition: detect.h:1291
InspectionBuffer
struct InspectionBuffer InspectionBuffer
SIG_TYPE_PKT
@ SIG_TYPE_PKT
Definition: detect.h:71
DetectEngineCtx_::requirements
SCDetectRequiresStatus * requirements
Definition: detect.h:1123
DetectEngineMasterCtx
struct DetectEngineMasterCtx_ DetectEngineMasterCtx
Signature_::addr_src_match4
DetectMatchAddressIPv4 * addr_src_match4
Definition: detect.h:709
SignatureHook_::pkt
struct SignatureHook_::@84::@86 pkt
SigTableElmt_::TransformValidate
bool(* TransformValidate)(const uint8_t *content, uint16_t content_len, void *context)
Definition: detect.h:1384
PrefilterEngineList_::pkt_hook
enum SignatureHookPkt pkt_hook
Definition: detect.h:1483
Signature_::class_id
uint16_t class_id
Definition: detect.h:700
DetectEngineThreadCtx_::counter_alerts_overflow
uint16_t counter_alerts_overflow
Definition: detect.h:1240
DetectBufferType_::ValidateCallback
bool(* ValidateCallback)(const struct Signature_ *, const char **sigerror, const struct DetectBufferType_ *)
Definition: detect.h:474
DETECT_FILESTORE_MAX
#define DETECT_FILESTORE_MAX
Definition: detect.h:1152
PrefilterEngineList_::alproto
AppProto alproto
Definition: detect.h:1474
SignatureInitData
struct SignatureInitData_ SignatureInitData
SigGroupHeadInitData_::sig_cnt
SigIntId sig_cnt
Definition: detect.h:1563
SRepCIDRTree_
Definition: reputation.h:36
DetectBufferMpmRegistry_::sgh_mpm_context
int sgh_mpm_context
Definition: detect.h:772
de_ctx
DetectEngineCtx * de_ctx
Definition: fuzz_siginit.c:18
DetectEnginePktInspectionEngine::sm_list
uint16_t sm_list
Definition: detect.h:499
DetectEngineThreadCtx_::match_array_len
uint32_t match_array_len
Definition: detect.h:1287
ADDRESS_GE
@ ADDRESS_GE
Definition: detect.h:157
DetectBufferMpmRegistry_::GetData
InspectionBufferGetPktDataPtr GetData
Definition: detect.h:794
PrefilterEngine_::pkt
struct PrefilterEngine_::@101::@103 pkt
IPOnlyCIDRItem_::negated
uint8_t negated
Definition: detect.h:338
SignatureInitData_::buffers_size
uint32_t buffers_size
Definition: detect.h:650
ENGINE_SGH_MPM_FACTORY_CONTEXT_SINGLE
@ ENGINE_SGH_MPM_FACTORY_CONTEXT_SINGLE
Definition: detect.h:1147
DetectEngineThreadCtx_
Definition: detect.h:1197
FIREWALL_TABLE_PACKET_TD
@ FIREWALL_TABLE_PACKET_TD
Definition: detect.h:565
PrefilterEngine_
Definition: detect.h:1505
MpmStore_
Definition: detect.h:1449
SigGroupHeadInitData_::tx_engines
PrefilterEngineList * tx_engines
Definition: detect.h:1558
SIG_TYPE_IPONLY
@ SIG_TYPE_IPONLY
Definition: detect.h:65
SCProfileKeywordDetectCtx_
Definition: util-profiling-keywords.c:49
PORT_ES
@ PORT_ES
Definition: detect.h:208
SignatureInitData_::mpm_sm
SigMatch * mpm_sm
Definition: detect.h:624
DetectEngineCtx_::srepCIDR_ctx
SRepCIDRTree * srepCIDR_ctx
Definition: detect.h:936
SignatureInitData_::src
const DetectAddressHead * src
Definition: detect.h:640
DetectEngineThreadCtx_::tx_candidates_size
uint32_t tx_candidates_size
Definition: detect.h:1292
signature_properties
const struct SignatureProperties signature_properties[SIG_TYPE_MAX]
Definition: detect-engine.c:117
DETECT_SM_LIST_BASE64_DATA
@ DETECT_SM_LIST_BASE64_DATA
Definition: detect.h:123
DetectEngineThreadKeywordCtxItem_::id
int id
Definition: detect.h:890
DetectBufferMpmRegistry_::sm_list
int16_t sm_list
Definition: detect.h:767
DetectEngineThreadCtx_::buffers
InspectionBuffer * buffers
Definition: detect.h:1251
DetectEngineMasterCtx_::keyword_list
DetectEngineThreadKeywordCtxItem * keyword_list
Definition: detect.h:1668
SignatureInitData_::mpm_sm_list
int mpm_sm_list
Definition: detect.h:622
PrefilterEngineList_::PrefilterFrame
PrefilterFrameFn PrefilterFrame
Definition: detect.h:1491
DetectEngineMasterCtx_::tenant_selector
enum DetectEngineTenantSelectors tenant_selector
Definition: detect.h:1659
DetectEngineCtx_::keyword_hash
HashListTable * keyword_hash
Definition: detect.h:1025
PrefilterEngineList_::pectx
void * pectx
Definition: detect.h:1487
SignatureInitData_::cidr_dst
IPOnlyCIDRItem * cidr_dst
Definition: detect.h:619
DetectEngineCtx_::last_reload
struct timeval last_reload
Definition: detect.h:1087
SignatureInitData_::list
int list
Definition: detect.h:629
DetectEngineCtx_::failure_fatal
bool failure_fatal
Definition: detect.h:921
Signature_::pkt_inspect
DetectEnginePktInspectionEngine * pkt_inspect
Definition: detect.h:727
DetectEngineAppInspectionEngine_::GetMultiData
InspectionMultiBufferGetDataPtr GetMultiData
Definition: detect.h:451
SCProfileSghData_
Definition: util-profiling-rulegroups.c:38
DetectReplaceList_::next
struct DetectReplaceList_ * next
Definition: detect.h:818
DetectEngineLookupFlow_::sgh
struct SigGroupHead_ * sgh[256]
Definition: detect.h:864
Signature_::references
DetectReference * references
Definition: detect.h:742
PrefilterEngineList_::PrefilterTx
PrefilterTxFn PrefilterTx
Definition: detect.h:1490
ThreadVars_
Per thread variable structure.
Definition: threadvars.h:58
DetectEngineCtx_::sm_types_prefilter
bool * sm_types_prefilter
Definition: detect.h:1099
SignatureNonPrefilterStore_::alproto
AppProto alproto
Definition: detect.h:1157
SignatureInitData_::rule_state_flowbits_ids_size
uint32_t rule_state_flowbits_ids_size
Definition: detect.h:662
SignatureHookPkt
SignatureHookPkt
Definition: detect.h:551
PrefilterEngineList_::gid
uint32_t gid
Definition: detect.h:1502
ADDRESS_LT
@ ADDRESS_LT
Definition: detect.h:152
PORT_EB
@ PORT_EB
Definition: detect.h:209
DetectEngineFrameInspectionEngine::sm_list
uint16_t sm_list
Definition: detect.h:526
DetectMetadataHead
Definition: detect-metadata.h:39
SigTableElmt
struct SigTableElmt_ SigTableElmt
element in sigmatch type table.
SigMatch
struct SigMatch_ SigMatch
a single match condition for a signature
DetectBufferMpmRegistry_::app_v2
struct DetectBufferMpmRegistry_::@87::@89 app_v2
SigMatch_::next
struct SigMatch_ * next
Definition: detect.h:360
DetectEngineCtx_::mpm_matcher
uint8_t mpm_matcher
Definition: detect.h:923
PORT_GT
@ PORT_GT
Definition: detect.h:211
FIREWALL_TABLE_PACKET_FILTER
@ FIREWALL_TABLE_PACKET_FILTER
Definition: detect.h:564
InspectionBuffer::inspect_offset
uint64_t inspect_offset
Definition: detect.h:382
DetectEngineCtx_::frame_inspect_engines
DetectEngineFrameInspectionEngine * frame_inspect_engines
Definition: detect.h:1079
DetectBufferMpmRegistry_::priority
int priority
Definition: detect.h:769
PrefilterEngineList
struct PrefilterEngineList_ PrefilterEngineList
DetectEngineMasterCtx_::free_list
DetectEngineCtx * free_list
Definition: detect.h:1657
DetectVarList_::type
uint16_t type
Definition: detect.h:828
DetectEngineCtx_::filestore_cnt
uint16_t filestore_cnt
Definition: detect.h:1126
ADDRESS_LE
@ ADDRESS_LE
Definition: detect.h:153
DetectEngineThreadKeywordCtxItem_::next
struct DetectEngineThreadKeywordCtxItem_ * next
Definition: detect.h:889
DetectAddress_::ip2
Address ip2
Definition: detect.h:170
PrefilterFrameFn
void(* PrefilterFrameFn)(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p, const struct Frames *frames, const struct Frame *frame)
Definition: detect.h:1463
DETECT_SM_LIST_MATCH
@ DETECT_SM_LIST_MATCH
Definition: detect.h:116
DetectPort_
Port structure for detection engine.
Definition: detect.h:219
SigGroupHead_::init
SigGroupHeadInitData * init
Definition: detect.h:1587
DetectEngineCtx_::sig_cnt
uint32_t sig_cnt
Definition: detect.h:930
InspectionBuffer::buf
uint8_t * buf
Definition: detect.h:390
SigTableElmt_::alternative
uint16_t alternative
Definition: detect.h:1400
SignatureInitData_::cidr_src
IPOnlyCIDRItem * cidr_src
Definition: detect.h:619
Signature_::app_inspect
DetectEngineAppInspectionEngine * app_inspect
Definition: detect.h:726
SigMatch_::ctx
SigMatchCtx * ctx
Definition: detect.h:359
DetectReference_
Signature reference list.
Definition: detect-reference.h:30
SignatureInitData_::hook
SignatureHook hook
Definition: detect.h:591
SIGNATURE_HOOK_TYPE_NOT_SET
@ SIGNATURE_HOOK_TYPE_NOT_SET
Definition: detect.h:558
SigFileLoaderStat_::bad_sigs_total
int bad_sigs_total
Definition: detect.h:881
SigGroupHeadInitData_::direction
uint32_t direction
Definition: detect.h:1548
DetectLoadCompleteSigPath
char * DetectLoadCompleteSigPath(const DetectEngineCtx *, const char *sig_file)
Create the path if default-rule-path was specified.
Definition: detect-engine-loader.c:106
PORT_ER
@ PORT_ER
Definition: detect.h:204
MpmStore_::direction
int direction
Definition: detect.h:1453
DetectEngineThreadCtx_::base64_decoded_len
int base64_decoded_len
Definition: detect.h:1276
DetectVarList_::next
struct DetectVarList_ * next
Definition: detect.h:836
DetectEngineThreadCtx_::lua_memory_limit_errors
uint16_t lua_memory_limit_errors
Definition: detect.h:1334
RuleMatchCandidateTx::stream_result
uint8_t stream_result
Definition: detect.h:1167
Signature_::action
uint8_t action
Definition: detect.h:684
DetectEngineLookupFlow_::udp
DetectPort * udp
Definition: detect.h:863
DetectEngineThreadCtx_::raw_stream_progress
uint64_t raw_stream_progress
Definition: detect.h:1218
SignatureHook_::alproto
AppProto alproto
Definition: detect.h:577
SignatureHookType
SignatureHookType
Definition: detect.h:557
PrefilterEngine_::alproto
AppProto alproto
Definition: detect.h:1509
Signature_::flags
uint32_t flags
Definition: detect.h:670
PostRuleMatchWorkQueue
struct PostRuleMatchWorkQueue PostRuleMatchWorkQueue
IPOnlyCIDRItem_::next
struct IPOnlyCIDRItem_ * next
Definition: detect.h:344
DetectEngineCtx_::max_fb_id
uint32_t max_fb_id
Definition: detect.h:982
DetectEngineIPOnlyCtx_::sig_mapping
uint32_t * sig_mapping
Definition: detect.h:857
Packet_
Definition: decode.h:484
DetectEngineFrameInspectionEngine::alproto
AppProto alproto
Definition: detect.h:522
FILE_DECODER_EVENT_Z_STREAM_ERROR
@ FILE_DECODER_EVENT_Z_STREAM_ERROR
Definition: detect.h:1415
DetectEngineCtx_::sgh_mpm_context_stream
int32_t sgh_mpm_context_stream
Definition: detect.h:995
SignatureNonPrefilterStore
struct SignatureNonPrefilterStore_ SignatureNonPrefilterStore
DetectBufferMpmRegistry
struct DetectBufferMpmRegistry_ DetectBufferMpmRegistry
one time registration of keywords at start up
DetectPort_::last
struct DetectPort_ * last
Definition: detect.h:234
sigmatch_table
SigTableElmt * sigmatch_table
Definition: detect-parse.c:155
DetectEngineThreadCtx_::frame_id
int64_t frame_id
Definition: detect.h:1270
ENGINE_PROFILE_MEDIUM
@ ENGINE_PROFILE_MEDIUM
Definition: detect.h:1139
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:517
DetectEngineCtx_::frame_mpms_list
DetectBufferMpmRegistry * frame_mpms_list
Definition: detect.h:1080
FILE_DECODER_EVENT_INVALID_SWF_LENGTH
@ FILE_DECODER_EVENT_INVALID_SWF_LENGTH
Definition: detect.h:1412
TransformData
struct TransformData_ TransformData
DetectEngineCtx_::sgh_mpm_ctx_cnf
uint8_t sgh_mpm_ctx_cnf
Definition: detect.h:1021
DetectEngineAppInspectionEngine_::match_on_null
bool match_on_null
Definition: detect.h:443
DetectBufferType_::packet
bool packet
Definition: detect.h:469
SignatureHook_::app
struct SignatureHook_::@84::@85 app
SCSigOrderFunc_
Structure holding the signature ordering function used by the signature ordering module.
Definition: detect-engine-sigorder.c:101
PrefilterEngine
struct PrefilterEngine_ PrefilterEngine
MpmStore_::alproto
AppProto alproto
Definition: detect.h:1457
DetectEngineMasterCtx_::multi_tenant_enabled
int multi_tenant_enabled
Definition: detect.h:1645
DetectRegisterThreadCtxFuncs
int DetectRegisterThreadCtxFuncs(DetectEngineCtx *, const char *name, void *(*InitFunc)(void *), void *data, void(*FreeFunc)(void *), int)
Register Thread keyword context Funcs.
Definition: detect-engine.c:3808
DetectEngineThreadCtx_::filestore_cnt
uint16_t filestore_cnt
Definition: detect.h:1235
DetectEngineFrameInspectionEngine
Definition: detect.h:521
DetectFileDataCfg::content_limit
uint32_t content_limit
Definition: detect.h:915
SigFileLoaderStat
struct SigFileLoaderStat_ SigFileLoaderStat
Signature loader statistics.
DetectEngineCtx_::max_uniq_toserver_groups
uint16_t max_uniq_toserver_groups
Definition: detect.h:979
DETECT_BUFFER_MPM_TYPE_PKT
@ DETECT_BUFFER_MPM_TYPE_PKT
Definition: detect.h:755
FILE_DECODER_EVENT_LZMA_IO_ERROR
@ FILE_DECODER_EVENT_LZMA_IO_ERROR
Definition: detect.h:1418
TmEcode
TmEcode
Definition: tm-threads-common.h:80
DetectEnginePktInspectionEngine::Callback
InspectionBufferPktInspectFunc Callback
Definition: detect.h:503
PrefilterEngine_::PrefilterFrame
PrefilterFrameFn PrefilterFrame
Definition: detect.h:1532
PrefilterEngine_::frame_type
uint8_t frame_type
Definition: detect.h:1519
DetectBufferType_::name
char name[64]
Definition: detect.h:464
name
const char * name
Definition: tm-threads.c:2135
Signature_::init_data
SignatureInitData * init_data
Definition: detect.h:748
DetectEngineCtx_::profile_keyword_ctx
struct SCProfileKeywordDetectCtx_ * profile_keyword_ctx
Definition: detect.h:1033
SigGroupHeadInitData_::max_sig_id
uint32_t max_sig_id
Definition: detect.h:1550
DetectEngineCtx_::sgh_array_cnt
uint32_t sgh_array_cnt
Definition: detect.h:989
SignatureInitData_::rule_state_dependant_sids_array
uint32_t * rule_state_dependant_sids_array
Definition: detect.h:658
DetectEngineThreadCtx_::alert_queue_capacity
uint16_t alert_queue_capacity
Definition: detect.h:1279
SignatureInitData_::negated
bool negated
Definition: detect.h:598
DetectEngineCtx_::sgh_array
struct SigGroupHead_ ** sgh_array
Definition: detect.h:988
SigTableElmt_::Match
int(* Match)(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *)
Definition: detect.h:1370
reputation.h
MpmStore
struct MpmStore_ MpmStore
SignatureInitData_
Definition: detect.h:590
SCFPSupportSMList_::priority
int priority
Definition: detect.h:841
HashListTable_
Definition: util-hashlist.h:37
PrefilterTxFn
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)
Definition: detect.h:1467
SignatureInitData_::rule_state_dependant_sids_size
uint32_t rule_state_dependant_sids_size
Definition: detect.h:659
DetectEngineCtx_::byte_extract_max_local_id
int32_t byte_extract_max_local_id
Definition: detect.h:998
SignatureInitData_::dst_contains_negation
bool dst_contains_negation
Definition: detect.h:603
DetectEnginePktInspectionEngine::sm_list_base
uint16_t sm_list_base
Definition: detect.h:500
DetectEngineTransforms::transforms
TransformData transforms[DETECT_TRANSFORMS_MAX]
Definition: detect.h:416
Signature_::addr_dst_match6_cnt
uint16_t addr_dst_match6_cnt
Definition: detect.h:696
SIG_TYPE_DEONLY
@ SIG_TYPE_DEONLY
Definition: detect.h:70
SIG_PROP_FLOW_ACTION_PACKET
@ SIG_PROP_FLOW_ACTION_PACKET
Definition: detect.h:83
ADDRESS_ER
@ ADDRESS_ER
Definition: detect.h:151
DetectEngineThreadCtx
struct DetectEngineThreadCtx_ DetectEngineThreadCtx
SigGroupHead_::frame_engines
PrefilterEngine * frame_engines
Definition: detect.h:1583
SigGroupHeadInitData_::app_mpms
MpmCtx ** app_mpms
Definition: detect.h:1552
SIG_ALPROTO_MAX
#define SIG_ALPROTO_MAX
Definition: detect.h:588
DetectEngineFrameInspectionEngine::dir
uint8_t dir
Definition: detect.h:523
DetectEngineTransforms
struct DetectEngineTransforms DetectEngineTransforms
Signature_::sp
DetectPort * sp
Definition: detect.h:720
SIG_TYPE_NOT_SET
@ SIG_TYPE_NOT_SET
Definition: detect.h:64
FILE_DECODER_EVENT_Z_BUF_ERROR
@ FILE_DECODER_EVENT_Z_BUF_ERROR
Definition: detect.h:1416
DetectEngineThreadCtx_::mtc
MpmThreadCtx mtc
Definition: detect.h:1294
SigString_::filename
char * filename
Definition: detect.h:868
DetectBufferType_::multi_instance
bool multi_instance
Definition: detect.h:472
DETECT_ENGINE_TYPE_TENANT
@ DETECT_ENGINE_TYPE_TENANT
Definition: detect.h:905
RuleMatchCandidateTx::flags
uint32_t * flags
Definition: detect.h:1163
PostRuleMatchWorkQueue
Definition: detect.h:1188
DetectEngineCtx_::dup_sig_hash_table
HashListTable * dup_sig_hash_table
Definition: detect.h:956
DetectEngineCtx_::config_prefix
char config_prefix[64]
Definition: detect.h:1039
PrefilterEngineList_::tx_min_progress
int8_t tx_min_progress
Definition: detect.h:1477
DetectEngineAppInspectionEngine_::alproto
AppProto alproto
Definition: detect.h:437
ENGINE_SGH_MPM_FACTORY_CONTEXT_FULL
@ ENGINE_SGH_MPM_FACTORY_CONTEXT_FULL
Definition: detect.h:1146
PORT_LE
@ PORT_LE
Definition: detect.h:206
SigMatchCtx_
Used to start a pointer to SigMatch context Should never be dereferenced without casting to something...
Definition: detect.h:351
Signature_::class_msg
char * class_msg
Definition: detect.h:740
DetectPatternTracker::sm_list
int sm_list
Definition: detect.h:810
DetectEngineAppInspectionEngine_::smd
SigMatchData * smd
Definition: detect.h:458
SigGroupHeadInitData_::pkt_engines
PrefilterEngineList * pkt_engines
Definition: detect.h:1556
DetectBufferMpmRegistry_::GetMultiData
InspectionMultiBufferGetDataPtr GetMultiData
Definition: detect.h:783
DetectBufferType_::id
int id
Definition: detect.h:466
DetectEngineCtx_::spm_matcher
uint8_t spm_matcher
Definition: detect.h:925
SigGroupHead_::post_rule_match_engines
PrefilterEngine * post_rule_match_engines
Definition: detect.h:1584
DetectEnginePktInspectionEngine::GetData
InspectionBufferGetPktDataPtr GetData
Definition: detect.h:502
DETECT_ENGINE_TYPE_NORMAL
@ DETECT_ENGINE_TYPE_NORMAL
Definition: detect.h:902
SignatureInitDataBuffer_::tail
SigMatch * tail
Definition: detect.h:548
DetectEngineIPOnlyCtx_::ip_dst
IPOnlyCIDRItem * ip_dst
Definition: detect.h:852
MpmStore_::mpm_ctx
MpmCtx * mpm_ctx
Definition: detect.h:1458
util-file.h
DetectAddressHead_::ipv6_head
DetectAddress * ipv6_head
Definition: detect.h:184
DetectMetadataHashFree
void DetectMetadataHashFree(DetectEngineCtx *de_ctx)
Definition: detect-metadata.c:80
util-prefilter.h
SignatureInitData_::dsize_sm
SigMatch * dsize_sm
Definition: detect.h:616
DetectBufferType_::frame
bool frame
Definition: detect.h:470
File_
Definition: util-file.h:79
AppLayerTxData
struct AppLayerTxData AppLayerTxData
Definition: detect.h:1466
DetectEngineIPOnlyCtx
struct DetectEngineIPOnlyCtx_ DetectEngineIPOnlyCtx
IP only rules matching ctx.
MPMB_TCP_PKT_TC
@ MPMB_TCP_PKT_TC
Definition: detect.h:1440
DetectEngineCtx_::sig_stat
SigFileLoaderStat sig_stat
Definition: detect.h:1090
DetectEngineCtx_::address_table
HashListTable * address_table
Definition: detect.h:1060
DetectEngineThreadCtx_::to_clear_queue
uint32_t * to_clear_queue
Definition: detect.h:1254
DetectEngineCtx_::profile_prefilter_ctx
struct SCProfilePrefilterDetectCtx_ * profile_prefilter_ctx
Definition: detect.h:1034
TENANT_SELECTOR_DIRECT
@ TENANT_SELECTOR_DIRECT
Definition: detect.h:1627
DetectEngineCtx_::rule_file
const char * rule_file
Definition: detect.h:1012
InspectionBufferMultipleForList
struct InspectionBufferMultipleForList InspectionBufferMultipleForList
util-mpm.h
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:431
flags
uint8_t flags
Definition: decode-gre.h:0
Signature_::proto
DetectProto proto
Definition: detect.h:688
SigTableElmt_::alias
const char * alias
Definition: detect.h:1403
DetectBufferMpmRegistry_::type
enum DetectBufferMpmType type
Definition: detect.h:771
SigMatchCtx
struct SigMatchCtx_ SigMatchCtx
Used to start a pointer to SigMatch context Should never be dereferenced without casting to something...
DetectEngineMasterCtx_::keyword_id
int keyword_id
Definition: detect.h:1669
DetectEngineCtx_::app_mpms_list
DetectBufferMpmRegistry * app_mpms_list
Definition: detect.h:1072
suricata-common.h
SigMatch_::idx
uint16_t idx
Definition: detect.h:358
SIG_PROP_FLOW_ACTION_FLOW_IF_STATEFUL
@ SIG_PROP_FLOW_ACTION_FLOW_IF_STATEFUL
Definition: detect.h:85
DetectEngineThreadCtx_::prefilter_bytes_called
uint64_t prefilter_bytes_called
Definition: detect.h:1362
SigString_::line
int line
Definition: detect.h:871
SigGroupHeadInitData_::frame_engines
PrefilterEngineList * frame_engines
Definition: detect.h:1559
SigMatch_::type
uint16_t type
Definition: detect.h:357
DETECT_BUFFER_MPM_TYPE_APP
@ DETECT_BUFFER_MPM_TYPE_APP
Definition: detect.h:756
SigGroupHeadInitData_::payload_engines
PrefilterEngineList * payload_engines
Definition: detect.h:1557
DetectEngineThreadCtx_::tenant_id
uint32_t tenant_id
Definition: detect.h:1200
SigGroupHeadInitData_::match_array
Signature ** match_array
Definition: detect.h:1566
SignatureHook_::ph
enum SignatureHookPkt ph
Definition: detect.h:583
DetectEngineCtx_::buffer_type_hash_name
HashListTable * buffer_type_hash_name
Definition: detect.h:1067
DetectEngineCtx_::next
struct DetectEngineCtx_ * next
Definition: detect.h:1046
Signature_::dsize_high
uint16_t dsize_high
Definition: detect.h:677
Signature_::file_flags
uint8_t file_flags
Definition: detect.h:685
DetectBufferMpmRegistry_::name
const char * name
Definition: detect.h:764
detect-metadata.h
Signature_::action_scope
uint8_t action_scope
Definition: detect.h:691
DETECT_ENGINE_TYPE_DD_STUB
@ DETECT_ENGINE_TYPE_DD_STUB
Definition: detect.h:903
TENANT_SELECTOR_VLAN
@ TENANT_SELECTOR_VLAN
Definition: detect.h:1628
DetectEngineFrameInspectionEngine::next
struct DetectEngineFrameInspectionEngine * next
Definition: detect.h:534
SignatureInitData_::curbuf
SignatureInitDataBuffer * curbuf
Definition: detect.h:651
DetectEngineThreadCtx_::prefilter_perf_data
struct SCProfilePrefilterData_ * prefilter_perf_data
Definition: detect.h:1358
DetectEnginePrefilterSetting
DetectEnginePrefilterSetting
Definition: detect.h:895
SignatureHook_::type
enum SignatureHookType type
Definition: detect.h:573
DetectPort_::prev
struct DetectPort_ * prev
Definition: detect.h:232
util-spm.h
DetectEnginePktInspectionEngine::next
struct DetectEnginePktInspectionEngine * next
Definition: detect.h:507
SignatureType
SignatureType
Definition: detect.h:63
PrefilterEngineList_::PrefilterPostRule
void(* PrefilterPostRule)(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p, Flow *f)
Definition: detect.h:1492
SigGroupHeadInitData_::sig_size
uint32_t sig_size
Definition: detect.h:1545
PrefilterEngineList_
Definition: detect.h:1470
SigFileLoaderStat_::total_files
int total_files
Definition: detect.h:879
util-radix4-tree.h
DetectEngineThreadCtx_::frame_inspect_progress
uint64_t frame_inspect_progress
Definition: detect.h:1271
DetectMatchAddressIPv4_::ip2
uint32_t ip2
Definition: detect.h:190
DetectEngineCtx_::profile_match_logging_threshold
uint32_t profile_match_logging_threshold
Definition: detect.h:1037
PostRuleMatchWorkQueue::q
PostRuleMatchWorkQueueItem * q
Definition: detect.h:1189
IPOnlyCIDRItem_::ip
uint32_t ip[4]
Definition: detect.h:340
PrefilterEngine_::gid
uint32_t gid
Definition: detect.h:1538
Signature_::rev
uint32_t rev
Definition: detect.h:716
SignatureInitData_::sm_cnt
uint16_t sm_cnt
Definition: detect.h:594
DetectEngineFrameInspectionEngine::v1
struct DetectEngineFrameInspectionEngine::@83 v1
util-radix6-tree.h
SIGNATURE_HOOK_TYPE_PKT
@ SIGNATURE_HOOK_TYPE_PKT
Definition: detect.h:559
DetectEngineCtx_::sig_list
Signature * sig_list
Definition: detect.h:929
DETECT_SM_LIST_TMATCH
@ DETECT_SM_LIST_TMATCH
Definition: detect.h:128
DetectEngineCtx_::profile_keyword_ctx_per_list
struct SCProfileKeywordDetectCtx_ ** profile_keyword_ctx_per_list
Definition: detect.h:1035
RuleMatchCandidateTx
struct RuleMatchCandidateTx RuleMatchCandidateTx
PrefilterPktFn
void(* PrefilterPktFn)(DetectEngineThreadCtx *det_ctx, Packet *p, const void *pectx)
Definition: detect.h:1462
DetectEngineCtx_::loader_id
int loader_id
Definition: detect.h:1049
FILE_DECODER_EVENT_NO_MEM
@ FILE_DECODER_EVENT_NO_MEM
Definition: detect.h:1411
TransformData_::transform
int transform
Definition: detect.h:411
DetectEngineCtx_::pkt_inspect_engines
DetectEnginePktInspectionEngine * pkt_inspect_engines
Definition: detect.h:1076
SIG_TYPE_MAX
@ SIG_TYPE_MAX
Definition: detect.h:78
tv
ThreadVars * tv
Definition: fuzz_decodepcapfile.c:32
Signature_::prio
int prio
Definition: detect.h:717
DetectEngineCtx_::ea
struct EngineAnalysisCtx_ * ea
Definition: detect.h:1117
DetectEngineIPOnlyCtx_::sig_mapping_size
uint32_t sig_mapping_size
Definition: detect.h:858
DetectEngineCtx_::sm_types_silent_error
bool * sm_types_silent_error
Definition: detect.h:1100
DetectEngineAppInspectionEngine_::progress
int16_t progress
Definition: detect.h:446
DetectEngineThreadKeywordCtxItem_::FreeFunc
void(* FreeFunc)(void *)
Definition: detect.h:887
DetectMatchAddressIPv6_::ip
uint32_t ip[4]
Definition: detect.h:194
SignatureInitDataBuffer_::only_ts
bool only_ts
Definition: detect.h:545
SigGroupHeadInitData
struct SigGroupHeadInitData_ SigGroupHeadInitData
DetectAddress
struct DetectAddress_ DetectAddress
address structure for use in the detection engine.
SpmGlobalThreadCtx_
Definition: util-spm.h:47
DetectEngineCtx_::app_mpms_list_cnt
uint32_t app_mpms_list_cnt
Definition: detect.h:1071
Signature_::addr_src_match6_cnt
uint16_t addr_src_match6_cnt
Definition: detect.h:697
DetectProto_
Definition: detect-engine-proto.h:35
DetectFilestoreData_
Definition: detect-filestore.h:36
SigGroupHeadInitData_
Definition: detect.h:1541
InspectionBuffer::inspect_len
uint32_t inspect_len
Definition: detect.h:383
SignatureInitData_::buffers
SignatureInitDataBuffer * buffers
Definition: detect.h:648
DetectEngineCtx_::app_inspect_engines
DetectEngineAppInspectionEngine * app_inspect_engines
Definition: detect.h:1075
SignatureInitData_::dst
const DetectAddressHead * dst
Definition: detect.h:640
DetectEngineCtx_::filemagic_thread_ctx_id
int filemagic_thread_ctx_id
Definition: detect.h:970
ENGINE_PROFILE_CUSTOM
@ ENGINE_PROFILE_CUSTOM
Definition: detect.h:1141
PrefilterEngine_::pectx
void * pectx
Definition: detect.h:1527
SignatureInitData_::firewall_rule
bool firewall_rule
Definition: detect.h:665
DetectEngineThreadCtx_::alert_queue
PacketAlert * alert_queue
Definition: detect.h:1280
SIGNATURE_HOOK_PKT_ALL
@ SIGNATURE_HOOK_PKT_ALL
Definition: detect.h:554
DetectEngineThreadCtx_::pcre_match_start_offset
uint32_t pcre_match_start_offset
Definition: detect.h:1225
DetectEngineThreadCtx_::global_keyword_ctxs_size
int global_keyword_ctxs_size
Definition: detect.h:1318
Signature_::dp
DetectPort * dp
Definition: detect.h:720
DetectEngineCtx_::mpm_hash_table
HashListTable * mpm_hash_table
Definition: detect.h:952
InspectionBuffer::inspect
const uint8_t * inspect
Definition: detect.h:381
DumpPatterns
void DumpPatterns(DetectEngineCtx *de_ctx)
Definition: detect-engine-analyzer.c:1418
Signature_::metadata
DetectMetadataHead * metadata
Definition: detect.h:744
DetectEngineThreadCtx_::tv
ThreadVars * tv
Definition: detect.h:1205
MPMB_UDP_TC
@ MPMB_UDP_TC
Definition: detect.h:1444
DetectBufferMpmRegistry_::id
int id
Definition: detect.h:770
DetectEngineThreadCtx_::counter_alerts
uint16_t counter_alerts
Definition: detect.h:1238
SCRadix6Tree_
Structure for the radix tree.
Definition: util-radix6-tree.h:64
InspectionBuffer::len
uint32_t len
Definition: detect.h:389
DetectVarList_::key
uint8_t * key
Definition: detect.h:833
DetectEngineThreadCtx_::keyword_ctxs_array
void ** keyword_ctxs_array
Definition: detect.h:1315
SignatureHook_::app_progress
int app_progress
Definition: detect.h:580
FILE_DECODER_EVENT_Z_DATA_ERROR
@ FILE_DECODER_EVENT_Z_DATA_ERROR
Definition: detect.h:1414
SigGroupHeadInitData_::post_rule_match_engines
PrefilterEngineList * post_rule_match_engines
Definition: detect.h:1560
SigFileLoaderStat_::good_sigs_total
int good_sigs_total
Definition: detect.h:880
MpmConfig_
Definition: util-mpm.h:89
SigTableElmt_::SupportsPrefilter
bool(* SupportsPrefilter)(const Signature *s)
Definition: detect.h:1389
Signature_::addr_dst_match6
DetectMatchAddressIPv6 * addr_dst_match6
Definition: detect.h:711
DetectEngineMasterCtx_
Definition: detect.h:1641
Signature_::id
uint32_t id
Definition: detect.h:714
SignatureHook
struct SignatureHook_ SignatureHook
DetectBufferMpmRegistry_::PrefilterRegisterWithListId
int(* PrefilterRegisterWithListId)(struct DetectEngineCtx_ *de_ctx, struct SigGroupHead_ *sgh, MpmCtx *mpm_ctx, const struct DetectBufferMpmRegistry_ *mpm_reg, int list_id)
Definition: detect.h:774
DetectEngineThreadKeywordCtxItem_::name
const char * name
Definition: detect.h:891
DetectEngineCtx_::guess_applayer_log_limit
uint8_t guess_applayer_log_limit
Definition: detect.h:964
DetectEngineLookupFlow
struct DetectEngineLookupFlow_ DetectEngineLookupFlow
RuleMatchCandidateTx::stream_reset
uint32_t stream_reset
Definition: detect.h:1169
DisableDetectFlowFileFlags
void DisableDetectFlowFileFlags(Flow *f)
disable file features we don't need Called if we have no detection engine.
Definition: detect.c:2309
DetectBufferType_::transforms
DetectEngineTransforms transforms
Definition: detect.h:476
DetectEngineType
DetectEngineType
Definition: detect.h:901
DetectEnginePktInspectionEngine::v1
struct DetectEnginePktInspectionEngine::@82 v1
SignatureInitData_::score
int score
Definition: detect.h:637
SignatureInitDataBuffer_::id
uint32_t id
Definition: detect.h:538
Signature_
Signature container.
Definition: detect.h:669
SigMatch_
a single match condition for a signature
Definition: detect.h:356
DetectEngineCtx_::tenant_path
char * tenant_path
Definition: detect.h:1120
PrefilterEngineList_::pkt_mask
SignatureMask pkt_mask
Definition: detect.h:1481
DetectVarList_::pad
uint8_t pad[2]
Definition: detect.h:829
SCProfilePrefilterData_
Definition: util-profiling-prefilter.c:36
DetectBufferMpmRegistry_::tx_min_progress
int tx_min_progress
Definition: detect.h:786
DetectEngineAppInspectionEngine_::transforms
const DetectEngineTransforms * transforms
Definition: detect.h:455
DetectEngineThreadCtx_::inspect
struct DetectEngineThreadCtx_::@98 inspect
DETECT_SM_LIST_MAX
@ DETECT_SM_LIST_MAX
Definition: detect.h:134
SigMatchCtx_::foo
int foo
Definition: detect.h:352
DetectBufferType_::parent_id
int parent_id
Definition: detect.h:467
DETECT_PREFILTER_MPM
@ DETECT_PREFILTER_MPM
Definition: detect.h:896
DetectBufferMpmRegistry_::alproto
AppProto alproto
Definition: detect.h:785
DetectAddress_::next
struct DetectAddress_ * next
Definition: detect.h:178
DetectEngineTenantMapping_::traffic_id
uint32_t traffic_id
Definition: detect.h:1636
SigGroupHeadInitData_::protos
uint8_t protos[256]
Definition: detect.h:1547
DetectMatchAddressIPv6_
Definition: detect.h:193
PostRuleMatchWorkQueueItem::value
uint32_t value
Definition: detect.h:1180
MPMB_TCP_PKT_TS
@ MPMB_TCP_PKT_TS
Definition: detect.h:1439
DetectMatchAddressIPv4_
Definition: detect.h:188
DetectEngineThreadCtx_::tx_id_set
bool tx_id_set
Definition: detect.h:1267
DetectEnginePktInspectionEngine
struct DetectEnginePktInspectionEngine DetectEnginePktInspectionEngine
DetectEngineThreadCtx_::base64_decoded
uint8_t * base64_decoded
Definition: detect.h:1275
Signature_::dsize_mode
uint8_t dsize_mode
Definition: detect.h:678
PORT_EQ
@ PORT_EQ
Definition: detect.h:207
DetectEngineLookupFlow_
Definition: detect.h:861
SignatureInitData_::has_possible_prefilter
bool has_possible_prefilter
Definition: detect.h:606
FirewallTable
FirewallTable
Definition: detect.h:563
SIGNATURE_HOOK_PKT_FLOW_START
@ SIGNATURE_HOOK_PKT_FLOW_START
Definition: detect.h:553
DetectEngineTransforms::cnt
int cnt
Definition: detect.h:417
PrefilterEngine_::is_last
bool is_last
Definition: detect.h:1522
DetectEngineThreadCtx_::de_ctx
DetectEngineCtx * de_ctx
Definition: detect.h:1313
PrefilterEngine_::hook
uint8_t hook
Definition: detect.h:1514
DetectEngineCtx_::sig_array
Signature ** sig_array
Definition: detect.h:938
PacketAlert_
Definition: decode.h:243
DetectEngineAppInspectionEngine_::dir
uint8_t dir
Definition: detect.h:438
DETECT_BUFFER_MPM_TYPE_SIZE
@ DETECT_BUFFER_MPM_TYPE_SIZE
Definition: detect.h:759
DetectEngineThreadCtx_::multi_inspect
struct DetectEngineThreadCtx_::@99 multi_inspect
DETECT_ENGINE_TYPE_MT_STUB
@ DETECT_ENGINE_TYPE_MT_STUB
Definition: detect.h:904
Signature_::firewall_table
uint8_t firewall_table
Definition: detect.h:703
SignatureInitDataBuffer_::only_tc
bool only_tc
Definition: detect.h:544
SignatureNonPrefilterStore_::mask
SignatureMask mask
Definition: detect.h:1156
DetectEngineCtx_::buffer_type_id
uint32_t buffer_type_id
Definition: detect.h:1069
Signature
struct Signature_ Signature
Signature container.
DetectEngineIPOnlyCtx_
IP only rules matching ctx.
Definition: detect.h:846
FILE_DECODER_EVENT_INVALID_SWF_VERSION
@ FILE_DECODER_EVENT_INVALID_SWF_VERSION
Definition: detect.h:1413
DetectEngineCtx_::sigerror
const char * sigerror
Definition: detect.h:1013
DetectBufferType_::SetupCallback
void(* SetupCallback)(const struct DetectEngineCtx_ *, struct Signature_ *)
Definition: detect.h:473
DetectEngineThreadCtx_::mt_det_ctxs_cnt
uint32_t mt_det_ctxs_cnt
Definition: detect.h:1207
DetectMetadataHashInit
int DetectMetadataHashInit(DetectEngineCtx *de_ctx)
Definition: detect-metadata.c:69
DetectEngineMasterCtx_::lock
SCMutex lock
Definition: detect.h:1642
DetectEnginePktInspectionEngine::mpm
bool mpm
Definition: detect.h:498
DetectEngineCtx_::spm_global_thread_ctx
SpmGlobalThreadCtx * spm_global_thread_ctx
Definition: detect.h:974
DetectFlowbitsAnalyze
int DetectFlowbitsAnalyze(DetectEngineCtx *de_ctx)
Definition: detect-flowbits.c:564
id
uint32_t id
Definition: detect-flowbits.c:933
SigGroupHead_::pkt_engines
PrefilterEngine * pkt_engines
Definition: detect.h:1580
SignatureInitData_::rule_state_flowbits_ids_array
uint32_t * rule_state_flowbits_ids_array
Definition: detect.h:661
DetectEngineCtx_::flags
uint8_t flags
Definition: detect.h:922
SIG_PROP_FLOW_ACTION_FLOW
@ SIG_PROP_FLOW_ACTION_FLOW
Definition: detect.h:84
DetectEngineThreadCtx_::replist
DetectReplaceList * replist
Definition: detect.h:1301
SignatureInitData_::transforms
DetectEngineTransforms transforms
Definition: detect.h:632
PrefilterEngine_::Prefilter
PrefilterPktFn Prefilter
Definition: detect.h:1530
ENGINE_PROFILE_UNKNOWN
@ ENGINE_PROFILE_UNKNOWN
Definition: detect.h:1137
SigString_::sig_str
char * sig_str
Definition: detect.h:869
DetectEngineCtx_::io_ctx
DetectEngineIPOnlyCtx io_ctx
Definition: detect.h:958
PrefilterEngine_::PrefilterTx
PrefilterTxFn PrefilterTx
Definition: detect.h:1531
DetectMatchAddressIPv4
struct DetectMatchAddressIPv4_ DetectMatchAddressIPv4
DetectEngineCtx_::rule_line
int rule_line
Definition: detect.h:1011
FIREWALL_TABLE_APP_TD
@ FIREWALL_TABLE_APP_TD
Definition: detect.h:567
MpmCtx_
Definition: util-mpm.h:93
Signature_::addr_dst_match4
DetectMatchAddressIPv4 * addr_dst_match4
Definition: detect.h:708
Signature_::msg
char * msg
Definition: detect.h:737
flow.h
SignatureInitDataBuffer_
Definition: detect.h:537
Signature_::addr_src_match4_cnt
uint16_t addr_src_match4_cnt
Definition: detect.h:695
SigIntId
#define SigIntId
Definition: suricata-common.h:324
SigTableElmt_::Transform
void(* Transform)(DetectEngineThreadCtx *, InspectionBuffer *, void *context)
Definition: detect.h:1383
DetectGetInnerTx
void * DetectGetInnerTx(void *tx_ptr, AppProto alproto, AppProto engine_alproto, uint8_t flow_flags)
Definition: detect.c:1104
DetectEngineAppInspectionEngine
struct DetectEngineAppInspectionEngine_ DetectEngineAppInspectionEngine
TENANT_SELECTOR_LIVEDEV
@ TENANT_SELECTOR_LIVEDEV
Definition: detect.h:1629
Signature_::addr_dst_match4_cnt
uint16_t addr_dst_match4_cnt
Definition: detect.h:694
DetectEngineFrameInspectionEngine::type
uint8_t type
Definition: detect.h:524
DetectSigmatchListEnum
DetectSigmatchListEnum
Definition: detect.h:114
DetectEngineMasterCtx_::version
uint32_t version
Definition: detect.h:1648
DetectEngineCtx_::sig_array_len
uint32_t sig_array_len
Definition: detect.h:939
DetectEngineCtx_::metadata_table
HashTable * metadata_table
Definition: detect.h:1063
Signature_::type
enum SignatureType type
Definition: detect.h:672
DetectEngineCtx_::signum
uint32_t signum
Definition: detect.h:941
DetectEngineCtx_::tenant_id
uint32_t tenant_id
Definition: detect.h:927
SigGroupHead_::filestore_cnt
uint16_t filestore_cnt
Definition: detect.h:1576
SignatureInitData_::buffer_index
uint32_t buffer_index
Definition: detect.h:649
IPOnlyCIDRItem_::signum
SigIntId signum
Definition: detect.h:341
SigFileLoaderStat_
Signature loader statistics.
Definition: detect.h:876
FILE_DECODER_EVENT_LZMA_HEADER_TOO_SHORT_ERROR
@ FILE_DECODER_EVENT_LZMA_HEADER_TOO_SHORT_ERROR
Definition: detect.h:1419
DetectAddress_::flags
uint8_t flags
Definition: detect.h:173
PORT_GE
@ PORT_GE
Definition: detect.h:210
DetectEngineCtx_::buffer_type_hash_id
HashListTable * buffer_type_hash_id
Definition: detect.h:1068
DetectEngineLookupFlow_::tcp
DetectPort * tcp
Definition: detect.h:862
DETECT_SM_LIST_SUPPRESS
@ DETECT_SM_LIST_SUPPRESS
Definition: detect.h:131
SCMutex
#define SCMutex
Definition: threads-debug.h:114
DetectEngineCtx_::fp_support_smlist_list
SCFPSupportSMList * fp_support_smlist_list
Definition: detect.h:1094
SIG_TYPE_PDONLY
@ SIG_TYPE_PDONLY
Definition: detect.h:69
InspectionBufferMultipleForList::inspection_buffers
InspectionBuffer * inspection_buffers
Definition: detect.h:404
MpmStore_::sgh_mpm_context
int32_t sgh_mpm_context
Definition: detect.h:1456
InspectionBufferMultipleForList::max
uint32_t max
Definition: detect.h:406
DetectAddressHead_::ipv4_head
DetectAddress * ipv4_head
Definition: detect.h:183
SignatureProperties::flow_action
enum SignaturePropertyFlowAction flow_action
Definition: detect.h:89
SigGroupHead_::id
uint32_t id
Definition: detect.h:1578
IPOnlyCIDRItem_::family
uint8_t family
Definition: detect.h:334
DetectEngineThreadCtx_::counter_mpm_list
uint16_t counter_mpm_list
Definition: detect.h:1244
DetectEngineThreadCtx_::prefilter_bytes
uint64_t prefilter_bytes
Definition: detect.h:1360
ADDRESS_EQ
@ ADDRESS_EQ
Definition: detect.h:154
SignatureHook_::t
union SignatureHook_::@84 t
FILE_DECODER_EVENT_LZMA_MEMLIMIT_ERROR
@ FILE_DECODER_EVENT_LZMA_MEMLIMIT_ERROR
Definition: detect.h:1421
DetectEngineFrameInspectionEngine
struct DetectEngineFrameInspectionEngine DetectEngineFrameInspectionEngine
SigMatchData
struct SigMatchData_ SigMatchData
Data needed for Match()
MpmStore_::buffer
enum MpmBuiltinBuffers buffer
Definition: detect.h:1454
DetectEngineThreadCtx_::post_rule_work_queue
PostRuleMatchWorkQueue post_rule_work_queue
Definition: detect.h:1296
DetectEngineThreadCtx_::tenant_array_size
uint32_t tenant_array_size
Definition: detect.h:1212
DetectEngineThreadCtx_::tenant_array
struct DetectEngineTenantMapping_ * tenant_array
Definition: detect.h:1211
DetectEngineCtx_::sc_sig_order_funcs
struct SCSigOrderFunc_ * sc_sig_order_funcs
Definition: detect.h:944
MpmCtxFactoryContainer_
Definition: util-mpm.h:130
SigTableElmt_::RegisterTests
void(* RegisterTests)(void)
Definition: detect.h:1394
DetectEngineThreadCtx_::file_id
uint32_t file_id
Definition: detect.h:1309
SignatureMask
#define SignatureMask
Definition: decode.h:99
DetectEngineThreadCtx_::mt_det_ctxs
struct DetectEngineThreadCtx_ ** mt_det_ctxs
Definition: detect.h:1208
Signature_::mask
SignatureMask mask
Definition: detect.h:680
SignatureInitData_::alprotos
AppProto alprotos[SIG_ALPROTO_MAX]
Definition: detect.h:613
RuleMatchCandidateTx
Definition: detect.h:1161
SIG_TYPE_LIKE_IPONLY
@ SIG_TYPE_LIKE_IPONLY
Definition: detect.h:66
DetectEngineThreadCtx_::TenantGetId
uint32_t(* TenantGetId)(const void *, const Packet *p)
Definition: detect.h:1214
DetectBufferType_::description
char description[128]
Definition: detect.h:465
DetectEngineIPOnlyCtx_::max_idx
uint32_t max_idx
Definition: detect.h:853
SigGroupHeadInitData_::frame_mpms
MpmCtx ** frame_mpms
Definition: detect.h:1554
DetectBufferMpmRegistry_::pname
char pname[32]
Definition: detect.h:765
SpmThreadCtx_
Definition: util-spm.h:54
ADDRESS_ES
@ ADDRESS_ES
Definition: detect.h:155
DetectEngineFrameInspectionEngine::smd
SigMatchData * smd
Definition: detect.h:533
DetectEngineThreadCtx_::match_array
Signature ** match_array
Definition: detect.h:1284