Skip to content

Commit

Permalink
QUIC TXP: Allow QLOG instance retrieval via callback
Browse files Browse the repository at this point in the history
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #23535)
  • Loading branch information
hlandau authored and t8m committed Feb 19, 2024
1 parent 9f2349a commit 6f09c80
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
10 changes: 6 additions & 4 deletions include/internal/quic_txp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
11 changes: 7 additions & 4 deletions ssl/quic/quic_txp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 6f09c80

Please sign in to comment.