aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/http/http2/hpack.h
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2025-02-25 06:52:25 -0500
committerFlorin Coras <florin.coras@gmail.com>2025-02-28 00:07:55 +0000
commita013224b9d35fcfd7c454c5222027ebb3a2a4d47 (patch)
tree3d5174037e166841a19425b3aa3129ddbf24aa8e /src/plugins/http/http2/hpack.h
parentbeceb0d946b4c79b22d0254f673a9f9cf059f40c (diff)
http: hpack headers encoding
1) header encoding without dynamic table 2) serialization of response header block Type: feature Change-Id: I7ec470310e5aec0f8055492e92682261b4af5e81 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'src/plugins/http/http2/hpack.h')
-rw-r--r--src/plugins/http/http2/hpack.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/plugins/http/http2/hpack.h b/src/plugins/http/http2/hpack.h
index 9dda1d6d49e..2a2936b7611 100644
--- a/src/plugins/http/http2/hpack.h
+++ b/src/plugins/http/http2/hpack.h
@@ -17,6 +17,7 @@
#define HPACK_DEFAULT_HEADER_TABLE_SIZE 4096
#define HPACK_DYNAMIC_TABLE_ENTRY_OVERHEAD 32
+#define HPACK_ENCODER_SKIP_CONTENT_LEN ((u64) ~0)
typedef struct
{
@@ -56,6 +57,16 @@ typedef struct
u16 parsed_bitmap;
} hpack_request_control_data_t;
+typedef struct
+{
+ http_status_code_t sc;
+ u64 content_len;
+ u8 *server_name;
+ u32 server_name_len;
+ u8 *date;
+ u32 date_len;
+} hpack_response_control_data_t;
+
/**
* Decode unsigned variable-length integer (RFC7541 section 5.1)
*
@@ -154,4 +165,16 @@ http2_error_t hpack_parse_request (u8 *src, u32 src_len, u8 *dst, u32 dst_len,
http_field_line_t **headers,
hpack_dynamic_table_t *dynamic_table);
+/**
+ * Serialize response
+ *
+ * @param app_headers App header list
+ * @param app_headers_len App header list length
+ * @param control_data Header values set by protocol layer
+ * @param dst Vector where serialized headers will be added
+ */
+void hpack_serialize_response (u8 *app_headers, u32 app_headers_len,
+ hpack_response_control_data_t *control_data,
+ u8 **dst);
+
#endif /* SRC_PLUGINS_HTTP_HPACK_H_ */