suricata
detect-http-raw-header.c
Go to the documentation of this file.
1 /* Copyright (C) 2007-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  * \ingroup httplayer
20  *
21  * @{
22  */
23 
24 
25 /**
26  * \file
27  *
28  * \author Pablo Rincon <pablo.rincon.crespo@gmail.com>
29  *
30  * Implements support for http_raw_header keyword.
31  */
32 
33 #include "suricata-common.h"
34 #include "threads.h"
35 #include "decode.h"
36 
37 #include "detect.h"
38 #include "detect-parse.h"
39 #include "detect-engine.h"
40 #include "detect-engine-buffer.h"
41 #include "detect-engine-mpm.h"
43 #include "detect-content.h"
44 
45 #include "flow.h"
46 #include "flow-var.h"
47 #include "flow-util.h"
48 
49 #include "util-debug.h"
50 #include "util-profiling.h"
51 
52 #include "app-layer.h"
53 #include "app-layer-parser.h"
54 #include "app-layer-htp.h"
55 #include "detect-http-raw-header.h"
56 
57 static int DetectHttpRawHeaderSetup(DetectEngineCtx *, Signature *, const char *);
58 static int DetectHttpRawHeaderSetupSticky(DetectEngineCtx *de_ctx, Signature *s, const char *str);
59 #ifdef UNITTESTS
60 static void DetectHttpRawHeaderRegisterTests(void);
61 #endif
62 static bool DetectHttpRawHeaderValidateCallback(
63  const Signature *s, const char **sigerror, const DetectBufferType *dbt);
64 static int g_http_raw_header_buffer_id = 0;
65 static int g_http2_thread_id = 0;
66 
67 static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
68  const DetectEngineTransforms *transforms, Flow *_f,
69  const uint8_t flow_flags, void *txv, const int list_id);
70 static InspectionBuffer *GetData2(DetectEngineThreadCtx *det_ctx,
71  const DetectEngineTransforms *transforms, Flow *_f, const uint8_t flow_flags, void *txv,
72  const int list_id);
73 
74 static int PrefilterMpmHttpHeaderRawRequestRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh,
75  MpmCtx *mpm_ctx, const DetectBufferMpmRegistry *mpm_reg, int list_id);
76 static int PrefilterMpmHttpHeaderRawResponseRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh,
77  MpmCtx *mpm_ctx, const DetectBufferMpmRegistry *mpm_reg, int list_id);
78 
79 /**
80  * \brief Registers the keyword handlers for the "http_raw_header" keyword.
81  */
83 {
84  /* http_raw_header content modifier */
85  sigmatch_table[DETECT_HTTP_RAW_HEADER_CM].name = "http_raw_header";
87  "content modifier to match the raw HTTP header buffer";
88  // no doc url for this obsolete keyword, see http.header.raw
89  sigmatch_table[DETECT_HTTP_RAW_HEADER_CM].Setup = DetectHttpRawHeaderSetup;
90 #ifdef UNITTESTS
92 #endif
96 
97  /* http.header.raw sticky buffer */
98  sigmatch_table[DETECT_HTTP_RAW_HEADER].name = "http.header.raw";
99  sigmatch_table[DETECT_HTTP_RAW_HEADER].desc = "sticky buffer to match the raw HTTP header buffer";
100  sigmatch_table[DETECT_HTTP_RAW_HEADER].url = "/rules/http-keywords.html#http-header-raw";
101  sigmatch_table[DETECT_HTTP_RAW_HEADER].Setup = DetectHttpRawHeaderSetupSticky;
103 
105  HTP_REQUEST_PROGRESS_HEADERS + 1, DetectEngineInspectBufferGeneric, GetData);
107  HTP_RESPONSE_PROGRESS_HEADERS + 1, DetectEngineInspectBufferGeneric, GetData);
108 
109  DetectAppLayerMpmRegister("http_raw_header", SIG_FLAG_TOSERVER, 2,
110  PrefilterMpmHttpHeaderRawRequestRegister, NULL, ALPROTO_HTTP1,
111  0); /* progress handled in register */
112  DetectAppLayerMpmRegister("http_raw_header", SIG_FLAG_TOCLIENT, 2,
113  PrefilterMpmHttpHeaderRawResponseRegister, NULL, ALPROTO_HTTP1,
114  0); /* progress handled in register */
115 
117  HTTP2StateOpen, DetectEngineInspectBufferGeneric, GetData2);
119  HTTP2StateDataServer, DetectEngineInspectBufferGeneric, GetData2);
120 
122  GetData2, ALPROTO_HTTP2, HTTP2StateOpen);
124  GetData2, ALPROTO_HTTP2, HTTP2StateDataServer);
125 
126  DetectBufferTypeSetDescriptionByName("http_raw_header",
127  "raw http headers");
128 
130  DetectHttpRawHeaderValidateCallback);
131  g_http2_thread_id = DetectRegisterThreadCtxGlobalFuncs(
132  "http2.raw_header", SCHttp2ThreadBufDataInit, NULL, SCHttp2ThreadBufDataFree);
133 
134  g_http_raw_header_buffer_id = DetectBufferTypeGetByName("http_raw_header");
135 }
136 
137 /**
138  * \brief The setup function for the http_raw_header keyword for a signature.
139  *
140  * \param de_ctx Pointer to the detection engine context.
141  * \param s Pointer to signature for the current Signature being parsed
142  * from the rules.
143  * \param m Pointer to the head of the SigMatchs for the current rule
144  * being parsed.
145  * \param arg Pointer to the string holding the keyword value.
146  *
147  * \retval 0 On success.
148  * \retval -1 On failure.
149  */
150 int DetectHttpRawHeaderSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg)
151 {
153  de_ctx, s, arg, DETECT_HTTP_RAW_HEADER_CM, g_http_raw_header_buffer_id, ALPROTO_HTTP1);
154 }
155 
156 /**
157  * \brief this function setup the http.header.raw keyword used in the rule
158  *
159  * \param de_ctx Pointer to the Detection Engine Context
160  * \param s Pointer to the Signature to which the current keyword belongs
161  * \param str Should hold an empty string always
162  *
163  * \retval 0 On success
164  */
165 static int DetectHttpRawHeaderSetupSticky(DetectEngineCtx *de_ctx, Signature *s, const char *str)
166 {
167  if (SCDetectBufferSetActiveList(de_ctx, s, g_http_raw_header_buffer_id) < 0)
168  return -1;
170  return -1;
171  return 0;
172 }
173 
174 static bool DetectHttpRawHeaderValidateCallback(
175  const Signature *s, const char **sigerror, const DetectBufferType *dbt)
176 {
178  *sigerror = "http_raw_header signature "
179  "without a flow direction. Use flow:to_server for "
180  "inspecting request headers or flow:to_client for "
181  "inspecting response headers.";
182 
183  SCLogError("%s", *sigerror);
184  SCReturnInt(false);
185  }
186  return true;
187 }
188 
189 static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
190  const DetectEngineTransforms *transforms, Flow *_f,
191  const uint8_t flow_flags, void *txv, const int list_id)
192 {
193  InspectionBuffer *buffer = SCInspectionBufferGet(det_ctx, list_id);
194  if (buffer->inspect == NULL) {
195  htp_tx_t *tx = (htp_tx_t *)txv;
196 
197  HtpTxUserData *tx_ud = htp_tx_get_user_data(tx);
198 
199  const bool ts = ((flow_flags & STREAM_TOSERVER) != 0);
200  const uint8_t *data = ts ?
202  if (data == NULL)
203  return NULL;
204  const uint32_t data_len = ts ?
206 
208  det_ctx, list_id, buffer, data, data_len, transforms);
209  }
210 
211  return buffer;
212 }
213 
214 static InspectionBuffer *GetData2(DetectEngineThreadCtx *det_ctx,
215  const DetectEngineTransforms *transforms, Flow *_f, const uint8_t flow_flags, void *txv,
216  const int list_id)
217 {
218  InspectionBuffer *buffer = SCInspectionBufferGet(det_ctx, list_id);
219  if (buffer->inspect == NULL) {
220  uint32_t b_len = 0;
221  const uint8_t *b = NULL;
222 
223  void *thread_buf = DetectThreadCtxGetGlobalKeywordThreadCtx(det_ctx, g_http2_thread_id);
224  if (thread_buf == NULL)
225  return NULL;
226  if (SCHttp2TxGetHeadersRaw(txv, flow_flags, &b, &b_len, thread_buf) != 1)
227  return NULL;
228  if (b == NULL || b_len == 0)
229  return NULL;
230 
231  SCInspectionBufferSetupAndApplyTransforms(det_ctx, list_id, buffer, b, b_len, transforms);
232  }
233 
234  return buffer;
235 }
236 
238  int list_id;
239  const MpmCtx *mpm_ctx;
242 
243 /** \brief Generic Mpm prefilter callback
244  *
245  * \param det_ctx detection engine thread ctx
246  * \param p packet to inspect
247  * \param f flow to inspect
248  * \param txv tx to inspect
249  * \param pectx inspection context
250  */
251 static void PrefilterMpmHttpHeaderRaw(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p,
252  Flow *f, void *txv, const uint64_t idx, const AppLayerTxData *_txd, const uint8_t flags)
253 {
254  SCEnter();
255 
256  const PrefilterMpmHttpHeaderRawCtx *ctx = pectx;
257  const MpmCtx *mpm_ctx = ctx->mpm_ctx;
258  SCLogDebug("running on list %d", ctx->list_id);
259 
260  const int list_id = ctx->list_id;
261 
262  InspectionBuffer *buffer = GetData(det_ctx, ctx->transforms, f,
263  flags, txv, list_id);
264  if (buffer == NULL)
265  return;
266 
267  const uint32_t data_len = buffer->inspect_len;
268  const uint8_t *data = buffer->inspect;
269 
270  SCLogDebug("mpm'ing buffer:");
271  //PrintRawDataFp(stdout, data, data_len);
272 
273  if (data != NULL && data_len >= mpm_ctx->minlen) {
274  (void)mpm_table[mpm_ctx->mpm_type].Search(
275  mpm_ctx, &det_ctx->mtc, &det_ctx->pmq, data, data_len);
276  PREFILTER_PROFILING_ADD_BYTES(det_ctx, data_len);
277  }
278 }
279 
280 static void PrefilterMpmHttpTrailerRaw(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p,
281  Flow *f, void *txv, const uint64_t idx, const AppLayerTxData *_txd, const uint8_t flags)
282 {
283  SCEnter();
284 
285  htp_tx_t *tx = txv;
286  const HtpTxUserData *htud = (const HtpTxUserData *)htp_tx_get_user_data(tx);
287  /* if the request wasn't flagged as having a trailer, we skip */
288  if (((flags & STREAM_TOSERVER) && !htud->request_has_trailers) ||
289  ((flags & STREAM_TOCLIENT) && !htud->response_has_trailers)) {
290  SCReturn;
291  }
292  PrefilterMpmHttpHeaderRaw(det_ctx, pectx, p, f, txv, idx, _txd, flags);
293  SCReturn;
294 }
295 
296 static void PrefilterMpmHttpHeaderRawFree(void *ptr)
297 {
298  SCFree(ptr);
299 }
300 
301 static int PrefilterMpmHttpHeaderRawRequestRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh,
302  MpmCtx *mpm_ctx, const DetectBufferMpmRegistry *mpm_reg, int list_id)
303 {
304  SCEnter();
305 
306  /* header */
307  PrefilterMpmHttpHeaderRawCtx *pectx = SCCalloc(1, sizeof(*pectx));
308  if (pectx == NULL)
309  return -1;
310  pectx->list_id = list_id;
311  pectx->mpm_ctx = mpm_ctx;
312  pectx->transforms = &mpm_reg->transforms;
313 
314  int r = PrefilterAppendTxEngine(de_ctx, sgh, PrefilterMpmHttpHeaderRaw, mpm_reg->app_v2.alproto,
315  HTP_REQUEST_PROGRESS_HEADERS + 1, pectx, PrefilterMpmHttpHeaderRawFree, mpm_reg->pname);
316  if (r != 0) {
317  SCFree(pectx);
318  return r;
319  }
320 
321  /* trailer */
322  pectx = SCCalloc(1, sizeof(*pectx));
323  if (pectx == NULL)
324  return -1;
325  pectx->list_id = list_id;
326  pectx->mpm_ctx = mpm_ctx;
327  pectx->transforms = &mpm_reg->transforms;
328 
329  r = PrefilterAppendTxEngine(de_ctx, sgh, PrefilterMpmHttpTrailerRaw, mpm_reg->app_v2.alproto,
330  HTP_REQUEST_PROGRESS_TRAILER + 1, pectx, PrefilterMpmHttpHeaderRawFree, mpm_reg->pname);
331  if (r != 0) {
332  SCFree(pectx);
333  }
334  return r;
335 }
336 
337 static int PrefilterMpmHttpHeaderRawResponseRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh,
338  MpmCtx *mpm_ctx, const DetectBufferMpmRegistry *mpm_reg, int list_id)
339 {
340  SCEnter();
341 
342  /* header */
343  PrefilterMpmHttpHeaderRawCtx *pectx = SCCalloc(1, sizeof(*pectx));
344  if (pectx == NULL)
345  return -1;
346  pectx->list_id = list_id;
347  pectx->mpm_ctx = mpm_ctx;
348  pectx->transforms = &mpm_reg->transforms;
349 
350  int r = PrefilterAppendTxEngine(de_ctx, sgh, PrefilterMpmHttpHeaderRaw, mpm_reg->app_v2.alproto,
351  HTP_RESPONSE_PROGRESS_HEADERS, pectx, PrefilterMpmHttpHeaderRawFree, mpm_reg->pname);
352  if (r != 0) {
353  SCFree(pectx);
354  return r;
355  }
356 
357  /* trailer */
358  pectx = SCCalloc(1, sizeof(*pectx));
359  if (pectx == NULL)
360  return -1;
361  pectx->list_id = list_id;
362  pectx->mpm_ctx = mpm_ctx;
363  pectx->transforms = &mpm_reg->transforms;
364 
365  r = PrefilterAppendTxEngine(de_ctx, sgh, PrefilterMpmHttpTrailerRaw, mpm_reg->app_v2.alproto,
366  HTP_RESPONSE_PROGRESS_TRAILER, pectx, PrefilterMpmHttpHeaderRawFree, mpm_reg->pname);
367  if (r != 0) {
368  SCFree(pectx);
369  }
370  return r;
371 }
372 
373 /************************************Unittests*********************************/
374 
375 #ifdef UNITTESTS
377 #endif
378 
379 /**
380  * @}
381  */
SigTableElmt_::url
const char * url
Definition: detect.h:1503
detect-content.h
MpmCtx_::mpm_type
uint8_t mpm_type
Definition: util-mpm.h:99
ts
uint64_t ts
Definition: source-erf-file.c:55
detect-engine.h
SIGMATCH_NOOPT
#define SIGMATCH_NOOPT
Definition: detect-engine-register.h:306
PrefilterMpmHttpHeaderRawCtx::list_id
int list_id
Definition: detect-http-raw-header.c:238
SigTableElmt_::desc
const char * desc
Definition: detect.h:1502
sigmatch_table
SigTableElmt * sigmatch_table
Definition: detect-parse.c:79
DetectEngineInspectBufferGeneric
uint8_t DetectEngineInspectBufferGeneric(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const 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:2049
flow-util.h
SCInspectionBufferGet
InspectionBuffer * SCInspectionBufferGet(DetectEngineThreadCtx *det_ctx, const int list_id)
Definition: detect-engine-inspect-buffer.c:56
HtpTxUserData_::request_headers_raw_len
uint32_t request_headers_raw_len
Definition: app-layer-htp.h:170
SigTableElmt_::name
const char * name
Definition: detect.h:1500
PrefilterMpmHttpHeaderRawCtx::transforms
const DetectEngineTransforms * transforms
Definition: detect-http-raw-header.c:240
DETECT_HTTP_RAW_HEADER
@ DETECT_HTTP_RAW_HEADER
Definition: detect-engine-register.h:177
SigGroupHead_
Container for matching data for a signature group.
Definition: detect.h:1670
DetectEngineTransforms
Definition: detect.h:391
SigTableElmt_::flags
uint32_t flags
Definition: detect.h:1491
SCLogDebug
#define SCLogDebug(...)
Definition: util-debug.h:282
DetectBufferMpmRegistry_::app_v2
struct DetectBufferMpmRegistry_::@90::@92 app_v2
InspectionBuffer
Definition: detect-engine-inspect-buffer.h:34
DetectHttpRawHeaderRegister
void DetectHttpRawHeaderRegister(void)
Registers the keyword handlers for the "http_raw_header" keyword.
Definition: detect-http-raw-header.c:82
DetectHttpRawHeaderRegisterTests
void DetectHttpRawHeaderRegisterTests(void)
Definition: detect-http-raw-header.c:2953
threads.h
Flow_
Flow data structure.
Definition: flow.h:347
DetectEngineThreadCtx_::pmq
PrefilterRuleStore pmq
Definition: detect.h:1390
ctx
struct Thresholds ctx
DetectEngineCtx_
main detection engine ctx
Definition: detect.h:966
DetectBufferTypeRegisterValidateCallback
void DetectBufferTypeRegisterValidateCallback(const char *name, bool(*ValidateCallback)(const Signature *, const char **sigerror, const DetectBufferType *))
Definition: detect-engine.c:1481
SCInspectionBufferSetupAndApplyTransforms
void SCInspectionBufferSetupAndApplyTransforms(DetectEngineThreadCtx *det_ctx, const int list_id, InspectionBuffer *buffer, const uint8_t *data, const uint32_t data_len, const DetectEngineTransforms *transforms)
setup the buffer with our initial data
Definition: detect-engine-inspect-buffer.c:197
DetectBufferMpmRegistry_
one time registration of keywords at start up
Definition: detect.h:767
PrefilterMpmHttpHeaderRawCtx::mpm_ctx
const MpmCtx * mpm_ctx
Definition: detect-http-raw-header.c:239
SCDetectBufferSetActiveList
int SCDetectBufferSetActiveList(DetectEngineCtx *de_ctx, Signature *s, const int list)
Definition: detect-engine-buffer.c:29
DetectBufferType_
Definition: detect.h:449
SCDetectSignatureSetAppProto
int SCDetectSignatureSetAppProto(Signature *s, AppProto alproto)
Definition: detect-parse.c:2277
SIG_FLAG_TOCLIENT
#define SIG_FLAG_TOCLIENT
Definition: detect.h:271
SigTableElmt_::Setup
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
Definition: detect.h:1482
detect-http-raw-header.c
Handle HTTP raw header match.
DetectBufferMpmRegistry_::transforms
DetectEngineTransforms transforms
Definition: detect.h:780
detect-engine-prefilter.h
DetectBufferTypeGetByName
int DetectBufferTypeGetByName(const char *name)
Definition: detect-engine.c:1278
SIG_FLAG_TOSERVER
#define SIG_FLAG_TOSERVER
Definition: detect.h:270
app-layer-htp.h
PrefilterMpmHttpHeaderRawCtx
struct PrefilterMpmHttpHeaderRawCtx PrefilterMpmHttpHeaderRawCtx
decode.h
DetectBufferMpmRegistry_::pname
char pname[DETECT_PROFILE_NAME_LEN]
Definition: detect.h:769
util-debug.h
AppLayerTxData
Definition: app-layer-parser.h:162
de_ctx
DetectEngineCtx * de_ctx
Definition: fuzz_siginit.c:19
DetectEngineThreadCtx_
Definition: detect.h:1284
PrefilterMpmHttpHeaderRawCtx
Definition: detect-http-raw-header.c:237
SCEnter
#define SCEnter(...)
Definition: util-debug.h:284
detect-engine-mpm.h
detect.h
HtpTxUserData_::response_has_trailers
uint8_t response_has_trailers
Definition: app-layer-htp.h:158
HtpTxUserData_::request_headers_raw
uint8_t * request_headers_raw
Definition: app-layer-htp.h:168
PrefilterGenericMpmRegister
int PrefilterGenericMpmRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistry *mpm_reg, int list_id)
Definition: detect-engine-prefilter.c:1580
SigTableElmt_::alternative
uint16_t alternative
Definition: detect.h:1498
DetectAppLayerMpmRegister
void DetectAppLayerMpmRegister(const char *name, int direction, int priority, PrefilterRegisterFunc PrefilterRegister, InspectionBufferGetDataPtr GetData, AppProto alproto, int tx_min_progress)
register an app layer keyword for mpm
Definition: detect-engine-mpm.c:152
app-layer-parser.h
MpmCtx_::minlen
uint16_t minlen
Definition: util-mpm.h:108
HtpTxUserData_::request_has_trailers
uint8_t request_has_trailers
Definition: app-layer-htp.h:157
util-profiling.h
SCReturn
#define SCReturn
Definition: util-debug.h:286
Signature_::flags
uint32_t flags
Definition: detect.h:673
SIGMATCH_INFO_CONTENT_MODIFIER
#define SIGMATCH_INFO_CONTENT_MODIFIER
Definition: detect-engine-register.h:326
DetectEngineContentModifierBufferSetup
int DetectEngineContentModifierBufferSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg, int sm_type, int sm_list, AppProto alproto)
Definition: detect-parse.c:146
Packet_
Definition: decode.h:505
ALPROTO_HTTP2
@ ALPROTO_HTTP2
Definition: app-layer-protos.h:69
MpmTableElmt_::Search
uint32_t(* Search)(const struct MpmCtx_ *, struct MpmThreadCtx_ *, PrefilterRuleStore *, const uint8_t *, uint32_t)
Definition: util-mpm.h:186
DetectEngineThreadCtx_::mtc
MpmThreadCtx mtc
Definition: detect.h:1386
DETECT_HTTP_RAW_HEADER_CM
@ DETECT_HTTP_RAW_HEADER_CM
Definition: detect-engine-register.h:176
PREFILTER_PROFILING_ADD_BYTES
#define PREFILTER_PROFILING_ADD_BYTES(det_ctx, bytes)
Definition: util-profiling.h:286
flags
uint8_t flags
Definition: decode-gre.h:0
suricata-common.h
HtpTxUserData_::response_headers_raw
uint8_t * response_headers_raw
Definition: app-layer-htp.h:169
ALPROTO_HTTP1
@ ALPROTO_HTTP1
Definition: app-layer-protos.h:36
detect-engine-buffer.h
PrefilterAppendTxEngine
int PrefilterAppendTxEngine(DetectEngineCtx *de_ctx, SigGroupHead *sgh, PrefilterTxFn PrefilterTxFunc, AppProto alproto, int tx_min_progress, void *pectx, void(*FreeFunc)(void *pectx), const char *name)
Definition: detect-engine-prefilter.c:355
HtpTxUserData_
Definition: app-layer-htp.h:152
detect-http-raw-header.h
InspectionBuffer::inspect_len
uint32_t inspect_len
Definition: detect-engine-inspect-buffer.h:37
InspectionBuffer::inspect
const uint8_t * inspect
Definition: detect-engine-inspect-buffer.h:35
str
#define str(s)
Definition: suricata-common.h:308
DetectThreadCtxGetGlobalKeywordThreadCtx
void * DetectThreadCtxGetGlobalKeywordThreadCtx(DetectEngineThreadCtx *det_ctx, int id)
Retrieve thread local keyword ctx by id.
Definition: detect-engine.c:3818
SCLogError
#define SCLogError(...)
Macro used to log ERROR messages.
Definition: util-debug.h:274
SCFree
#define SCFree(p)
Definition: util-mem.h:61
detect-parse.h
Signature_
Signature container.
Definition: detect.h:672
ALPROTO_HTTP
@ ALPROTO_HTTP
Definition: app-layer-protos.h:76
SIGMATCH_INFO_STICKY_BUFFER
#define SIGMATCH_INFO_STICKY_BUFFER
Definition: detect-engine-register.h:328
mpm_table
MpmTableElmt mpm_table[MPM_TABLE_SIZE]
Definition: util-mpm.c:47
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
MpmCtx_
Definition: util-mpm.h:97
HtpTxUserData_::response_headers_raw_len
uint32_t response_headers_raw_len
Definition: app-layer-htp.h:171
flow.h
SCCalloc
#define SCCalloc(nm, sz)
Definition: util-mem.h:53
SCReturnInt
#define SCReturnInt(x)
Definition: util-debug.h:288
flow-var.h
DetectRegisterThreadCtxGlobalFuncs
int DetectRegisterThreadCtxGlobalFuncs(const char *name, void *(*InitFunc)(void *), void *data, void(*FreeFunc)(void *))
Register Thread keyword context Funcs (Global)
Definition: detect-engine.c:3774
SigTableElmt_::RegisterTests
void(* RegisterTests)(void)
Definition: detect.h:1489
app-layer.h