Go to the documentation of this file.
69 static int g_http_cookie_buffer_id = 0;
73 Flow *_f,
const uint8_t _flow_flags,
74 void *txv,
const int list_id);
77 Flow *_f,
const uint8_t _flow_flags,
78 void *txv,
const int list_id);
131 "http cookie header");
175 const uint8_t _flow_flags,
void *txv,
const int list_id)
179 htp_tx_t *tx = (htp_tx_t *)txv;
181 if (tx->request_headers == NULL)
184 htp_header_t *h = (htp_header_t *)htp_table_get_c(tx->request_headers,
186 if (h == NULL || h->value == NULL) {
187 SCLogDebug(
"HTTP cookie header not present in this request");
191 const uint32_t data_len = bstr_len(h->value);
192 const uint8_t *data = bstr_ptr(h->value);
203 const uint8_t _flow_flags,
void *txv,
const int list_id)
207 htp_tx_t *tx = (htp_tx_t *)txv;
209 if (tx->response_headers == NULL)
212 htp_header_t *h = (htp_header_t *)htp_table_get_c(tx->response_headers,
214 if (h == NULL || h->value == NULL) {
215 SCLogDebug(
"HTTP cookie header not present in this request");
219 const uint32_t data_len = bstr_len(h->value);
220 const uint8_t *data = bstr_ptr(h->value);
236 const uint8_t *b = NULL;
238 if (rs_http2_tx_get_cookie(txv, STREAM_TOSERVER, &b, &b_len) != 1)
240 if (b == NULL || b_len == 0)
257 const uint8_t *b = NULL;
259 if (rs_http2_tx_get_cookie(txv, STREAM_TOCLIENT, &b, &b_len) != 1)
261 if (b == NULL || b_len == 0)
int DetectSignatureSetAppProto(Signature *s, AppProto alproto)
#define SIGMATCH_INFO_STICKY_BUFFER
#define SIGMATCH_INFO_CONTENT_MODIFIER
int PrefilterGenericMpmRegister(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistery *mpm_reg, int list_id)
main detection engine ctx
#define SIG_FLAG_TOCLIENT
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
InspectionBuffer * InspectionBufferGet(DetectEngineThreadCtx *det_ctx, const int list_id)
void DetectHttpCookieRegister(void)
Registration function for keyword: http_cookie.
int DetectBufferTypeGetByName(const char *name)
#define SIG_FLAG_TOSERVER
int 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.
int DetectEngineContentModifierBufferSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg, int sm_type, int sm_list, AppProto alproto)
void DetectAppLayerInspectEngineRegister2(const char *name, AppProto alproto, uint32_t dir, int progress, InspectEngineFuncPtr2 Callback2, InspectionBufferGetDataPtr GetData)
register inspect engine at start up time
Handle HTTP cookie match.
void DetectAppLayerMpmRegister2(const char *name, int direction, int priority, int(*PrefilterRegister)(DetectEngineCtx *de_ctx, SigGroupHead *sgh, MpmCtx *mpm_ctx, const DetectBufferMpmRegistery *mpm_reg, int list_id), InspectionBufferGetDataPtr GetData, AppProto alproto, int tx_min_progress)
register a MPM engine
void InspectionBufferApplyTransforms(InspectionBuffer *buffer, const DetectEngineTransforms *transforms)
SigTableElmt sigmatch_table[DETECT_TBLSIZE]
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
int DetectBufferSetActiveList(Signature *s, const int list)
void DetectBufferTypeSetDescriptionByName(const char *name, const char *desc)
void(* RegisterTests)(void)
void DetectHttpCookieRegisterTests(void)
Register the UNITTESTS for the http_cookie keyword.