xref: /aosp_15_r20/external/grpc-grpc-java/xds/third_party/envoy/src/main/proto/envoy/api/v2/core/address.proto (revision e07d83d3ffcef9ecfc9f7f475418ec639ff0e5fe)
1syntax = "proto3";
2
3package envoy.api.v2.core;
4
5import "envoy/api/v2/core/socket_option.proto";
6
7import "google/protobuf/wrappers.proto";
8
9import "udpa/annotations/migrate.proto";
10import "udpa/annotations/status.proto";
11import "validate/validate.proto";
12
13option java_package = "io.envoyproxy.envoy.api.v2.core";
14option java_outer_classname = "AddressProto";
15option java_multiple_files = true;
16option go_package = "github.com/envoyproxy/go-control-plane/envoy/api/v2/core";
17option (udpa.annotations.file_migrate).move_to_package = "envoy.config.core.v3";
18option (udpa.annotations.file_status).package_version_status = FROZEN;
19
20// [#protodoc-title: Network addresses]
21
22message Pipe {
23  // Unix Domain Socket path. On Linux, paths starting with '@' will use the
24  // abstract namespace. The starting '@' is replaced by a null byte by Envoy.
25  // Paths starting with '@' will result in an error in environments other than
26  // Linux.
27  string path = 1 [(validate.rules).string = {min_bytes: 1}];
28
29  // The mode for the Pipe. Not applicable for abstract sockets.
30  uint32 mode = 2 [(validate.rules).uint32 = {lte: 511}];
31}
32
33// [#next-free-field: 7]
34message SocketAddress {
35  enum Protocol {
36    TCP = 0;
37    UDP = 1;
38  }
39
40  Protocol protocol = 1 [(validate.rules).enum = {defined_only: true}];
41
42  // The address for this socket. :ref:`Listeners <config_listeners>` will bind
43  // to the address. An empty address is not allowed. Specify ``0.0.0.0`` or ``::``
44  // to bind to any address. [#comment:TODO(zuercher) reinstate when implemented:
45  // It is possible to distinguish a Listener address via the prefix/suffix matching
46  // in :ref:`FilterChainMatch <envoy_api_msg_listener.FilterChainMatch>`.] When used
47  // within an upstream :ref:`BindConfig <envoy_api_msg_core.BindConfig>`, the address
48  // controls the source address of outbound connections. For :ref:`clusters
49  // <envoy_api_msg_Cluster>`, the cluster type determines whether the
50  // address must be an IP (*STATIC* or *EDS* clusters) or a hostname resolved by DNS
51  // (*STRICT_DNS* or *LOGICAL_DNS* clusters). Address resolution can be customized
52  // via :ref:`resolver_name <envoy_api_field_core.SocketAddress.resolver_name>`.
53  string address = 2 [(validate.rules).string = {min_bytes: 1}];
54
55  oneof port_specifier {
56    option (validate.required) = true;
57
58    uint32 port_value = 3 [(validate.rules).uint32 = {lte: 65535}];
59
60    // This is only valid if :ref:`resolver_name
61    // <envoy_api_field_core.SocketAddress.resolver_name>` is specified below and the
62    // named resolver is capable of named port resolution.
63    string named_port = 4;
64  }
65
66  // The name of the custom resolver. This must have been registered with Envoy. If
67  // this is empty, a context dependent default applies. If the address is a concrete
68  // IP address, no resolution will occur. If address is a hostname this
69  // should be set for resolution other than DNS. Specifying a custom resolver with
70  // *STRICT_DNS* or *LOGICAL_DNS* will generate an error at runtime.
71  string resolver_name = 5;
72
73  // When binding to an IPv6 address above, this enables `IPv4 compatibility
74  // <https://tools.ietf.org/html/rfc3493#page-11>`_. Binding to ``::`` will
75  // allow both IPv4 and IPv6 connections, with peer IPv4 addresses mapped into
76  // IPv6 space as ``::FFFF:<IPv4-address>``.
77  bool ipv4_compat = 6;
78}
79
80message TcpKeepalive {
81  // Maximum number of keepalive probes to send without response before deciding
82  // the connection is dead. Default is to use the OS level configuration (unless
83  // overridden, Linux defaults to 9.)
84  google.protobuf.UInt32Value keepalive_probes = 1;
85
86  // The number of seconds a connection needs to be idle before keep-alive probes
87  // start being sent. Default is to use the OS level configuration (unless
88  // overridden, Linux defaults to 7200s (i.e., 2 hours.)
89  google.protobuf.UInt32Value keepalive_time = 2;
90
91  // The number of seconds between keep-alive probes. Default is to use the OS
92  // level configuration (unless overridden, Linux defaults to 75s.)
93  google.protobuf.UInt32Value keepalive_interval = 3;
94}
95
96message BindConfig {
97  // The address to bind to when creating a socket.
98  SocketAddress source_address = 1 [(validate.rules).message = {required: true}];
99
100  // Whether to set the *IP_FREEBIND* option when creating the socket. When this
101  // flag is set to true, allows the :ref:`source_address
102  // <envoy_api_field_UpstreamBindConfig.source_address>` to be an IP address
103  // that is not configured on the system running Envoy. When this flag is set
104  // to false, the option *IP_FREEBIND* is disabled on the socket. When this
105  // flag is not set (default), the socket is not modified, i.e. the option is
106  // neither enabled nor disabled.
107  google.protobuf.BoolValue freebind = 2;
108
109  // Additional socket options that may not be present in Envoy source code or
110  // precompiled binaries.
111  repeated SocketOption socket_options = 3;
112}
113
114// Addresses specify either a logical or physical address and port, which are
115// used to tell Envoy where to bind/listen, connect to upstream and find
116// management servers.
117message Address {
118  oneof address {
119    option (validate.required) = true;
120
121    SocketAddress socket_address = 1;
122
123    Pipe pipe = 2;
124  }
125}
126
127// CidrRange specifies an IP Address and a prefix length to construct
128// the subnet mask for a `CIDR <https://tools.ietf.org/html/rfc4632>`_ range.
129message CidrRange {
130  // IPv4 or IPv6 address, e.g. ``192.0.0.0`` or ``2001:db8::``.
131  string address_prefix = 1 [(validate.rules).string = {min_bytes: 1}];
132
133  // Length of prefix, e.g. 0, 32. Defaults to 0 when unset.
134  google.protobuf.UInt32Value prefix_len = 2 [(validate.rules).uint32 = {lte: 128}];
135}
136