Go to the documentation of this file.
61 static int g_http_method_buffer_id = 0;
68 static bool DetectHttpMethodValidateCallback(
const Signature *s,
const char **sigerror);
71 const uint8_t _flow_flags,
void *txv,
const int list_id);
113 "http request method");
116 DetectHttpMethodValidateCallback);
120 SCLogDebug(
"registering http_method rule option");
164 static bool DetectHttpMethodValidateCallback(
const Signature *s,
const char **sigerror)
170 for (; sm != NULL; sm = sm->
next) {
176 *sigerror =
"http_method pattern with trailing space";
179 }
else if (cd->
content[0] == 0x20) {
180 *sigerror =
"http_method pattern with leading space";
184 *sigerror =
"http_method pattern with trailing tab";
187 }
else if (cd->
content[0] == 0x09) {
188 *sigerror =
"http_method pattern with leading tab";
200 const uint8_t _flow_flags,
void *txv,
const int list_id)
204 htp_tx_t *tx = (htp_tx_t *)txv;
206 if (tx->request_method == NULL)
209 const uint32_t data_len = bstr_len(tx->request_method);
210 const uint8_t *data = bstr_ptr(tx->request_method);
226 const uint8_t *b = NULL;
228 if (rs_http2_tx_get_method(txv, &b, &b_len) != 1)
230 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)
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 DetectBufferTypeRegisterValidateCallback(const char *name, bool(*ValidateCallback)(const Signature *, const char **sigerror))
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
void DetectHttpMethodRegisterTests(void)
this function registers unit tests for DetectHttpMethod
int DetectEngineContentModifierBufferSetup(DetectEngineCtx *de_ctx, Signature *s, const char *arg, int sm_type, int sm_list, AppProto alproto)
SignatureInitData * init_data
int(* Match)(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *)
void DetectHttpMethodFree(void *)
void InspectionBufferApplyTransforms(InspectionBuffer *buffer, const DetectEngineTransforms *transforms)
SignatureInitDataBuffer * buffers
#define SCLogError(...)
Macro used to log ERROR messages.
Handle HTTP method match.
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
a single match condition for a signature
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)
void DetectHttpMethodRegister(void)
Registration function for keyword: http_method.
void(* RegisterTests)(void)