// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.10
// 	protoc        v6.33.2
// source: envoy/config/core/v3/socket_option.proto

package corev3

import (
	_ "github.com/cncf/xds/go/udpa/annotations"
	_ "github.com/envoyproxy/protoc-gen-validate/validate"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	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)
)

type SocketOption_SocketState int32

const (
	// Socket options are applied after socket creation but before binding the socket to a port
	SocketOption_STATE_PREBIND SocketOption_SocketState = 0
	// Socket options are applied after binding the socket to a port but before calling listen()
	SocketOption_STATE_BOUND SocketOption_SocketState = 1
	// Socket options are applied after calling listen()
	SocketOption_STATE_LISTENING SocketOption_SocketState = 2
)

// Enum value maps for SocketOption_SocketState.
var (
	SocketOption_SocketState_name = map[int32]string{
		0: "STATE_PREBIND",
		1: "STATE_BOUND",
		2: "STATE_LISTENING",
	}
	SocketOption_SocketState_value = map[string]int32{
		"STATE_PREBIND":   0,
		"STATE_BOUND":     1,
		"STATE_LISTENING": 2,
	}
)

func (x SocketOption_SocketState) Enum() *SocketOption_SocketState {
	p := new(SocketOption_SocketState)
	*p = x
	return p
}

func (x SocketOption_SocketState) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (SocketOption_SocketState) Descriptor() protoreflect.EnumDescriptor {
	return file_envoy_config_core_v3_socket_option_proto_enumTypes[0].Descriptor()
}

func (SocketOption_SocketState) Type() protoreflect.EnumType {
	return &file_envoy_config_core_v3_socket_option_proto_enumTypes[0]
}

func (x SocketOption_SocketState) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use SocketOption_SocketState.Descriptor instead.
func (SocketOption_SocketState) EnumDescriptor() ([]byte, []int) {
	return file_envoy_config_core_v3_socket_option_proto_rawDescGZIP(), []int{0, 0}
}

// Generic socket option message. This would be used to set socket options that
// might not exist in upstream kernels or precompiled Envoy binaries.
//
// For example:
//
// .. code-block:: json
//
//	{
//	  "description": "support tcp keep alive",
//	  "state": 0,
//	  "level": 1,
//	  "name": 9,
//	  "int_value": 1,
//	}
//
// 1 means SOL_SOCKET and 9 means SO_KEEPALIVE on Linux.
// With the above configuration, `TCP Keep-Alives <https://www.freesoft.org/CIE/RFC/1122/114.htm>`_
// can be enabled in socket with Linux, which can be used in
// :ref:`listener's<envoy_v3_api_field_config.listener.v3.Listener.socket_options>` or
// :ref:`admin's <envoy_v3_api_field_config.bootstrap.v3.Admin.socket_options>` socket_options etc.
//
// It should be noted that the name or level may have different values on different platforms.
// [#next-free-field: 8]
type SocketOption struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// An optional name to give this socket option for debugging, etc.
	// Uniqueness is not required and no special meaning is assumed.
	Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
	// Corresponding to the level value passed to setsockopt, such as IPPROTO_TCP
	Level int64 `protobuf:"varint,2,opt,name=level,proto3" json:"level,omitempty"`
	// The numeric name as passed to setsockopt
	Name int64 `protobuf:"varint,3,opt,name=name,proto3" json:"name,omitempty"`
	// Types that are valid to be assigned to Value:
	//
	//	*SocketOption_IntValue
	//	*SocketOption_BufValue
	Value isSocketOption_Value `protobuf_oneof:"value"`
	// The state in which the option will be applied. When used in BindConfig
	// STATE_PREBIND is currently the only valid value.
	State SocketOption_SocketState `protobuf:"varint,6,opt,name=state,proto3,enum=envoy.config.core.v3.SocketOption_SocketState" json:"state,omitempty"`
	// Apply the socket option to the specified `socket type <https://linux.die.net/man/2/socket>`_.
	// If not specified, the socket option will be applied to all socket types.
	Type          *SocketOption_SocketType `protobuf:"bytes,7,opt,name=type,proto3" json:"type,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*SocketOption) ProtoMessage() {}

func (x *SocketOption) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_config_core_v3_socket_option_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 SocketOption.ProtoReflect.Descriptor instead.
func (*SocketOption) Descriptor() ([]byte, []int) {
	return file_envoy_config_core_v3_socket_option_proto_rawDescGZIP(), []int{0}
}

func (x *SocketOption) GetDescription() string {
	if x != nil {
		return x.Description
	}
	return ""
}

func (x *SocketOption) GetLevel() int64 {
	if x != nil {
		return x.Level
	}
	return 0
}

func (x *SocketOption) GetName() int64 {
	if x != nil {
		return x.Name
	}
	return 0
}

func (x *SocketOption) GetValue() isSocketOption_Value {
	if x != nil {
		return x.Value
	}
	return nil
}

func (x *SocketOption) GetIntValue() int64 {
	if x != nil {
		if x, ok := x.Value.(*SocketOption_IntValue); ok {
			return x.IntValue
		}
	}
	return 0
}

func (x *SocketOption) GetBufValue() []byte {
	if x != nil {
		if x, ok := x.Value.(*SocketOption_BufValue); ok {
			return x.BufValue
		}
	}
	return nil
}

func (x *SocketOption) GetState() SocketOption_SocketState {
	if x != nil {
		return x.State
	}
	return SocketOption_STATE_PREBIND
}

func (x *SocketOption) GetType() *SocketOption_SocketType {
	if x != nil {
		return x.Type
	}
	return nil
}

type isSocketOption_Value interface {
	isSocketOption_Value()
}

type SocketOption_IntValue struct {
	// Because many sockopts take an int value.
	IntValue int64 `protobuf:"varint,4,opt,name=int_value,json=intValue,proto3,oneof"`
}

type SocketOption_BufValue struct {
	// Otherwise it's a byte buffer.
	BufValue []byte `protobuf:"bytes,5,opt,name=buf_value,json=bufValue,proto3,oneof"`
}

func (*SocketOption_IntValue) isSocketOption_Value() {}

func (*SocketOption_BufValue) isSocketOption_Value() {}

type SocketOptionsOverride struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	SocketOptions []*SocketOption        `protobuf:"bytes,1,rep,name=socket_options,json=socketOptions,proto3" json:"socket_options,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*SocketOptionsOverride) ProtoMessage() {}

func (x *SocketOptionsOverride) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_config_core_v3_socket_option_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 SocketOptionsOverride.ProtoReflect.Descriptor instead.
func (*SocketOptionsOverride) Descriptor() ([]byte, []int) {
	return file_envoy_config_core_v3_socket_option_proto_rawDescGZIP(), []int{1}
}

func (x *SocketOptionsOverride) GetSocketOptions() []*SocketOption {
	if x != nil {
		return x.SocketOptions
	}
	return nil
}

// The `socket type <https://linux.die.net/man/2/socket>`_ to apply the socket option to.
// Only one field should be set. If multiple fields are set, the precedence order will determine
// the selected one. If none of the fields is set, the socket option will be applied to all socket types.
//
// For example:
// If :ref:`stream <envoy_v3_api_field_config.core.v3.SocketOption.SocketType.stream>` is set,
// it takes precedence over :ref:`datagram <envoy_v3_api_field_config.core.v3.SocketOption.SocketType.datagram>`.
type SocketOption_SocketType struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// Apply the socket option to the stream socket type.
	Stream *SocketOption_SocketType_Stream `protobuf:"bytes,1,opt,name=stream,proto3" json:"stream,omitempty"`
	// Apply the socket option to the datagram socket type.
	Datagram      *SocketOption_SocketType_Datagram `protobuf:"bytes,2,opt,name=datagram,proto3" json:"datagram,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *SocketOption_SocketType) Reset() {
	*x = SocketOption_SocketType{}
	mi := &file_envoy_config_core_v3_socket_option_proto_msgTypes[2]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

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

func (*SocketOption_SocketType) ProtoMessage() {}

func (x *SocketOption_SocketType) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_config_core_v3_socket_option_proto_msgTypes[2]
	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 SocketOption_SocketType.ProtoReflect.Descriptor instead.
func (*SocketOption_SocketType) Descriptor() ([]byte, []int) {
	return file_envoy_config_core_v3_socket_option_proto_rawDescGZIP(), []int{0, 0}
}

func (x *SocketOption_SocketType) GetStream() *SocketOption_SocketType_Stream {
	if x != nil {
		return x.Stream
	}
	return nil
}

func (x *SocketOption_SocketType) GetDatagram() *SocketOption_SocketType_Datagram {
	if x != nil {
		return x.Datagram
	}
	return nil
}

// The stream socket type.
type SocketOption_SocketType_Stream struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *SocketOption_SocketType_Stream) Reset() {
	*x = SocketOption_SocketType_Stream{}
	mi := &file_envoy_config_core_v3_socket_option_proto_msgTypes[3]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

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

func (*SocketOption_SocketType_Stream) ProtoMessage() {}

func (x *SocketOption_SocketType_Stream) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_config_core_v3_socket_option_proto_msgTypes[3]
	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 SocketOption_SocketType_Stream.ProtoReflect.Descriptor instead.
func (*SocketOption_SocketType_Stream) Descriptor() ([]byte, []int) {
	return file_envoy_config_core_v3_socket_option_proto_rawDescGZIP(), []int{0, 0, 0}
}

// The datagram socket type.
type SocketOption_SocketType_Datagram struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *SocketOption_SocketType_Datagram) Reset() {
	*x = SocketOption_SocketType_Datagram{}
	mi := &file_envoy_config_core_v3_socket_option_proto_msgTypes[4]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

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

func (*SocketOption_SocketType_Datagram) ProtoMessage() {}

func (x *SocketOption_SocketType_Datagram) ProtoReflect() protoreflect.Message {
	mi := &file_envoy_config_core_v3_socket_option_proto_msgTypes[4]
	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 SocketOption_SocketType_Datagram.ProtoReflect.Descriptor instead.
func (*SocketOption_SocketType_Datagram) Descriptor() ([]byte, []int) {
	return file_envoy_config_core_v3_socket_option_proto_rawDescGZIP(), []int{0, 0, 1}
}

var File_envoy_config_core_v3_socket_option_proto protoreflect.FileDescriptor

const file_envoy_config_core_v3_socket_option_proto_rawDesc = "" +
	"\n" +
	"(envoy/config/core/v3/socket_option.proto\x12\x14envoy.config.core.v3\x1a\x1dudpa/annotations/status.proto\x1a!udpa/annotations/versioning.proto\x1a\x17validate/validate.proto\"\xef\x04\n" +
	"\fSocketOption\x12 \n" +
	"\vdescription\x18\x01 \x01(\tR\vdescription\x12\x14\n" +
	"\x05level\x18\x02 \x01(\x03R\x05level\x12\x12\n" +
	"\x04name\x18\x03 \x01(\x03R\x04name\x12\x1d\n" +
	"\tint_value\x18\x04 \x01(\x03H\x00R\bintValue\x12\x1d\n" +
	"\tbuf_value\x18\x05 \x01(\fH\x00R\bbufValue\x12N\n" +
	"\x05state\x18\x06 \x01(\x0e2..envoy.config.core.v3.SocketOption.SocketStateB\b\xfaB\x05\x82\x01\x02\x10\x01R\x05state\x12A\n" +
	"\x04type\x18\a \x01(\v2-.envoy.config.core.v3.SocketOption.SocketTypeR\x04type\x1a\xc4\x01\n" +
	"\n" +
	"SocketType\x12L\n" +
	"\x06stream\x18\x01 \x01(\v24.envoy.config.core.v3.SocketOption.SocketType.StreamR\x06stream\x12R\n" +
	"\bdatagram\x18\x02 \x01(\v26.envoy.config.core.v3.SocketOption.SocketType.DatagramR\bdatagram\x1a\b\n" +
	"\x06Stream\x1a\n" +
	"\n" +
	"\bDatagram\"F\n" +
	"\vSocketState\x12\x11\n" +
	"\rSTATE_PREBIND\x10\x00\x12\x0f\n" +
	"\vSTATE_BOUND\x10\x01\x12\x13\n" +
	"\x0fSTATE_LISTENING\x10\x02:%\x9aň\x1e \n" +
	"\x1eenvoy.api.v2.core.SocketOptionB\f\n" +
	"\x05value\x12\x03\xf8B\x01\"b\n" +
	"\x15SocketOptionsOverride\x12I\n" +
	"\x0esocket_options\x18\x01 \x03(\v2\".envoy.config.core.v3.SocketOptionR\rsocketOptionsB\x85\x01\xba\x80\xc8\xd1\x06\x02\x10\x02\n" +
	"\"io.envoyproxy.envoy.config.core.v3B\x11SocketOptionProtoP\x01ZBgithub.com/envoyproxy/go-control-plane/envoy/config/core/v3;corev3b\x06proto3"

var (
	file_envoy_config_core_v3_socket_option_proto_rawDescOnce sync.Once
	file_envoy_config_core_v3_socket_option_proto_rawDescData []byte
)

func file_envoy_config_core_v3_socket_option_proto_rawDescGZIP() []byte {
	file_envoy_config_core_v3_socket_option_proto_rawDescOnce.Do(func() {
		file_envoy_config_core_v3_socket_option_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_envoy_config_core_v3_socket_option_proto_rawDesc), len(file_envoy_config_core_v3_socket_option_proto_rawDesc)))
	})
	return file_envoy_config_core_v3_socket_option_proto_rawDescData
}

var file_envoy_config_core_v3_socket_option_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_envoy_config_core_v3_socket_option_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_envoy_config_core_v3_socket_option_proto_goTypes = []any{
	(SocketOption_SocketState)(0),            // 0: envoy.config.core.v3.SocketOption.SocketState
	(*SocketOption)(nil),                     // 1: envoy.config.core.v3.SocketOption
	(*SocketOptionsOverride)(nil),            // 2: envoy.config.core.v3.SocketOptionsOverride
	(*SocketOption_SocketType)(nil),          // 3: envoy.config.core.v3.SocketOption.SocketType
	(*SocketOption_SocketType_Stream)(nil),   // 4: envoy.config.core.v3.SocketOption.SocketType.Stream
	(*SocketOption_SocketType_Datagram)(nil), // 5: envoy.config.core.v3.SocketOption.SocketType.Datagram
}
var file_envoy_config_core_v3_socket_option_proto_depIdxs = []int32{
	0, // 0: envoy.config.core.v3.SocketOption.state:type_name -> envoy.config.core.v3.SocketOption.SocketState
	3, // 1: envoy.config.core.v3.SocketOption.type:type_name -> envoy.config.core.v3.SocketOption.SocketType
	1, // 2: envoy.config.core.v3.SocketOptionsOverride.socket_options:type_name -> envoy.config.core.v3.SocketOption
	4, // 3: envoy.config.core.v3.SocketOption.SocketType.stream:type_name -> envoy.config.core.v3.SocketOption.SocketType.Stream
	5, // 4: envoy.config.core.v3.SocketOption.SocketType.datagram:type_name -> envoy.config.core.v3.SocketOption.SocketType.Datagram
	5, // [5:5] is the sub-list for method output_type
	5, // [5:5] is the sub-list for method input_type
	5, // [5:5] is the sub-list for extension type_name
	5, // [5:5] is the sub-list for extension extendee
	0, // [0:5] is the sub-list for field type_name
}

func init() { file_envoy_config_core_v3_socket_option_proto_init() }
func file_envoy_config_core_v3_socket_option_proto_init() {
	if File_envoy_config_core_v3_socket_option_proto != nil {
		return
	}
	file_envoy_config_core_v3_socket_option_proto_msgTypes[0].OneofWrappers = []any{
		(*SocketOption_IntValue)(nil),
		(*SocketOption_BufValue)(nil),
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_envoy_config_core_v3_socket_option_proto_rawDesc), len(file_envoy_config_core_v3_socket_option_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   5,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_envoy_config_core_v3_socket_option_proto_goTypes,
		DependencyIndexes: file_envoy_config_core_v3_socket_option_proto_depIdxs,
		EnumInfos:         file_envoy_config_core_v3_socket_option_proto_enumTypes,
		MessageInfos:      file_envoy_config_core_v3_socket_option_proto_msgTypes,
	}.Build()
	File_envoy_config_core_v3_socket_option_proto = out.File
	file_envoy_config_core_v3_socket_option_proto_goTypes = nil
	file_envoy_config_core_v3_socket_option_proto_depIdxs = nil
}
