From: Hugo Landau Date: Mon, 12 Feb 2024 09:50:42 +0000 (+0000) Subject: QUIC TXP: Allow QLOG instance retrieval via callback X-Git-Tag: openssl-3.3.0-alpha1~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f09c8071af8328b1dac1914bea4533cac182204;p=thirdparty%2Fopenssl.git QUIC TXP: Allow QLOG instance retrieval via callback Reviewed-by: Matt Caswell Reviewed-by: Neil Horman Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/23535) --- diff --git a/include/internal/quic_txp.h b/include/internal/quic_txp.h index a6d38a2ba9e..9c05acc9a50 100644 --- a/include/internal/quic_txp.h +++ b/include/internal/quic_txp.h @@ -50,7 +50,8 @@ typedef struct ossl_quic_tx_packetiser_args_st { OSSL_CC_DATA *cc_data; /* QUIC Congestion Controller Instance */ OSSL_TIME (*now)(void *arg); /* Callback to get current time. */ void *now_arg; - QLOG *qlog; /* Optional QLOG instance */ + QLOG *(*get_qlog_cb)(void *arg); /* Optional QLOG retrieval func */ + void *get_qlog_cb_arg; /* * Injected dependencies - crypto streams. @@ -139,10 +140,11 @@ int ossl_quic_tx_packetiser_set_peer(OSSL_QUIC_TX_PACKETISER *txp, const BIO_ADDR *peer); /* - * Change the QLOG instance in use after instantiation. + * Change the QLOG instance retrieval function in use after instantiation. */ -void ossl_quic_tx_packetiser_set0_qlog(OSSL_QUIC_TX_PACKETISER *txp, - QLOG *qlog); +void ossl_quic_tx_packetiser_set_qlog_cb(OSSL_QUIC_TX_PACKETISER *txp, + QLOG *(*get_qlog_cb)(void *arg), + void *get_qlog_cb_arg); /* * Inform the TX packetiser that an EL has been discarded. Idempotent. diff --git a/ssl/quic/quic_txp.c b/ssl/quic/quic_txp.c index 1327ba83bbe..7cbb1d95782 100644 --- a/ssl/quic/quic_txp.c +++ b/ssl/quic/quic_txp.c @@ -482,7 +482,8 @@ OSSL_QUIC_TX_PACKETISER *ossl_quic_tx_packetiser_new(const OSSL_QUIC_TX_PACKETIS on_regen_notify, txp, on_confirm_notify, txp, on_sstream_updated, txp, - args->qlog)) { + args->get_qlog_cb, + args->get_qlog_cb_arg)) { OPENSSL_free(txp); return NULL; } @@ -626,10 +627,12 @@ void ossl_quic_tx_packetiser_set_ack_tx_cb(OSSL_QUIC_TX_PACKETISER *txp, txp->ack_tx_cb_arg = cb_arg; } -void ossl_quic_tx_packetiser_set0_qlog(OSSL_QUIC_TX_PACKETISER *txp, - QLOG *qlog) +void ossl_quic_tx_packetiser_set_qlog_cb(OSSL_QUIC_TX_PACKETISER *txp, + QLOG *(*get_qlog_cb)(void *arg), + void *get_qlog_cb_arg) { - ossl_quic_fifd_set0_qlog(&txp->fifd, qlog); + ossl_quic_fifd_set_qlog_cb(&txp->fifd, get_qlog_cb, get_qlog_cb_arg); + } int ossl_quic_tx_packetiser_discard_enc_level(OSSL_QUIC_TX_PACKETISER *txp,