lsquic_conn_public.h revision 7d09751d
17d09751dSDmitri Tikhonov/* Copyright (c) 2017 - 2020 LiteSpeed Technologies Inc.  See LICENSE. */
250aadb33SDmitri Tikhonov/*
350aadb33SDmitri Tikhonov * lsquic_conn_public.h -- Connection's "public interface"
450aadb33SDmitri Tikhonov *
550aadb33SDmitri Tikhonov * This structure is used to bundle things in connection that stream
650aadb33SDmitri Tikhonov * needs access to into a single object.  This way, the space per
750aadb33SDmitri Tikhonov * stream object is one pointer instead of four or five.
850aadb33SDmitri Tikhonov */
950aadb33SDmitri Tikhonov
1050aadb33SDmitri Tikhonov#ifndef LSQUIC_CONN_PUBLIC_H
1150aadb33SDmitri Tikhonov#define LSQUIC_CONN_PUBLIC_H 1
1250aadb33SDmitri Tikhonov
1350aadb33SDmitri Tikhonovstruct lsquic_conn;
1450aadb33SDmitri Tikhonovstruct lsquic_engine_public;
1550aadb33SDmitri Tikhonovstruct lsquic_mm;
16c51ce338SDmitri Tikhonovstruct lsquic_hash;
1750aadb33SDmitri Tikhonovstruct headers_stream;
1850aadb33SDmitri Tikhonovstruct lsquic_send_ctl;
1919f667fbSDmitri Tikhonov#if LSQUIC_CONN_STATS
2019f667fbSDmitri Tikhonovstruct conn_stats;
2119f667fbSDmitri Tikhonov#endif
225392f7a3SLiteSpeed Techstruct qpack_enc_hdl;
235392f7a3SLiteSpeed Techstruct qpack_dec_hdl;
245392f7a3SLiteSpeed Techstruct network_path;
2550aadb33SDmitri Tikhonov
2650aadb33SDmitri Tikhonovstruct lsquic_conn_public {
27c51ce338SDmitri Tikhonov    struct lsquic_streams_tailq     sending_streams,    /* Send RST_STREAM, BLOCKED, and WUF frames */
28c51ce338SDmitri Tikhonov                                    read_streams,
29c51ce338SDmitri Tikhonov                                    write_streams,      /* Send STREAM frames */
3050aadb33SDmitri Tikhonov                                    service_streams;
31c51ce338SDmitri Tikhonov    struct lsquic_hash             *all_streams;
3250aadb33SDmitri Tikhonov    struct lsquic_cfcw              cfcw;
3350aadb33SDmitri Tikhonov    struct lsquic_conn_cap          conn_cap;
3450aadb33SDmitri Tikhonov    struct lsquic_rtt_stats         rtt_stats;
3550aadb33SDmitri Tikhonov    struct lsquic_engine_public    *enpub;
3650aadb33SDmitri Tikhonov    struct malo                    *packet_out_malo;
3750aadb33SDmitri Tikhonov    struct lsquic_conn             *lconn;
3850aadb33SDmitri Tikhonov    struct lsquic_mm               *mm;
395392f7a3SLiteSpeed Tech    union {
405392f7a3SLiteSpeed Tech        struct {
415392f7a3SLiteSpeed Tech            struct headers_stream  *hs;
425392f7a3SLiteSpeed Tech        }                       gquic;
435392f7a3SLiteSpeed Tech        struct {
445392f7a3SLiteSpeed Tech            struct qpack_enc_hdl *qeh;
455392f7a3SLiteSpeed Tech            struct qpack_dec_hdl *qdh;
465392f7a3SLiteSpeed Tech            struct lsquic_hash   *promises;
475392f7a3SLiteSpeed Tech        }                       ietf;
485392f7a3SLiteSpeed Tech    }                               u;
495392f7a3SLiteSpeed Tech    enum {
505392f7a3SLiteSpeed Tech        CP_STREAM_UNBLOCKED     = 1 << 0,   /* Set when a stream becomes unblocked */
515392f7a3SLiteSpeed Tech    }                               cp_flags;
5250aadb33SDmitri Tikhonov    struct lsquic_send_ctl         *send_ctl;
5319f667fbSDmitri Tikhonov#if LSQUIC_CONN_STATS
5419f667fbSDmitri Tikhonov    struct conn_stats              *conn_stats;
5519f667fbSDmitri Tikhonov#endif
565392f7a3SLiteSpeed Tech    const struct network_path      *path;
57c09fcff4SDmitri Tikhonov#if LSQUIC_EXTRA_CHECKS
58c09fcff4SDmitri Tikhonov    unsigned long                   stream_frame_bytes;
59c09fcff4SDmitri Tikhonov#endif
6050aadb33SDmitri Tikhonov};
6150aadb33SDmitri Tikhonov
6250aadb33SDmitri Tikhonov#endif
63