aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/quic/quic.h
diff options
context:
space:
mode:
authorNathan Skrzypczak <nathan.skrzypczak@gmail.com>2019-05-03 14:20:27 +0200
committerDave Wallace <dwallacelf@gmail.com>2019-05-06 13:08:16 +0000
commit3a34b1d9366551bbff7eabff3ab48ec8189249e2 (patch)
tree3452571d43f045df0ebcb2ed713df75c26d39c93 /src/plugins/quic/quic.h
parent7107d7ef036b48cf910cb90a03978b9371b5c3ab (diff)
Add QUIC multistream support
Change-Id: I9dc746b8c62c3e7ee2f65e34a1a1dca243ed4bd9 Signed-off-by: Nathan Skrzypczak <nathan.skrzypczak@gmail.com>
Diffstat (limited to 'src/plugins/quic/quic.h')
-rw-r--r--src/plugins/quic/quic.h36
1 files changed, 15 insertions, 21 deletions
diff --git a/src/plugins/quic/quic.h b/src/plugins/quic/quic.h
index a4615946d94..512ffd95eeb 100644
--- a/src/plugins/quic/quic.h
+++ b/src/plugins/quic/quic.h
@@ -20,19 +20,17 @@
#include <vppinfra/lock.h>
#include <vppinfra/tw_timer_1t_3w_1024sl_ov.h>
+#include <vppinfra/bihash_16_8.h>
#include <quicly.h>
#include <quicly/streambuf.h>
-
-#define QUIC_DEBUG 0
-#define QUIC_DEBUG_LEVEL_CLIENT 0
-#define QUIC_DEBUG_LEVEL_SERVER 0
+#define QUIC_DEBUG 0
+#define QUIC_DEBUG_LEVEL_CLIENT 0
+#define QUIC_DEBUG_LEVEL_SERVER 0
#define QUIC_DEFAULT_CA_CERT_PATH "/etc/ssl/certs/ca-certificates.crt"
-#define QUIC_TIMER_HANDLE_INVALID ((u32) ~0)
-
#define QUIC_TSTAMP_RESOLUTION 0.001 /* QUIC tick resolution (1ms) */
@@ -44,16 +42,9 @@
#define QUIC_DBG(_lvl, _fmt, _args...)
#endif
-#define QUIC_CONN_STATE_HANDSHAKE 0
-#define QUIC_CONN_STATE_READY 1
-
-enum quic_session_type_t
-{
- QUIC_SESSION_TYPE_QUIC = 0,
- QUIC_SESSION_TYPE_STREAM = 1,
- QUIC_SESSION_TYPE_LISTEN = INT32_MAX,
-};
-
+#define QUIC_CONN_STATE_OPENED 0
+#define QUIC_CONN_STATE_HANDSHAKE 1
+#define QUIC_CONN_STATE_READY 2
/* *INDENT-OFF* */
typedef CLIB_PACKED (struct quic_ctx_id_
@@ -62,14 +53,14 @@ typedef CLIB_PACKED (struct quic_ctx_id_
u32 parent_app_id;
union {
CLIB_PACKED (struct {
- session_handle_t quic_session_handle; // TODO: remove
+ session_handle_t quic_session_handle; /* TODO: remove */
session_handle_t udp_session_handle;
quicly_conn_t *conn;
u32 listener_ctx_id;
u8 udp_is_ip4;
});
CLIB_PACKED (struct {
- session_handle_t stream_session_handle; // TODO: remove
+ session_handle_t stream_session_handle; /* TODO: remove */
quicly_stream_t *stream;
u32 quic_connection_ctx_id;
});
@@ -80,8 +71,8 @@ typedef CLIB_PACKED (struct quic_ctx_id_
STATIC_ASSERT (sizeof (quic_ctx_id_t) <= 42, "ctx id must be less than 42");
-// This structure is used to implement the concept of VPP connection for QUIC.
-// We create one per connection and one per stream.
+/* This structure is used to implement the concept of VPP connection for QUIC.
+ * We create one per connection and one per stream. */
typedef struct quic_ctx_
{
union
@@ -105,8 +96,9 @@ typedef struct quic_stream_data_
typedef struct quic_worker_ctx_
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
- u32 time_now; /**< worker time */
+ int64_t time_now; /**< worker time */
tw_timer_wheel_1t_3w_1024sl_ov_t timer_wheel; /**< worker timer wheel */
+ u32 *opening_ctx_pool;
} quic_worker_ctx_t;
typedef struct quic_main_
@@ -114,7 +106,9 @@ typedef struct quic_main_
u32 app_index;
quic_ctx_t **ctx_pool;
quic_worker_ctx_t *wrk_ctx;
+ clib_bihash_16_8_t connection_hash; /* quicly connection id -> conn handle */
f64 tstamp_ticks_per_clock;
+ u32 fake_app_listener_index; /* ugly hack for accept cb */
/*
* Config