lsquic_conn_public.h revision 5392f7a3
1229fce07SDmitri Tikhonov/* Copyright (c) 2017 - 2019 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 h3_prio_tree; 255392f7a3SLiteSpeed Techstruct network_path; 2650aadb33SDmitri Tikhonov 2750aadb33SDmitri Tikhonovstruct lsquic_conn_public { 28c51ce338SDmitri Tikhonov struct lsquic_streams_tailq sending_streams, /* Send RST_STREAM, BLOCKED, and WUF frames */ 29c51ce338SDmitri Tikhonov read_streams, 30c51ce338SDmitri Tikhonov write_streams, /* Send STREAM frames */ 3150aadb33SDmitri Tikhonov service_streams; 32c51ce338SDmitri Tikhonov struct lsquic_hash *all_streams; 3350aadb33SDmitri Tikhonov struct lsquic_cfcw cfcw; 3450aadb33SDmitri Tikhonov struct lsquic_conn_cap conn_cap; 3550aadb33SDmitri Tikhonov struct lsquic_rtt_stats rtt_stats; 3650aadb33SDmitri Tikhonov struct lsquic_engine_public *enpub; 3750aadb33SDmitri Tikhonov struct malo *packet_out_malo; 3850aadb33SDmitri Tikhonov struct lsquic_conn *lconn; 3950aadb33SDmitri Tikhonov struct lsquic_mm *mm; 405392f7a3SLiteSpeed Tech union { 415392f7a3SLiteSpeed Tech struct { 425392f7a3SLiteSpeed Tech struct headers_stream *hs; 435392f7a3SLiteSpeed Tech } gquic; 445392f7a3SLiteSpeed Tech struct { 455392f7a3SLiteSpeed Tech struct qpack_enc_hdl *qeh; 465392f7a3SLiteSpeed Tech struct qpack_dec_hdl *qdh; 475392f7a3SLiteSpeed Tech struct h3_prio_tree *prio_tree; 485392f7a3SLiteSpeed Tech struct lsquic_hash *promises; 495392f7a3SLiteSpeed Tech } ietf; 505392f7a3SLiteSpeed Tech } u; 515392f7a3SLiteSpeed Tech enum { 525392f7a3SLiteSpeed Tech CP_STREAM_UNBLOCKED = 1 << 0, /* Set when a stream becomes unblocked */ 535392f7a3SLiteSpeed Tech } cp_flags; 5450aadb33SDmitri Tikhonov struct lsquic_send_ctl *send_ctl; 5519f667fbSDmitri Tikhonov#if LSQUIC_CONN_STATS 5619f667fbSDmitri Tikhonov struct conn_stats *conn_stats; 5719f667fbSDmitri Tikhonov#endif 585392f7a3SLiteSpeed Tech const struct network_path *path; 5950aadb33SDmitri Tikhonov}; 6050aadb33SDmitri Tikhonov 6150aadb33SDmitri Tikhonov#endif 62