32#include "htp/htp_rs.h"
44static int g_buffer_id = 0;
46#ifdef KEYWORD_TOSERVER
49 const uint8_t _flow_flags,
void *txv,
const int list_id)
55 htp_tx_t *tx = (htp_tx_t *)txv;
57 if (htp_tx_request_headers(tx) == NULL)
60 const htp_header_t *h = htp_tx_request_header(tx,
HEADER_NAME);
61 if (h == NULL || htp_header_value(h) == NULL) {
62 SCLogDebug(
"HTTP %s header not present in this request",
67 const uint32_t data_len = (uint32_t)htp_header_value_len(h);
68 const uint8_t *data = htp_header_value_ptr(h);
71 det_ctx, list_id, buffer, data, data_len, transforms);
86 const uint8_t *b = NULL;
88 if (SCHttp2TxGetHeaderValue(txv, STREAM_TOSERVER,
HEADER_NAME, &b, &b_len) != 1)
90 if (b == NULL || b_len == 0)
100#ifdef KEYWORD_TOCLIENT
103 const uint8_t _flow_flags,
void *txv,
const int list_id)
109 htp_tx_t *tx = (htp_tx_t *)txv;
111 if (htp_tx_response_headers(tx) == NULL)
114 const htp_header_t *h = htp_tx_response_header(tx,
HEADER_NAME);
115 if (h == NULL || htp_header_value(h) == NULL) {
116 SCLogDebug(
"HTTP %s header not present in this request",
121 const uint32_t data_len = (uint32_t)htp_header_value_len(h);
122 const uint8_t *data = htp_header_value_ptr(h);
125 det_ctx, list_id, buffer, data, data_len, transforms);
140 const uint8_t *b = NULL;
142 if (SCHttp2TxGetHeaderValue(txv, STREAM_TOCLIENT,
HEADER_NAME, &b, &b_len) != 1)
144 if (b == NULL || b_len == 0)
174static void DetectHttpHeadersRegisterStub(
void)
177#ifdef KEYWORD_NAME_LEGACY
183#if defined(KEYWORD_TOSERVER) && defined(KEYWORD_TOSERVER)
190#ifdef KEYWORD_TOSERVER
192 GetRequestData,
ALPROTO_HTTP1, HTP_REQUEST_PROGRESS_HEADERS);
196#ifdef KEYWORD_TOCLIENT
198 GetResponseData,
ALPROTO_HTTP1, HTP_RESPONSE_PROGRESS_HEADERS);
202#ifdef KEYWORD_TOSERVER
208#ifdef KEYWORD_TOCLIENT
int SCDetectBufferSetActiveList(DetectEngineCtx *de_ctx, Signature *s, const int list)
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
InspectionBuffer * InspectionBufferGet(DetectEngineThreadCtx *det_ctx, const int list_id)
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
int PrefilterGenericMpmRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistry *mpm_reg, int list_id)
void DetectBufferTypeSetDescriptionByName(const char *name, const char *desc)
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.
void DetectAppLayerInspectEngineRegister(const char *name, AppProto alproto, uint32_t dir, int progress, InspectEngineFuncPtr Callback, InspectionBufferGetDataPtr GetData)
Registers an app inspection engine.
int DetectBufferTypeGetByName(const char *name)
#define KEYWORD_NAME_LEGACY
int SCDetectSignatureSetAppProto(Signature *s, AppProto alproto)
SigTableElmt * sigmatch_table
#define SIGMATCH_SUPPORT_DIR
#define SIG_FLAG_TOCLIENT
#define SIGMATCH_INFO_STICKY_BUFFER
#define SIG_FLAG_TOSERVER
#define SIGMATCH_OPTIONAL_OPT
main detection engine ctx
int(* Setup)(DetectEngineCtx *, Signature *, const char *)