From e801455446cb9144224b424f930ee81977eeab22 Mon Sep 17 00:00:00 2001 From: Hugo Landau Date: Thu, 9 Nov 2023 10:27:13 +0000 Subject: [PATCH] QUIC CHANNEL: Consolidate forward object declarations in a single header Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/22674) --- include/internal/quic_channel.h | 6 ++--- include/internal/quic_predef.h | 41 +++++++++++++++++++++++++++++++++ ssl/quic/quic_channel_local.h | 6 ++--- test/quic_multistream_test.c | 1 + util/quicserver.c | 1 + 5 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 include/internal/quic_predef.h diff --git a/include/internal/quic_channel.h b/include/internal/quic_channel.h index f46db0637e..6f883faf76 100644 --- a/include/internal/quic_channel.h +++ b/include/internal/quic_channel.h @@ -12,9 +12,9 @@ # include # include "internal/quic_types.h" -# include "internal/quic_stream_map.h" -# include "internal/quic_reactor.h" -# include "internal/quic_statm.h" +# include "internal/quic_record_tx.h" +# include "internal/quic_wire.h" +# include "internal/quic_predef.h" # include "internal/time.h" # include "internal/thread.h" diff --git a/include/internal/quic_predef.h b/include/internal/quic_predef.h new file mode 100644 index 0000000000..2512810afa --- /dev/null +++ b/include/internal/quic_predef.h @@ -0,0 +1,41 @@ +/* + * Copyright 2023 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_PREDEF_H +# define OSSL_QUIC_PREDEF_H + +# ifndef OPENSSL_NO_QUIC + +typedef struct quic_port_st QUIC_PORT; +typedef struct quic_channel_st QUIC_CHANNEL; +typedef struct quic_tls_st QUIC_TLS; +typedef struct quic_txpim_st QUIC_TXPIM; +typedef struct quic_cfq_st QUIC_CFQ; +typedef struct ossl_quic_tx_packetiser_st OSSL_QUIC_TX_PACKETISER; +typedef struct ossl_ackm_st OSSL_ACKM; +typedef struct quic_srt_elem_st QUIC_SRT_ELEM; +typedef struct ossl_cc_data_st OSSL_CC_DATA; +typedef struct ossl_cc_method_st OSSL_CC_METHOD; +typedef struct quic_stream_map_st QUIC_STREAM_MAP; +typedef struct quic_stream_st QUIC_STREAM; +typedef struct quic_sstream_st QUIC_SSTREAM; +typedef struct quic_rstream_st QUIC_RSTREAM; +typedef struct quic_reactor_st QUIC_REACTOR; +typedef struct ossl_statm_st OSSL_STATM; +typedef struct quic_demux_st QUIC_DEMUX; +typedef struct ossl_qrx_pkt_st OSSL_QRX_PKT; +typedef struct ossl_qtx_pkt_st OSSL_QTX_PKT; +typedef struct quic_tick_result_st QUIC_TICK_RESULT; +typedef struct quic_srtm_st QUIC_SRTM; +typedef struct quic_lcidm_st QUIC_LCIDM; +typedef struct quic_urxe_st QUIC_URXE; + +# endif + +#endif diff --git a/ssl/quic/quic_channel_local.h b/ssl/quic/quic_channel_local.h index f0ac742420..f4a02559c6 100644 --- a/ssl/quic/quic_channel_local.h +++ b/ssl/quic/quic_channel_local.h @@ -7,9 +7,9 @@ # include # include "internal/list.h" - - -typedef struct quic_srt_elem_st QUIC_SRT_ELEM; +# include "internal/quic_predef.h" +# include "internal/quic_fc.h" +# include "internal/quic_stream_map.h" struct quic_srt_elem_st { OSSL_LIST_MEMBER(stateless_reset_tokens, QUIC_SRT_ELEM); diff --git a/test/quic_multistream_test.c b/test/quic_multistream_test.c index 22a753ad67..d0560bb041 100644 --- a/test/quic_multistream_test.c +++ b/test/quic_multistream_test.c @@ -13,6 +13,7 @@ #include "internal/quic_tserver.h" #include "internal/quic_ssl.h" #include "internal/quic_error.h" +#include "internal/quic_stream_map.h" #include "testutil.h" #include "helpers/quictestlib.h" #if defined(OPENSSL_THREADS) diff --git a/util/quicserver.c b/util/quicserver.c index b5c15806a3..d752340882 100644 --- a/util/quicserver.c +++ b/util/quicserver.c @@ -19,6 +19,7 @@ #include "internal/e_os.h" #include "internal/sockets.h" #include "internal/quic_tserver.h" +#include "internal/quic_stream_map.h" #include "internal/time.h" static BIO *bio_err = NULL;