|
FD.io VPP
v21.10.1-2-g0a485f517
Vector Packet Processing
|
Go to the documentation of this file.
16 #include <sys/socket.h>
22 #include <vpp/app/version.h>
30 #include <quicly/constants.h>
31 #include <quicly/defaults.h>
39 #define quic_error(n,s) s,
44 #define DEFAULT_MAX_PACKETS_PER_KEY 16777216
64 kv->
key[0] = ((
u64)
ctx->ckpair_index) << 32 | (
u64)
ctx->crypto_engine;
76 kv->
key[1] =
data->quicly_ctx.transport_params.max_stream_data.bidi_local;
77 kv->
key[2] =
data->quicly_ctx.transport_params.max_stream_data.bidi_remote;
104 for (
i = 0;
i < num_threads;
i++)
140 cr_index & 0x00ffffff);
152 for (
i = 0;
i < num_threads;
i++)
204 else if (
unformat (line_input,
"cubic"))
231 quicly_context_t *quicly_ctx;
232 ptls_iovec_t key_vec;
236 ptls_context_t *ptls_ctx;
239 ctx->c_thread_index);
245 quicly_ctx = &
data->quicly_ctx;
246 ptls_ctx = &
data->ptls_ctx;
248 ptls_ctx->random_bytes = ptls_openssl_random_bytes;
249 ptls_ctx->get_time = &ptls_get_time;
250 ptls_ctx->key_exchanges = ptls_openssl_key_exchanges;
252 ptls_ctx->certificates.list = NULL;
253 ptls_ctx->certificates.count = 0;
254 ptls_ctx->esni = NULL;
255 ptls_ctx->on_client_hello = NULL;
256 ptls_ctx->emit_certificate = NULL;
257 ptls_ctx->sign_certificate = NULL;
258 ptls_ctx->verify_certificate = NULL;
259 ptls_ctx->ticket_lifetime = 86400;
260 ptls_ctx->max_early_data_size = 8192;
261 ptls_ctx->hkdf_label_prefix__obsolete = NULL;
262 ptls_ctx->require_dhe_on_psk = 1;
264 clib_memcpy (quicly_ctx, &quicly_spec_context,
sizeof (quicly_context_t));
267 quicly_ctx->tls = ptls_ctx;
271 quicly_amend_ptls_context (quicly_ctx->tls);
277 quicly_ctx->crypto_engine = &quicly_default_crypto_engine;
280 quicly_ctx->transport_params.max_streams_uni = (uint64_t) 1 << 60;
281 quicly_ctx->transport_params.max_streams_bidi = (uint64_t) 1 << 60;
285 quicly_ctx->init_cc = &quicly_cc_cubic_init;
287 quicly_ctx->init_cc = &quicly_cc_reno_init;
290 quicly_ctx->transport_params.max_stream_data.bidi_local =
292 quicly_ctx->transport_params.max_stream_data.bidi_remote =
294 quicly_ctx->transport_params.max_stream_data.uni =
QUIC_INT_MAX;
306 quicly_ctx->cid_encryptor =
307 quicly_new_default_cid_encryptor (&ptls_openssl_bfecb,
308 &ptls_openssl_aes128ecb,
309 &ptls_openssl_sha256, key_vec);
312 if (!ckpair || !ckpair->
key || !ckpair->
cert)
319 QUIC_DBG (1,
"failed to read private key from app configuration\n");
324 QUIC_DBG (1,
"failed to load certificate\n");
340 QUIC_DBG (2,
"No crypto engine specified, using %d",
346 QUIC_DBG (1,
"Quic does not support crypto engine %d",
348 return SESSION_E_NOCRYPTOENG;
353 if (clib_bihash_search_24_8
358 ctx->crypto_context_index = kv.
value;
373 clib_bihash_add_del_24_8 (&qm->
374 wrk_ctx[
ctx->c_thread_index].crypto_context_hash,
380 return SESSION_E_NOCRYPTOCKP;
396 QUIC_DBG (3,
"Allocated quic_ctx %u on thread %u",
404 QUIC_DBG (2,
"Free ctx %u %x",
ctx->c_thread_index,
ctx->c_c_index);
430 conn_data = (
u64) * quicly_get_data (conn);
431 return quic_ctx_get (conn_data & UINT32_MAX, conn_data >> 32);
437 *quicly_get_data (conn) =
438 (
void *) (((
u64)
ctx->c_thread_index) << 32 | (
u64)
ctx->c_c_index);
472 const quicly_cid_plaintext_t *
id)
474 kv->
key[0] = ((
u64)
id->master_id) << 32 | (
u64)
id->thread_id;
475 kv->
key[1] =
id->node_id;
487 static quicly_context_t *
494 return &
data->quicly_ctx;
497 static quicly_context_t *
520 tw_timer_wheel_1t_3w_1024sl_ov_t *tw;
524 tw_timer_stop_1t_3w_1024sl_ov (tw,
ctx->timer_handle);
526 QUIC_DBG (4,
"Stopping timer for ctx %u",
ctx->c_c_index);
537 quicly_stream_t *stream;
550 quicly_stream_sync_recvbuf (stream, stream_data->
app_rx_data_len - max_deq);
558 QUIC_DBG (2,
"Disconnecting transport 0x%lx",
ctx->udp_session_handle);
560 .handle =
ctx->udp_session_handle,
566 ctx->udp_session_handle);
575 if (
ctx->conn == NULL)
577 QUIC_DBG (2,
"Skipping redundant delete of connection %u",
581 QUIC_DBG (2,
"Deleting connection %u",
ctx->c_c_index);
590 QUIC_DBG (2,
"Deleting conn with id %lu %lu from map", kv.
key[0],
615 QUIC_DBG (2,
"QUIC connection %u/%u closed",
ctx->c_thread_index,
621 switch (
ctx->conn_state)
653 quicly_address_t *dest, quicly_address_t *
src)
667 QUIC_ERR (
"Too much data to send, max_enqueue %u, len %u",
683 struct sockaddr_in *sa4 = (
struct sockaddr_in *) &dest->sa;
685 hdr.
rmt_ip.ip4.as_u32 = sa4->sin_addr.s_addr;
690 struct sockaddr_in6 *sa6 = (
struct sockaddr_in6 *) &dest->sa;
701 QUIC_ERR (
"Not enough space to enqueue dgram");
716 ->transport_params.max_udp_payload_size];
719 size_t num_packets,
i, max_packets;
720 quicly_address_t dest,
src;
745 num_packets = max_packets;
746 if ((err = quicly_send (conn, &dest, &
src,
packets, &num_packets,
buf,
750 for (
i = 0;
i != num_packets; ++
i)
758 n_sent += num_packets;
760 while (num_packets > 0 && num_packets == max_packets);
770 if (err && err != QUICLY_ERROR_PACKET_IGNORED
771 && err != QUICLY_ERROR_FREE_CONNECTION)
786 sctx->c_thread_index);
787 QUIC_DBG (2,
"DESTROYED_STREAM: session 0x%lx (%U)",
806 sctx->c_thread_index);
807 clib_warning (
"(NOT IMPLEMENTD) STOP_SENDING: session 0x%lx (%U)",
821 sctx->c_thread_index);
833 u32 max_enq, rlen,
rv;
849 QUIC_DBG (3,
"Enqueuing %u at off %u in %u space",
len,
off, max_enq);
851 if (off < stream_data->app_rx_data_len)
853 QUIC_DBG (3,
"Session [idx %u, app_wrk %u, thread %u, rx-fifo 0x%llx]: "
854 "DUPLICATE PACKET (max_enq %u, len %u, "
855 "app_rx_data_len %u, off %u, ToBeNQ %u)",
865 QUIC_ERR (
"Session [idx %u, app_wrk %u, thread %u, rx-fifo 0x%llx]: "
866 "RX FIFO IS FULL (max_enq %u, len %u, "
867 "app_rx_data_len %u, off %u, ToBeNQ %u)",
879 QUIC_DBG (3,
"Session [idx %u, app_wrk %u, ti %u, rx-fifo 0x%llx]: "
880 "Enqueuing %u (rlen %u) at off %u in %u space, ",
892 QUIC_ERR (
"Failed to ping app for RX");
921 ctx->bytes_written += delta;
925 rv = quicly_stream_sync_sendbuf (stream, 0);
931 size_t *
len,
int *wrote_all)
981 session_t *stream_session, *quic_session;
988 QUIC_DBG (2,
"on_stream_open called");
993 if (quicly_stream_is_self_initiated (stream))
1006 QUIC_DBG (2,
"ACCEPTED stream_session 0x%lx ctx %u",
1012 sctx->c_c_index = sctx_id;
1018 if (quicly_stream_is_unidirectional (stream->stream_id))
1019 stream_session->
flags |= SESSION_F_UNIDIRECTIONAL;
1022 stream_data->
ctx_id = sctx_id;
1033 quic_session =
session_get (qctx->c_s_index, qctx->c_thread_index);
1039 QUIC_ERR (
"failed to allocate fifos");
1049 QUIC_ERR (
"failed to notify accept worker app");
1059 int code, uint64_t frame_type,
const char *reason,
1065 clib_warning (
"Session 0x%lx closed by peer (%U) %.*s ",
1067 reason_len, reason);
1101 tw_timer_wheel_1t_3w_1024sl_ov_t *tw;
1105 tw_timer_expire_timers_1t_3w_1024sl_ov (tw,
now);
1112 QUIC_DBG (4,
"Timer expired for conn %u at %ld", conn_index,
1122 tw_timer_wheel_1t_3w_1024sl_ov_t *tw;
1123 int64_t next_timeout, next_interval;
1128 next_timeout = quicly_get_first_timeout (
ctx->conn);
1131 if (next_timeout == 0 || next_interval <= 0)
1146 QUIC_ERR (
"Failed to enqueue builtin_tx %d",
rv);
1156 QUIC_DBG (4,
"Timer set to %ld (int %ld) for ctx %u", next_timeout,
1157 next_interval,
ctx->c_c_index);
1161 if (next_timeout == INT64_MAX)
1163 QUIC_DBG (4,
"timer for ctx %u already stopped",
ctx->c_c_index);
1166 ctx->timer_handle = tw_timer_start_1t_3w_1024sl_ov (tw,
ctx->c_c_index,
1171 if (next_timeout == INT64_MAX)
1176 tw_timer_update_1t_3w_1024sl_ov (tw,
ctx->timer_handle,
1187 for (
i = 0;
i <
vec_len (expired_timers);
i++)
1197 uint64_t quic_session_handle;
1200 quicly_stream_t *stream;
1201 quicly_conn_t *conn;
1210 QUIC_DBG (2,
"Opening new stream (qsession %u)", quic_session_handle);
1213 TRANSPORT_PROTO_QUIC)
1215 QUIC_ERR (
"received incompatible session");
1222 QUIC_ERR (
"Invalid app worker :(");
1240 sctx->c_c_index = sctx_index;
1246 if (!conn || !quicly_connection_is_ready (conn))
1250 if ((
rv = quicly_open_stream (conn, &stream, is_unidir)))
1252 QUIC_DBG (2,
"Stream open failed with %d",
rv);
1260 QUIC_DBG (2,
"Opened stream %d, creating session", stream->stream_id);
1263 QUIC_DBG (2,
"Allocated stream_session 0x%lx ctx %u",
1271 stream_session->
flags |= SESSION_F_UNIDIRECTIONAL;
1275 stream_data->
ctx_id = sctx->c_c_index;
1284 QUIC_ERR (
"failed to app_worker_init_connected");
1318 return SESSION_E_NOEXTCFG;
1322 ccfg = &sep->ext_cfg->crypto;
1327 ctx->parent_app_wrk_id = sep->app_wrk_index;
1329 ctx->c_c_index = ctx_index;
1330 ctx->udp_is_ip4 = sep->is_ip4;
1333 ctx->client_opaque = sep->opaque;
1340 &sep->ip, sep->is_ip4);
1344 cargs->sep.transport_proto = TRANSPORT_PROTO_UDP;
1346 cargs->api_context = ctx_index;
1351 cargs->sep_ext.ns_index = app->
ns_index;
1368 QUIC_DBG (2,
"Called quic_connect");
1388 ctx->c_thread_index);
1394 quicly_stream_t *stream =
ctx->stream;
1395 if (!quicly_stream_has_send_side (quicly_is_client (stream->conn),
1398 quicly_sendstate_shutdown (&stream->sendstate,
ctx->bytes_written +
1401 err = quicly_stream_sync_sendbuf (stream, 1);
1404 QUIC_DBG (1,
"sendstate_shutdown failed for stream session %lu",
1412 switch (
ctx->conn_state)
1418 quicly_conn_t *conn =
ctx->conn;
1438 QUIC_ERR (
"Trying to close conn in state %d",
ctx->conn_state);
1461 return SESSION_E_NOEXTCFG;
1463 ccfg = &sep->ext_cfg->crypto;
1470 args->sep_ext = *sep;
1471 args->sep_ext.ns_index = app->
ns_index;
1472 args->sep_ext.transport_proto = TRANSPORT_PROTO_UDP;
1478 udp_handle = args->handle;
1481 udp_listen_session->
opaque = lctx_index;
1486 clib_memcpy (&lctx->c_rmt_ip, &args->sep.peer.ip, sizeof (ip46_address_t));
1487 clib_memcpy (&lctx->c_lcl_ip, &args->sep.ip, sizeof (ip46_address_t));
1488 lctx->c_rmt_port = args->sep.peer.port;
1489 lctx->c_lcl_port = args->sep.port;
1490 lctx->c_is_ip4 = args->sep.is_ip4;
1491 lctx->c_fib_index = args->sep.fib_index;
1492 lctx->c_proto = TRANSPORT_PROTO_QUIC;
1496 lctx->c_s_index = quic_listen_session_index;
1502 QUIC_DBG (2,
"Listening UDP session 0x%lx",
1504 QUIC_DBG (2,
"Listening QUIC session 0x%lx", quic_listen_session_index);
1511 QUIC_DBG (2,
"Called quic_stop_listen");
1534 return &
ctx->connection;
1540 QUIC_DBG (2,
"Called quic_listener_get");
1543 return &
ctx->connection;
1550 u32 verbose = va_arg (*args,
u32);
1555 str =
format (str,
"[#%d][Q] ",
ctx->c_thread_index);
1558 str =
format (str,
"Listener, UDP %ld",
ctx->udp_session_handle);
1560 str =
format (str,
"Stream %ld conn %d",
1561 ctx->stream->stream_id,
ctx->quic_connection_ctx_id);
1563 str =
format (str,
"Conn %d UDP %d",
ctx->c_c_index,
1564 ctx->udp_session_handle);
1566 str =
format (str,
" app %d wrk %d",
ctx->parent_app_id,
1567 ctx->parent_app_wrk_id);
1571 str,
ctx->conn_state);
1573 s =
format (s,
"%s\n", str);
1581 u32 qc_index = va_arg (*args,
u32);
1583 u32 verbose = va_arg (*args,
u32);
1592 u32 qc_index = va_arg (*args,
u32);
1596 ctx->parent_app_id);
1604 u32 tci = va_arg (*args,
u32);
1606 u32 verbose = va_arg (*args,
u32);
1620 struct sockaddr_in *sa4 = (
struct sockaddr_in *) sa;
1621 sa4->sin_family = AF_INET;
1622 sa4->sin_port =
port;
1623 sa4->sin_addr.s_addr =
addr->ip4.as_u32;
1624 *salen =
sizeof (
struct sockaddr_in);
1628 struct sockaddr_in6 *sa6 = (
struct sockaddr_in6 *) sa;
1629 sa6->sin6_family = AF_INET6;
1630 sa6->sin6_port =
port;
1632 *salen =
sizeof (
struct sockaddr_in6);
1641 u32 ctx_id =
ctx->c_c_index;
1659 QUIC_ERR (
"failed to app_worker_init_connected");
1667 SESSION_E_NONE,
ctx->client_opaque)))
1694 if (!quicly_connection_is_ready (
ctx->conn))
1697 if (!quicly_is_client (
ctx->conn))
1707 ptls_context_t **tls;
1708 quicly_context_t **_quicly_context;
1709 _quicly_context = (quicly_context_t **) conn;
1710 *_quicly_context = quicly_context;
1711 tls = (ptls_context_t **) quicly_get_tls (conn);
1712 *tls = quicly_context->tls;
1721 quicly_conn_t *conn;
1722 quicly_context_t *quicly_context;
1729 QUIC_DBG (2,
"Received conn %u (now %u)", temp_ctx->c_thread_index,
1736 new_ctx->c_c_index = new_ctx_id;
1739 conn = new_ctx->
conn;
1746 QUIC_DBG (2,
"Registering conn with id %lu %lu", kv.
key[0], kv.
key[1]);
1753 udp_session->
opaque = new_ctx_id;
1754 udp_session->
flags &= ~SESSION_F_IS_MIGRATING;
1765 QUIC_DBG (2,
"Transferring conn %u to thread %u", ctx_index, dest_thread);
1787 QUIC_DBG (2,
"UDP Session is now connected (id %u)",
1792 struct sockaddr_in6 sa6;
1793 struct sockaddr *sa = (
struct sockaddr *) &sa6;
1797 quicly_conn_t *conn;
1801 quicly_context_t *quicly_ctx;
1815 api_context =
ctx->c_s_index;
1824 udp_session->
opaque = ctx_index;
1832 ret = quicly_connect (&
ctx->conn, quicly_ctx, (
char *)
ctx->srv_hostname,
1845 QUIC_DBG (2,
"Registering conn with id %lu %lu", kv.
key[0], kv.
key[1]);
1871 ctx->c_thread_index);
1892 ctx->udp_session_handle = new_sh;
1908 udp_listen_session =
1914 ctx->c_c_index = ctx_index;
1917 QUIC_DBG (2,
"ACCEPTED UDP 0x%lx",
ctx->udp_session_handle);
1918 ctx->listener_ctx_id = udp_listen_session->
opaque;
1921 ctx->udp_is_ip4 = lctx->c_is_ip4;
1931 udp_session->
opaque = ctx_index;
1957 QUIC_DBG (3,
"Received app READ notification");
1973 quicly_stream_t *stream;
1979 (stream_session->
session_state >= SESSION_STATE_TRANSPORT_CLOSING))
1990 stream =
ctx->stream;
1991 if (!quicly_sendstate_is_open (&stream->sendstate))
1993 QUIC_ERR (
"Warning: tried to send on closed stream");
2002 QUIC_DBG (3,
"TX but no data %d / %d", max_deq,
2007 rv = quicly_stream_sync_sendbuf (stream, 1);
2024 clib_bihash_16_8_t *
h;
2030 QUIC_DBG (3,
"Searching conn with id %lu %lu", kv.
key[0], kv.
key[1]);
2032 if (clib_bihash_search_16_8 (
h, &kv, &kv))
2034 QUIC_DBG (3,
"connection not found");
2039 thread_id = kv.
value >> 32;
2042 if (thread_id != caller_thread_index)
2044 QUIC_DBG (2,
"Connection is on wrong thread");
2056 if (!quicly_is_destination (
ctx->conn, NULL, &pctx->
sa, &pctx->
packet))
2068 quicly_context_t *quicly_ctx;
2072 quicly_conn_t *conn;
2082 QUIC_DBG (2,
"already accepted ctx 0x%x",
ctx->c_s_index);
2087 if ((
rv = quicly_accept (&conn, quicly_ctx, NULL, &pctx->
sa,
2106 QUIC_DBG (2,
"Allocated quic_session, 0x%lx ctx %u",
2123 QUIC_DBG (2,
"Registering conn with id %lu %lu", kv.
key[0], kv.
key[1]);
2128 QUIC_ERR (
"failed to allocate fifos");
2136 QUIC_ERR (
"failed to notify accept worker app");
2152 QUIC_DBG (2,
"Sending stateless reset");
2155 quicly_context_t *quicly_ctx;
2156 if (pctx->
packet.cid.dest.plaintext.node_id != 0
2157 || pctx->
packet.cid.dest.plaintext.thread_id != 0)
2162 quicly_address_t
src;
2163 uint8_t payload[quicly_ctx->transport_params.max_udp_payload_size];
2164 size_t payload_len =
2165 quicly_send_stateless_reset (quicly_ctx, &
src.sa, payload);
2166 if (payload_len == 0)
2170 packet.iov_len = payload_len;
2171 packet.iov_base = payload;
2173 struct _st_quicly_conn_public_t *conn =
2174 (
struct _st_quicly_conn_public_t *) qctx->
conn;
2178 &conn->local.address);
2191 quicly_context_t *quicly_ctx;
2200 if (full_len > cur_deq)
2202 QUIC_ERR (
"Not enough data in fifo RX");
2212 QUIC_ERR (
"Not enough data peeked in RX");
2222 plen = quicly_decode_packet (quicly_ctx, &pctx->
packet, pctx->
data,
2225 if (plen == SIZE_MAX)
2248 else if (QUICLY_PACKET_IS_LONG_HEADER (pctx->
packet.octets.base[0]))
2272 u32 cur_deq, fifo_offset, max_packets,
i;
2276 if (udp_session->
flags & SESSION_F_IS_MIGRATING)
2278 QUIC_DBG (3,
"RX on migrating udp session");
2294 for (
i = 0;
i < max_packets;
i++)
2300 cur_deq = max_deq - fifo_offset;
2303 max_packets =
i + 1;
2308 fifo_offset = max_deq;
2309 max_packets =
i + 1;
2310 QUIC_ERR (
"Fifo %d < header size in RX", cur_deq);
2314 fifo_offset, &packets_ctx[
i]);
2319 max_packets =
i + 1;
2324 for (
i = 0;
i < max_packets;
i++)
2326 switch (packets_ctx[
i].ptype)
2330 rv = quicly_receive (
ctx->conn, NULL, &packets_ctx[
i].
sa,
2332 if (
rv &&
rv != QUICLY_ERROR_PACKET_IGNORED)
2334 QUIC_ERR (
"quicly_receive return error %U",
2346 ctx = prev_ctx = NULL;
2347 for (
i = 0;
i < max_packets;
i++)
2350 switch (packets_ctx[
i].ptype)
2367 if (
ctx != prev_ctx)
2448 .transport_options = {
2465 ptls_cipher_suite_t ** ciphers)
2483 (
"error while getting segment_manager_props_t, can't update fifo-size");
2494 u32 segment_size = 256 << 20;
2496 tw_timer_wheel_1t_3w_1024sl_ov_t *tw;
2529 for (
i = 0;
i < num_threads;
i++)
2537 "quic crypto contexts", 64, 128 << 10);
2540 clib_bihash_init_16_8 (&qm->
connection_hash,
"quic connections", 1024,
2556 ptls_openssl_cipher_suites);
2566 u8 empty_key[32] = {};
2571 for (
i = 0;
i < num_threads;
i++)
2574 vm, VNET_CRYPTO_ALG_AES_256_CTR, empty_key, 32);
2603 else if (
unformat (line_input,
"picotls"))
2634 if (
tmp >= 0x100000000ULL)
2637 (0,
"fifo-size %llu (0x%llx) too large",
tmp,
tmp);
2667 em = &this_vlib_main->error_main;
2685 quicly_stats_t st, agg_stats;
2686 u32 i, nconn = 0, nstream = 0;
2689 for (
i = 0;
i < num_workers + 1;
i++)
2696 quicly_get_stats (
ctx->conn, &st);
2697 agg_stats.rtt.smoothed += st.rtt.smoothed;
2698 agg_stats.rtt.minimum += st.rtt.minimum;
2699 agg_stats.rtt.variance += st.rtt.variance;
2700 agg_stats.num_packets.received += st.num_packets.received;
2701 agg_stats.num_packets.sent += st.num_packets.sent;
2702 agg_stats.num_packets.lost += st.num_packets.lost;
2703 agg_stats.num_packets.ack_received += st.num_packets.ack_received;
2704 agg_stats.num_bytes.received += st.num_bytes.received;
2705 agg_stats.num_bytes.sent += st.num_bytes.sent;
2736 nconn > 0 ? agg_stats.rtt.minimum / nconn : 0);
2738 nconn > 0 ? agg_stats.rtt.smoothed / nconn : 0);
2740 nconn > 0 ? agg_stats.rtt.variance / nconn : 0);
2742 agg_stats.num_packets.received);
2746 agg_stats.num_packets.ack_received);
2754 quicly_cid_plaintext_t *mid = va_arg (*args, quicly_cid_plaintext_t *);
2755 s =
format (s,
"C%x_%x", mid->master_id, mid->thread_id);
2762 quicly_stream_t *stream = va_arg (*args, quicly_stream_t *);
2765 quicly_get_master_id (stream->conn), stream->stream_id);
2773 s =
format (s,
"[#%d][%x][Listener]",
ctx->c_thread_index,
ctx->c_c_index);
2781 quicly_stats_t quicly_stats;
2783 s =
format (s,
"[#%d][%x]",
ctx->c_thread_index,
ctx->c_c_index);
2787 s =
format (s,
"- no conn -\n");
2792 quicly_get_stats (
ctx->conn, &quicly_stats);
2794 s =
format (s,
"[RTT >%3d, ~%3d, V%3d, last %3d]",
2795 quicly_stats.rtt.minimum, quicly_stats.rtt.smoothed,
2796 quicly_stats.rtt.variance, quicly_stats.rtt.latest);
2797 s =
format (s,
" TX:%d RX:%d loss:%d ack:%d",
2798 quicly_stats.num_packets.sent,
2799 quicly_stats.num_packets.received,
2800 quicly_stats.num_packets.lost,
2801 quicly_stats.num_packets.ack_received);
2803 format (s,
"\ncwnd:%u ssthresh:%u recovery_end:%lu", quicly_stats.cc.cwnd,
2804 quicly_stats.cc.ssthresh, quicly_stats.cc.recovery_end);
2807 if (quicly_ctx->init_cc == &quicly_cc_cubic_init)
2811 "\nk:%d w_max:%u w_last_max:%u avoidance_start:%ld last_sent_time:%ld",
2812 quicly_stats.cc.state.cubic.k, quicly_stats.cc.state.cubic.w_max,
2813 quicly_stats.cc.state.cubic.w_last_max,
2814 quicly_stats.cc.state.cubic.avoidance_start,
2815 quicly_stats.cc.state.cubic.last_sent_time);
2817 else if (quicly_ctx->init_cc == &quicly_cc_reno_init)
2819 s =
format (s,
" stash:%u", quicly_stats.cc.state.reno.stash);
2830 quicly_stream_t *stream =
ctx->stream;
2833 s =
format (s,
"[#%d][%x]",
ctx->c_thread_index,
ctx->c_c_index);
2837 if (!stream_session)
2839 s =
format (s,
"- no session -\n");
2844 s =
format (s,
"[rx %d tx %d]\n", rxs, txs);
2854 u8 show_listeners = 0, show_conn = 0, show_stream = 0;
2870 if (
unformat (line_input,
"listener"))
2872 else if (
unformat (line_input,
"conn"))
2874 else if (
unformat (line_input,
"stream"))
2884 for (
int i = 0;
i < num_workers + 1;
i++)
2906 .path =
"quic set crypto api",
2907 .short_help =
"quic set crypto api [picotls|vpp]",
2912 .path =
"quic set fifo-size",
2913 .short_help =
"quic set fifo-size N[K|M|G] (default 64K)",
2918 .path =
"show quic",
2919 .short_help =
"show quic",
2924 .path =
"show quic crypto context",
2925 .short_help =
"list quic crypto contextes",
2930 .path =
"set quic max_packets_per_key",
2931 .short_help =
"set quic max_packets_per_key 16777216",
2935 .path =
"set quic cc",
2936 .short_help =
"set quic cc [reno|cubic]",
2941 .version = VPP_BUILD_VER,
2942 .description =
"Quic transport protocol",
2943 .default_disabled = 1,
2967 if (
tmp >= 0x100000000ULL)
2970 "fifo-size %llu (0x%llx) too large",
2976 else if (
unformat (input,
"conn-timeout %u", &
i))
2978 else if (
unformat (input,
"fifo-prealloc %u", &
i))
3005 .name =
"quic-input",
3006 .vector_size =
sizeof (
u32),
static u8 * format_quic_listener(u8 *s, va_list *args)
static uword quic_node_fn(vlib_main_t *vm, vlib_node_runtime_t *node, vlib_frame_t *frame)
int vnet_listen(vnet_listen_args_t *a)
@ QUIC_CONN_STATE_PASSIVE_CLOSING_APP_CLOSED
#define SESSION_CLI_STATE_LEN
static u8 svm_fifo_set_event(svm_fifo_t *f)
Set fifo event flag.
void * data
protocol specific data
#define QUIC_APP_ALLOCATION_ERROR
enum crypto_engine_type_ crypto_engine_type_t
session_handle_t udp_session_handle
static u32 vlib_num_workers()
u32 wrk_index
Worker index in global worker pool.
tw_timer_wheel_1t_3w_1024sl_ov_t timer_wheel
worker timer wheel
static void quic_udp_session_cleanup_callback(session_t *udp_session, session_cleanup_ntf_t ntf)
enum session_error_ session_error_t
static clib_error_t * quic_plugin_crypto_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static void quic_timer_expired(u32 conn_index)
static void quic_receive_connection(void *arg)
static int quic_connect_connection(session_endpoint_cfg_t *sep)
static u8 * format_quic_ctx(u8 *s, va_list *args)
int vnet_connect(vnet_connect_args_t *a)
vlib_main_t vlib_node_runtime_t vlib_frame_t * frame
u8 * format_crypto_context(u8 *s, va_list *args)
static clib_error_t * quic_config_fn(vlib_main_t *vm, unformat_input_t *input)
@ APP_OPTIONS_RX_FIFO_SIZE
u32 session_index
Index in thread pool where session was allocated.
crypto_context_t * crypto_ctx_pool
per thread pool of crypto contexes
static void quic_get_transport_endpoint(u32 ctx_index, u32 thread_index, transport_endpoint_t *tep, u8 is_lcl)
#define clib_memcpy(d, s, n)
static u8 * format_quic_connection(u8 *s, va_list *args)
#define SESSION_CLI_ID_LEN
@ SVM_FIFO_WANT_DEQ_NOTIF_IF_FULL
Notify on transition from full.
void quic_increment_counter(u8 evt, u8 val)
static vlib_cli_command_t quic_plugin_crypto_command
(constructor) VLIB_CLI_COMMAND (quic_plugin_crypto_command)
char quic_iv[17]
quic initialization vector
static quicly_context_t * quic_get_quicly_ctx_from_udp(u64 udp_session_handle)
static u8 * quic_format_quicly_stream_id(u8 *s, va_list *args)
void session_transport_closing_notify(transport_connection_t *tc)
Notification from transport that connection is being closed.
int svm_fifo_enqueue_with_offset(svm_fifo_t *f, u32 offset, u32 len, u8 *src)
Enqueue a future segment.
static int quic_ctx_is_conn(quic_ctx_t *ctx)
static clib_error_t * quic_set_cc_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
int64_t time_now
worker time
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
void session_get_endpoint(session_t *s, transport_endpoint_t *tep, u8 is_lcl)
static crypto_context_t * quic_crypto_context_get(u32 cr_index, u32 thread_index)
int vnet_unlisten(vnet_unlisten_args_t *a)
static int quic_on_stream_open(quicly_stream_open_t *self, quicly_stream_t *stream)
#define QUIC_MAX_PACKET_SIZE
void quic_fifo_egress_emit(quicly_stream_t *stream, size_t off, void *dst, size_t *len, int *wrote_all)
static u64 listen_session_get_handle(session_t *s)
#define QUIC_TIMER_HANDLE_INVALID
static int quic_udp_session_connected_callback(u32 quic_app_index, u32 ctx_index, session_t *udp_session, session_error_t err)
#define QUIC_APP_CONNECT_NOTIFY_ERROR
int svm_fifo_peek(svm_fifo_t *f, u32 offset, u32 len, u8 *dst)
Peek data from fifo.
static void quic_store_conn_ctx(quicly_conn_t *conn, quic_ctx_t *ctx)
@ VLIB_NODE_TYPE_INTERNAL
static void clib_mem_free(void *p)
@ QUIC_CONN_STATE_PASSIVE_CLOSING_QUIC_CLOSED
int load_bio_certificate_chain(ptls_context_t *ctx, const char *cert_data)
vlib_main_t vlib_node_runtime_t * node
static void quic_disconnect_transport(quic_ctx_t *ctx)
quic_session_cache_t session_cache
u32 app_rx_data_len
bytes received, to be read by external app
#define clib_error_return(e, args...)
struct _session_endpoint_cfg session_endpoint_cfg_t
static quicly_context_t * quic_get_quicly_ctx_from_ctx(quic_ctx_t *ctx)
static int quic_send_datagram(session_t *udp_session, struct iovec *packet, quicly_address_t *dest, quicly_address_t *src)
static u32 quic_set_time_now(u32 thread_index)
static void quic_update_conn_ctx(quicly_conn_t *conn, quicly_context_t *quicly_context)
static clib_error_t * quic_init(vlib_main_t *vm)
static void quic_connection_delete(quic_ctx_t *ctx)
struct _transport_proto_vft transport_proto_vft_t
static void quic_check_quic_session_connected(quic_ctx_t *ctx)
vlib_error_main_t error_main
static void quic_update_fifo_size()
#define APP_INVALID_INDEX
static clib_error_t * quic_set_max_packets_per_key_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static void quic_crypto_context_make_key_from_crctx(clib_bihash_kv_24_8_t *kv, crypto_context_t *crctx)
u8 thread_index
Index of the thread that allocated the session.
#define pool_put(P, E)
Free an object E in pool P.
ptls_cipher_suite_t * quic_crypto_cipher_suites[]
session_type_t session_type
Type built from transport and network protocol types.
static u32 quic_ctx_alloc(u32 thread_index)
static vlib_cli_command_t quic_show_ctx_command
(constructor) VLIB_CLI_COMMAND (quic_show_ctx_command)
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
static session_t * get_stream_session_and_ctx_from_stream(quicly_stream_t *stream, quic_ctx_t **ctx)
static u32 quic_stop_listen(u32 lctx_index)
@ SESSION_IO_EVT_BUILTIN_TX
static u8 * format_quic_half_open(u8 *s, va_list *args)
static void quic_crypto_context_make_key_from_ctx(clib_bihash_kv_24_8_t *kv, quic_ctx_t *ctx)
description malformed packet
struct _vnet_unlisten_args_t vnet_unlisten_args_t
u32 n_subscribers
refcount of sessions using said context
@ APP_OPTIONS_SEGMENT_SIZE
static u32 session_thread_from_handle(session_handle_t handle)
int load_bio_private_key(ptls_context_t *ctx, const char *pk_data)
static quic_ctx_t * quic_ctx_get_if_valid(u32 ctx_index, u32 thread_index)
struct _transport_connection transport_connection_t
static transport_proto_t session_type_transport_proto(session_type_t st)
static void quic_udp_session_disconnect_callback(session_t *s)
#define clib_bitmap_alloc(v, n_bits)
Allocate a bitmap with the supplied number of bits.
static_always_inline void * clib_memcpy_fast(void *restrict dst, const void *restrict src, size_t n)
static int quic_ctx_is_listener(quic_ctx_t *ctx)
int quic_udp_session_accepted_callback(session_t *udp_session)
#define SESSION_CONN_HDR_LEN
#define VLIB_EARLY_CONFIG_FUNCTION(x, n,...)
int(* session_accept_callback)(session_t *new_session)
Notify server of newly accepted session.
u8 hostname[256]
full domain len is 255 as per rfc 3986
static void quic_stop_ctx_timer(quic_ctx_t *ctx)
static quicly_closed_by_remote_t on_closed_by_remote
static void quic_set_udp_tx_evt(session_t *udp_session)
struct _svm_fifo svm_fifo_t
static int quic_custom_app_rx_callback(transport_connection_t *tc)
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
static clib_error_t * quic_plugin_set_fifo_size_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
@ QUIC_PACKET_TYPE_ACCEPT
static void quic_on_receive(quicly_stream_t *stream, size_t off, const void *src, size_t len)
application_t * application_get(u32 app_index)
#define foreach_vlib_main()
#define QUIC_SEND_PACKET_VEC_SIZE
static void quic_udp_session_migrate_callback(session_t *s, session_handle_t new_sh)
u32 app_wrk_index
Index of the app worker that owns the session.
#define pool_foreach(VAR, POOL)
Iterate through pool.
int app_worker_init_connected(app_worker_t *app_wrk, session_t *s)
static transport_connection_t * quic_listener_get(u32 listener_index)
u8 app_crypto_engine_n_types(void)
svm_fifo_t * rx_fifo
Pointers to rx/tx buffers.
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
@ QUIC_PACKET_TYPE_RECEIVE
static uword clib_bitmap_get(uword *ai, uword i)
Gets the ith bit value from a bitmap.
static int64_t quic_get_thread_time(u8 thread_index)
#define QUIC_DEFAULT_CONN_TIMEOUT
struct _vnet_disconnect_args_t vnet_disconnect_args_t
static void quic_register_cipher_suite(crypto_engine_type_t type, ptls_cipher_suite_t **ciphers)
static session_cb_vft_t quic_app_cb_vft
quic_worker_ctx_t * wrk_ctx
segment_manager_props_t * application_get_segment_manager_properties(u32 app_index)
transport_connection_t * session_get_transport(session_t *s)
#define QUIC_DBG(_lvl, _fmt, _args...)
ptls_cipher_suite_t *** quic_ciphers
available ciphers by crypto engine
static u32 svm_fifo_max_enqueue(svm_fifo_t *f)
struct _segment_manager_props segment_manager_props_t
static int quic_custom_tx_callback(void *s, transport_send_params_t *sp)
#define QUIC_APP_ACCEPT_NOTIFY_ERROR
static_always_inline uword vlib_get_thread_index(void)
app_worker_t * app_worker_get_if_valid(u32 wrk_index)
#define QUIC_RCV_MAX_PACKETS
int session_send_io_evt_to_thread_custom(void *data, u32 thread_index, session_evt_type_t evt_type)
struct _vnet_bind_args_t vnet_listen_args_t
static int quic_find_packet_ctx(quic_rx_packet_ctx_t *pctx, u32 caller_thread_index)
ptls_handshake_properties_t hs_properties
static void quic_on_quic_session_connected(quic_ctx_t *ctx)
static void quic_transfer_connection(u32 ctx_index, u32 dest_thread)
#define QUIC_DEFAULT_FIFO_SIZE
u8 * quic_format_err(u8 *s, va_list *args)
static int quic_connect_stream(session_t *quic_session, session_endpoint_cfg_t *sep)
if(node->flags &VLIB_NODE_FLAG_TRACE) vnet_interface_output_trace(vm
int svm_fifo_enqueue_segments(svm_fifo_t *f, const svm_fifo_seg_t segs[], u32 n_segs, u8 allow_partial)
Enqueue array of svm_fifo_seg_t in order.
@ TRANSPORT_SERVICE_APP
app transport service
static void vlib_node_increment_counter(vlib_main_t *vm, u32 node_index, u32 counter_index, u64 increment)
static vlib_node_t * vlib_get_node(vlib_main_t *vm, u32 i)
Get vlib node by index.
static void quic_udp_session_reset_callback(session_t *s)
static u32 transport_cl_thread(void)
static void quic_on_stop_sending(quicly_stream_t *stream, int err)
static crypto_context_t * quic_crypto_context_alloc(u8 thread_index)
void session_send_rpc_evt_to_thread(u32 thread_index, void *fp, void *rpc_args)
int svm_fifo_dequeue_drop(svm_fifo_t *f, u32 len)
Dequeue and drop bytes from fifo.
static u8 * quic_format_connection_ctx(u8 *s, va_list *args)
static int64_t quic_get_time(quicly_now_t *self)
static session_handle_t session_handle(session_t *s)
int svm_fifo_enqueue(svm_fifo_t *f, u32 len, const u8 *src)
Enqueue data to fifo.
@ TRANSPORT_CFG_F_CONNECTED
u32 ns_index
Namespace the application belongs to.
void transport_register_protocol(transport_proto_t transport_proto, const transport_proto_vft_t *vft, fib_protocol_t fib_proto, u32 output_node)
Register transport virtual function table.
vnet_feature_config_main_t * cm
u32 app_tx_data_len
bytes sent
#define pool_get(P, E)
Allocate an object E from a pool P (unspecified alignment).
quicly_cid_plaintext_t next_cid
static session_t * session_get_from_handle(session_handle_t handle)
clib_bihash_24_8_t crypto_context_hash
per thread [params:crypto_ctx_index] hash
static session_t * session_get_from_handle_if_valid(session_handle_t handle)
#define vec_validate(V, I)
Make sure vector is long enough for given index (no header, unspecified alignment)
int app_worker_init_accepted(session_t *s)
static void quic_on_closed_by_remote(quicly_closed_by_remote_t *self, quicly_conn_t *conn, int code, uint64_t frame_type, const char *reason, size_t reason_len)
#define VLIB_CLI_COMMAND(x,...)
u64 max_packets_per_key
number of packets that can be sent without a key update
u8 data[QUIC_MAX_PACKET_SIZE]
static void quic_crypto_context_free_if_needed(crypto_context_t *crctx, u8 thread_index)
static uword * clib_bitmap_set(uword *ai, uword i, uword value)
Sets the ith bit of a bitmap to new_value Removes trailing zeros from the bitmap.
quicly_conn_t * conn
QUIC ctx case.
quicly_decoded_packet_t packet
static vlib_cli_command_t quic_plugin_set_fifo_size_command
(constructor) VLIB_CLI_COMMAND (quic_plugin_set_fifo_size_command)
struct _vlib_node_registration vlib_node_registration_t
static session_t * session_get(u32 si, u32 thread_index)
int vnet_disconnect_session(vnet_disconnect_args_t *a)
void vlib_cli_output(vlib_main_t *vm, char *fmt,...)
@ QUIC_PACKET_TYPE_MIGRATE
void session_transport_delete_notify(transport_connection_t *tc)
Notification from transport that connection is being deleted.
int app_worker_connect_notify(app_worker_t *app_wrk, session_t *s, session_error_t err, u32 opaque)
static void quic_ctx_free(quic_ctx_t *ctx)
static void quic_build_sockaddr(struct sockaddr *sa, socklen_t *salen, ip46_address_t *addr, u16 port, u8 is_ip4)
quicly_crypto_engine_t quic_crypto_engine
static u8 * quic_format_quicly_conn_id(u8 *s, va_list *args)
@ APP_OPTIONS_PREALLOC_FIFO_PAIRS
static void quic_show_aggregated_stats(vlib_main_t *vm)
static clib_error_t * quic_show_connections_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
vnet_crypto_main_t crypto_main
@ TRANSPORT_TX_INTERNAL
apps acting as transports
session_handle_t listener_handle
Parent listener session index if the result of an accept.
app_listener_t * app_listener_get_w_handle(session_handle_t handle)
Get app listener for listener session handle.
static session_type_t session_type_from_proto_and_ip(transport_proto_t proto, u8 is_ip4)
int vnet_application_attach(vnet_app_attach_args_t *a)
Attach application to vpp.
static void quic_accept_connection(quic_rx_packet_ctx_t *pctx)
static void quic_expired_timers_dispatch(u32 *expired_timers)
u32 vnet_crypto_key_add(vlib_main_t *vm, vnet_crypto_alg_t alg, u8 *data, u16 length)
static void quic_on_stream_destroy(quicly_stream_t *stream, int err)
#define QUIC_ERR(_fmt, _args...)
#define vec_free(V)
Free vector's memory (no header).
static u32 quic_start_listen(u32 quic_listen_session_index, transport_endpoint_t *tep)
u32 ctx_index
index in crypto context pool
static const transport_proto_vft_t quic_proto
@ APP_OPTIONS_TX_FIFO_SIZE
quicly_stream_t * stream
STREAM ctx case.
#define QUIC_ASSERT(truth)
@ TRANSPORT_CONNECTION_F_NO_LOOKUP
Don't register connection in lookup.
#define DEFAULT_MAX_PACKETS_PER_KEY
static u32 svm_fifo_max_enqueue_prod(svm_fifo_t *f)
Maximum number of bytes that can be enqueued into fifo.
u64 * counters_last_clear
@ APP_OPTIONS_ADD_SEGMENT_SIZE
static char * quic_error_strings[]
description fragment has unexpected format
@ SVM_FIFO_WANT_DEQ_NOTIF_IF_EMPTY
Notify on transition to empty.
static quicly_stream_open_t on_stream_open
static int quic_send_packets(quic_ctx_t *ctx)
segment_manager_props_t sm_properties
Segment manager properties.
ptls_encrypt_ticket_t super
format_function_t format_ip46_address
static session_t * session_get_if_valid(u64 si, u32 thread_index)
u32 opaque
Opaque, for general use.
u8 default_crypto_engine
Used if you do connect with CRYPTO_ENGINE_NONE (0)
quic_ctx_t * quic_get_conn_ctx(quicly_conn_t *conn)
@ SESSION_CLEANUP_SESSION
#define VLIB_INIT_FUNCTION(x)
static struct option options[]
static int quic_app_cert_key_pair_delete_callback(app_cert_key_pair_t *ckpair)
int app_worker_lock_and_send_event(app_worker_t *app, session_t *s, u8 evt_type)
Send event to application.
static u8 * quic_format_listener_ctx(u8 *s, va_list *args)
static int quic_reset_connection(u64 udp_session_handle, quic_rx_packet_ctx_t *pctx)
static void quic_common_get_transport_endpoint(quic_ctx_t *ctx, transport_endpoint_t *tep, u8 is_lcl)
static const quicly_stream_callbacks_t quic_stream_callbacks
static void quic_on_receive_reset(quicly_stream_t *stream, int err)
app_worker_t * app_worker_get(u32 wrk_index)
@ QUIC_CONN_STATE_HANDSHAKE
struct _vnet_connect_args vnet_connect_args_t
static void quic_ack_rx_data(session_t *stream_session)
@ QUIC_CONN_STATE_PASSIVE_CLOSING
@ TRANSPORT_CFG_F_UNIDIRECTIONAL
static void quic_make_connection_key(clib_bihash_kv_16_8_t *kv, const quicly_cid_plaintext_t *id)
static u8 * quic_format_stream_ctx(u8 *s, va_list *args)
#define SESSION_INVALID_HANDLE
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
static vlib_cli_command_t quic_set_cc
(constructor) VLIB_CLI_COMMAND (quic_set_cc)
vlib_node_registration_t quic_input_node
(constructor) VLIB_REGISTER_NODE (quic_input_node)
uword * available_crypto_engines
Bitmap for registered engines.
static vlib_main_t * vlib_get_main(void)
f64 tstamp_ticks_per_clock
static int quic_connect(transport_endpoint_cfg_t *tep)
#define QUIC_TSTAMP_RESOLUTION
clib_error_t *() vlib_init_function_t(struct vlib_main_t *vm)
static void quic_connection_closed(quic_ctx_t *ctx)
Called when quicly return an error This function interacts tightly with quic_proto_on_close.
#define vec_terminate_c_string(V)
(If necessary) NULL terminate a vector containing a c-string.
static int quic_sendable_packet_count(session_t *udp_session)
static void quic_get_transport_listener_endpoint(u32 listener_index, transport_endpoint_t *tep, u8 is_lcl)
static int quic_init_crypto_context(crypto_context_t *crctx, quic_ctx_t *ctx)
static void quic_release_crypto_context(u32 crypto_context_index, u8 thread_index)
static clib_error_t * quic_list_crypto_context_command_fn(vlib_main_t *vm, unformat_input_t *input, vlib_cli_command_t *cmd)
static void svm_fifo_reset_has_deq_ntf(svm_fifo_t *f)
Clear has notification flag.
static int quic_acquire_crypto_context(quic_ctx_t *ctx)
#define clib_warning(format, args...)
static int quic_udp_session_rx_callback(session_t *udp_session)
int quic_encrypt_ticket_cb(ptls_encrypt_ticket_t *_self, ptls_t *tls, int is_encrypt, ptls_buffer_t *dst, ptls_iovec_t src)
static vlib_cli_command_t quic_set_max_packets_per_key
(constructor) VLIB_CLI_COMMAND (quic_set_max_packets_per_key)
@ QUIC_CONN_STATE_ACTIVE_CLOSING
static int quic_ctx_is_stream(quic_ctx_t *ctx)
app_cert_key_pair_t * app_cert_key_pair_get_if_valid(u32 index)
#define QUIC_SESSION_INVALID
static int quic_process_one_rx_packet(u64 udp_session_handle, svm_fifo_t *f, u32 fifo_offset, quic_rx_packet_ctx_t *pctx)
static int quic_add_segment_callback(u32 client_index, u64 seg_handle)
static f64 vlib_time_now(vlib_main_t *vm)
u32 * per_thread_crypto_key_indices
int vlib_main(vlib_main_t *volatile vm, unformat_input_t *input)
void quic_fifo_egress_shift(quicly_stream_t *stream, size_t delta)
struct _vnet_app_attach_args_t vnet_app_attach_args_t
u32 app_index
Index of owning app.
u32 quic_connection_ctx_id
static quicly_now_t quicly_vpp_now_cb
#define session_cli_return_if_not_enabled()
static quic_ctx_t * quic_ctx_get(u32 ctx_index, u32 thread_index)
void session_transport_reset_notify(transport_connection_t *tc)
Notify application that connection has been reset.
static vlib_thread_main_t * vlib_get_thread_main()
u32 ckpair_index
certificate & key
static u32 svm_fifo_max_dequeue_cons(svm_fifo_t *f)
Fifo max bytes to dequeue optimized for consumer.
static void svm_fifo_add_want_deq_ntf(svm_fifo_t *f, u8 ntf_type)
Set specific want notification flag.
int app_worker_accept_notify(app_worker_t *app_wrk, session_t *s)
static void quic_update_time(f64 now, u8 thread_index)
session_t * app_listener_get_session(app_listener_t *al)
session_t * session_alloc(u32 thread_index)
int session_send_io_evt_to_thread(svm_fifo_t *f, session_evt_type_t evt_type)
volatile u8 session_state
State in session layer state machine.
static void quic_update_timer(quic_ctx_t *ctx)
static void quic_proto_on_close(u32 ctx_index, u32 thread_index)
u32 connection_index
Index of the transport connection associated to the session.
static void * clib_mem_alloc(uword size)
static transport_connection_t * quic_connection_get(u32 ctx_index, u32 thread_index)
static u64 quic_get_counter_value(u32 event_code)
int vnet_app_add_cert_key_interest(u32 index, u32 app_index)
Ask for app cb on pair deletion.
#define QUIC_ERROR_FULL_FIFO
static vlib_cli_command_t quic_list_crypto_context_command
(constructor) VLIB_CLI_COMMAND (quic_list_crypto_context_command)
vl_api_fib_path_type_t type
static session_t * listen_session_get_from_handle(session_handle_t handle)
static int quic_del_segment_callback(u32 client_index, u64 seg_handle)
#define QUIC_APP_ERROR_CLOSE_NOTIFY
static u32 svm_fifo_max_dequeue(svm_fifo_t *f)
Fifo max bytes to dequeue.
clib_bihash_16_8_t connection_hash
quic connection id -> conn handle
#define VLIB_REGISTER_NODE(x,...)
void quic_crypto_decrypt_packet(quic_ctx_t *qctx, quic_rx_packet_ctx_t *pctx)