lsquic_conn_public.h revision a74702c6
1/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ 2/* 3 * lsquic_conn_public.h -- Connection's "public interface" 4 * 5 * This structure is used to bundle things in connection that stream 6 * needs access to into a single object. This way, the space per 7 * stream object is one pointer instead of four or five. 8 */ 9 10#ifndef LSQUIC_CONN_PUBLIC_H 11#define LSQUIC_CONN_PUBLIC_H 1 12 13struct lsquic_conn; 14struct lsquic_engine_public; 15struct lsquic_mm; 16struct lsquic_hash; 17struct headers_stream; 18struct lsquic_send_ctl; 19#if LSQUIC_CONN_STATS 20struct conn_stats; 21#endif 22struct qpack_enc_hdl; 23struct qpack_dec_hdl; 24struct network_path; 25 26struct lsquic_conn_public { 27 struct lsquic_streams_tailq sending_streams, /* Send RST_STREAM, BLOCKED, and WUF frames */ 28 read_streams, 29 write_streams, /* Send STREAM frames */ 30 service_streams; 31 struct lsquic_hash *all_streams; 32 struct lsquic_cfcw cfcw; 33 struct lsquic_conn_cap conn_cap; 34 struct lsquic_rtt_stats rtt_stats; 35 struct lsquic_engine_public *enpub; 36 struct malo *packet_out_malo; 37 struct lsquic_conn *lconn; 38 struct lsquic_mm *mm; 39 union { 40 struct { 41 struct headers_stream *hs; 42 } gquic; 43 struct { 44 struct qpack_enc_hdl *qeh; 45 struct qpack_dec_hdl *qdh; 46 struct hcso_writer *hcso; 47 struct lsquic_hash *promises; 48 } ietf; 49 } u; 50 enum { 51 CP_STREAM_UNBLOCKED = 1 << 0, /* Set when a stream becomes unblocked */ 52 } cp_flags; 53 struct lsquic_send_ctl *send_ctl; 54#if LSQUIC_CONN_STATS 55 struct conn_stats *conn_stats; 56#endif 57 const struct network_path *path; 58#if LSQUIC_EXTRA_CHECKS 59 unsigned long stream_frame_bytes; 60 unsigned wtp_level; /* wtp: Write To Packets */ 61#endif 62 /* "unsigned" is wide enough: these values are only used for amplification 63 * limit before initial path is validated. 64 */ 65 unsigned bytes_in; /* successfully processed */ 66 unsigned bytes_out; 67 /* Used for no-progress timeout */ 68 lsquic_time_t last_tick, last_prog; 69 unsigned max_peer_ack_usec; 70 uint8_t n_special_streams; 71}; 72 73#endif 74