QUIC QRX: Remove legacy DEMUX-QRX routing code
authorHugo Landau <hlandau@openssl.org>
Thu, 9 Nov 2023 10:27:14 +0000 (10:27 +0000)
committerHugo Landau <hlandau@openssl.org>
Thu, 21 Dec 2023 08:12:00 +0000 (08:12 +0000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22674)

include/internal/quic_record_rx.h
ssl/quic/quic_record_rx.c

index c4ed5a71d380e75748fa5be86c4e06b9532dbc6f..cc2d6e94d8ff4b07e6ff3a0630c441ff9c8f72a0 100644 (file)
@@ -28,7 +28,7 @@ typedef struct ossl_qrx_args_st {
     OSSL_LIB_CTX   *libctx;
     const char     *propq;
 
-    /* Demux to receive datagrams from. */
+    /* Demux which owns the URXEs passed to us. */
     QUIC_DEMUX     *demux;
 
     /* Length of connection IDs used in short-header packets in bytes. */
@@ -66,40 +66,6 @@ void ossl_qrx_set_msg_callback(OSSL_QRX *qrx, ossl_msg_cb msg_callback,
 void ossl_qrx_set_msg_callback_arg(OSSL_QRX *qrx,
                                    void *msg_callback_arg);
 
-/*
- * DCID Management
- * ===============
- */
-
-/*
- * Adds a given DCID to the QRX. The QRX will register the DCID with the demuxer
- * so that incoming packets with that DCID are passed to the given QRX. Multiple
- * DCIDs may be associated with a QRX at any one time. You will need to add at
- * least one DCID after instantiating the QRX. A zero-length DCID is a valid
- * input to this function. This function fails if the DCID is already
- * registered.
- *
- * TODO(QUIC SERVER): DEPRECATED in favour of explicit routing by QUIC_PORT with
- * reference to QUIC_LCIDM. To be removed.
- *
- * Returns 1 on success or 0 on error.
- */
-int ossl_qrx_add_dst_conn_id(OSSL_QRX *qrx,
-                             const QUIC_CONN_ID *dst_conn_id);
-
-/*
- * Remove a DCID previously registered with ossl_qrx_add_dst_conn_id. The DCID
- * is unregistered from the demuxer. Fails if the DCID is not registered with
- * the demuxer.
- *
- * TODO(QUIC SERVER): DEPRECATED in favour of explicit routing by QUIC_PORT with
- * reference to QUIC_LCIDM. To be removed.
- *
- * Returns 1 on success or 0 on error.
- */
-int ossl_qrx_remove_dst_conn_id(OSSL_QRX *qrx,
-                                const QUIC_CONN_ID *dst_conn_id);
-
 /*
  * Secret Management
  * =================
index d35264e7a27af1c9c0e1364bf0463e4e2446e17e..393007df50fc95182bf3280105ded1c9b15c4796 100644 (file)
@@ -167,8 +167,6 @@ struct ossl_qrx_st {
     SSL *msg_callback_ssl;
 };
 
-static void qrx_on_rx(QUIC_URXE *urxe, void *arg, const QUIC_CONN_ID *dcid);
-
 OSSL_QRX *ossl_qrx_new(const OSSL_QRX_ARGS *args)
 {
     OSSL_QRX *qrx;
@@ -222,9 +220,6 @@ void ossl_qrx_free(OSSL_QRX *qrx)
     if (qrx == NULL)
         return;
 
-    /* Unregister from the RX DEMUX. */
-    ossl_quic_demux_unregister_by_cb(qrx->demux, qrx_on_rx, qrx);
-
     /* Free RXE queue data. */
     qrx_cleanup_rxl(&qrx->rx_free);
     qrx_cleanup_rxl(&qrx->rx_pending);
@@ -252,28 +247,6 @@ void ossl_qrx_inject_urxe(OSSL_QRX *qrx, QUIC_URXE *urxe)
                           qrx->msg_callback_arg);
 }
 
-static void qrx_on_rx(QUIC_URXE *urxe, void *arg, const QUIC_CONN_ID *dcid)
-{
-    OSSL_QRX *qrx = arg;
-
-    ossl_qrx_inject_urxe(qrx, urxe);
-}
-
-int ossl_qrx_add_dst_conn_id(OSSL_QRX *qrx,
-                             const QUIC_CONN_ID *dst_conn_id)
-{
-    return ossl_quic_demux_register(qrx->demux,
-                                    dst_conn_id,
-                                    qrx_on_rx,
-                                    qrx);
-}
-
-int ossl_qrx_remove_dst_conn_id(OSSL_QRX *qrx,
-                                const QUIC_CONN_ID *dst_conn_id)
-{
-    return ossl_quic_demux_unregister(qrx->demux, dst_conn_id);
-}
-
 static void qrx_requeue_deferred(OSSL_QRX *qrx)
 {
     QUIC_URXE *e;