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