|
|
|
|
@ -672,10 +672,9 @@ static void PrefilterMpmHttp2HNameFree(void *ptr)
|
|
|
|
|
SCFree(ptr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static InspectionBuffer *GetHttp2HNameData(DetectEngineThreadCtx *det_ctx,
|
|
|
|
|
const uint8_t flags, const DetectEngineTransforms *transforms,
|
|
|
|
|
Flow *_f, const struct MpmListIdDataArgs *cbdata,
|
|
|
|
|
int list_id, bool first)
|
|
|
|
|
static InspectionBuffer *GetHttp2HNameData(DetectEngineThreadCtx *det_ctx, const uint8_t flags,
|
|
|
|
|
const DetectEngineTransforms *transforms, Flow *_f, const struct MpmListIdDataArgs *cbdata,
|
|
|
|
|
int list_id)
|
|
|
|
|
{
|
|
|
|
|
SCEnter();
|
|
|
|
|
|
|
|
|
|
@ -683,7 +682,7 @@ static InspectionBuffer *GetHttp2HNameData(DetectEngineThreadCtx *det_ctx,
|
|
|
|
|
InspectionBufferMultipleForListGet(det_ctx, list_id, cbdata->local_id);
|
|
|
|
|
if (buffer == NULL)
|
|
|
|
|
return NULL;
|
|
|
|
|
if (!first && buffer->inspect != NULL)
|
|
|
|
|
if (buffer->initialized)
|
|
|
|
|
return buffer;
|
|
|
|
|
|
|
|
|
|
uint32_t b_len = 0;
|
|
|
|
|
@ -715,8 +714,8 @@ static void PrefilterTxHttp2HName(DetectEngineThreadCtx *det_ctx, const void *pe
|
|
|
|
|
// loop until we get a NULL
|
|
|
|
|
|
|
|
|
|
struct MpmListIdDataArgs cbdata = { local_id, txv };
|
|
|
|
|
InspectionBuffer *buffer = GetHttp2HNameData(det_ctx, flags, ctx->transforms,
|
|
|
|
|
f, &cbdata, list_id, true);
|
|
|
|
|
InspectionBuffer *buffer =
|
|
|
|
|
GetHttp2HNameData(det_ctx, flags, ctx->transforms, f, &cbdata, list_id);
|
|
|
|
|
if (buffer == NULL)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
@ -762,8 +761,8 @@ static uint8_t DetectEngineInspectHttp2HeaderName(DetectEngineCtx *de_ctx,
|
|
|
|
|
while (1) {
|
|
|
|
|
//TODOask use MpmListIdDataArgs elsewhere
|
|
|
|
|
struct MpmListIdDataArgs cbdata = { local_id, txv, };
|
|
|
|
|
InspectionBuffer *buffer = GetHttp2HNameData(det_ctx, flags,
|
|
|
|
|
transforms, f, &cbdata, engine->sm_list, false);
|
|
|
|
|
InspectionBuffer *buffer =
|
|
|
|
|
GetHttp2HNameData(det_ctx, flags, transforms, f, &cbdata, engine->sm_list);
|
|
|
|
|
|
|
|
|
|
if (buffer == NULL || buffer->inspect == NULL)
|
|
|
|
|
break;
|
|
|
|
|
@ -803,10 +802,9 @@ static void PrefilterMpmHttp2HeaderFree(void *ptr)
|
|
|
|
|
SCFree(ptr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static InspectionBuffer *GetHttp2HeaderData(DetectEngineThreadCtx *det_ctx,
|
|
|
|
|
const uint8_t flags, const DetectEngineTransforms *transforms,
|
|
|
|
|
Flow *_f, const struct MpmListIdDataArgs *cbdata,
|
|
|
|
|
int list_id, bool first)
|
|
|
|
|
static InspectionBuffer *GetHttp2HeaderData(DetectEngineThreadCtx *det_ctx, const uint8_t flags,
|
|
|
|
|
const DetectEngineTransforms *transforms, Flow *_f, const struct MpmListIdDataArgs *cbdata,
|
|
|
|
|
int list_id)
|
|
|
|
|
{
|
|
|
|
|
SCEnter();
|
|
|
|
|
|
|
|
|
|
@ -814,7 +812,7 @@ static InspectionBuffer *GetHttp2HeaderData(DetectEngineThreadCtx *det_ctx,
|
|
|
|
|
InspectionBufferMultipleForListGet(det_ctx, list_id, cbdata->local_id);
|
|
|
|
|
if (buffer == NULL)
|
|
|
|
|
return NULL;
|
|
|
|
|
if (!first && buffer->inspect != NULL)
|
|
|
|
|
if (buffer->initialized)
|
|
|
|
|
return buffer;
|
|
|
|
|
|
|
|
|
|
uint32_t b_len = 0;
|
|
|
|
|
@ -845,8 +843,8 @@ static void PrefilterTxHttp2Header(DetectEngineThreadCtx *det_ctx, const void *p
|
|
|
|
|
// loop until we get a NULL
|
|
|
|
|
|
|
|
|
|
struct MpmListIdDataArgs cbdata = { local_id, txv };
|
|
|
|
|
InspectionBuffer *buffer = GetHttp2HeaderData(det_ctx, flags, ctx->transforms,
|
|
|
|
|
f, &cbdata, list_id, true);
|
|
|
|
|
InspectionBuffer *buffer =
|
|
|
|
|
GetHttp2HeaderData(det_ctx, flags, ctx->transforms, f, &cbdata, list_id);
|
|
|
|
|
if (buffer == NULL)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
@ -890,8 +888,8 @@ static uint8_t DetectEngineInspectHttp2Header(DetectEngineCtx *de_ctx,
|
|
|
|
|
|
|
|
|
|
while (1) {
|
|
|
|
|
struct MpmListIdDataArgs cbdata = { local_id, txv, };
|
|
|
|
|
InspectionBuffer *buffer = GetHttp2HeaderData(det_ctx, flags,
|
|
|
|
|
transforms, f, &cbdata, engine->sm_list, false);
|
|
|
|
|
InspectionBuffer *buffer =
|
|
|
|
|
GetHttp2HeaderData(det_ctx, flags, transforms, f, &cbdata, engine->sm_list);
|
|
|
|
|
|
|
|
|
|
if (buffer == NULL || buffer->inspect == NULL)
|
|
|
|
|
break;
|
|
|
|
|
|