Path: blob/main/crypto/openssl/ssl/quic/quic_port_local.h
48262 views
/*1* Copyright 2023-2025 The OpenSSL Project Authors. All Rights Reserved.2*3* Licensed under the Apache License 2.0 (the "License"). You may not use4* this file except in compliance with the License. You can obtain a copy5* in the file LICENSE in the source distribution or at6* https://www.openssl.org/source/license.html7*/89#ifndef OSSL_QUIC_PORT_LOCAL_H10# define OSSL_QUIC_PORT_LOCAL_H1112# include "internal/quic_port.h"13# include "internal/quic_reactor.h"14# include "internal/list.h"1516# ifndef OPENSSL_NO_QUIC1718/*19* QUIC Port Structure20* ===================21*22* QUIC port internals. It is intended that only the QUIC_PORT and QUIC_CHANNEL23* implementation be allowed to access this structure directly.24*25* Other components should not include this header.26*/27DECLARE_LIST_OF(ch, QUIC_CHANNEL);28DECLARE_LIST_OF(incoming_ch, QUIC_CHANNEL);2930/* A port is always in one of the following states: */31enum {32/* Initial and steady state. */33QUIC_PORT_STATE_RUNNING,3435/*36* Terminal state indicating port is no longer functioning. There are no37* transitions out of this state. May be triggered by e.g. a permanent38* network BIO error.39*/40QUIC_PORT_STATE_FAILED41};4243struct quic_port_st {44/* The engine which this port is a child of. */45QUIC_ENGINE *engine;4647/*48* QUIC_ENGINE keeps the ports which belong to it on a list for bookkeeping49* purposes.50*/51OSSL_LIST_MEMBER(port, QUIC_PORT);5253SSL * (*get_conn_user_ssl)(QUIC_CHANNEL *ch, void *arg);54void *user_ssl_arg;5556/* Used to create handshake layer objects inside newly created channels. */57SSL_CTX *channel_ctx;5859/* Network-side read and write BIOs. */60BIO *net_rbio, *net_wbio;6162/* RX demuxer. We register incoming DCIDs with this. */63QUIC_DEMUX *demux;6465/* List of all child channels. */66OSSL_LIST(ch) channel_list;6768/*69* Queue of unaccepted incoming channels. Each such channel is also on70* channel_list.71*/72OSSL_LIST(incoming_ch) incoming_channel_list;7374/* Special TSERVER channel. To be removed in the future. */75QUIC_CHANNEL *tserver_ch;7677/* LCIDM used for incoming packet routing by DCID. */78QUIC_LCIDM *lcidm;7980/* SRTM used for incoming packet routing by SRT. */81QUIC_SRTM *srtm;8283/* Port-level permanent errors (causing failure state) are stored here. */84ERR_STATE *err_state;8586/* DCID length used for incoming short header packets. */87unsigned char rx_short_dcid_len;88/* For clients, CID length used for outgoing Initial packets. */89unsigned char tx_init_dcid_len;9091/* Port state (QUIC_PORT_STATE_*). */92unsigned int state : 1;9394/* Is this port created to support multiple connections? */95unsigned int is_multi_conn : 1;9697/* Is this port doing server address validation */98unsigned int validate_addr : 1;99100/* Has this port sent any packet of any kind yet? */101unsigned int have_sent_any_pkt : 1;102103/* Does this port allow incoming connections? */104unsigned int allow_incoming : 1;105106/* Are we on the QUIC_ENGINE linked list of ports? */107unsigned int on_engine_list : 1;108109/* Are we using addressed mode (BIO_sendmmsg with non-NULL peer)? */110unsigned int addressed_mode_w : 1;111unsigned int addressed_mode_r : 1;112113/* Has the BIO been changed since we last updated reactor pollability? */114unsigned int bio_changed : 1;115116/* AES-256 GCM context for token encryption */117EVP_CIPHER_CTX *token_ctx;118};119120# endif121122#endif123124125