Go to the documentation of this file.
65 #define KEYWORD_NAME "http.start"
66 #define KEYWORD_NAME_LEGACY "http_start"
67 #define KEYWORD_DOC "http-keywords.html#http-start"
68 #define BUFFER_NAME "http_start"
69 #define BUFFER_DESC "http start: request/response line + headers"
70 static int g_buffer_id = 0;
71 static int g_keyword_thread_id = 0;
73 #define BUFFER_SIZE_STEP 2048
76 static uint8_t *GetBufferForTX(
88 const bstr *line = NULL;
90 if (
flags & STREAM_TOSERVER) {
103 if (line == NULL || headers == NULL)
106 size_t line_size = bstr_len(line) + 2;
107 if (line_size + buf->
len > buf->
size) {
112 memcpy(buf->
buffer + buf->
len, bstr_ptr(line), bstr_size(line));
113 buf->
len += bstr_size(line);
119 for (; i < no_of_headers; i++) {
123 size_t size = size1 + size2 + 4;
124 if (i + 1 == no_of_headers)
126 if (size + buf->
len > buf->
size) {
140 if (i + 1 == no_of_headers) {
146 *buffer_len = buf->
len;
156 uint32_t rawdata_len = 0;
157 uint8_t *rawdata = GetBufferForTX(txv, det_ctx, f, flow_flags, &rawdata_len);
158 if (rawdata_len == 0)
209 SCLogDebug(
"keyword %s registered. Thread id %d. "
210 "Buffer %s registered. Buffer id %d",
#define htp_header_value_len(h)
int DetectSignatureSetAppProto(Signature *s, AppProto alproto)
#define SIGMATCH_INFO_STICKY_BUFFER
SigTableElmt * sigmatch_table
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.
#define KEYWORD_NAME_LEGACY
void DetectHttpStartRegister(void)
Registers the keyword handlers for the "http_start" keyword.
#define HTP_RESPONSE_PROGRESS_HEADERS
#define htp_headers_get_index(headers, index)
int DetectBufferSetActiveList(DetectEngineCtx *de_ctx, Signature *s, const int list)
int AppLayerParserGetStateProgress(uint8_t ipproto, AppProto alproto, void *alstate, uint8_t flags)
get the progress value for a tx/protocol
main detection engine ctx
#define htp_tx_response_headers(tx)
#define SIG_FLAG_TOCLIENT
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
InspectionBuffer * InspectionBufferGet(DetectEngineThreadCtx *det_ctx, const int list_id)
#define htp_headers_size(headers)
int DetectBufferTypeGetByName(const char *name)
#define htp_tx_request_headers(tx)
#define SIG_FLAG_TOSERVER
int PrefilterGenericMpmRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistry *mpm_reg, 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
#define htp_header_value_ptr(h)
Data structures and function prototypes for keeping state for the detection engine.
#define htp_header_name_len(h)
void * HttpHeaderThreadDataInit(void *data)
void InspectionBufferApplyTransforms(InspectionBuffer *buffer, const DetectEngineTransforms *transforms)
#define HTP_REQUEST_PROGRESS_HEADERS
void InspectionBufferSetup(DetectEngineThreadCtx *det_ctx, const int list_id, InspectionBuffer *buffer, const uint8_t *data, const uint32_t data_len)
setup the buffer with our initial data
#define htp_tx_response_line(tx)
HttpHeaderBuffer * HttpHeaderGetBufferSpace(DetectEngineThreadCtx *det_ctx, Flow *f, uint8_t flags, const int keyword_id, HttpHeaderThreadData **ret_hdr_td)
int HttpHeaderExpandBuffer(HttpHeaderThreadData *td, HttpHeaderBuffer *buf, uint32_t size)
void DetectAppLayerInspectEngineRegister(const char *name, AppProto alproto, uint32_t dir, int progress, InspectEngineFuncPtr Callback, InspectionBufferGetDataPtr GetData)
Registers an app inspection engine.
void DetectBufferTypeSetDescriptionByName(const char *name, const char *desc)
#define htp_header_name_ptr(h)
#define htp_tx_request_line(tx)
void HttpHeaderThreadDataFree(void *data)
int DetectRegisterThreadCtxGlobalFuncs(const char *name, void *(*InitFunc)(void *), void *data, void(*FreeFunc)(void *))
Register Thread keyword context Funcs (Global)