xref: /aosp_15_r20/external/grpc-grpc/src/proto/grpc/testing/xds/v3/address.proto (revision cc02d7e222339f7a4f6ba5f422e6413f4bd931f2)
1// Copyright 2020 The gRPC Authors
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15// Local copy of Envoy xDS proto file, used for testing only.
16
17syntax = "proto3";
18
19package envoy.config.core.v3;
20
21import "google/protobuf/wrappers.proto";
22
23// [#protodoc-title: Network addresses]
24
25// [#next-free-field: 7]
26message SocketAddress {
27  enum Protocol {
28    TCP = 0;
29    UDP = 1;
30  }
31  Protocol protocol = 1;
32
33  // The address for this socket. :ref:`Listeners <config_listeners>` will bind
34  // to the address. An empty address is not allowed. Specify ``0.0.0.0`` or ``::``
35  // to bind to any address. [#comment:TODO(zuercher) reinstate when implemented:
36  // It is possible to distinguish a Listener address via the prefix/suffix matching
37  // in :ref:`FilterChainMatch <envoy_api_msg_config.listener.v3.FilterChainMatch>`.] When used
38  // within an upstream :ref:`BindConfig <envoy_api_msg_config.core.v3.BindConfig>`, the address
39  // controls the source address of outbound connections. For :ref:`clusters
40  // <envoy_api_msg_config.cluster.v3.Cluster>`, the cluster type determines whether the
41  // address must be an IP (*STATIC* or *EDS* clusters) or a hostname resolved by DNS
42  // (*STRICT_DNS* or *LOGICAL_DNS* clusters). Address resolution can be customized
43  // via :ref:`resolver_name <envoy_api_field_config.core.v3.SocketAddress.resolver_name>`.
44  string address = 2;
45
46  oneof port_specifier {
47    uint32 port_value = 3;
48  }
49
50  // The name of the custom resolver. This must have been registered with Envoy. If
51  // this is empty, a context dependent default applies. If the address is a concrete
52  // IP address, no resolution will occur. If address is a hostname this
53  // should be set for resolution other than DNS. Specifying a custom resolver with
54  // *STRICT_DNS* or *LOGICAL_DNS* will generate an error at runtime.
55  string resolver_name = 5;
56}
57
58// Addresses specify either a logical or physical address and port, which are
59// used to tell Envoy where to bind/listen, connect to upstream and find
60// management servers.
61message Address {
62  oneof address {
63    SocketAddress socket_address = 1;
64  }
65}
66
67// CidrRange specifies an IP Address and a prefix length to construct
68// the subnet mask for a `CIDR <https://tools.ietf.org/html/rfc4632>`_ range.
69message CidrRange {
70  // IPv4 or IPv6 address, e.g. ``192.0.0.0`` or ``2001:db8::``.
71  string address_prefix = 1;
72
73  // Length of prefix, e.g. 0, 32.
74  google.protobuf.UInt32Value prefix_len = 2;
75}
76