#define QUIC_INT_MAX 0x3FFFFFFFFFFFFFFF
#define QUIC_DEFAULT_FIFO_SIZE (64 << 10)
#define QUIC_SEND_PACKET_VEC_SIZE 16
+#define QUIC_IV_LEN 17
#define QUIC_SEND_MAX_BATCH_PACKETS 16
#define QUIC_RCV_MAX_BATCH_PACKETS 16
+#define QUIC_DEFAULT_CONN_TIMEOUT (30 * 1000) /* 30 seconds */
/* Taken from quicly.c */
#define QUICLY_QUIC_BIT 0x40
#define QUIC_DBG(_lvl, _fmt, _args...)
#endif
+#if CLIB_ASSERT_ENABLE
+#define QUIC_ASSERT(truth) ASSERT (truth)
+#else
+#define QUIC_ASSERT(truth) \
+ do { \
+ if (PREDICT_FALSE (! (truth))) \
+ QUIC_ERR ("ASSERT(%s) failed", # truth); \
+ } while (0)
+#endif
+
#define QUIC_ERR(_fmt, _args...) \
do { \
clib_warning ("QUIC-ERR: " _fmt, ##_args); \
} while (0)
+
+
extern vlib_node_registration_t quic_input_node;
typedef enum
u32 parent_app_wrk_id;
u32 parent_app_id;
u32 ckpair_index;
- quicly_context_t *quicly_ctx;
+ u32 crypto_engine;
+ u32 crypto_context_index;
u8 flags;
} quic_ctx_t;
u32 ctx_id;
u32 thread_index;
u32 app_rx_data_len; /**< bytes received, to be read by external app */
+ u32 app_tx_data_len; /**< bytes sent */
} quic_stream_data_t;
+typedef struct quic_crypto_context_data_
+{
+ quicly_context_t quicly_ctx;
+ char cid_key[QUIC_IV_LEN];
+ ptls_context_t ptls_ctx;
+} quic_crypto_context_data_t;
+
typedef struct quic_worker_ctx_
{
CLIB_CACHE_LINE_ALIGN_MARK (cacheline0);
int64_t time_now; /**< worker time */
tw_timer_wheel_1t_3w_1024sl_ov_t timer_wheel; /**< worker timer wheel */
+ quicly_cid_plaintext_t next_cid;
+ crypto_context_t *crypto_ctx_pool; /**< per thread pool of crypto contexes */
+ clib_bihash_24_8_t crypto_context_hash; /**< per thread [params:crypto_ctx_index] hash */
} quic_worker_ctx_t;
typedef struct quic_rx_packet_ctx_
session_dgram_hdr_t ph;
} quic_rx_packet_ctx_t;
-typedef struct quicly_ctx_data_
-{
- quicly_context_t quicly_ctx;
- char cid_key[17];
- ptls_context_t ptls_ctx;
-} quicly_ctx_data_t;
-
typedef struct quic_main_
{
u32 app_index;
u8 default_crypto_engine; /**< Used if you do connect with CRYPTO_ENGINE_NONE (0) */
ptls_handshake_properties_t hs_properties;
- quicly_cid_plaintext_t next_cid;
quic_session_cache_t session_cache;
u32 udp_fifo_size;
u32 udp_fifo_prealloc;
+ u32 connection_timeout;
} quic_main_t;
#endif /* __included_quic_h__ */