Go to the documentation of this file.
64 static void DetectHttpUARegisterTests(
void);
66 static int g_http_ua_buffer_id = 0;
70 Flow *_f,
const uint8_t _flow_flags,
71 void *txv,
const int list_id);
158 const uint8_t _flow_flags,
void *txv,
const int list_id)
162 htp_tx_t *tx = (htp_tx_t *)txv;
164 if (tx->request_headers == NULL)
167 htp_header_t *h = (htp_header_t *)htp_table_get_c(tx->request_headers,
169 if (h == NULL || h->value == NULL) {
170 SCLogDebug(
"HTTP UA header not present in this request");
174 const uint32_t data_len = bstr_len(h->value);
175 const uint8_t *data = bstr_ptr(h->value);
193 const uint8_t *b = NULL;
195 if (rs_http2_tx_get_useragent(txv, &b, &b_len) != 1)
197 if (b == NULL || b_len == 0)
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 SIGMATCH_INFO_CONTENT_MODIFIER
int DetectBufferSetActiveList(DetectEngineCtx *de_ctx, Signature *s, const int list)
@ DETECT_AL_HTTP_USER_AGENT
main detection engine ctx
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
InspectionBuffer * InspectionBufferGet(DetectEngineThreadCtx *det_ctx, const int list_id)
int DetectBufferTypeGetByName(const char *name)
#define SIG_FLAG_TOSERVER
void DetectHttpUARegister(void)
Registers the keyword handlers for the "http_user_agent" keyword.
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
int DetectEngineContentModifierBufferSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg, int sm_type, int sm_list, AppProto alproto)
Data structures and function prototypes for keeping state for the detection engine.
void InspectionBufferApplyTransforms(InspectionBuffer *buffer, const DetectEngineTransforms *transforms)
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
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)
Handle HTTP user agent match.
void(* RegisterTests)(void)