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