1 // 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> 9 #include <string> 10 11 #include "absl/strings/string_view.h" 12 #include "quiche/quic/core/quic_types.h" 13 #include "quiche/quic/platform/api/quic_export.h" 14 15 namespace quic { 16 17 // Unidirectional stream types. 18 enum : 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, 25 // https://ietf-wg-webtrans.github.io/draft-ietf-webtrans-http3/draft-ietf-webtrans-http3.html#name-unidirectional-streams 26 kWebTransportUnidirectionalStream = 0x54, 27 }; 28 29 // This includes control stream, QPACK encoder stream, and QPACK decoder stream. 30 enum : QuicStreamCount { kHttp3StaticUnidirectionalStreamCount = 3 }; 31 32 // HTTP/3 and QPACK settings identifiers. 33 // https://quicwg.org/base-drafts/draft-ietf-quic-http.html#settings-parameters 34 // https://quicwg.org/base-drafts/draft-ietf-quic-qpack.html#configuration 35 enum 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. 39 SETTINGS_MAX_FIELD_SECTION_SIZE = 0x06, 40 SETTINGS_QPACK_BLOCKED_STREAMS = 0x07, 41 // draft-ietf-masque-h3-datagram-04. 42 SETTINGS_H3_DATAGRAM_DRAFT04 = 0xffd277, 43 // RFC 9297. 44 SETTINGS_H3_DATAGRAM = 0x33, 45 // draft-ietf-webtrans-http3 46 SETTINGS_WEBTRANS_DRAFT00 = 0x2b603742, 47 SETTINGS_WEBTRANS_MAX_SESSIONS_DRAFT07 = 0xc671706a, 48 // draft-ietf-httpbis-h3-websockets 49 SETTINGS_ENABLE_CONNECT_PROTOCOL = 0x08, 50 SETTINGS_ENABLE_METADATA = 0x4d44, 51 }; 52 53 // Returns HTTP/3 SETTINGS identifier as a string. 54 QUICHE_EXPORT std::string H3SettingsToString( 55 Http3AndQpackSettingsIdentifiers identifier); 56 57 // Default maximum dynamic table capacity, communicated via 58 // SETTINGS_QPACK_MAX_TABLE_CAPACITY. 59 enum : QuicByteCount { 60 kDefaultQpackMaxDynamicTableCapacity = 64 * 1024 // 64 KB 61 }; 62 63 // Default limit on the size of uncompressed headers, 64 // communicated via SETTINGS_MAX_HEADER_LIST_SIZE. 65 enum : QuicByteCount { 66 kDefaultMaxUncompressedHeaderSize = 16 * 1024 // 16 KB 67 }; 68 69 // Default limit on number of blocked streams, communicated via 70 // SETTINGS_QPACK_BLOCKED_STREAMS. 71 enum : uint64_t { kDefaultMaximumBlockedStreams = 100 }; 72 73 ABSL_CONST_INIT QUICHE_EXPORT extern const absl::string_view 74 kUserAgentHeaderName; 75 76 } // namespace quic 77 78 #endif // QUICHE_QUIC_CORE_HTTP_HTTP_CONSTANTS_H_ 79