diff options
author | Hugo Landau <hlandau@openssl.org> | 2022-09-15 13:48:50 +0200 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2022-11-07 19:18:05 +0100 |
commit | 0ede517cfa73fd3566d2ecd32215b4b12dd1d3b5 (patch) | |
tree | 8e1b0fba1fd7bb883826178813b65569f7667e4d /include | |
parent | QUIC TXPIM (diff) | |
download | openssl-0ede517cfa73fd3566d2ecd32215b4b12dd1d3b5.tar.xz openssl-0ede517cfa73fd3566d2ecd32215b4b12dd1d3b5.zip |
QUIC FIFD
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19206)
Diffstat (limited to 'include')
-rw-r--r-- | include/internal/quic_fifd.h | 56 | ||||
-rw-r--r-- | include/internal/quic_txpim.h | 9 |
2 files changed, 64 insertions, 1 deletions
diff --git a/include/internal/quic_fifd.h b/include/internal/quic_fifd.h new file mode 100644 index 0000000000..15952e43d8 --- /dev/null +++ b/include/internal/quic_fifd.h @@ -0,0 +1,56 @@ +/* + * Copyright 2022 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OSSL_QUIC_FIFD_H +# define OSSL_QUIC_FIFD_H + +# include <openssl/ssl.h> +# include "internal/quic_types.h" +# include "internal/quic_cfq.h" +# include "internal/quic_ackm.h" +# include "internal/quic_txpim.h" +# include "internal/quic_stream.h" + +/* + * QUIC Frame-in-Flight Dispatcher (FIFD) + * ====================================== + */ +struct quic_fifd_st { + /* Internal data; use the ossl_quic_fifd functions. */ + QUIC_CFQ *cfq; + OSSL_ACKM *ackm; + QUIC_TXPIM *txpim; + QUIC_SSTREAM *(*get_sstream_by_id)(uint64_t stream_id, + void *arg); + void *get_sstream_by_id_arg; + void (*regen_frame)(uint64_t frame_type, + uint64_t stream_id, + void *arg); + void *regen_frame_arg; +}; + +int ossl_quic_fifd_init(QUIC_FIFD *fifd, + QUIC_CFQ *cfq, + OSSL_ACKM *ackm, + QUIC_TXPIM *txpim, + /* stream_id is UINT64_MAX for the crypto stream */ + QUIC_SSTREAM *(*get_sstream_by_id)(uint64_t stream_id, + void *arg), + void *get_sstream_by_id_arg, + /* stream_id is UINT64_MAX if not applicable */ + void (*regen_frame)(uint64_t frame_type, + uint64_t stream_id, + void *arg), + void *regen_frame_arg); + +void ossl_quic_fifd_cleanup(QUIC_FIFD *fifd); /* (no-op) */ + +int ossl_quic_fifd_pkt_commit(QUIC_FIFD *fifd, QUIC_TXPIM_PKT *pkt); + +#endif diff --git a/include/internal/quic_txpim.h b/include/internal/quic_txpim.h index 623004e79d..087d13363f 100644 --- a/include/internal/quic_txpim.h +++ b/include/internal/quic_txpim.h @@ -35,7 +35,8 @@ typedef struct quic_txpim_pkt_st { /* Regenerate-strategy frames. */ unsigned int had_handshake_done_frame : 1; unsigned int had_max_data_frame : 1; - unsigned int had_max_streams_frame : 1; + unsigned int had_max_streams_bidi_frame : 1; + unsigned int had_max_streams_uni_frame : 1; unsigned int had_ack_frame : 1; /* Private data follows. */ @@ -106,4 +107,10 @@ const QUIC_TXPIM_CHUNK *ossl_quic_txpim_pkt_get_chunks(QUIC_TXPIM_PKT *fpkt); */ size_t ossl_quic_txpim_pkt_get_num_chunks(QUIC_TXPIM_PKT *fpkt); +/* + * Returns the number of QUIC_TXPIM_PKTs allocated by the given TXPIM that have + * yet to be returned to the TXPIM. + */ +size_t ossl_quic_txpim_get_in_use(QUIC_TXPIM *txpim); + #endif |