|
|
|
|
@ -152,7 +152,7 @@ static InspectionBuffer *GetBuffer2ForTX(DetectEngineThreadCtx *det_ctx,
|
|
|
|
|
uint32_t b_len = 0;
|
|
|
|
|
const uint8_t *b = NULL;
|
|
|
|
|
|
|
|
|
|
void *thread_buf = DetectThreadCtxGetGlobalKeywordThreadCtx(det_ctx, g_http2_thread_id);
|
|
|
|
|
void *thread_buf = SCDetectThreadCtxGetGlobalKeywordThreadCtx(det_ctx, g_http2_thread_id);
|
|
|
|
|
if (thread_buf == NULL)
|
|
|
|
|
return NULL;
|
|
|
|
|
if (SCHttp2TxGetHeaders(txv, flow_flags, &b, &b_len, thread_buf) != 1)
|
|
|
|
|
@ -413,9 +413,9 @@ void DetectHttpHeaderRegister(void)
|
|
|
|
|
|
|
|
|
|
g_http_header_buffer_id = DetectBufferTypeGetByName("http_header");
|
|
|
|
|
|
|
|
|
|
g_keyword_thread_id = DetectRegisterThreadCtxGlobalFuncs("http_header",
|
|
|
|
|
HttpHeaderThreadDataInit, &g_td_config, HttpHeaderThreadDataFree);
|
|
|
|
|
g_http2_thread_id = DetectRegisterThreadCtxGlobalFuncs(
|
|
|
|
|
g_keyword_thread_id = SCDetectRegisterThreadCtxGlobalFuncs(
|
|
|
|
|
"http_header", HttpHeaderThreadDataInit, &g_td_config, HttpHeaderThreadDataFree);
|
|
|
|
|
g_http2_thread_id = SCDetectRegisterThreadCtxGlobalFuncs(
|
|
|
|
|
"http2.header", SCDetectThreadBufDataInit, NULL, SCDetectThreadBufDataFree);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -472,7 +472,7 @@ static bool GetHttp2HeaderData(DetectEngineThreadCtx *det_ctx, const void *txv,
|
|
|
|
|
} else {
|
|
|
|
|
kw_thread_id = g_h2_response_header_thread_id;
|
|
|
|
|
}
|
|
|
|
|
void *hdr_td = DetectThreadCtxGetGlobalKeywordThreadCtx(det_ctx, kw_thread_id);
|
|
|
|
|
void *hdr_td = SCDetectThreadCtxGetGlobalKeywordThreadCtx(det_ctx, kw_thread_id);
|
|
|
|
|
if (unlikely(hdr_td == NULL)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
@ -491,7 +491,7 @@ static bool GetHttp1HeaderData(DetectEngineThreadCtx *det_ctx, const void *txv,
|
|
|
|
|
kw_thread_id = g_response_header_thread_id;
|
|
|
|
|
}
|
|
|
|
|
HttpMultiBufHeaderThreadData *hdr_td =
|
|
|
|
|
DetectThreadCtxGetGlobalKeywordThreadCtx(det_ctx, kw_thread_id);
|
|
|
|
|
SCDetectThreadCtxGetGlobalKeywordThreadCtx(det_ctx, kw_thread_id);
|
|
|
|
|
if (unlikely(hdr_td == NULL)) {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
@ -582,9 +582,9 @@ void DetectHttpRequestHeaderRegister(void)
|
|
|
|
|
DetectBufferTypeSetDescriptionByName("http_request_header", "HTTP header name and value");
|
|
|
|
|
g_http_request_header_buffer_id = DetectBufferTypeGetByName("http_request_header");
|
|
|
|
|
DetectBufferTypeSupportsMultiInstance("http_request_header");
|
|
|
|
|
g_request_header_thread_id = DetectRegisterThreadCtxGlobalFuncs("http_request_header",
|
|
|
|
|
g_request_header_thread_id = SCDetectRegisterThreadCtxGlobalFuncs("http_request_header",
|
|
|
|
|
HttpMultiBufHeaderThreadDataInit, NULL, HttpMultiBufHeaderThreadDataFree);
|
|
|
|
|
g_h2_request_header_thread_id = DetectRegisterThreadCtxGlobalFuncs("http2_request_header",
|
|
|
|
|
g_h2_request_header_thread_id = SCDetectRegisterThreadCtxGlobalFuncs("http2_request_header",
|
|
|
|
|
SCHttp2ThreadMultiBufDataInit, NULL, SCHttp2ThreadMultiBufDataFree);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -618,9 +618,9 @@ void DetectHttpResponseHeaderRegister(void)
|
|
|
|
|
DetectBufferTypeSetDescriptionByName("http_response_header", "HTTP header name and value");
|
|
|
|
|
g_http_response_header_buffer_id = DetectBufferTypeGetByName("http_response_header");
|
|
|
|
|
DetectBufferTypeSupportsMultiInstance("http_response_header");
|
|
|
|
|
g_response_header_thread_id = DetectRegisterThreadCtxGlobalFuncs("http_response_header",
|
|
|
|
|
g_response_header_thread_id = SCDetectRegisterThreadCtxGlobalFuncs("http_response_header",
|
|
|
|
|
HttpMultiBufHeaderThreadDataInit, NULL, HttpMultiBufHeaderThreadDataFree);
|
|
|
|
|
g_h2_response_header_thread_id = DetectRegisterThreadCtxGlobalFuncs("http2_response_header",
|
|
|
|
|
g_h2_response_header_thread_id = SCDetectRegisterThreadCtxGlobalFuncs("http2_response_header",
|
|
|
|
|
SCHttp2ThreadMultiBufDataInit, NULL, SCHttp2ThreadMultiBufDataFree);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|