- return 0;
-}
-
-static int
-quic_create_connection (u32 ctx_index, struct sockaddr *sa,
- socklen_t salen, quicly_decoded_packet_t packet)
-{
- clib_bihash_kv_16_8_t kv;
- quic_ctx_t *ctx;
- quicly_conn_t *conn;
- u32 thread_index = vlib_get_thread_index ();
- quicly_context_t *quicly_ctx;
- int rv;
-
- /* new connection, accept and create context if packet is valid
- * TODO: check if socket is actually listening? */
- ctx = quic_ctx_get (ctx_index, thread_index);
- quicly_ctx = quic_get_quicly_ctx_from_ctx (ctx);
- if ((rv = quicly_accept (&conn, quicly_ctx, NULL, sa,
- &packet, NULL, &quic_main.next_cid, NULL)))
- {
- /* Invalid packet, pass */
- assert (conn == NULL);
- QUIC_DBG (1, "Accept failed with %d", rv);
- /* TODO: cleanup created quic ctx and UDP session */
- return 0;
- }
- assert (conn != NULL);
-
- ++quic_main.next_cid.master_id;
- /* Save ctx handle in quicly connection */
- quic_store_conn_ctx (conn, ctx);
- ctx->conn = conn;
- ctx->conn_state = QUIC_CONN_STATE_HANDSHAKE;
-
- quic_create_quic_session (ctx);