lsquic_conn_public.h revision 5392f7a3
1/* Copyright (c) 2017 - 2019 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 h3_prio_tree;
25struct network_path;
26
27struct lsquic_conn_public {
28    struct lsquic_streams_tailq     sending_streams,    /* Send RST_STREAM, BLOCKED, and WUF frames */
29                                    read_streams,
30                                    write_streams,      /* Send STREAM frames */
31                                    service_streams;
32    struct lsquic_hash             *all_streams;
33    struct lsquic_cfcw              cfcw;
34    struct lsquic_conn_cap          conn_cap;
35    struct lsquic_rtt_stats         rtt_stats;
36    struct lsquic_engine_public    *enpub;
37    struct malo                    *packet_out_malo;
38    struct lsquic_conn             *lconn;
39    struct lsquic_mm               *mm;
40    union {
41        struct {
42            struct headers_stream  *hs;
43        }                       gquic;
44        struct {
45            struct qpack_enc_hdl *qeh;
46            struct qpack_dec_hdl *qdh;
47            struct h3_prio_tree  *prio_tree;
48            struct lsquic_hash   *promises;
49        }                       ietf;
50    }                               u;
51    enum {
52        CP_STREAM_UNBLOCKED     = 1 << 0,   /* Set when a stream becomes unblocked */
53    }                               cp_flags;
54    struct lsquic_send_ctl         *send_ctl;
55#if LSQUIC_CONN_STATS
56    struct conn_stats              *conn_stats;
57#endif
58    const struct network_path      *path;
59};
60
61#endif
62