From 56a1a0ad2438d8cacdedb9413cc5dd8823e7b805 Mon Sep 17 00:00:00 2001 From: Hugo Landau Date: Mon, 31 Oct 2022 15:54:14 +0000 Subject: QUIC: Add transport parameter and other constants Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/19703) --- include/internal/quic_stream_map.h | 2 +- include/internal/quic_types.h | 3 +++ include/internal/quic_wire.h | 19 +++++++++++++++++++ ssl/quic/quic_stream_map.c | 3 +++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/include/internal/quic_stream_map.h b/include/internal/quic_stream_map.h index 7158334219..5f0e0347e4 100644 --- a/include/internal/quic_stream_map.h +++ b/include/internal/quic_stream_map.h @@ -61,7 +61,7 @@ struct quic_stream_st { uint64_t txp_txfc_new_credit_consumed; QUIC_SSTREAM *sstream; /* NULL if RX-only */ - void *rstream; /* NULL if TX only (placeholder) */ + QUIC_RSTREAM *rstream; /* NULL if TX only */ QUIC_TXFC txfc; /* NULL if RX-only */ QUIC_RXFC rxfc; /* NULL if TX-only */ unsigned int type : 8; /* QUIC_STREAM_INITIATOR_*, QUIC_STREAM_DIR_* */ diff --git a/include/internal/quic_types.h b/include/internal/quic_types.h index f288853a94..95c0508624 100644 --- a/include/internal/quic_types.h +++ b/include/internal/quic_types.h @@ -81,4 +81,7 @@ static ossl_unused ossl_inline int ossl_quic_conn_id_eq(const QUIC_CONN_ID *a, #define QUIC_MIN_INITIAL_DGRAM_LEN 1200 +#define QUIC_DEFAULT_ACK_DELAY_EXP 3 +#define QUIC_MAX_ACK_DELAY_EXP 20 + #endif diff --git a/include/internal/quic_wire.h b/include/internal/quic_wire.h index dec7aeddc1..e1d001c4e3 100644 --- a/include/internal/quic_wire.h +++ b/include/internal/quic_wire.h @@ -100,6 +100,25 @@ ossl_quic_frame_type_is_ack_eliciting(uint64_t frame_type) } } +/* QUIC Transport Parameter Types */ +#define QUIC_TPARAM_ORIG_DCID 0x00 +#define QUIC_TPARAM_MAX_IDLE_TIMEOUT 0x01 +#define QUIC_TPARAM_STATELESS_RESET_TOKEN 0x02 +#define QUIC_TPARAM_MAX_UDP_PAYLOAD_SIZE 0x03 +#define QUIC_TPARAM_INITIAL_MAX_DATA 0x04 +#define QUIC_TPARAM_INITIAL_MAX_STREAM_DATA_BIDI_LOCAL 0x05 +#define QUIC_TPARAM_INITIAL_MAX_STREAM_DATA_BIDI_REMOTE 0x06 +#define QUIC_TPARAM_INITIAL_MAX_STREAM_DATA_UNI 0x07 +#define QUIC_TPARAM_INITIAL_MAX_STREAMS_BIDI 0x08 +#define QUIC_TPARAM_INITIAL_MAX_STREAMS_UNI 0x09 +#define QUIC_TPARAM_ACK_DELAY_EXP 0x0A +#define QUIC_TPARAM_MAX_ACK_DELAY 0x0B +#define QUIC_TPARAM_DISABLE_ACTIVE_MIGRATION 0x0C +#define QUIC_TPARAM_PREFERRED_ADDR 0x0D +#define QUIC_TPARAM_ACTIVE_CONN_ID_LIMIT 0x0E +#define QUIC_TPARAM_INITIAL_SCID 0x0F +#define QUIC_TPARAM_RETRY_SCID 0x10 + /* * QUIC Frame Logical Representations * ================================== diff --git a/ssl/quic/quic_stream_map.c b/ssl/quic/quic_stream_map.c index 043a631fec..d080bac233 100644 --- a/ssl/quic/quic_stream_map.c +++ b/ssl/quic/quic_stream_map.c @@ -154,6 +154,9 @@ void ossl_quic_stream_map_release(QUIC_STREAM_MAP *qsm, QUIC_STREAM *stream) ossl_quic_sstream_free(stream->sstream); stream->sstream = NULL; + ossl_quic_rstream_free(stream->rstream); + stream->rstream = NULL; + lh_QUIC_STREAM_delete(qsm->map, stream); OPENSSL_free(stream); } -- cgit v1.2.3