*/
#define DEFAULT_MAX_ACK_DELAY QUIC_DEFAULT_MAX_ACK_DELAY
+DEFINE_LIST_OF_IMPL(ch, QUIC_CHANNEL);
+
static void ch_save_err_state(QUIC_CHANNEL *ch);
static void ch_rx_pre(QUIC_CHANNEL *ch);
static int ch_rx(QUIC_CHANNEL *ch, int channel_only);
ch_update_idle(ch);
ossl_quic_reactor_init(&ch->rtor, ch_tick, ch,
ch_determine_next_tick_deadline(ch));
+ ossl_list_ch_insert_tail(&ch->port->channel_list, ch);
+ ch->on_port_list = 1;
return 1;
err:
OPENSSL_free(srte);
}
lh_QUIC_SRT_ELEM_free(ch->srt_hash_tok);
+ if (ch->on_port_list) {
+ ossl_list_ch_remove(&ch->port->channel_list, ch);
+ ch->on_port_list = 0;
+ }
}
QUIC_CHANNEL *ossl_quic_channel_new(const QUIC_CHANNEL_ARGS *args)
struct quic_channel_st {
QUIC_PORT *port;
+ /*
+ * QUIC_PORT keeps the channels which belong to it on a list for bookkeeping
+ * purposes.
+ */
+ OSSL_LIST_MEMBER(ch, struct quic_channel_st);
+
/*
* The associated TLS 1.3 connection data. Used to provide the handshake
* layer; its 'network' side is plugged into the crypto stream for each EL
/* Are we using addressed mode? */
unsigned int addressed_mode : 1;
+ /* Are we on the QUIC_PORT linked list of channels? */
+ unsigned int on_port_list : 1;
+
/* Saved error stack in case permanent error was encountered */
ERR_STATE *err_state;
static void port_tick(QUIC_TICK_RESULT *res, void *arg, uint32_t flags);
//static void port_default_packet_handler(QUIC_URXE *e, void *arg);
+DEFINE_LIST_OF_IMPL(ch, QUIC_CHANNEL);
+
QUIC_PORT *ossl_quic_port_new(const QUIC_PORT_ARGS *args)
{
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;
}
# include "internal/quic_port.h"
# include "internal/quic_reactor.h"
+# include "internal/list.h"
# ifndef OPENSSL_NO_QUIC
*
* Other components should not include this header.
*/
+DECLARE_LIST_OF(ch, QUIC_CHANNEL);
+
struct quic_port_st {
OSSL_LIB_CTX *libctx;
const char *propq;
/* RX demuxer. We register incoming DCIDs with this. */
QUIC_DEMUX *demux;
+
+ /* List of all child channels. */
+ OSSL_LIST(ch) channel_list;
};
# endif