Skip to content

Commit

Permalink
QUIC PORT: Add SRTM wiring
Browse files Browse the repository at this point in the history
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from #22674)
  • Loading branch information
hlandau committed Dec 21, 2023
1 parent 073e5bc commit a4be37b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ssl/quic/quic_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand All @@ -95,8 +100,12 @@ static int port_init(QUIC_PORT *port)
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)
Expand Down
6 changes: 6 additions & 0 deletions ssl/quic/quic_port_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down

0 comments on commit a4be37b

Please sign in to comment.