lsquic_ver_neg.h revision 229fce07
1/* Copyright (c) 2017 - 2019 LiteSpeed Technologies Inc.  See LICENSE. */
2#ifndef LSQUIC_VER_NEG_H
3#define LSQUIC_VER_NEG_H
4
5/* Client engages in version negotiation, going from highest supported
6 * version to lowest.
7 */
8struct ver_neg {
9    unsigned            vn_supp;    /* Remaining options, including `vn_ver' */
10    enum lsquic_version vn_ver;     /* If client, current version sent to server;
11                                     * if server, this is set to negotiated version.
12                                     */
13    enum ver_neg_state {
14        VN_START,                   /* Have not received ver-nego packet */
15        VN_IN_PROGRESS,             /* Received ver-nego packet */
16        VN_END,                     /* Received packet using supported version */
17    }                   vn_state;
18    lsquic_ver_tag_t    vn_buf;     /* Buffer to store version tag */
19    lsquic_ver_tag_t   *vn_tag;     /* Pointer to version tag.  Set to NULL if
20                                     * version negotiation is done in the client;
21                                     * always set to NULL in server.
22                                     */
23};
24
25#endif
26