Go to the documentation of this file.
95 static int g_http2_match_buffer_id = 0;
96 static int g_http2_header_name_buffer_id = 0;
104 int list_id, uint32_t local_id)
185 HTTP2StateOpen, GetHttp2HNameData, 2, HTTP2StateOpen);
187 HTTP2StateOpen, GetHttp2HNameData, 2, HTTP2StateOpen);
190 "HTTP2 header name");
212 uint8_t *detect = (uint8_t *)
ctx;
214 return rs_http2_tx_has_frametype(txv,
flags, *detect);
217 static int DetectHTTP2FuncParseFrameType(
const char *
str, uint8_t *ft)
225 int r = rs_http2_parse_frametype(
str);
226 if (r >= 0 && r <= UINT8_MAX) {
251 if (!DetectHTTP2FuncParseFrameType(
str, &frame_type)) {
252 SCLogError(
"Invalid argument \"%s\" supplied to http2.frametype keyword.",
str);
256 uint8_t *http2ft =
SCCalloc(1,
sizeof(uint8_t));
259 *http2ft = frame_type;
262 g_http2_match_buffer_id) == NULL) {
291 uint32_t *detect = (uint32_t *)
ctx;
293 return rs_http2_tx_has_errorcode(txv,
flags, *detect);
297 static int DetectHTTP2FuncParseErrorCode(
const char *
str, uint32_t *ec)
305 int r = rs_http2_parse_errorcode(
str);
331 if (!DetectHTTP2FuncParseErrorCode(
str, &error_code)) {
332 SCLogError(
"Invalid argument \"%s\" supplied to http2.errorcode keyword.",
str);
336 uint32_t *http2ec =
SCCalloc(1,
sizeof(uint32_t));
339 *http2ec = error_code;
342 g_http2_match_buffer_id) == NULL) {
372 int value = rs_http2_tx_get_next_priority(txv,
flags, nb);
379 value = rs_http2_tx_get_next_priority(txv,
flags, nb);
404 g_http2_match_buffer_id) == NULL) {
405 rs_detect_u8_free(prio);
419 rs_detect_u8_free(ptr);
434 int value = rs_http2_tx_get_next_window(txv,
flags, nb);
441 value = rs_http2_tx_get_next_window(txv,
flags, nb);
466 g_http2_match_buffer_id) == NULL) {
467 rs_detect_u32_free(wu);
481 rs_detect_u32_free(ptr);
495 return rs_http2_detect_sizeupdatectx_match(
ctx, txv,
flags);
513 void *su = rs_detect_u64_parse(
str);
518 g_http2_match_buffer_id) == NULL) {
533 rs_detect_u64_free(ptr);
547 return rs_http2_detect_settingsctx_match(
ctx, txv,
flags);
565 void *http2set = rs_http2_detect_settingsctx_parse(
str);
566 if (http2set == NULL)
570 g_http2_match_buffer_id) == NULL) {
585 rs_http2_detect_settingsctx_free(ptr);
int DetectSignatureSetAppProto(Signature *s, AppProto alproto)
#define SIGMATCH_INFO_STICKY_BUFFER
void DetectHTTP2priorityRegisterTests(void)
int DetectU32Match(const uint32_t parg, const DetectUintData_u32 *du32)
SigTableElmt * sigmatch_table
void(* Free)(DetectEngineCtx *, void *)
InspectionBuffer * DetectHelperGetMultiData(struct DetectEngineThreadCtx_ *det_ctx, const DetectEngineTransforms *transforms, Flow *f, const uint8_t flow_flags, void *txv, const int list_id, uint32_t index, MultiGetTxBuffer GetBuf)
void DetectHTTP2RegisterTests(void)
DetectUintData_u32 * DetectU32Parse(const char *u32str)
This function is used to parse u32 options passed via some u32 keyword.
int DetectBufferSetActiveList(DetectEngineCtx *de_ctx, Signature *s, const int list)
void DetectHTTP2priorityFree(DetectEngineCtx *, void *)
this function will free memory associated with uint32_t
main detection engine ctx
@ DETECT_HTTP2_SIZEUPDATE
void DetectBufferTypeSupportsMultiInstance(const char *name)
int(* AppLayerTxMatch)(DetectEngineThreadCtx *, Flow *, uint8_t flags, void *alstate, void *txv, const Signature *, const SigMatchCtx *)
int ByteExtractStringUint32(uint32_t *res, int base, size_t len, const char *str)
void DetectHTTP2sizeUpdateFree(DetectEngineCtx *, void *)
this function will free memory associated with uint32_t
@ DETECT_HTTP2_HEADERNAME
#define SIG_FLAG_TOCLIENT
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
int DetectBufferTypeGetByName(const char *name)
void DetectAppLayerMultiRegister(const char *name, AppProto alproto, uint32_t dir, int progress, InspectionMultiBufferGetDataPtr GetData, int priority, int tx_min_progress)
DetectUintData_u8 * DetectU8Parse(const char *u8str)
This function is used to parse u8 options passed via some u8 keyword.
#define SIG_FLAG_TOSERVER
bool(* MultiGetTxBuffer)(void *, uint8_t, uint32_t, const uint8_t **, uint32_t *)
void DetectHTTP2sizeUpdateRegisterTests(void)
void DetectHTTP2settingsFree(DetectEngineCtx *, void *)
this function will free memory associated with rust signature context
DetectUintData_u8 DetectU8Data
void DetectHTTP2settingsRegisterTests(void)
int(* Match)(DetectEngineThreadCtx *, Packet *, const Signature *, const SigMatchCtx *)
void DetectHTTP2windowRegisterTests(void)
Used to start a pointer to SigMatch context Should never be dereferenced without casting to something...
int ByteExtractStringUint8(uint8_t *res, int base, size_t len, const char *str)
int DetectU8Match(const uint8_t parg, const DetectUintData_u8 *du8)
int DetectBufferTypeRegister(const char *name)
void DetectHTTP2windowFree(DetectEngineCtx *, void *)
this function will free memory associated with uint32_t
DetectUintData_u32 DetectU32Data
void DetectHttp2Register(void)
uint8_t DetectEngineInspectGenericList(DetectEngineCtx *de_ctx, DetectEngineThreadCtx *det_ctx, const struct 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 SCLogError(...)
Macro used to log ERROR messages.
void DetectHTTP2errorCodeRegisterTests(void)
void DetectAppLayerInspectEngineRegister(const char *name, AppProto alproto, uint32_t dir, int progress, InspectEngineFuncPtr Callback, InspectionBufferGetDataPtr GetData)
Registers an app inspection engine.
SigMatch * SigMatchAppendSMToList(DetectEngineCtx *de_ctx, Signature *s, uint16_t type, SigMatchCtx *ctx, const int list)
Append a SigMatch to the list type.
void DetectBufferTypeSetDescriptionByName(const char *name, const char *desc)
void DetectHTTP2frameTypeRegisterTests(void)
this function registers unit tests for DetectHTTP2frameType
void DetectHTTP2errorcodeFree(DetectEngineCtx *, void *)
this function will free memory associated with uint32_t
void DetectHTTP2frametypeFree(DetectEngineCtx *, void *)
this function will free memory associated with uint8_t
void(* RegisterTests)(void)