32 #include "htp/htp_rs.h"
44 static int g_buffer_id = 0;
46 #ifdef KEYWORD_TOSERVER
49 const uint8_t _flow_flags,
void *txv,
const int list_id)
55 htp_tx_t *tx = (htp_tx_t *)txv;
57 if (htp_tx_request_headers(tx) == NULL)
60 const htp_header_t *h = htp_tx_request_header(tx,
HEADER_NAME);
61 if (h == NULL || htp_header_value(h) == NULL) {
62 SCLogDebug(
"HTTP %s header not present in this request",
67 const uint32_t data_len = (uint32_t)htp_header_value_len(h);
68 const uint8_t *data = htp_header_value_ptr(h);
71 det_ctx, list_id, buffer, data, data_len, transforms);
86 const uint8_t *b = NULL;
88 if (SCHttp2TxGetHeaderValue(txv, STREAM_TOSERVER,
HEADER_NAME, &b, &b_len) != 1)
90 if (b == NULL || b_len == 0)
100 #ifdef KEYWORD_TOCLIENT
103 const uint8_t _flow_flags,
void *txv,
const int list_id)
109 htp_tx_t *tx = (htp_tx_t *)txv;
111 if (htp_tx_response_headers(tx) == NULL)
114 const htp_header_t *h = htp_tx_response_header(tx,
HEADER_NAME);
115 if (h == NULL || htp_header_value(h) == NULL) {
116 SCLogDebug(
"HTTP %s header not present in this request",
121 const uint32_t data_len = (uint32_t)htp_header_value_len(h);
122 const uint8_t *data = htp_header_value_ptr(h);
125 det_ctx, list_id, buffer, data, data_len, transforms);
140 const uint8_t *b = NULL;
142 if (SCHttp2TxGetHeaderValue(txv, STREAM_TOCLIENT,
HEADER_NAME, &b, &b_len) != 1)
144 if (b == NULL || b_len == 0)
174 static void DetectHttpHeadersRegisterStub(
void)
177 #ifdef KEYWORD_NAME_LEGACY
183 #if defined(KEYWORD_TOSERVER) && defined(KEYWORD_TOSERVER)
190 #ifdef KEYWORD_TOSERVER
192 GetRequestData,
ALPROTO_HTTP1, HTP_REQUEST_PROGRESS_HEADERS);
196 #ifdef KEYWORD_TOCLIENT
198 GetResponseData,
ALPROTO_HTTP1, HTP_RESPONSE_PROGRESS_HEADERS);
202 #ifdef KEYWORD_TOSERVER
208 #ifdef KEYWORD_TOCLIENT