grpc
src
core
ext
transport
chttp2
transport
http2_settings.cc
Go to the documentation of this file.
1
/*
2
* Copyright 2017 gRPC authors.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
/*
18
* Automatically generated by tools/codegen/core/gen_settings_ids.py
19
*/
20
21
#include <
grpc/support/port_platform.h
>
22
23
#include "
src/core/ext/transport/chttp2/transport/http2_settings.h
"
24
25
#include "
src/core/lib/gpr/useful.h
"
26
#include "
src/core/lib/transport/http2_errors.h
"
27
28
const
uint16_t
grpc_setting_id_to_wire_id
[] = {1, 2, 3, 4, 5, 6, 65027};
29
30
bool
grpc_wire_id_to_setting_id
(
uint32_t
wire_id,
grpc_chttp2_setting_id
*
out
) {
31
uint32_t
i
= wire_id - 1;
32
uint32_t
x
=
i
% 256;
33
uint32_t
y
=
i
/ 256;
34
uint32_t
h =
x
;
35
switch
(
y
) {
36
case
254:
37
h += 4;
38
break
;
39
}
40
*
out
=
static_cast<
grpc_chttp2_setting_id
>
(h);
41
return
h <
GPR_ARRAY_SIZE
(
grpc_setting_id_to_wire_id
) &&
42
grpc_setting_id_to_wire_id
[h] == wire_id;
43
}
44
45
const
grpc_chttp2_setting_parameters
46
grpc_chttp2_settings_parameters
[
GRPC_CHTTP2_NUM_SETTINGS
] = {
47
{
"HEADER_TABLE_SIZE"
, 4096
u
, 0
u
, 4294967295
u
,
48
GRPC_CHTTP2_CLAMP_INVALID_VALUE
,
GRPC_HTTP2_PROTOCOL_ERROR
},
49
{
"ENABLE_PUSH"
, 1
u
, 0
u
, 1
u
,
GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE
,
50
GRPC_HTTP2_PROTOCOL_ERROR
},
51
{
"MAX_CONCURRENT_STREAMS"
, 4294967295
u
, 0
u
, 4294967295
u
,
52
GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE
,
GRPC_HTTP2_PROTOCOL_ERROR
},
53
{
"INITIAL_WINDOW_SIZE"
, 65535
u
, 0
u
, 2147483647
u
,
54
GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE
,
55
GRPC_HTTP2_FLOW_CONTROL_ERROR
},
56
{
"MAX_FRAME_SIZE"
, 16384
u
, 16384
u
, 16777215
u
,
57
GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE
,
GRPC_HTTP2_PROTOCOL_ERROR
},
58
{
"MAX_HEADER_LIST_SIZE"
, 16777216
u
, 0
u
, 16777216
u
,
59
GRPC_CHTTP2_CLAMP_INVALID_VALUE
,
GRPC_HTTP2_PROTOCOL_ERROR
},
60
{
"GRPC_ALLOW_TRUE_BINARY_METADATA"
, 0
u
, 0
u
, 1
u
,
61
GRPC_CHTTP2_CLAMP_INVALID_VALUE
,
GRPC_HTTP2_PROTOCOL_ERROR
},
62
};
grpc_setting_id_to_wire_id
const uint16_t grpc_setting_id_to_wire_id[]
Definition:
http2_settings.cc:28
gen_build_yaml.out
dictionary out
Definition:
src/benchmark/gen_build_yaml.py:24
GRPC_CHTTP2_CLAMP_INVALID_VALUE
@ GRPC_CHTTP2_CLAMP_INVALID_VALUE
Definition:
http2_settings.h:45
uint16_t
unsigned short uint16_t
Definition:
stdint-msvc2008.h:79
grpc_chttp2_setting_parameters
Definition:
http2_settings.h:49
y
const double y
Definition:
bloaty/third_party/googletest/googlemock/test/gmock-matchers_test.cc:3611
useful.h
u
OPENSSL_EXPORT pem_password_cb void * u
Definition:
pem.h:351
uint32_t
unsigned int uint32_t
Definition:
stdint-msvc2008.h:80
http2_settings.h
GRPC_HTTP2_FLOW_CONTROL_ERROR
@ GRPC_HTTP2_FLOW_CONTROL_ERROR
Definition:
http2_errors.h:27
GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE
@ GRPC_CHTTP2_DISCONNECT_ON_INVALID_VALUE
Definition:
http2_settings.h:46
grpc_wire_id_to_setting_id
bool grpc_wire_id_to_setting_id(uint32_t wire_id, grpc_chttp2_setting_id *out)
Definition:
http2_settings.cc:30
x
int x
Definition:
bloaty/third_party/googletest/googlemock/test/gmock-matchers_test.cc:3610
grpc_chttp2_setting_id
grpc_chttp2_setting_id
Definition:
http2_settings.h:28
GPR_ARRAY_SIZE
#define GPR_ARRAY_SIZE(array)
Definition:
useful.h:129
GRPC_CHTTP2_NUM_SETTINGS
#define GRPC_CHTTP2_NUM_SETTINGS
Definition:
http2_settings.h:38
http2_errors.h
grpc_chttp2_settings_parameters
const grpc_chttp2_setting_parameters grpc_chttp2_settings_parameters[GRPC_CHTTP2_NUM_SETTINGS]
Definition:
http2_settings.cc:46
GRPC_HTTP2_PROTOCOL_ERROR
@ GRPC_HTTP2_PROTOCOL_ERROR
Definition:
http2_errors.h:25
i
uint64_t i
Definition:
abseil-cpp/absl/container/btree_benchmark.cc:230
port_platform.h
grpc
Author(s):
autogenerated on Fri May 16 2025 02:59:02