GRPC Core  18.0.0
xds_api.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2018 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
19 #ifndef GRPC_CORE_EXT_XDS_XDS_API_H
20 #define GRPC_CORE_EXT_XDS_XDS_API_H
21 
23 
24 #include <stdint.h>
25 
26 #include <set>
27 
28 #include "absl/container/inlined_vector.h"
29 #include "absl/types/optional.h"
30 #include "re2/re2.h"
31 
32 #include "upb/def.hpp"
33 
34 #include <grpc/slice_buffer.h>
35 
42 
43 namespace grpc_core {
44 
45 // TODO(yashykt): Check to see if xDS security is enabled. This will be
46 // removed once this feature is fully integration-tested and enabled by
47 // default.
48 bool XdsSecurityEnabled();
49 
50 class XdsClient;
51 
52 class XdsApi {
53  public:
54  static const char* kLdsTypeUrl;
55  static const char* kRdsTypeUrl;
56  static const char* kCdsTypeUrl;
57  static const char* kEdsTypeUrl;
58 
59  struct Duration {
60  int64_t seconds = 0;
61  int32_t nanos = 0;
62  bool operator==(const Duration& other) const {
63  return seconds == other.seconds && nanos == other.nanos;
64  }
65  std::string ToString() const {
66  return absl::StrFormat("Duration seconds: %ld, nanos %d", seconds, nanos);
67  }
68  };
69 
71  std::map<std::string, XdsHttpFilterImpl::FilterConfig>;
72 
73  // TODO(donnadionne): When we can use absl::variant<>, consider using that
74  // for: PathMatcher, HeaderMatcher, cluster_name and weighted_clusters
75  struct Route {
76  // Matchers for this route.
77  struct Matchers {
79  std::vector<HeaderMatcher> header_matchers;
80  absl::optional<uint32_t> fraction_per_million;
81 
82  bool operator==(const Matchers& other) const {
83  return path_matcher == other.path_matcher &&
86  }
87  std::string ToString() const;
88  };
89 
90  struct HashPolicy {
91  enum Type { HEADER, CHANNEL_ID };
93  bool terminal = false;
94  // Fields used for type HEADER.
95  std::string header_name;
96  std::unique_ptr<RE2> regex = nullptr;
97  std::string regex_substitution;
98 
100 
101  // Copyable.
102  HashPolicy(const HashPolicy& other);
103  HashPolicy& operator=(const HashPolicy& other);
104 
105  // Moveable.
106  HashPolicy(HashPolicy&& other) noexcept;
107  HashPolicy& operator=(HashPolicy&& other) noexcept;
108 
109  bool operator==(const HashPolicy& other) const;
110  std::string ToString() const;
111  };
112 
114  std::vector<HashPolicy> hash_policies;
115 
116  // Action for this route.
117  // TODO(roth): When we can use absl::variant<>, consider using that
118  // here, to enforce the fact that only one of the two fields can be set.
119  std::string cluster_name;
120  struct ClusterWeight {
121  std::string name;
122  uint32_t weight;
124 
125  bool operator==(const ClusterWeight& other) const {
126  return name == other.name && weight == other.weight &&
128  }
129  std::string ToString() const;
130  };
131  std::vector<ClusterWeight> weighted_clusters;
132  // Storing the timeout duration from route action:
133  // RouteAction.max_stream_duration.grpc_timeout_header_max or
134  // RouteAction.max_stream_duration.max_stream_duration if the former is
135  // not set.
136  absl::optional<Duration> max_stream_duration;
137 
139 
140  bool operator==(const Route& other) const {
141  return matchers == other.matchers && cluster_name == other.cluster_name &&
145  }
146  std::string ToString() const;
147  };
148 
149  struct RdsUpdate {
150  struct VirtualHost {
151  std::vector<std::string> domains;
152  std::vector<Route> routes;
154 
155  bool operator==(const VirtualHost& other) const {
156  return domains == other.domains && routes == other.routes &&
158  }
159  };
160 
161  std::vector<VirtualHost> virtual_hosts;
162 
163  bool operator==(const RdsUpdate& other) const {
164  return virtual_hosts == other.virtual_hosts;
165  }
166  std::string ToString() const;
167  VirtualHost* FindVirtualHostForDomain(const std::string& domain);
168  };
169 
172  std::vector<StringMatcher> match_subject_alt_names;
173 
174  bool operator==(const CertificateValidationContext& other) const {
176  }
177 
178  std::string ToString() const;
179  bool Empty() const;
180  };
181 
183  std::string instance_name;
184  std::string certificate_name;
185 
186  bool operator==(const CertificateProviderInstance& other) const {
187  return instance_name == other.instance_name &&
189  }
190 
191  std::string ToString() const;
192  bool Empty() const;
193  };
194 
199 
204  }
205 
206  std::string ToString() const;
207  bool Empty() const;
208  };
209 
212 
213  bool operator==(const CommonTlsContext& other) const {
217  }
218 
219  std::string ToString() const;
220  bool Empty() const;
221  };
222 
226 
227  bool operator==(const DownstreamTlsContext& other) const {
228  return common_tls_context == other.common_tls_context &&
230  }
231 
232  std::string ToString() const;
233  bool Empty() const;
234  };
235 
236  // TODO(roth): When we can use absl::variant<>, consider using that
237  // here, to enforce the fact that only one of the two fields can be set.
238  struct LdsUpdate {
239  enum class ListenerType {
240  kTcpListener = 0,
242  } type;
243 
245  // The name to use in the RDS request.
246  std::string route_config_name;
247  // Storing the Http Connection Manager Common Http Protocol Option
248  // max_stream_duration
250  // The RouteConfiguration to use for this listener.
251  // Present only if it is inlined in the LDS response.
252  absl::optional<RdsUpdate> rds_update;
253 
254  struct HttpFilter {
255  std::string name;
257 
258  bool operator==(const HttpFilter& other) const {
259  return name == other.name && config == other.config;
260  }
261 
262  std::string ToString() const;
263  };
264  std::vector<HttpFilter> http_filters;
265 
266  bool operator==(const HttpConnectionManager& other) const {
267  return route_config_name == other.route_config_name &&
269  rds_update == other.rds_update &&
270  http_filters == other.http_filters;
271  }
272 
273  std::string ToString() const;
274  };
275 
276  // Populated for type=kHttpApiListener.
278 
279  // Populated for type=kTcpListener.
280  // host:port listening_address set when type is kTcpListener
281  std::string address;
282 
285  // This is in principle the filter list.
286  // We currently require exactly one filter, which is the HCM.
288 
289  bool operator==(const FilterChainData& other) const {
292  }
293 
294  std::string ToString() const;
296 
297  // A multi-level map used to determine which filter chain to use for a given
298  // incoming connection. Determining the right filter chain for a given
299  // connection checks the following properties, in order:
300  // - destination port (never matched, so not present in map)
301  // - destination IP address
302  // - server name (never matched, so not present in map)
303  // - transport protocol (allows only "raw_buffer" or unset, prefers the
304  // former, so only one of those two types is present in map)
305  // - application protocol (never matched, so not present in map)
306  // - connection source type (any, local or external)
307  // - source IP address
308  // - source port
309  // https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/listener/v3/listener_components.proto#config-listener-v3-filterchainmatch
310  // for more details
311  struct FilterChainMap {
313  std::shared_ptr<FilterChainData> data;
314  bool operator==(const FilterChainDataSharedPtr& other) const {
315  return *data == *other.data;
316  }
317  };
318  struct CidrRange {
320  uint32_t prefix_len;
321 
322  bool operator==(const CidrRange& other) const {
323  return memcmp(&address, &other.address, sizeof(address)) == 0 &&
324  prefix_len == other.prefix_len;
325  }
326 
327  std::string ToString() const;
328  };
329  using SourcePortsMap = std::map<uint16_t, FilterChainDataSharedPtr>;
330  struct SourceIp {
331  absl::optional<CidrRange> prefix_range;
333 
334  bool operator==(const SourceIp& other) const {
335  return prefix_range == other.prefix_range &&
336  ports_map == other.ports_map;
337  }
338  };
339  using SourceIpVector = std::vector<SourceIp>;
340  enum class ConnectionSourceType {
341  kAny = 0,
343  kExternal
344  };
345  using ConnectionSourceTypesArray = std::array<SourceIpVector, 3>;
346  struct DestinationIp {
347  absl::optional<CidrRange> prefix_range;
348  // We always fail match on server name, so those filter chains are not
349  // included here.
351 
352  bool operator==(const DestinationIp& other) const {
353  return prefix_range == other.prefix_range &&
355  }
356  };
357  // We always fail match on destination ports map
358  using DestinationIpVector = std::vector<DestinationIp>;
360 
361  bool operator==(const FilterChainMap& other) const {
363  }
364 
365  std::string ToString() const;
367 
368  absl::optional<FilterChainData> default_filter_chain;
369 
370  bool operator==(const LdsUpdate& other) const {
372  address == other.address &&
375  }
376 
377  std::string ToString() const;
378  };
379 
382  std::string serialized_proto;
383  };
384 
385  using LdsUpdateMap = std::map<std::string /*server_name*/, LdsResourceData>;
386 
389  std::string serialized_proto;
390  };
391 
392  using RdsUpdateMap =
393  std::map<std::string /*route_config_name*/, RdsResourceData>;
394 
395  struct CdsUpdate {
398  // For cluster type EDS.
399  // The name to use in the EDS request.
400  // If empty, the cluster name will be used.
401  std::string eds_service_name;
402  // For cluster type LOGICAL_DNS.
403  // The hostname to lookup in DNS.
404  std::string dns_hostname;
405  // For cluster type AGGREGATE.
406  // The prioritized list of cluster names.
407  std::vector<std::string> prioritized_cluster_names;
408 
409  // Tls Context used by clients
411 
412  // The LRS server to use for load reporting.
413  // If not set, load reporting will be disabled.
414  // If set to the empty string, will use the same server we obtained the CDS
415  // data from.
416  absl::optional<std::string> lrs_load_reporting_server_name;
417 
418  // The LB policy to use (e.g., "ROUND_ROBIN" or "RING_HASH").
419  std::string lb_policy;
420  // Used for RING_HASH LB policy only.
421  uint64_t min_ring_size = 1024;
422  uint64_t max_ring_size = 8388608;
423  // Maximum number of outstanding requests can be made to the upstream
424  // cluster.
425  uint32_t max_concurrent_requests = 1024;
426 
427  bool operator==(const CdsUpdate& other) const {
428  return cluster_type == other.cluster_type &&
430  dns_hostname == other.dns_hostname &&
435  lb_policy == other.lb_policy &&
436  min_ring_size == other.min_ring_size &&
437  max_ring_size == other.max_ring_size &&
439  }
440 
441  std::string ToString() const;
442  };
443 
446  std::string serialized_proto;
447  };
448 
449  using CdsUpdateMap = std::map<std::string /*cluster_name*/, CdsResourceData>;
450 
451  struct EdsUpdate {
452  struct Priority {
453  struct Locality {
455  uint32_t lb_weight;
457 
458  bool operator==(const Locality& other) const {
459  return *name == *other.name && lb_weight == other.lb_weight &&
460  endpoints == other.endpoints;
461  }
462  bool operator!=(const Locality& other) const {
463  return !(*this == other);
464  }
465  std::string ToString() const;
466  };
467 
468  std::map<XdsLocalityName*, Locality, XdsLocalityName::Less> localities;
469 
470  bool operator==(const Priority& other) const;
471  std::string ToString() const;
472  };
473  using PriorityList = absl::InlinedVector<Priority, 2>;
474 
475  // There are two phases of accessing this class's content:
476  // 1. to initialize in the control plane combiner;
477  // 2. to use in the data plane combiner.
478  // So no additional synchronization is needed.
479  class DropConfig : public RefCounted<DropConfig> {
480  public:
481  struct DropCategory {
482  bool operator==(const DropCategory& other) const {
483  return name == other.name &&
485  }
486 
487  std::string name;
488  const uint32_t parts_per_million;
489  };
490 
491  using DropCategoryList = absl::InlinedVector<DropCategory, 2>;
492 
493  void AddCategory(std::string name, uint32_t parts_per_million) {
494  drop_category_list_.emplace_back(
495  DropCategory{std::move(name), parts_per_million});
496  if (parts_per_million == 1000000) drop_all_ = true;
497  }
498 
499  // The only method invoked from outside the WorkSerializer (used in
500  // the data plane).
501  bool ShouldDrop(const std::string** category_name) const;
502 
504  return drop_category_list_;
505  }
506 
507  bool drop_all() const { return drop_all_; }
508 
509  bool operator==(const DropConfig& other) const {
510  return drop_category_list_ == other.drop_category_list_;
511  }
512  bool operator!=(const DropConfig& other) const {
513  return !(*this == other);
514  }
515 
516  std::string ToString() const;
517 
518  private:
519  DropCategoryList drop_category_list_;
520  bool drop_all_ = false;
521  };
522 
525 
526  bool operator==(const EdsUpdate& other) const {
527  return priorities == other.priorities &&
528  *drop_config == *other.drop_config;
529  }
530  std::string ToString() const;
531  };
532 
535  std::string serialized_proto;
536  };
537 
538  using EdsUpdateMap =
539  std::map<std::string /*eds_service_name*/, EdsResourceData>;
540 
543  std::map<RefCountedPtr<XdsLocalityName>, XdsClusterLocalityStats::Snapshot,
547  };
548  using ClusterLoadReportMap = std::map<
549  std::pair<std::string /*cluster_name*/, std::string /*eds_service_name*/>,
551 
552  // The metadata of the xDS resource; used by the xDS config dump.
554  // Resource status from the view of a xDS client, which tells the
555  // synchronization status between the xDS client and the xDS server.
557  // Client requested this resource but hasn't received any update from
558  // management server. The client will not fail requests, but will queue
559  // them
560  // until update arrives or the client times out waiting for the resource.
562  // This resource has been requested by the client but has either not been
563  // delivered by the server or was previously delivered by the server and
564  // then subsequently removed from resources provided by the server.
566  // Client received this resource and replied with ACK.
568  // Client received this resource and replied with NACK.
569  NACKED
570  };
571 
572  // The client status of this resource.
574  // The serialized bytes of the last successfully updated raw xDS resource.
575  std::string serialized_proto;
576  // The timestamp when the resource was last successfully updated.
578  // The last successfully updated version of the resource.
579  std::string version;
580  // The rejected version string of the last failed update attempt.
581  std::string failed_version;
582  // Details about the last failed update attempt.
583  std::string failed_details;
584  // Timestamp of the last failed update attempt.
586  };
588  std::map<absl::string_view /*resource_name*/, const ResourceMetadata*>;
590  absl::string_view version;
592  };
594  std::map<absl::string_view /*type_url*/, ResourceTypeMetadata>;
595  static_assert(static_cast<ResourceMetadata::ClientResourceStatus>(
597  ResourceMetadata::ClientResourceStatus::REQUESTED,
598  "");
599  static_assert(static_cast<ResourceMetadata::ClientResourceStatus>(
601  ResourceMetadata::ClientResourceStatus::DOES_NOT_EXIST,
602  "");
603  static_assert(static_cast<ResourceMetadata::ClientResourceStatus>(
605  ResourceMetadata::ClientResourceStatus::ACKED,
606  "");
607  static_assert(static_cast<ResourceMetadata::ClientResourceStatus>(
609  ResourceMetadata::ClientResourceStatus::NACKED,
610  "");
611 
612  // If the response can't be parsed at the top level, the resulting
613  // type_url will be empty.
614  // If there is any other type of validation error, the parse_error
615  // field will be set to something other than GRPC_ERROR_NONE and the
616  // resource_names_failed field will be populated.
617  // Otherwise, one of the *_update_map fields will be populated, based
618  // on the type_url field.
619  struct AdsParseResult {
621  std::string version;
622  std::string nonce;
623  std::string type_url;
628  std::set<std::string> resource_names_failed;
629  };
630 
632 
633  // Creates an ADS request.
634  // Takes ownership of \a error.
636  const std::string& type_url,
637  const std::set<absl::string_view>& resource_names,
638  const std::string& version,
639  const std::string& nonce, grpc_error_handle error,
640  bool populate_node);
641 
642  // Parses an ADS response.
644  const XdsBootstrap::XdsServer& server, const grpc_slice& encoded_response,
645  const std::set<absl::string_view>& expected_listener_names,
646  const std::set<absl::string_view>& expected_route_configuration_names,
647  const std::set<absl::string_view>& expected_cluster_names,
648  const std::set<absl::string_view>& expected_eds_service_names);
649 
650  // Creates an initial LRS request.
652 
653  // Creates an LRS request sending a client-side load report.
654  grpc_slice CreateLrsRequest(ClusterLoadReportMap cluster_load_report_map);
655 
656  // Parses the LRS response and returns \a
657  // load_reporting_interval for client-side load reporting. If there is any
658  // error, the output config is invalid.
659  grpc_error_handle ParseLrsResponse(const grpc_slice& encoded_response,
660  bool* send_all_clusters,
661  std::set<std::string>* cluster_names,
662  grpc_millis* load_reporting_interval);
663 
664  // Assemble the client config proto message and return the serialized result.
665  std::string AssembleClientConfig(
666  const ResourceTypeMetadataMap& resource_type_metadata_map);
667 
668  private:
669  XdsClient* client_;
670  TraceFlag* tracer_;
671  const XdsBootstrap::Node* node_; // Do not own.
672  upb::SymbolTable symtab_;
673  const std::string build_version_;
674  const std::string user_agent_name_;
675  const std::string user_agent_version_;
676 };
677 
678 } // namespace grpc_core
679 
680 #endif /* GRPC_CORE_EXT_XDS_XDS_API_H */
Definition: ref_counted.h:282
Definition: ref_counted_ptr.h:35
Definition: matchers.h:31
Definition: trace.h:61
absl::InlinedVector< DropCategory, 2 > DropCategoryList
Definition: xds_api.h:491
bool ShouldDrop(const std::string **category_name) const
Definition: xds_api.cc:772
void AddCategory(std::string name, uint32_t parts_per_million)
Definition: xds_api.h:493
bool drop_all() const
Definition: xds_api.h:507
std::string ToString() const
Definition: xds_api.cc:786
bool operator!=(const DropConfig &other) const
Definition: xds_api.h:512
bool operator==(const DropConfig &other) const
Definition: xds_api.h:509
const DropCategoryList & drop_category_list() const
Definition: xds_api.h:503
Definition: xds_api.h:52
std::map< std::string, EdsResourceData > EdsUpdateMap
Definition: xds_api.h:539
std::map< absl::string_view, ResourceTypeMetadata > ResourceTypeMetadataMap
Definition: xds_api.h:594
static const char * kCdsTypeUrl
Definition: xds_api.h:56
std::map< absl::string_view, const ResourceMetadata * > ResourceMetadataMap
Definition: xds_api.h:588
static const char * kLdsTypeUrl
Definition: xds_api.h:54
XdsApi(XdsClient *client, TraceFlag *tracer, const XdsBootstrap::Node *node)
Definition: xds_api.cc:870
std::map< std::string, CdsResourceData > CdsUpdateMap
Definition: xds_api.h:449
grpc_error_handle ParseLrsResponse(const grpc_slice &encoded_response, bool *send_all_clusters, std::set< std::string > *cluster_names, grpc_millis *load_reporting_interval)
Definition: xds_api.cc:3627
grpc_slice CreateAdsRequest(const XdsBootstrap::XdsServer &server, const std::string &type_url, const std::set< absl::string_view > &resource_names, const std::string &version, const std::string &nonce, grpc_error_handle error, bool populate_node)
Definition: xds_api.cc:1113
grpc_slice CreateLrsRequest(ClusterLoadReportMap cluster_load_report_map)
Definition: xds_api.cc:3563
static const char * kEdsTypeUrl
Definition: xds_api.h:57
std::string AssembleClientConfig(const ResourceTypeMetadataMap &resource_type_metadata_map)
Definition: xds_api.cc:3892
grpc_slice CreateLrsInitialRequest(const XdsBootstrap::XdsServer &server)
Definition: xds_api.cc:3492
std::map< std::string, XdsHttpFilterImpl::FilterConfig > TypedPerFilterConfig
Definition: xds_api.h:71
static const char * kRdsTypeUrl
Definition: xds_api.h:55
AdsParseResult ParseAdsResponse(const XdsBootstrap::XdsServer &server, const grpc_slice &encoded_response, const std::set< absl::string_view > &expected_listener_names, const std::set< absl::string_view > &expected_route_configuration_names, const std::set< absl::string_view > &expected_cluster_names, const std::set< absl::string_view > &expected_eds_service_names)
Definition: xds_api.cc:3399
std::map< std::pair< std::string, std::string >, ClusterLoadReport > ClusterLoadReportMap
Definition: xds_api.h:550
std::map< std::string, RdsResourceData > RdsUpdateMap
Definition: xds_api.h:393
std::map< std::string, LdsResourceData > LdsUpdateMap
Definition: xds_api.h:385
Definition: xds_client.h:44
@ envoy_admin_v3_REQUESTED
Definition: config_dump.upb.h:98
@ envoy_admin_v3_NACKED
Definition: config_dump.upb.h:101
@ envoy_admin_v3_ACKED
Definition: config_dump.upb.h:100
@ envoy_admin_v3_DOES_NOT_EXIST
Definition: config_dump.upb.h:99
#define GRPC_ERROR_NONE
The following "special" errors can be propagated without allocating memory.
Definition: error.h:228
int64_t grpc_millis
Definition: exec_ctx.h:37
grpc_error_handle error
Definition: lame_client.cc:54
Round Robin Policy.
Definition: backend_metric.cc:26
absl::InlinedVector< ServerAddress, 1 > ServerAddressList
Definition: server_address.h:111
bool XdsSecurityEnabled()
Definition: xds_api.cc:132
Definition: xds_api.h:619
std::string version
Definition: xds_api.h:621
RdsUpdateMap rds_update_map
Definition: xds_api.h:625
std::string nonce
Definition: xds_api.h:622
LdsUpdateMap lds_update_map
Definition: xds_api.h:624
grpc_error_handle parse_error
Definition: xds_api.h:620
std::string type_url
Definition: xds_api.h:623
CdsUpdateMap cds_update_map
Definition: xds_api.h:626
EdsUpdateMap eds_update_map
Definition: xds_api.h:627
std::set< std::string > resource_names_failed
Definition: xds_api.h:628
Definition: xds_api.h:444
std::string serialized_proto
Definition: xds_api.h:446
CdsUpdate resource
Definition: xds_api.h:445
Definition: xds_api.h:395
std::string ToString() const
Definition: xds_api.cc:699
std::string lb_policy
Definition: xds_api.h:419
std::string eds_service_name
Definition: xds_api.h:401
std::vector< std::string > prioritized_cluster_names
Definition: xds_api.h:407
uint64_t max_ring_size
Definition: xds_api.h:422
std::string dns_hostname
Definition: xds_api.h:404
uint64_t min_ring_size
Definition: xds_api.h:421
ClusterType
Definition: xds_api.h:396
@ LOGICAL_DNS
Definition: xds_api.h:396
@ AGGREGATE
Definition: xds_api.h:396
@ EDS
Definition: xds_api.h:396
ClusterType cluster_type
Definition: xds_api.h:397
CommonTlsContext common_tls_context
Definition: xds_api.h:410
uint32_t max_concurrent_requests
Definition: xds_api.h:425
bool operator==(const CdsUpdate &other) const
Definition: xds_api.h:427
absl::optional< std::string > lrs_load_reporting_server_name
Definition: xds_api.h:416
Definition: xds_api.h:541
grpc_millis load_report_interval
Definition: xds_api.h:546
XdsClusterDropStats::Snapshot dropped_requests
Definition: xds_api.h:542
std::map< RefCountedPtr< XdsLocalityName >, XdsClusterLocalityStats::Snapshot, XdsLocalityName::Less > locality_stats
Definition: xds_api.h:545
std::string ToString() const
Definition: xds_api.cc:431
bool operator==(const CertificateProviderInstance &other) const
Definition: xds_api.h:186
bool operator==(const CertificateValidationContext &other) const
Definition: xds_api.h:174
std::vector< StringMatcher > match_subject_alt_names
Definition: xds_api.h:172
std::string ToString() const
Definition: xds_api.cc:413
CertificateProviderInstance validation_context_certificate_provider_instance
Definition: xds_api.h:198
bool operator==(const CombinedCertificateValidationContext &other) const
Definition: xds_api.h:200
CertificateValidationContext default_validation_context
Definition: xds_api.h:196
Definition: xds_api.h:170
CombinedCertificateValidationContext combined_validation_context
Definition: xds_api.h:211
bool operator==(const CommonTlsContext &other) const
Definition: xds_api.h:213
std::string ToString() const
Definition: xds_api.cc:478
bool Empty() const
Definition: xds_api.cc:492
CertificateProviderInstance tls_certificate_certificate_provider_instance
Definition: xds_api.h:210
bool require_client_certificate
Definition: xds_api.h:225
bool operator==(const DownstreamTlsContext &other) const
Definition: xds_api.h:227
std::string ToString() const
Definition: xds_api.cc:501
bool Empty() const
Definition: xds_api.cc:507
CommonTlsContext common_tls_context
Definition: xds_api.h:224
Definition: xds_api.h:59
bool operator==(const Duration &other) const
Definition: xds_api.h:62
int64_t seconds
Definition: xds_api.h:60
int32_t nanos
Definition: xds_api.h:61
std::string ToString() const
Definition: xds_api.h:65
Definition: xds_api.h:533
std::string serialized_proto
Definition: xds_api.h:535
EdsUpdate resource
Definition: xds_api.h:534
bool operator==(const DropCategory &other) const
Definition: xds_api.h:482
const uint32_t parts_per_million
Definition: xds_api.h:488
std::string name
Definition: xds_api.h:487
ServerAddressList endpoints
Definition: xds_api.h:456
bool operator!=(const Locality &other) const
Definition: xds_api.h:462
uint32_t lb_weight
Definition: xds_api.h:455
std::string ToString() const
Definition: xds_api.cc:741
RefCountedPtr< XdsLocalityName > name
Definition: xds_api.h:454
bool operator==(const Locality &other) const
Definition: xds_api.h:458
std::string ToString() const
Definition: xds_api.cc:764
std::map< XdsLocalityName *, Locality, XdsLocalityName::Less > localities
Definition: xds_api.h:468
bool operator==(const Priority &other) const
Definition: xds_api.cc:751
Definition: xds_api.h:451
RefCountedPtr< DropConfig > drop_config
Definition: xds_api.h:524
absl::InlinedVector< Priority, 2 > PriorityList
Definition: xds_api.h:473
bool operator==(const EdsUpdate &other) const
Definition: xds_api.h:526
PriorityList priorities
Definition: xds_api.h:523
std::string ToString() const
Definition: xds_api.cc:796
Definition: xds_api.h:380
std::string serialized_proto
Definition: xds_api.h:382
LdsUpdate resource
Definition: xds_api.h:381
HttpConnectionManager http_connection_manager
Definition: xds_api.h:287
bool operator==(const FilterChainData &other) const
Definition: xds_api.h:289
DownstreamTlsContext downstream_tls_context
Definition: xds_api.h:284
std::string ToString() const
Definition: xds_api.cc:550
bool operator==(const CidrRange &other) const
Definition: xds_api.h:322
grpc_resolved_address address
Definition: xds_api.h:319
std::string ToString() const
Definition: xds_api.cc:560
ConnectionSourceTypesArray source_types_array
Definition: xds_api.h:350
bool operator==(const DestinationIp &other) const
Definition: xds_api.h:352
absl::optional< CidrRange > prefix_range
Definition: xds_api.h:347
bool operator==(const FilterChainDataSharedPtr &other) const
Definition: xds_api.h:314
std::shared_ptr< FilterChainData > data
Definition: xds_api.h:313
bool operator==(const SourceIp &other) const
Definition: xds_api.h:334
absl::optional< CidrRange > prefix_range
Definition: xds_api.h:331
SourcePortsMap ports_map
Definition: xds_api.h:332
DestinationIpVector destination_ip_vector
Definition: xds_api.h:359
bool operator==(const FilterChainMap &other) const
Definition: xds_api.h:361
std::vector< SourceIp > SourceIpVector
Definition: xds_api.h:339
ConnectionSourceType
Definition: xds_api.h:340
std::map< uint16_t, FilterChainDataSharedPtr > SourcePortsMap
Definition: xds_api.h:329
std::array< SourceIpVector, 3 > ConnectionSourceTypesArray
Definition: xds_api.h:345
std::string ToString() const
Definition: xds_api.cc:641
std::vector< DestinationIp > DestinationIpVector
Definition: xds_api.h:358
bool operator==(const HttpFilter &other) const
Definition: xds_api.h:258
XdsHttpFilterImpl::FilterConfig config
Definition: xds_api.h:256
std::string ToString() const
Definition: xds_api.cc:541
Duration http_max_stream_duration
Definition: xds_api.h:249
absl::optional< RdsUpdate > rds_update
Definition: xds_api.h:252
bool operator==(const HttpConnectionManager &other) const
Definition: xds_api.h:266
std::string route_config_name
Definition: xds_api.h:246
std::string ToString() const
Definition: xds_api.cc:515
std::vector< HttpFilter > http_filters
Definition: xds_api.h:264
Definition: xds_api.h:238
struct grpc_core::XdsApi::LdsUpdate::FilterChainMap filter_chain_map
bool operator==(const LdsUpdate &other) const
Definition: xds_api.h:370
ListenerType
Definition: xds_api.h:239
struct grpc_core::XdsApi::LdsUpdate::FilterChainData filter_chain_data
std::string ToString() const
Definition: xds_api.cc:678
enum grpc_core::XdsApi::LdsUpdate::ListenerType type
absl::optional< FilterChainData > default_filter_chain
Definition: xds_api.h:368
HttpConnectionManager http_connection_manager
Definition: xds_api.h:277
std::string address
Definition: xds_api.h:281
Definition: xds_api.h:387
std::string serialized_proto
Definition: xds_api.h:389
RdsUpdate resource
Definition: xds_api.h:388
std::vector< Route > routes
Definition: xds_api.h:152
bool operator==(const VirtualHost &other) const
Definition: xds_api.h:155
std::vector< std::string > domains
Definition: xds_api.h:151
TypedPerFilterConfig typed_per_filter_config
Definition: xds_api.h:153
Definition: xds_api.h:149
bool operator==(const RdsUpdate &other) const
Definition: xds_api.h:163
std::string ToString() const
Definition: xds_api.cc:283
std::vector< VirtualHost > virtual_hosts
Definition: xds_api.h:161
VirtualHost * FindVirtualHostForDomain(const std::string &domain)
Definition: xds_api.cc:368
Definition: xds_api.h:553
std::string serialized_proto
Definition: xds_api.h:575
ClientResourceStatus
Definition: xds_api.h:556
@ ACKED
Definition: xds_api.h:567
@ DOES_NOT_EXIST
Definition: xds_api.h:565
@ REQUESTED
Definition: xds_api.h:561
@ NACKED
Definition: xds_api.h:569
std::string failed_version
Definition: xds_api.h:581
ClientResourceStatus client_status
Definition: xds_api.h:573
grpc_millis failed_update_time
Definition: xds_api.h:585
grpc_millis update_time
Definition: xds_api.h:577
std::string version
Definition: xds_api.h:579
std::string failed_details
Definition: xds_api.h:583
ResourceMetadataMap resource_metadata_map
Definition: xds_api.h:591
absl::string_view version
Definition: xds_api.h:590
TypedPerFilterConfig typed_per_filter_config
Definition: xds_api.h:123
std::string ToString() const
Definition: xds_api.cc:235
uint32_t weight
Definition: xds_api.h:122
bool operator==(const ClusterWeight &other) const
Definition: xds_api.h:125
std::string name
Definition: xds_api.h:121
Definition: xds_api.h:90
bool operator==(const HashPolicy &other) const
bool terminal
Definition: xds_api.h:93
std::string ToString() const
Definition: xds_api.cc:197
Type
Definition: xds_api.h:91
@ CHANNEL_ID
Definition: xds_api.h:91
@ HEADER
Definition: xds_api.h:91
std::string header_name
Definition: xds_api.h:95
HashPolicy()
Definition: xds_api.h:99
HashPolicy & operator=(const HashPolicy &other)
Definition: xds_api.cc:154
Type type
Definition: xds_api.h:92
std::string regex_substitution
Definition: xds_api.h:97
std::unique_ptr< RE2 > regex
Definition: xds_api.h:96
Definition: xds_api.h:77
std::vector< HeaderMatcher > header_matchers
Definition: xds_api.h:79
absl::optional< uint32_t > fraction_per_million
Definition: xds_api.h:80
StringMatcher path_matcher
Definition: xds_api.h:78
std::string ToString() const
Definition: xds_api.cc:221
bool operator==(const Matchers &other) const
Definition: xds_api.h:82
Definition: xds_api.h:75
Matchers matchers
Definition: xds_api.h:113
absl::optional< Duration > max_stream_duration
Definition: xds_api.h:136
TypedPerFilterConfig typed_per_filter_config
Definition: xds_api.h:138
std::vector< HashPolicy > hash_policies
Definition: xds_api.h:114
bool operator==(const Route &other) const
Definition: xds_api.h:140
std::string ToString() const
Definition: xds_api.cc:252
std::vector< ClusterWeight > weighted_clusters
Definition: xds_api.h:131
std::string cluster_name
Definition: xds_api.h:119
Definition: xds_bootstrap.h:52
Definition: xds_bootstrap.h:61
Definition: xds_client_stats.h:107
Definition: xds_client_stats.h:174
Definition: xds_http_filters.h:43
Definition: xds_client_stats.h:46
Definition: error_internal.h:41
Definition: resolve_address.h:44
A grpc_slice s, if initialized, represents the byte range s.bytes[0..s.length-1].
Definition: slice.h:60
TraceFlag * tracer
Definition: xds_api.cc:907
XdsClient * client
Definition: xds_api.cc:906