summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2024-01-22 13:15:08 +0000
committerHugo Landau <hlandau@openssl.org>2024-02-08 16:50:00 +0000
commita774062466d3d2d2908c4f076a9cbbd2cb00738a (patch)
treec91d5b68b054dc7be2eade445ea204359842d337 /ssl
parente203d1b542eba8dd7ae53b3def2abf8482acc4d8 (diff)
QUIC RXFC: Add accessor for credit
Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/23360)
Diffstat (limited to 'ssl')
-rw-r--r--ssl/quic/quic_fc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/ssl/quic/quic_fc.c b/ssl/quic/quic_fc.c
index 750e896306..7e36aab09e 100644
--- a/ssl/quic/quic_fc.c
+++ b/ssl/quic/quic_fc.c
@@ -359,21 +359,26 @@ int ossl_quic_rxfc_on_retire(QUIC_RXFC *rxfc,
return 1;
}
-uint64_t ossl_quic_rxfc_get_cwm(QUIC_RXFC *rxfc)
+uint64_t ossl_quic_rxfc_get_cwm(const QUIC_RXFC *rxfc)
{
return rxfc->cwm;
}
-uint64_t ossl_quic_rxfc_get_swm(QUIC_RXFC *rxfc)
+uint64_t ossl_quic_rxfc_get_swm(const QUIC_RXFC *rxfc)
{
return rxfc->swm;
}
-uint64_t ossl_quic_rxfc_get_rwm(QUIC_RXFC *rxfc)
+uint64_t ossl_quic_rxfc_get_rwm(const QUIC_RXFC *rxfc)
{
return rxfc->rwm;
}
+uint64_t ossl_quic_rxfc_get_credit(const QUIC_RXFC *rxfc)
+{
+ return ossl_quic_rxfc_get_cwm(rxfc) - ossl_quic_rxfc_get_swm(rxfc);
+}
+
int ossl_quic_rxfc_has_cwm_changed(QUIC_RXFC *rxfc, int clear)
{
int r = rxfc->has_cwm_changed;