1 /*
2 * Copyright 2015 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 * WARNING: Auto-generated code.
19 *
20 * To make changes to this file, change
21 * tools/codegen/core/gen_static_metadata.py, and then re-run it.
22 *
23 * See metadata.h for an explanation of the interface here, and metadata.cc for
24 * an explanation of what's going on.
25 */
26
27 #ifndef GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H
28 #define GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H
29
30 #include <grpc/support/port_platform.h>
31
32 #include <cstdint>
33
34 #include "src/core/lib/transport/metadata.h"
35
36 static_assert(
37 std::is_trivially_destructible<grpc_core::StaticMetadataSlice>::value,
38 "grpc_core::StaticMetadataSlice must be trivially destructible.");
39 #define GRPC_STATIC_MDSTR_COUNT 110
40
41 void grpc_init_static_metadata_ctx(void);
42 void grpc_destroy_static_metadata_ctx(void);
43 namespace grpc_core {
44 #ifndef NDEBUG
45 constexpr uint64_t kGrpcStaticMetadataInitCanary = 0xCAFEF00DC0FFEE11L;
46 uint64_t StaticMetadataInitCanary();
47 #endif
48 extern const StaticMetadataSlice* g_static_metadata_slice_table;
49 } // namespace grpc_core
grpc_static_slice_table()50 inline const grpc_core::StaticMetadataSlice* grpc_static_slice_table() {
51 GPR_DEBUG_ASSERT(grpc_core::StaticMetadataInitCanary() ==
52 grpc_core::kGrpcStaticMetadataInitCanary);
53 GPR_DEBUG_ASSERT(grpc_core::g_static_metadata_slice_table != nullptr);
54 return grpc_core::g_static_metadata_slice_table;
55 }
56
57 /* ":path" */
58 #define GRPC_MDSTR_PATH (grpc_static_slice_table()[0])
59 /* ":method" */
60 #define GRPC_MDSTR_METHOD (grpc_static_slice_table()[1])
61 /* ":status" */
62 #define GRPC_MDSTR_STATUS (grpc_static_slice_table()[2])
63 /* ":authority" */
64 #define GRPC_MDSTR_AUTHORITY (grpc_static_slice_table()[3])
65 /* ":scheme" */
66 #define GRPC_MDSTR_SCHEME (grpc_static_slice_table()[4])
67 /* "te" */
68 #define GRPC_MDSTR_TE (grpc_static_slice_table()[5])
69 /* "grpc-message" */
70 #define GRPC_MDSTR_GRPC_MESSAGE (grpc_static_slice_table()[6])
71 /* "grpc-status" */
72 #define GRPC_MDSTR_GRPC_STATUS (grpc_static_slice_table()[7])
73 /* "grpc-payload-bin" */
74 #define GRPC_MDSTR_GRPC_PAYLOAD_BIN (grpc_static_slice_table()[8])
75 /* "grpc-encoding" */
76 #define GRPC_MDSTR_GRPC_ENCODING (grpc_static_slice_table()[9])
77 /* "grpc-accept-encoding" */
78 #define GRPC_MDSTR_GRPC_ACCEPT_ENCODING (grpc_static_slice_table()[10])
79 /* "grpc-server-stats-bin" */
80 #define GRPC_MDSTR_GRPC_SERVER_STATS_BIN (grpc_static_slice_table()[11])
81 /* "grpc-tags-bin" */
82 #define GRPC_MDSTR_GRPC_TAGS_BIN (grpc_static_slice_table()[12])
83 /* "grpc-trace-bin" */
84 #define GRPC_MDSTR_GRPC_TRACE_BIN (grpc_static_slice_table()[13])
85 /* "content-type" */
86 #define GRPC_MDSTR_CONTENT_TYPE (grpc_static_slice_table()[14])
87 /* "content-encoding" */
88 #define GRPC_MDSTR_CONTENT_ENCODING (grpc_static_slice_table()[15])
89 /* "accept-encoding" */
90 #define GRPC_MDSTR_ACCEPT_ENCODING (grpc_static_slice_table()[16])
91 /* "grpc-internal-encoding-request" */
92 #define GRPC_MDSTR_GRPC_INTERNAL_ENCODING_REQUEST \
93 (grpc_static_slice_table()[17])
94 /* "grpc-internal-stream-encoding-request" */
95 #define GRPC_MDSTR_GRPC_INTERNAL_STREAM_ENCODING_REQUEST \
96 (grpc_static_slice_table()[18])
97 /* "user-agent" */
98 #define GRPC_MDSTR_USER_AGENT (grpc_static_slice_table()[19])
99 /* "host" */
100 #define GRPC_MDSTR_HOST (grpc_static_slice_table()[20])
101 /* "grpc-previous-rpc-attempts" */
102 #define GRPC_MDSTR_GRPC_PREVIOUS_RPC_ATTEMPTS (grpc_static_slice_table()[21])
103 /* "grpc-retry-pushback-ms" */
104 #define GRPC_MDSTR_GRPC_RETRY_PUSHBACK_MS (grpc_static_slice_table()[22])
105 /* "x-endpoint-load-metrics-bin" */
106 #define GRPC_MDSTR_X_ENDPOINT_LOAD_METRICS_BIN (grpc_static_slice_table()[23])
107 /* "grpc-timeout" */
108 #define GRPC_MDSTR_GRPC_TIMEOUT (grpc_static_slice_table()[24])
109 /* "1" */
110 #define GRPC_MDSTR_1 (grpc_static_slice_table()[25])
111 /* "2" */
112 #define GRPC_MDSTR_2 (grpc_static_slice_table()[26])
113 /* "3" */
114 #define GRPC_MDSTR_3 (grpc_static_slice_table()[27])
115 /* "4" */
116 #define GRPC_MDSTR_4 (grpc_static_slice_table()[28])
117 /* "" */
118 #define GRPC_MDSTR_EMPTY (grpc_static_slice_table()[29])
119 /* "grpc.wait_for_ready" */
120 #define GRPC_MDSTR_GRPC_DOT_WAIT_FOR_READY (grpc_static_slice_table()[30])
121 /* "grpc.timeout" */
122 #define GRPC_MDSTR_GRPC_DOT_TIMEOUT (grpc_static_slice_table()[31])
123 /* "grpc.max_request_message_bytes" */
124 #define GRPC_MDSTR_GRPC_DOT_MAX_REQUEST_MESSAGE_BYTES \
125 (grpc_static_slice_table()[32])
126 /* "grpc.max_response_message_bytes" */
127 #define GRPC_MDSTR_GRPC_DOT_MAX_RESPONSE_MESSAGE_BYTES \
128 (grpc_static_slice_table()[33])
129 /* "/grpc.lb.v1.LoadBalancer/BalanceLoad" */
130 #define GRPC_MDSTR_SLASH_GRPC_DOT_LB_DOT_V1_DOT_LOADBALANCER_SLASH_BALANCELOAD \
131 (grpc_static_slice_table()[34])
132 /* "/envoy.service.load_stats.v2.LoadReportingService/StreamLoadStats" */
133 #define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_LOAD_STATS_DOT_V2_DOT_LOADREPORTINGSERVICE_SLASH_STREAMLOADSTATS \
134 (grpc_static_slice_table()[35])
135 /* "/envoy.service.load_stats.v3.LoadReportingService/StreamLoadStats" */
136 #define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_LOAD_STATS_DOT_V3_DOT_LOADREPORTINGSERVICE_SLASH_STREAMLOADSTATS \
137 (grpc_static_slice_table()[36])
138 /* "/grpc.health.v1.Health/Watch" */
139 #define GRPC_MDSTR_SLASH_GRPC_DOT_HEALTH_DOT_V1_DOT_HEALTH_SLASH_WATCH \
140 (grpc_static_slice_table()[37])
141 /* "/envoy.service.discovery.v2.AggregatedDiscoveryService/StreamAggregatedResources"
142 */
143 #define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_DISCOVERY_DOT_V2_DOT_AGGREGATEDDISCOVERYSERVICE_SLASH_STREAMAGGREGATEDRESOURCES \
144 (grpc_static_slice_table()[38])
145 /* "/envoy.service.discovery.v3.AggregatedDiscoveryService/StreamAggregatedResources"
146 */
147 #define GRPC_MDSTR_SLASH_ENVOY_DOT_SERVICE_DOT_DISCOVERY_DOT_V3_DOT_AGGREGATEDDISCOVERYSERVICE_SLASH_STREAMAGGREGATEDRESOURCES \
148 (grpc_static_slice_table()[39])
149 /* "deflate" */
150 #define GRPC_MDSTR_DEFLATE (grpc_static_slice_table()[40])
151 /* "gzip" */
152 #define GRPC_MDSTR_GZIP (grpc_static_slice_table()[41])
153 /* "stream/gzip" */
154 #define GRPC_MDSTR_STREAM_SLASH_GZIP (grpc_static_slice_table()[42])
155 /* "GET" */
156 #define GRPC_MDSTR_GET (grpc_static_slice_table()[43])
157 /* "POST" */
158 #define GRPC_MDSTR_POST (grpc_static_slice_table()[44])
159 /* "/" */
160 #define GRPC_MDSTR_SLASH (grpc_static_slice_table()[45])
161 /* "/index.html" */
162 #define GRPC_MDSTR_SLASH_INDEX_DOT_HTML (grpc_static_slice_table()[46])
163 /* "http" */
164 #define GRPC_MDSTR_HTTP (grpc_static_slice_table()[47])
165 /* "https" */
166 #define GRPC_MDSTR_HTTPS (grpc_static_slice_table()[48])
167 /* "200" */
168 #define GRPC_MDSTR_200 (grpc_static_slice_table()[49])
169 /* "204" */
170 #define GRPC_MDSTR_204 (grpc_static_slice_table()[50])
171 /* "206" */
172 #define GRPC_MDSTR_206 (grpc_static_slice_table()[51])
173 /* "304" */
174 #define GRPC_MDSTR_304 (grpc_static_slice_table()[52])
175 /* "400" */
176 #define GRPC_MDSTR_400 (grpc_static_slice_table()[53])
177 /* "404" */
178 #define GRPC_MDSTR_404 (grpc_static_slice_table()[54])
179 /* "500" */
180 #define GRPC_MDSTR_500 (grpc_static_slice_table()[55])
181 /* "accept-charset" */
182 #define GRPC_MDSTR_ACCEPT_CHARSET (grpc_static_slice_table()[56])
183 /* "gzip, deflate" */
184 #define GRPC_MDSTR_GZIP_COMMA_DEFLATE (grpc_static_slice_table()[57])
185 /* "accept-language" */
186 #define GRPC_MDSTR_ACCEPT_LANGUAGE (grpc_static_slice_table()[58])
187 /* "accept-ranges" */
188 #define GRPC_MDSTR_ACCEPT_RANGES (grpc_static_slice_table()[59])
189 /* "accept" */
190 #define GRPC_MDSTR_ACCEPT (grpc_static_slice_table()[60])
191 /* "access-control-allow-origin" */
192 #define GRPC_MDSTR_ACCESS_CONTROL_ALLOW_ORIGIN (grpc_static_slice_table()[61])
193 /* "age" */
194 #define GRPC_MDSTR_AGE (grpc_static_slice_table()[62])
195 /* "allow" */
196 #define GRPC_MDSTR_ALLOW (grpc_static_slice_table()[63])
197 /* "authorization" */
198 #define GRPC_MDSTR_AUTHORIZATION (grpc_static_slice_table()[64])
199 /* "cache-control" */
200 #define GRPC_MDSTR_CACHE_CONTROL (grpc_static_slice_table()[65])
201 /* "content-disposition" */
202 #define GRPC_MDSTR_CONTENT_DISPOSITION (grpc_static_slice_table()[66])
203 /* "content-language" */
204 #define GRPC_MDSTR_CONTENT_LANGUAGE (grpc_static_slice_table()[67])
205 /* "content-length" */
206 #define GRPC_MDSTR_CONTENT_LENGTH (grpc_static_slice_table()[68])
207 /* "content-location" */
208 #define GRPC_MDSTR_CONTENT_LOCATION (grpc_static_slice_table()[69])
209 /* "content-range" */
210 #define GRPC_MDSTR_CONTENT_RANGE (grpc_static_slice_table()[70])
211 /* "cookie" */
212 #define GRPC_MDSTR_COOKIE (grpc_static_slice_table()[71])
213 /* "date" */
214 #define GRPC_MDSTR_DATE (grpc_static_slice_table()[72])
215 /* "etag" */
216 #define GRPC_MDSTR_ETAG (grpc_static_slice_table()[73])
217 /* "expect" */
218 #define GRPC_MDSTR_EXPECT (grpc_static_slice_table()[74])
219 /* "expires" */
220 #define GRPC_MDSTR_EXPIRES (grpc_static_slice_table()[75])
221 /* "from" */
222 #define GRPC_MDSTR_FROM (grpc_static_slice_table()[76])
223 /* "if-match" */
224 #define GRPC_MDSTR_IF_MATCH (grpc_static_slice_table()[77])
225 /* "if-modified-since" */
226 #define GRPC_MDSTR_IF_MODIFIED_SINCE (grpc_static_slice_table()[78])
227 /* "if-none-match" */
228 #define GRPC_MDSTR_IF_NONE_MATCH (grpc_static_slice_table()[79])
229 /* "if-range" */
230 #define GRPC_MDSTR_IF_RANGE (grpc_static_slice_table()[80])
231 /* "if-unmodified-since" */
232 #define GRPC_MDSTR_IF_UNMODIFIED_SINCE (grpc_static_slice_table()[81])
233 /* "last-modified" */
234 #define GRPC_MDSTR_LAST_MODIFIED (grpc_static_slice_table()[82])
235 /* "link" */
236 #define GRPC_MDSTR_LINK (grpc_static_slice_table()[83])
237 /* "location" */
238 #define GRPC_MDSTR_LOCATION (grpc_static_slice_table()[84])
239 /* "max-forwards" */
240 #define GRPC_MDSTR_MAX_FORWARDS (grpc_static_slice_table()[85])
241 /* "proxy-authenticate" */
242 #define GRPC_MDSTR_PROXY_AUTHENTICATE (grpc_static_slice_table()[86])
243 /* "proxy-authorization" */
244 #define GRPC_MDSTR_PROXY_AUTHORIZATION (grpc_static_slice_table()[87])
245 /* "range" */
246 #define GRPC_MDSTR_RANGE (grpc_static_slice_table()[88])
247 /* "referer" */
248 #define GRPC_MDSTR_REFERER (grpc_static_slice_table()[89])
249 /* "refresh" */
250 #define GRPC_MDSTR_REFRESH (grpc_static_slice_table()[90])
251 /* "retry-after" */
252 #define GRPC_MDSTR_RETRY_AFTER (grpc_static_slice_table()[91])
253 /* "server" */
254 #define GRPC_MDSTR_SERVER (grpc_static_slice_table()[92])
255 /* "set-cookie" */
256 #define GRPC_MDSTR_SET_COOKIE (grpc_static_slice_table()[93])
257 /* "strict-transport-security" */
258 #define GRPC_MDSTR_STRICT_TRANSPORT_SECURITY (grpc_static_slice_table()[94])
259 /* "transfer-encoding" */
260 #define GRPC_MDSTR_TRANSFER_ENCODING (grpc_static_slice_table()[95])
261 /* "vary" */
262 #define GRPC_MDSTR_VARY (grpc_static_slice_table()[96])
263 /* "via" */
264 #define GRPC_MDSTR_VIA (grpc_static_slice_table()[97])
265 /* "www-authenticate" */
266 #define GRPC_MDSTR_WWW_AUTHENTICATE (grpc_static_slice_table()[98])
267 /* "0" */
268 #define GRPC_MDSTR_0 (grpc_static_slice_table()[99])
269 /* "identity" */
270 #define GRPC_MDSTR_IDENTITY (grpc_static_slice_table()[100])
271 /* "trailers" */
272 #define GRPC_MDSTR_TRAILERS (grpc_static_slice_table()[101])
273 /* "application/grpc" */
274 #define GRPC_MDSTR_APPLICATION_SLASH_GRPC (grpc_static_slice_table()[102])
275 /* "grpc" */
276 #define GRPC_MDSTR_GRPC (grpc_static_slice_table()[103])
277 /* "PUT" */
278 #define GRPC_MDSTR_PUT (grpc_static_slice_table()[104])
279 /* "lb-cost-bin" */
280 #define GRPC_MDSTR_LB_COST_BIN (grpc_static_slice_table()[105])
281 /* "identity,deflate" */
282 #define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE (grpc_static_slice_table()[106])
283 /* "identity,gzip" */
284 #define GRPC_MDSTR_IDENTITY_COMMA_GZIP (grpc_static_slice_table()[107])
285 /* "deflate,gzip" */
286 #define GRPC_MDSTR_DEFLATE_COMMA_GZIP (grpc_static_slice_table()[108])
287 /* "identity,deflate,gzip" */
288 #define GRPC_MDSTR_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \
289 (grpc_static_slice_table()[109])
290
291 namespace grpc_core {
292 struct StaticSliceRefcount;
293 extern StaticSliceRefcount* g_static_metadata_slice_refcounts;
294 } // namespace grpc_core
grpc_static_metadata_refcounts()295 inline grpc_core::StaticSliceRefcount* grpc_static_metadata_refcounts() {
296 GPR_DEBUG_ASSERT(grpc_core::StaticMetadataInitCanary() ==
297 grpc_core::kGrpcStaticMetadataInitCanary);
298 GPR_DEBUG_ASSERT(grpc_core::g_static_metadata_slice_refcounts != nullptr);
299 return grpc_core::g_static_metadata_slice_refcounts;
300 }
301
302 #define GRPC_IS_STATIC_METADATA_STRING(slice) \
303 ((slice).refcount != NULL && \
304 (slice).refcount->GetType() == grpc_slice_refcount::Type::STATIC)
305
306 #define GRPC_STATIC_METADATA_INDEX(static_slice) \
307 (reinterpret_cast<grpc_core::StaticSliceRefcount*>((static_slice).refcount) \
308 ->index)
309
310 #define GRPC_STATIC_MDELEM_COUNT 85
311
312 namespace grpc_core {
313 extern StaticMetadata* g_static_mdelem_table;
314 extern grpc_mdelem* g_static_mdelem_manifested;
315 } // namespace grpc_core
grpc_static_mdelem_table()316 inline grpc_core::StaticMetadata* grpc_static_mdelem_table() {
317 GPR_DEBUG_ASSERT(grpc_core::StaticMetadataInitCanary() ==
318 grpc_core::kGrpcStaticMetadataInitCanary);
319 GPR_DEBUG_ASSERT(grpc_core::g_static_mdelem_table != nullptr);
320 return grpc_core::g_static_mdelem_table;
321 }
grpc_static_mdelem_manifested()322 inline grpc_mdelem* grpc_static_mdelem_manifested() {
323 GPR_DEBUG_ASSERT(grpc_core::StaticMetadataInitCanary() ==
324 grpc_core::kGrpcStaticMetadataInitCanary);
325 GPR_DEBUG_ASSERT(grpc_core::g_static_mdelem_manifested != nullptr);
326 return grpc_core::g_static_mdelem_manifested;
327 }
328
329 extern uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT];
330 /* ":authority": "" */
331 #define GRPC_MDELEM_AUTHORITY_EMPTY (grpc_static_mdelem_manifested()[0])
332 /* ":method": "GET" */
333 #define GRPC_MDELEM_METHOD_GET (grpc_static_mdelem_manifested()[1])
334 /* ":method": "POST" */
335 #define GRPC_MDELEM_METHOD_POST (grpc_static_mdelem_manifested()[2])
336 /* ":path": "/" */
337 #define GRPC_MDELEM_PATH_SLASH (grpc_static_mdelem_manifested()[3])
338 /* ":path": "/index.html" */
339 #define GRPC_MDELEM_PATH_SLASH_INDEX_DOT_HTML \
340 (grpc_static_mdelem_manifested()[4])
341 /* ":scheme": "http" */
342 #define GRPC_MDELEM_SCHEME_HTTP (grpc_static_mdelem_manifested()[5])
343 /* ":scheme": "https" */
344 #define GRPC_MDELEM_SCHEME_HTTPS (grpc_static_mdelem_manifested()[6])
345 /* ":status": "200" */
346 #define GRPC_MDELEM_STATUS_200 (grpc_static_mdelem_manifested()[7])
347 /* ":status": "204" */
348 #define GRPC_MDELEM_STATUS_204 (grpc_static_mdelem_manifested()[8])
349 /* ":status": "206" */
350 #define GRPC_MDELEM_STATUS_206 (grpc_static_mdelem_manifested()[9])
351 /* ":status": "304" */
352 #define GRPC_MDELEM_STATUS_304 (grpc_static_mdelem_manifested()[10])
353 /* ":status": "400" */
354 #define GRPC_MDELEM_STATUS_400 (grpc_static_mdelem_manifested()[11])
355 /* ":status": "404" */
356 #define GRPC_MDELEM_STATUS_404 (grpc_static_mdelem_manifested()[12])
357 /* ":status": "500" */
358 #define GRPC_MDELEM_STATUS_500 (grpc_static_mdelem_manifested()[13])
359 /* "accept-charset": "" */
360 #define GRPC_MDELEM_ACCEPT_CHARSET_EMPTY (grpc_static_mdelem_manifested()[14])
361 /* "accept-encoding": "gzip, deflate" */
362 #define GRPC_MDELEM_ACCEPT_ENCODING_GZIP_COMMA_DEFLATE \
363 (grpc_static_mdelem_manifested()[15])
364 /* "accept-language": "" */
365 #define GRPC_MDELEM_ACCEPT_LANGUAGE_EMPTY (grpc_static_mdelem_manifested()[16])
366 /* "accept-ranges": "" */
367 #define GRPC_MDELEM_ACCEPT_RANGES_EMPTY (grpc_static_mdelem_manifested()[17])
368 /* "accept": "" */
369 #define GRPC_MDELEM_ACCEPT_EMPTY (grpc_static_mdelem_manifested()[18])
370 /* "access-control-allow-origin": "" */
371 #define GRPC_MDELEM_ACCESS_CONTROL_ALLOW_ORIGIN_EMPTY \
372 (grpc_static_mdelem_manifested()[19])
373 /* "age": "" */
374 #define GRPC_MDELEM_AGE_EMPTY (grpc_static_mdelem_manifested()[20])
375 /* "allow": "" */
376 #define GRPC_MDELEM_ALLOW_EMPTY (grpc_static_mdelem_manifested()[21])
377 /* "authorization": "" */
378 #define GRPC_MDELEM_AUTHORIZATION_EMPTY (grpc_static_mdelem_manifested()[22])
379 /* "cache-control": "" */
380 #define GRPC_MDELEM_CACHE_CONTROL_EMPTY (grpc_static_mdelem_manifested()[23])
381 /* "content-disposition": "" */
382 #define GRPC_MDELEM_CONTENT_DISPOSITION_EMPTY \
383 (grpc_static_mdelem_manifested()[24])
384 /* "content-encoding": "" */
385 #define GRPC_MDELEM_CONTENT_ENCODING_EMPTY (grpc_static_mdelem_manifested()[25])
386 /* "content-language": "" */
387 #define GRPC_MDELEM_CONTENT_LANGUAGE_EMPTY (grpc_static_mdelem_manifested()[26])
388 /* "content-length": "" */
389 #define GRPC_MDELEM_CONTENT_LENGTH_EMPTY (grpc_static_mdelem_manifested()[27])
390 /* "content-location": "" */
391 #define GRPC_MDELEM_CONTENT_LOCATION_EMPTY (grpc_static_mdelem_manifested()[28])
392 /* "content-range": "" */
393 #define GRPC_MDELEM_CONTENT_RANGE_EMPTY (grpc_static_mdelem_manifested()[29])
394 /* "content-type": "" */
395 #define GRPC_MDELEM_CONTENT_TYPE_EMPTY (grpc_static_mdelem_manifested()[30])
396 /* "cookie": "" */
397 #define GRPC_MDELEM_COOKIE_EMPTY (grpc_static_mdelem_manifested()[31])
398 /* "date": "" */
399 #define GRPC_MDELEM_DATE_EMPTY (grpc_static_mdelem_manifested()[32])
400 /* "etag": "" */
401 #define GRPC_MDELEM_ETAG_EMPTY (grpc_static_mdelem_manifested()[33])
402 /* "expect": "" */
403 #define GRPC_MDELEM_EXPECT_EMPTY (grpc_static_mdelem_manifested()[34])
404 /* "expires": "" */
405 #define GRPC_MDELEM_EXPIRES_EMPTY (grpc_static_mdelem_manifested()[35])
406 /* "from": "" */
407 #define GRPC_MDELEM_FROM_EMPTY (grpc_static_mdelem_manifested()[36])
408 /* "host": "" */
409 #define GRPC_MDELEM_HOST_EMPTY (grpc_static_mdelem_manifested()[37])
410 /* "if-match": "" */
411 #define GRPC_MDELEM_IF_MATCH_EMPTY (grpc_static_mdelem_manifested()[38])
412 /* "if-modified-since": "" */
413 #define GRPC_MDELEM_IF_MODIFIED_SINCE_EMPTY \
414 (grpc_static_mdelem_manifested()[39])
415 /* "if-none-match": "" */
416 #define GRPC_MDELEM_IF_NONE_MATCH_EMPTY (grpc_static_mdelem_manifested()[40])
417 /* "if-range": "" */
418 #define GRPC_MDELEM_IF_RANGE_EMPTY (grpc_static_mdelem_manifested()[41])
419 /* "if-unmodified-since": "" */
420 #define GRPC_MDELEM_IF_UNMODIFIED_SINCE_EMPTY \
421 (grpc_static_mdelem_manifested()[42])
422 /* "last-modified": "" */
423 #define GRPC_MDELEM_LAST_MODIFIED_EMPTY (grpc_static_mdelem_manifested()[43])
424 /* "link": "" */
425 #define GRPC_MDELEM_LINK_EMPTY (grpc_static_mdelem_manifested()[44])
426 /* "location": "" */
427 #define GRPC_MDELEM_LOCATION_EMPTY (grpc_static_mdelem_manifested()[45])
428 /* "max-forwards": "" */
429 #define GRPC_MDELEM_MAX_FORWARDS_EMPTY (grpc_static_mdelem_manifested()[46])
430 /* "proxy-authenticate": "" */
431 #define GRPC_MDELEM_PROXY_AUTHENTICATE_EMPTY \
432 (grpc_static_mdelem_manifested()[47])
433 /* "proxy-authorization": "" */
434 #define GRPC_MDELEM_PROXY_AUTHORIZATION_EMPTY \
435 (grpc_static_mdelem_manifested()[48])
436 /* "range": "" */
437 #define GRPC_MDELEM_RANGE_EMPTY (grpc_static_mdelem_manifested()[49])
438 /* "referer": "" */
439 #define GRPC_MDELEM_REFERER_EMPTY (grpc_static_mdelem_manifested()[50])
440 /* "refresh": "" */
441 #define GRPC_MDELEM_REFRESH_EMPTY (grpc_static_mdelem_manifested()[51])
442 /* "retry-after": "" */
443 #define GRPC_MDELEM_RETRY_AFTER_EMPTY (grpc_static_mdelem_manifested()[52])
444 /* "server": "" */
445 #define GRPC_MDELEM_SERVER_EMPTY (grpc_static_mdelem_manifested()[53])
446 /* "set-cookie": "" */
447 #define GRPC_MDELEM_SET_COOKIE_EMPTY (grpc_static_mdelem_manifested()[54])
448 /* "strict-transport-security": "" */
449 #define GRPC_MDELEM_STRICT_TRANSPORT_SECURITY_EMPTY \
450 (grpc_static_mdelem_manifested()[55])
451 /* "transfer-encoding": "" */
452 #define GRPC_MDELEM_TRANSFER_ENCODING_EMPTY \
453 (grpc_static_mdelem_manifested()[56])
454 /* "user-agent": "" */
455 #define GRPC_MDELEM_USER_AGENT_EMPTY (grpc_static_mdelem_manifested()[57])
456 /* "vary": "" */
457 #define GRPC_MDELEM_VARY_EMPTY (grpc_static_mdelem_manifested()[58])
458 /* "via": "" */
459 #define GRPC_MDELEM_VIA_EMPTY (grpc_static_mdelem_manifested()[59])
460 /* "www-authenticate": "" */
461 #define GRPC_MDELEM_WWW_AUTHENTICATE_EMPTY (grpc_static_mdelem_manifested()[60])
462 /* "grpc-status": "0" */
463 #define GRPC_MDELEM_GRPC_STATUS_0 (grpc_static_mdelem_manifested()[61])
464 /* "grpc-status": "1" */
465 #define GRPC_MDELEM_GRPC_STATUS_1 (grpc_static_mdelem_manifested()[62])
466 /* "grpc-status": "2" */
467 #define GRPC_MDELEM_GRPC_STATUS_2 (grpc_static_mdelem_manifested()[63])
468 /* "grpc-encoding": "identity" */
469 #define GRPC_MDELEM_GRPC_ENCODING_IDENTITY (grpc_static_mdelem_manifested()[64])
470 /* "grpc-encoding": "gzip" */
471 #define GRPC_MDELEM_GRPC_ENCODING_GZIP (grpc_static_mdelem_manifested()[65])
472 /* "grpc-encoding": "deflate" */
473 #define GRPC_MDELEM_GRPC_ENCODING_DEFLATE (grpc_static_mdelem_manifested()[66])
474 /* "te": "trailers" */
475 #define GRPC_MDELEM_TE_TRAILERS (grpc_static_mdelem_manifested()[67])
476 /* "content-type": "application/grpc" */
477 #define GRPC_MDELEM_CONTENT_TYPE_APPLICATION_SLASH_GRPC \
478 (grpc_static_mdelem_manifested()[68])
479 /* ":scheme": "grpc" */
480 #define GRPC_MDELEM_SCHEME_GRPC (grpc_static_mdelem_manifested()[69])
481 /* ":method": "PUT" */
482 #define GRPC_MDELEM_METHOD_PUT (grpc_static_mdelem_manifested()[70])
483 /* "accept-encoding": "" */
484 #define GRPC_MDELEM_ACCEPT_ENCODING_EMPTY (grpc_static_mdelem_manifested()[71])
485 /* "content-encoding": "identity" */
486 #define GRPC_MDELEM_CONTENT_ENCODING_IDENTITY \
487 (grpc_static_mdelem_manifested()[72])
488 /* "content-encoding": "gzip" */
489 #define GRPC_MDELEM_CONTENT_ENCODING_GZIP (grpc_static_mdelem_manifested()[73])
490 /* "lb-cost-bin": "" */
491 #define GRPC_MDELEM_LB_COST_BIN_EMPTY (grpc_static_mdelem_manifested()[74])
492 /* "grpc-accept-encoding": "identity" */
493 #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY \
494 (grpc_static_mdelem_manifested()[75])
495 /* "grpc-accept-encoding": "deflate" */
496 #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE \
497 (grpc_static_mdelem_manifested()[76])
498 /* "grpc-accept-encoding": "identity,deflate" */
499 #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE \
500 (grpc_static_mdelem_manifested()[77])
501 /* "grpc-accept-encoding": "gzip" */
502 #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_GZIP \
503 (grpc_static_mdelem_manifested()[78])
504 /* "grpc-accept-encoding": "identity,gzip" */
505 #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_GZIP \
506 (grpc_static_mdelem_manifested()[79])
507 /* "grpc-accept-encoding": "deflate,gzip" */
508 #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_DEFLATE_COMMA_GZIP \
509 (grpc_static_mdelem_manifested()[80])
510 /* "grpc-accept-encoding": "identity,deflate,gzip" */
511 #define GRPC_MDELEM_GRPC_ACCEPT_ENCODING_IDENTITY_COMMA_DEFLATE_COMMA_GZIP \
512 (grpc_static_mdelem_manifested()[81])
513 /* "accept-encoding": "identity" */
514 #define GRPC_MDELEM_ACCEPT_ENCODING_IDENTITY \
515 (grpc_static_mdelem_manifested()[82])
516 /* "accept-encoding": "gzip" */
517 #define GRPC_MDELEM_ACCEPT_ENCODING_GZIP (grpc_static_mdelem_manifested()[83])
518 /* "accept-encoding": "identity,gzip" */
519 #define GRPC_MDELEM_ACCEPT_ENCODING_IDENTITY_COMMA_GZIP \
520 (grpc_static_mdelem_manifested()[84])
521
522 grpc_mdelem grpc_static_mdelem_for_static_strings(intptr_t a, intptr_t b);
523 typedef enum {
524 GRPC_BATCH_PATH,
525 GRPC_BATCH_METHOD,
526 GRPC_BATCH_STATUS,
527 GRPC_BATCH_AUTHORITY,
528 GRPC_BATCH_SCHEME,
529 GRPC_BATCH_TE,
530 GRPC_BATCH_GRPC_MESSAGE,
531 GRPC_BATCH_GRPC_STATUS,
532 GRPC_BATCH_GRPC_PAYLOAD_BIN,
533 GRPC_BATCH_GRPC_ENCODING,
534 GRPC_BATCH_GRPC_ACCEPT_ENCODING,
535 GRPC_BATCH_GRPC_SERVER_STATS_BIN,
536 GRPC_BATCH_GRPC_TAGS_BIN,
537 GRPC_BATCH_GRPC_TRACE_BIN,
538 GRPC_BATCH_CONTENT_TYPE,
539 GRPC_BATCH_CONTENT_ENCODING,
540 GRPC_BATCH_ACCEPT_ENCODING,
541 GRPC_BATCH_GRPC_INTERNAL_ENCODING_REQUEST,
542 GRPC_BATCH_GRPC_INTERNAL_STREAM_ENCODING_REQUEST,
543 GRPC_BATCH_USER_AGENT,
544 GRPC_BATCH_HOST,
545 GRPC_BATCH_GRPC_PREVIOUS_RPC_ATTEMPTS,
546 GRPC_BATCH_GRPC_RETRY_PUSHBACK_MS,
547 GRPC_BATCH_X_ENDPOINT_LOAD_METRICS_BIN,
548 GRPC_BATCH_CALLOUTS_COUNT
549 } grpc_metadata_batch_callouts_index;
550
551 typedef union {
552 struct grpc_linked_mdelem* array[GRPC_BATCH_CALLOUTS_COUNT];
553 struct {
554 struct grpc_linked_mdelem* path;
555 struct grpc_linked_mdelem* method;
556 struct grpc_linked_mdelem* status;
557 struct grpc_linked_mdelem* authority;
558 struct grpc_linked_mdelem* scheme;
559 struct grpc_linked_mdelem* te;
560 struct grpc_linked_mdelem* grpc_message;
561 struct grpc_linked_mdelem* grpc_status;
562 struct grpc_linked_mdelem* grpc_payload_bin;
563 struct grpc_linked_mdelem* grpc_encoding;
564 struct grpc_linked_mdelem* grpc_accept_encoding;
565 struct grpc_linked_mdelem* grpc_server_stats_bin;
566 struct grpc_linked_mdelem* grpc_tags_bin;
567 struct grpc_linked_mdelem* grpc_trace_bin;
568 struct grpc_linked_mdelem* content_type;
569 struct grpc_linked_mdelem* content_encoding;
570 struct grpc_linked_mdelem* accept_encoding;
571 struct grpc_linked_mdelem* grpc_internal_encoding_request;
572 struct grpc_linked_mdelem* grpc_internal_stream_encoding_request;
573 struct grpc_linked_mdelem* user_agent;
574 struct grpc_linked_mdelem* host;
575 struct grpc_linked_mdelem* grpc_previous_rpc_attempts;
576 struct grpc_linked_mdelem* grpc_retry_pushback_ms;
577 struct grpc_linked_mdelem* x_endpoint_load_metrics_bin;
578 } named;
579 } grpc_metadata_batch_callouts;
580
581 #define GRPC_BATCH_INDEX_OF(slice) \
582 (GRPC_IS_STATIC_METADATA_STRING((slice)) && \
583 reinterpret_cast<grpc_core::StaticSliceRefcount*>((slice).refcount) \
584 ->index <= static_cast<uint32_t>(GRPC_BATCH_CALLOUTS_COUNT) \
585 ? static_cast<grpc_metadata_batch_callouts_index>( \
586 reinterpret_cast<grpc_core::StaticSliceRefcount*>( \
587 (slice).refcount) \
588 ->index) \
589 : GRPC_BATCH_CALLOUTS_COUNT)
590
591 extern const uint8_t grpc_static_accept_encoding_metadata[8];
592 #define GRPC_MDELEM_ACCEPT_ENCODING_FOR_ALGORITHMS(algs) \
593 (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table() \
594 [grpc_static_accept_encoding_metadata[(algs)]] \
595 .data(), \
596 GRPC_MDELEM_STORAGE_STATIC))
597
598 extern const uint8_t grpc_static_accept_stream_encoding_metadata[4];
599 #define GRPC_MDELEM_ACCEPT_STREAM_ENCODING_FOR_ALGORITHMS(algs) \
600 (GRPC_MAKE_MDELEM(&grpc_static_mdelem_table() \
601 [grpc_static_accept_stream_encoding_metadata[(algs)]] \
602 .data(), \
603 GRPC_MDELEM_STORAGE_STATIC))
604 #endif /* GRPC_CORE_LIB_TRANSPORT_STATIC_METADATA_H */
605