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 #include "util-unittest.h"
46 
47 #define PARSE_REGEX "\\S[0-9A-z_]+[.][A-z0-9_+.]+$"
48 
49 static DetectParseRegex parse_regex;
50 
51 static int DetectEngineEventMatch (DetectEngineThreadCtx *,
52  Packet *, const Signature *, const SigMatchCtx *);
53 static int DetectEngineEventSetup (DetectEngineCtx *, Signature *, const char *);
54 static int DetectDecodeEventSetup (DetectEngineCtx *, Signature *, const char *);
55 static int DetectStreamEventSetup (DetectEngineCtx *, Signature *, const char *);
56 static void DetectEngineEventFree (DetectEngineCtx *, void *);
57 #ifdef UNITTESTS
58 void EngineEventRegisterTests(void);
59 #endif
60 
61 static bool PrefilterEventIsPrefilterable(const Signature *s, int smtype)
62 {
63  const SigMatch *sm;
64  for (sm = s->init_data->smlists[DETECT_SM_LIST_MATCH]; sm != NULL; sm = sm->next) {
65  if (sm->type == smtype) {
66  return true;
67  }
68  }
69  return false;
70 }
71 static bool PrefilterStreamEventIsPrefilterable(const Signature *s)
72 {
73  return PrefilterEventIsPrefilterable(s, DETECT_STREAM_EVENT);
74 }
75 
76 static bool PrefilterDecodeEventIsPrefilterable(const Signature *s)
77 {
78  return PrefilterEventIsPrefilterable(s, DETECT_DECODE_EVENT);
79 }
80 
81 static void PrefilterPacketEventSet(PrefilterPacketHeaderValue *v, void *smctx)
82 {
83  const DetectEngineEventData *a = smctx;
85  v->u8[1] = a->event; // arg1
86  v->u8[2] = 0; // arg2
87 }
88 
89 static bool PrefilterPacketEventCompare(PrefilterPacketHeaderValue v, void *smctx)
90 {
91  const DetectEngineEventData *a = smctx;
92  DetectUintData_u8 du8;
93  du8.mode = DETECT_UINT_EQ;
94  du8.arg1 = a->event;
95  du8.arg2 = 0;
96  return PrefilterPacketU8Compare(v, &du8);
97 }
98 
99 static void PrefilterPacketEventMatch(DetectEngineThreadCtx *det_ctx, Packet *p, const void *pectx)
100 {
101  const PrefilterPacketU8HashCtx *h = pectx;
102  for (uint8_t u = 0; u < p->events.cnt; u++) {
103  const SigsArray *sa = h->array[p->events.events[u]];
104  if (sa) {
105  PrefilterAddSids(&det_ctx->pmq, sa->sigs, sa->cnt);
106  }
107  }
108 }
109 
110 static int PrefilterSetupStreamEvent(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
111 {
113  SIG_MASK_REQUIRE_ENGINE_EVENT, PrefilterPacketEventSet, PrefilterPacketEventCompare,
114  PrefilterPacketEventMatch);
115 }
116 
117 static int PrefilterSetupDecodeEvent(DetectEngineCtx *de_ctx, SigGroupHead *sgh)
118 {
120  SIG_MASK_REQUIRE_ENGINE_EVENT, PrefilterPacketEventSet, PrefilterPacketEventCompare,
121  PrefilterPacketEventMatch);
122 }
123 
124 /**
125  * \brief Registration function for decode-event: keyword
126  */
128 {
129  sigmatch_table[DETECT_ENGINE_EVENT].name = "engine-event";
130  sigmatch_table[DETECT_ENGINE_EVENT].Match = DetectEngineEventMatch;
131  sigmatch_table[DETECT_ENGINE_EVENT].Setup = DetectEngineEventSetup;
132  sigmatch_table[DETECT_ENGINE_EVENT].Free = DetectEngineEventFree;
133 #ifdef UNITTESTS
135 #endif
136 
137  sigmatch_table[DETECT_DECODE_EVENT].name = "decode-event";
138  sigmatch_table[DETECT_DECODE_EVENT].Match = DetectEngineEventMatch;
139  sigmatch_table[DETECT_DECODE_EVENT].Setup = DetectDecodeEventSetup;
140  sigmatch_table[DETECT_DECODE_EVENT].Free = DetectEngineEventFree;
142  "match on events triggered by structural or invalid values during packet decoding";
143  sigmatch_table[DETECT_DECODE_EVENT].url = "/rules/decode-layer.html#decode-event";
145  sigmatch_table[DETECT_DECODE_EVENT].SupportsPrefilter = PrefilterDecodeEventIsPrefilterable;
146  sigmatch_table[DETECT_DECODE_EVENT].SetupPrefilter = PrefilterSetupDecodeEvent;
147 
148  sigmatch_table[DETECT_STREAM_EVENT].name = "stream-event";
149  sigmatch_table[DETECT_STREAM_EVENT].Match = DetectEngineEventMatch;
150  sigmatch_table[DETECT_STREAM_EVENT].Setup = DetectStreamEventSetup;
151  sigmatch_table[DETECT_STREAM_EVENT].Free = DetectEngineEventFree;
153  "match on events triggered by anomalies during TCP streaming";
154  sigmatch_table[DETECT_STREAM_EVENT].SupportsPrefilter = PrefilterStreamEventIsPrefilterable;
155  sigmatch_table[DETECT_STREAM_EVENT].SetupPrefilter = PrefilterSetupStreamEvent;
156 
157  DetectSetupParseRegexes(PARSE_REGEX, &parse_regex);
158 }
159 
160 /**
161  * \brief This function is used to match decoder event flags set on a packet with those passed via decode-event:
162  *
163  * \param t pointer to thread vars
164  * \param det_ctx pointer to the pattern matcher thread
165  * \param p pointer to the current packet
166  * \param s pointer to the Signature
167  * \param m pointer to the sigmatch
168  *
169  * \retval 0 no match
170  * \retval 1 match
171  */
172 static int DetectEngineEventMatch (DetectEngineThreadCtx *det_ctx,
173  Packet *p, const Signature *s, const SigMatchCtx *ctx)
174 {
175  SCEnter();
176 
177  const DetectEngineEventData *de = (const DetectEngineEventData *)ctx;
178 
179  if (ENGINE_ISSET_EVENT(p, de->event)) {
180  SCLogDebug("de->event matched %u", de->event);
181  SCReturnInt(1);
182  }
183 
184  SCReturnInt(0);
185 }
186 
187 static bool OutdatedEvent(const char *raw)
188 {
189  return strcmp(raw, "decoder.udp.hlen_invalid") == 0;
190 }
191 
192 /**
193  * \brief This function is used to parse decoder events options passed via decode-event: keyword
194  *
195  * \param rawstr Pointer to the user provided decode-event options
196  *
197  * \retval de pointer to DetectFlowData on success
198  * \retval NULL on failure
199  */
200 static DetectEngineEventData *DetectEngineEventParse (const char *rawstr)
201 {
202  int i;
203  DetectEngineEventData *de = NULL;
204  int res = 0, found = 0;
205  size_t pcre2len;
206  pcre2_match_data *match = NULL;
207 
208  int ret = DetectParsePcreExec(&parse_regex, &match, rawstr, 0, 0);
209  if (ret < 1) {
210  SCLogError("pcre_exec parse error, ret %" PRId32 ", string %s", ret, rawstr);
211  goto error;
212  }
213 
214  char copy_str[128] = "";
215  pcre2len = sizeof(copy_str);
216  res = pcre2_substring_copy_bynumber(match, 0, (PCRE2_UCHAR8 *)copy_str, &pcre2len);
217 
218  if (res < 0) {
219  SCLogError("pcre2_substring_copy_bynumber failed");
220  goto error;
221  }
222 
223  for (i = 0; DEvents[i].event_name != NULL; i++) {
224  if (strcasecmp(DEvents[i].event_name,copy_str) == 0) {
225  found = 1;
226  break;
227  }
228  }
229 
230  if (found == 0) {
231  SCLogError("unknown decode event \"%s\"", copy_str);
232  goto error;
233  }
234 
235  de = SCMalloc(sizeof(DetectEngineEventData));
236  if (unlikely(de == NULL))
237  goto error;
238 
239  de->event = DEvents[i].code;
240 
243  }
244 
245  if (OutdatedEvent(rawstr)) {
247  SCLogError("decode-event keyword no longer supports event \"%s\"", rawstr);
248  goto error;
249  } else {
250  SCLogWarning("decode-event keyword no longer supports event \"%s\"", rawstr);
251  }
252  }
253 
254  pcre2_match_data_free(match);
255  return de;
256 
257 error:
258  if (de)
259  SCFree(de);
260  if (match) {
261  pcre2_match_data_free(match);
262  }
263  return NULL;
264 }
265 
266 /**
267  * \brief this function is used to add the parsed decode-event into the current signature
268  *
269  * \param de_ctx pointer to the Detection Engine Context
270  * \param s pointer to the Current Signature
271  * \param rawstr pointer to the user provided decode-event options
272  *
273  * \retval 0 on Success
274  * \retval -1 on Failure
275  */
276 static int DetectEngineEventSetupDo(
277  DetectEngineCtx *de_ctx, Signature *s, const char *rawstr, uint16_t smtype)
278 {
279  DetectEngineEventData *de = DetectEngineEventParse(rawstr);
280  if (de == NULL)
281  return -1;
282 
283  SCLogDebug("rawstr %s %u", rawstr, de->event);
284 
286  NULL) {
287  SCFree(de);
288  return -1;
289  }
290  return 0;
291 }
292 
293 
294 static int DetectEngineEventSetup (DetectEngineCtx *de_ctx, Signature *s, const char *rawstr)
295 {
296  return DetectEngineEventSetupDo (de_ctx, s, rawstr, DETECT_ENGINE_EVENT);
297 }
298 
299 /**
300  * \brief this function will free memory associated with DetectEngineEventData
301  *
302  * \param de pointer to DetectEngineEventData
303  */
304 static void DetectEngineEventFree(DetectEngineCtx *de_ctx, void *ptr)
305 {
307  if (de)
308  SCFree(de);
309 }
310 
311 
312 /**
313  * \brief this function Setup the 'decode-event' keyword by setting the correct
314  * signature type
315 */
316 static int DetectDecodeEventSetup (DetectEngineCtx *de_ctx, Signature *s, const char *rawstr)
317 {
318  char drawstr[64] = "decoder.";
319 
320  /* decoder:$EVENT alias command develop as decode-event:decoder.$EVENT */
321  strlcat(drawstr, rawstr, sizeof(drawstr));
322 
323  return DetectEngineEventSetupDo(de_ctx, s, drawstr, DETECT_DECODE_EVENT);
324 }
325 
326 /**
327  * \brief this function Setup the 'stream-event' keyword by resolving the alias
328 */
329 static int DetectStreamEventSetup (DetectEngineCtx *de_ctx, Signature *s, const char *rawstr)
330 {
331  char srawstr[64] = "stream.";
332 
333  if (strcmp(rawstr, "est_synack_resend_with_different_ack") == 0) {
334  rawstr = "est_synack_resend_with_diff_ack";
335  } else if (strcmp(rawstr, "3whs_synack_resend_with_different_ack") == 0) {
336  rawstr = "3whs_synack_resend_with_diff_ack";
337  }
338 
339  /* stream:$EVENT alias command develop as decode-event:stream.$EVENT */
340  strlcat(srawstr, rawstr, sizeof(srawstr));
341 
342  return DetectEngineEventSetupDo(de_ctx, s, srawstr, DETECT_STREAM_EVENT);
343 }
344 
345 /*
346  * ONLY TESTS BELOW THIS COMMENT
347  */
348 #ifdef UNITTESTS
349 
350 /**
351  * \test EngineEventTestParse01 is a test for a valid decode-event value
352  */
353 static int EngineEventTestParse01 (void)
354 {
355  DetectEngineEventData *de = DetectEngineEventParse("decoder.ipv4.pkt_too_small");
356 
357  FAIL_IF_NULL(de);
358 
359  DetectEngineEventFree(NULL, de);
360 
361  PASS;
362 }
363 
364 /**
365  * \test EngineEventTestParse02 is a test for a valid upper + lower case decode-event value
366  */
367 static int EngineEventTestParse02 (void)
368 {
369  DetectEngineEventData *de = DetectEngineEventParse("decoder.PPP.pkt_too_small");
370 
371  FAIL_IF_NULL(de);
372 
373  DetectEngineEventFree(NULL, de);
374 
375  PASS;
376 }
377 
378 /**
379  * \test EngineEventTestParse03 is a test for a valid upper case decode-event value
380  */
381 static int EngineEventTestParse03 (void)
382 {
383  DetectEngineEventData *de = DetectEngineEventParse("decoder.IPV6.PKT_TOO_SMALL");
384 
385  FAIL_IF_NULL(de);
386 
387  DetectEngineEventFree(NULL, de);
388 
389  PASS;
390 }
391 
392 /**
393  * \test EngineEventTestParse04 is a test for an invalid upper case decode-event value
394  */
395 static int EngineEventTestParse04 (void)
396 {
397  DetectEngineEventData *de = DetectEngineEventParse("decoder.IPV6.INVALID_EVENT");
398 
399  FAIL_IF_NOT_NULL(de);
400 
401  DetectEngineEventFree(NULL, de);
402 
403  PASS;
404 }
405 
406 /**
407  * \test EngineEventTestParse05 is a test for an invalid char into the decode-event value
408  */
409 static int EngineEventTestParse05 (void)
410 {
411  DetectEngineEventData *de = DetectEngineEventParse("decoder.IPV-6,INVALID_CHAR");
412 
413  FAIL_IF_NOT_NULL(de);
414 
415  DetectEngineEventFree(NULL, de);
416 
417  PASS;
418 }
419 
420 /**
421  * \test EngineEventTestParse06 is a test for match function with valid decode-event value
422  */
423 static int EngineEventTestParse06 (void)
424 {
425  Packet *p = PacketGetFromAlloc();
426  FAIL_IF_NULL(p);
427 
428  ThreadVars tv;
429 
430  memset(&tv, 0, sizeof(ThreadVars));
431 
433 
434  DetectEngineEventData *de = DetectEngineEventParse("decoder.ppp.pkt_too_small");
435  FAIL_IF_NULL(de);
436 
437  de->event = PPP_PKT_TOO_SMALL;
438 
439  SigMatch *sm = SigMatchAlloc();
440  FAIL_IF_NULL(sm);
441 
443  sm->ctx = (SigMatchCtx *)de;
444 
445  FAIL_IF_NOT(DetectEngineEventMatch(NULL, p, NULL, sm->ctx));
446 
447  PacketFree(p);
448  SCFree(de);
449  SCFree(sm);
450 
451  PASS;
452 }
453 
454 /**
455  * \brief this function registers unit tests for EngineEvent
456  */
458 {
459  UtRegisterTest("EngineEventTestParse01", EngineEventTestParse01);
460  UtRegisterTest("EngineEventTestParse02", EngineEventTestParse02);
461  UtRegisterTest("EngineEventTestParse03", EngineEventTestParse03);
462  UtRegisterTest("EngineEventTestParse04", EngineEventTestParse04);
463  UtRegisterTest("EngineEventTestParse05", EngineEventTestParse05);
464  UtRegisterTest("EngineEventTestParse06", EngineEventTestParse06);
465 }
466 #endif /* UNITTESTS */
ENGINE_SET_EVENT
#define ENGINE_SET_EVENT(p, e)
Definition: decode.h:1213
detect-engine-uint.h
EngineEventRegisterTests
void EngineEventRegisterTests(void)
this function registers unit tests for EngineEvent
Definition: detect-engine-event.c:457
SigTableElmt_::url
const char * url
Definition: detect.h:1471
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:646
SigTableElmt_::desc
const char * desc
Definition: detect.h:1470
sigmatch_table
SigTableElmt * sigmatch_table
Definition: detect-parse.c:79
SigTableElmt_::Free
void(* Free)(DetectEngineCtx *, void *)
Definition: detect.h:1455
DetectParseRegex
Definition: detect-parse.h:92
SigTableElmt_::name
const char * name
Definition: detect.h:1468
stream-tcp.h
detect-engine-event.h
SigGroupHead_
Container for matching data for a signature group.
Definition: detect.h:1638
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:103
SigTableElmt_::flags
uint32_t flags
Definition: detect.h:1459
PacketEngineEvents_::events
uint8_t events[PACKET_ENGINE_EVENT_MAX]
Definition: decode.h:309
ENGINE_ISSET_EVENT
#define ENGINE_ISSET_EVENT(p, e)
Definition: decode.h:1226
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:125
DetectEngineThreadCtx_::pmq
PrefilterRuleStore pmq
Definition: detect.h:1358
ctx
struct Thresholds ctx
DetectEngineCtx_
main detection engine ctx
Definition: detect.h:937
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
DetectParsePcreExec
int DetectParsePcreExec(DetectParseRegex *parse_regex, pcre2_match_data **match, const char *str, int start_offset, int options)
Definition: detect-parse.c:3532
SigTableElmt_::Setup
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
Definition: detect.h:1450
Packet_::events
PacketEngineEvents events
Definition: decode.h:630
util-unittest.h
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:47
SigTableElmt_::SetupPrefilter
int(* SetupPrefilter)(DetectEngineCtx *de_ctx, struct SigGroupHead_ *sgh)
Definition: detect.h:1453
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:19
DetectEngineThreadCtx_
Definition: detect.h:1252
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:318
DEvents
const struct DecodeEvents_ DEvents[]
Definition: decode-events.c:29
DetectSetupParseRegexes
void DetectSetupParseRegexes(const char *parse_str, DetectParseRegex *detect_parse)
Definition: detect-parse.c:3658
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:387
detect.h
ThreadVars_
Per thread variable structure.
Definition: threadvars.h:58
STREAM_REASSEMBLY_OVERLAP_DIFFERENT_DATA
@ STREAM_REASSEMBLY_OVERLAP_DIFFERENT_DATA
Definition: decode-events.h:311
SigMatch_::next
struct SigMatch_ * next
Definition: detect.h:360
PacketFree
void PacketFree(Packet *p)
Return a malloced packet.
Definition: decode.c:225
DETECT_ENGINE_EVENT
@ DETECT_ENGINE_EVENT
Definition: detect-engine-register.h:216
SigMatchStrictEnabled
bool SigMatchStrictEnabled(const enum DetectKeywordId id)
Definition: detect-parse.c:335
DETECT_SM_LIST_MATCH
@ DETECT_SM_LIST_MATCH
Definition: detect.h:117
SCLogWarning
#define SCLogWarning(...)
Macro used to log WARNING messages.
Definition: util-debug.h:262
SigMatch_::ctx
SigMatchCtx * ctx
Definition: detect.h:359
Packet_
Definition: decode.h:505
DecodeEvents_::code
uint8_t code
Definition: decode-events.h:338
Signature_::init_data
SignatureInitData * init_data
Definition: detect.h:751
SigTableElmt_::Match
int(* Match)(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *)
Definition: detect.h:1430
SigMatchAlloc
SigMatch * SigMatchAlloc(void)
Definition: detect-parse.c:274
SIGMATCH_DEONLY_COMPAT
#define SIGMATCH_DEONLY_COMPAT
Definition: detect-engine-register.h:315
DecodeEvents_::event_name
const char * event_name
Definition: decode-events.h:337
decode-events.h
SigMatchCtx_
Used to start a pointer to SigMatch context Should never be dereferenced without casting to something...
Definition: detect.h:351
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:357
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:33
PacketGetFromAlloc
Packet * PacketGetFromAlloc(void)
Get a malloced packet.
Definition: decode.c:264
DetectEngineEventRegister
void DetectEngineEventRegister(void)
Registration function for decode-event: keyword.
Definition: detect-engine-event.c:127
SCMalloc
#define SCMalloc(sz)
Definition: util-mem.h:47
DETECT_STREAM_EVENT
@ DETECT_STREAM_EVENT
Definition: detect-engine-register.h:217
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:1452
detect-parse.h
Signature_
Signature container.
Definition: detect.h:672
SigMatch_
a single match condition for a signature
Definition: detect.h:356
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:1457
DetectEngineEventData_::event
uint8_t event
Definition: detect-engine-event.h:28
PacketEngineEvents_::cnt
uint8_t cnt
Definition: decode.h:308