// Copyright 2025 Envoy Project 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.

syntax = "proto3";

package envoy.extensions.network.dns_resolver.getaddrinfo.v3;

import "google/protobuf/wrappers.proto";

import "udpa/annotations/status.proto";

option java_package = "io.envoyproxy.envoy.extensions.network.dns_resolver.getaddrinfo.v3";
option java_outer_classname = "GetaddrinfoDnsResolverProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/network/dns_resolver/getaddrinfo/v3;getaddrinfov3";
option (udpa.annotations.file_status).package_version_status = ACTIVE;

// [#protodoc-title: getaddrinfo DNS resolver]
// [#extension: envoy.network.dns_resolver.getaddrinfo]

// Configuration for getaddrinfo DNS resolver. This resolver will use the system's getaddrinfo()
// function to resolve hosts.
//
// .. attention::
//
//   Resolutions currently use a hard coded TTL of 60s because the getaddrinfo() API does not
//   provide the actual TTL. Configuration for this can be added in the future if needed.
message GetAddrInfoDnsResolverConfig {
  // Specifies the number of retries before the resolver gives up. If not specified, the resolver will
  // retry indefinitely until it succeeds or the DNS query times out.
  google.protobuf.UInt32Value num_retries = 1;

  // Specifies the number of threads used to resolve pending DNS queries. If not specified, one thread is used.
  google.protobuf.UInt32Value num_resolver_threads = 2;
}
