http: htp_headers_t alias for htp_table_t

In preparation of libhtp rust
pull/12492/head
Philippe Antoine 2 years ago committed by Victor Julien
parent 439d3766d7
commit 72c08cb94e

@ -137,6 +137,7 @@
#define htp_headers_get_index(headers, index) htp_table_get_index(headers, index, NULL)
#define htp_tx_request_headers_size(tx) htp_table_size(tx->request_headers)
#define htp_tx_request_header_index(tx, i) htp_table_get_index(tx->request_headers, i, NULL);
#define htp_headers_t htp_table_t
bstr *SCHTPGenerateNormalizedUri(htp_tx_t *tx, htp_uri_t *uri, bool uri_include_all);

@ -86,7 +86,7 @@ static uint8_t *GetBufferForTX(
return NULL;
}
htp_table_t *headers;
const htp_headers_t *headers;
if (flags & STREAM_TOSERVER) {
if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP1, tx, flags) <=
HTP_REQUEST_PROGRESS_HEADERS)

@ -79,7 +79,7 @@ static uint8_t *GetBufferForTX(
return NULL;
}
htp_table_t *headers;
const htp_headers_t *headers;
if (flags & STREAM_TOSERVER) {
if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP1, tx, flags) <=
HTP_REQUEST_PROGRESS_HEADERS)
@ -552,7 +552,7 @@ static InspectionBuffer *GetHttp1HeaderData(DetectEngineThreadCtx *det_ctx,
}
htp_tx_t *tx = (htp_tx_t *)txv;
htp_table_t *headers;
const htp_headers_t *headers;
if (flags & STREAM_TOSERVER) {
headers = htp_tx_request_headers(tx);
} else {

@ -86,7 +86,7 @@ static uint8_t *GetBufferForTX(
}
const bstr *line = NULL;
htp_table_t *headers;
const htp_headers_t *headers;
if (flags & STREAM_TOSERVER) {
if (AppLayerParserGetStateProgress(IPPROTO_TCP, ALPROTO_HTTP1, tx, flags) <=
HTP_REQUEST_PROGRESS_HEADERS)

@ -314,8 +314,8 @@ static void EveHttpLogJSONExtended(JsonBuilder *js, htp_tx_t *tx)
static void EveHttpLogJSONHeaders(
JsonBuilder *js, uint32_t direction, htp_tx_t *tx, LogHttpFileCtx *http_ctx)
{
htp_table_t *headers = direction & LOG_HTTP_REQ_HEADERS ? htp_tx_request_headers(tx)
: htp_tx_response_headers(tx);
const htp_headers_t *headers = direction & LOG_HTTP_REQ_HEADERS ? htp_tx_request_headers(tx)
: htp_tx_response_headers(tx);
char name[MAX_SIZE_HEADER_NAME] = {0};
char value[MAX_SIZE_HEADER_VALUE] = {0};
size_t n = htp_headers_size(headers);

@ -154,7 +154,7 @@ static int HttpGetHeader(lua_State *luastate, int dir)
if (name == NULL)
return LuaCallbackError(luastate, "1st argument missing, empty or wrong type");
htp_table_t *headers = htp_tx_request_headers(tx);
const htp_headers_t *headers = htp_tx_request_headers(tx);
if (dir == 1)
headers = htp_tx_response_headers(tx);
if (headers == NULL)
@ -223,7 +223,7 @@ static int HttpGetHeaders(lua_State *luastate, int dir)
if (tx == NULL)
return LuaCallbackError(luastate, "internal error: no tx");
htp_table_t *table = htp_tx_request_headers(tx);
const htp_headers_t *table = htp_tx_request_headers(tx);
if (dir == 1)
table = htp_tx_response_headers(tx);
if (htp_tx_request_headers(tx) == NULL)

Loading…
Cancel
Save