lsquic_full_conn.h revision 5392f7a3
1229fce07SDmitri Tikhonov/* Copyright (c) 2017 - 2019 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 *,
1050aadb33SDmitri Tikhonov               unsigned flags /* Only FC_SERVER and FC_HTTP */,
118ca33e0eSDmitri Tikhonov               const char *hostname, unsigned short max_packet_size,
125392f7a3SLiteSpeed Tech               int is_ipv4,
138ca33e0eSDmitri Tikhonov               const unsigned char *zero_rtt, size_t zero_rtt_len);
1450aadb33SDmitri Tikhonov
155392f7a3SLiteSpeed Techstruct lsquic_conn *
165392f7a3SLiteSpeed Techlsquic_ietf_full_conn_client_new (struct lsquic_engine_public *,
175392f7a3SLiteSpeed Tech               unsigned flags /* Only FC_SERVER and FC_HTTP */,
185392f7a3SLiteSpeed Tech           const char *hostname, unsigned short max_packet_size, int is_ipv4,
195392f7a3SLiteSpeed Tech           const unsigned char *zero_rtt, size_t,
205392f7a3SLiteSpeed Tech           const unsigned char *token, size_t);
215392f7a3SLiteSpeed Tech
225392f7a3SLiteSpeed Techtypedef struct lsquic_conn *
235392f7a3SLiteSpeed Tech(*server_conn_ctor_f) (struct lsquic_engine_public *,
245392f7a3SLiteSpeed Tech               unsigned flags /* Only FC_SERVER and FC_HTTP */,
255392f7a3SLiteSpeed Tech               struct lsquic_conn *mini_conn);
265392f7a3SLiteSpeed Tech
275392f7a3SLiteSpeed Techstruct lsquic_conn *
285392f7a3SLiteSpeed Techlsquic_gquic_full_conn_server_new (struct lsquic_engine_public *,
295392f7a3SLiteSpeed Tech               unsigned flags /* Only FC_SERVER and FC_HTTP */,
305392f7a3SLiteSpeed Tech               struct lsquic_conn *mini_conn);
315392f7a3SLiteSpeed Tech
325392f7a3SLiteSpeed Techstruct lsquic_conn *
335392f7a3SLiteSpeed Techlsquic_ietf_full_conn_server_new (struct lsquic_engine_public *,
345392f7a3SLiteSpeed Tech               unsigned flags /* Only FC_SERVER and FC_HTTP */,
355392f7a3SLiteSpeed Tech               struct lsquic_conn *mini_conn);
365392f7a3SLiteSpeed Tech
375392f7a3SLiteSpeed Techstruct dcid_elem
385392f7a3SLiteSpeed Tech{
395392f7a3SLiteSpeed Tech    /* This is never both in the hash and on the retirement list */
405392f7a3SLiteSpeed Tech    union {
415392f7a3SLiteSpeed Tech        struct lsquic_hash_elem     hash_el;
425392f7a3SLiteSpeed Tech        TAILQ_ENTRY(dcid_elem)      next_to_ret;
435392f7a3SLiteSpeed Tech    }                           de_u;
445392f7a3SLiteSpeed Tech#define de_hash_el de_u.hash_el
455392f7a3SLiteSpeed Tech#define de_next_to_ret de_u.next_to_ret
465392f7a3SLiteSpeed Tech    lsquic_cid_t                de_cid;
475392f7a3SLiteSpeed Tech    unsigned                    de_seqno;
485392f7a3SLiteSpeed Tech    enum {
495392f7a3SLiteSpeed Tech        DE_SRST     = 1 << 0, /* de_srst is set */
505392f7a3SLiteSpeed Tech        DE_ASSIGNED = 1 << 1, /* de_cid has been assigned to a path */
515392f7a3SLiteSpeed Tech    }                           de_flags;
525392f7a3SLiteSpeed Tech    unsigned char               de_srst[IQUIC_SRESET_TOKEN_SZ];
535392f7a3SLiteSpeed Tech};
545392f7a3SLiteSpeed Tech
555392f7a3SLiteSpeed Techint
565392f7a3SLiteSpeed Techlsquic_gquic_full_conn_srej (struct lsquic_conn *);
5750aadb33SDmitri Tikhonov
5850aadb33SDmitri Tikhonov#endif
59