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";
89  "/rules/http-keywords.html#http-header-and-http-raw-header";
90  sigmatch_table[DETECT_HTTP_RAW_HEADER_CM].Setup = DetectHttpRawHeaderSetup;
91 #ifdef UNITTESTS
93 #endif
97 
98  /* http.header.raw sticky buffer */
99  sigmatch_table[DETECT_HTTP_RAW_HEADER].name = "http.header.raw";
100  sigmatch_table[DETECT_HTTP_RAW_HEADER].desc = "sticky buffer to match the raw HTTP header buffer";
101  sigmatch_table[DETECT_HTTP_RAW_HEADER].url = "/rules/http-keywords.html#http-header-and-http-raw-header";
102  sigmatch_table[DETECT_HTTP_RAW_HEADER].Setup = DetectHttpRawHeaderSetupSticky;
104 
106  HTP_REQUEST_PROGRESS_HEADERS + 1, DetectEngineInspectBufferGeneric, GetData);
108  HTP_RESPONSE_PROGRESS_HEADERS + 1, DetectEngineInspectBufferGeneric, GetData);
109 
110  DetectAppLayerMpmRegister("http_raw_header", SIG_FLAG_TOSERVER, 2,
111  PrefilterMpmHttpHeaderRawRequestRegister, NULL, ALPROTO_HTTP1,
112  0); /* progress handled in register */
113  DetectAppLayerMpmRegister("http_raw_header", SIG_FLAG_TOCLIENT, 2,
114  PrefilterMpmHttpHeaderRawResponseRegister, NULL, ALPROTO_HTTP1,
115  0); /* progress handled in register */
116 
118  HTTP2StateDataClient, DetectEngineInspectBufferGeneric, GetData2);
120  HTTP2StateDataServer, DetectEngineInspectBufferGeneric, GetData2);
121 
123  GetData2, ALPROTO_HTTP2, HTTP2StateDataClient);
125  GetData2, ALPROTO_HTTP2, HTTP2StateDataServer);
126 
127  DetectBufferTypeSetDescriptionByName("http_raw_header",
128  "raw http headers");
129 
131  DetectHttpRawHeaderValidateCallback);
132  g_http2_thread_id = DetectRegisterThreadCtxGlobalFuncs(
133  "http2.raw_header", SCHttp2ThreadBufDataInit, NULL, SCHttp2ThreadBufDataFree);
134 
135  g_http_raw_header_buffer_id = DetectBufferTypeGetByName("http_raw_header");
136 }
137 
138 /**
139  * \brief The setup function for the http_raw_header keyword for a signature.
140  *
141  * \param de_ctx Pointer to the detection engine context.
142  * \param s Pointer to signature for the current Signature being parsed
143  * from the rules.
144  * \param m Pointer to the head of the SigMatchs for the current rule
145  * being parsed.
146  * \param arg Pointer to the string holding the keyword value.
147  *
148  * \retval 0 On success.
149  * \retval -1 On failure.
150  */
151 int DetectHttpRawHeaderSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg)
152 {
154  de_ctx, s, arg, DETECT_HTTP_RAW_HEADER_CM, g_http_raw_header_buffer_id, ALPROTO_HTTP1);
155 }
156 
157 /**
158  * \brief this function setup the http.header.raw keyword used in the rule
159  *
160  * \param de_ctx Pointer to the Detection Engine Context
161  * \param s Pointer to the Signature to which the current keyword belongs
162  * \param str Should hold an empty string always
163  *
164  * \retval 0 On success
165  */
166 static int DetectHttpRawHeaderSetupSticky(DetectEngineCtx *de_ctx, Signature *s, const char *str)
167 {
168  if (SCDetectBufferSetActiveList(de_ctx, s, g_http_raw_header_buffer_id) < 0)
169  return -1;
171  return -1;
172  return 0;
173 }
174 
175 static bool DetectHttpRawHeaderValidateCallback(
176  const Signature *s, const char **sigerror, const DetectBufferType *dbt)
177 {
179  *sigerror = "http_raw_header signature "
180  "without a flow direction. Use flow:to_server for "
181  "inspecting request headers or flow:to_client for "
182  "inspecting response headers.";
183 
184  SCLogError("%s", *sigerror);
185  SCReturnInt(false);
186  }
187  return true;
188 }
189 
190 static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
191  const DetectEngineTransforms *transforms, Flow *_f,
192  const uint8_t flow_flags, void *txv, const int list_id)
193 {
194  InspectionBuffer *buffer = InspectionBufferGet(det_ctx, list_id);
195  if (buffer->inspect == NULL) {
196  htp_tx_t *tx = (htp_tx_t *)txv;
197 
198  HtpTxUserData *tx_ud = htp_tx_get_user_data(tx);
199 
200  const bool ts = ((flow_flags & STREAM_TOSERVER) != 0);
201  const uint8_t *data = ts ?
203  if (data == NULL)
204  return NULL;
205  const uint32_t data_len = ts ?
207 
209  det_ctx, list_id, buffer, data, data_len, transforms);
210  }
211 
212  return buffer;
213 }
214 
215 static InspectionBuffer *GetData2(DetectEngineThreadCtx *det_ctx,
216  const DetectEngineTransforms *transforms, Flow *_f, const uint8_t flow_flags, void *txv,
217  const int list_id)
218 {
219  InspectionBuffer *buffer = InspectionBufferGet(det_ctx, list_id);
220  if (buffer->inspect == NULL) {
221  uint32_t b_len = 0;
222  const uint8_t *b = NULL;
223 
224  void *thread_buf = DetectThreadCtxGetGlobalKeywordThreadCtx(det_ctx, g_http2_thread_id);
225  if (thread_buf == NULL)
226  return NULL;
227  if (SCHttp2TxGetHeadersRaw(txv, flow_flags, &b, &b_len, thread_buf) != 1)
228  return NULL;
229  if (b == NULL || b_len == 0)
230  return NULL;
231 
232  InspectionBufferSetupAndApplyTransforms(det_ctx, list_id, buffer, b, b_len, transforms);
233  }
234 
235  return buffer;
236 }
237 
239  int list_id;
240  const MpmCtx *mpm_ctx;
243 
244 /** \brief Generic Mpm prefilter callback
245  *
246  * \param det_ctx detection engine thread ctx
247  * \param p packet to inspect
248  * \param f flow to inspect
249  * \param txv tx to inspect
250  * \param pectx inspection context
251  */
252 static void PrefilterMpmHttpHeaderRaw(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p,
253  Flow *f, void *txv, const uint64_t idx, const AppLayerTxData *_txd, const uint8_t flags)
254 {
255  SCEnter();
256 
257  const PrefilterMpmHttpHeaderRawCtx *ctx = pectx;
258  const MpmCtx *mpm_ctx = ctx->mpm_ctx;
259  SCLogDebug("running on list %d", ctx->list_id);
260 
261  const int list_id = ctx->list_id;
262 
263  InspectionBuffer *buffer = GetData(det_ctx, ctx->transforms, f,
264  flags, txv, list_id);
265  if (buffer == NULL)
266  return;
267 
268  const uint32_t data_len = buffer->inspect_len;
269  const uint8_t *data = buffer->inspect;
270 
271  SCLogDebug("mpm'ing buffer:");
272  //PrintRawDataFp(stdout, data, data_len);
273 
274  if (data != NULL && data_len >= mpm_ctx->minlen) {
275  (void)mpm_table[mpm_ctx->mpm_type].Search(
276  mpm_ctx, &det_ctx->mtc, &det_ctx->pmq, data, data_len);
277  PREFILTER_PROFILING_ADD_BYTES(det_ctx, data_len);
278  }
279 }
280 
281 static void PrefilterMpmHttpTrailerRaw(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p,
282  Flow *f, void *txv, const uint64_t idx, const AppLayerTxData *_txd, const uint8_t flags)
283 {
284  SCEnter();
285 
286  htp_tx_t *tx = txv;
287  const HtpTxUserData *htud = (const HtpTxUserData *)htp_tx_get_user_data(tx);
288  /* if the request wasn't flagged as having a trailer, we skip */
289  if (((flags & STREAM_TOSERVER) && !htud->request_has_trailers) ||
290  ((flags & STREAM_TOCLIENT) && !htud->response_has_trailers)) {
291  SCReturn;
292  }
293  PrefilterMpmHttpHeaderRaw(det_ctx, pectx, p, f, txv, idx, _txd, flags);
294  SCReturn;
295 }
296 
297 static void PrefilterMpmHttpHeaderRawFree(void *ptr)
298 {
299  SCFree(ptr);
300 }
301 
302 static int PrefilterMpmHttpHeaderRawRequestRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh,
303  MpmCtx *mpm_ctx, const DetectBufferMpmRegistry *mpm_reg, int list_id)
304 {
305  SCEnter();
306 
307  /* header */
308  PrefilterMpmHttpHeaderRawCtx *pectx = SCCalloc(1, sizeof(*pectx));
309  if (pectx == NULL)
310  return -1;
311  pectx->list_id = list_id;
312  pectx->mpm_ctx = mpm_ctx;
313  pectx->transforms = &mpm_reg->transforms;
314 
315  int r = PrefilterAppendTxEngine(de_ctx, sgh, PrefilterMpmHttpHeaderRaw, mpm_reg->app_v2.alproto,
316  HTP_REQUEST_PROGRESS_HEADERS + 1, pectx, PrefilterMpmHttpHeaderRawFree, mpm_reg->pname);
317  if (r != 0) {
318  SCFree(pectx);
319  return r;
320  }
321 
322  /* trailer */
323  pectx = SCCalloc(1, sizeof(*pectx));
324  if (pectx == NULL)
325  return -1;
326  pectx->list_id = list_id;
327  pectx->mpm_ctx = mpm_ctx;
328  pectx->transforms = &mpm_reg->transforms;
329 
330  r = PrefilterAppendTxEngine(de_ctx, sgh, PrefilterMpmHttpTrailerRaw, mpm_reg->app_v2.alproto,
331  HTP_REQUEST_PROGRESS_TRAILER + 1, pectx, PrefilterMpmHttpHeaderRawFree, mpm_reg->pname);
332  if (r != 0) {
333  SCFree(pectx);
334  }
335  return r;
336 }
337 
338 static int PrefilterMpmHttpHeaderRawResponseRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh,
339  MpmCtx *mpm_ctx, const DetectBufferMpmRegistry *mpm_reg, int list_id)
340 {
341  SCEnter();
342 
343  /* header */
344  PrefilterMpmHttpHeaderRawCtx *pectx = SCCalloc(1, sizeof(*pectx));
345  if (pectx == NULL)
346  return -1;
347  pectx->list_id = list_id;
348  pectx->mpm_ctx = mpm_ctx;
349  pectx->transforms = &mpm_reg->transforms;
350 
351  int r = PrefilterAppendTxEngine(de_ctx, sgh, PrefilterMpmHttpHeaderRaw, mpm_reg->app_v2.alproto,
352  HTP_RESPONSE_PROGRESS_HEADERS, pectx, PrefilterMpmHttpHeaderRawFree, mpm_reg->pname);
353  if (r != 0) {
354  SCFree(pectx);
355  return r;
356  }
357 
358  /* trailer */
359  pectx = SCCalloc(1, sizeof(*pectx));
360  if (pectx == NULL)
361  return -1;
362  pectx->list_id = list_id;
363  pectx->mpm_ctx = mpm_ctx;
364  pectx->transforms = &mpm_reg->transforms;
365 
366  r = PrefilterAppendTxEngine(de_ctx, sgh, PrefilterMpmHttpTrailerRaw, mpm_reg->app_v2.alproto,
367  HTP_RESPONSE_PROGRESS_TRAILER, pectx, PrefilterMpmHttpHeaderRawFree, mpm_reg->pname);
368  if (r != 0) {
369  SCFree(pectx);
370  }
371  return r;
372 }
373 
374 /************************************Unittests*********************************/
375 
376 #ifdef UNITTESTS
378 #endif
379 
380 /**
381  * @}
382  */
SigTableElmt_::url
const char * url
Definition: detect.h:1464
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_INFO_STICKY_BUFFER
#define SIGMATCH_INFO_STICKY_BUFFER
Definition: detect.h:1678
PrefilterMpmHttpHeaderRawCtx::list_id
int list_id
Definition: detect-http-raw-header.c:239
SigTableElmt_::desc
const char * desc
Definition: detect.h:1463
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
SIGMATCH_INFO_CONTENT_MODIFIER
#define SIGMATCH_INFO_CONTENT_MODIFIER
Definition: detect.h:1676
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:1461
PrefilterMpmHttpHeaderRawCtx::transforms
const DetectEngineTransforms * transforms
Definition: detect-http-raw-header.c:241
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:1631
DetectEngineTransforms
Definition: detect.h:390
SigTableElmt_::flags
uint32_t flags
Definition: detect.h:1452
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:1351
ctx
struct Thresholds ctx
DetectEngineCtx_
main detection engine ctx
Definition: detect.h:933
DetectBufferTypeRegisterValidateCallback
void DetectBufferTypeRegisterValidateCallback(const char *name, bool(*ValidateCallback)(const Signature *, const char **sigerror, const DetectBufferType *))
Definition: detect-engine.c:1481
DetectBufferMpmRegistry_
one time registration of keywords at start up
Definition: detect.h:763
PrefilterMpmHttpHeaderRawCtx::mpm_ctx
const MpmCtx * mpm_ctx
Definition: detect-http-raw-header.c:240
SCDetectBufferSetActiveList
int SCDetectBufferSetActiveList(DetectEngineCtx *de_ctx, Signature *s, const int list)
Definition: detect-engine-buffer.c:29
DetectBufferType_
Definition: detect.h:448
SCDetectSignatureSetAppProto
int SCDetectSignatureSetAppProto(Signature *s, AppProto alproto)
Definition: detect-parse.c:2236
SIG_FLAG_TOCLIENT
#define SIG_FLAG_TOCLIENT
Definition: detect.h:271
InspectionBufferGet
InspectionBuffer * InspectionBufferGet(DetectEngineThreadCtx *det_ctx, const int list_id)
Definition: detect-engine-inspect-buffer.c:56
SigTableElmt_::Setup
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
Definition: detect.h:1443
detect-http-raw-header.c
Handle HTTP raw header match.
DetectBufferMpmRegistry_::transforms
DetectEngineTransforms transforms
Definition: detect.h:776
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:765
util-debug.h
AppLayerTxData
Definition: app-layer-parser.h:177
de_ctx
DetectEngineCtx * de_ctx
Definition: fuzz_siginit.c:19
DetectEngineThreadCtx_
Definition: detect.h:1245
PrefilterMpmHttpHeaderRawCtx
Definition: detect-http-raw-header.c:238
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:1577
SigTableElmt_::alternative
uint16_t alternative
Definition: detect.h:1459
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:669
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:1347
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:352
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:3849
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:668
ALPROTO_HTTP
@ ALPROTO_HTTP
Definition: app-layer-protos.h:76
InspectionBufferSetupAndApplyTransforms
void InspectionBufferSetupAndApplyTransforms(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
mpm_table
MpmTableElmt mpm_table[MPM_TABLE_SIZE]
Definition: util-mpm.c:47
SIGMATCH_NOOPT
#define SIGMATCH_NOOPT
Definition: detect.h:1653
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:3805
SigTableElmt_::RegisterTests
void(* RegisterTests)(void)
Definition: detect.h:1450
app-layer.h