aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/http/http2/http2.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/http/http2/http2.h')
-rw-r--r--src/plugins/http/http2/http2.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/plugins/http/http2/http2.h b/src/plugins/http/http2/http2.h
index 82403a46fc3..9fc95344771 100644
--- a/src/plugins/http/http2/http2.h
+++ b/src/plugins/http/http2/http2.h
@@ -5,6 +5,9 @@
#ifndef SRC_PLUGINS_HTTP_HTTP2_H_
#define SRC_PLUGINS_HTTP_HTTP2_H_
+#include <vppinfra/format.h>
+#include <vppinfra/types.h>
+
/* RFC9113 section 7 */
#define foreach_http2_error \
_ (NO_ERROR, "NO_ERROR") \
@@ -55,4 +58,40 @@ format_http2_error (u8 *s, va_list *va)
_ (3, PATH, "path") \
_ (4, STATUS, "status")
+/* value, label, member, min, max, default_value, err_code */
+#define foreach_http2_settings \
+ _ (1, HEADER_TABLE_SIZE, header_table_size, 0, CLIB_U32_MAX, 4096, \
+ HTTP2_ERROR_NO_ERROR) \
+ _ (2, ENABLE_PUSH, enable_push, 0, 1, 1, HTTP2_ERROR_PROTOCOL_ERROR) \
+ _ (3, MAX_CONCURRENT_STREAMS, max_concurrent_streams, 0, CLIB_U32_MAX, \
+ CLIB_U32_MAX, HTTP2_ERROR_NO_ERROR) \
+ _ (4, INITIAL_WINDOW_SIZE, initial_window_size, 0, 0x7FFFFFFF, 65535, \
+ HTTP2_ERROR_FLOW_CONTROL_ERROR) \
+ _ (5, MAX_FRAME_SIZE, max_frame_size, 16384, 16777215, 16384, \
+ HTTP2_ERROR_PROTOCOL_ERROR) \
+ _ (6, MAX_HEADER_LIST_SIZE, max_header_list_size, 0, CLIB_U32_MAX, \
+ CLIB_U32_MAX, HTTP2_ERROR_NO_ERROR)
+
+typedef enum
+{
+#define _(value, label, member, min, max, default_value, err_code) \
+ HTTP2_SETTINGS_##label = value,
+ foreach_http2_settings
+#undef _
+} http_settings_t;
+
+typedef struct
+{
+#define _(value, label, member, min, max, default_value, err_code) u32 member;
+ foreach_http2_settings
+#undef _
+} http2_conn_settings_t;
+
+static const http2_conn_settings_t http2_default_conn_settings = {
+#define _(value, label, member, min, max, default_value, err_code) \
+ default_value,
+ foreach_http2_settings
+#undef _
+};
+
#endif /* SRC_PLUGINS_HTTP_HTTP2_H_ */