16 #ifndef __included_quic_h__ 17 #define __included_quic_h__ 38 #define QUIC_TSTAMP_RESOLUTION 0.001 39 #define QUIC_TIMER_HANDLE_INVALID ((u32) ~0) 40 #define QUIC_SESSION_INVALID ((u32) ~0 - 1) 41 #define QUIC_MAX_PACKET_SIZE 1280 43 #define QUIC_INT_MAX 0x3FFFFFFFFFFFFFFF 44 #define QUIC_DEFAULT_FIFO_SIZE (64 << 10) 45 #define QUIC_SEND_PACKET_VEC_SIZE 16 46 #define QUIC_IV_LEN 17 48 #define QUIC_MAX_COALESCED_PACKET 4 50 #define QUIC_SEND_MAX_BATCH_PACKETS 16 51 #define QUIC_RCV_MAX_BATCH_PACKETS 16 53 #define QUIC_DEFAULT_CONN_TIMEOUT (30 * 1000) 56 #define QUICLY_QUIC_BIT 0x40 58 #define QUICLY_PACKET_TYPE_INITIAL (QUICLY_LONG_HEADER_BIT | QUICLY_QUIC_BIT | 0) 59 #define QUICLY_PACKET_TYPE_0RTT (QUICLY_LONG_HEADER_BIT | QUICLY_QUIC_BIT | 0x10) 60 #define QUICLY_PACKET_TYPE_HANDSHAKE (QUICLY_LONG_HEADER_BIT | QUICLY_QUIC_BIT | 0x20) 61 #define QUICLY_PACKET_TYPE_RETRY (QUICLY_LONG_HEADER_BIT | QUICLY_QUIC_BIT | 0x30) 62 #define QUICLY_PACKET_TYPE_BITMASK 0xf0 65 #define QUIC_ERROR_FULL_FIFO 0xff10 66 #define QUIC_APP_ERROR_CLOSE_NOTIFY QUICLY_ERROR_FROM_APPLICATION_ERROR_CODE(0) 67 #define QUIC_APP_ALLOCATION_ERROR QUICLY_ERROR_FROM_APPLICATION_ERROR_CODE(0x1) 68 #define QUIC_APP_ACCEPT_NOTIFY_ERROR QUICLY_ERROR_FROM_APPLICATION_ERROR_CODE(0x2) 69 #define QUIC_APP_CONNECT_NOTIFY_ERROR QUICLY_ERROR_FROM_APPLICATION_ERROR_CODE(0x3) 71 #define QUIC_DECRYPT_PACKET_OK 0 72 #define QUIC_DECRYPT_PACKET_NOTOFFLOADED 1 73 #define QUIC_DECRYPT_PACKET_ERROR 2 76 #define QUIC_DBG(_lvl, _fmt, _args...) \ 77 if (_lvl <= QUIC_DEBUG) \ 78 clib_warning (_fmt, ##_args) 80 #define QUIC_DBG(_lvl, _fmt, _args...) 83 #if CLIB_ASSERT_ENABLE 84 #define QUIC_ASSERT(truth) ASSERT (truth) 86 #define QUIC_ASSERT(truth) \ 88 if (PREDICT_FALSE (! (truth))) \ 89 QUIC_ERR ("ASSERT(%s) failed", # truth); \ 93 #define QUIC_ERR(_fmt, _args...) \ 95 clib_warning ("QUIC-ERR: " _fmt, ##_args); \ 104 #define quic_error(n,s) QUIC_ERROR_##n, 185 "connection data must be less than TRANSPORT_CONN_ID_LEN bytes");
188 "connection data must be less than TRANSPORT_CONN_ID_LEN bytes");
220 ptls_cipher_context_t *
hp;
252 struct sockaddr_in6 sa6;
#define QUIC_RCV_MAX_BATCH_PACKETS
#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.
ptls_cipher_context_t * hp_ctx
quicly_datagram_t * packet
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
struct quic_encrypt_cb_ctx_ quic_encrypt_cb_ctx
#define QUIC_MAX_COALESCED_PACKET
clib_rwlock_t crypto_keys_quic_rw_lock
u8 default_crypto_engine
Used if you do connect with CRYPTO_ENGINE_NONE (0)
struct quic_ctx_::@710 ingress_keys
ptls_cipher_context_t * hp
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
u64 max_packets_per_key
number of packets that can be sent without a key update
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
#define QUIC_SEND_MAX_BATCH_PACKETS
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
ptls_aead_context_t * aead_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_crypto_batch_ctx_t crypto_context_batch
quic_session_cache_t session_cache
quicly_cid_plaintext_t next_cid
u32 app_tx_data_len
bytes sent
struct quic_crypto_batch_ctx_ quic_crypto_batch_ctx_t
enum quic_ctx_flags_ quic_ctx_flags_t