From fb6ddc98f736b102ddcfb8176f1379c42b3c7ee1 Mon Sep 17 00:00:00 2001 From: "update-envoy[bot]" <135279899+update-envoy[bot]@users.noreply.github.com> Date: Mon, 26 Aug 2024 13:57:02 +0000 Subject: [PATCH] Mirrored from envoyproxy/envoy @ bd5bec9abb537b3d462ed4e74bb5ea4bf1844655 Signed-off-by: update-envoy[bot] <135279899+update-envoy[bot]@users.noreply.github.com> --- envoy/COMMIT | 2 +- .../config/core/v3/socket_cmsg_headers.pb.go | 190 +++++++++++++++++ .../v3/socket_cmsg_headers.pb.validate.go | 199 ++++++++++++++++++ .../core/v3/socket_cmsg_headers_vtproto.pb.go | 99 +++++++++ envoy/config/listener/v3/quic_config.pb.go | 66 ++++-- .../listener/v3/quic_config.pb.validate.go | 45 ++++ .../listener/v3/quic_config_vtproto.pb.go | 36 ++++ 7 files changed, 614 insertions(+), 23 deletions(-) create mode 100755 envoy/config/core/v3/socket_cmsg_headers.pb.go create mode 100755 envoy/config/core/v3/socket_cmsg_headers.pb.validate.go create mode 100755 envoy/config/core/v3/socket_cmsg_headers_vtproto.pb.go diff --git a/envoy/COMMIT b/envoy/COMMIT index 31ad134bf9..9181fe335c 100644 --- a/envoy/COMMIT +++ b/envoy/COMMIT @@ -1 +1 @@ -20e27887d29d735e1cc47cbb9af1cfe9baac4b4d +bd5bec9abb537b3d462ed4e74bb5ea4bf1844655 diff --git a/envoy/config/core/v3/socket_cmsg_headers.pb.go b/envoy/config/core/v3/socket_cmsg_headers.pb.go new file mode 100755 index 0000000000..769e2f4548 --- /dev/null +++ b/envoy/config/core/v3/socket_cmsg_headers.pb.go @@ -0,0 +1,190 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.30.0 +// protoc v5.26.1 +// source: envoy/config/core/v3/socket_cmsg_headers.proto + +package corev3 + +import ( + _ "github.com/cncf/xds/go/udpa/annotations" + 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" +) + +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) +) + +// Configuration for socket cmsg headers. +// See `:ref:CMSG `_ for further information. +type SocketCmsgHeaders struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // cmsg level. Default is unset. + Level *wrapperspb.UInt32Value `protobuf:"bytes,1,opt,name=level,proto3" json:"level,omitempty"` + // cmsg type. Default is unset. + Type *wrapperspb.UInt32Value `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + // Expected size of cmsg value. Default is zero. + ExpectedSize uint32 `protobuf:"varint,3,opt,name=expected_size,json=expectedSize,proto3" json:"expected_size,omitempty"` +} + +func (x *SocketCmsgHeaders) Reset() { + *x = SocketCmsgHeaders{} + if protoimpl.UnsafeEnabled { + mi := &file_envoy_config_core_v3_socket_cmsg_headers_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SocketCmsgHeaders) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SocketCmsgHeaders) ProtoMessage() {} + +func (x *SocketCmsgHeaders) ProtoReflect() protoreflect.Message { + mi := &file_envoy_config_core_v3_socket_cmsg_headers_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use SocketCmsgHeaders.ProtoReflect.Descriptor instead. +func (*SocketCmsgHeaders) Descriptor() ([]byte, []int) { + return file_envoy_config_core_v3_socket_cmsg_headers_proto_rawDescGZIP(), []int{0} +} + +func (x *SocketCmsgHeaders) GetLevel() *wrapperspb.UInt32Value { + if x != nil { + return x.Level + } + return nil +} + +func (x *SocketCmsgHeaders) GetType() *wrapperspb.UInt32Value { + if x != nil { + return x.Type + } + return nil +} + +func (x *SocketCmsgHeaders) GetExpectedSize() uint32 { + if x != nil { + return x.ExpectedSize + } + return 0 +} + +var File_envoy_config_core_v3_socket_cmsg_headers_proto protoreflect.FileDescriptor + +var file_envoy_config_core_v3_socket_cmsg_headers_proto_rawDesc = []byte{ + 0x0a, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x63, + 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x5f, 0x63, 0x6d, + 0x73, 0x67, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x12, 0x14, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, + 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, + 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9e, 0x01, 0x0a, 0x11, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, + 0x43, 0x6d, 0x73, 0x67, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x32, 0x0a, 0x05, 0x6c, + 0x65, 0x76, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, + 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x55, 0x49, 0x6e, + 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x05, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x12, + 0x30, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, + 0x55, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, + 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x73, 0x69, + 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0c, 0x65, 0x78, 0x70, 0x65, 0x63, 0x74, + 0x65, 0x64, 0x53, 0x69, 0x7a, 0x65, 0x42, 0x8a, 0x01, 0xba, 0x80, 0xc8, 0xd1, 0x06, 0x02, 0x10, + 0x02, 0x0a, 0x22, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, + 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, 0x6f, + 0x72, 0x65, 0x2e, 0x76, 0x33, 0x42, 0x16, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x6d, 0x73, + 0x67, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x42, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, + 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, + 0x6c, 0x2d, 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x63, 0x6f, + 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x3b, 0x63, 0x6f, 0x72, + 0x65, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_envoy_config_core_v3_socket_cmsg_headers_proto_rawDescOnce sync.Once + file_envoy_config_core_v3_socket_cmsg_headers_proto_rawDescData = file_envoy_config_core_v3_socket_cmsg_headers_proto_rawDesc +) + +func file_envoy_config_core_v3_socket_cmsg_headers_proto_rawDescGZIP() []byte { + file_envoy_config_core_v3_socket_cmsg_headers_proto_rawDescOnce.Do(func() { + file_envoy_config_core_v3_socket_cmsg_headers_proto_rawDescData = protoimpl.X.CompressGZIP(file_envoy_config_core_v3_socket_cmsg_headers_proto_rawDescData) + }) + return file_envoy_config_core_v3_socket_cmsg_headers_proto_rawDescData +} + +var file_envoy_config_core_v3_socket_cmsg_headers_proto_msgTypes = make([]protoimpl.MessageInfo, 1) +var file_envoy_config_core_v3_socket_cmsg_headers_proto_goTypes = []interface{}{ + (*SocketCmsgHeaders)(nil), // 0: envoy.config.core.v3.SocketCmsgHeaders + (*wrapperspb.UInt32Value)(nil), // 1: google.protobuf.UInt32Value +} +var file_envoy_config_core_v3_socket_cmsg_headers_proto_depIdxs = []int32{ + 1, // 0: envoy.config.core.v3.SocketCmsgHeaders.level:type_name -> google.protobuf.UInt32Value + 1, // 1: envoy.config.core.v3.SocketCmsgHeaders.type:type_name -> google.protobuf.UInt32Value + 2, // [2:2] is the sub-list for method output_type + 2, // [2:2] is the sub-list for method input_type + 2, // [2:2] is the sub-list for extension type_name + 2, // [2:2] is the sub-list for extension extendee + 0, // [0:2] is the sub-list for field type_name +} + +func init() { file_envoy_config_core_v3_socket_cmsg_headers_proto_init() } +func file_envoy_config_core_v3_socket_cmsg_headers_proto_init() { + if File_envoy_config_core_v3_socket_cmsg_headers_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_envoy_config_core_v3_socket_cmsg_headers_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SocketCmsgHeaders); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_envoy_config_core_v3_socket_cmsg_headers_proto_rawDesc, + NumEnums: 0, + NumMessages: 1, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_envoy_config_core_v3_socket_cmsg_headers_proto_goTypes, + DependencyIndexes: file_envoy_config_core_v3_socket_cmsg_headers_proto_depIdxs, + MessageInfos: file_envoy_config_core_v3_socket_cmsg_headers_proto_msgTypes, + }.Build() + File_envoy_config_core_v3_socket_cmsg_headers_proto = out.File + file_envoy_config_core_v3_socket_cmsg_headers_proto_rawDesc = nil + file_envoy_config_core_v3_socket_cmsg_headers_proto_goTypes = nil + file_envoy_config_core_v3_socket_cmsg_headers_proto_depIdxs = nil +} diff --git a/envoy/config/core/v3/socket_cmsg_headers.pb.validate.go b/envoy/config/core/v3/socket_cmsg_headers.pb.validate.go new file mode 100755 index 0000000000..d3b54d5a4d --- /dev/null +++ b/envoy/config/core/v3/socket_cmsg_headers.pb.validate.go @@ -0,0 +1,199 @@ +//go:build !disable_pgv +// Code generated by protoc-gen-validate. DO NOT EDIT. +// source: envoy/config/core/v3/socket_cmsg_headers.proto + +package corev3 + +import ( + "bytes" + "errors" + "fmt" + "net" + "net/mail" + "net/url" + "regexp" + "sort" + "strings" + "time" + "unicode/utf8" + + "google.golang.org/protobuf/types/known/anypb" +) + +// ensure the imports are used +var ( + _ = bytes.MinRead + _ = errors.New("") + _ = fmt.Print + _ = utf8.UTFMax + _ = (*regexp.Regexp)(nil) + _ = (*strings.Reader)(nil) + _ = net.IPv4len + _ = time.Duration(0) + _ = (*url.URL)(nil) + _ = (*mail.Address)(nil) + _ = anypb.Any{} + _ = sort.Sort +) + +// Validate checks the field values on SocketCmsgHeaders with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *SocketCmsgHeaders) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on SocketCmsgHeaders with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// SocketCmsgHeadersMultiError, or nil if none found. +func (m *SocketCmsgHeaders) ValidateAll() error { + return m.validate(true) +} + +func (m *SocketCmsgHeaders) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + if all { + switch v := interface{}(m.GetLevel()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, SocketCmsgHeadersValidationError{ + field: "Level", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, SocketCmsgHeadersValidationError{ + field: "Level", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetLevel()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return SocketCmsgHeadersValidationError{ + field: "Level", + reason: "embedded message failed validation", + cause: err, + } + } + } + + if all { + switch v := interface{}(m.GetType()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, SocketCmsgHeadersValidationError{ + field: "Type", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, SocketCmsgHeadersValidationError{ + field: "Type", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetType()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return SocketCmsgHeadersValidationError{ + field: "Type", + reason: "embedded message failed validation", + cause: err, + } + } + } + + // no validation rules for ExpectedSize + + if len(errors) > 0 { + return SocketCmsgHeadersMultiError(errors) + } + + return nil +} + +// SocketCmsgHeadersMultiError is an error wrapping multiple validation errors +// returned by SocketCmsgHeaders.ValidateAll() if the designated constraints +// aren't met. +type SocketCmsgHeadersMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m SocketCmsgHeadersMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m SocketCmsgHeadersMultiError) AllErrors() []error { return m } + +// SocketCmsgHeadersValidationError is the validation error returned by +// SocketCmsgHeaders.Validate if the designated constraints aren't met. +type SocketCmsgHeadersValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e SocketCmsgHeadersValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e SocketCmsgHeadersValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e SocketCmsgHeadersValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e SocketCmsgHeadersValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e SocketCmsgHeadersValidationError) ErrorName() string { + return "SocketCmsgHeadersValidationError" +} + +// Error satisfies the builtin error interface +func (e SocketCmsgHeadersValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sSocketCmsgHeaders.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = SocketCmsgHeadersValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = SocketCmsgHeadersValidationError{} diff --git a/envoy/config/core/v3/socket_cmsg_headers_vtproto.pb.go b/envoy/config/core/v3/socket_cmsg_headers_vtproto.pb.go new file mode 100755 index 0000000000..0de8340b4d --- /dev/null +++ b/envoy/config/core/v3/socket_cmsg_headers_vtproto.pb.go @@ -0,0 +1,99 @@ +//go:build vtprotobuf +// +build vtprotobuf + +// Code generated by protoc-gen-go-vtproto. DO NOT EDIT. +// source: envoy/config/core/v3/socket_cmsg_headers.proto + +package corev3 + +import ( + protohelpers "github.com/planetscale/vtprotobuf/protohelpers" + wrapperspb "github.com/planetscale/vtprotobuf/types/known/wrapperspb" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" +) + +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) +) + +func (m *SocketCmsgHeaders) MarshalVTStrict() (dAtA []byte, err error) { + if m == nil { + return nil, nil + } + size := m.SizeVT() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBufferVTStrict(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SocketCmsgHeaders) MarshalToVTStrict(dAtA []byte) (int, error) { + size := m.SizeVT() + return m.MarshalToSizedBufferVTStrict(dAtA[:size]) +} + +func (m *SocketCmsgHeaders) MarshalToSizedBufferVTStrict(dAtA []byte) (int, error) { + if m == nil { + return 0, nil + } + i := len(dAtA) + _ = i + var l int + _ = l + if m.unknownFields != nil { + i -= len(m.unknownFields) + copy(dAtA[i:], m.unknownFields) + } + if m.ExpectedSize != 0 { + i = protohelpers.EncodeVarint(dAtA, i, uint64(m.ExpectedSize)) + i-- + dAtA[i] = 0x18 + } + if m.Type != nil { + size, err := (*wrapperspb.UInt32Value)(m.Type).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x12 + } + if m.Level != nil { + size, err := (*wrapperspb.UInt32Value)(m.Level).MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SocketCmsgHeaders) SizeVT() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Level != nil { + l = (*wrapperspb.UInt32Value)(m.Level).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.Type != nil { + l = (*wrapperspb.UInt32Value)(m.Type).SizeVT() + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + if m.ExpectedSize != 0 { + n += 1 + protohelpers.SizeOfVarint(uint64(m.ExpectedSize)) + } + n += len(m.unknownFields) + return n +} diff --git a/envoy/config/listener/v3/quic_config.pb.go b/envoy/config/listener/v3/quic_config.pb.go index a2f3a48e23..2a70107c3d 100755 --- a/envoy/config/listener/v3/quic_config.pb.go +++ b/envoy/config/listener/v3/quic_config.pb.go @@ -27,7 +27,7 @@ const ( ) // Configuration specific to the UDP QUIC listener. -// [#next-free-field: 12] +// [#next-free-field: 13] type QuicProtocolOptions struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -78,6 +78,11 @@ type QuicProtocolOptions struct { // If not specified, no debug visitor will be attached to connections. // [#extension-category: envoy.quic.connection_debug_visitor] ConnectionDebugVisitorConfig *v3.TypedExtensionConfig `protobuf:"bytes,11,opt,name=connection_debug_visitor_config,json=connectionDebugVisitorConfig,proto3" json:"connection_debug_visitor_config,omitempty"` + // Configure a type of UDP cmsg to pass to listener filters via QuicReceivedPacket. + // Both level and type must be specified for cmsg to be saved. + // Cmsg may be truncated or omitted if expected size is not set. + // If not specified, no cmsg will be saved to QuicReceivedPacket. + SaveCmsgConfig []*v3.SocketCmsgHeaders `protobuf:"bytes,12,rep,name=save_cmsg_config,json=saveCmsgConfig,proto3" json:"save_cmsg_config,omitempty"` } func (x *QuicProtocolOptions) Reset() { @@ -189,6 +194,13 @@ func (x *QuicProtocolOptions) GetConnectionDebugVisitorConfig() *v3.TypedExtensi return nil } +func (x *QuicProtocolOptions) GetSaveCmsgConfig() []*v3.SocketCmsgHeaders { + if x != nil { + return x.SaveCmsgConfig + } + return nil +} + var File_envoy_config_listener_v3_quic_config_proto protoreflect.FileDescriptor var file_envoy_config_listener_v3_quic_config_proto_rawDesc = []byte{ @@ -203,6 +215,9 @@ var file_envoy_config_listener_v3_quic_config_proto_rawDesc = []byte{ 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x23, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x1a, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, + 0x2f, 0x63, 0x6f, 0x72, 0x65, 0x2f, 0x76, 0x33, 0x2f, 0x73, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x5f, + 0x63, 0x6d, 0x73, 0x67, 0x5f, 0x68, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, @@ -214,8 +229,8 @@ var file_envoy_config_listener_v3_quic_config_proto_rawDesc = []byte{ 0x74, 0x6f, 0x1a, 0x21, 0x75, 0x64, 0x70, 0x61, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, - 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf6, - 0x08, 0x0a, 0x13, 0x51, 0x75, 0x69, 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4f, + 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xd3, + 0x09, 0x0a, 0x13, 0x51, 0x75, 0x69, 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x5d, 0x0a, 0x15, 0x71, 0x75, 0x69, 0x63, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x29, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, @@ -283,20 +298,25 @@ var file_envoy_config_listener_v3_quic_config_proto_rawDesc = []byte{ 0x76, 0x33, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x64, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x52, 0x1c, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x65, 0x62, 0x75, 0x67, 0x56, 0x69, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x43, - 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x3a, 0x30, 0x9a, 0xc5, 0x88, 0x1e, 0x2b, 0x0a, 0x29, 0x65, 0x6e, - 0x76, 0x6f, 0x79, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x65, - 0x6e, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x69, 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x8f, 0x01, 0xba, 0x80, 0xc8, 0xd1, 0x06, 0x02, - 0x10, 0x02, 0x0a, 0x26, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, - 0x79, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x6c, - 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x0f, 0x51, 0x75, 0x69, 0x63, - 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4a, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, - 0x72, 0x6f, 0x78, 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, - 0x70, 0x6c, 0x61, 0x6e, 0x65, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, - 0x69, 0x67, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x2f, 0x76, 0x33, 0x3b, 0x6c, - 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x5b, 0x0a, 0x10, 0x73, 0x61, 0x76, 0x65, 0x5f, 0x63, 0x6d, + 0x73, 0x67, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x18, 0x0c, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x27, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x63, + 0x6f, 0x72, 0x65, 0x2e, 0x76, 0x33, 0x2e, 0x53, 0x6f, 0x63, 0x6b, 0x65, 0x74, 0x43, 0x6d, 0x73, + 0x67, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x42, 0x08, 0xfa, 0x42, 0x05, 0x92, 0x01, 0x02, + 0x10, 0x01, 0x52, 0x0e, 0x73, 0x61, 0x76, 0x65, 0x43, 0x6d, 0x73, 0x67, 0x43, 0x6f, 0x6e, 0x66, + 0x69, 0x67, 0x3a, 0x30, 0x9a, 0xc5, 0x88, 0x1e, 0x2b, 0x0a, 0x29, 0x65, 0x6e, 0x76, 0x6f, 0x79, + 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x32, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, + 0x2e, 0x51, 0x75, 0x69, 0x63, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x4f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x8f, 0x01, 0xba, 0x80, 0xc8, 0xd1, 0x06, 0x02, 0x10, 0x02, 0x0a, + 0x26, 0x69, 0x6f, 0x2e, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x2e, 0x65, + 0x6e, 0x76, 0x6f, 0x79, 0x2e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2e, 0x6c, 0x69, 0x73, 0x74, + 0x65, 0x6e, 0x65, 0x72, 0x2e, 0x76, 0x33, 0x42, 0x0f, 0x51, 0x75, 0x69, 0x63, 0x43, 0x6f, 0x6e, + 0x66, 0x69, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x4a, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x70, 0x72, 0x6f, 0x78, + 0x79, 0x2f, 0x67, 0x6f, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2d, 0x70, 0x6c, 0x61, + 0x6e, 0x65, 0x2f, 0x65, 0x6e, 0x76, 0x6f, 0x79, 0x2f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x2f, + 0x6c, 0x69, 0x73, 0x74, 0x65, 0x6e, 0x65, 0x72, 0x2f, 0x76, 0x33, 0x3b, 0x6c, 0x69, 0x73, 0x74, + 0x65, 0x6e, 0x65, 0x72, 0x76, 0x33, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -320,6 +340,7 @@ var file_envoy_config_listener_v3_quic_config_proto_goTypes = []interface{}{ (*wrapperspb.UInt32Value)(nil), // 4: google.protobuf.UInt32Value (*v3.TypedExtensionConfig)(nil), // 5: envoy.config.core.v3.TypedExtensionConfig (*wrapperspb.BoolValue)(nil), // 6: google.protobuf.BoolValue + (*v3.SocketCmsgHeaders)(nil), // 7: envoy.config.core.v3.SocketCmsgHeaders } var file_envoy_config_listener_v3_quic_config_proto_depIdxs = []int32{ 1, // 0: envoy.config.listener.v3.QuicProtocolOptions.quic_protocol_options:type_name -> envoy.config.core.v3.QuicProtocolOptions @@ -333,11 +354,12 @@ var file_envoy_config_listener_v3_quic_config_proto_depIdxs = []int32{ 5, // 8: envoy.config.listener.v3.QuicProtocolOptions.server_preferred_address_config:type_name -> envoy.config.core.v3.TypedExtensionConfig 6, // 9: envoy.config.listener.v3.QuicProtocolOptions.send_disable_active_migration:type_name -> google.protobuf.BoolValue 5, // 10: envoy.config.listener.v3.QuicProtocolOptions.connection_debug_visitor_config:type_name -> envoy.config.core.v3.TypedExtensionConfig - 11, // [11:11] is the sub-list for method output_type - 11, // [11:11] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name + 7, // 11: envoy.config.listener.v3.QuicProtocolOptions.save_cmsg_config:type_name -> envoy.config.core.v3.SocketCmsgHeaders + 12, // [12:12] is the sub-list for method output_type + 12, // [12:12] is the sub-list for method input_type + 12, // [12:12] is the sub-list for extension type_name + 12, // [12:12] is the sub-list for extension extendee + 0, // [0:12] is the sub-list for field type_name } func init() { file_envoy_config_listener_v3_quic_config_proto_init() } diff --git a/envoy/config/listener/v3/quic_config.pb.validate.go b/envoy/config/listener/v3/quic_config.pb.validate.go index efabacb665..b3077ab6c6 100755 --- a/envoy/config/listener/v3/quic_config.pb.validate.go +++ b/envoy/config/listener/v3/quic_config.pb.validate.go @@ -363,6 +363,51 @@ func (m *QuicProtocolOptions) validate(all bool) error { } } + if len(m.GetSaveCmsgConfig()) > 1 { + err := QuicProtocolOptionsValidationError{ + field: "SaveCmsgConfig", + reason: "value must contain no more than 1 item(s)", + } + if !all { + return err + } + errors = append(errors, err) + } + + for idx, item := range m.GetSaveCmsgConfig() { + _, _ = idx, item + + if all { + switch v := interface{}(item).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, QuicProtocolOptionsValidationError{ + field: fmt.Sprintf("SaveCmsgConfig[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, QuicProtocolOptionsValidationError{ + field: fmt.Sprintf("SaveCmsgConfig[%v]", idx), + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(item).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return QuicProtocolOptionsValidationError{ + field: fmt.Sprintf("SaveCmsgConfig[%v]", idx), + reason: "embedded message failed validation", + cause: err, + } + } + } + + } + if len(errors) > 0 { return QuicProtocolOptionsMultiError(errors) } diff --git a/envoy/config/listener/v3/quic_config_vtproto.pb.go b/envoy/config/listener/v3/quic_config_vtproto.pb.go index 4b0826804a..22873d0e11 100755 --- a/envoy/config/listener/v3/quic_config_vtproto.pb.go +++ b/envoy/config/listener/v3/quic_config_vtproto.pb.go @@ -51,6 +51,30 @@ func (m *QuicProtocolOptions) MarshalToSizedBufferVTStrict(dAtA []byte) (int, er i -= len(m.unknownFields) copy(dAtA[i:], m.unknownFields) } + if len(m.SaveCmsgConfig) > 0 { + for iNdEx := len(m.SaveCmsgConfig) - 1; iNdEx >= 0; iNdEx-- { + if vtmsg, ok := interface{}(m.SaveCmsgConfig[iNdEx]).(interface { + MarshalToSizedBufferVTStrict([]byte) (int, error) + }); ok { + size, err := vtmsg.MarshalToSizedBufferVTStrict(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = protohelpers.EncodeVarint(dAtA, i, uint64(size)) + } else { + encoded, err := proto.Marshal(m.SaveCmsgConfig[iNdEx]) + if err != nil { + return 0, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = protohelpers.EncodeVarint(dAtA, i, uint64(len(encoded))) + } + i-- + dAtA[i] = 0x62 + } + } if m.ConnectionDebugVisitorConfig != nil { if vtmsg, ok := interface{}(m.ConnectionDebugVisitorConfig).(interface { MarshalToSizedBufferVTStrict([]byte) (int, error) @@ -340,6 +364,18 @@ func (m *QuicProtocolOptions) SizeVT() (n int) { } n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) } + if len(m.SaveCmsgConfig) > 0 { + for _, e := range m.SaveCmsgConfig { + if size, ok := interface{}(e).(interface { + SizeVT() int + }); ok { + l = size.SizeVT() + } else { + l = proto.Size(e) + } + n += 1 + l + protohelpers.SizeOfVarint(uint64(l)) + } + } n += len(m.unknownFields) return n }