16 #ifndef __included_quic_h__ 17 #define __included_quic_h__ 35 #define QUIC_TSTAMP_RESOLUTION 0.001 36 #define QUIC_TIMER_HANDLE_INVALID ((u32) ~0) 37 #define QUIC_SESSION_INVALID ((u32) ~0 - 1) 38 #define QUIC_MAX_PACKET_SIZE 1280 40 #define QUIC_INT_MAX 0x3FFFFFFFFFFFFFFF 41 #define QUIC_DEFAULT_FIFO_SIZE (64 << 10) 42 #define QUIC_SEND_PACKET_VEC_SIZE 16 43 #define QUIC_IV_LEN 17 45 #define QUIC_SEND_MAX_BATCH_PACKETS 16 46 #define QUIC_RCV_MAX_BATCH_PACKETS 16 47 #define QUIC_DEFAULT_CONN_TIMEOUT (30 * 1000) 50 #define QUICLY_QUIC_BIT 0x40 52 #define QUICLY_PACKET_TYPE_INITIAL (QUICLY_LONG_HEADER_BIT | QUICLY_QUIC_BIT | 0) 53 #define QUICLY_PACKET_TYPE_0RTT (QUICLY_LONG_HEADER_BIT | QUICLY_QUIC_BIT | 0x10) 54 #define QUICLY_PACKET_TYPE_HANDSHAKE (QUICLY_LONG_HEADER_BIT | QUICLY_QUIC_BIT | 0x20) 55 #define QUICLY_PACKET_TYPE_RETRY (QUICLY_LONG_HEADER_BIT | QUICLY_QUIC_BIT | 0x30) 56 #define QUICLY_PACKET_TYPE_BITMASK 0xf0 59 #define QUIC_ERROR_FULL_FIFO 0xff10 60 #define QUIC_APP_ERROR_CLOSE_NOTIFY QUICLY_ERROR_FROM_APPLICATION_ERROR_CODE(0) 61 #define QUIC_APP_ALLOCATION_ERROR QUICLY_ERROR_FROM_APPLICATION_ERROR_CODE(0x1) 62 #define QUIC_APP_ACCEPT_NOTIFY_ERROR QUICLY_ERROR_FROM_APPLICATION_ERROR_CODE(0x2) 63 #define QUIC_APP_CONNECT_NOTIFY_ERROR QUICLY_ERROR_FROM_APPLICATION_ERROR_CODE(0x3) 66 #define QUIC_DBG(_lvl, _fmt, _args...) \ 67 if (_lvl <= QUIC_DEBUG) \ 68 clib_warning (_fmt, ##_args) 70 #define QUIC_DBG(_lvl, _fmt, _args...) 73 #if CLIB_ASSERT_ENABLE 74 #define QUIC_ASSERT(truth) ASSERT (truth) 76 #define QUIC_ASSERT(truth) \ 78 if (PREDICT_FALSE (! (truth))) \ 79 QUIC_ERR ("ASSERT(%s) failed", # truth); \ 83 #define QUIC_ERR(_fmt, _args...) \ 85 clib_warning ("QUIC-ERR: " _fmt, ##_args); \ 94 #define quic_error(n,s) QUIC_ERROR_##n, 166 "connection data must be less than TRANSPORT_CONN_ID_LEN bytes");
169 "connection data must be less than TRANSPORT_CONN_ID_LEN bytes");
213 struct sockaddr_in6 sa6;
#define CLIB_CACHE_LINE_ALIGN_MARK(mark)
uword * available_crypto_engines
Bitmap for registered engines.
struct quic_session_cache_ quic_session_cache_t
enum quic_ctx_conn_state_ quic_ctx_conn_state_t
quic_worker_ctx_t * wrk_ctx
quicly_stream_t * stream
STREAM ctx case.
int64_t time_now
worker time
clib_bihash_16_8_t connection_hash
quic connection id -> conn handle
struct quic_ctx_ quic_ctx_t
struct quic_worker_ctx_ quic_worker_ctx_t
f64 tstamp_ticks_per_clock
u8 default_crypto_engine
Used if you do connect with CRYPTO_ENGINE_NONE (0)
ptls_handshake_properties_t hs_properties
#define QUIC_MAX_PACKET_SIZE
clib_bihash_24_8_t crypto_context_hash
per thread [params:crypto_ctx_index] hash
struct quic_rx_packet_ctx_ quic_rx_packet_ctx_t
u32 app_rx_data_len
bytes received, to be read by external app
struct quic_crypto_context_data_ quic_crypto_context_data_t
quicly_conn_t * conn
QUIC ctx case.
transport_connection_t connection
ptls_cipher_suite_t *** quic_ciphers
available ciphers by crypto engine
ptls_encrypt_ticket_t super
struct quic_main_ quic_main_t
struct _transport_connection transport_connection_t
STATIC_ASSERT(offsetof(quic_ctx_t, _qctx_end_marker)<=TRANSPORT_CONN_ID_LEN, "connection data must be less than TRANSPORT_CONN_ID_LEN bytes")
#define TRANSPORT_CONN_ID_LEN
crypto_context_t * crypto_ctx_pool
per thread pool of crypto contexes
tw_timer_wheel_1t_3w_1024sl_ov_t timer_wheel
worker timer wheel
u32 quic_connection_ctx_id
session_handle_t udp_session_handle
enum quic_packet_type_ quic_packet_type_t
struct _vlib_node_registration vlib_node_registration_t
quicly_context_t quicly_ctx
struct quic_stream_data_ quic_stream_data_t
quicly_decoded_packet_t packet
vlib_node_registration_t quic_input_node
(constructor) VLIB_REGISTER_NODE (quic_input_node)
quic_session_cache_t session_cache
quicly_cid_plaintext_t next_cid
u32 app_tx_data_len
bytes sent
enum quic_ctx_flags_ quic_ctx_flags_t