suricata
detect-http2.c
Go to the documentation of this file.
1 /* Copyright (C) 2020-2022 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 Philippe Antoine <p.antoine@catenacyber.fr>
22  *
23  */
24 
25 #include "suricata-common.h"
26 
27 #include "detect.h"
28 #include "detect-parse.h"
29 #include "detect-content.h"
30 
31 #include "detect-engine.h"
32 #include "detect-engine-buffer.h"
33 #include "detect-engine-uint.h"
34 #include "detect-engine-mpm.h"
37 #include "detect-engine-helper.h"
38 
39 #include "detect-http2.h"
40 #include "util-byte.h"
41 #include "rust.h"
42 #include "util-profiling.h"
43 
44 #ifdef UNITTESTS
51 #endif
52 
53 /* prototypes */
54 static int DetectHTTP2frametypeMatch(DetectEngineThreadCtx *det_ctx,
55  Flow *f, uint8_t flags, void *state, void *txv, const Signature *s,
56  const SigMatchCtx *ctx);
57 static int DetectHTTP2frametypeSetup (DetectEngineCtx *, Signature *, const char *);
59 
60 static int DetectHTTP2errorcodeMatch(DetectEngineThreadCtx *det_ctx,
61  Flow *f, uint8_t flags, void *state, void *txv, const Signature *s,
62  const SigMatchCtx *ctx);
63 static int DetectHTTP2errorcodeSetup (DetectEngineCtx *, Signature *, const char *);
65 
66 static int DetectHTTP2priorityMatch(DetectEngineThreadCtx *det_ctx,
67  Flow *f, uint8_t flags, void *state, void *txv, const Signature *s,
68  const SigMatchCtx *ctx);
69 static int DetectHTTP2prioritySetup (DetectEngineCtx *, Signature *, const char *);
71 
72 static int DetectHTTP2windowMatch(DetectEngineThreadCtx *det_ctx,
73  Flow *f, uint8_t flags, void *state, void *txv, const Signature *s,
74  const SigMatchCtx *ctx);
75 static int DetectHTTP2windowSetup (DetectEngineCtx *, Signature *, const char *);
76 void DetectHTTP2windowFree (DetectEngineCtx *, void *);
77 
78 static int DetectHTTP2sizeUpdateMatch(DetectEngineThreadCtx *det_ctx,
79  Flow *f, uint8_t flags, void *state, void *txv, const Signature *s,
80  const SigMatchCtx *ctx);
81 static int DetectHTTP2sizeUpdateSetup (DetectEngineCtx *, Signature *, const char *);
83 
84 static int DetectHTTP2settingsMatch(DetectEngineThreadCtx *det_ctx,
85  Flow *f, uint8_t flags, void *state, void *txv, const Signature *s,
86  const SigMatchCtx *ctx);
87 static int DetectHTTP2settingsSetup (DetectEngineCtx *, Signature *, const char *);
89 
90 static int DetectHTTP2headerNameSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg);
91 
92 #ifdef UNITTESTS
94 #endif
95 
96 static int g_http2_match_buffer_id = 0;
97 static int g_http2_complete_buffer_id = 0;
98 static int g_http2_header_name_buffer_id = 0;
99 
100 /**
101  * \brief Registration function for HTTP2 keywords
102  */
103 
105 {
106  sigmatch_table[DETECT_HTTP2_FRAMETYPE].name = "http2.frametype";
107  sigmatch_table[DETECT_HTTP2_FRAMETYPE].desc = "match on HTTP2 frame type field";
108  sigmatch_table[DETECT_HTTP2_FRAMETYPE].url = "/rules/http2-keywords.html#frametype";
110  sigmatch_table[DETECT_HTTP2_FRAMETYPE].AppLayerTxMatch = DetectHTTP2frametypeMatch;
111  sigmatch_table[DETECT_HTTP2_FRAMETYPE].Setup = DetectHTTP2frametypeSetup;
115 #ifdef UNITTESTS
117 #endif
118 
119  sigmatch_table[DETECT_HTTP2_ERRORCODE].name = "http2.errorcode";
120  sigmatch_table[DETECT_HTTP2_ERRORCODE].desc = "match on HTTP2 error code field";
121  sigmatch_table[DETECT_HTTP2_ERRORCODE].url = "/rules/http2-keywords.html#errorcode";
123  sigmatch_table[DETECT_HTTP2_ERRORCODE].AppLayerTxMatch = DetectHTTP2errorcodeMatch;
124  sigmatch_table[DETECT_HTTP2_ERRORCODE].Setup = DetectHTTP2errorcodeSetup;
128 #ifdef UNITTESTS
130 #endif
131 
132  sigmatch_table[DETECT_HTTP2_PRIORITY].name = "http2.priority";
133  sigmatch_table[DETECT_HTTP2_PRIORITY].desc = "match on HTTP2 priority weight field";
134  sigmatch_table[DETECT_HTTP2_PRIORITY].url = "/rules/http2-keywords.html#priority";
136  sigmatch_table[DETECT_HTTP2_PRIORITY].AppLayerTxMatch = DetectHTTP2priorityMatch;
137  sigmatch_table[DETECT_HTTP2_PRIORITY].Setup = DetectHTTP2prioritySetup;
140 #ifdef UNITTESTS
142 #endif
143 
144  sigmatch_table[DETECT_HTTP2_WINDOW].name = "http2.window";
145  sigmatch_table[DETECT_HTTP2_WINDOW].desc = "match on HTTP2 window update size increment field";
146  sigmatch_table[DETECT_HTTP2_WINDOW].url = "/rules/http2-keywords.html#window";
148  sigmatch_table[DETECT_HTTP2_WINDOW].AppLayerTxMatch = DetectHTTP2windowMatch;
149  sigmatch_table[DETECT_HTTP2_WINDOW].Setup = DetectHTTP2windowSetup;
152 #ifdef UNITTESTS
154 #endif
155 
156  sigmatch_table[DETECT_HTTP2_SIZEUPDATE].name = "http2.size_update";
157  sigmatch_table[DETECT_HTTP2_SIZEUPDATE].desc = "match on HTTP2 dynamic headers table size update";
158  sigmatch_table[DETECT_HTTP2_SIZEUPDATE].url = "/rules/http2-keywords.html#sizeupdate";
160  sigmatch_table[DETECT_HTTP2_SIZEUPDATE].AppLayerTxMatch = DetectHTTP2sizeUpdateMatch;
161  sigmatch_table[DETECT_HTTP2_SIZEUPDATE].Setup = DetectHTTP2sizeUpdateSetup;
164 #ifdef UNITTESTS
166 #endif
167 
168  sigmatch_table[DETECT_HTTP2_SETTINGS].name = "http2.settings";
169  sigmatch_table[DETECT_HTTP2_SETTINGS].desc = "match on HTTP2 settings identifier and value fields";
170  sigmatch_table[DETECT_HTTP2_SETTINGS].url = "/rules/http2-keywords.html#settings";
172  sigmatch_table[DETECT_HTTP2_SETTINGS].AppLayerTxMatch = DetectHTTP2settingsMatch;
173  sigmatch_table[DETECT_HTTP2_SETTINGS].Setup = DetectHTTP2settingsSetup;
175 #ifdef UNITTESTS
177 #endif
178 
179  sigmatch_table[DETECT_HTTP2_HEADERNAME].name = "http2.header_name";
180  sigmatch_table[DETECT_HTTP2_HEADERNAME].desc = "sticky buffer to match on one HTTP2 header name";
181  sigmatch_table[DETECT_HTTP2_HEADERNAME].url = "/rules/http2-keywords.html#header_name";
182  sigmatch_table[DETECT_HTTP2_HEADERNAME].Setup = DetectHTTP2headerNameSetup;
185 
187  HTTP2StateOpen, SCHttp2TxGetHeaderName, 2);
189  HTTP2StateOpen, SCHttp2TxGetHeaderName, 2);
190 
191  DetectBufferTypeSupportsMultiInstance("http2_header_name");
192  DetectBufferTypeSetDescriptionByName("http2_header_name",
193  "HTTP2 header name");
194  g_http2_header_name_buffer_id = DetectBufferTypeGetByName("http2_header_name");
195 
200 
201  g_http2_match_buffer_id = DetectBufferTypeRegister("http2");
202 
204  HTTP2StateClosed, DetectEngineInspectGenericList, NULL);
206  HTTP2StateClosed, DetectEngineInspectGenericList, NULL);
207 
208  g_http2_complete_buffer_id = DetectBufferTypeRegister("http2_complete");
209 }
210 
211 /**
212  * \brief This function is used to match HTTP2 frame type rule option on a transaction with those passed via http2.frametype:
213  *
214  * \retval 0 no match
215  * \retval 1 match
216  */
217 static int DetectHTTP2frametypeMatch(DetectEngineThreadCtx *det_ctx,
218  Flow *f, uint8_t flags, void *state, void *txv, const Signature *s,
219  const SigMatchCtx *ctx)
220 
221 {
222  return SCHttp2TxHasFrametype(txv, flags, ctx);
223 }
224 
225 /**
226  * \brief this function is used to attach the parsed http2.frametype data into the current signature
227  *
228  * \param de_ctx pointer to the Detection Engine Context
229  * \param s pointer to the Current Signature
230  * \param str pointer to the user provided http2.frametype options
231  *
232  * \retval 0 on Success
233  * \retval -1 on Failure
234  */
235 static int DetectHTTP2frametypeSetup (DetectEngineCtx *de_ctx, Signature *s, const char *str)
236 {
238  return -1;
239 
240  void *dua8 = SCHttp2ParseFrametype(str);
241  if (dua8 == NULL) {
242  SCLogError("Invalid http2.frametype: %s", str);
243  return -1;
244  }
245 
247  g_http2_match_buffer_id) == NULL) {
248  DetectHTTP2frametypeFree(NULL, dua8);
249  return -1;
250  }
251 
252  return 0;
253 }
254 
255 /**
256  * \brief this function will free memory associated with uint8_t
257  *
258  * \param ptr pointer to uint8_t
259  */
261 {
262  SCDetectU8ArrayFree(ptr);
263 }
264 
265 /**
266  * \brief This function is used to match HTTP2 error code rule option on a transaction with those passed via http2.errorcode:
267  *
268  * \retval 0 no match
269  * \retval 1 match
270  */
271 static int DetectHTTP2errorcodeMatch(DetectEngineThreadCtx *det_ctx,
272  Flow *f, uint8_t flags, void *state, void *txv, const Signature *s,
273  const SigMatchCtx *ctx)
274 
275 {
276  return SCHttp2TxHasErrorCode(txv, flags, ctx);
277 }
278 
279 /**
280  * \brief this function is used to attach the parsed http2.errorcode data into the current signature
281  *
282  * \param de_ctx pointer to the Detection Engine Context
283  * \param s pointer to the Current Signature
284  * \param str pointer to the user provided http2.errorcode options
285  *
286  * \retval 0 on Success
287  * \retval -1 on Failure
288  */
289 static int DetectHTTP2errorcodeSetup (DetectEngineCtx *de_ctx, Signature *s, const char *str)
290 {
292  return -1;
293 
294  void *dua32 = SCHttp2ParseErrorCode(str);
295  if (dua32 == NULL) {
296  SCLogError("Invalid http2.errorcode: %s", str);
297  return -1;
298  }
299 
301  g_http2_match_buffer_id) == NULL) {
302  DetectHTTP2errorcodeFree(NULL, dua32);
303  return -1;
304  }
305 
306  return 0;
307 }
308 
309 /**
310  * \brief this function will free memory associated with uint32_t
311  *
312  * \param ptr pointer to uint32_t
313  */
315 {
316  SCDetectU32ArrayFree(ptr);
317 }
318 
319 /**
320  * \brief This function is used to match HTTP2 error code rule option on a transaction with those passed via http2.priority:
321  *
322  * \retval 0 no match
323  * \retval 1 match
324  */
325 static int DetectHTTP2priorityMatch(DetectEngineThreadCtx *det_ctx,
326  Flow *f, uint8_t flags, void *state, void *txv, const Signature *s,
327  const SigMatchCtx *ctx)
328 
329 {
330  return SCHttp2PriorityMatch(txv, flags, ctx);
331 }
332 
333 /**
334  * \brief this function is used to attach the parsed http2.priority data into the current signature
335  *
336  * \param de_ctx pointer to the Detection Engine Context
337  * \param s pointer to the Current Signature
338  * \param str pointer to the user provided http2.priority options
339  *
340  * \retval 0 on Success
341  * \retval -1 on Failure
342  */
343 static int DetectHTTP2prioritySetup (DetectEngineCtx *de_ctx, Signature *s, const char *str)
344 {
346  return -1;
347 
348  DetectU8Data *prio = SCDetectU8ArrayParse(str);
349  if (prio == NULL)
350  return -1;
351 
353  g_http2_match_buffer_id) == NULL) {
354  SCDetectU8Free(prio);
355  return -1;
356  }
357 
358  return 0;
359 }
360 
361 /**
362  * \brief this function will free memory associated with uint32_t
363  *
364  * \param ptr pointer to DetectU8Data
365  */
367 {
368  SCDetectU8ArrayFree(ptr);
369 }
370 
371 /**
372  * \brief This function is used to match HTTP2 window rule option on a transaction with those passed via http2.window:
373  *
374  * \retval 0 no match
375  * \retval 1 match
376  */
377 static int DetectHTTP2windowMatch(DetectEngineThreadCtx *det_ctx,
378  Flow *f, uint8_t flags, void *state, void *txv, const Signature *s,
379  const SigMatchCtx *ctx)
380 
381 {
382  return SCHttp2WindowMatch(txv, flags, ctx);
383 }
384 
385 /**
386  * \brief this function is used to attach the parsed http2.window data into the current signature
387  *
388  * \param de_ctx pointer to the Detection Engine Context
389  * \param s pointer to the Current Signature
390  * \param str pointer to the user provided http2.window options
391  *
392  * \retval 0 on Success
393  * \retval -1 on Failure
394  */
395 static int DetectHTTP2windowSetup (DetectEngineCtx *de_ctx, Signature *s, const char *str)
396 {
398  return -1;
399 
400  DetectU32Data *wu = SCDetectU32ArrayParse(str);
401  if (wu == NULL)
402  return -1;
403 
404  // use g_http2_complete_buffer_id as we may have window changes in any state
406  g_http2_complete_buffer_id) == NULL) {
407  SCDetectU32Free(wu);
408  return -1;
409  }
410 
411  return 0;
412 }
413 
414 /**
415  * \brief this function will free memory associated with uint32_t
416  *
417  * \param ptr pointer to DetectU8Data
418  */
420 {
421  SCDetectU32ArrayFree(ptr);
422 }
423 
424 /**
425  * \brief This function is used to match HTTP2 size update rule option on a transaction with those passed via http2.size_update:
426  *
427  * \retval 0 no match
428  * \retval 1 match
429  */
430 static int DetectHTTP2sizeUpdateMatch(DetectEngineThreadCtx *det_ctx,
431  Flow *f, uint8_t flags, void *state, void *txv, const Signature *s,
432  const SigMatchCtx *ctx)
433 
434 {
435  return SCHttp2DetectSizeUpdateCtxMatch(ctx, txv, flags);
436 }
437 
438 /**
439  * \brief this function is used to attach the parsed http2.size_update data into the current signature
440  *
441  * \param de_ctx pointer to the Detection Engine Context
442  * \param s pointer to the Current Signature
443  * \param str pointer to the user provided http2.size_update options
444  *
445  * \retval 0 on Success
446  * \retval -1 on Failure
447  */
448 static int DetectHTTP2sizeUpdateSetup (DetectEngineCtx *de_ctx, Signature *s, const char *str)
449 {
451  return -1;
452 
453  void *su = SCDetectU64Parse(str);
454  if (su == NULL)
455  return -1;
456 
458  g_http2_match_buffer_id) == NULL) {
459  DetectHTTP2settingsFree(NULL, su);
460  return -1;
461  }
462 
463  return 0;
464 }
465 
466 /**
467  * \brief this function will free memory associated with uint32_t
468  *
469  * \param ptr pointer to DetectU8Data
470  */
472 {
473  SCDetectU64Free(ptr);
474 }
475 
476 /**
477  * \brief This function is used to match HTTP2 error code rule option on a transaction with those passed via http2.settings:
478  *
479  * \retval 0 no match
480  * \retval 1 match
481  */
482 static int DetectHTTP2settingsMatch(DetectEngineThreadCtx *det_ctx,
483  Flow *f, uint8_t flags, void *state, void *txv, const Signature *s,
484  const SigMatchCtx *ctx)
485 
486 {
487  return SCHttp2DetectSettingsCtxMatch(ctx, txv, flags);
488 }
489 
490 /**
491  * \brief this function is used to attach the parsed http2.settings data into the current signature
492  *
493  * \param de_ctx pointer to the Detection Engine Context
494  * \param s pointer to the Current Signature
495  * \param str pointer to the user provided http2.settings options
496  *
497  * \retval 0 on Success
498  * \retval -1 on Failure
499  */
500 static int DetectHTTP2settingsSetup (DetectEngineCtx *de_ctx, Signature *s, const char *str)
501 {
503  return -1;
504 
505  void *http2set = SCHttp2DetectSettingsCtxParse(str);
506  if (http2set == NULL)
507  return -1;
508 
510  g_http2_match_buffer_id) == NULL) {
511  DetectHTTP2settingsFree(NULL, http2set);
512  return -1;
513  }
514 
515  return 0;
516 }
517 
518 /**
519  * \brief this function will free memory associated with rust signature context
520  *
521  * \param ptr pointer to rust signature context
522  */
524 {
525  SCHttp2DetectSettingsCtxFree(ptr);
526 }
527 
528 static int DetectHTTP2headerNameSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg)
529 {
530  if (SCDetectBufferSetActiveList(de_ctx, s, g_http2_header_name_buffer_id) < 0)
531  return -1;
532 
534  return -1;
535 
536  return 0;
537 }
538 
539 #ifdef UNITTESTS
540 #include "tests/detect-http2.c"
541 #endif
util-byte.h
detect-engine-uint.h
SigTableElmt_::url
const char * url
Definition: detect.h:1460
detect-content.h
detect-engine.h
SIGMATCH_INFO_STICKY_BUFFER
#define SIGMATCH_INFO_STICKY_BUFFER
Definition: detect.h:1674
DetectHTTP2priorityRegisterTests
void DetectHTTP2priorityRegisterTests(void)
Definition: detect-http2.c:90
SigTableElmt_::desc
const char * desc
Definition: detect.h:1459
sigmatch_table
SigTableElmt * sigmatch_table
Definition: detect-parse.c:79
SigTableElmt_::Free
void(* Free)(DetectEngineCtx *, void *)
Definition: detect.h:1444
SigTableElmt_::name
const char * name
Definition: detect.h:1457
DetectHTTP2RegisterTests
void DetectHTTP2RegisterTests(void)
SigTableElmt_::flags
uint32_t flags
Definition: detect.h:1448
Flow_
Flow data structure.
Definition: flow.h:348
DETECT_HTTP2_SETTINGS
@ DETECT_HTTP2_SETTINGS
Definition: detect-engine-register.h:211
ctx
struct Thresholds ctx
DetectHTTP2priorityFree
void DetectHTTP2priorityFree(DetectEngineCtx *, void *)
this function will free memory associated with uint32_t
Definition: detect-http2.c:366
DetectEngineCtx_
main detection engine ctx
Definition: detect.h:932
DETECT_HTTP2_SIZEUPDATE
@ DETECT_HTTP2_SIZEUPDATE
Definition: detect-engine-register.h:210
DetectBufferTypeSupportsMultiInstance
void DetectBufferTypeSupportsMultiInstance(const char *name)
Definition: detect-engine.c:1228
SigTableElmt_::AppLayerTxMatch
int(* AppLayerTxMatch)(DetectEngineThreadCtx *, Flow *, uint8_t flags, void *alstate, void *txv, const Signature *, const SigMatchCtx *)
Definition: detect.h:1422
rust.h
DetectHTTP2sizeUpdateFree
void DetectHTTP2sizeUpdateFree(DetectEngineCtx *, void *)
this function will free memory associated with uint32_t
Definition: detect-http2.c:471
DETECT_HTTP2_HEADERNAME
@ DETECT_HTTP2_HEADERNAME
Definition: detect-engine-register.h:212
SCDetectBufferSetActiveList
int SCDetectBufferSetActiveList(DetectEngineCtx *de_ctx, Signature *s, const int list)
Definition: detect-engine-buffer.c:29
SCDetectSignatureSetAppProto
int SCDetectSignatureSetAppProto(Signature *s, AppProto alproto)
Definition: detect-parse.c:2229
SIG_FLAG_TOCLIENT
#define SIG_FLAG_TOCLIENT
Definition: detect.h:272
SigTableElmt_::Setup
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
Definition: detect.h:1439
detect-engine-prefilter.h
DetectBufferTypeGetByName
int DetectBufferTypeGetByName(const char *name)
Definition: detect-engine.c:1278
SIGMATCH_INFO_UINT32
#define SIGMATCH_INFO_UINT32
Definition: detect.h:1690
SIG_FLAG_TOSERVER
#define SIG_FLAG_TOSERVER
Definition: detect.h:271
de_ctx
DetectEngineCtx * de_ctx
Definition: fuzz_siginit.c:18
detect-http2.h
DetectEngineThreadCtx_
Definition: detect.h:1244
SIGMATCH_INFO_MULTI_UINT
#define SIGMATCH_INFO_MULTI_UINT
Definition: detect.h:1694
detect-engine-mpm.h
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:388
detect.h
DetectHTTP2sizeUpdateRegisterTests
void DetectHTTP2sizeUpdateRegisterTests(void)
Definition: detect-http2.c:158
DetectHTTP2settingsFree
void DetectHTTP2settingsFree(DetectEngineCtx *, void *)
this function will free memory associated with rust signature context
Definition: detect-http2.c:523
DetectU8Data
DetectUintData_u8 DetectU8Data
Definition: detect-engine-uint.h:43
detect-engine-helper.h
DetectHTTP2settingsRegisterTests
void DetectHTTP2settingsRegisterTests(void)
Definition: detect-http2.c:135
util-profiling.h
SigTableElmt_::Match
int(* Match)(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *)
Definition: detect.h:1419
ALPROTO_HTTP2
@ ALPROTO_HTTP2
Definition: app-layer-protos.h:69
DetectHTTP2windowRegisterTests
void DetectHTTP2windowRegisterTests(void)
Definition: detect-http2.c:112
detect-engine-content-inspection.h
SigMatchCtx_
Used to start a pointer to SigMatch context Should never be dereferenced without casting to something...
Definition: detect.h:351
DetectBufferTypeRegister
int DetectBufferTypeRegister(const char *name)
Definition: detect-engine.c:1214
flags
uint8_t flags
Definition: decode-gre.h:0
suricata-common.h
DetectHTTP2windowFree
void DetectHTTP2windowFree(DetectEngineCtx *, void *)
this function will free memory associated with uint32_t
Definition: detect-http2.c:419
DETECT_HTTP2_ERRORCODE
@ DETECT_HTTP2_ERRORCODE
Definition: detect-engine-register.h:207
DetectU32Data
DetectUintData_u32 DetectU32Data
Definition: detect-engine-uint.h:41
detect-engine-buffer.h
SIGMATCH_INFO_UINT64
#define SIGMATCH_INFO_UINT64
Definition: detect.h:1692
DetectHttp2Register
void DetectHttp2Register(void)
Registration function for HTTP2 keywords.
Definition: detect-http2.c:104
DetectEngineInspectGenericList
uint8_t DetectEngineInspectGenericList(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct DetectEngineAppInspectionEngine_ *engine, const Signature *s, Flow *f, uint8_t flags, void *alstate, void *txv, uint64_t tx_id)
Do the content inspection & validation for a signature.
Definition: detect-engine.c:1946
SIGMATCH_INFO_MULTI_BUFFER
#define SIGMATCH_INFO_MULTI_BUFFER
Definition: detect.h:1684
str
#define str(s)
Definition: suricata-common.h:308
SCLogError
#define SCLogError(...)
Macro used to log ERROR messages.
Definition: util-debug.h:271
DetectHTTP2errorCodeRegisterTests
void DetectHTTP2errorCodeRegisterTests(void)
Definition: detect-http2.c:68
DETECT_HTTP2_WINDOW
@ DETECT_HTTP2_WINDOW
Definition: detect-engine-register.h:209
detect-parse.h
Signature_
Signature container.
Definition: detect.h:668
SIGMATCH_INFO_UINT8
#define SIGMATCH_INFO_UINT8
Definition: detect.h:1686
DETECT_HTTP2_PRIORITY
@ DETECT_HTTP2_PRIORITY
Definition: detect-engine-register.h:208
detect-http2.c
SIGMATCH_NOOPT
#define SIGMATCH_NOOPT
Definition: detect.h:1649
DetectAppLayerInspectEngineRegister
void DetectAppLayerInspectEngineRegister(const char *name, AppProto alproto, uint32_t dir, int progress, InspectEngineFuncPtr Callback, InspectionBufferGetDataPtr GetData)
Registers an app inspection engine.
Definition: detect-engine.c:273
DetectBufferTypeSetDescriptionByName
void DetectBufferTypeSetDescriptionByName(const char *name, const char *desc)
Definition: detect-engine.c:1375
DetectHTTP2frameTypeRegisterTests
void DetectHTTP2frameTypeRegisterTests(void)
this function registers unit tests for DetectHTTP2frameType
Definition: detect-http2.c:46
DetectHTTP2errorcodeFree
void DetectHTTP2errorcodeFree(DetectEngineCtx *, void *)
this function will free memory associated with uint32_t
Definition: detect-http2.c:314
DetectAppLayerMultiRegister
void DetectAppLayerMultiRegister(const char *name, AppProto alproto, uint32_t dir, int progress, InspectionMultiBufferGetDataPtr GetData, int priority)
Definition: detect-engine.c:2099
DetectHTTP2frametypeFree
void DetectHTTP2frametypeFree(DetectEngineCtx *, void *)
this function will free memory associated with uint8_t
Definition: detect-http2.c:260
SIGMATCH_INFO_ENUM_UINT
#define SIGMATCH_INFO_ENUM_UINT
Definition: detect.h:1696
DETECT_HTTP2_FRAMETYPE
@ DETECT_HTTP2_FRAMETYPE
Definition: detect-engine-register.h:206
SigTableElmt_::RegisterTests
void(* RegisterTests)(void)
Definition: detect.h:1446