Go to the documentation of this file.
96 static int g_http2_match_buffer_id = 0;
97 static int g_http2_complete_buffer_id = 0;
98 static int g_http2_header_name_buffer_id = 0;
184 HTTP2StateOpen, SCHttp2TxGetHeaderName, 2);
186 HTTP2StateOpen, SCHttp2TxGetHeaderName, 2);
190 "HTTP2 header name");
219 uint8_t *detect = (uint8_t *)
ctx;
221 return SCHttp2TxHasFrametype(txv,
flags, *detect);
224 static int DetectHTTP2FuncParseFrameType(
const char *
str, uint8_t *ft)
232 int r = SCHttp2ParseFrametype(
str);
233 if (r >= 0 && r <= UINT8_MAX) {
258 if (!DetectHTTP2FuncParseFrameType(
str, &frame_type)) {
259 SCLogError(
"Invalid argument \"%s\" supplied to http2.frametype keyword.",
str);
263 uint8_t *http2ft =
SCCalloc(1,
sizeof(uint8_t));
266 *http2ft = frame_type;
269 g_http2_match_buffer_id) == NULL) {
298 uint32_t *detect = (uint32_t *)
ctx;
300 return SCHttp2TxHasErrorCode(txv,
flags, *detect);
304 static int DetectHTTP2FuncParseErrorCode(
const char *
str, uint32_t *ec)
312 int r = SCHttp2ParseErrorCode(
str);
338 if (!DetectHTTP2FuncParseErrorCode(
str, &error_code)) {
339 SCLogError(
"Invalid argument \"%s\" supplied to http2.errorcode keyword.",
str);
343 uint32_t *http2ec =
SCCalloc(1,
sizeof(uint32_t));
346 *http2ec = error_code;
349 g_http2_match_buffer_id) == NULL) {
378 return SCHttp2PriorityMatch(txv,
flags,
ctx);
401 g_http2_match_buffer_id) == NULL) {
402 SCDetectU8Free(prio);
416 SCDetectU8ArrayFree(ptr);
430 return SCHttp2WindowMatch(txv,
flags,
ctx);
454 g_http2_complete_buffer_id) == NULL) {
469 SCDetectU32ArrayFree(ptr);
483 return SCHttp2DetectSizeUpdateCtxMatch(
ctx, txv,
flags);
501 void *su = SCDetectU64Parse(
str);
506 g_http2_match_buffer_id) == NULL) {
521 SCDetectU64Free(ptr);
535 return SCHttp2DetectSettingsCtxMatch(
ctx, txv,
flags);
553 void *http2set = SCHttp2DetectSettingsCtxParse(
str);
554 if (http2set == NULL)
558 g_http2_match_buffer_id) == NULL) {
573 SCHttp2DetectSettingsCtxFree(ptr);
#define SIGMATCH_INFO_STICKY_BUFFER
void DetectHTTP2priorityRegisterTests(void)
SigTableElmt * sigmatch_table
void(* Free)(DetectEngineCtx *, void *)
void DetectHTTP2RegisterTests(void)
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
int SCDetectBufferSetActiveList(DetectEngineCtx *de_ctx, Signature *s, const int list)
int SCDetectSignatureSetAppProto(Signature *s, AppProto alproto)
#define SIG_FLAG_TOCLIENT
int(* Setup)(DetectEngineCtx *, Signature *, const char *)
int DetectBufferTypeGetByName(const char *name)
#define SIGMATCH_INFO_UINT32
#define SIG_FLAG_TOSERVER
#define SIGMATCH_INFO_MULTI_UINT
SigMatch * SCSigMatchAppendSMToList(DetectEngineCtx *de_ctx, Signature *s, uint16_t type, SigMatchCtx *ctx, const int list)
Append a SigMatch to the list type.
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 DetectBufferTypeRegister(const char *name)
void DetectHTTP2windowFree(DetectEngineCtx *, void *)
this function will free memory associated with uint32_t
DetectUintData_u32 DetectU32Data
#define SIGMATCH_INFO_UINT64
void DetectHttp2Register(void)
Registration function for HTTP2 keywords.
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 SIGMATCH_INFO_MULTI_BUFFER
#define SCLogError(...)
Macro used to log ERROR messages.
void DetectHTTP2errorCodeRegisterTests(void)
#define SIGMATCH_INFO_UINT8
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 DetectHTTP2frameTypeRegisterTests(void)
this function registers unit tests for DetectHTTP2frameType
void DetectHTTP2errorcodeFree(DetectEngineCtx *, void *)
this function will free memory associated with uint32_t
void DetectAppLayerMultiRegister(const char *name, AppProto alproto, uint32_t dir, int progress, InspectionMultiBufferGetDataPtr GetData, int priority)
void DetectHTTP2frametypeFree(DetectEngineCtx *, void *)
this function will free memory associated with uint8_t
void(* RegisterTests)(void)