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