1a74702c6SGeorge Wang/* Copyright (c) 2017 - 2022 LiteSpeed Technologies Inc. See LICENSE. */ 250aadb33SDmitri Tikhonov#ifndef LSQUIC_FULL_CONN_H 350aadb33SDmitri Tikhonov#define LSQUIC_FULL_CONN_H 450aadb33SDmitri Tikhonov 550aadb33SDmitri Tikhonovstruct lsquic_conn; 650aadb33SDmitri Tikhonovstruct lsquic_engine_public; 750aadb33SDmitri Tikhonov 850aadb33SDmitri Tikhonovstruct lsquic_conn * 95392f7a3SLiteSpeed Techlsquic_gquic_full_conn_client_new (struct lsquic_engine_public *, 10a0e1aeeeSDmitri Tikhonov unsigned versions, 1150aadb33SDmitri Tikhonov unsigned flags /* Only FC_SERVER and FC_HTTP */, 128ca33e0eSDmitri Tikhonov const char *hostname, unsigned short max_packet_size, 135392f7a3SLiteSpeed Tech int is_ipv4, 147483dee0SDmitri Tikhonov const unsigned char *sess_resume, size_t sess_resume_len); 1550aadb33SDmitri Tikhonov 165392f7a3SLiteSpeed Techstruct lsquic_conn * 175392f7a3SLiteSpeed Techlsquic_ietf_full_conn_client_new (struct lsquic_engine_public *, 18a0e1aeeeSDmitri Tikhonov unsigned versions, 195392f7a3SLiteSpeed Tech unsigned flags /* Only FC_SERVER and FC_HTTP */, 20b8fa6195SDmitri Tikhonov const char *hostname, unsigned short base_plpmtu, int is_ipv4, 217483dee0SDmitri Tikhonov const unsigned char *sess_resume, size_t, 2221bcad87Ssumasrao const unsigned char *token, size_t, void* peer_ctx); 235392f7a3SLiteSpeed Tech 245392f7a3SLiteSpeed Techtypedef struct lsquic_conn * 255392f7a3SLiteSpeed Tech(*server_conn_ctor_f) (struct lsquic_engine_public *, 265392f7a3SLiteSpeed Tech unsigned flags /* Only FC_SERVER and FC_HTTP */, 275392f7a3SLiteSpeed Tech struct lsquic_conn *mini_conn); 285392f7a3SLiteSpeed Tech 295392f7a3SLiteSpeed Techstruct lsquic_conn * 305392f7a3SLiteSpeed Techlsquic_gquic_full_conn_server_new (struct lsquic_engine_public *, 315392f7a3SLiteSpeed Tech unsigned flags /* Only FC_SERVER and FC_HTTP */, 325392f7a3SLiteSpeed Tech struct lsquic_conn *mini_conn); 335392f7a3SLiteSpeed Tech 345392f7a3SLiteSpeed Techstruct lsquic_conn * 355392f7a3SLiteSpeed Techlsquic_ietf_full_conn_server_new (struct lsquic_engine_public *, 365392f7a3SLiteSpeed Tech unsigned flags /* Only FC_SERVER and FC_HTTP */, 375392f7a3SLiteSpeed Tech struct lsquic_conn *mini_conn); 385392f7a3SLiteSpeed Tech 395392f7a3SLiteSpeed Techstruct dcid_elem 405392f7a3SLiteSpeed Tech{ 415392f7a3SLiteSpeed Tech /* This is never both in the hash and on the retirement list */ 425392f7a3SLiteSpeed Tech union { 435392f7a3SLiteSpeed Tech struct lsquic_hash_elem hash_el; 445392f7a3SLiteSpeed Tech TAILQ_ENTRY(dcid_elem) next_to_ret; 455392f7a3SLiteSpeed Tech } de_u; 465392f7a3SLiteSpeed Tech#define de_hash_el de_u.hash_el 475392f7a3SLiteSpeed Tech#define de_next_to_ret de_u.next_to_ret 485392f7a3SLiteSpeed Tech lsquic_cid_t de_cid; 495392f7a3SLiteSpeed Tech unsigned de_seqno; 505392f7a3SLiteSpeed Tech enum { 515392f7a3SLiteSpeed Tech DE_SRST = 1 << 0, /* de_srst is set */ 525392f7a3SLiteSpeed Tech DE_ASSIGNED = 1 << 1, /* de_cid has been assigned to a path */ 535392f7a3SLiteSpeed Tech } de_flags; 545392f7a3SLiteSpeed Tech unsigned char de_srst[IQUIC_SRESET_TOKEN_SZ]; 555392f7a3SLiteSpeed Tech}; 565392f7a3SLiteSpeed Tech 575392f7a3SLiteSpeed Techint 585392f7a3SLiteSpeed Techlsquic_gquic_full_conn_srej (struct lsquic_conn *); 5950aadb33SDmitri Tikhonov 6050aadb33SDmitri Tikhonov#endif 61