QUIC PORT: Add SRTM wiring
authorHugo Landau <hlandau@openssl.org>
Thu, 9 Nov 2023 10:27:13 +0000 (10:27 +0000)
committerHugo Landau <hlandau@openssl.org>
Thu, 21 Dec 2023 08:11:59 +0000 (08:11 +0000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22674)

ssl/quic/quic_port.c
ssl/quic/quic_port_local.h

index ee4b2900e05830a5eed8d32b00e8b1cef2153d3a..b128477c0a846f245bde208d6c925d18f6a3d2d6 100644 (file)
@@ -9,6 +9,8 @@
 
 #include "internal/quic_port.h"
 #include "internal/quic_channel.h"
+#include "internal/quic_lcidm.h"
+#include "internal/quic_srtm.h"
 #include "quic_port_local.h"
 #include "quic_channel_local.h"
 #include "../ssl_local.h"
@@ -82,6 +84,9 @@ static int port_init(QUIC_PORT *port)
                                         port_default_packet_handler,
                                         port);
 
+    if ((port->srtm = ossl_quic_srtm_new(port->libctx, port->propq)) == NULL)
+        goto err;
+
     ossl_quic_reactor_init(&port->rtor, port_tick, port, ossl_time_zero());
     port->rx_short_dcid_len = (unsigned char)rx_short_dcid_len;
     port->tx_init_dcid_len  = INIT_DCID_LEN;
@@ -95,8 +100,12 @@ err:
 static void port_cleanup(QUIC_PORT *port)
 {
     assert(ossl_list_ch_num(&port->channel_list) == 0);
+
     ossl_quic_demux_free(port->demux);
     port->demux = NULL;
+
+    ossl_quic_srtm_free(port->srtm);
+    port->srtm = NULL;
 }
 
 QUIC_REACTOR *ossl_quic_port_get0_reactor(QUIC_PORT *port)
index ad6638eb2f02a5d4d0d7f50f2d71dfdcf8b1d0cc..bfcc5896e1411f1dd895f0cc17881cde862977ca 100644 (file)
@@ -52,6 +52,12 @@ struct quic_port_st {
     /* Special TSERVER channel. To be removed in the future. */
     QUIC_CHANNEL                    *tserver_ch;
 
+    /* LCIDM used for incoming packet routing by DCID. */
+    QUIC_LCIDM                      *lcidm;
+
+    /* SRTM used for incoming packet routing by SRT. */
+    QUIC_SRTM                       *srtm;
+
     /* DCID length used for incoming short header packets. */
     unsigned char                   rx_short_dcid_len;
     /* For clients, CID length used for outgoing Initial packets. */