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  HTTP2TxTypeStream, HTTP2ProgHeaders, DetectEngineInspectBufferGeneric, GetData2);
119  HTTP2TxTypeStream, HTTP2ProgHeaders, DetectEngineInspectBufferGeneric, GetData2);
120 
122  PrefilterGenericMpmRegister, GetData2, ALPROTO_HTTP2, HTTP2TxTypeStream,
123  HTTP2ProgHeaders);
125  PrefilterGenericMpmRegister, GetData2, ALPROTO_HTTP2, HTTP2TxTypeStream,
126  HTTP2ProgHeaders);
127 
128  DetectBufferTypeSetDescriptionByName("http_raw_header",
129  "raw http headers");
130 
132  DetectHttpRawHeaderValidateCallback);
133  g_http2_thread_id = SCDetectRegisterThreadCtxGlobalFuncs(
134  "http2.raw_header", SCDetectThreadBufDataInit, NULL, SCDetectThreadBufDataFree);
135 
136  g_http_raw_header_buffer_id = DetectBufferTypeGetByName("http_raw_header");
137 }
138 
139 /**
140  * \brief The setup function for the http_raw_header keyword for a signature.
141  *
142  * \param de_ctx Pointer to the detection engine context.
143  * \param s Pointer to signature for the current Signature being parsed
144  * from the rules.
145  * \param m Pointer to the head of the SigMatchs for the current rule
146  * being parsed.
147  * \param arg Pointer to the string holding the keyword value.
148  *
149  * \retval 0 On success.
150  * \retval -1 On failure.
151  */
152 int DetectHttpRawHeaderSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg)
153 {
155  de_ctx, s, arg, DETECT_HTTP_RAW_HEADER_CM, g_http_raw_header_buffer_id, ALPROTO_HTTP1);
156 }
157 
158 /**
159  * \brief this function setup the http.header.raw keyword used in the rule
160  *
161  * \param de_ctx Pointer to the Detection Engine Context
162  * \param s Pointer to the Signature to which the current keyword belongs
163  * \param str Should hold an empty string always
164  *
165  * \retval 0 On success
166  */
167 static int DetectHttpRawHeaderSetupSticky(DetectEngineCtx *de_ctx, Signature *s, const char *str)
168 {
169  if (SCDetectBufferSetActiveList(de_ctx, s, g_http_raw_header_buffer_id) < 0)
170  return -1;
172  return -1;
173  return 0;
174 }
175 
176 static bool DetectHttpRawHeaderValidateCallback(
177  const Signature *s, const char **sigerror, const DetectBufferType *dbt)
178 {
180  *sigerror = "http_raw_header signature "
181  "without a flow direction. Use flow:to_server for "
182  "inspecting request headers or flow:to_client for "
183  "inspecting response headers.";
184 
185  SCLogError("%s", *sigerror);
186  SCReturnInt(false);
187  }
188  return true;
189 }
190 
191 static InspectionBuffer *GetData(DetectEngineThreadCtx *det_ctx,
192  const DetectEngineTransforms *transforms, Flow *_f,
193  const uint8_t flow_flags, void *txv, const int list_id)
194 {
195  InspectionBuffer *buffer = SCInspectionBufferGet(det_ctx, list_id);
196  if (buffer->inspect == NULL) {
197  htp_tx_t *tx = (htp_tx_t *)txv;
198 
199  HtpTxUserData *tx_ud = htp_tx_get_user_data(tx);
200 
201  const bool ts = ((flow_flags & STREAM_TOSERVER) != 0);
202  const uint8_t *data = ts ?
204  if (data == NULL)
205  return NULL;
206  const uint32_t data_len = ts ?
208 
210  det_ctx, list_id, buffer, data, data_len, transforms);
211  }
212 
213  return buffer;
214 }
215 
216 static InspectionBuffer *GetData2(DetectEngineThreadCtx *det_ctx,
217  const DetectEngineTransforms *transforms, Flow *_f, const uint8_t flow_flags, void *txv,
218  const int list_id)
219 {
220  InspectionBuffer *buffer = SCInspectionBufferGet(det_ctx, list_id);
221  if (buffer->inspect == NULL) {
222  uint32_t b_len = 0;
223  const uint8_t *b = NULL;
224 
225  void *thread_buf = SCDetectThreadCtxGetGlobalKeywordThreadCtx(det_ctx, g_http2_thread_id);
226  if (thread_buf == NULL)
227  return NULL;
228  if (SCHttp2TxGetHeadersRaw(txv, flow_flags, &b, &b_len, thread_buf) != 1)
229  return NULL;
230  if (b == NULL || b_len == 0)
231  return NULL;
232 
233  SCInspectionBufferSetupAndApplyTransforms(det_ctx, list_id, buffer, b, b_len, transforms);
234  }
235 
236  return buffer;
237 }
238 
240  int list_id;
241  const MpmCtx *mpm_ctx;
244 
245 /** \brief Generic Mpm prefilter callback
246  *
247  * \param det_ctx detection engine thread ctx
248  * \param p packet to inspect
249  * \param f flow to inspect
250  * \param txv tx to inspect
251  * \param pectx inspection context
252  */
253 static void PrefilterMpmHttpHeaderRaw(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p,
254  Flow *f, void *txv, const uint64_t idx, const AppLayerTxData *_txd, const uint8_t flags)
255 {
256  SCEnter();
257 
258  const PrefilterMpmHttpHeaderRawCtx *ctx = pectx;
259  const MpmCtx *mpm_ctx = ctx->mpm_ctx;
260  SCLogDebug("running on list %d", ctx->list_id);
261 
262  const int list_id = ctx->list_id;
263 
264  InspectionBuffer *buffer = GetData(det_ctx, ctx->transforms, f,
265  flags, txv, list_id);
266  if (buffer == NULL)
267  return;
268 
269  const uint32_t data_len = buffer->inspect_len;
270  const uint8_t *data = buffer->inspect;
271 
272  SCLogDebug("mpm'ing buffer:");
273  //PrintRawDataFp(stdout, data, data_len);
274 
275  if (data != NULL && data_len >= mpm_ctx->minlen) {
276  (void)mpm_table[mpm_ctx->mpm_type].Search(
277  mpm_ctx, &det_ctx->mtc, &det_ctx->pmq, data, data_len);
278  PREFILTER_PROFILING_ADD_BYTES(det_ctx, data_len);
279  }
280 }
281 
282 static void PrefilterMpmHttpTrailerRaw(DetectEngineThreadCtx *det_ctx, const void *pectx, Packet *p,
283  Flow *f, void *txv, const uint64_t idx, const AppLayerTxData *_txd, const uint8_t flags)
284 {
285  SCEnter();
286 
287  htp_tx_t *tx = txv;
288  const HtpTxUserData *htud = (const HtpTxUserData *)htp_tx_get_user_data(tx);
289  /* if the request wasn't flagged as having a trailer, we skip */
290  if (((flags & STREAM_TOSERVER) && !htud->request_has_trailers) ||
291  ((flags & STREAM_TOCLIENT) && !htud->response_has_trailers)) {
292  SCReturn;
293  }
294  PrefilterMpmHttpHeaderRaw(det_ctx, pectx, p, f, txv, idx, _txd, flags);
295  SCReturn;
296 }
297 
298 static void PrefilterMpmHttpHeaderRawFree(void *ptr)
299 {
300  SCFree(ptr);
301 }
302 
303 static int PrefilterMpmHttpHeaderRawRequestRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh,
304  MpmCtx *mpm_ctx, const DetectBufferMpmRegistry *mpm_reg, int list_id)
305 {
306  SCEnter();
307 
308  /* header */
309  PrefilterMpmHttpHeaderRawCtx *pectx = SCCalloc(1, sizeof(*pectx));
310  if (pectx == NULL)
311  return -1;
312  pectx->list_id = list_id;
313  pectx->mpm_ctx = mpm_ctx;
314  pectx->transforms = &mpm_reg->transforms;
315 
316  int r = PrefilterAppendTxEngine(de_ctx, sgh, PrefilterMpmHttpHeaderRaw, mpm_reg->app_v2.alproto,
317  HTP_REQUEST_PROGRESS_HEADERS + 1, pectx, PrefilterMpmHttpHeaderRawFree, mpm_reg->pname);
318  if (r != 0) {
319  SCFree(pectx);
320  return r;
321  }
322 
323  /* trailer */
324  pectx = SCCalloc(1, sizeof(*pectx));
325  if (pectx == NULL)
326  return -1;
327  pectx->list_id = list_id;
328  pectx->mpm_ctx = mpm_ctx;
329  pectx->transforms = &mpm_reg->transforms;
330 
331  r = PrefilterAppendTxEngine(de_ctx, sgh, PrefilterMpmHttpTrailerRaw, mpm_reg->app_v2.alproto,
332  HTP_REQUEST_PROGRESS_TRAILER + 1, pectx, PrefilterMpmHttpHeaderRawFree, mpm_reg->pname);
333  if (r != 0) {
334  SCFree(pectx);
335  }
336  return r;
337 }
338 
339 static int PrefilterMpmHttpHeaderRawResponseRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh,
340  MpmCtx *mpm_ctx, const DetectBufferMpmRegistry *mpm_reg, int list_id)
341 {
342  SCEnter();
343 
344  /* header */
345  PrefilterMpmHttpHeaderRawCtx *pectx = SCCalloc(1, sizeof(*pectx));
346  if (pectx == NULL)
347  return -1;
348  pectx->list_id = list_id;
349  pectx->mpm_ctx = mpm_ctx;
350  pectx->transforms = &mpm_reg->transforms;
351 
352  int r = PrefilterAppendTxEngine(de_ctx, sgh, PrefilterMpmHttpHeaderRaw, mpm_reg->app_v2.alproto,
353  HTP_RESPONSE_PROGRESS_HEADERS, pectx, PrefilterMpmHttpHeaderRawFree, mpm_reg->pname);
354  if (r != 0) {
355  SCFree(pectx);
356  return r;
357  }
358 
359  /* trailer */
360  pectx = SCCalloc(1, sizeof(*pectx));
361  if (pectx == NULL)
362  return -1;
363  pectx->list_id = list_id;
364  pectx->mpm_ctx = mpm_ctx;
365  pectx->transforms = &mpm_reg->transforms;
366 
367  r = PrefilterAppendTxEngine(de_ctx, sgh, PrefilterMpmHttpTrailerRaw, mpm_reg->app_v2.alproto,
368  HTP_RESPONSE_PROGRESS_TRAILER, pectx, PrefilterMpmHttpHeaderRawFree, mpm_reg->pname);
369  if (r != 0) {
370  SCFree(pectx);
371  }
372  return r;
373 }
374 
375 /************************************Unittests*********************************/
376 
377 #ifdef UNITTESTS
379 #endif
380 
381 /**
382  * @}
383  */
SigTableElmt_::url
const char * url
Definition: detect.h:1521
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:240
SigTableElmt_::desc
const char * desc
Definition: detect.h:1520
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:2226
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:171
SigTableElmt_::name
const char * name
Definition: detect.h:1518
PrefilterMpmHttpHeaderRawCtx::transforms
const DetectEngineTransforms * transforms
Definition: detect-http-raw-header.c:242
DETECT_HTTP_RAW_HEADER
@ DETECT_HTTP_RAW_HEADER
Definition: detect-engine-register.h:182
SigGroupHead_
Container for matching data for a signature group.
Definition: detect.h:1693
DetectEngineTransforms
Definition: detect.h:391
SigTableElmt_::flags
uint32_t flags
Definition: detect.h:1509
SCLogDebug
#define SCLogDebug(...)
Definition: util-debug.h:282
SCDetectThreadCtxGetGlobalKeywordThreadCtx
void * SCDetectThreadCtxGetGlobalKeywordThreadCtx(DetectEngineThreadCtx *det_ctx, int id)
Retrieve thread local keyword ctx by id.
Definition: detect-engine.c:4057
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:354
DetectEngineThreadCtx_::pmq
PrefilterRuleStore pmq
Definition: detect.h:1408
ctx
struct Thresholds ctx
DetectEngineCtx_
main detection engine ctx
Definition: detect.h:981
DetectBufferTypeRegisterValidateCallback
void DetectBufferTypeRegisterValidateCallback(const char *name, bool(*ValidateCallback)(const Signature *, const char **sigerror, const DetectBufferType *))
Definition: detect-engine.c:1658
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:777
PrefilterMpmHttpHeaderRawCtx::mpm_ctx
const MpmCtx * mpm_ctx
Definition: detect-http-raw-header.c:241
SCDetectBufferSetActiveList
int SCDetectBufferSetActiveList(DetectEngineCtx *de_ctx, Signature *s, const int list)
Definition: detect-engine-buffer.c:29
DetectBufferType_
Definition: detect.h:450
p
Packet * p
Definition: fuzz_iprep.c:21
SCDetectSignatureSetAppProto
int SCDetectSignatureSetAppProto(Signature *s, AppProto alproto)
Definition: detect-parse.c:2461
SIG_FLAG_TOCLIENT
#define SIG_FLAG_TOCLIENT
Definition: detect.h:271
SigTableElmt_::Setup
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
Definition: detect.h:1500
detect-http-raw-header.c
Handle HTTP raw header match.
DetectBufferMpmRegistry_::transforms
DetectEngineTransforms transforms
Definition: detect.h:790
DetectAppLayerMpmRegisterSubState
void DetectAppLayerMpmRegisterSubState(const char *name, int direction, int priority, PrefilterRegisterFunc PrefilterRegister, InspectionBufferGetDataPtr GetData, AppProto alproto, uint8_t sub_state, uint8_t tx_min_progress)
Definition: detect-engine-mpm.c:167
detect-engine-prefilter.h
DetectAppLayerInspectEngineRegister
void DetectAppLayerInspectEngineRegister(const char *name, AppProto alproto, uint32_t dir, uint8_t progress, InspectEngineFuncPtr Callback, InspectionBufferGetDataPtr GetData)
Registers an app inspection engine.
Definition: detect-engine.c:276
DetectBufferTypeGetByName
int DetectBufferTypeGetByName(const char *name)
Definition: detect-engine.c:1455
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:779
util-debug.h
AppLayerTxData
Definition: app-layer-parser.h:166
de_ctx
DetectEngineCtx * de_ctx
Definition: fuzz_siginit.c:22
DetectEngineThreadCtx_
Definition: detect.h:1300
PrefilterMpmHttpHeaderRawCtx
Definition: detect-http-raw-header.c:239
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:159
HtpTxUserData_::request_headers_raw
uint8_t * request_headers_raw
Definition: app-layer-htp.h:169
PrefilterGenericMpmRegister
int PrefilterGenericMpmRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistry *mpm_reg, int list_id)
Definition: detect-engine-prefilter.c:1674
SigTableElmt_::alternative
uint16_t alternative
Definition: detect.h:1516
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:158
util-profiling.h
SCReturn
#define SCReturn
Definition: util-debug.h:286
Signature_::flags
uint32_t flags
Definition: detect.h:683
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:516
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:1404
DETECT_HTTP_RAW_HEADER_CM
@ DETECT_HTTP_RAW_HEADER_CM
Definition: detect-engine-register.h:181
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:170
ALPROTO_HTTP1
@ ALPROTO_HTTP1
Definition: app-layer-protos.h:36
DetectAppLayerMpmRegister
void DetectAppLayerMpmRegister(const char *name, int direction, int priority, PrefilterRegisterFunc PrefilterRegister, InspectionBufferGetDataPtr GetData, AppProto alproto, uint8_t tx_min_progress)
register an app layer keyword for mpm
Definition: detect-engine-mpm.c:159
detect-engine-buffer.h
HtpTxUserData_
Definition: app-layer-htp.h:153
DetectAppLayerInspectEngineRegisterSubState
void DetectAppLayerInspectEngineRegisterSubState(const char *name, AppProto alproto, uint32_t dir, uint8_t sub_state, uint8_t progress, InspectEngineFuncPtr Callback, InspectionBufferGetDataPtr GetData)
register an app inspection engine for a tx type
Definition: detect-engine.c:299
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:316
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:682
ALPROTO_HTTP
@ ALPROTO_HTTP
Definition: app-layer-protos.h:77
PrefilterAppendTxEngine
int PrefilterAppendTxEngine(DetectEngineCtx *de_ctx, SigGroupHead *sgh, PrefilterTxFn PrefilterTxFunc, AppProto alproto, const int8_t tx_min_progress, void *pectx, void(*FreeFunc)(void *pectx), const char *name)
Definition: detect-engine-prefilter.c:412
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
DetectBufferTypeSetDescriptionByName
void DetectBufferTypeSetDescriptionByName(const char *name, const char *desc)
Definition: detect-engine.c:1552
MpmCtx_
Definition: util-mpm.h:97
HtpTxUserData_::response_headers_raw_len
uint32_t response_headers_raw_len
Definition: app-layer-htp.h:172
flow.h
SCCalloc
#define SCCalloc(nm, sz)
Definition: util-mem.h:53
SCReturnInt
#define SCReturnInt(x)
Definition: util-debug.h:288
SCDetectRegisterThreadCtxGlobalFuncs
int SCDetectRegisterThreadCtxGlobalFuncs(const char *name, void *(*InitFunc)(void *), void *data, void(*FreeFunc)(void *))
Register Thread keyword context Funcs (Global)
Definition: detect-engine.c:4013
flow-var.h
SigTableElmt_::RegisterTests
void(* RegisterTests)(void)
Definition: detect.h:1507
app-layer.h