suricata
detect-engine-event.c
Go to the documentation of this file.
1 /* Copyright (C) 2007-2021 Open Information Security Foundation
2  *
3  * You can copy, redistribute or modify this Program under the terms of
4  * the GNU General Public License version 2 as published by the Free
5  * Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * version 2 along with this program; if not, write to the Free Software
14  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15  * 02110-1301, USA.
16  */
17 
18 /**
19  * \file
20  *
21  * \author Breno Silva <breno.silva@gmail.com>
22  *
23  * Implements the decode-event keyword
24  */
25 
26 #include "suricata-common.h"
27 #include "suricata.h"
28 #include "decode.h"
29 #include "detect.h"
30 #include "detect-parse.h"
32 #include "detect-engine-uint.h"
33 
34 #include "flow-var.h"
35 #include "decode-events.h"
36 
37 #include "util-debug.h"
38 
39 #include "stream-tcp.h"
40 
41 
42 /* Need to get the DEvents[] array */
43 
44 #include "detect-engine-event.h"
45 
46 #define PARSE_REGEX "\\S[0-9A-z_]+[.][A-z0-9_+.]+$"
47 
48 static DetectParseRegex parse_regex;
49 
50 static int DetectEngineEventMatch (DetectEngineThreadCtx *,
51  Packet *, const Signature *, const SigMatchCtx *);
52 static int DetectEngineEventSetup (DetectEngineCtx *, Signature *, const char *);
53 static int DetectDecodeEventSetup (DetectEngineCtx *, Signature *, const char *);
54 static int DetectStreamEventSetup (DetectEngineCtx *, Signature *, const char *);
55 static void DetectEngineEventFree (DetectEngineCtx *, void *);
56 #ifdef UNITTESTS
57 void EngineEventRegisterTests(void);
58 #endif
59 
60 static bool PrefilterEventIsPrefilterable(const Signature *s, int smtype)
61 {
62  const SigMatch *sm;
63  for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH]; sm != NULL; sm = sm->next) {
64  if (sm->type == smtype) {
65  return true;
66  }
67  }
68  return false;
69 }
70 static bool PrefilterStreamEventIsPrefilterable(const Signature *s)
71 {
72  return PrefilterEventIsPrefilterable(s, DETECT_STREAM_EVENT);
73 }
74 
75 static bool PrefilterDecodeEventIsPrefilterable(const Signature *s)
76 {
77  return PrefilterEventIsPrefilterable(s, DETECT_DECODE_EVENT);
78 }
79 
80 static void PrefilterPacketEventSet(PrefilterPacketHeaderValue *v, void *smctx)
81 {
82  const DetectEngineEventData *a = smctx;
84  v->u8[1] = a->event; // arg1
85  v->u8[2] = 0; // arg2
86 }
87 
88 static bool PrefilterPacketEventCompare(PrefilterPacketHeaderValue v, void *smctx)
89 {
90  const DetectEngineEventData *a = smctx;
91  DetectUintData_u8 du8;
92  du8.mode = DETECT_UINT_EQ;
93  du8.arg1 = a->event;
94  du8.arg2 = 0;
95  return PrefilterPacketU8Compare(v, &du8);
96 }
97 
98 static void PrefilterPacketEventMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const void *pectx)
99 {
100  const PrefilterPacketU8HashCtx *h = pectx;
101  for (uint8_t u = 0; u < p->events.cnt; u++) {
102  const SigsArray *sa = h->array[p->events.events[u]];
103  if (sa) {
104  PrefilterAddSids(&det_ctx->pmq, sa->sigs, sa->cnt);
105  }
106  }
107 }
108 
109 static int PrefilterSetupStreamEvent(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
110 {
112  SIG_MASK_REQUIRE_ENGINE_EVENT, PrefilterPacketEventSet, PrefilterPacketEventCompare,
113  PrefilterPacketEventMatch);
114 }
115 
116 static int PrefilterSetupDecodeEvent(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
117 {
119  SIG_MASK_REQUIRE_ENGINE_EVENT, PrefilterPacketEventSet, PrefilterPacketEventCompare,
120  PrefilterPacketEventMatch);
121 }
122 
123 /**
124  * \brief Registration function for decode-event: keyword
125  */
127 {
128  sigmatch_table[DETECT_ENGINE_EVENT].name = "engine-event";
129  sigmatch_table[DETECT_ENGINE_EVENT].Match = DetectEngineEventMatch;
130  sigmatch_table[DETECT_ENGINE_EVENT].Setup = DetectEngineEventSetup;
131  sigmatch_table[DETECT_ENGINE_EVENT].Free = DetectEngineEventFree;
132 #ifdef UNITTESTS
134 #endif
135 
136  sigmatch_table[DETECT_DECODE_EVENT].name = "decode-event";
137  sigmatch_table[DETECT_DECODE_EVENT].Match = DetectEngineEventMatch;
138  sigmatch_table[DETECT_DECODE_EVENT].Setup = DetectDecodeEventSetup;
139  sigmatch_table[DETECT_DECODE_EVENT].Free = DetectEngineEventFree;
141  "match on events triggered by structural or invalid values during packet decoding";
142  sigmatch_table[DETECT_DECODE_EVENT].url = "/rules/decode-layer.html#decode-event";
144  sigmatch_table[DETECT_DECODE_EVENT].SupportsPrefilter = PrefilterDecodeEventIsPrefilterable;
145  sigmatch_table[DETECT_DECODE_EVENT].SetupPrefilter = PrefilterSetupDecodeEvent;
146 
147  sigmatch_table[DETECT_STREAM_EVENT].name = "stream-event";
148  sigmatch_table[DETECT_STREAM_EVENT].Match = DetectEngineEventMatch;
149  sigmatch_table[DETECT_STREAM_EVENT].Setup = DetectStreamEventSetup;
150  sigmatch_table[DETECT_STREAM_EVENT].Free = DetectEngineEventFree;
152  "match on events triggered by anomalies during TCP streaming";
153  sigmatch_table[DETECT_STREAM_EVENT].SupportsPrefilter = PrefilterStreamEventIsPrefilterable;
154  sigmatch_table[DETECT_STREAM_EVENT].SetupPrefilter = PrefilterSetupStreamEvent;
155 
156  DetectSetupParseRegexes(PARSE_REGEX, &parse_regex);
157 }
158 
159 /**
160  * \brief This function is used to match decoder event flags set on a packet with those passed via decode-event:
161  *
162  * \param t pointer to thread vars
163  * \param det_ctx pointer to the pattern matcher thread
164  * \param p pointer to the current packet
165  * \param s pointer to the Signature
166  * \param m pointer to the sigmatch
167  *
168  * \retval 0 no match
169  * \retval 1 match
170  */
171 static int DetectEngineEventMatch (DetectEngineThreadCtx *det_ctx,
172  Packet *p, const Signature *s, const SigMatchCtx *ctx)
173 {
174  SCEnter();
175 
176  const DetectEngineEventData *de = (const DetectEngineEventData *)ctx;
177 
178  if (ENGINE_ISSET_EVENT(p, de->event)) {
179  SCLogDebug("de->event matched %u", de->event);
180  SCReturnInt(1);
181  }
182 
183  SCReturnInt(0);
184 }
185 
186 static bool OutdatedEvent(const char *raw)
187 {
188  return strcmp(raw, "decoder.udp.hlen_invalid") == 0;
189 }
190 
191 /**
192  * \brief This function is used to parse decoder events options passed via decode-event: keyword
193  *
194  * \param rawstr Pointer to the user provided decode-event options
195  *
196  * \retval de pointer to DetectFlowData on success
197  * \retval NULL on failure
198  */
199 static DetectEngineEventData *DetectEngineEventParse (const char *rawstr)
200 {
201  int i;
202  DetectEngineEventData *de = NULL;
203  int res = 0, found = 0;
204  size_t pcre2len;
205  pcre2_match_data *match = NULL;
206 
207  int ret = DetectParsePcreExec(&parse_regex, &match, rawstr, 0, 0);
208  if (ret < 1) {
209  SCLogError("pcre_exec parse error, ret %" PRId32 ", string %s", ret, rawstr);
210  goto error;
211  }
212 
213  char copy_str[128] = "";
214  pcre2len = sizeof(copy_str);
215  res = pcre2_substring_copy_bynumber(match, 0, (PCRE2_UCHAR8 *)copy_str, &pcre2len);
216 
217  if (res < 0) {
218  SCLogError("pcre2_substring_copy_bynumber failed");
219  goto error;
220  }
221 
222  for (i = 0; DEvents[i].event_name != NULL; i++) {
223  if (strcasecmp(DEvents[i].event_name,copy_str) == 0) {
224  found = 1;
225  break;
226  }
227  }
228 
229  if (found == 0) {
230  SCLogError("unknown decode event \"%s\"", copy_str);
231  goto error;
232  }
233 
234  de = SCMalloc(sizeof(DetectEngineEventData));
235  if (unlikely(de == NULL))
236  goto error;
237 
238  de->event = DEvents[i].code;
239 
242  }
243 
244  if (OutdatedEvent(rawstr)) {
246  SCLogError("decode-event keyword no longer supports event \"%s\"", rawstr);
247  goto error;
248  } else {
249  SCLogWarning("decode-event keyword no longer supports event \"%s\"", rawstr);
250  }
251  }
252 
253  pcre2_match_data_free(match);
254  return de;
255 
256 error:
257  if (de)
258  SCFree(de);
259  if (match) {
260  pcre2_match_data_free(match);
261  }
262  return NULL;
263 }
264 
265 /**
266  * \brief this function is used to add the parsed decode-event into the current signature
267  *
268  * \param de_ctx pointer to the Detection Engine Context
269  * \param s pointer to the Current Signature
270  * \param rawstr pointer to the user provided decode-event options
271  *
272  * \retval 0 on Success
273  * \retval -1 on Failure
274  */
275 static int DetectEngineEventSetupDo(
276  DetectEngineCtx *de_ctx, Signature *s, const char *rawstr, uint16_t smtype)
277 {
278  DetectEngineEventData *de = DetectEngineEventParse(rawstr);
279  if (de == NULL)
280  return -1;
281 
282  SCLogDebug("rawstr %s %u", rawstr, de->event);
283 
285  NULL) {
286  SCFree(de);
287  return -1;
288  }
289  return 0;
290 }
291 
292 
293 static int DetectEngineEventSetup (DetectEngineCtx *de_ctx, Signature *s, const char *rawstr)
294 {
295  return DetectEngineEventSetupDo (de_ctx, s, rawstr, DETECT_ENGINE_EVENT);
296 }
297 
298 /**
299  * \brief this function will free memory associated with DetectEngineEventData
300  *
301  * \param de pointer to DetectEngineEventData
302  */
303 static void DetectEngineEventFree(DetectEngineCtx *de_ctx, void *ptr)
304 {
306  if (de)
307  SCFree(de);
308 }
309 
310 
311 /**
312  * \brief this function Setup the 'decode-event' keyword by setting the correct
313  * signature type
314 */
315 static int DetectDecodeEventSetup (DetectEngineCtx *de_ctx, Signature *s, const char *rawstr)
316 {
317  char drawstr[64] = "decoder.";
318 
319  /* decoder:$EVENT alias command develop as decode-event:decoder.$EVENT */
320  strlcat(drawstr, rawstr, sizeof(drawstr));
321 
322  return DetectEngineEventSetupDo(de_ctx, s, drawstr, DETECT_DECODE_EVENT);
323 }
324 
325 /**
326  * \brief this function Setup the 'stream-event' keyword by resolving the alias
327 */
328 static int DetectStreamEventSetup (DetectEngineCtx *de_ctx, Signature *s, const char *rawstr)
329 {
330  char srawstr[64] = "stream.";
331 
332  if (strcmp(rawstr, "est_synack_resend_with_different_ack") == 0) {
333  rawstr = "est_synack_resend_with_diff_ack";
334  } else if (strcmp(rawstr, "3whs_synack_resend_with_different_ack") == 0) {
335  rawstr = "3whs_synack_resend_with_diff_ack";
336  }
337 
338  /* stream:$EVENT alias command develop as decode-event:stream.$EVENT */
339  strlcat(srawstr, rawstr, sizeof(srawstr));
340 
341  return DetectEngineEventSetupDo(de_ctx, s, srawstr, DETECT_STREAM_EVENT);
342 }
343 
344 /*
345  * ONLY TESTS BELOW THIS COMMENT
346  */
347 #ifdef UNITTESTS
348 
349 /**
350  * \test EngineEventTestParse01 is a test for a valid decode-event value
351  */
352 static int EngineEventTestParse01 (void)
353 {
354  DetectEngineEventData *de = DetectEngineEventParse("decoder.ipv4.pkt_too_small");
355 
356  FAIL_IF_NULL(de);
357 
358  DetectEngineEventFree(NULL, de);
359 
360  PASS;
361 }
362 
363 /**
364  * \test EngineEventTestParse02 is a test for a valid upper + lower case decode-event value
365  */
366 static int EngineEventTestParse02 (void)
367 {
368  DetectEngineEventData *de = DetectEngineEventParse("decoder.PPP.pkt_too_small");
369 
370  FAIL_IF_NULL(de);
371 
372  DetectEngineEventFree(NULL, de);
373 
374  PASS;
375 }
376 
377 /**
378  * \test EngineEventTestParse03 is a test for a valid upper case decode-event value
379  */
380 static int EngineEventTestParse03 (void)
381 {
382  DetectEngineEventData *de = DetectEngineEventParse("decoder.IPV6.PKT_TOO_SMALL");
383 
384  FAIL_IF_NULL(de);
385 
386  DetectEngineEventFree(NULL, de);
387 
388  PASS;
389 }
390 
391 /**
392  * \test EngineEventTestParse04 is a test for an invalid upper case decode-event value
393  */
394 static int EngineEventTestParse04 (void)
395 {
396  DetectEngineEventData *de = DetectEngineEventParse("decoder.IPV6.INVALID_EVENT");
397 
398  FAIL_IF_NOT_NULL(de);
399 
400  DetectEngineEventFree(NULL, de);
401 
402  PASS;
403 }
404 
405 /**
406  * \test EngineEventTestParse05 is a test for an invalid char into the decode-event value
407  */
408 static int EngineEventTestParse05 (void)
409 {
410  DetectEngineEventData *de = DetectEngineEventParse("decoder.IPV-6,INVALID_CHAR");
411 
412  FAIL_IF_NOT_NULL(de);
413 
414  DetectEngineEventFree(NULL, de);
415 
416  PASS;
417 }
418 
419 /**
420  * \test EngineEventTestParse06 is a test for match function with valid decode-event value
421  */
422 static int EngineEventTestParse06 (void)
423 {
425  FAIL_IF_NULL(p);
426 
427  ThreadVars tv;
428 
429  memset(&tv, 0, sizeof(ThreadVars));
430 
432 
433  DetectEngineEventData *de = DetectEngineEventParse("decoder.ppp.pkt_too_small");
434  FAIL_IF_NULL(de);
435 
436  de->event = PPP_PKT_TOO_SMALL;
437 
438  SigMatch *sm = SigMatchAlloc();
439  FAIL_IF_NULL(sm);
440 
442  sm->ctx = (SigMatchCtx *)de;
443 
444  FAIL_IF_NOT(DetectEngineEventMatch(NULL, p, NULL, sm->ctx));
445 
446  PacketFree(p);
447  SCFree(de);
448  SCFree(sm);
449 
450  PASS;
451 }
452 
453 /**
454  * \brief this function registers unit tests for EngineEvent
455  */
457 {
458  UtRegisterTest("EngineEventTestParse01", EngineEventTestParse01);
459  UtRegisterTest("EngineEventTestParse02", EngineEventTestParse02);
460  UtRegisterTest("EngineEventTestParse03", EngineEventTestParse03);
461  UtRegisterTest("EngineEventTestParse04", EngineEventTestParse04);
462  UtRegisterTest("EngineEventTestParse05", EngineEventTestParse05);
463  UtRegisterTest("EngineEventTestParse06", EngineEventTestParse06);
464 }
465 #endif /* UNITTESTS */
ENGINE_SET_EVENT
#define ENGINE_SET_EVENT(p, e)
Definition: decode.h:1231
detect-engine-uint.h
EngineEventRegisterTests
void EngineEventRegisterTests(void)
this function registers unit tests for EngineEvent
Definition: detect-engine-event.c:456
SigTableElmt_::url
const char * url
Definition: detect.h:1545
FAIL_IF_NULL
#define FAIL_IF_NULL(expr)
Fail a test if expression evaluates to NULL.
Definition: util-unittest.h:89
SignatureInitData_::smlists
struct SigMatch_ * smlists[DETECT_SM_LIST_MAX]
Definition: detect.h:666
SigTableElmt_::desc
const char * desc
Definition: detect.h:1544
sigmatch_table
SigTableElmt * sigmatch_table
Definition: detect-parse.c:78
SigTableElmt_::Free
void(* Free)(DetectEngineCtx *, void *)
Definition: detect.h:1529
DetectParseRegex
Definition: detect-parse.h:94
SigTableElmt_::name
const char * name
Definition: detect.h:1542
stream-tcp.h
detect-engine-event.h
SigGroupHead_
Container for matching data for a signature group.
Definition: detect.h:1730
unlikely
#define unlikely(expr)
Definition: util-optimize.h:35
UtRegisterTest
void UtRegisterTest(const char *name, int(*TestFn)(void))
Register unit test.
Definition: util-unittest.c:101
SigTableElmt_::flags
uint32_t flags
Definition: detect.h:1533
PacketEngineEvents_::events
uint8_t events[PACKET_ENGINE_EVENT_MAX]
Definition: decode.h:311
ENGINE_ISSET_EVENT
#define ENGINE_ISSET_EVENT(p, e)
Definition: decode.h:1244
PrefilterPacketU8HashCtx_::array
SigsArray * array[256]
Definition: detect-engine-prefilter-common.h:53
SCLogDebug
#define SCLogDebug(...)
Definition: util-debug.h:282
DETECT_DECODE_EVENT
@ DETECT_DECODE_EVENT
Definition: detect-engine-register.h:132
DetectEngineThreadCtx_::pmq
PrefilterRuleStore pmq
Definition: detect.h:1429
ctx
struct Thresholds ctx
DetectEngineCtx_
main detection engine ctx
Definition: detect.h:995
StreamTcpReassembleConfigEnableOverlapCheck
void StreamTcpReassembleConfigEnableOverlapCheck(void)
Definition: stream-tcp-list.c:40
DETECT_UINT_EQ
#define DETECT_UINT_EQ
Definition: detect-engine-uint.h:35
PrefilterPacketHeaderValue::u8
uint8_t u8[16]
Definition: detect-engine-prefilter-common.h:24
p
Packet * p
Definition: fuzz_dataset.c:30
DetectParsePcreExec
int DetectParsePcreExec(DetectParseRegex *parse_regex, pcre2_match_data **match, const char *str, int start_offset, int options)
Definition: detect-parse.c:4025
SigTableElmt_::Setup
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
Definition: detect.h:1524
Packet_::events
PacketEngineEvents events
Definition: decode.h:643
FAIL_IF_NOT
#define FAIL_IF_NOT(expr)
Fail a test if expression evaluates to false.
Definition: util-unittest.h:82
PARSE_REGEX
#define PARSE_REGEX
Definition: detect-engine-event.c:46
SigTableElmt_::SetupPrefilter
int(* SetupPrefilter)(DetectEngineCtx *de_ctx, struct SigGroupHead_ *sgh)
Definition: detect.h:1527
decode.h
FAIL_IF_NOT_NULL
#define FAIL_IF_NOT_NULL(expr)
Fail a test if expression evaluates to non-NULL.
Definition: util-unittest.h:96
util-debug.h
PrefilterSetupPacketHeaderU8Hash
int PrefilterSetupPacketHeaderU8Hash(DetectEngineCtx *de_ctx, SigGroupHead *sgh, int sm_type, SignatureMask mask, void(*Set)(PrefilterPacketHeaderValue *v, void *), bool(*Compare)(PrefilterPacketHeaderValue v, void *), void(*Match)(DetectEngineThreadCtx *det_ctx, Packet *p, const void *pectx))
Definition: detect-engine-prefilter-common.c:462
PASS
#define PASS
Pass the test.
Definition: util-unittest.h:105
de_ctx
DetectEngineCtx * de_ctx
Definition: fuzz_siginit.c:22
DetectEngineThreadCtx_
Definition: detect.h:1316
strlcat
size_t strlcat(char *, const char *src, size_t siz)
Definition: util-strlcatu.c:45
SIG_MASK_REQUIRE_ENGINE_EVENT
#define SIG_MASK_REQUIRE_ENGINE_EVENT
Definition: detect.h:322
DEvents
const struct DecodeEvents_ DEvents[]
Definition: decode-events.c:29
DetectSetupParseRegexes
void DetectSetupParseRegexes(const char *parse_str, DetectParseRegex *detect_parse)
Definition: detect-parse.c:4151
SCEnter
#define SCEnter(...)
Definition: util-debug.h:284
SCSigMatchAppendSMToList
SigMatch * SCSigMatchAppendSMToList(DetectEngineCtx *de_ctx, Signature *s, uint16_t type, SigMatchCtx *ctx, const int list)
Append a SigMatch to the list type.
Definition: detect-parse.c:424
detect.h
ThreadVars_
Per thread variable structure.
Definition: threadvars.h:57
STREAM_REASSEMBLY_OVERLAP_DIFFERENT_DATA
@ STREAM_REASSEMBLY_OVERLAP_DIFFERENT_DATA
Definition: decode-events.h:318
SigMatch_::next
struct SigMatch_ * next
Definition: detect.h:364
PacketFree
void PacketFree(Packet *p)
Return a malloced packet.
Definition: decode.c:221
DETECT_ENGINE_EVENT
@ DETECT_ENGINE_EVENT
Definition: detect-engine-register.h:219
SigMatchStrictEnabled
bool SigMatchStrictEnabled(const enum DetectKeywordId id)
Definition: detect-parse.c:372
DETECT_SM_LIST_MATCH
@ DETECT_SM_LIST_MATCH
Definition: detect.h:118
SCLogWarning
#define SCLogWarning(...)
Macro used to log WARNING messages.
Definition: util-debug.h:262
SigMatch_::ctx
SigMatchCtx * ctx
Definition: detect.h:363
Packet_
Definition: decode.h:516
DecodeEvents_::code
uint8_t code
Definition: decode-events.h:345
Signature_::init_data
SignatureInitData * init_data
Definition: detect.h:775
SigTableElmt_::Match
int(* Match)(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *)
Definition: detect.h:1504
SigMatchAlloc
SigMatch * SigMatchAlloc(void)
Definition: detect-parse.c:311
SIGMATCH_DEONLY_COMPAT
#define SIGMATCH_DEONLY_COMPAT
Definition: detect-engine-register.h:312
DecodeEvents_::event_name
const char * event_name
Definition: decode-events.h:344
decode-events.h
SigMatchCtx_
Used to start a pointer to SigMatch context Should never be dereferenced without casting to something...
Definition: detect.h:355
PREFILTER_U8HASH_MODE_EQ
#define PREFILTER_U8HASH_MODE_EQ
Definition: detect-engine-prefilter-common.h:56
SigsArray_::sigs
SigIntId * sigs
Definition: detect-engine-prefilter-common.h:47
PPP_PKT_TOO_SMALL
@ PPP_PKT_TOO_SMALL
Definition: decode-events.h:123
suricata-common.h
SigMatch_::type
uint16_t type
Definition: detect.h:361
SigsArray_
Definition: detect-engine-prefilter-common.h:46
SigsArray_::cnt
uint32_t cnt
Definition: detect-engine-prefilter-common.h:48
tv
ThreadVars * tv
Definition: fuzz_decodepcapfile.c:34
PacketGetFromAlloc
Packet * PacketGetFromAlloc(void)
Get a malloced packet.
Definition: decode.c:260
DetectEngineEventRegister
void DetectEngineEventRegister(void)
Registration function for decode-event: keyword.
Definition: detect-engine-event.c:126
SCMalloc
#define SCMalloc(sz)
Definition: util-mem.h:47
DETECT_STREAM_EVENT
@ DETECT_STREAM_EVENT
Definition: detect-engine-register.h:220
SCLogError
#define SCLogError(...)
Macro used to log ERROR messages.
Definition: util-debug.h:274
SCFree
#define SCFree(p)
Definition: util-mem.h:61
SigTableElmt_::SupportsPrefilter
bool(* SupportsPrefilter)(const Signature *s)
Definition: detect.h:1526
detect-parse.h
Signature_
Signature container.
Definition: detect.h:692
SigMatch_
a single match condition for a signature
Definition: detect.h:360
DetectEngineEventData_
Definition: detect-engine-event.h:27
PrefilterPacketU8Compare
bool PrefilterPacketU8Compare(PrefilterPacketHeaderValue v, void *smctx)
Definition: detect-engine-uint.c:98
suricata.h
PrefilterPacketU8HashCtx_
Definition: detect-engine-prefilter-common.h:52
PrefilterPacketHeaderValue
Definition: detect-engine-prefilter-common.h:23
detect-engine-prefilter-common.h
SCReturnInt
#define SCReturnInt(x)
Definition: util-debug.h:288
flow-var.h
SigTableElmt_::RegisterTests
void(* RegisterTests)(void)
Definition: detect.h:1531
DetectEngineEventData_::event
uint8_t event
Definition: detect-engine-event.h:28
PacketEngineEvents_::cnt
uint8_t cnt
Definition: decode.h:310