// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.10
// 	protoc        v6.33.2
// source: envoy/extensions/http/original_ip_detection/xff/v3/xff.proto

package xffv3

import (
	_ "github.com/cncf/xds/go/udpa/annotations"
	v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

// This extension allows for the original downstream remote IP to be detected
// by reading the :ref:`config_http_conn_man_headers_x-forwarded-for` header.
//
// [#extension: envoy.http.original_ip_detection.xff]
type XffConfig struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The number of additional ingress proxy hops from the right side of the
	// :ref:`config_http_conn_man_headers_x-forwarded-for` HTTP header to trust when
	// determining the origin client's IP address. The default is zero if this option
	// is not specified. See the documentation for
	// :ref:`config_http_conn_man_headers_x-forwarded-for` for more information.
	//
	// Only one of “xff_num_trusted_hops“ and “xff_trusted_cidrs“ can be set.
	XffNumTrustedHops uint32 `protobuf:"varint,1,opt,name=xff_num_trusted_hops,json=xffNumTrustedHops,proto3" json:"xff_num_trusted_hops,omitempty"`
	// The `CIDR <https://tools.ietf.org/html/rfc4632>`_ ranges to trust when
	// evaluating the remote IP address to determine the original client's IP address.
	// This is used instead of
	// :ref:`use_remote_address <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.use_remote_address>`.
	// When the remote IP address matches a trusted CIDR and the
	// :ref:`config_http_conn_man_headers_x-forwarded-for` header was sent, each entry
	// in the “x-forwarded-for“ header is evaluated from right to left and the first
	// non-trusted address is used as the original client address. If all
	// addresses in “x-forwarded-for“ are within the trusted list, the first (leftmost)
	// entry is used.
	//
	// .. warning::
	//
	//	Starting with Envoy v1.33.0, private IP address ranges are **not** automatically skipped
	//	when determining the original client address. We'll return the first address that is not
	//	in the ``xff_trusted_cidrs`` list, even if it is a private IP address.
	//
	//	If you want to skip private IP addresses, explicitly add them to the ``xff_trusted_cidrs``
	//	list. For example:
	//
	//	.. code-block:: yaml
	//
	//	  xff_trusted_cidrs:
	//	    cidrs:
	//	      - address_prefix: "10.0.0.0"
	//	        prefix_len: 8
	//	      - address_prefix: "172.16.0.0"
	//	        prefix_len: 12
	//	      - address_prefix: "192.168.0.0"
	//	        prefix_len: 16
	//	      - address_prefix: "127.0.0.0"
	//	        prefix_len: 8
	//	      - address_prefix: "fc00::"
	//	        prefix_len: 7
	//	      - address_prefix: "::1"
	//	        prefix_len: 128
	//
	//	See :ref:`internal_address_config
	//	<envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.internal_address_config>`
	//	for more information about the v1.33.0 behavior change.
	//
	// This is typically used when requests are proxied by a
	// `CDN <https://en.wikipedia.org/wiki/Content_delivery_network>`_.
	//
	// Only one of “xff_num_trusted_hops“ and “xff_trusted_cidrs“ can be set.
	XffTrustedCidrs *XffTrustedCidrs `protobuf:"bytes,2,opt,name=xff_trusted_cidrs,json=xffTrustedCidrs,proto3" json:"xff_trusted_cidrs,omitempty"`
	// If set, Envoy will not append the remote address to the
	// :ref:`config_http_conn_man_headers_x-forwarded-for` HTTP header.
	//
	// .. attention::
	//
	//	For proper proxy behaviour it is not recommended to set this option.
	//	For backwards compatibility, if this option is unset it defaults to true.
	//
	// This only applies when :ref:`use_remote_address
	// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.use_remote_address>`
	// is false, otherwise :ref:`skip_xff_append
	// <envoy_v3_api_field_extensions.filters.network.http_connection_manager.v3.HttpConnectionManager.skip_xff_append>`
	// applies.
	SkipXffAppend *wrapperspb.BoolValue `protobuf:"bytes,3,opt,name=skip_xff_append,json=skipXffAppend,proto3" json:"skip_xff_append,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *XffConfig) Reset() {
	*x = XffConfig{}
	mi := &file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *XffConfig) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*XffConfig) ProtoMessage() {}

func (x *XffConfig) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use XffConfig.ProtoReflect.Descriptor instead.
func (*XffConfig) Descriptor() ([]byte, []int) {
	return file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_rawDescGZIP(), []int{0}
}

func (x *XffConfig) GetXffNumTrustedHops() uint32 {
	if x != nil {
		return x.XffNumTrustedHops
	}
	return 0
}

func (x *XffConfig) GetXffTrustedCidrs() *XffTrustedCidrs {
	if x != nil {
		return x.XffTrustedCidrs
	}
	return nil
}

func (x *XffConfig) GetSkipXffAppend() *wrapperspb.BoolValue {
	if x != nil {
		return x.SkipXffAppend
	}
	return nil
}

type XffTrustedCidrs struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The list of `CIDRs <https://tools.ietf.org/html/rfc4632>`_ from which remote
	// connections are considered trusted.
	Cidrs         []*v3.CidrRange `protobuf:"bytes,1,rep,name=cidrs,proto3" json:"cidrs,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *XffTrustedCidrs) Reset() {
	*x = XffTrustedCidrs{}
	mi := &file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *XffTrustedCidrs) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*XffTrustedCidrs) ProtoMessage() {}

func (x *XffTrustedCidrs) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_msgTypes[1]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use XffTrustedCidrs.ProtoReflect.Descriptor instead.
func (*XffTrustedCidrs) Descriptor() ([]byte, []int) {
	return file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_rawDescGZIP(), []int{1}
}

func (x *XffTrustedCidrs) GetCidrs() []*v3.CidrRange {
	if x != nil {
		return x.Cidrs
	}
	return nil
}

var File_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto protoreflect.FileDescriptor

const file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_rawDesc = "" +
	"\n" +
	"<envoy/extensions/http/original_ip_detection/xff/v3/xff.proto\x122envoy.extensions.http.original_ip_detection.xff.v3\x1a\"envoy/config/core/v3/address.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1dudpa/annotations/status.proto\"\xf1\x01\n" +
	"\tXffConfig\x12/\n" +
	"\x14xff_num_trusted_hops\x18\x01 \x01(\rR\x11xffNumTrustedHops\x12o\n" +
	"\x11xff_trusted_cidrs\x18\x02 \x01(\v2C.envoy.extensions.http.original_ip_detection.xff.v3.XffTrustedCidrsR\x0fxffTrustedCidrs\x12B\n" +
	"\x0fskip_xff_append\x18\x03 \x01(\v2\x1a.google.protobuf.BoolValueR\rskipXffAppend\"H\n" +
	"\x0fXffTrustedCidrs\x125\n" +
	"\x05cidrs\x18\x01 \x03(\v2\x1f.envoy.config.core.v3.CidrRangeR\x05cidrsB\xb7\x01\xba\x80\xc8\xd1\x06\x02\x10\x02\n" +
	"@io.envoyproxy.envoy.extensions.http.original_ip_detection.xff.v3B\bXffProtoP\x01Z_github.com/envoyproxy/go-control-plane/envoy/extensions/http/original_ip_detection/xff/v3;xffv3b\x06proto3"

var (
	file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_rawDescOnce sync.Once
	file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_rawDescData []byte
)

func file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_rawDescGZIP() []byte {
	file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_rawDescOnce.Do(func() {
		file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_rawDesc), len(file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_rawDesc)))
	})
	return file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_rawDescData
}

var file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_goTypes = []any{
	(*XffConfig)(nil),            // 0: envoy.extensions.http.original_ip_detection.xff.v3.XffConfig
	(*XffTrustedCidrs)(nil),      // 1: envoy.extensions.http.original_ip_detection.xff.v3.XffTrustedCidrs
	(*wrapperspb.BoolValue)(nil), // 2: google.protobuf.BoolValue
	(*v3.CidrRange)(nil),         // 3: envoy.config.core.v3.CidrRange
}
var file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_depIdxs = []int32{
	1, // 0: envoy.extensions.http.original_ip_detection.xff.v3.XffConfig.xff_trusted_cidrs:type_name -> envoy.extensions.http.original_ip_detection.xff.v3.XffTrustedCidrs
	2, // 1: envoy.extensions.http.original_ip_detection.xff.v3.XffConfig.skip_xff_append:type_name -> google.protobuf.BoolValue
	3, // 2: envoy.extensions.http.original_ip_detection.xff.v3.XffTrustedCidrs.cidrs:type_name -> envoy.config.core.v3.CidrRange
	3, // [3:3] is the sub-list for method output_type
	3, // [3:3] is the sub-list for method input_type
	3, // [3:3] is the sub-list for extension type_name
	3, // [3:3] is the sub-list for extension extendee
	0, // [0:3] is the sub-list for field type_name
}

func init() { file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_init() }
func file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_init() {
	if File_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_rawDesc), len(file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   2,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_goTypes,
		DependencyIndexes: file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_depIdxs,
		MessageInfos:      file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_msgTypes,
	}.Build()
	File_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto = out.File
	file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_goTypes = nil
	file_envoy_extensions_http_original_ip_detection_xff_v3_xff_proto_depIdxs = nil
}
