1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
// Copyright 2023 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Automatically generated by tools/codegen/core/gen_config_vars.py
//
#include <grpc/support/port_platform.h>
#include "src/core/lib/config/config_vars.h"
#include "y_absl/flags/flag.h"
#include "y_absl/strings/escaping.h"
#include "y_absl/strings/str_cat.h"
#include "src/core/lib/config/load_config.h"
#ifndef GPR_DEFAULT_LOG_VERBOSITY_STRING
#define GPR_DEFAULT_LOG_VERBOSITY_STRING "ERROR"
#endif // !GPR_DEFAULT_LOG_VERBOSITY_STRING
#ifdef GRPC_ENABLE_FORK_SUPPORT
#define GRPC_ENABLE_FORK_SUPPORT_DEFAULT true
#else
#define GRPC_ENABLE_FORK_SUPPORT_DEFAULT false
#endif // GRPC_ENABLE_FORK_SUPPORT
Y_ABSL_FLAG(y_absl::optional<TString>, grpc_experiments, y_absl::nullopt,
"A comma separated list of currently active experiments. Experiments "
"may be prefixed with a '-' to disable them.");
Y_ABSL_FLAG(y_absl::optional<int32_t>, grpc_client_channel_backup_poll_interval_ms,
y_absl::nullopt,
"Declares the interval in ms between two backup polls on client "
"channels. These polls are run in the timer thread so that gRPC can "
"process connection failures while there is no active polling "
"thread. They help reconnect disconnected client channels (mostly "
"due to idleness), so that the next RPC on this channel won't fail. "
"Set to 0 to turn off the backup polls.");
Y_ABSL_FLAG(y_absl::optional<TString>, grpc_dns_resolver, y_absl::nullopt,
"Declares which DNS resolver to use. The default is ares if gRPC is "
"built with c-ares support. Otherwise, the value of this environment "
"variable is ignored.");
Y_ABSL_FLAG(y_absl::optional<TString>, grpc_trace, y_absl::nullopt,
"A comma separated list of tracers that provide additional insight "
"into how gRPC C core is processing requests via debug logs.");
Y_ABSL_FLAG(y_absl::optional<TString>, grpc_verbosity, y_absl::nullopt,
"Default gRPC logging verbosity");
Y_ABSL_FLAG(y_absl::optional<TString>, grpc_stacktrace_minloglevel,
y_absl::nullopt,
"Messages logged at the same or higher level than this will print "
"stacktrace");
Y_ABSL_FLAG(y_absl::optional<bool>, grpc_enable_fork_support, y_absl::nullopt,
"Enable fork support");
Y_ABSL_FLAG(y_absl::optional<TString>, grpc_poll_strategy, y_absl::nullopt,
"Declares which polling engines to try when starting gRPC. This is a "
"comma-separated list of engines, which are tried in priority order "
"first -> last.");
Y_ABSL_FLAG(y_absl::optional<bool>, grpc_abort_on_leaks, y_absl::nullopt,
"A debugging aid to cause a call to abort() when gRPC objects are "
"leaked past grpc_shutdown()");
Y_ABSL_FLAG(y_absl::optional<TString>, grpc_system_ssl_roots_dir, y_absl::nullopt,
"Custom directory to SSL Roots");
Y_ABSL_FLAG(y_absl::optional<TString>, grpc_default_ssl_roots_file_path,
y_absl::nullopt, "Path to the default SSL roots file.");
Y_ABSL_FLAG(y_absl::optional<bool>, grpc_not_use_system_ssl_roots, y_absl::nullopt,
"Disable loading system root certificates.");
Y_ABSL_FLAG(y_absl::optional<TString>, grpc_ssl_cipher_suites, y_absl::nullopt,
"A colon separated list of cipher suites to use with OpenSSL");
namespace grpc_core {
ConfigVars::ConfigVars(const Overrides& overrides)
: client_channel_backup_poll_interval_ms_(
LoadConfig(FLAGS_grpc_client_channel_backup_poll_interval_ms,
"GRPC_CLIENT_CHANNEL_BACKUP_POLL_INTERVAL_MS",
overrides.client_channel_backup_poll_interval_ms, 5000)),
enable_fork_support_(LoadConfig(
FLAGS_grpc_enable_fork_support, "GRPC_ENABLE_FORK_SUPPORT",
overrides.enable_fork_support, GRPC_ENABLE_FORK_SUPPORT_DEFAULT)),
abort_on_leaks_(LoadConfig(FLAGS_grpc_abort_on_leaks,
"GRPC_ABORT_ON_LEAKS",
overrides.abort_on_leaks, false)),
not_use_system_ssl_roots_(LoadConfig(
FLAGS_grpc_not_use_system_ssl_roots, "GRPC_NOT_USE_SYSTEM_SSL_ROOTS",
overrides.not_use_system_ssl_roots, false)),
experiments_(LoadConfig(FLAGS_grpc_experiments, "GRPC_EXPERIMENTS",
overrides.experiments, "")),
dns_resolver_(LoadConfig(FLAGS_grpc_dns_resolver, "GRPC_DNS_RESOLVER",
overrides.dns_resolver, "")),
trace_(LoadConfig(FLAGS_grpc_trace, "GRPC_TRACE", overrides.trace, "")),
verbosity_(LoadConfig(FLAGS_grpc_verbosity, "GRPC_VERBOSITY",
overrides.verbosity,
GPR_DEFAULT_LOG_VERBOSITY_STRING)),
stacktrace_minloglevel_(LoadConfig(FLAGS_grpc_stacktrace_minloglevel,
"GRPC_STACKTRACE_MINLOGLEVEL",
overrides.stacktrace_minloglevel, "")),
poll_strategy_(LoadConfig(FLAGS_grpc_poll_strategy, "GRPC_POLL_STRATEGY",
overrides.poll_strategy, "all")),
ssl_cipher_suites_(LoadConfig(
FLAGS_grpc_ssl_cipher_suites, "GRPC_SSL_CIPHER_SUITES",
overrides.ssl_cipher_suites,
"TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_"
"SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:"
"ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384")),
override_system_ssl_roots_dir_(overrides.system_ssl_roots_dir),
override_default_ssl_roots_file_path_(
overrides.default_ssl_roots_file_path) {}
TString ConfigVars::SystemSslRootsDir() const {
return LoadConfig(FLAGS_grpc_system_ssl_roots_dir,
"GRPC_SYSTEM_SSL_ROOTS_DIR", override_system_ssl_roots_dir_,
"");
}
TString ConfigVars::DefaultSslRootsFilePath() const {
return LoadConfig(FLAGS_grpc_default_ssl_roots_file_path,
"GRPC_DEFAULT_SSL_ROOTS_FILE_PATH",
override_default_ssl_roots_file_path_, "");
}
TString ConfigVars::ToString() const {
return y_absl::StrCat(
"experiments: ", "\"", y_absl::CEscape(Experiments()), "\"",
", client_channel_backup_poll_interval_ms: ",
ClientChannelBackupPollIntervalMs(), ", dns_resolver: ", "\"",
y_absl::CEscape(DnsResolver()), "\"", ", trace: ", "\"",
y_absl::CEscape(Trace()), "\"", ", verbosity: ", "\"",
y_absl::CEscape(Verbosity()), "\"", ", stacktrace_minloglevel: ", "\"",
y_absl::CEscape(StacktraceMinloglevel()), "\"",
", enable_fork_support: ", EnableForkSupport() ? "true" : "false",
", poll_strategy: ", "\"", y_absl::CEscape(PollStrategy()), "\"",
", abort_on_leaks: ", AbortOnLeaks() ? "true" : "false",
", system_ssl_roots_dir: ", "\"", y_absl::CEscape(SystemSslRootsDir()),
"\"", ", default_ssl_roots_file_path: ", "\"",
y_absl::CEscape(DefaultSslRootsFilePath()), "\"",
", not_use_system_ssl_roots: ", NotUseSystemSslRoots() ? "true" : "false",
", ssl_cipher_suites: ", "\"", y_absl::CEscape(SslCipherSuites()), "\"");
}
} // namespace grpc_core
|