lsquic_hq.h revision 7d09751d
1/* Copyright (c) 2017 - 2020 LiteSpeed Technologies Inc.  See LICENSE. */
2/*
3 * lsquic_hq.h -- HTTP over QUIC (HQ) types
4 */
5
6#ifndef LSQUIC_HQ_H
7#define LSQUIC_HQ_H 1
8
9/* [draft-ietf-quic-http-15] Section 4 */
10enum hq_frame_type
11{
12    HQFT_DATA           = 0,
13    HQFT_HEADERS        = 1,
14    HQFT_CANCEL_PUSH    = 3,
15    HQFT_SETTINGS       = 4,
16    HQFT_PUSH_PROMISE   = 5,
17    HQFT_GOAWAY         = 7,
18    HQFT_MAX_PUSH_ID    = 0xD,
19    HQFT_DUPLICATE_PUSH = 0xE,
20    /* This frame is made up and its type is never written to stream.
21     * Nevertheless, just to be on the safe side, give it a value as
22     * described in [draft-ietf-quic-http-20] Section 4.2.10.
23     */
24    HQFT_PUSH_PREAMBLE  = 0x1F * 3 + 0x21,
25};
26
27
28enum hq_setting_id
29{
30    HQSID_QPACK_MAX_TABLE_CAPACITY  = 1,
31    HQSID_MAX_HEADER_LIST_SIZE      = 6,
32    HQSID_QPACK_BLOCKED_STREAMS     = 7,
33};
34
35/* As of 12/18/2018: */
36#define HQ_DF_QPACK_MAX_TABLE_CAPACITY 0
37#define HQ_DF_MAX_HEADER_LIST_SIZE 0
38#define HQ_DF_QPACK_BLOCKED_STREAMS 0
39
40
41/* [draft-ietf-quic-http-19] Section 10.6,
42 * [draft-ietf-quic-qpack-07] Section 8.2
43 */
44enum hq_uni_stream_type
45{
46    HQUST_CONTROL   = 0,
47    HQUST_PUSH      = 1,
48    HQUST_QPACK_ENC = 2,
49    HQUST_QPACK_DEC = 3,
50};
51
52
53/* [draft-ietf-quic-http-23] Section 8.1 and
54 * [draft-ietf-quic-qpack-08], Section 8.3
55 */
56enum http_error_code
57{
58    HEC_NO_ERROR                =  0x100,
59    HEC_GENERAL_PROTOCOL_ERROR  =  0x101,
60    HEC_INTERNAL_ERROR          =  0x102,
61    HEC_STREAM_CREATION_ERROR   =  0x103,
62    HEC_CLOSED_CRITICAL_STREAM  =  0x104,
63    HEC_FRAME_UNEXPECTED        =  0x105,
64    HEC_FRAME_ERROR             =  0x106,
65    HEC_EXCESSIVE_LOAD          =  0x107,
66    HEC_ID_ERROR                =  0x108,
67    HEC_SETTINGS_ERROR          =  0x109,
68    HEC_MISSING_SETTINGS        =  0x10A,
69    HEC_REQUEST_REJECTED        =  0x10B,
70    HEC_REQUEST_CANCELLED       =  0x10C,
71    HEC_REQUEST_INCOMPLETE      =  0x10D,
72    HEC_EARLY_RESPONSE          =  0x10E,
73    HEC_CONNECT_ERROR           =  0x10F,
74    HEC_VERSION_FALLBACK        =  0x110,
75    HEC_QPACK_DECOMPRESSION_FAILED  = 0x200,
76    HEC_QPACK_ENCODER_STREAM_ERROR  = 0x201,
77    HEC_QPACK_DECODER_STREAM_ERROR  = 0x202,
78};
79
80
81#endif
82