X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fquic%2Fquic.h;h=dacf07a14ad59bab72dd1626757137dcfca1742c;hb=caa7acf5c55a78ef4f7addfb94da0ad788f59a75;hp=a7ce4dd57ad2317ddb1e082c9dd523693a4afe1c;hpb=1c2af06852fb6d7788f0f4926d062c11e5869ead;p=vpp.git diff --git a/src/plugins/quic/quic.h b/src/plugins/quic/quic.h index a7ce4dd57ad..dacf07a14ad 100644 --- a/src/plugins/quic/quic.h +++ b/src/plugins/quic/quic.h @@ -38,7 +38,7 @@ #define QUIC_MAX_PACKET_SIZE 1280 #define QUIC_INT_MAX 0x3FFFFFFFFFFFFFFF -#define QUIC_FIFO_SIZE (64 << 10) +#define QUIC_DEFAULT_FIFO_SIZE (64 << 10) #define QUIC_SEND_PACKET_VEC_SIZE 16 /* Taken from quicly.c */ @@ -65,6 +65,16 @@ #define QUIC_DBG(_lvl, _fmt, _args...) #endif +extern vlib_node_registration_t quic_input_node; + +typedef enum +{ +#define quic_error(n,s) QUIC_ERROR_##n, +#include +#undef quic_error + QUIC_N_ERROR, +} quic_error_t; + typedef enum quic_ctx_conn_state_ { QUIC_CONN_STATE_OPENED, @@ -112,6 +122,7 @@ typedef struct quic_ctx_ u32 parent_app_wrk_id; u32 parent_app_id; u8 flags; + quicly_context_t *quicly_ctx; } quic_ctx_t; /* Make sure our custom fields don't overlap with the fields we use in @@ -124,6 +135,19 @@ STATIC_ASSERT (offsetof (quic_ctx_t, _sctx_end_marker) <= TRANSPORT_CONN_ID_LEN, "connection data must be less than TRANSPORT_CONN_ID_LEN bytes"); +typedef enum quic_crypto_engine_ +{ + CRYPTO_ENGINE_VPP, + CRYPTO_ENGINE_PICOTLS, +} quic_crypto_engine_t; + +/* single-entry session cache */ +typedef struct quic_session_cache_ +{ + ptls_encrypt_ticket_t super; + uint8_t id[32]; + ptls_iovec_t data; +} quic_session_cache_t; typedef struct quic_stream_data_ { @@ -140,20 +164,42 @@ typedef struct quic_worker_ctx_ u32 *opening_ctx_pool; } quic_worker_ctx_t; +typedef struct quic_rx_packet_ctx_ +{ + quicly_decoded_packet_t packet; + u8 data[QUIC_MAX_PACKET_SIZE]; + u32 ctx_index; + u32 thread_index; +} 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; quic_ctx_t **ctx_pool; quic_worker_ctx_t *wrk_ctx; - clib_bihash_16_8_t connection_hash; /* quicly connection id -> conn handle */ + clib_bihash_16_8_t connection_hash; /* quic connection id -> conn handle */ f64 tstamp_ticks_per_clock; + ptls_cipher_suite_t ***quic_ciphers; /* available ciphers by crypto engine */ + u8 default_cipher; + quic_session_cache_t session_cache; + /* * Config */ quicly_context_t quicly_ctx; ptls_handshake_properties_t hs_properties; quicly_cid_plaintext_t next_cid; + + u64 udp_fifo_size; + u64 udp_fifo_prealloc; } quic_main_t; #endif /* __included_quic_h__ */