lsquic_hq.h revision 7d09751d
17d09751dSDmitri Tikhonov/* Copyright (c) 2017 - 2020 LiteSpeed Technologies Inc.  See LICENSE. */
25392f7a3SLiteSpeed Tech/*
35392f7a3SLiteSpeed Tech * lsquic_hq.h -- HTTP over QUIC (HQ) types
45392f7a3SLiteSpeed Tech */
55392f7a3SLiteSpeed Tech
65392f7a3SLiteSpeed Tech#ifndef LSQUIC_HQ_H
75392f7a3SLiteSpeed Tech#define LSQUIC_HQ_H 1
85392f7a3SLiteSpeed Tech
95392f7a3SLiteSpeed Tech/* [draft-ietf-quic-http-15] Section 4 */
105392f7a3SLiteSpeed Techenum hq_frame_type
115392f7a3SLiteSpeed Tech{
125392f7a3SLiteSpeed Tech    HQFT_DATA           = 0,
135392f7a3SLiteSpeed Tech    HQFT_HEADERS        = 1,
145392f7a3SLiteSpeed Tech    HQFT_CANCEL_PUSH    = 3,
155392f7a3SLiteSpeed Tech    HQFT_SETTINGS       = 4,
165392f7a3SLiteSpeed Tech    HQFT_PUSH_PROMISE   = 5,
175392f7a3SLiteSpeed Tech    HQFT_GOAWAY         = 7,
185392f7a3SLiteSpeed Tech    HQFT_MAX_PUSH_ID    = 0xD,
195392f7a3SLiteSpeed Tech    HQFT_DUPLICATE_PUSH = 0xE,
205392f7a3SLiteSpeed Tech    /* This frame is made up and its type is never written to stream.
215392f7a3SLiteSpeed Tech     * Nevertheless, just to be on the safe side, give it a value as
225392f7a3SLiteSpeed Tech     * described in [draft-ietf-quic-http-20] Section 4.2.10.
235392f7a3SLiteSpeed Tech     */
245392f7a3SLiteSpeed Tech    HQFT_PUSH_PREAMBLE  = 0x1F * 3 + 0x21,
255392f7a3SLiteSpeed Tech};
265392f7a3SLiteSpeed Tech
275392f7a3SLiteSpeed Tech
285392f7a3SLiteSpeed Techenum hq_setting_id
295392f7a3SLiteSpeed Tech{
305392f7a3SLiteSpeed Tech    HQSID_QPACK_MAX_TABLE_CAPACITY  = 1,
315392f7a3SLiteSpeed Tech    HQSID_MAX_HEADER_LIST_SIZE      = 6,
325392f7a3SLiteSpeed Tech    HQSID_QPACK_BLOCKED_STREAMS     = 7,
335392f7a3SLiteSpeed Tech};
345392f7a3SLiteSpeed Tech
355392f7a3SLiteSpeed Tech/* As of 12/18/2018: */
365392f7a3SLiteSpeed Tech#define HQ_DF_QPACK_MAX_TABLE_CAPACITY 0
375392f7a3SLiteSpeed Tech#define HQ_DF_MAX_HEADER_LIST_SIZE 0
385392f7a3SLiteSpeed Tech#define HQ_DF_QPACK_BLOCKED_STREAMS 0
395392f7a3SLiteSpeed Tech
405392f7a3SLiteSpeed Tech
415392f7a3SLiteSpeed Tech/* [draft-ietf-quic-http-19] Section 10.6,
425392f7a3SLiteSpeed Tech * [draft-ietf-quic-qpack-07] Section 8.2
435392f7a3SLiteSpeed Tech */
445392f7a3SLiteSpeed Techenum hq_uni_stream_type
455392f7a3SLiteSpeed Tech{
465392f7a3SLiteSpeed Tech    HQUST_CONTROL   = 0,
475392f7a3SLiteSpeed Tech    HQUST_PUSH      = 1,
485392f7a3SLiteSpeed Tech    HQUST_QPACK_ENC = 2,
495392f7a3SLiteSpeed Tech    HQUST_QPACK_DEC = 3,
505392f7a3SLiteSpeed Tech};
515392f7a3SLiteSpeed Tech
525392f7a3SLiteSpeed Tech
5392f6e17bSDmitri Tikhonov/* [draft-ietf-quic-http-23] Section 8.1 and
545392f7a3SLiteSpeed Tech * [draft-ietf-quic-qpack-08], Section 8.3
555392f7a3SLiteSpeed Tech */
565392f7a3SLiteSpeed Techenum http_error_code
575392f7a3SLiteSpeed Tech{
5892f6e17bSDmitri Tikhonov    HEC_NO_ERROR                =  0x100,
5992f6e17bSDmitri Tikhonov    HEC_GENERAL_PROTOCOL_ERROR  =  0x101,
6092f6e17bSDmitri Tikhonov    HEC_INTERNAL_ERROR          =  0x102,
6192f6e17bSDmitri Tikhonov    HEC_STREAM_CREATION_ERROR   =  0x103,
6292f6e17bSDmitri Tikhonov    HEC_CLOSED_CRITICAL_STREAM  =  0x104,
6392f6e17bSDmitri Tikhonov    HEC_FRAME_UNEXPECTED        =  0x105,
6492f6e17bSDmitri Tikhonov    HEC_FRAME_ERROR             =  0x106,
6592f6e17bSDmitri Tikhonov    HEC_EXCESSIVE_LOAD          =  0x107,
6692f6e17bSDmitri Tikhonov    HEC_ID_ERROR                =  0x108,
6792f6e17bSDmitri Tikhonov    HEC_SETTINGS_ERROR          =  0x109,
6892f6e17bSDmitri Tikhonov    HEC_MISSING_SETTINGS        =  0x10A,
6992f6e17bSDmitri Tikhonov    HEC_REQUEST_REJECTED        =  0x10B,
7092f6e17bSDmitri Tikhonov    HEC_REQUEST_CANCELLED       =  0x10C,
7192f6e17bSDmitri Tikhonov    HEC_REQUEST_INCOMPLETE      =  0x10D,
7292f6e17bSDmitri Tikhonov    HEC_EARLY_RESPONSE          =  0x10E,
7392f6e17bSDmitri Tikhonov    HEC_CONNECT_ERROR           =  0x10F,
7492f6e17bSDmitri Tikhonov    HEC_VERSION_FALLBACK        =  0x110,
755392f7a3SLiteSpeed Tech    HEC_QPACK_DECOMPRESSION_FAILED  = 0x200,
765392f7a3SLiteSpeed Tech    HEC_QPACK_ENCODER_STREAM_ERROR  = 0x201,
775392f7a3SLiteSpeed Tech    HEC_QPACK_DECODER_STREAM_ERROR  = 0x202,
785392f7a3SLiteSpeed Tech};
795392f7a3SLiteSpeed Tech
805392f7a3SLiteSpeed Tech
815392f7a3SLiteSpeed Tech#endif
82