blob: c13a1a8c2b29d16c1353609524025fffe964f679 [file] [log] [blame]
bnc3fc60df2019-07-17 11:55:10 -07001// Copyright (c) 2019 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef QUICHE_QUIC_CORE_HTTP_HTTP_CONSTANTS_H_
6#define QUICHE_QUIC_CORE_HTTP_HTTP_CONSTANTS_H_
7
8#include <cstdint>
bncf33be612021-01-22 11:20:51 -08009#include <string>
bnc3fc60df2019-07-17 11:55:10 -070010
vasilvva778b752021-03-01 11:07:02 -080011#include "absl/strings/string_view.h"
QUICHE team5be974e2020-12-29 18:35:24 -050012#include "quic/core/quic_types.h"
vasilvv443fa2d2021-01-25 11:32:08 -080013#include "quic/platform/api/quic_export.h"
bnc63becfb2019-07-29 10:19:53 -070014
bnc3fc60df2019-07-17 11:55:10 -070015namespace quic {
16
17// Unidirectional stream types.
vasilvva778b752021-03-01 11:07:02 -080018enum : uint64_t {
19 // https://quicwg.org/base-drafts/draft-ietf-quic-http.html#unidirectional-streams
20 kControlStream = 0x00,
21 kServerPushStream = 0x01,
22 // https://quicwg.org/base-drafts/draft-ietf-quic-qpack.html#enc-dec-stream-def
23 kQpackEncoderStream = 0x02,
24 kQpackDecoderStream = 0x03,
vasilvv316f3762021-03-31 13:49:30 -070025 // https://ietf-wg-webtrans.github.io/draft-ietf-webtrans-http3/draft-ietf-webtrans-http3.html#name-unidirectional-streams
26 kWebTransportUnidirectionalStream = 0x54,
vasilvva778b752021-03-01 11:07:02 -080027};
bnc3fc60df2019-07-17 11:55:10 -070028
renjietang241ba602020-04-29 13:29:46 -070029// This includes control stream, QPACK encoder stream, and QPACK decoder stream.
vasilvva778b752021-03-01 11:07:02 -080030enum : QuicStreamCount { kHttp3StaticUnidirectionalStreamCount = 3 };
renjietang241ba602020-04-29 13:29:46 -070031
bnc63becfb2019-07-29 10:19:53 -070032// HTTP/3 and QPACK settings identifiers.
bnc3fc60df2019-07-17 11:55:10 -070033// https://quicwg.org/base-drafts/draft-ietf-quic-http.html#settings-parameters
bnc3fc60df2019-07-17 11:55:10 -070034// https://quicwg.org/base-drafts/draft-ietf-quic-qpack.html#configuration
bnc63becfb2019-07-29 10:19:53 -070035enum Http3AndQpackSettingsIdentifiers : uint64_t {
36 // Same value as spdy::SETTINGS_HEADER_TABLE_SIZE.
37 SETTINGS_QPACK_MAX_TABLE_CAPACITY = 0x01,
38 // Same value as spdy::SETTINGS_MAX_HEADER_LIST_SIZE.
renjietang4e9714d2020-09-21 15:25:23 -070039 SETTINGS_MAX_FIELD_SECTION_SIZE = 0x06,
bnc63becfb2019-07-29 10:19:53 -070040 SETTINGS_QPACK_BLOCKED_STREAMS = 0x07,
dschinazi388d7f92021-02-25 20:58:46 -080041 // draft-ietf-masque-h3-datagram.
42 SETTINGS_H3_DATAGRAM = 0x276,
vasilvv52ca55d2021-03-02 13:17:59 -080043 // draft-ietf-webtrans-http3-00
44 SETTINGS_WEBTRANS_DRAFT00 = 0x2b603742,
bnc63becfb2019-07-29 10:19:53 -070045};
46
bncf33be612021-01-22 11:20:51 -080047// Returns HTTP/3 SETTINGS identifier as a string.
vasilvv443fa2d2021-01-25 11:32:08 -080048QUIC_EXPORT std::string H3SettingsToString(
49 Http3AndQpackSettingsIdentifiers identifier);
bncf33be612021-01-22 11:20:51 -080050
bnc63becfb2019-07-29 10:19:53 -070051// Default maximum dynamic table capacity, communicated via
52// SETTINGS_QPACK_MAX_TABLE_CAPACITY.
vasilvva778b752021-03-01 11:07:02 -080053enum : QuicByteCount {
54 kDefaultQpackMaxDynamicTableCapacity = 64 * 1024 // 64 KB
55};
bnc3fc60df2019-07-17 11:55:10 -070056
renjietang2253f4c2020-08-05 10:43:56 -070057// Default limit on the size of uncompressed headers,
58// communicated via SETTINGS_MAX_HEADER_LIST_SIZE.
vasilvva778b752021-03-01 11:07:02 -080059enum : QuicByteCount {
60 kDefaultMaxUncompressedHeaderSize = 16 * 1024 // 16 KB
61};
renjietang2253f4c2020-08-05 10:43:56 -070062
bnc57b5f622019-08-21 14:07:44 -070063// Default limit on number of blocked streams, communicated via
64// SETTINGS_QPACK_BLOCKED_STREAMS.
vasilvva778b752021-03-01 11:07:02 -080065enum : uint64_t { kDefaultMaximumBlockedStreams = 100 };
bnc57b5f622019-08-21 14:07:44 -070066
dschinazi6e3b1142021-03-01 13:34:16 -080067ABSL_CONST_INIT QUIC_EXPORT_PRIVATE extern const absl::string_view
vasilvva778b752021-03-01 11:07:02 -080068 kUserAgentHeaderName;
bncf33be612021-01-22 11:20:51 -080069
bnc3fc60df2019-07-17 11:55:10 -070070} // namespace quic
71
72#endif // QUICHE_QUIC_CORE_HTTP_HTTP_CONSTANTS_H_