lsquic_full_conn.h revision 5392f7a3
1/* Copyright (c) 2017 - 2019 LiteSpeed Technologies Inc.  See LICENSE. */
2#ifndef LSQUIC_FULL_CONN_H
3#define LSQUIC_FULL_CONN_H
4
5struct lsquic_conn;
6struct lsquic_engine_public;
7
8struct lsquic_conn *
9lsquic_gquic_full_conn_client_new (struct lsquic_engine_public *,
10               unsigned flags /* Only FC_SERVER and FC_HTTP */,
11               const char *hostname, unsigned short max_packet_size,
12               int is_ipv4,
13               const unsigned char *zero_rtt, size_t zero_rtt_len);
14
15struct lsquic_conn *
16lsquic_ietf_full_conn_client_new (struct lsquic_engine_public *,
17               unsigned flags /* Only FC_SERVER and FC_HTTP */,
18           const char *hostname, unsigned short max_packet_size, int is_ipv4,
19           const unsigned char *zero_rtt, size_t,
20           const unsigned char *token, size_t);
21
22typedef struct lsquic_conn *
23(*server_conn_ctor_f) (struct lsquic_engine_public *,
24               unsigned flags /* Only FC_SERVER and FC_HTTP */,
25               struct lsquic_conn *mini_conn);
26
27struct lsquic_conn *
28lsquic_gquic_full_conn_server_new (struct lsquic_engine_public *,
29               unsigned flags /* Only FC_SERVER and FC_HTTP */,
30               struct lsquic_conn *mini_conn);
31
32struct lsquic_conn *
33lsquic_ietf_full_conn_server_new (struct lsquic_engine_public *,
34               unsigned flags /* Only FC_SERVER and FC_HTTP */,
35               struct lsquic_conn *mini_conn);
36
37struct dcid_elem
38{
39    /* This is never both in the hash and on the retirement list */
40    union {
41        struct lsquic_hash_elem     hash_el;
42        TAILQ_ENTRY(dcid_elem)      next_to_ret;
43    }                           de_u;
44#define de_hash_el de_u.hash_el
45#define de_next_to_ret de_u.next_to_ret
46    lsquic_cid_t                de_cid;
47    unsigned                    de_seqno;
48    enum {
49        DE_SRST     = 1 << 0, /* de_srst is set */
50        DE_ASSIGNED = 1 << 1, /* de_cid has been assigned to a path */
51    }                           de_flags;
52    unsigned char               de_srst[IQUIC_SRESET_TOKEN_SZ];
53};
54
55int
56lsquic_gquic_full_conn_srej (struct lsquic_conn *);
57
58#endif
59