From 543c1272c55c38b7a0eedbbb4fce244cd6e21724 Mon Sep 17 00:00:00 2001 From: Kazuyoshi Kato Date: Tue, 22 Feb 2022 01:17:58 +0000 Subject: [PATCH] Run Protobuild on GitHub Actions containerd is planning to migrate off from github.com/gogo/protobuf which will affect hcsshim. Before that, this commit runs Protobuild in GitHub Actions to make sure all generated files are reproducible from .proto files. Signed-off-by: Kazuyoshi Kato --- .github/workflows/ci.yml | 16 + Protobuild.toml | 6 +- .../options/runhcs.pb.go | 439 ++-- .../stats/stats.pb.go | 759 +++--- internal/computeagent/computeagent.pb.go | 544 ++-- internal/extendedtask/extendedtask.pb.go | 135 +- .../ncproxyttrpc/networkconfigproxy.pb.go | 248 +- internal/shimdiag/shimdiag.pb.go | 388 ++- internal/vmservice/vmservice.pb.go | 2292 ++++++++--------- .../ncproxygrpc/v1/networkconfigproxy.pb.go | 2078 +++++++-------- pkg/ncproxy/nodenetsvc/v1/nodenetsvc.pb.go | 527 ++-- 11 files changed, 3700 insertions(+), 3732 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5a094817e..930d621749 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,22 @@ env: GOPROXY: off jobs: + proto: + runs-on: 'windows-2019' + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: '^1.15.0' + + # TODO install protoc-gen-gogoctrd + - name: Run Protobuild + shell: bash + run: | + go install github.com/containerd/protobuild@7e5ee24bc1f70e9e289fef15e2631eb3491320bf + protobuild $(go list ./... | grep -v /vendor/) + git diff --exit-code + lint: runs-on: 'windows-2019' steps: diff --git a/Protobuild.toml b/Protobuild.toml index 4f5616619c..1572fac889 100644 --- a/Protobuild.toml +++ b/Protobuild.toml @@ -1,14 +1,10 @@ -version = "unstable" +version = "1" generator = "gogoctrd" plugins = ["grpc", "fieldpath"] # Control protoc include paths. Below are usually some good defaults, but feel # free to try it without them if it works for your project. [includes] - # Include paths that will be added before all others. Typically, you want to - # treat the root of the project as an include, but this may not be necessary. - before = ["./protobuf"] - # Paths that should be treated as include roots in relation to the vendor # directory. These will be calculated with the vendor directory nearest the # target package. diff --git a/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go b/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go index f3b8ca404b..1ec477d2d7 100644 --- a/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go +++ b/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go @@ -11,6 +11,7 @@ import ( github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" time "time" @@ -26,7 +27,7 @@ var _ = time.Kitchen // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Options_DebugType int32 @@ -168,7 +169,7 @@ func (m *Options) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Options.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -217,7 +218,7 @@ func (m *ProcessDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_ProcessDetails.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -322,7 +323,7 @@ var fileDescriptor_b643df6839c75082 = []byte{ func (m *Options) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -330,162 +331,177 @@ func (m *Options) Marshal() (dAtA []byte, err error) { } func (m *Options) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Options) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Debug { - dAtA[i] = 0x8 - i++ - if m.Debug { + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.NoInheritHostTimezone { + i-- + if m.NoInheritHostTimezone { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if m.DebugType != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(m.DebugType)) - } - if len(m.RegistryRoot) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.RegistryRoot))) - i += copy(dAtA[i:], m.RegistryRoot) - } - if len(m.SandboxImage) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.SandboxImage))) - i += copy(dAtA[i:], m.SandboxImage) - } - if len(m.SandboxPlatform) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.SandboxPlatform))) - i += copy(dAtA[i:], m.SandboxPlatform) - } - if m.SandboxIsolation != 0 { - dAtA[i] = 0x30 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(m.SandboxIsolation)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x98 } - if len(m.BootFilesRootPath) > 0 { - dAtA[i] = 0x3a - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.BootFilesRootPath))) - i += copy(dAtA[i:], m.BootFilesRootPath) + if len(m.DefaultContainerAnnotations) > 0 { + for k := range m.DefaultContainerAnnotations { + v := m.DefaultContainerAnnotations[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintRunhcs(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintRunhcs(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintRunhcs(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 + } } - if m.VmProcessorCount != 0 { - dAtA[i] = 0x40 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(m.VmProcessorCount)) + if m.IoRetryTimeoutInSec != 0 { + i = encodeVarintRunhcs(dAtA, i, uint64(m.IoRetryTimeoutInSec)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x88 } - if m.VmMemorySizeInMb != 0 { - dAtA[i] = 0x48 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(m.VmMemorySizeInMb)) + if len(m.LogLevel) > 0 { + i -= len(m.LogLevel) + copy(dAtA[i:], m.LogLevel) + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.LogLevel))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x82 } - if len(m.GPUVHDPath) > 0 { - dAtA[i] = 0x52 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.GPUVHDPath))) - i += copy(dAtA[i:], m.GPUVHDPath) + if len(m.NCProxyAddr) > 0 { + i -= len(m.NCProxyAddr) + copy(dAtA[i:], m.NCProxyAddr) + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.NCProxyAddr))) + i-- + dAtA[i] = 0x7a } - if m.ScaleCpuLimitsToSandbox { - dAtA[i] = 0x58 - i++ - if m.ScaleCpuLimitsToSandbox { + if m.ShareScratch { + i-- + if m.ShareScratch { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if m.DefaultContainerScratchSizeInGb != 0 { - dAtA[i] = 0x60 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(m.DefaultContainerScratchSizeInGb)) + i-- + dAtA[i] = 0x70 } if m.DefaultVmScratchSizeInGb != 0 { - dAtA[i] = 0x68 - i++ i = encodeVarintRunhcs(dAtA, i, uint64(m.DefaultVmScratchSizeInGb)) + i-- + dAtA[i] = 0x68 } - if m.ShareScratch { - dAtA[i] = 0x70 - i++ - if m.ShareScratch { + if m.DefaultContainerScratchSizeInGb != 0 { + i = encodeVarintRunhcs(dAtA, i, uint64(m.DefaultContainerScratchSizeInGb)) + i-- + dAtA[i] = 0x60 + } + if m.ScaleCpuLimitsToSandbox { + i-- + if m.ScaleCpuLimitsToSandbox { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x58 } - if len(m.NCProxyAddr) > 0 { - dAtA[i] = 0x7a - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.NCProxyAddr))) - i += copy(dAtA[i:], m.NCProxyAddr) + if len(m.GPUVHDPath) > 0 { + i -= len(m.GPUVHDPath) + copy(dAtA[i:], m.GPUVHDPath) + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.GPUVHDPath))) + i-- + dAtA[i] = 0x52 } - if len(m.LogLevel) > 0 { - dAtA[i] = 0x82 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.LogLevel))) - i += copy(dAtA[i:], m.LogLevel) + if m.VmMemorySizeInMb != 0 { + i = encodeVarintRunhcs(dAtA, i, uint64(m.VmMemorySizeInMb)) + i-- + dAtA[i] = 0x48 } - if m.IoRetryTimeoutInSec != 0 { - dAtA[i] = 0x88 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(m.IoRetryTimeoutInSec)) + if m.VmProcessorCount != 0 { + i = encodeVarintRunhcs(dAtA, i, uint64(m.VmProcessorCount)) + i-- + dAtA[i] = 0x40 } - if len(m.DefaultContainerAnnotations) > 0 { - for k, _ := range m.DefaultContainerAnnotations { - dAtA[i] = 0x92 - i++ - dAtA[i] = 0x1 - i++ - v := m.DefaultContainerAnnotations[k] - mapSize := 1 + len(k) + sovRunhcs(uint64(len(k))) + 1 + len(v) + sovRunhcs(uint64(len(v))) - i = encodeVarintRunhcs(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) - } + if len(m.BootFilesRootPath) > 0 { + i -= len(m.BootFilesRootPath) + copy(dAtA[i:], m.BootFilesRootPath) + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.BootFilesRootPath))) + i-- + dAtA[i] = 0x3a } - if m.NoInheritHostTimezone { - dAtA[i] = 0x98 - i++ - dAtA[i] = 0x1 - i++ - if m.NoInheritHostTimezone { + if m.SandboxIsolation != 0 { + i = encodeVarintRunhcs(dAtA, i, uint64(m.SandboxIsolation)) + i-- + dAtA[i] = 0x30 + } + if len(m.SandboxPlatform) > 0 { + i -= len(m.SandboxPlatform) + copy(dAtA[i:], m.SandboxPlatform) + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.SandboxPlatform))) + i-- + dAtA[i] = 0x2a + } + if len(m.SandboxImage) > 0 { + i -= len(m.SandboxImage) + copy(dAtA[i:], m.SandboxImage) + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.SandboxImage))) + i-- + dAtA[i] = 0x22 + } + if len(m.RegistryRoot) > 0 { + i -= len(m.RegistryRoot) + copy(dAtA[i:], m.RegistryRoot) + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.RegistryRoot))) + i-- + dAtA[i] = 0x1a + } + if m.DebugType != 0 { + i = encodeVarintRunhcs(dAtA, i, uint64(m.DebugType)) + i-- + dAtA[i] = 0x10 + } + if m.Debug { + i-- + if m.Debug { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *ProcessDetails) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -493,74 +509,84 @@ func (m *ProcessDetails) Marshal() (dAtA []byte, err error) { } func (m *ProcessDetails) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProcessDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ImageName) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.ImageName))) - i += copy(dAtA[i:], m.ImageName) - } - dAtA[i] = 0x12 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt))) - n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - i += n1 - if m.KernelTime_100Ns != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(m.KernelTime_100Ns)) + if len(m.ExecID) > 0 { + i -= len(m.ExecID) + copy(dAtA[i:], m.ExecID) + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.ExecID))) + i-- + dAtA[i] = 0x4a } - if m.MemoryCommitBytes != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(m.MemoryCommitBytes)) + if m.UserTime_100Ns != 0 { + i = encodeVarintRunhcs(dAtA, i, uint64(m.UserTime_100Ns)) + i-- + dAtA[i] = 0x40 } - if m.MemoryWorkingSetPrivateBytes != 0 { - dAtA[i] = 0x28 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(m.MemoryWorkingSetPrivateBytes)) + if m.ProcessID != 0 { + i = encodeVarintRunhcs(dAtA, i, uint64(m.ProcessID)) + i-- + dAtA[i] = 0x38 } if m.MemoryWorkingSetSharedBytes != 0 { - dAtA[i] = 0x30 - i++ i = encodeVarintRunhcs(dAtA, i, uint64(m.MemoryWorkingSetSharedBytes)) + i-- + dAtA[i] = 0x30 } - if m.ProcessID != 0 { - dAtA[i] = 0x38 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(m.ProcessID)) + if m.MemoryWorkingSetPrivateBytes != 0 { + i = encodeVarintRunhcs(dAtA, i, uint64(m.MemoryWorkingSetPrivateBytes)) + i-- + dAtA[i] = 0x28 } - if m.UserTime_100Ns != 0 { - dAtA[i] = 0x40 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(m.UserTime_100Ns)) + if m.MemoryCommitBytes != 0 { + i = encodeVarintRunhcs(dAtA, i, uint64(m.MemoryCommitBytes)) + i-- + dAtA[i] = 0x20 } - if len(m.ExecID) > 0 { - dAtA[i] = 0x4a - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.ExecID))) - i += copy(dAtA[i:], m.ExecID) + if m.KernelTime_100Ns != 0 { + i = encodeVarintRunhcs(dAtA, i, uint64(m.KernelTime_100Ns)) + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt):]) + if err1 != nil { + return 0, err1 } - return i, nil + i -= n1 + i = encodeVarintRunhcs(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x12 + if len(m.ImageName) > 0 { + i -= len(m.ImageName) + copy(dAtA[i:], m.ImageName) + i = encodeVarintRunhcs(dAtA, i, uint64(len(m.ImageName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func encodeVarintRunhcs(dAtA []byte, offset int, v uint64) int { + offset -= sovRunhcs(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *Options) Size() (n int) { if m == nil { @@ -684,14 +710,7 @@ func (m *ProcessDetails) Size() (n int) { } func sovRunhcs(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozRunhcs(x uint64) (n int) { return sovRunhcs(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -741,7 +760,7 @@ func (this *ProcessDetails) String() string { } s := strings.Join([]string{`&ProcessDetails{`, `ImageName:` + fmt.Sprintf("%v", this.ImageName) + `,`, - `CreatedAt:` + strings.Replace(strings.Replace(this.CreatedAt.String(), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `CreatedAt:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.CreatedAt), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, `KernelTime_100Ns:` + fmt.Sprintf("%v", this.KernelTime_100Ns) + `,`, `MemoryCommitBytes:` + fmt.Sprintf("%v", this.MemoryCommitBytes) + `,`, `MemoryWorkingSetPrivateBytes:` + fmt.Sprintf("%v", this.MemoryWorkingSetPrivateBytes) + `,`, @@ -1324,7 +1343,7 @@ func (m *Options) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRunhcs } if (iNdEx + skippy) > postIndex { @@ -1361,10 +1380,7 @@ func (m *Options) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRunhcs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRunhcs } if (iNdEx + skippy) > l { @@ -1626,10 +1642,7 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthRunhcs - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthRunhcs } if (iNdEx + skippy) > l { @@ -1648,6 +1661,7 @@ func (m *ProcessDetails) Unmarshal(dAtA []byte) error { func skipRunhcs(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -1679,10 +1693,8 @@ func skipRunhcs(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -1703,55 +1715,30 @@ func skipRunhcs(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthRunhcs } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthRunhcs - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowRunhcs - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipRunhcs(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthRunhcs - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupRunhcs + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthRunhcs + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthRunhcs = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowRunhcs = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthRunhcs = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRunhcs = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupRunhcs = fmt.Errorf("proto: unexpected end of group") ) diff --git a/cmd/containerd-shim-runhcs-v1/stats/stats.pb.go b/cmd/containerd-shim-runhcs-v1/stats/stats.pb.go index 0b41b11b0c..9e28127151 100644 --- a/cmd/containerd-shim-runhcs-v1/stats/stats.pb.go +++ b/cmd/containerd-shim-runhcs-v1/stats/stats.pb.go @@ -11,6 +11,7 @@ import ( github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" time "time" @@ -26,7 +27,7 @@ var _ = time.Kitchen // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type Statistics struct { // Types that are valid to be assigned to Container: @@ -52,7 +53,7 @@ func (m *Statistics) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Statistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -78,10 +79,10 @@ type isStatistics_Container interface { } type Statistics_Windows struct { - Windows *WindowsContainerStatistics `protobuf:"bytes,1,opt,name=windows,proto3,oneof"` + Windows *WindowsContainerStatistics `protobuf:"bytes,1,opt,name=windows,proto3,oneof" json:"windows,omitempty"` } type Statistics_Linux struct { - Linux *v1.Metrics `protobuf:"bytes,2,opt,name=linux,proto3,oneof"` + Linux *v1.Metrics `protobuf:"bytes,2,opt,name=linux,proto3,oneof" json:"linux,omitempty"` } func (*Statistics_Windows) isStatistics_Container() {} @@ -108,80 +109,14 @@ func (m *Statistics) GetLinux() *v1.Metrics { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*Statistics) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _Statistics_OneofMarshaler, _Statistics_OneofUnmarshaler, _Statistics_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Statistics) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*Statistics_Windows)(nil), (*Statistics_Linux)(nil), } } -func _Statistics_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*Statistics) - // container - switch x := m.Container.(type) { - case *Statistics_Windows: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Windows); err != nil { - return err - } - case *Statistics_Linux: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Linux); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("Statistics.Container has unexpected type %T", x) - } - return nil -} - -func _Statistics_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*Statistics) - switch tag { - case 1: // container.windows - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(WindowsContainerStatistics) - err := b.DecodeMessage(msg) - m.Container = &Statistics_Windows{msg} - return true, err - case 2: // container.linux - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(v1.Metrics) - err := b.DecodeMessage(msg) - m.Container = &Statistics_Linux{msg} - return true, err - default: - return false, nil - } -} - -func _Statistics_OneofSizer(msg proto.Message) (n int) { - m := msg.(*Statistics) - // container - switch x := m.Container.(type) { - case *Statistics_Windows: - s := proto.Size(x.Windows) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Statistics_Linux: - s := proto.Size(x.Linux) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type WindowsContainerStatistics struct { Timestamp time.Time `protobuf:"bytes,1,opt,name=timestamp,proto3,stdtime" json:"timestamp"` ContainerStartTime time.Time `protobuf:"bytes,2,opt,name=container_start_time,json=containerStartTime,proto3,stdtime" json:"container_start_time"` @@ -207,7 +142,7 @@ func (m *WindowsContainerStatistics) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_WindowsContainerStatistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -248,7 +183,7 @@ func (m *WindowsContainerProcessorStatistics) XXX_Marshal(b []byte, deterministi return xxx_messageInfo_WindowsContainerProcessorStatistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -289,7 +224,7 @@ func (m *WindowsContainerMemoryStatistics) XXX_Marshal(b []byte, deterministic b return xxx_messageInfo_WindowsContainerMemoryStatistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -331,7 +266,7 @@ func (m *WindowsContainerStorageStatistics) XXX_Marshal(b []byte, deterministic return xxx_messageInfo_WindowsContainerStorageStatistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -371,7 +306,7 @@ func (m *VirtualMachineStatistics) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_VirtualMachineStatistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -410,7 +345,7 @@ func (m *VirtualMachineProcessorStatistics) XXX_Marshal(b []byte, deterministic return xxx_messageInfo_VirtualMachineProcessorStatistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -451,7 +386,7 @@ func (m *VirtualMachineMemoryStatistics) XXX_Marshal(b []byte, deterministic boo return xxx_messageInfo_VirtualMachineMemoryStatistics.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -496,7 +431,7 @@ func (m *VirtualMachineMemory) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_VirtualMachineMemory.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -603,7 +538,7 @@ var fileDescriptor_23217f96da3a05cc = []byte{ func (m *Statistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -611,65 +546,89 @@ func (m *Statistics) Marshal() (dAtA []byte, err error) { } func (m *Statistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Statistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Container != nil { - nn1, err := m.Container.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn1 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.VM != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintStats(dAtA, i, uint64(m.VM.Size())) - n2, err := m.VM.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.VM.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Container != nil { + { + size := m.Container.Size() + i -= size + if _, err := m.Container.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - return i, nil + return len(dAtA) - i, nil } func (m *Statistics_Windows) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Statistics_Windows) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Windows != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintStats(dAtA, i, uint64(m.Windows.Size())) - n3, err := m.Windows.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Windows.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Statistics_Linux) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Statistics_Linux) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Linux != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.Linux.Size())) - n4, err := m.Linux.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Linux.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *WindowsContainerStatistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -677,71 +636,83 @@ func (m *WindowsContainerStatistics) Marshal() (dAtA []byte, err error) { } func (m *WindowsContainerStatistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WindowsContainerStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - dAtA[i] = 0xa - i++ - i = encodeVarintStats(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp))) - n5, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i:]) - if err != nil { - return 0, err - } - i += n5 - dAtA[i] = 0x12 - i++ - i = encodeVarintStats(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.ContainerStartTime))) - n6, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ContainerStartTime, dAtA[i:]) - if err != nil { - return 0, err - } - i += n6 - if m.UptimeNS != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.UptimeNS)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.Processor != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.Processor.Size())) - n7, err := m.Processor.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Storage != nil { + { + size, err := m.Storage.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x32 } if m.Memory != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintStats(dAtA, i, uint64(m.Memory.Size())) - n8, err := m.Memory.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Memory.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x2a } - if m.Storage != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.Storage.Size())) - n9, err := m.Storage.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.Processor != nil { + { + size, err := m.Processor.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n9 + i-- + dAtA[i] = 0x22 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.UptimeNS != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.UptimeNS)) + i-- + dAtA[i] = 0x18 + } + n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ContainerStartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ContainerStartTime):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintStats(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x12 + n8, err8 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp):]) + if err8 != nil { + return 0, err8 } - return i, nil + i -= n8 + i = encodeVarintStats(dAtA, i, uint64(n8)) + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil } func (m *WindowsContainerProcessorStatistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -749,35 +720,41 @@ func (m *WindowsContainerProcessorStatistics) Marshal() (dAtA []byte, err error) } func (m *WindowsContainerProcessorStatistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WindowsContainerProcessorStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.TotalRuntimeNS != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.TotalRuntimeNS)) - } - if m.RuntimeUserNS != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.RuntimeUserNS)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.RuntimeKernelNS != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintStats(dAtA, i, uint64(m.RuntimeKernelNS)) + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.RuntimeUserNS != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.RuntimeUserNS)) + i-- + dAtA[i] = 0x10 + } + if m.TotalRuntimeNS != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.TotalRuntimeNS)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *WindowsContainerMemoryStatistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -785,35 +762,41 @@ func (m *WindowsContainerMemoryStatistics) Marshal() (dAtA []byte, err error) { } func (m *WindowsContainerMemoryStatistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WindowsContainerMemoryStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.MemoryUsageCommitBytes != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.MemoryUsageCommitBytes)) - } - if m.MemoryUsageCommitPeakBytes != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.MemoryUsageCommitPeakBytes)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.MemoryUsagePrivateWorkingSetBytes != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintStats(dAtA, i, uint64(m.MemoryUsagePrivateWorkingSetBytes)) + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.MemoryUsageCommitPeakBytes != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.MemoryUsageCommitPeakBytes)) + i-- + dAtA[i] = 0x10 } - return i, nil + if m.MemoryUsageCommitBytes != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.MemoryUsageCommitBytes)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func (m *WindowsContainerStorageStatistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -821,40 +804,46 @@ func (m *WindowsContainerStorageStatistics) Marshal() (dAtA []byte, err error) { } func (m *WindowsContainerStorageStatistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WindowsContainerStorageStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.ReadCountNormalized != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.ReadCountNormalized)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.ReadSizeBytes != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.ReadSizeBytes)) + if m.WriteSizeBytes != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.WriteSizeBytes)) + i-- + dAtA[i] = 0x20 } if m.WriteCountNormalized != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintStats(dAtA, i, uint64(m.WriteCountNormalized)) + i-- + dAtA[i] = 0x18 } - if m.WriteSizeBytes != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.WriteSizeBytes)) + if m.ReadSizeBytes != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.ReadSizeBytes)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.ReadCountNormalized != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.ReadCountNormalized)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *VirtualMachineStatistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -862,40 +851,50 @@ func (m *VirtualMachineStatistics) Marshal() (dAtA []byte, err error) { } func (m *VirtualMachineStatistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VirtualMachineStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Processor != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintStats(dAtA, i, uint64(m.Processor.Size())) - n10, err := m.Processor.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n10 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Memory != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.Memory.Size())) - n11, err := m.Memory.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Memory.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n11 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Processor != nil { + { + size, err := m.Processor.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *VirtualMachineProcessorStatistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -903,25 +902,31 @@ func (m *VirtualMachineProcessorStatistics) Marshal() (dAtA []byte, err error) { } func (m *VirtualMachineProcessorStatistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VirtualMachineProcessorStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.TotalRuntimeNS != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintStats(dAtA, i, uint64(m.TotalRuntimeNS)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *VirtualMachineMemoryStatistics) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -929,40 +934,48 @@ func (m *VirtualMachineMemoryStatistics) Marshal() (dAtA []byte, err error) { } func (m *VirtualMachineMemoryStatistics) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VirtualMachineMemoryStatistics) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.WorkingSetBytes != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.WorkingSetBytes)) - } - if m.VirtualNodeCount != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.VirtualNodeCount)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.VmMemory != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintStats(dAtA, i, uint64(m.VmMemory.Size())) - n12, err := m.VmMemory.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.VmMemory.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStats(dAtA, i, uint64(size)) } - i += n12 + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.VirtualNodeCount != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.VirtualNodeCount)) + i-- + dAtA[i] = 0x10 + } + if m.WorkingSetBytes != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.WorkingSetBytes)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *VirtualMachineMemory) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -970,74 +983,82 @@ func (m *VirtualMachineMemory) Marshal() (dAtA []byte, err error) { } func (m *VirtualMachineMemory) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VirtualMachineMemory) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.AvailableMemory != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.AvailableMemory)) - } - if m.AvailableMemoryBuffer != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.AvailableMemoryBuffer)) - } - if m.ReservedMemory != 0 { - dAtA[i] = 0x18 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.ReservedMemory)) - } - if m.AssignedMemory != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintStats(dAtA, i, uint64(m.AssignedMemory)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.SlpActive { - dAtA[i] = 0x28 - i++ - if m.SlpActive { + if m.DmOperationInProgress { + i-- + if m.DmOperationInProgress { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x38 } if m.BalancingEnabled { - dAtA[i] = 0x30 - i++ + i-- if m.BalancingEnabled { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x30 } - if m.DmOperationInProgress { - dAtA[i] = 0x38 - i++ - if m.DmOperationInProgress { + if m.SlpActive { + i-- + if m.SlpActive { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x28 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.AssignedMemory != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.AssignedMemory)) + i-- + dAtA[i] = 0x20 + } + if m.ReservedMemory != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.ReservedMemory)) + i-- + dAtA[i] = 0x18 + } + if m.AvailableMemoryBuffer != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.AvailableMemoryBuffer)) + i-- + dAtA[i] = 0x10 } - return i, nil + if m.AvailableMemory != 0 { + i = encodeVarintStats(dAtA, i, uint64(m.AvailableMemory)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func encodeVarintStats(dAtA []byte, offset int, v uint64) int { + offset -= sovStats(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *Statistics) Size() (n int) { if m == nil { @@ -1270,14 +1291,7 @@ func (m *VirtualMachineMemory) Size() (n int) { } func sovStats(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozStats(x uint64) (n int) { return sovStats(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1288,7 +1302,7 @@ func (this *Statistics) String() string { } s := strings.Join([]string{`&Statistics{`, `Container:` + fmt.Sprintf("%v", this.Container) + `,`, - `VM:` + strings.Replace(fmt.Sprintf("%v", this.VM), "VirtualMachineStatistics", "VirtualMachineStatistics", 1) + `,`, + `VM:` + strings.Replace(this.VM.String(), "VirtualMachineStatistics", "VirtualMachineStatistics", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -1319,12 +1333,12 @@ func (this *WindowsContainerStatistics) String() string { return "nil" } s := strings.Join([]string{`&WindowsContainerStatistics{`, - `Timestamp:` + strings.Replace(strings.Replace(this.Timestamp.String(), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, - `ContainerStartTime:` + strings.Replace(strings.Replace(this.ContainerStartTime.String(), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `Timestamp:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.Timestamp), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, + `ContainerStartTime:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.ContainerStartTime), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`, `UptimeNS:` + fmt.Sprintf("%v", this.UptimeNS) + `,`, - `Processor:` + strings.Replace(fmt.Sprintf("%v", this.Processor), "WindowsContainerProcessorStatistics", "WindowsContainerProcessorStatistics", 1) + `,`, - `Memory:` + strings.Replace(fmt.Sprintf("%v", this.Memory), "WindowsContainerMemoryStatistics", "WindowsContainerMemoryStatistics", 1) + `,`, - `Storage:` + strings.Replace(fmt.Sprintf("%v", this.Storage), "WindowsContainerStorageStatistics", "WindowsContainerStorageStatistics", 1) + `,`, + `Processor:` + strings.Replace(this.Processor.String(), "WindowsContainerProcessorStatistics", "WindowsContainerProcessorStatistics", 1) + `,`, + `Memory:` + strings.Replace(this.Memory.String(), "WindowsContainerMemoryStatistics", "WindowsContainerMemoryStatistics", 1) + `,`, + `Storage:` + strings.Replace(this.Storage.String(), "WindowsContainerStorageStatistics", "WindowsContainerStorageStatistics", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -1375,8 +1389,8 @@ func (this *VirtualMachineStatistics) String() string { return "nil" } s := strings.Join([]string{`&VirtualMachineStatistics{`, - `Processor:` + strings.Replace(fmt.Sprintf("%v", this.Processor), "VirtualMachineProcessorStatistics", "VirtualMachineProcessorStatistics", 1) + `,`, - `Memory:` + strings.Replace(fmt.Sprintf("%v", this.Memory), "VirtualMachineMemoryStatistics", "VirtualMachineMemoryStatistics", 1) + `,`, + `Processor:` + strings.Replace(this.Processor.String(), "VirtualMachineProcessorStatistics", "VirtualMachineProcessorStatistics", 1) + `,`, + `Memory:` + strings.Replace(this.Memory.String(), "VirtualMachineMemoryStatistics", "VirtualMachineMemoryStatistics", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -1400,7 +1414,7 @@ func (this *VirtualMachineMemoryStatistics) String() string { s := strings.Join([]string{`&VirtualMachineMemoryStatistics{`, `WorkingSetBytes:` + fmt.Sprintf("%v", this.WorkingSetBytes) + `,`, `VirtualNodeCount:` + fmt.Sprintf("%v", this.VirtualNodeCount) + `,`, - `VmMemory:` + strings.Replace(fmt.Sprintf("%v", this.VmMemory), "VirtualMachineMemory", "VirtualMachineMemory", 1) + `,`, + `VmMemory:` + strings.Replace(this.VmMemory.String(), "VirtualMachineMemory", "VirtualMachineMemory", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -1572,10 +1586,7 @@ func (m *Statistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -1819,10 +1830,7 @@ func (m *WindowsContainerStatistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -1930,10 +1938,7 @@ func (m *WindowsContainerProcessorStatistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -2041,10 +2046,7 @@ func (m *WindowsContainerMemoryStatistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -2171,10 +2173,7 @@ func (m *WindowsContainerStorageStatistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -2297,10 +2296,7 @@ func (m *VirtualMachineStatistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -2370,10 +2366,7 @@ func (m *VirtualMachineProcessorStatistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -2498,10 +2491,7 @@ func (m *VirtualMachineMemoryStatistics) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -2688,10 +2678,7 @@ func (m *VirtualMachineMemory) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthStats - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthStats } if (iNdEx + skippy) > l { @@ -2710,6 +2697,7 @@ func (m *VirtualMachineMemory) Unmarshal(dAtA []byte) error { func skipStats(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -2741,10 +2729,8 @@ func skipStats(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -2765,55 +2751,30 @@ func skipStats(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthStats } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthStats - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowStats - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipStats(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthStats - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupStats + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthStats + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthStats = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowStats = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthStats = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowStats = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupStats = fmt.Errorf("proto: unexpected end of group") ) diff --git a/internal/computeagent/computeagent.pb.go b/internal/computeagent/computeagent.pb.go index 8d7236dffd..5ec5e514a1 100644 --- a/internal/computeagent/computeagent.pb.go +++ b/internal/computeagent/computeagent.pb.go @@ -11,6 +11,7 @@ import ( types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -24,7 +25,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type AssignPCIInternalRequest struct { ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` @@ -49,7 +50,7 @@ func (m *AssignPCIInternalRequest) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_AssignPCIInternalRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -88,7 +89,7 @@ func (m *AssignPCIInternalResponse) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_AssignPCIInternalResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -129,7 +130,7 @@ func (m *RemovePCIInternalRequest) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_RemovePCIInternalRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -167,7 +168,7 @@ func (m *RemovePCIInternalResponse) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_RemovePCIInternalResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -208,7 +209,7 @@ func (m *AddNICInternalRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_AddNICInternalRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -246,7 +247,7 @@ func (m *AddNICInternalResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_AddNICInternalResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -287,7 +288,7 @@ func (m *ModifyNICInternalRequest) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_ModifyNICInternalRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -325,7 +326,7 @@ func (m *ModifyNICInternalResponse) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_ModifyNICInternalResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -366,7 +367,7 @@ func (m *DeleteNICInternalRequest) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_DeleteNICInternalRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -404,7 +405,7 @@ func (m *DeleteNICInternalResponse) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_DeleteNICInternalResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -445,7 +446,7 @@ func (m *IovSettings) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_IovSettings.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -530,7 +531,7 @@ var fileDescriptor_7f2f03dc308add4c = []byte{ func (m *AssignPCIInternalRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -538,43 +539,52 @@ func (m *AssignPCIInternalRequest) Marshal() (dAtA []byte, err error) { } func (m *AssignPCIInternalRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AssignPCIInternalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.DeviceID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.DeviceID))) - i += copy(dAtA[i:], m.DeviceID) + if len(m.NicID) > 0 { + i -= len(m.NicID) + copy(dAtA[i:], m.NicID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) + i-- + dAtA[i] = 0x22 } if m.VirtualFunctionIndex != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintComputeagent(dAtA, i, uint64(m.VirtualFunctionIndex)) + i-- + dAtA[i] = 0x18 } - if len(m.NicID) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) - i += copy(dAtA[i:], m.NicID) + if len(m.DeviceID) > 0 { + i -= len(m.DeviceID) + copy(dAtA[i:], m.DeviceID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.DeviceID))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AssignPCIInternalResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -582,26 +592,33 @@ func (m *AssignPCIInternalResponse) Marshal() (dAtA []byte, err error) { } func (m *AssignPCIInternalResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AssignPCIInternalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ID) + copy(dAtA[i:], m.ID) i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RemovePCIInternalRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -609,37 +626,45 @@ func (m *RemovePCIInternalRequest) Marshal() (dAtA []byte, err error) { } func (m *RemovePCIInternalRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemovePCIInternalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) - } - if len(m.DeviceID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.DeviceID))) - i += copy(dAtA[i:], m.DeviceID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.VirtualFunctionIndex != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintComputeagent(dAtA, i, uint64(m.VirtualFunctionIndex)) + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.DeviceID) > 0 { + i -= len(m.DeviceID) + copy(dAtA[i:], m.DeviceID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.DeviceID))) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *RemovePCIInternalResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -647,20 +672,26 @@ func (m *RemovePCIInternalResponse) Marshal() (dAtA []byte, err error) { } func (m *RemovePCIInternalResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RemovePCIInternalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *AddNICInternalRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -668,42 +699,52 @@ func (m *AddNICInternalRequest) Marshal() (dAtA []byte, err error) { } func (m *AddNICInternalRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddNICInternalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) - } - if len(m.NicID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) - i += copy(dAtA[i:], m.NicID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Endpoint != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(m.Endpoint.Size())) - n1, err := m.Endpoint.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Endpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintComputeagent(dAtA, i, uint64(size)) } - i += n1 + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.NicID) > 0 { + i -= len(m.NicID) + copy(dAtA[i:], m.NicID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *AddNICInternalResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -711,20 +752,26 @@ func (m *AddNICInternalResponse) Marshal() (dAtA []byte, err error) { } func (m *AddNICInternalResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddNICInternalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyNICInternalRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -732,46 +779,57 @@ func (m *ModifyNICInternalRequest) Marshal() (dAtA []byte, err error) { } func (m *ModifyNICInternalRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyNICInternalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.NicID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) - i += copy(dAtA[i:], m.NicID) - } - if m.Endpoint != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(m.Endpoint.Size())) - n2, err := m.Endpoint.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.IovPolicySettings != nil { + { + size, err := m.IovPolicySettings.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintComputeagent(dAtA, i, uint64(size)) + } + i-- dAtA[i] = 0x1a - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(m.IovPolicySettings.Size())) - n3, err := m.IovPolicySettings.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + } + if m.Endpoint != nil { + { + size, err := m.Endpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintComputeagent(dAtA, i, uint64(size)) } - i += n3 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.NicID) > 0 { + i -= len(m.NicID) + copy(dAtA[i:], m.NicID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyNICInternalResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -779,20 +837,26 @@ func (m *ModifyNICInternalResponse) Marshal() (dAtA []byte, err error) { } func (m *ModifyNICInternalResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyNICInternalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *DeleteNICInternalRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -800,42 +864,52 @@ func (m *DeleteNICInternalRequest) Marshal() (dAtA []byte, err error) { } func (m *DeleteNICInternalRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteNICInternalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) - } - if len(m.NicID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) - i += copy(dAtA[i:], m.NicID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Endpoint != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(m.Endpoint.Size())) - n4, err := m.Endpoint.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Endpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintComputeagent(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.NicID) > 0 { + i -= len(m.NicID) + copy(dAtA[i:], m.NicID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.NicID))) + i-- + dAtA[i] = 0x12 } - return i, nil + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil } func (m *DeleteNICInternalResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -843,20 +917,26 @@ func (m *DeleteNICInternalResponse) Marshal() (dAtA []byte, err error) { } func (m *DeleteNICInternalResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteNICInternalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *IovSettings) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -864,39 +944,47 @@ func (m *IovSettings) Marshal() (dAtA []byte, err error) { } func (m *IovSettings) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IovSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.IovOffloadWeight != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(m.IovOffloadWeight)) - } - if m.QueuePairsRequested != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(m.QueuePairsRequested)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.InterruptModeration != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintComputeagent(dAtA, i, uint64(m.InterruptModeration)) + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.QueuePairsRequested != 0 { + i = encodeVarintComputeagent(dAtA, i, uint64(m.QueuePairsRequested)) + i-- + dAtA[i] = 0x10 } - return i, nil + if m.IovOffloadWeight != 0 { + i = encodeVarintComputeagent(dAtA, i, uint64(m.IovOffloadWeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil } func encodeVarintComputeagent(dAtA []byte, offset int, v uint64) int { + offset -= sovComputeagent(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *AssignPCIInternalRequest) Size() (n int) { if m == nil { @@ -1106,14 +1194,7 @@ func (m *IovSettings) Size() (n int) { } func sovComputeagent(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozComputeagent(x uint64) (n int) { return sovComputeagent(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1196,7 +1277,7 @@ func (this *ModifyNICInternalRequest) String() string { s := strings.Join([]string{`&ModifyNICInternalRequest{`, `NicID:` + fmt.Sprintf("%v", this.NicID) + `,`, `Endpoint:` + strings.Replace(fmt.Sprintf("%v", this.Endpoint), "Any", "types.Any", 1) + `,`, - `IovPolicySettings:` + strings.Replace(fmt.Sprintf("%v", this.IovPolicySettings), "IovSettings", "IovSettings", 1) + `,`, + `IovPolicySettings:` + strings.Replace(this.IovPolicySettings.String(), "IovSettings", "IovSettings", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -1504,10 +1585,7 @@ func (m *AssignPCIInternalRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -1590,10 +1668,7 @@ func (m *AssignPCIInternalResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -1727,10 +1802,7 @@ func (m *RemovePCIInternalRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -1781,10 +1853,7 @@ func (m *RemovePCIInternalResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -1935,10 +2004,7 @@ func (m *AddNICInternalRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -1989,10 +2055,7 @@ func (m *AddNICInternalResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -2147,10 +2210,7 @@ func (m *ModifyNICInternalRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -2201,10 +2261,7 @@ func (m *ModifyNICInternalResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -2355,10 +2412,7 @@ func (m *DeleteNICInternalRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -2409,10 +2463,7 @@ func (m *DeleteNICInternalResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -2520,10 +2571,7 @@ func (m *IovSettings) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthComputeagent - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthComputeagent } if (iNdEx + skippy) > l { @@ -2542,6 +2590,7 @@ func (m *IovSettings) Unmarshal(dAtA []byte) error { func skipComputeagent(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -2573,10 +2622,8 @@ func skipComputeagent(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -2597,55 +2644,30 @@ func skipComputeagent(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthComputeagent } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthComputeagent - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowComputeagent - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipComputeagent(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthComputeagent - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupComputeagent + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthComputeagent + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthComputeagent = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowComputeagent = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthComputeagent = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowComputeagent = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupComputeagent = fmt.Errorf("proto: unexpected end of group") ) diff --git a/internal/extendedtask/extendedtask.pb.go b/internal/extendedtask/extendedtask.pb.go index cde41d4a3f..c13f92defb 100644 --- a/internal/extendedtask/extendedtask.pb.go +++ b/internal/extendedtask/extendedtask.pb.go @@ -10,6 +10,7 @@ import ( proto "github.com/gogo/protobuf/proto" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -23,7 +24,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ComputeProcessorInfoRequest struct { ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -45,7 +46,7 @@ func (m *ComputeProcessorInfoRequest) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_ComputeProcessorInfoRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -84,7 +85,7 @@ func (m *ComputeProcessorInfoResponse) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_ComputeProcessorInfoResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -135,7 +136,7 @@ var fileDescriptor_c90988f6b70b2a29 = []byte{ func (m *ComputeProcessorInfoRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -143,26 +144,33 @@ func (m *ComputeProcessorInfoRequest) Marshal() (dAtA []byte, err error) { } func (m *ComputeProcessorInfoRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ComputeProcessorInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ID) + copy(dAtA[i:], m.ID) i = encodeVarintExtendedtask(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ComputeProcessorInfoResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -170,29 +178,37 @@ func (m *ComputeProcessorInfoResponse) Marshal() (dAtA []byte, err error) { } func (m *ComputeProcessorInfoResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ComputeProcessorInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Count != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintExtendedtask(dAtA, i, uint64(m.Count)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func encodeVarintExtendedtask(dAtA []byte, offset int, v uint64) int { + offset -= sovExtendedtask(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *ComputeProcessorInfoRequest) Size() (n int) { if m == nil { @@ -226,14 +242,7 @@ func (m *ComputeProcessorInfoResponse) Size() (n int) { } func sovExtendedtask(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozExtendedtask(x uint64) (n int) { return sovExtendedtask(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -369,10 +378,7 @@ func (m *ComputeProcessorInfoRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthExtendedtask - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthExtendedtask } if (iNdEx + skippy) > l { @@ -442,10 +448,7 @@ func (m *ComputeProcessorInfoResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthExtendedtask - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthExtendedtask } if (iNdEx + skippy) > l { @@ -464,6 +467,7 @@ func (m *ComputeProcessorInfoResponse) Unmarshal(dAtA []byte) error { func skipExtendedtask(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -495,10 +499,8 @@ func skipExtendedtask(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -519,55 +521,30 @@ func skipExtendedtask(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthExtendedtask } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthExtendedtask - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowExtendedtask - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipExtendedtask(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthExtendedtask - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupExtendedtask + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthExtendedtask + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthExtendedtask = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowExtendedtask = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthExtendedtask = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowExtendedtask = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupExtendedtask = fmt.Errorf("proto: unexpected end of group") ) diff --git a/internal/ncproxyttrpc/networkconfigproxy.pb.go b/internal/ncproxyttrpc/networkconfigproxy.pb.go index a0fa845090..39ac60ed87 100644 --- a/internal/ncproxyttrpc/networkconfigproxy.pb.go +++ b/internal/ncproxyttrpc/networkconfigproxy.pb.go @@ -10,6 +10,7 @@ import ( proto "github.com/gogo/protobuf/proto" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -23,7 +24,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type RequestTypeInternal int32 @@ -71,7 +72,7 @@ func (m *RegisterComputeAgentRequest) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_RegisterComputeAgentRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -109,7 +110,7 @@ func (m *RegisterComputeAgentResponse) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_RegisterComputeAgentResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -148,7 +149,7 @@ func (m *UnregisterComputeAgentRequest) XXX_Marshal(b []byte, deterministic bool return xxx_messageInfo_UnregisterComputeAgentRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -186,7 +187,7 @@ func (m *UnregisterComputeAgentResponse) XXX_Marshal(b []byte, deterministic boo return xxx_messageInfo_UnregisterComputeAgentResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -226,7 +227,7 @@ func (m *ConfigureNetworkingInternalRequest) XXX_Marshal(b []byte, deterministic return xxx_messageInfo_ConfigureNetworkingInternalRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -264,7 +265,7 @@ func (m *ConfigureNetworkingInternalResponse) XXX_Marshal(b []byte, deterministi return xxx_messageInfo_ConfigureNetworkingInternalResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -332,7 +333,7 @@ var fileDescriptor_11f9efc6dfbf9b45 = []byte{ func (m *RegisterComputeAgentRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -340,32 +341,40 @@ func (m *RegisterComputeAgentRequest) Marshal() (dAtA []byte, err error) { } func (m *RegisterComputeAgentRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RegisterComputeAgentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.AgentAddress) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.AgentAddress))) - i += copy(dAtA[i:], m.AgentAddress) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.ContainerID) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.AgentAddress) > 0 { + i -= len(m.AgentAddress) + copy(dAtA[i:], m.AgentAddress) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.AgentAddress))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *RegisterComputeAgentResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -373,20 +382,26 @@ func (m *RegisterComputeAgentResponse) Marshal() (dAtA []byte, err error) { } func (m *RegisterComputeAgentResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RegisterComputeAgentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *UnregisterComputeAgentRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -394,26 +409,33 @@ func (m *UnregisterComputeAgentRequest) Marshal() (dAtA []byte, err error) { } func (m *UnregisterComputeAgentRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UnregisterComputeAgentRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *UnregisterComputeAgentResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -421,20 +443,26 @@ func (m *UnregisterComputeAgentResponse) Marshal() (dAtA []byte, err error) { } func (m *UnregisterComputeAgentResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UnregisterComputeAgentResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *ConfigureNetworkingInternalRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -442,31 +470,38 @@ func (m *ConfigureNetworkingInternalRequest) Marshal() (dAtA []byte, err error) } func (m *ConfigureNetworkingInternalRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigureNetworkingInternalRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.RequestType != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.RequestType)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ConfigureNetworkingInternalResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -474,24 +509,32 @@ func (m *ConfigureNetworkingInternalResponse) Marshal() (dAtA []byte, err error) } func (m *ConfigureNetworkingInternalResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigureNetworkingInternalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func encodeVarintNetworkconfigproxy(dAtA []byte, offset int, v uint64) int { + offset -= sovNetworkconfigproxy(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *RegisterComputeAgentRequest) Size() (n int) { if m == nil { @@ -585,14 +628,7 @@ func (m *ConfigureNetworkingInternalResponse) Size() (n int) { } func sovNetworkconfigproxy(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozNetworkconfigproxy(x uint64) (n int) { return sovNetworkconfigproxy(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -835,10 +871,7 @@ func (m *RegisterComputeAgentRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -889,10 +922,7 @@ func (m *RegisterComputeAgentResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -975,10 +1005,7 @@ func (m *UnregisterComputeAgentRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -1029,10 +1056,7 @@ func (m *UnregisterComputeAgentResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -1134,10 +1158,7 @@ func (m *ConfigureNetworkingInternalRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -1188,10 +1209,7 @@ func (m *ConfigureNetworkingInternalResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -1210,6 +1228,7 @@ func (m *ConfigureNetworkingInternalResponse) Unmarshal(dAtA []byte) error { func skipNetworkconfigproxy(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -1241,10 +1260,8 @@ func skipNetworkconfigproxy(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -1265,55 +1282,30 @@ func skipNetworkconfigproxy(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthNetworkconfigproxy } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthNetworkconfigproxy - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowNetworkconfigproxy - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipNetworkconfigproxy(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthNetworkconfigproxy - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupNetworkconfigproxy + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthNetworkconfigproxy + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthNetworkconfigproxy = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowNetworkconfigproxy = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthNetworkconfigproxy = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowNetworkconfigproxy = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupNetworkconfigproxy = fmt.Errorf("proto: unexpected end of group") ) diff --git a/internal/shimdiag/shimdiag.pb.go b/internal/shimdiag/shimdiag.pb.go index 7a44c3064c..84ca8aa334 100644 --- a/internal/shimdiag/shimdiag.pb.go +++ b/internal/shimdiag/shimdiag.pb.go @@ -10,6 +10,7 @@ import ( proto "github.com/gogo/protobuf/proto" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -23,7 +24,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ExecProcessRequest struct { Args []string `protobuf:"bytes,1,rep,name=args,proto3" json:"args,omitempty"` @@ -50,7 +51,7 @@ func (m *ExecProcessRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ExecProcessRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -89,7 +90,7 @@ func (m *ExecProcessResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ExecProcessResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -127,7 +128,7 @@ func (m *StacksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_StacksRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -167,7 +168,7 @@ func (m *StacksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_StacksResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -208,7 +209,7 @@ func (m *ShareRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_ShareRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -246,7 +247,7 @@ func (m *ShareResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_ShareResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -284,7 +285,7 @@ func (m *PidRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_PidRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -323,7 +324,7 @@ func (m *PidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_PidResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -398,7 +399,7 @@ var fileDescriptor_c7933dc6ffbb8784 = []byte{ func (m *ExecProcessRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -406,69 +407,73 @@ func (m *ExecProcessRequest) Marshal() (dAtA []byte, err error) { } func (m *ExecProcessRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExecProcessRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Args) > 0 { - for _, s := range m.Args { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Workdir) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Workdir))) - i += copy(dAtA[i:], m.Workdir) + if len(m.Stderr) > 0 { + i -= len(m.Stderr) + copy(dAtA[i:], m.Stderr) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stderr))) + i-- + dAtA[i] = 0x32 + } + if len(m.Stdout) > 0 { + i -= len(m.Stdout) + copy(dAtA[i:], m.Stdout) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stdout))) + i-- + dAtA[i] = 0x2a + } + if len(m.Stdin) > 0 { + i -= len(m.Stdin) + copy(dAtA[i:], m.Stdin) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stdin))) + i-- + dAtA[i] = 0x22 } if m.Terminal { - dAtA[i] = 0x18 - i++ + i-- if m.Terminal { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if len(m.Stdin) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stdin))) - i += copy(dAtA[i:], m.Stdin) - } - if len(m.Stdout) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stdout))) - i += copy(dAtA[i:], m.Stdout) + i-- + dAtA[i] = 0x18 } - if len(m.Stderr) > 0 { - dAtA[i] = 0x32 - i++ - i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stderr))) - i += copy(dAtA[i:], m.Stderr) + if len(m.Workdir) > 0 { + i -= len(m.Workdir) + copy(dAtA[i:], m.Workdir) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Workdir))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Args) > 0 { + for iNdEx := len(m.Args) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Args[iNdEx]) + copy(dAtA[i:], m.Args[iNdEx]) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Args[iNdEx]))) + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *ExecProcessResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -476,25 +481,31 @@ func (m *ExecProcessResponse) Marshal() (dAtA []byte, err error) { } func (m *ExecProcessResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExecProcessResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.ExitCode != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintShimdiag(dAtA, i, uint64(m.ExitCode)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *StacksRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -502,20 +513,26 @@ func (m *StacksRequest) Marshal() (dAtA []byte, err error) { } func (m *StacksRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StacksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *StacksResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -523,32 +540,40 @@ func (m *StacksResponse) Marshal() (dAtA []byte, err error) { } func (m *StacksResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StacksResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Stacks) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stacks))) - i += copy(dAtA[i:], m.Stacks) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.GuestStacks) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.GuestStacks) + copy(dAtA[i:], m.GuestStacks) i = encodeVarintShimdiag(dAtA, i, uint64(len(m.GuestStacks))) - i += copy(dAtA[i:], m.GuestStacks) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Stacks) > 0 { + i -= len(m.Stacks) + copy(dAtA[i:], m.Stacks) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.Stacks))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ShareRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -556,42 +581,50 @@ func (m *ShareRequest) Marshal() (dAtA []byte, err error) { } func (m *ShareRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ShareRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.HostPath) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintShimdiag(dAtA, i, uint64(len(m.HostPath))) - i += copy(dAtA[i:], m.HostPath) - } - if len(m.UvmPath) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintShimdiag(dAtA, i, uint64(len(m.UvmPath))) - i += copy(dAtA[i:], m.UvmPath) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.ReadOnly { - dAtA[i] = 0x18 - i++ + i-- if m.ReadOnly { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.UvmPath) > 0 { + i -= len(m.UvmPath) + copy(dAtA[i:], m.UvmPath) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.UvmPath))) + i-- + dAtA[i] = 0x12 + } + if len(m.HostPath) > 0 { + i -= len(m.HostPath) + copy(dAtA[i:], m.HostPath) + i = encodeVarintShimdiag(dAtA, i, uint64(len(m.HostPath))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ShareResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -599,20 +632,26 @@ func (m *ShareResponse) Marshal() (dAtA []byte, err error) { } func (m *ShareResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ShareResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *PidRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -620,20 +659,26 @@ func (m *PidRequest) Marshal() (dAtA []byte, err error) { } func (m *PidRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PidRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *PidResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -641,29 +686,37 @@ func (m *PidResponse) Marshal() (dAtA []byte, err error) { } func (m *PidResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Pid != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintShimdiag(dAtA, i, uint64(m.Pid)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func encodeVarintShimdiag(dAtA []byte, offset int, v uint64) int { + offset -= sovShimdiag(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *ExecProcessRequest) Size() (n int) { if m == nil { @@ -812,14 +865,7 @@ func (m *PidResponse) Size() (n int) { } func sovShimdiag(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozShimdiag(x uint64) (n int) { return sovShimdiag(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1222,10 +1268,7 @@ func (m *ExecProcessRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1295,10 +1338,7 @@ func (m *ExecProcessResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1349,10 +1389,7 @@ func (m *StacksRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1467,10 +1504,7 @@ func (m *StacksResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1605,10 +1639,7 @@ func (m *ShareRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1659,10 +1690,7 @@ func (m *ShareResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1713,10 +1741,7 @@ func (m *PidRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1786,10 +1811,7 @@ func (m *PidResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthShimdiag - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthShimdiag } if (iNdEx + skippy) > l { @@ -1808,6 +1830,7 @@ func (m *PidResponse) Unmarshal(dAtA []byte) error { func skipShimdiag(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -1839,10 +1862,8 @@ func skipShimdiag(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -1863,55 +1884,30 @@ func skipShimdiag(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthShimdiag } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthShimdiag - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowShimdiag - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipShimdiag(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthShimdiag - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupShimdiag + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthShimdiag + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthShimdiag = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowShimdiag = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthShimdiag = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowShimdiag = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupShimdiag = fmt.Errorf("proto: unexpected end of group") ) diff --git a/internal/vmservice/vmservice.pb.go b/internal/vmservice/vmservice.pb.go index c828d0dadd..79cf5624df 100644 --- a/internal/vmservice/vmservice.pb.go +++ b/internal/vmservice/vmservice.pb.go @@ -12,6 +12,7 @@ import ( types "github.com/gogo/protobuf/types" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -25,7 +26,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type ModifyType int32 @@ -195,7 +196,7 @@ func (m *DirectBoot) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DirectBoot.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -238,7 +239,7 @@ func (m *UEFI) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_UEFI.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -285,7 +286,7 @@ func (m *MemoryConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_MemoryConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -326,7 +327,7 @@ func (m *ProcessorConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_ProcessorConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -368,7 +369,7 @@ func (m *DevicesConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_DevicesConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -417,7 +418,7 @@ func (m *VMConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_VMConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -443,10 +444,10 @@ type isVMConfig_BootConfig interface { } type VMConfig_DirectBoot struct { - DirectBoot *DirectBoot `protobuf:"bytes,5,opt,name=direct_boot,json=directBoot,proto3,oneof"` + DirectBoot *DirectBoot `protobuf:"bytes,5,opt,name=direct_boot,json=directBoot,proto3,oneof" json:"direct_boot,omitempty"` } type VMConfig_Uefi struct { - Uefi *UEFI `protobuf:"bytes,6,opt,name=uefi,proto3,oneof"` + Uefi *UEFI `protobuf:"bytes,6,opt,name=uefi,proto3,oneof" json:"uefi,omitempty"` } func (*VMConfig_DirectBoot) isVMConfig_BootConfig() {} @@ -473,80 +474,14 @@ func (m *VMConfig) GetUefi() *UEFI { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*VMConfig) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _VMConfig_OneofMarshaler, _VMConfig_OneofUnmarshaler, _VMConfig_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*VMConfig) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*VMConfig_DirectBoot)(nil), (*VMConfig_Uefi)(nil), } } -func _VMConfig_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*VMConfig) - // BootConfig - switch x := m.BootConfig.(type) { - case *VMConfig_DirectBoot: - _ = b.EncodeVarint(5<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.DirectBoot); err != nil { - return err - } - case *VMConfig_Uefi: - _ = b.EncodeVarint(6<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Uefi); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("VMConfig.BootConfig has unexpected type %T", x) - } - return nil -} - -func _VMConfig_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*VMConfig) - switch tag { - case 5: // BootConfig.direct_boot - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(DirectBoot) - err := b.DecodeMessage(msg) - m.BootConfig = &VMConfig_DirectBoot{msg} - return true, err - case 6: // BootConfig.uefi - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(UEFI) - err := b.DecodeMessage(msg) - m.BootConfig = &VMConfig_Uefi{msg} - return true, err - default: - return false, nil - } -} - -func _VMConfig_OneofSizer(msg proto.Message) (n int) { - m := msg.(*VMConfig) - // BootConfig - switch x := m.BootConfig.(type) { - case *VMConfig_DirectBoot: - s := proto.Size(x.DirectBoot) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *VMConfig_Uefi: - s := proto.Size(x.Uefi) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - // WindowsOptions contains virtual machine configurations that are only present on a Windows host. type WindowsOptions struct { CpuGroupID uint64 `protobuf:"varint,1,opt,name=cpu_group_id,json=cpuGroupId,proto3" json:"cpu_group_id,omitempty"` @@ -568,7 +503,7 @@ func (m *WindowsOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_WindowsOptions.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -607,7 +542,7 @@ func (m *SerialConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_SerialConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -648,7 +583,7 @@ func (m *SerialConfig_Config) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_SerialConfig_Config.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -691,7 +626,7 @@ func (m *CreateVMRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_CreateVMRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -731,7 +666,7 @@ func (m *InspectVMRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_InspectVMRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -770,7 +705,7 @@ func (m *InspectVMResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_InspectVMResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -812,7 +747,7 @@ func (m *MemoryStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_MemoryStats.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -851,7 +786,7 @@ func (m *ProcessorStats) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_ProcessorStats.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -890,7 +825,7 @@ func (m *PropertiesVMRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_PropertiesVMRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -930,7 +865,7 @@ func (m *PropertiesVMResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_PropertiesVMResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -970,7 +905,7 @@ func (m *CapabilitiesVMResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_CapabilitiesVMResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1014,7 +949,7 @@ func (m *CapabilitiesVMResponse_SupportedResource) XXX_Marshal(b []byte, determi return xxx_messageInfo_CapabilitiesVMResponse_SupportedResource.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1056,7 +991,7 @@ func (m *HVSocketListen) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_HVSocketListen.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1096,7 +1031,7 @@ func (m *VSockListen) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return xxx_messageInfo_VSockListen.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1139,7 +1074,7 @@ func (m *VMSocketRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return xxx_messageInfo_VMSocketRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1165,10 +1100,10 @@ type isVMSocketRequest_Config interface { } type VMSocketRequest_HvsocketList struct { - HvsocketList *HVSocketListen `protobuf:"bytes,2,opt,name=hvsocket_list,json=hvsocketList,proto3,oneof"` + HvsocketList *HVSocketListen `protobuf:"bytes,2,opt,name=hvsocket_list,json=hvsocketList,proto3,oneof" json:"hvsocket_list,omitempty"` } type VMSocketRequest_VsockListen struct { - VsockListen *VSockListen `protobuf:"bytes,3,opt,name=vsock_listen,json=vsockListen,proto3,oneof"` + VsockListen *VSockListen `protobuf:"bytes,3,opt,name=vsock_listen,json=vsockListen,proto3,oneof" json:"vsock_listen,omitempty"` } func (*VMSocketRequest_HvsocketList) isVMSocketRequest_Config() {} @@ -1195,80 +1130,14 @@ func (m *VMSocketRequest) GetVsockListen() *VSockListen { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*VMSocketRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _VMSocketRequest_OneofMarshaler, _VMSocketRequest_OneofUnmarshaler, _VMSocketRequest_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*VMSocketRequest) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*VMSocketRequest_HvsocketList)(nil), (*VMSocketRequest_VsockListen)(nil), } } -func _VMSocketRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*VMSocketRequest) - // Config - switch x := m.Config.(type) { - case *VMSocketRequest_HvsocketList: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.HvsocketList); err != nil { - return err - } - case *VMSocketRequest_VsockListen: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.VsockListen); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("VMSocketRequest.Config has unexpected type %T", x) - } - return nil -} - -func _VMSocketRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*VMSocketRequest) - switch tag { - case 2: // Config.hvsocket_list - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(HVSocketListen) - err := b.DecodeMessage(msg) - m.Config = &VMSocketRequest_HvsocketList{msg} - return true, err - case 3: // Config.vsock_listen - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(VSockListen) - err := b.DecodeMessage(msg) - m.Config = &VMSocketRequest_VsockListen{msg} - return true, err - default: - return false, nil - } -} - -func _VMSocketRequest_OneofSizer(msg proto.Message) (n int) { - m := msg.(*VMSocketRequest) - // Config - switch x := m.Config.(type) { - case *VMSocketRequest_HvsocketList: - s := proto.Size(x.HvsocketList) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *VMSocketRequest_VsockListen: - s := proto.Size(x.VsockListen) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type SCSIDisk struct { Controller uint32 `protobuf:"varint,1,opt,name=controller,proto3" json:"controller,omitempty"` Lun uint32 `protobuf:"varint,2,opt,name=lun,proto3" json:"lun,omitempty"` @@ -1293,7 +1162,7 @@ func (m *SCSIDisk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_SCSIDisk.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1334,7 +1203,7 @@ func (m *VPMEMDisk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_VPMEMDisk.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1378,7 +1247,7 @@ func (m *NICConfig) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_NICConfig.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1418,7 +1287,7 @@ func (m *WindowsPCIDevice) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_WindowsPCIDevice.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1457,7 +1326,7 @@ func (m *ModifyMemoryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ModifyMemoryRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1497,7 +1366,7 @@ func (m *ModifyProcessorRequest) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_ModifyProcessorRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1537,7 +1406,7 @@ func (m *ModifyProcessorConfigRequest) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_ModifyProcessorConfigRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1585,7 +1454,7 @@ func (m *ModifyResourceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_ModifyResourceRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1611,25 +1480,25 @@ type isModifyResourceRequest_Resource interface { } type ModifyResourceRequest_Processor struct { - Processor *ModifyProcessorRequest `protobuf:"bytes,2,opt,name=processor,proto3,oneof"` + Processor *ModifyProcessorRequest `protobuf:"bytes,2,opt,name=processor,proto3,oneof" json:"processor,omitempty"` } type ModifyResourceRequest_ProcessorConfig struct { - ProcessorConfig *ModifyProcessorConfigRequest `protobuf:"bytes,3,opt,name=processor_config,json=processorConfig,proto3,oneof"` + ProcessorConfig *ModifyProcessorConfigRequest `protobuf:"bytes,3,opt,name=processor_config,json=processorConfig,proto3,oneof" json:"processor_config,omitempty"` } type ModifyResourceRequest_Memory struct { - Memory *ModifyMemoryRequest `protobuf:"bytes,4,opt,name=memory,proto3,oneof"` + Memory *ModifyMemoryRequest `protobuf:"bytes,4,opt,name=memory,proto3,oneof" json:"memory,omitempty"` } type ModifyResourceRequest_ScsiDisk struct { - ScsiDisk *SCSIDisk `protobuf:"bytes,5,opt,name=scsi_disk,json=scsiDisk,proto3,oneof"` + ScsiDisk *SCSIDisk `protobuf:"bytes,5,opt,name=scsi_disk,json=scsiDisk,proto3,oneof" json:"scsi_disk,omitempty"` } type ModifyResourceRequest_VpmemDisk struct { - VpmemDisk *VPMEMDisk `protobuf:"bytes,6,opt,name=vpmem_disk,json=vpmemDisk,proto3,oneof"` + VpmemDisk *VPMEMDisk `protobuf:"bytes,6,opt,name=vpmem_disk,json=vpmemDisk,proto3,oneof" json:"vpmem_disk,omitempty"` } type ModifyResourceRequest_NicConfig struct { - NicConfig *NICConfig `protobuf:"bytes,7,opt,name=nic_config,json=nicConfig,proto3,oneof"` + NicConfig *NICConfig `protobuf:"bytes,7,opt,name=nic_config,json=nicConfig,proto3,oneof" json:"nic_config,omitempty"` } type ModifyResourceRequest_WindowsDevice struct { - WindowsDevice *WindowsPCIDevice `protobuf:"bytes,8,opt,name=windows_device,json=windowsDevice,proto3,oneof"` + WindowsDevice *WindowsPCIDevice `protobuf:"bytes,8,opt,name=windows_device,json=windowsDevice,proto3,oneof" json:"windows_device,omitempty"` } func (*ModifyResourceRequest_Processor) isModifyResourceRequest_Resource() {} @@ -1696,9 +1565,9 @@ func (m *ModifyResourceRequest) GetWindowsDevice() *WindowsPCIDevice { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*ModifyResourceRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _ModifyResourceRequest_OneofMarshaler, _ModifyResourceRequest_OneofUnmarshaler, _ModifyResourceRequest_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*ModifyResourceRequest) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*ModifyResourceRequest_Processor)(nil), (*ModifyResourceRequest_ProcessorConfig)(nil), (*ModifyResourceRequest_Memory)(nil), @@ -1709,162 +1578,6 @@ func (*ModifyResourceRequest) XXX_OneofFuncs() (func(msg proto.Message, b *proto } } -func _ModifyResourceRequest_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*ModifyResourceRequest) - // resource - switch x := m.Resource.(type) { - case *ModifyResourceRequest_Processor: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Processor); err != nil { - return err - } - case *ModifyResourceRequest_ProcessorConfig: - _ = b.EncodeVarint(3<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.ProcessorConfig); err != nil { - return err - } - case *ModifyResourceRequest_Memory: - _ = b.EncodeVarint(4<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.Memory); err != nil { - return err - } - case *ModifyResourceRequest_ScsiDisk: - _ = b.EncodeVarint(5<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.ScsiDisk); err != nil { - return err - } - case *ModifyResourceRequest_VpmemDisk: - _ = b.EncodeVarint(6<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.VpmemDisk); err != nil { - return err - } - case *ModifyResourceRequest_NicConfig: - _ = b.EncodeVarint(7<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.NicConfig); err != nil { - return err - } - case *ModifyResourceRequest_WindowsDevice: - _ = b.EncodeVarint(8<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.WindowsDevice); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("ModifyResourceRequest.Resource has unexpected type %T", x) - } - return nil -} - -func _ModifyResourceRequest_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*ModifyResourceRequest) - switch tag { - case 2: // resource.processor - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(ModifyProcessorRequest) - err := b.DecodeMessage(msg) - m.Resource = &ModifyResourceRequest_Processor{msg} - return true, err - case 3: // resource.processor_config - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(ModifyProcessorConfigRequest) - err := b.DecodeMessage(msg) - m.Resource = &ModifyResourceRequest_ProcessorConfig{msg} - return true, err - case 4: // resource.memory - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(ModifyMemoryRequest) - err := b.DecodeMessage(msg) - m.Resource = &ModifyResourceRequest_Memory{msg} - return true, err - case 5: // resource.scsi_disk - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(SCSIDisk) - err := b.DecodeMessage(msg) - m.Resource = &ModifyResourceRequest_ScsiDisk{msg} - return true, err - case 6: // resource.vpmem_disk - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(VPMEMDisk) - err := b.DecodeMessage(msg) - m.Resource = &ModifyResourceRequest_VpmemDisk{msg} - return true, err - case 7: // resource.nic_config - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(NICConfig) - err := b.DecodeMessage(msg) - m.Resource = &ModifyResourceRequest_NicConfig{msg} - return true, err - case 8: // resource.windows_device - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(WindowsPCIDevice) - err := b.DecodeMessage(msg) - m.Resource = &ModifyResourceRequest_WindowsDevice{msg} - return true, err - default: - return false, nil - } -} - -func _ModifyResourceRequest_OneofSizer(msg proto.Message) (n int) { - m := msg.(*ModifyResourceRequest) - // resource - switch x := m.Resource.(type) { - case *ModifyResourceRequest_Processor: - s := proto.Size(x.Processor) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *ModifyResourceRequest_ProcessorConfig: - s := proto.Size(x.ProcessorConfig) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *ModifyResourceRequest_Memory: - s := proto.Size(x.Memory) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *ModifyResourceRequest_ScsiDisk: - s := proto.Size(x.ScsiDisk) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *ModifyResourceRequest_VpmemDisk: - s := proto.Size(x.VpmemDisk) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *ModifyResourceRequest_NicConfig: - s := proto.Size(x.NicConfig) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *ModifyResourceRequest_WindowsDevice: - s := proto.Size(x.WindowsDevice) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - func init() { proto.RegisterEnum("vmservice.ModifyType", ModifyType_name, ModifyType_value) proto.RegisterEnum("vmservice.DiskType", DiskType_name, DiskType_value) @@ -2058,7 +1771,7 @@ var fileDescriptor_272f12cfdaa6c7c8 = []byte{ func (m *DirectBoot) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2066,38 +1779,47 @@ func (m *DirectBoot) Marshal() (dAtA []byte, err error) { } func (m *DirectBoot) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DirectBoot) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.KernelPath) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.KernelPath))) - i += copy(dAtA[i:], m.KernelPath) - } - if len(m.InitrdPath) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.InitrdPath))) - i += copy(dAtA[i:], m.InitrdPath) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.KernelCmdline) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.KernelCmdline) + copy(dAtA[i:], m.KernelCmdline) i = encodeVarintVmservice(dAtA, i, uint64(len(m.KernelCmdline))) - i += copy(dAtA[i:], m.KernelCmdline) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.InitrdPath) > 0 { + i -= len(m.InitrdPath) + copy(dAtA[i:], m.InitrdPath) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.InitrdPath))) + i-- + dAtA[i] = 0x12 + } + if len(m.KernelPath) > 0 { + i -= len(m.KernelPath) + copy(dAtA[i:], m.KernelPath) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.KernelPath))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *UEFI) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2105,38 +1827,47 @@ func (m *UEFI) Marshal() (dAtA []byte, err error) { } func (m *UEFI) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *UEFI) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.FirmwarePath) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.FirmwarePath))) - i += copy(dAtA[i:], m.FirmwarePath) - } - if len(m.DevicePath) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.DevicePath))) - i += copy(dAtA[i:], m.DevicePath) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.OptionalData) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.OptionalData) + copy(dAtA[i:], m.OptionalData) i = encodeVarintVmservice(dAtA, i, uint64(len(m.OptionalData))) - i += copy(dAtA[i:], m.OptionalData) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.DevicePath) > 0 { + i -= len(m.DevicePath) + copy(dAtA[i:], m.DevicePath) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.DevicePath))) + i-- + dAtA[i] = 0x12 + } + if len(m.FirmwarePath) > 0 { + i -= len(m.FirmwarePath) + copy(dAtA[i:], m.FirmwarePath) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.FirmwarePath))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *MemoryConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2144,90 +1875,96 @@ func (m *MemoryConfig) Marshal() (dAtA []byte, err error) { } func (m *MemoryConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemoryConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.MemoryMb != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.MemoryMb)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.AllowOvercommit { - dAtA[i] = 0x10 - i++ - if m.AllowOvercommit { + if m.HighMmioGapInMb != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.HighMmioGapInMb)) + i-- + dAtA[i] = 0x48 + } + if m.HighMmioBaseInMb != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.HighMmioBaseInMb)) + i-- + dAtA[i] = 0x40 + } + if m.LowMmioGapInMb != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.LowMmioGapInMb)) + i-- + dAtA[i] = 0x38 + } + if m.ColdDiscardHint { + i-- + if m.ColdDiscardHint { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x30 } - if m.DeferredCommit { - dAtA[i] = 0x18 - i++ - if m.DeferredCommit { + if m.ColdHint { + i-- + if m.ColdHint { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x28 } if m.HotHint { - dAtA[i] = 0x20 - i++ + i-- if m.HotHint { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x20 } - if m.ColdHint { - dAtA[i] = 0x28 - i++ - if m.ColdHint { + if m.DeferredCommit { + i-- + if m.DeferredCommit { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } - if m.ColdDiscardHint { - dAtA[i] = 0x30 - i++ - if m.ColdDiscardHint { + if m.AllowOvercommit { + i-- + if m.AllowOvercommit { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if m.LowMmioGapInMb != 0 { - dAtA[i] = 0x38 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.LowMmioGapInMb)) - } - if m.HighMmioBaseInMb != 0 { - dAtA[i] = 0x40 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.HighMmioBaseInMb)) - } - if m.HighMmioGapInMb != 0 { - dAtA[i] = 0x48 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.HighMmioGapInMb)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.MemoryMb != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.MemoryMb)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *ProcessorConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2235,35 +1972,41 @@ func (m *ProcessorConfig) Marshal() (dAtA []byte, err error) { } func (m *ProcessorConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProcessorConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.ProcessorCount != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorCount)) - } - if m.ProcessorWeight != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorWeight)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.ProcessorLimit != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorLimit)) + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.ProcessorWeight != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorWeight)) + i-- + dAtA[i] = 0x10 + } + if m.ProcessorCount != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorCount)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *DevicesConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2271,68 +2014,82 @@ func (m *DevicesConfig) Marshal() (dAtA []byte, err error) { } func (m *DevicesConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DevicesConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ScsiDisks) > 0 { - for _, msg := range m.ScsiDisks { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.VpmemDisks) > 0 { - for _, msg := range m.VpmemDisks { - dAtA[i] = 0x12 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.WindowsDevice) > 0 { + for iNdEx := len(m.WindowsDevice) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.WindowsDevice[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x22 } } if len(m.NicConfig) > 0 { - for _, msg := range m.NicConfig { - dAtA[i] = 0x1a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.NicConfig) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.NicConfig[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x1a } } - if len(m.WindowsDevice) > 0 { - for _, msg := range m.WindowsDevice { - dAtA[i] = 0x22 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if len(m.VpmemDisks) > 0 { + for iNdEx := len(m.VpmemDisks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.VpmemDisks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x12 } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ScsiDisks) > 0 { + for iNdEx := len(m.ScsiDisks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ScsiDisks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *VMConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2340,122 +2097,156 @@ func (m *VMConfig) Marshal() (dAtA []byte, err error) { } func (m *VMConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VMConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.MemoryConfig != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.MemoryConfig.Size())) - n1, err := m.MemoryConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.ExtraData) > 0 { + for k := range m.ExtraData { + v := m.ExtraData[k] + baseI := i + i -= len(v) + copy(dAtA[i:], v) + i = encodeVarintVmservice(dAtA, i, uint64(len(v))) + i-- + dAtA[i] = 0x12 + i -= len(k) + copy(dAtA[i:], k) + i = encodeVarintVmservice(dAtA, i, uint64(len(k))) + i-- + dAtA[i] = 0xa + i = encodeVarintVmservice(dAtA, i, uint64(baseI-i)) + i-- + dAtA[i] = 0x42 } - i += n1 } - if m.ProcessorConfig != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorConfig.Size())) - n2, err := m.ProcessorConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.WindowsOptions != nil { + { + size, err := m.WindowsOptions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n2 + i-- + dAtA[i] = 0x3a } - if m.DevicesConfig != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.DevicesConfig.Size())) - n3, err := m.DevicesConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.BootConfig != nil { + { + size := m.BootConfig.Size() + i -= size + if _, err := m.BootConfig.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += n3 } if m.SerialConfig != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.SerialConfig.Size())) - n4, err := m.SerialConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.SerialConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n4 + i-- + dAtA[i] = 0x22 } - if m.BootConfig != nil { - nn5, err := m.BootConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.DevicesConfig != nil { + { + size, err := m.DevicesConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += nn5 + i-- + dAtA[i] = 0x1a } - if m.WindowsOptions != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.WindowsOptions.Size())) - n6, err := m.WindowsOptions.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + if m.ProcessorConfig != nil { + { + size, err := m.ProcessorConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0x12 } - if len(m.ExtraData) > 0 { - for k := range m.ExtraData { - dAtA[i] = 0x42 - i++ - v := m.ExtraData[k] - mapSize := 1 + len(k) + sovVmservice(uint64(len(k))) + 1 + len(v) + sovVmservice(uint64(len(v))) - i = encodeVarintVmservice(dAtA, i, uint64(mapSize)) - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(k))) - i += copy(dAtA[i:], k) - dAtA[i] = 0x12 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(v))) - i += copy(dAtA[i:], v) + if m.MemoryConfig != nil { + { + size, err := m.MemoryConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } + i-- + dAtA[i] = 0xa } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *VMConfig_DirectBoot) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VMConfig_DirectBoot) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.DirectBoot != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.DirectBoot.Size())) - n7, err := m.DirectBoot.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.DirectBoot.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n7 + i-- + dAtA[i] = 0x2a } - return i, nil + return len(dAtA) - i, nil } func (m *VMConfig_Uefi) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VMConfig_Uefi) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Uefi != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Uefi.Size())) - n8, err := m.Uefi.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Uefi.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n8 + i-- + dAtA[i] = 0x32 } - return i, nil + return len(dAtA) - i, nil } func (m *WindowsOptions) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2463,25 +2254,31 @@ func (m *WindowsOptions) Marshal() (dAtA []byte, err error) { } func (m *WindowsOptions) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WindowsOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.CpuGroupID != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintVmservice(dAtA, i, uint64(m.CpuGroupID)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *SerialConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2489,32 +2286,40 @@ func (m *SerialConfig) Marshal() (dAtA []byte, err error) { } func (m *SerialConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SerialConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Ports) > 0 { - for _, msg := range m.Ports { - dAtA[i] = 0x1a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Ports) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ports[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0x1a } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *SerialConfig_Config) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2522,31 +2327,38 @@ func (m *SerialConfig_Config) Marshal() (dAtA []byte, err error) { } func (m *SerialConfig_Config) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SerialConfig_Config) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Port != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Port)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.SocketPath) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.SocketPath) + copy(dAtA[i:], m.SocketPath) i = encodeVarintVmservice(dAtA, i, uint64(len(m.SocketPath))) - i += copy(dAtA[i:], m.SocketPath) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Port != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *CreateVMRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2554,36 +2366,45 @@ func (m *CreateVMRequest) Marshal() (dAtA []byte, err error) { } func (m *CreateVMRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateVMRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Config != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Config.Size())) - n9, err := m.Config.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n9 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.LogID) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.LogID) + copy(dAtA[i:], m.LogID) i = encodeVarintVmservice(dAtA, i, uint64(len(m.LogID))) - i += copy(dAtA[i:], m.LogID) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Config != nil { + { + size, err := m.Config.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *InspectVMRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2591,31 +2412,38 @@ func (m *InspectVMRequest) Marshal() (dAtA []byte, err error) { } func (m *InspectVMRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InspectVMRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Query) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.Query))) - i += copy(dAtA[i:], m.Query) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.RecursionLimit != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintVmservice(dAtA, i, uint64(m.RecursionLimit)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Query) > 0 { + i -= len(m.Query) + copy(dAtA[i:], m.Query) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.Query))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *InspectVMResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2623,30 +2451,38 @@ func (m *InspectVMResponse) Marshal() (dAtA []byte, err error) { } func (m *InspectVMResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *InspectVMResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Result != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Result.Size())) - n10, err := m.Result.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Result.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n10 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *MemoryStats) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2654,40 +2490,46 @@ func (m *MemoryStats) Marshal() (dAtA []byte, err error) { } func (m *MemoryStats) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MemoryStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.WorkingSetBytes != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.WorkingSetBytes)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.AvailableMemory != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.AvailableMemory)) + if m.AssignedMemory != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.AssignedMemory)) + i-- + dAtA[i] = 0x20 } if m.ReservedMemory != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintVmservice(dAtA, i, uint64(m.ReservedMemory)) + i-- + dAtA[i] = 0x18 } - if m.AssignedMemory != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.AssignedMemory)) + if m.AvailableMemory != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.AvailableMemory)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.WorkingSetBytes != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.WorkingSetBytes)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *ProcessorStats) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2695,25 +2537,31 @@ func (m *ProcessorStats) Marshal() (dAtA []byte, err error) { } func (m *ProcessorStats) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProcessorStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.TotalRuntimeNs != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintVmservice(dAtA, i, uint64(m.TotalRuntimeNs)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *PropertiesVMRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2721,37 +2569,44 @@ func (m *PropertiesVMRequest) Marshal() (dAtA []byte, err error) { } func (m *PropertiesVMRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PropertiesVMRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Types) > 0 { - dAtA12 := make([]byte, len(m.Types)*10) - var j11 int + dAtA11 := make([]byte, len(m.Types)*10) + var j10 int for _, num := range m.Types { for num >= 1<<7 { - dAtA12[j11] = uint8(uint64(num)&0x7f | 0x80) + dAtA11[j10] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j11++ + j10++ } - dAtA12[j11] = uint8(num) - j11++ + dAtA11[j10] = uint8(num) + j10++ } + i -= j10 + copy(dAtA[i:], dAtA11[:j10]) + i = encodeVarintVmservice(dAtA, i, uint64(j10)) + i-- dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(j11)) - i += copy(dAtA[i:], dAtA12[:j11]) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *PropertiesVMResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2759,40 +2614,50 @@ func (m *PropertiesVMResponse) Marshal() (dAtA []byte, err error) { } func (m *PropertiesVMResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PropertiesVMResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.MemoryStats != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.MemoryStats.Size())) - n13, err := m.MemoryStats.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n13 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.ProcessorStats != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorStats.Size())) - n14, err := m.ProcessorStats.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.ProcessorStats.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n14 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.MemoryStats != nil { + { + size, err := m.MemoryStats.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CapabilitiesVMResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2800,49 +2665,58 @@ func (m *CapabilitiesVMResponse) Marshal() (dAtA []byte, err error) { } func (m *CapabilitiesVMResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CapabilitiesVMResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.SupportedResources) > 0 { - for _, msg := range m.SupportedResources { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.SupportedGuestOs) > 0 { - dAtA16 := make([]byte, len(m.SupportedGuestOs)*10) - var j15 int + dAtA15 := make([]byte, len(m.SupportedGuestOs)*10) + var j14 int for _, num := range m.SupportedGuestOs { for num >= 1<<7 { - dAtA16[j15] = uint8(uint64(num)&0x7f | 0x80) + dAtA15[j14] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j15++ + j14++ } - dAtA16[j15] = uint8(num) - j15++ + dAtA15[j14] = uint8(num) + j14++ } + i -= j14 + copy(dAtA[i:], dAtA15[:j14]) + i = encodeVarintVmservice(dAtA, i, uint64(j14)) + i-- dAtA[i] = 0x12 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(j15)) - i += copy(dAtA[i:], dAtA16[:j15]) } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.SupportedResources) > 0 { + for iNdEx := len(m.SupportedResources) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SupportedResources[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } } - return i, nil + return len(dAtA) - i, nil } func (m *CapabilitiesVMResponse_SupportedResource) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2850,55 +2724,61 @@ func (m *CapabilitiesVMResponse_SupportedResource) Marshal() (dAtA []byte, err e } func (m *CapabilitiesVMResponse_SupportedResource) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CapabilitiesVMResponse_SupportedResource) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Add { - dAtA[i] = 0x8 - i++ - if m.Add { + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if m.Resource != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.Resource)) + i-- + dAtA[i] = 0x20 + } + if m.Update { + i-- + if m.Update { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 } if m.Remove { - dAtA[i] = 0x10 - i++ + i-- if m.Remove { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x10 } - if m.Update { - dAtA[i] = 0x18 - i++ - if m.Update { + if m.Add { + i-- + if m.Add { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if m.Resource != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Resource)) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *HVSocketListen) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2906,32 +2786,40 @@ func (m *HVSocketListen) Marshal() (dAtA []byte, err error) { } func (m *HVSocketListen) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HVSocketListen) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServiceID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.ServiceID))) - i += copy(dAtA[i:], m.ServiceID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.ListenerPath) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.ListenerPath) + copy(dAtA[i:], m.ListenerPath) i = encodeVarintVmservice(dAtA, i, uint64(len(m.ListenerPath))) - i += copy(dAtA[i:], m.ListenerPath) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ServiceID) > 0 { + i -= len(m.ServiceID) + copy(dAtA[i:], m.ServiceID) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.ServiceID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *VSockListen) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2939,31 +2827,38 @@ func (m *VSockListen) Marshal() (dAtA []byte, err error) { } func (m *VSockListen) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VSockListen) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Port != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Port)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.ListenerPath) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.ListenerPath) + copy(dAtA[i:], m.ListenerPath) i = encodeVarintVmservice(dAtA, i, uint64(len(m.ListenerPath))) - i += copy(dAtA[i:], m.ListenerPath) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Port != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.Port)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *VMSocketRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2971,60 +2866,82 @@ func (m *VMSocketRequest) Marshal() (dAtA []byte, err error) { } func (m *VMSocketRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VMSocketRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Type != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Type)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Config != nil { - nn17, err := m.Config.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Config.Size() + i -= size + if _, err := m.Config.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn17 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Type != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *VMSocketRequest_HvsocketList) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VMSocketRequest_HvsocketList) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.HvsocketList != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.HvsocketList.Size())) - n18, err := m.HvsocketList.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.HvsocketList.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n18 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *VMSocketRequest_VsockListen) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VMSocketRequest_VsockListen) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.VsockListen != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.VsockListen.Size())) - n19, err := m.VsockListen.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.VsockListen.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n19 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *SCSIDisk) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3032,51 +2949,58 @@ func (m *SCSIDisk) Marshal() (dAtA []byte, err error) { } func (m *SCSIDisk) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SCSIDisk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Controller != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Controller)) - } - if m.Lun != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Lun)) - } - if len(m.HostPath) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.HostPath))) - i += copy(dAtA[i:], m.HostPath) - } - if m.Type != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Type)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.ReadOnly { - dAtA[i] = 0x28 - i++ + i-- if m.ReadOnly { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x28 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Type != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x20 + } + if len(m.HostPath) > 0 { + i -= len(m.HostPath) + copy(dAtA[i:], m.HostPath) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.HostPath))) + i-- + dAtA[i] = 0x1a + } + if m.Lun != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.Lun)) + i-- + dAtA[i] = 0x10 + } + if m.Controller != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.Controller)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *VPMEMDisk) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3084,41 +3008,48 @@ func (m *VPMEMDisk) Marshal() (dAtA []byte, err error) { } func (m *VPMEMDisk) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *VPMEMDisk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.HostPath) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.HostPath))) - i += copy(dAtA[i:], m.HostPath) - } - if m.Type != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Type)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.ReadOnly { - dAtA[i] = 0x18 - i++ + i-- if m.ReadOnly { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ + i-- + dAtA[i] = 0x18 + } + if m.Type != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.HostPath) > 0 { + i -= len(m.HostPath) + copy(dAtA[i:], m.HostPath) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.HostPath))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *NICConfig) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3126,50 +3057,61 @@ func (m *NICConfig) Marshal() (dAtA []byte, err error) { } func (m *NICConfig) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NICConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.NicID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.NicID))) - i += copy(dAtA[i:], m.NicID) - } - if len(m.PortID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.PortID))) - i += copy(dAtA[i:], m.PortID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.MacAddress) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.MacAddress))) - i += copy(dAtA[i:], m.MacAddress) + if len(m.NicName) > 0 { + i -= len(m.NicName) + copy(dAtA[i:], m.NicName) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.NicName))) + i-- + dAtA[i] = 0x2a } if len(m.SwitchID) > 0 { - dAtA[i] = 0x22 - i++ + i -= len(m.SwitchID) + copy(dAtA[i:], m.SwitchID) i = encodeVarintVmservice(dAtA, i, uint64(len(m.SwitchID))) - i += copy(dAtA[i:], m.SwitchID) + i-- + dAtA[i] = 0x22 } - if len(m.NicName) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(len(m.NicName))) - i += copy(dAtA[i:], m.NicName) + if len(m.MacAddress) > 0 { + i -= len(m.MacAddress) + copy(dAtA[i:], m.MacAddress) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.MacAddress))) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.PortID) > 0 { + i -= len(m.PortID) + copy(dAtA[i:], m.PortID) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.PortID))) + i-- + dAtA[i] = 0x12 + } + if len(m.NicID) > 0 { + i -= len(m.NicID) + copy(dAtA[i:], m.NicID) + i = encodeVarintVmservice(dAtA, i, uint64(len(m.NicID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *WindowsPCIDevice) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3177,26 +3119,33 @@ func (m *WindowsPCIDevice) Marshal() (dAtA []byte, err error) { } func (m *WindowsPCIDevice) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *WindowsPCIDevice) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.InstanceID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.InstanceID) + copy(dAtA[i:], m.InstanceID) i = encodeVarintVmservice(dAtA, i, uint64(len(m.InstanceID))) - i += copy(dAtA[i:], m.InstanceID) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyMemoryRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3204,25 +3153,31 @@ func (m *ModifyMemoryRequest) Marshal() (dAtA []byte, err error) { } func (m *ModifyMemoryRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyMemoryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.MemoryMb != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintVmservice(dAtA, i, uint64(m.MemoryMb)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyProcessorRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3230,25 +3185,31 @@ func (m *ModifyProcessorRequest) Marshal() (dAtA []byte, err error) { } func (m *ModifyProcessorRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyProcessorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.ProcessorIndex != 0 { - dAtA[i] = 0x8 - i++ i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorIndex)) + i-- + dAtA[i] = 0x8 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyProcessorConfigRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3256,30 +3217,36 @@ func (m *ModifyProcessorConfigRequest) Marshal() (dAtA []byte, err error) { } func (m *ModifyProcessorConfigRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyProcessorConfigRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.ProcessorWeight != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorWeight)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.ProcessorLimit != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorLimit)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.ProcessorWeight != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorWeight)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyResourceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3287,134 +3254,193 @@ func (m *ModifyResourceRequest) Marshal() (dAtA []byte, err error) { } func (m *ModifyResourceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyResourceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.Type != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Type)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Resource != nil { - nn20, err := m.Resource.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Resource.Size() + i -= size + if _, err := m.Resource.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn20 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.Type != 0 { + i = encodeVarintVmservice(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyResourceRequest_Processor) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyResourceRequest_Processor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Processor != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Processor.Size())) - n21, err := m.Processor.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Processor.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n21 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyResourceRequest_ProcessorConfig) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyResourceRequest_ProcessorConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.ProcessorConfig != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.ProcessorConfig.Size())) - n22, err := m.ProcessorConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.ProcessorConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n22 + i-- + dAtA[i] = 0x1a } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyResourceRequest_Memory) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyResourceRequest_Memory) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.Memory != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.Memory.Size())) - n23, err := m.Memory.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Memory.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n23 + i-- + dAtA[i] = 0x22 } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyResourceRequest_ScsiDisk) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyResourceRequest_ScsiDisk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.ScsiDisk != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.ScsiDisk.Size())) - n24, err := m.ScsiDisk.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.ScsiDisk.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n24 + i-- + dAtA[i] = 0x2a } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyResourceRequest_VpmemDisk) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyResourceRequest_VpmemDisk) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.VpmemDisk != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.VpmemDisk.Size())) - n25, err := m.VpmemDisk.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.VpmemDisk.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n25 + i-- + dAtA[i] = 0x32 } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyResourceRequest_NicConfig) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyResourceRequest_NicConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.NicConfig != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.NicConfig.Size())) - n26, err := m.NicConfig.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.NicConfig.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n26 + i-- + dAtA[i] = 0x3a } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyResourceRequest_WindowsDevice) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyResourceRequest_WindowsDevice) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.WindowsDevice != nil { - dAtA[i] = 0x42 - i++ - i = encodeVarintVmservice(dAtA, i, uint64(m.WindowsDevice.Size())) - n27, err := m.WindowsDevice.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.WindowsDevice.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintVmservice(dAtA, i, uint64(size)) } - i += n27 + i-- + dAtA[i] = 0x42 } - return i, nil + return len(dAtA) - i, nil } func encodeVarintVmservice(dAtA []byte, offset int, v uint64) int { + offset -= sovVmservice(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *DirectBoot) Size() (n int) { if m == nil { @@ -4192,14 +4218,7 @@ func (m *ModifyResourceRequest_WindowsDevice) Size() (n int) { } func sovVmservice(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozVmservice(x uint64) (n int) { return sovVmservice(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -4266,11 +4285,31 @@ func (this *DevicesConfig) String() string { if this == nil { return "nil" } + repeatedStringForScsiDisks := "[]*SCSIDisk{" + for _, f := range this.ScsiDisks { + repeatedStringForScsiDisks += strings.Replace(f.String(), "SCSIDisk", "SCSIDisk", 1) + "," + } + repeatedStringForScsiDisks += "}" + repeatedStringForVpmemDisks := "[]*VPMEMDisk{" + for _, f := range this.VpmemDisks { + repeatedStringForVpmemDisks += strings.Replace(f.String(), "VPMEMDisk", "VPMEMDisk", 1) + "," + } + repeatedStringForVpmemDisks += "}" + repeatedStringForNicConfig := "[]*NICConfig{" + for _, f := range this.NicConfig { + repeatedStringForNicConfig += strings.Replace(f.String(), "NICConfig", "NICConfig", 1) + "," + } + repeatedStringForNicConfig += "}" + repeatedStringForWindowsDevice := "[]*WindowsPCIDevice{" + for _, f := range this.WindowsDevice { + repeatedStringForWindowsDevice += strings.Replace(f.String(), "WindowsPCIDevice", "WindowsPCIDevice", 1) + "," + } + repeatedStringForWindowsDevice += "}" s := strings.Join([]string{`&DevicesConfig{`, - `ScsiDisks:` + strings.Replace(fmt.Sprintf("%v", this.ScsiDisks), "SCSIDisk", "SCSIDisk", 1) + `,`, - `VpmemDisks:` + strings.Replace(fmt.Sprintf("%v", this.VpmemDisks), "VPMEMDisk", "VPMEMDisk", 1) + `,`, - `NicConfig:` + strings.Replace(fmt.Sprintf("%v", this.NicConfig), "NICConfig", "NICConfig", 1) + `,`, - `WindowsDevice:` + strings.Replace(fmt.Sprintf("%v", this.WindowsDevice), "WindowsPCIDevice", "WindowsPCIDevice", 1) + `,`, + `ScsiDisks:` + repeatedStringForScsiDisks + `,`, + `VpmemDisks:` + repeatedStringForVpmemDisks + `,`, + `NicConfig:` + repeatedStringForNicConfig + `,`, + `WindowsDevice:` + repeatedStringForWindowsDevice + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4281,7 +4320,7 @@ func (this *VMConfig) String() string { return "nil" } keysForExtraData := make([]string, 0, len(this.ExtraData)) - for k := range this.ExtraData { + for k, _ := range this.ExtraData { keysForExtraData = append(keysForExtraData, k) } github_com_gogo_protobuf_sortkeys.Strings(keysForExtraData) @@ -4291,12 +4330,12 @@ func (this *VMConfig) String() string { } mapStringForExtraData += "}" s := strings.Join([]string{`&VMConfig{`, - `MemoryConfig:` + strings.Replace(fmt.Sprintf("%v", this.MemoryConfig), "MemoryConfig", "MemoryConfig", 1) + `,`, - `ProcessorConfig:` + strings.Replace(fmt.Sprintf("%v", this.ProcessorConfig), "ProcessorConfig", "ProcessorConfig", 1) + `,`, - `DevicesConfig:` + strings.Replace(fmt.Sprintf("%v", this.DevicesConfig), "DevicesConfig", "DevicesConfig", 1) + `,`, - `SerialConfig:` + strings.Replace(fmt.Sprintf("%v", this.SerialConfig), "SerialConfig", "SerialConfig", 1) + `,`, + `MemoryConfig:` + strings.Replace(this.MemoryConfig.String(), "MemoryConfig", "MemoryConfig", 1) + `,`, + `ProcessorConfig:` + strings.Replace(this.ProcessorConfig.String(), "ProcessorConfig", "ProcessorConfig", 1) + `,`, + `DevicesConfig:` + strings.Replace(this.DevicesConfig.String(), "DevicesConfig", "DevicesConfig", 1) + `,`, + `SerialConfig:` + strings.Replace(this.SerialConfig.String(), "SerialConfig", "SerialConfig", 1) + `,`, `BootConfig:` + fmt.Sprintf("%v", this.BootConfig) + `,`, - `WindowsOptions:` + strings.Replace(fmt.Sprintf("%v", this.WindowsOptions), "WindowsOptions", "WindowsOptions", 1) + `,`, + `WindowsOptions:` + strings.Replace(this.WindowsOptions.String(), "WindowsOptions", "WindowsOptions", 1) + `,`, `ExtraData:` + mapStringForExtraData + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, @@ -4338,8 +4377,13 @@ func (this *SerialConfig) String() string { if this == nil { return "nil" } + repeatedStringForPorts := "[]*SerialConfig_Config{" + for _, f := range this.Ports { + repeatedStringForPorts += strings.Replace(fmt.Sprintf("%v", f), "SerialConfig_Config", "SerialConfig_Config", 1) + "," + } + repeatedStringForPorts += "}" s := strings.Join([]string{`&SerialConfig{`, - `Ports:` + strings.Replace(fmt.Sprintf("%v", this.Ports), "SerialConfig_Config", "SerialConfig_Config", 1) + `,`, + `Ports:` + repeatedStringForPorts + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4362,7 +4406,7 @@ func (this *CreateVMRequest) String() string { return "nil" } s := strings.Join([]string{`&CreateVMRequest{`, - `Config:` + strings.Replace(fmt.Sprintf("%v", this.Config), "VMConfig", "VMConfig", 1) + `,`, + `Config:` + strings.Replace(this.Config.String(), "VMConfig", "VMConfig", 1) + `,`, `LogID:` + fmt.Sprintf("%v", this.LogID) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, @@ -4433,8 +4477,8 @@ func (this *PropertiesVMResponse) String() string { return "nil" } s := strings.Join([]string{`&PropertiesVMResponse{`, - `MemoryStats:` + strings.Replace(fmt.Sprintf("%v", this.MemoryStats), "MemoryStats", "MemoryStats", 1) + `,`, - `ProcessorStats:` + strings.Replace(fmt.Sprintf("%v", this.ProcessorStats), "ProcessorStats", "ProcessorStats", 1) + `,`, + `MemoryStats:` + strings.Replace(this.MemoryStats.String(), "MemoryStats", "MemoryStats", 1) + `,`, + `ProcessorStats:` + strings.Replace(this.ProcessorStats.String(), "ProcessorStats", "ProcessorStats", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4444,8 +4488,13 @@ func (this *CapabilitiesVMResponse) String() string { if this == nil { return "nil" } + repeatedStringForSupportedResources := "[]*CapabilitiesVMResponse_SupportedResource{" + for _, f := range this.SupportedResources { + repeatedStringForSupportedResources += strings.Replace(fmt.Sprintf("%v", f), "CapabilitiesVMResponse_SupportedResource", "CapabilitiesVMResponse_SupportedResource", 1) + "," + } + repeatedStringForSupportedResources += "}" s := strings.Join([]string{`&CapabilitiesVMResponse{`, - `SupportedResources:` + strings.Replace(fmt.Sprintf("%v", this.SupportedResources), "CapabilitiesVMResponse_SupportedResource", "CapabilitiesVMResponse_SupportedResource", 1) + `,`, + `SupportedResources:` + repeatedStringForSupportedResources + `,`, `SupportedGuestOs:` + fmt.Sprintf("%v", this.SupportedGuestOs) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, @@ -5025,10 +5074,7 @@ func (m *DirectBoot) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -5175,10 +5221,7 @@ func (m *UEFI) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -5405,10 +5448,7 @@ func (m *MemoryConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -5516,10 +5556,7 @@ func (m *ProcessorConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -5706,10 +5743,7 @@ func (m *DevicesConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -6120,7 +6154,7 @@ func (m *VMConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > postIndex { @@ -6137,10 +6171,7 @@ func (m *VMConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -6210,10 +6241,7 @@ func (m *WindowsOptions) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -6298,10 +6326,7 @@ func (m *SerialConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -6403,10 +6428,7 @@ func (m *SerialConfig_Config) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -6525,10 +6547,7 @@ func (m *CreateVMRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -6630,10 +6649,7 @@ func (m *InspectVMRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -6720,10 +6736,7 @@ func (m *InspectVMResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -6850,10 +6863,7 @@ func (m *MemoryStats) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -6923,10 +6933,7 @@ func (m *ProcessorStats) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -7046,10 +7053,7 @@ func (m *PropertiesVMRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -7172,10 +7176,7 @@ func (m *PropertiesVMResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -7329,10 +7330,7 @@ func (m *CapabilitiesVMResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -7462,10 +7460,7 @@ func (m *CapabilitiesVMResponse_SupportedResource) Unmarshal(dAtA []byte) error if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -7580,10 +7575,7 @@ func (m *HVSocketListen) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -7685,10 +7677,7 @@ func (m *VSockListen) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -7828,10 +7817,7 @@ func (m *VMSocketRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -7991,10 +7977,7 @@ func (m *SCSIDisk) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -8116,10 +8099,7 @@ func (m *VPMEMDisk) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -8330,10 +8310,7 @@ func (m *NICConfig) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -8416,10 +8393,7 @@ func (m *WindowsPCIDevice) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -8489,10 +8463,7 @@ func (m *ModifyMemoryRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -8562,10 +8533,7 @@ func (m *ModifyProcessorRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -8654,10 +8622,7 @@ func (m *ModifyProcessorConfigRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -8972,10 +8937,7 @@ func (m *ModifyResourceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthVmservice - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthVmservice } if (iNdEx + skippy) > l { @@ -8994,6 +8956,7 @@ func (m *ModifyResourceRequest) Unmarshal(dAtA []byte) error { func skipVmservice(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -9025,10 +8988,8 @@ func skipVmservice(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -9049,55 +9010,30 @@ func skipVmservice(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthVmservice } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthVmservice - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowVmservice - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipVmservice(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthVmservice - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupVmservice + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthVmservice + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthVmservice = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowVmservice = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthVmservice = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowVmservice = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupVmservice = fmt.Errorf("proto: unexpected end of group") ) diff --git a/pkg/ncproxy/ncproxygrpc/v1/networkconfigproxy.pb.go b/pkg/ncproxy/ncproxygrpc/v1/networkconfigproxy.pb.go index 6343596af3..c80b299e20 100644 --- a/pkg/ncproxy/ncproxygrpc/v1/networkconfigproxy.pb.go +++ b/pkg/ncproxy/ncproxygrpc/v1/networkconfigproxy.pb.go @@ -8,8 +8,11 @@ import ( fmt "fmt" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -23,7 +26,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type HostComputeNetworkSettings_NetworkMode int32 @@ -98,7 +101,7 @@ func (m *AddNICRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error return xxx_messageInfo_AddNICRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -136,7 +139,7 @@ func (m *AddNICResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return xxx_messageInfo_AddNICResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -178,7 +181,7 @@ func (m *ModifyNICRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_ModifyNICRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -216,7 +219,7 @@ func (m *ModifyNICResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_ModifyNICResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -257,7 +260,7 @@ func (m *DeleteNICRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_DeleteNICRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -295,7 +298,7 @@ func (m *DeleteNICResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_DeleteNICResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -334,7 +337,7 @@ func (m *CreateNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_CreateNetworkRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -376,7 +379,7 @@ func (m *Network) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_Network.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -402,10 +405,10 @@ type isNetwork_Settings interface { } type Network_HcnNetwork struct { - HcnNetwork *HostComputeNetworkSettings `protobuf:"bytes,1,opt,name=hcn_network,json=hcnNetwork,proto3,oneof"` + HcnNetwork *HostComputeNetworkSettings `protobuf:"bytes,1,opt,name=hcn_network,json=hcnNetwork,proto3,oneof" json:"hcn_network,omitempty"` } type Network_NcproxyNetwork struct { - NcproxyNetwork *NCProxyNetworkSettings `protobuf:"bytes,2,opt,name=ncproxy_network,json=ncproxyNetwork,proto3,oneof"` + NcproxyNetwork *NCProxyNetworkSettings `protobuf:"bytes,2,opt,name=ncproxy_network,json=ncproxyNetwork,proto3,oneof" json:"ncproxy_network,omitempty"` } func (*Network_HcnNetwork) isNetwork_Settings() {} @@ -432,80 +435,14 @@ func (m *Network) GetNcproxyNetwork() *NCProxyNetworkSettings { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*Network) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _Network_OneofMarshaler, _Network_OneofUnmarshaler, _Network_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*Network) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*Network_HcnNetwork)(nil), (*Network_NcproxyNetwork)(nil), } } -func _Network_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*Network) - // settings - switch x := m.Settings.(type) { - case *Network_HcnNetwork: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.HcnNetwork); err != nil { - return err - } - case *Network_NcproxyNetwork: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.NcproxyNetwork); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("Network.Settings has unexpected type %T", x) - } - return nil -} - -func _Network_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*Network) - switch tag { - case 1: // settings.hcn_network - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(HostComputeNetworkSettings) - err := b.DecodeMessage(msg) - m.Settings = &Network_HcnNetwork{msg} - return true, err - case 2: // settings.ncproxy_network - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(NCProxyNetworkSettings) - err := b.DecodeMessage(msg) - m.Settings = &Network_NcproxyNetwork{msg} - return true, err - default: - return false, nil - } -} - -func _Network_OneofSizer(msg proto.Message) (n int) { - m := msg.(*Network) - // settings - switch x := m.Settings.(type) { - case *Network_HcnNetwork: - s := proto.Size(x.HcnNetwork) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *Network_NcproxyNetwork: - s := proto.Size(x.NcproxyNetwork) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type NCProxyNetworkSettings struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` @@ -526,7 +463,7 @@ func (m *NCProxyNetworkSettings) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_NCProxyNetworkSettings.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -570,7 +507,7 @@ func (m *HostComputeNetworkSettings) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_HostComputeNetworkSettings.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -609,7 +546,7 @@ func (m *CreateNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_CreateNetworkResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -648,7 +585,7 @@ func (m *PortNameEndpointPolicySetting) XXX_Marshal(b []byte, deterministic bool return xxx_messageInfo_PortNameEndpointPolicySetting.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -689,7 +626,7 @@ func (m *IovEndpointPolicySetting) XXX_Marshal(b []byte, deterministic bool) ([] return xxx_messageInfo_IovEndpointPolicySetting.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -730,7 +667,7 @@ func (m *DnsSetting) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return xxx_messageInfo_DnsSetting.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -769,7 +706,7 @@ func (m *CreateEndpointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_CreateEndpointRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -811,7 +748,7 @@ func (m *EndpointSettings) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_EndpointSettings.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -837,10 +774,10 @@ type isEndpointSettings_Settings interface { } type EndpointSettings_HcnEndpoint struct { - HcnEndpoint *HcnEndpointSettings `protobuf:"bytes,1,opt,name=hcn_endpoint,json=hcnEndpoint,proto3,oneof"` + HcnEndpoint *HcnEndpointSettings `protobuf:"bytes,1,opt,name=hcn_endpoint,json=hcnEndpoint,proto3,oneof" json:"hcn_endpoint,omitempty"` } type EndpointSettings_NcproxyEndpoint struct { - NcproxyEndpoint *NCProxyEndpointSettings `protobuf:"bytes,2,opt,name=ncproxy_endpoint,json=ncproxyEndpoint,proto3,oneof"` + NcproxyEndpoint *NCProxyEndpointSettings `protobuf:"bytes,2,opt,name=ncproxy_endpoint,json=ncproxyEndpoint,proto3,oneof" json:"ncproxy_endpoint,omitempty"` } func (*EndpointSettings_HcnEndpoint) isEndpointSettings_Settings() {} @@ -867,80 +804,14 @@ func (m *EndpointSettings) GetNcproxyEndpoint() *NCProxyEndpointSettings { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*EndpointSettings) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _EndpointSettings_OneofMarshaler, _EndpointSettings_OneofUnmarshaler, _EndpointSettings_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*EndpointSettings) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*EndpointSettings_HcnEndpoint)(nil), (*EndpointSettings_NcproxyEndpoint)(nil), } } -func _EndpointSettings_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*EndpointSettings) - // settings - switch x := m.Settings.(type) { - case *EndpointSettings_HcnEndpoint: - _ = b.EncodeVarint(1<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.HcnEndpoint); err != nil { - return err - } - case *EndpointSettings_NcproxyEndpoint: - _ = b.EncodeVarint(2<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.NcproxyEndpoint); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("EndpointSettings.Settings has unexpected type %T", x) - } - return nil -} - -func _EndpointSettings_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*EndpointSettings) - switch tag { - case 1: // settings.hcn_endpoint - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(HcnEndpointSettings) - err := b.DecodeMessage(msg) - m.Settings = &EndpointSettings_HcnEndpoint{msg} - return true, err - case 2: // settings.ncproxy_endpoint - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(NCProxyEndpointSettings) - err := b.DecodeMessage(msg) - m.Settings = &EndpointSettings_NcproxyEndpoint{msg} - return true, err - default: - return false, nil - } -} - -func _EndpointSettings_OneofSizer(msg proto.Message) (n int) { - m := msg.(*EndpointSettings) - // settings - switch x := m.Settings.(type) { - case *EndpointSettings_HcnEndpoint: - s := proto.Size(x.HcnEndpoint) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case *EndpointSettings_NcproxyEndpoint: - s := proto.Size(x.NcproxyEndpoint) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type HcnEndpointResponse struct { Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` ID string `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"` @@ -963,7 +834,7 @@ func (m *HcnEndpointResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_HcnEndpointResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1008,7 +879,7 @@ func (m *HcnEndpointSettings) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_HcnEndpointSettings.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1048,7 +919,7 @@ func (m *HcnEndpointPolicies) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_HcnEndpointPolicies.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1095,7 +966,7 @@ func (m *NCProxyEndpointSettings) XXX_Marshal(b []byte, deterministic bool) ([]b return xxx_messageInfo_NCProxyEndpointSettings.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1121,7 +992,7 @@ type isNCProxyEndpointSettings_DeviceDetails interface { } type NCProxyEndpointSettings_PciDeviceDetails struct { - PciDeviceDetails *PCIDeviceDetails `protobuf:"bytes,7,opt,name=pci_device_details,json=pciDeviceDetails,proto3,oneof"` + PciDeviceDetails *PCIDeviceDetails `protobuf:"bytes,7,opt,name=pci_device_details,json=pciDeviceDetails,proto3,oneof" json:"pci_device_details,omitempty"` } func (*NCProxyEndpointSettings_PciDeviceDetails) isNCProxyEndpointSettings_DeviceDetails() {} @@ -1140,61 +1011,13 @@ func (m *NCProxyEndpointSettings) GetPciDeviceDetails() *PCIDeviceDetails { return nil } -// XXX_OneofFuncs is for the internal use of the proto package. -func (*NCProxyEndpointSettings) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{}) { - return _NCProxyEndpointSettings_OneofMarshaler, _NCProxyEndpointSettings_OneofUnmarshaler, _NCProxyEndpointSettings_OneofSizer, []interface{}{ +// XXX_OneofWrappers is for the internal use of the proto package. +func (*NCProxyEndpointSettings) XXX_OneofWrappers() []interface{} { + return []interface{}{ (*NCProxyEndpointSettings_PciDeviceDetails)(nil), } } -func _NCProxyEndpointSettings_OneofMarshaler(msg proto.Message, b *proto.Buffer) error { - m := msg.(*NCProxyEndpointSettings) - // device_details - switch x := m.DeviceDetails.(type) { - case *NCProxyEndpointSettings_PciDeviceDetails: - _ = b.EncodeVarint(7<<3 | proto.WireBytes) - if err := b.EncodeMessage(x.PciDeviceDetails); err != nil { - return err - } - case nil: - default: - return fmt.Errorf("NCProxyEndpointSettings.DeviceDetails has unexpected type %T", x) - } - return nil -} - -func _NCProxyEndpointSettings_OneofUnmarshaler(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error) { - m := msg.(*NCProxyEndpointSettings) - switch tag { - case 7: // device_details.pci_device_details - if wire != proto.WireBytes { - return true, proto.ErrInternalBadWireType - } - msg := new(PCIDeviceDetails) - err := b.DecodeMessage(msg) - m.DeviceDetails = &NCProxyEndpointSettings_PciDeviceDetails{msg} - return true, err - default: - return false, nil - } -} - -func _NCProxyEndpointSettings_OneofSizer(msg proto.Message) (n int) { - m := msg.(*NCProxyEndpointSettings) - // device_details - switch x := m.DeviceDetails.(type) { - case *NCProxyEndpointSettings_PciDeviceDetails: - s := proto.Size(x.PciDeviceDetails) - n += 1 // tag and wire - n += proto.SizeVarint(uint64(s)) - n += s - case nil: - default: - panic(fmt.Sprintf("proto: unexpected type %T in oneof", x)) - } - return n -} - type PCIDeviceDetails struct { DeviceID string `protobuf:"bytes,1,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"` VirtualFunctionIndex uint32 `protobuf:"varint,2,opt,name=virtual_function_index,json=virtualFunctionIndex,proto3" json:"virtual_function_index,omitempty"` @@ -1216,7 +1039,7 @@ func (m *PCIDeviceDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, er return xxx_messageInfo_PCIDeviceDetails.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1255,7 +1078,7 @@ func (m *CreateEndpointResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_CreateEndpointResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1295,7 +1118,7 @@ func (m *AddEndpointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_AddEndpointRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1333,7 +1156,7 @@ func (m *AddEndpointResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_AddEndpointResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1372,7 +1195,7 @@ func (m *DeleteEndpointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_DeleteEndpointRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1410,7 +1233,7 @@ func (m *DeleteEndpointResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return xxx_messageInfo_DeleteEndpointResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1449,7 +1272,7 @@ func (m *DeleteNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_DeleteNetworkRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1487,7 +1310,7 @@ func (m *DeleteNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byt return xxx_messageInfo_DeleteNetworkResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1526,7 +1349,7 @@ func (m *GetEndpointRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetEndpointRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1567,7 +1390,7 @@ func (m *GetEndpointResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetEndpointResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1606,7 +1429,7 @@ func (m *GetNetworkRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return xxx_messageInfo_GetNetworkRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1646,7 +1469,7 @@ func (m *GetNetworkResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetNetworkResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1684,7 +1507,7 @@ func (m *GetEndpointsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetEndpointsRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1723,7 +1546,7 @@ func (m *GetEndpointsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte return xxx_messageInfo_GetEndpointsResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1761,7 +1584,7 @@ func (m *GetNetworksRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetNetworksRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -1800,7 +1623,7 @@ func (m *GetNetworksResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_GetNetworksResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -2127,6 +1950,47 @@ type NetworkConfigProxyServer interface { GetNetworks(context.Context, *GetNetworksRequest) (*GetNetworksResponse, error) } +// UnimplementedNetworkConfigProxyServer can be embedded to have forward compatible implementations. +type UnimplementedNetworkConfigProxyServer struct { +} + +func (*UnimplementedNetworkConfigProxyServer) AddNIC(ctx context.Context, req *AddNICRequest) (*AddNICResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddNIC not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) ModifyNIC(ctx context.Context, req *ModifyNICRequest) (*ModifyNICResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ModifyNIC not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) DeleteNIC(ctx context.Context, req *DeleteNICRequest) (*DeleteNICResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteNIC not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) CreateNetwork(ctx context.Context, req *CreateNetworkRequest) (*CreateNetworkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateNetwork not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) CreateEndpoint(ctx context.Context, req *CreateEndpointRequest) (*CreateEndpointResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateEndpoint not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) AddEndpoint(ctx context.Context, req *AddEndpointRequest) (*AddEndpointResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddEndpoint not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) DeleteEndpoint(ctx context.Context, req *DeleteEndpointRequest) (*DeleteEndpointResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteEndpoint not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) DeleteNetwork(ctx context.Context, req *DeleteNetworkRequest) (*DeleteNetworkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteNetwork not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) GetEndpoint(ctx context.Context, req *GetEndpointRequest) (*GetEndpointResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetEndpoint not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) GetNetwork(ctx context.Context, req *GetNetworkRequest) (*GetNetworkResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNetwork not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) GetEndpoints(ctx context.Context, req *GetEndpointsRequest) (*GetEndpointsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetEndpoints not implemented") +} +func (*UnimplementedNetworkConfigProxyServer) GetNetworks(ctx context.Context, req *GetNetworksRequest) (*GetNetworksResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNetworks not implemented") +} + func RegisterNetworkConfigProxyServer(s *grpc.Server, srv NetworkConfigProxyServer) { s.RegisterService(&_NetworkConfigProxy_serviceDesc, srv) } @@ -2407,7 +2271,7 @@ var _NetworkConfigProxy_serviceDesc = grpc.ServiceDesc{ func (m *AddNICRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2415,48 +2279,59 @@ func (m *AddNICRequest) Marshal() (dAtA []byte, err error) { } func (m *AddNICRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddNICRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.NicID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NicID))) - i += copy(dAtA[i:], m.NicID) + if m.EndpointSettings != nil { + { + size, err := m.EndpointSettings.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } if len(m.EndpointName) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.EndpointName) + copy(dAtA[i:], m.EndpointName) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.EndpointName))) - i += copy(dAtA[i:], m.EndpointName) + i-- + dAtA[i] = 0x1a } - if m.EndpointSettings != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.EndpointSettings.Size())) - n1, err := m.EndpointSettings.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n1 + if len(m.NicID) > 0 { + i -= len(m.NicID) + copy(dAtA[i:], m.NicID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NicID))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AddNICResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2464,20 +2339,26 @@ func (m *AddNICResponse) Marshal() (dAtA []byte, err error) { } func (m *AddNICResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddNICResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyNICRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2485,48 +2366,59 @@ func (m *ModifyNICRequest) Marshal() (dAtA []byte, err error) { } func (m *ModifyNICRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyNICRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.NicID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NicID))) - i += copy(dAtA[i:], m.NicID) + if m.EndpointSettings != nil { + { + size, err := m.EndpointSettings.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 } if len(m.EndpointName) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.EndpointName) + copy(dAtA[i:], m.EndpointName) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.EndpointName))) - i += copy(dAtA[i:], m.EndpointName) + i-- + dAtA[i] = 0x1a } - if m.EndpointSettings != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.EndpointSettings.Size())) - n2, err := m.EndpointSettings.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 + if len(m.NicID) > 0 { + i -= len(m.NicID) + copy(dAtA[i:], m.NicID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NicID))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ModifyNICResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2534,20 +2426,26 @@ func (m *ModifyNICResponse) Marshal() (dAtA []byte, err error) { } func (m *ModifyNICResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ModifyNICResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *DeleteNICRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2555,38 +2453,47 @@ func (m *DeleteNICRequest) Marshal() (dAtA []byte, err error) { } func (m *DeleteNICRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteNICRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) - } - if len(m.NicID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NicID))) - i += copy(dAtA[i:], m.NicID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.EndpointName) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.EndpointName) + copy(dAtA[i:], m.EndpointName) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.EndpointName))) - i += copy(dAtA[i:], m.EndpointName) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.NicID) > 0 { + i -= len(m.NicID) + copy(dAtA[i:], m.NicID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NicID))) + i-- + dAtA[i] = 0x12 + } + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *DeleteNICResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2594,20 +2501,26 @@ func (m *DeleteNICResponse) Marshal() (dAtA []byte, err error) { } func (m *DeleteNICResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteNICResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *CreateNetworkRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2615,30 +2528,38 @@ func (m *CreateNetworkRequest) Marshal() (dAtA []byte, err error) { } func (m *CreateNetworkRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Network != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.Network.Size())) - n3, err := m.Network.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n3 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Network) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2646,55 +2567,77 @@ func (m *Network) Marshal() (dAtA []byte, err error) { } func (m *Network) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Network) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Settings != nil { - nn4, err := m.Settings.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Settings.Size() + i -= size + if _, err := m.Settings.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn4 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *Network_HcnNetwork) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Network_HcnNetwork) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.HcnNetwork != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.HcnNetwork.Size())) - n5, err := m.HcnNetwork.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.HcnNetwork.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n5 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *Network_NcproxyNetwork) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Network_NcproxyNetwork) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.NcproxyNetwork != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.NcproxyNetwork.Size())) - n6, err := m.NcproxyNetwork.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.NcproxyNetwork.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n6 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *NCProxyNetworkSettings) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2702,26 +2645,33 @@ func (m *NCProxyNetworkSettings) Marshal() (dAtA []byte, err error) { } func (m *NCProxyNetworkSettings) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NCProxyNetworkSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *HostComputeNetworkSettings) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2729,63 +2679,66 @@ func (m *HostComputeNetworkSettings) Marshal() (dAtA []byte, err error) { } func (m *HostComputeNetworkSettings) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HostComputeNetworkSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if m.Mode != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.Mode)) + if len(m.DefaultGateway) > 0 { + i -= len(m.DefaultGateway) + copy(dAtA[i:], m.DefaultGateway) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.DefaultGateway))) + i-- + dAtA[i] = 0x32 } - if len(m.SwitchName) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.SwitchName))) - i += copy(dAtA[i:], m.SwitchName) + if len(m.SubnetIpaddressPrefix) > 0 { + for iNdEx := len(m.SubnetIpaddressPrefix) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.SubnetIpaddressPrefix[iNdEx]) + copy(dAtA[i:], m.SubnetIpaddressPrefix[iNdEx]) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.SubnetIpaddressPrefix[iNdEx]))) + i-- + dAtA[i] = 0x2a + } } if m.IpamType != 0 { - dAtA[i] = 0x20 - i++ i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IpamType)) + i-- + dAtA[i] = 0x20 } - if len(m.SubnetIpaddressPrefix) > 0 { - for _, s := range m.SubnetIpaddressPrefix { - dAtA[i] = 0x2a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } + if len(m.SwitchName) > 0 { + i -= len(m.SwitchName) + copy(dAtA[i:], m.SwitchName) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.SwitchName))) + i-- + dAtA[i] = 0x1a } - if len(m.DefaultGateway) > 0 { - dAtA[i] = 0x32 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.DefaultGateway))) - i += copy(dAtA[i:], m.DefaultGateway) + if m.Mode != 0 { + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.Mode)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CreateNetworkResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2793,26 +2746,33 @@ func (m *CreateNetworkResponse) Marshal() (dAtA []byte, err error) { } func (m *CreateNetworkResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ID) + copy(dAtA[i:], m.ID) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *PortNameEndpointPolicySetting) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2820,26 +2780,33 @@ func (m *PortNameEndpointPolicySetting) Marshal() (dAtA []byte, err error) { } func (m *PortNameEndpointPolicySetting) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PortNameEndpointPolicySetting) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.PortName) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.PortName) + copy(dAtA[i:], m.PortName) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.PortName))) - i += copy(dAtA[i:], m.PortName) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *IovEndpointPolicySetting) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2847,35 +2814,41 @@ func (m *IovEndpointPolicySetting) Marshal() (dAtA []byte, err error) { } func (m *IovEndpointPolicySetting) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *IovEndpointPolicySetting) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.IovOffloadWeight != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IovOffloadWeight)) - } - if m.QueuePairsRequested != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.QueuePairsRequested)) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.InterruptModeration != 0 { - dAtA[i] = 0x18 - i++ i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.InterruptModeration)) + i-- + dAtA[i] = 0x18 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.QueuePairsRequested != 0 { + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.QueuePairsRequested)) + i-- + dAtA[i] = 0x10 + } + if m.IovOffloadWeight != 0 { + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IovOffloadWeight)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *DnsSetting) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2883,56 +2856,51 @@ func (m *DnsSetting) Marshal() (dAtA []byte, err error) { } func (m *DnsSetting) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DnsSetting) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ServerIpAddrs) > 0 { - for _, s := range m.ServerIpAddrs { - dAtA[i] = 0xa - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } + if len(m.Search) > 0 { + for iNdEx := len(m.Search) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Search[iNdEx]) + copy(dAtA[i:], m.Search[iNdEx]) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Search[iNdEx]))) + i-- + dAtA[i] = 0x1a } } if len(m.Domain) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Domain) + copy(dAtA[i:], m.Domain) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Domain))) - i += copy(dAtA[i:], m.Domain) + i-- + dAtA[i] = 0x12 } - if len(m.Search) > 0 { - for _, s := range m.Search { - dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) + if len(m.ServerIpAddrs) > 0 { + for iNdEx := len(m.ServerIpAddrs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.ServerIpAddrs[iNdEx]) + copy(dAtA[i:], m.ServerIpAddrs[iNdEx]) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ServerIpAddrs[iNdEx]))) + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *CreateEndpointRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2940,30 +2908,38 @@ func (m *CreateEndpointRequest) Marshal() (dAtA []byte, err error) { } func (m *CreateEndpointRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateEndpointRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.EndpointSettings != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.EndpointSettings.Size())) - n7, err := m.EndpointSettings.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.EndpointSettings.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n7 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *EndpointSettings) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -2971,55 +2947,77 @@ func (m *EndpointSettings) Marshal() (dAtA []byte, err error) { } func (m *EndpointSettings) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EndpointSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if m.Settings != nil { - nn8, err := m.Settings.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size := m.Settings.Size() + i -= size + if _, err := m.Settings.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } } - i += nn8 - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *EndpointSettings_HcnEndpoint) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EndpointSettings_HcnEndpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.HcnEndpoint != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.HcnEndpoint.Size())) - n9, err := m.HcnEndpoint.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.HcnEndpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n9 + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *EndpointSettings_NcproxyEndpoint) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EndpointSettings_NcproxyEndpoint) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.NcproxyEndpoint != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.NcproxyEndpoint.Size())) - n10, err := m.NcproxyEndpoint.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.NcproxyEndpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n10 + i-- + dAtA[i] = 0x12 } - return i, nil + return len(dAtA) - i, nil } func (m *HcnEndpointResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3027,42 +3025,52 @@ func (m *HcnEndpointResponse) Marshal() (dAtA []byte, err error) { } func (m *HcnEndpointResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HcnEndpointResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Namespace) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Namespace))) - i += copy(dAtA[i:], m.Namespace) - } - if len(m.ID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Settings != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.Settings.Size())) - n11, err := m.Settings.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Settings.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n11 + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0x12 + } + if len(m.Namespace) > 0 { + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Namespace))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *HcnEndpointSettings) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3070,69 +3078,83 @@ func (m *HcnEndpointSettings) Marshal() (dAtA []byte, err error) { } func (m *HcnEndpointSettings) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HcnEndpointSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if len(m.Macaddress) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Macaddress))) - i += copy(dAtA[i:], m.Macaddress) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Ipaddress) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Ipaddress))) - i += copy(dAtA[i:], m.Ipaddress) + if m.DnsSetting != nil { + { + size, err := m.DnsSetting.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a } - if m.IpaddressPrefixlength != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IpaddressPrefixlength)) + if m.Policies != nil { + { + size, err := m.Policies.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 } if len(m.NetworkName) > 0 { - dAtA[i] = 0x2a - i++ + i -= len(m.NetworkName) + copy(dAtA[i:], m.NetworkName) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NetworkName))) - i += copy(dAtA[i:], m.NetworkName) + i-- + dAtA[i] = 0x2a } - if m.Policies != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.Policies.Size())) - n12, err := m.Policies.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n12 + if m.IpaddressPrefixlength != 0 { + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IpaddressPrefixlength)) + i-- + dAtA[i] = 0x20 } - if m.DnsSetting != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.DnsSetting.Size())) - n13, err := m.DnsSetting.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n13 + if len(m.Ipaddress) > 0 { + i -= len(m.Ipaddress) + copy(dAtA[i:], m.Ipaddress) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Ipaddress))) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Macaddress) > 0 { + i -= len(m.Macaddress) + copy(dAtA[i:], m.Macaddress) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Macaddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *HcnEndpointPolicies) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3140,40 +3162,50 @@ func (m *HcnEndpointPolicies) Marshal() (dAtA []byte, err error) { } func (m *HcnEndpointPolicies) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *HcnEndpointPolicies) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.PortnamePolicySetting != nil { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.PortnamePolicySetting.Size())) - n14, err := m.PortnamePolicySetting.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n14 + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.IovPolicySettings != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IovPolicySettings.Size())) - n15, err := m.IovPolicySettings.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.IovPolicySettings.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n15 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if m.PortnamePolicySetting != nil { + { + size, err := m.PortnamePolicySetting.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *NCProxyEndpointSettings) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3181,76 +3213,96 @@ func (m *NCProxyEndpointSettings) Marshal() (dAtA []byte, err error) { } func (m *NCProxyEndpointSettings) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NCProxyEndpointSettings) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if len(m.Macaddress) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Macaddress))) - i += copy(dAtA[i:], m.Macaddress) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Ipaddress) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Ipaddress))) - i += copy(dAtA[i:], m.Ipaddress) + if m.DeviceDetails != nil { + { + size := m.DeviceDetails.Size() + i -= size + if _, err := m.DeviceDetails.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } } - if m.IpaddressPrefixlength != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IpaddressPrefixlength)) + if len(m.DefaultGateway) > 0 { + i -= len(m.DefaultGateway) + copy(dAtA[i:], m.DefaultGateway) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.DefaultGateway))) + i-- + dAtA[i] = 0x32 } if len(m.NetworkName) > 0 { - dAtA[i] = 0x2a - i++ + i -= len(m.NetworkName) + copy(dAtA[i:], m.NetworkName) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NetworkName))) - i += copy(dAtA[i:], m.NetworkName) + i-- + dAtA[i] = 0x2a } - if len(m.DefaultGateway) > 0 { - dAtA[i] = 0x32 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.DefaultGateway))) - i += copy(dAtA[i:], m.DefaultGateway) + if m.IpaddressPrefixlength != 0 { + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IpaddressPrefixlength)) + i-- + dAtA[i] = 0x20 } - if m.DeviceDetails != nil { - nn16, err := m.DeviceDetails.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += nn16 + if len(m.Ipaddress) > 0 { + i -= len(m.Ipaddress) + copy(dAtA[i:], m.Ipaddress) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Ipaddress))) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Macaddress) > 0 { + i -= len(m.Macaddress) + copy(dAtA[i:], m.Macaddress) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Macaddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *NCProxyEndpointSettings_PciDeviceDetails) MarshalTo(dAtA []byte) (int, error) { - i := 0 + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NCProxyEndpointSettings_PciDeviceDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) if m.PciDeviceDetails != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.PciDeviceDetails.Size())) - n17, err := m.PciDeviceDetails.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.PciDeviceDetails.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n17 + i-- + dAtA[i] = 0x3a } - return i, nil + return len(dAtA) - i, nil } func (m *PCIDeviceDetails) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3258,31 +3310,38 @@ func (m *PCIDeviceDetails) Marshal() (dAtA []byte, err error) { } func (m *PCIDeviceDetails) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PCIDeviceDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.DeviceID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.DeviceID))) - i += copy(dAtA[i:], m.DeviceID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.VirtualFunctionIndex != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.VirtualFunctionIndex)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.DeviceID) > 0 { + i -= len(m.DeviceID) + copy(dAtA[i:], m.DeviceID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.DeviceID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *CreateEndpointResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3290,26 +3349,33 @@ func (m *CreateEndpointResponse) Marshal() (dAtA []byte, err error) { } func (m *CreateEndpointResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *CreateEndpointResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ID) + copy(dAtA[i:], m.ID) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AddEndpointRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3317,32 +3383,40 @@ func (m *AddEndpointRequest) Marshal() (dAtA []byte, err error) { } func (m *AddEndpointRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddEndpointRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.NamespaceID) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.NamespaceID) + copy(dAtA[i:], m.NamespaceID) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.NamespaceID))) - i += copy(dAtA[i:], m.NamespaceID) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *AddEndpointResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3350,20 +3424,26 @@ func (m *AddEndpointResponse) Marshal() (dAtA []byte, err error) { } func (m *AddEndpointResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AddEndpointResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *DeleteEndpointRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3371,26 +3451,33 @@ func (m *DeleteEndpointRequest) Marshal() (dAtA []byte, err error) { } func (m *DeleteEndpointRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteEndpointRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *DeleteEndpointResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3398,20 +3485,26 @@ func (m *DeleteEndpointResponse) Marshal() (dAtA []byte, err error) { } func (m *DeleteEndpointResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteEndpointResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *DeleteNetworkRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3419,26 +3512,33 @@ func (m *DeleteNetworkRequest) Marshal() (dAtA []byte, err error) { } func (m *DeleteNetworkRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *DeleteNetworkResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3446,20 +3546,26 @@ func (m *DeleteNetworkResponse) Marshal() (dAtA []byte, err error) { } func (m *DeleteNetworkResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DeleteNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *GetEndpointRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3467,26 +3573,33 @@ func (m *GetEndpointRequest) Marshal() (dAtA []byte, err error) { } func (m *GetEndpointRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetEndpointRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetEndpointResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3494,42 +3607,52 @@ func (m *GetEndpointResponse) Marshal() (dAtA []byte, err error) { } func (m *GetEndpointResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetEndpointResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Namespace) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Namespace))) - i += copy(dAtA[i:], m.Namespace) - } - if len(m.ID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Endpoint != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.Endpoint.Size())) - n18, err := m.Endpoint.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Endpoint.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n18 + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0x12 + } + if len(m.Namespace) > 0 { + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Namespace))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetNetworkRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3537,26 +3660,33 @@ func (m *GetNetworkRequest) Marshal() (dAtA []byte, err error) { } func (m *GetNetworkRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNetworkRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetNetworkResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3564,36 +3694,45 @@ func (m *GetNetworkResponse) Marshal() (dAtA []byte, err error) { } func (m *GetNetworkResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNetworkResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.Network != nil { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.Network.Size())) - n19, err := m.Network.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + { + size, err := m.Network.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n19 + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ID) > 0 { + i -= len(m.ID) + copy(dAtA[i:], m.ID) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetEndpointsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3601,20 +3740,26 @@ func (m *GetEndpointsRequest) Marshal() (dAtA []byte, err error) { } func (m *GetEndpointsRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetEndpointsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *GetEndpointsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3622,32 +3767,40 @@ func (m *GetEndpointsResponse) Marshal() (dAtA []byte, err error) { } func (m *GetEndpointsResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetEndpointsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Endpoints) > 0 { - for _, msg := range m.Endpoints { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Endpoints) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Endpoints[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *GetNetworksRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3655,20 +3808,26 @@ func (m *GetNetworksRequest) Marshal() (dAtA []byte, err error) { } func (m *GetNetworksRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNetworksRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *GetNetworksResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -3676,36 +3835,46 @@ func (m *GetNetworksResponse) Marshal() (dAtA []byte, err error) { } func (m *GetNetworksResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNetworksResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Networks) > 0 { - for _, msg := range m.Networks { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Networks) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Networks[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func encodeVarintNetworkconfigproxy(dAtA []byte, offset int, v uint64) int { + offset -= sovNetworkconfigproxy(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *AddNICRequest) Size() (n int) { if m == nil { @@ -4459,14 +4628,7 @@ func (m *GetNetworksResponse) Size() (n int) { } func sovNetworkconfigproxy(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozNetworkconfigproxy(x uint64) (n int) { return sovNetworkconfigproxy(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -4479,7 +4641,7 @@ func (this *AddNICRequest) String() string { `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, `NicID:` + fmt.Sprintf("%v", this.NicID) + `,`, `EndpointName:` + fmt.Sprintf("%v", this.EndpointName) + `,`, - `EndpointSettings:` + strings.Replace(fmt.Sprintf("%v", this.EndpointSettings), "EndpointSettings", "EndpointSettings", 1) + `,`, + `EndpointSettings:` + strings.Replace(this.EndpointSettings.String(), "EndpointSettings", "EndpointSettings", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4503,7 +4665,7 @@ func (this *ModifyNICRequest) String() string { `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, `NicID:` + fmt.Sprintf("%v", this.NicID) + `,`, `EndpointName:` + fmt.Sprintf("%v", this.EndpointName) + `,`, - `EndpointSettings:` + strings.Replace(fmt.Sprintf("%v", this.EndpointSettings), "EndpointSettings", "EndpointSettings", 1) + `,`, + `EndpointSettings:` + strings.Replace(this.EndpointSettings.String(), "EndpointSettings", "EndpointSettings", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4547,7 +4709,7 @@ func (this *CreateNetworkRequest) String() string { return "nil" } s := strings.Join([]string{`&CreateNetworkRequest{`, - `Network:` + strings.Replace(fmt.Sprintf("%v", this.Network), "Network", "Network", 1) + `,`, + `Network:` + strings.Replace(this.Network.String(), "Network", "Network", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4664,7 +4826,7 @@ func (this *CreateEndpointRequest) String() string { return "nil" } s := strings.Join([]string{`&CreateEndpointRequest{`, - `EndpointSettings:` + strings.Replace(fmt.Sprintf("%v", this.EndpointSettings), "EndpointSettings", "EndpointSettings", 1) + `,`, + `EndpointSettings:` + strings.Replace(this.EndpointSettings.String(), "EndpointSettings", "EndpointSettings", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4708,7 +4870,7 @@ func (this *HcnEndpointResponse) String() string { s := strings.Join([]string{`&HcnEndpointResponse{`, `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Settings:` + strings.Replace(fmt.Sprintf("%v", this.Settings), "HcnEndpointSettings", "HcnEndpointSettings", 1) + `,`, + `Settings:` + strings.Replace(this.Settings.String(), "HcnEndpointSettings", "HcnEndpointSettings", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4724,8 +4886,8 @@ func (this *HcnEndpointSettings) String() string { `Ipaddress:` + fmt.Sprintf("%v", this.Ipaddress) + `,`, `IpaddressPrefixlength:` + fmt.Sprintf("%v", this.IpaddressPrefixlength) + `,`, `NetworkName:` + fmt.Sprintf("%v", this.NetworkName) + `,`, - `Policies:` + strings.Replace(fmt.Sprintf("%v", this.Policies), "HcnEndpointPolicies", "HcnEndpointPolicies", 1) + `,`, - `DnsSetting:` + strings.Replace(fmt.Sprintf("%v", this.DnsSetting), "DnsSetting", "DnsSetting", 1) + `,`, + `Policies:` + strings.Replace(this.Policies.String(), "HcnEndpointPolicies", "HcnEndpointPolicies", 1) + `,`, + `DnsSetting:` + strings.Replace(this.DnsSetting.String(), "DnsSetting", "DnsSetting", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4736,8 +4898,8 @@ func (this *HcnEndpointPolicies) String() string { return "nil" } s := strings.Join([]string{`&HcnEndpointPolicies{`, - `PortnamePolicySetting:` + strings.Replace(fmt.Sprintf("%v", this.PortnamePolicySetting), "PortNameEndpointPolicySetting", "PortNameEndpointPolicySetting", 1) + `,`, - `IovPolicySettings:` + strings.Replace(fmt.Sprintf("%v", this.IovPolicySettings), "IovEndpointPolicySetting", "IovEndpointPolicySetting", 1) + `,`, + `PortnamePolicySetting:` + strings.Replace(this.PortnamePolicySetting.String(), "PortNameEndpointPolicySetting", "PortNameEndpointPolicySetting", 1) + `,`, + `IovPolicySettings:` + strings.Replace(this.IovPolicySettings.String(), "IovEndpointPolicySetting", "IovEndpointPolicySetting", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4875,7 +5037,7 @@ func (this *GetEndpointResponse) String() string { s := strings.Join([]string{`&GetEndpointResponse{`, `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Endpoint:` + strings.Replace(fmt.Sprintf("%v", this.Endpoint), "EndpointSettings", "EndpointSettings", 1) + `,`, + `Endpoint:` + strings.Replace(this.Endpoint.String(), "EndpointSettings", "EndpointSettings", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4898,7 +5060,7 @@ func (this *GetNetworkResponse) String() string { } s := strings.Join([]string{`&GetNetworkResponse{`, `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Network:` + strings.Replace(fmt.Sprintf("%v", this.Network), "Network", "Network", 1) + `,`, + `Network:` + strings.Replace(this.Network.String(), "Network", "Network", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4918,8 +5080,13 @@ func (this *GetEndpointsResponse) String() string { if this == nil { return "nil" } + repeatedStringForEndpoints := "[]*GetEndpointResponse{" + for _, f := range this.Endpoints { + repeatedStringForEndpoints += strings.Replace(f.String(), "GetEndpointResponse", "GetEndpointResponse", 1) + "," + } + repeatedStringForEndpoints += "}" s := strings.Join([]string{`&GetEndpointsResponse{`, - `Endpoints:` + strings.Replace(fmt.Sprintf("%v", this.Endpoints), "GetEndpointResponse", "GetEndpointResponse", 1) + `,`, + `Endpoints:` + repeatedStringForEndpoints + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -4939,8 +5106,13 @@ func (this *GetNetworksResponse) String() string { if this == nil { return "nil" } + repeatedStringForNetworks := "[]*GetNetworkResponse{" + for _, f := range this.Networks { + repeatedStringForNetworks += strings.Replace(f.String(), "GetNetworkResponse", "GetNetworkResponse", 1) + "," + } + repeatedStringForNetworks += "}" s := strings.Join([]string{`&GetNetworksResponse{`, - `Networks:` + strings.Replace(fmt.Sprintf("%v", this.Networks), "GetNetworkResponse", "GetNetworkResponse", 1) + `,`, + `Networks:` + repeatedStringForNetworks + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -5121,10 +5293,7 @@ func (m *AddNICRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -5175,10 +5344,7 @@ func (m *AddNICResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -5361,10 +5527,7 @@ func (m *ModifyNICRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -5415,10 +5578,7 @@ func (m *ModifyNICResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -5565,10 +5725,7 @@ func (m *DeleteNICRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -5619,10 +5776,7 @@ func (m *DeleteNICResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -5709,10 +5863,7 @@ func (m *CreateNetworkRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -5833,10 +5984,7 @@ func (m *Network) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -5919,10 +6067,7 @@ func (m *NCProxyNetworkSettings) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -6139,10 +6284,7 @@ func (m *HostComputeNetworkSettings) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -6225,10 +6367,7 @@ func (m *CreateNetworkResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -6311,10 +6450,7 @@ func (m *PortNameEndpointPolicySetting) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -6422,10 +6558,7 @@ func (m *IovEndpointPolicySetting) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -6572,10 +6705,7 @@ func (m *DnsSetting) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -6662,10 +6792,7 @@ func (m *CreateEndpointRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -6786,10 +6913,7 @@ func (m *EndpointSettings) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -6940,10 +7064,7 @@ func (m *HcnEndpointResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -7213,10 +7334,7 @@ func (m *HcnEndpointSettings) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -7339,10 +7457,7 @@ func (m *HcnEndpointPolicies) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -7607,10 +7722,7 @@ func (m *NCProxyEndpointSettings) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -7712,10 +7824,7 @@ func (m *PCIDeviceDetails) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -7798,10 +7907,7 @@ func (m *CreateEndpointResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -7916,10 +8022,7 @@ func (m *AddEndpointRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -7970,10 +8073,7 @@ func (m *AddEndpointResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8056,10 +8156,7 @@ func (m *DeleteEndpointRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8110,10 +8207,7 @@ func (m *DeleteEndpointResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8196,10 +8290,7 @@ func (m *DeleteNetworkRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8250,10 +8341,7 @@ func (m *DeleteNetworkResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8336,10 +8424,7 @@ func (m *GetEndpointRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8490,10 +8575,7 @@ func (m *GetEndpointResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8576,10 +8658,7 @@ func (m *GetNetworkRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8698,10 +8777,7 @@ func (m *GetNetworkResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8752,10 +8828,7 @@ func (m *GetEndpointsRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8840,10 +8913,7 @@ func (m *GetEndpointsResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8894,10 +8964,7 @@ func (m *GetNetworksRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -8982,10 +9049,7 @@ func (m *GetNetworksResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNetworkconfigproxy - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNetworkconfigproxy } if (iNdEx + skippy) > l { @@ -9004,6 +9068,7 @@ func (m *GetNetworksResponse) Unmarshal(dAtA []byte) error { func skipNetworkconfigproxy(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -9035,10 +9100,8 @@ func skipNetworkconfigproxy(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -9059,55 +9122,30 @@ func skipNetworkconfigproxy(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthNetworkconfigproxy } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthNetworkconfigproxy - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowNetworkconfigproxy - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipNetworkconfigproxy(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthNetworkconfigproxy - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupNetworkconfigproxy + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthNetworkconfigproxy + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthNetworkconfigproxy = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowNetworkconfigproxy = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthNetworkconfigproxy = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowNetworkconfigproxy = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupNetworkconfigproxy = fmt.Errorf("proto: unexpected end of group") ) diff --git a/pkg/ncproxy/nodenetsvc/v1/nodenetsvc.pb.go b/pkg/ncproxy/nodenetsvc/v1/nodenetsvc.pb.go index f2fd334f88..842300c922 100644 --- a/pkg/ncproxy/nodenetsvc/v1/nodenetsvc.pb.go +++ b/pkg/ncproxy/nodenetsvc/v1/nodenetsvc.pb.go @@ -8,8 +8,11 @@ import ( fmt "fmt" proto "github.com/gogo/protobuf/proto" grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" io "io" math "math" + math_bits "math/bits" reflect "reflect" strings "strings" ) @@ -23,7 +26,7 @@ var _ = math.Inf // is compatible with the proto package it is being compiled against. // A compilation error at this line likely means your copy of the // proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type RequestType int32 @@ -71,7 +74,7 @@ func (m *ConfigureNetworkingRequest) XXX_Marshal(b []byte, deterministic bool) ( return xxx_messageInfo_ConfigureNetworkingRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -109,7 +112,7 @@ func (m *ConfigureNetworkingResponse) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_ConfigureNetworkingResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -148,7 +151,7 @@ func (m *PingNodeNetworkServiceRequest) XXX_Marshal(b []byte, deterministic bool return xxx_messageInfo_PingNodeNetworkServiceRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -187,7 +190,7 @@ func (m *PingNodeNetworkServiceResponse) XXX_Marshal(b []byte, deterministic boo return xxx_messageInfo_PingNodeNetworkServiceResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -228,7 +231,7 @@ func (m *ConfigureContainerNetworkingRequest) XXX_Marshal(b []byte, deterministi return xxx_messageInfo_ConfigureContainerNetworkingRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -267,7 +270,7 @@ func (m *ConfigureContainerNetworkingResponse) XXX_Marshal(b []byte, determinist return xxx_messageInfo_ConfigureContainerNetworkingResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -309,7 +312,7 @@ func (m *ContainerIPAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, return xxx_messageInfo_ContainerIPAddress.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -351,7 +354,7 @@ func (m *ContainerNetworkInterface) XXX_Marshal(b []byte, deterministic bool) ([ return xxx_messageInfo_ContainerNetworkInterface.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -390,7 +393,7 @@ func (m *GetHostLocalIpAddressRequest) XXX_Marshal(b []byte, deterministic bool) return xxx_messageInfo_GetHostLocalIpAddressRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -429,7 +432,7 @@ func (m *GetHostLocalIpAddressResponse) XXX_Marshal(b []byte, deterministic bool return xxx_messageInfo_GetHostLocalIpAddressResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] - n, err := m.MarshalTo(b) + n, err := m.MarshalToSizedBuffer(b) if err != nil { return nil, err } @@ -584,6 +587,23 @@ type NodeNetworkServiceServer interface { GetHostLocalIpAddress(context.Context, *GetHostLocalIpAddressRequest) (*GetHostLocalIpAddressResponse, error) } +// UnimplementedNodeNetworkServiceServer can be embedded to have forward compatible implementations. +type UnimplementedNodeNetworkServiceServer struct { +} + +func (*UnimplementedNodeNetworkServiceServer) ConfigureNetworking(ctx context.Context, req *ConfigureNetworkingRequest) (*ConfigureNetworkingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConfigureNetworking not implemented") +} +func (*UnimplementedNodeNetworkServiceServer) ConfigureContainerNetworking(ctx context.Context, req *ConfigureContainerNetworkingRequest) (*ConfigureContainerNetworkingResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ConfigureContainerNetworking not implemented") +} +func (*UnimplementedNodeNetworkServiceServer) PingNodeNetworkService(ctx context.Context, req *PingNodeNetworkServiceRequest) (*PingNodeNetworkServiceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method PingNodeNetworkService not implemented") +} +func (*UnimplementedNodeNetworkServiceServer) GetHostLocalIpAddress(ctx context.Context, req *GetHostLocalIpAddressRequest) (*GetHostLocalIpAddressResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetHostLocalIpAddress not implemented") +} + func RegisterNodeNetworkServiceServer(s *grpc.Server, srv NodeNetworkServiceServer) { s.RegisterService(&_NodeNetworkService_serviceDesc, srv) } @@ -688,7 +708,7 @@ var _NodeNetworkService_serviceDesc = grpc.ServiceDesc{ func (m *ConfigureNetworkingRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -696,31 +716,38 @@ func (m *ConfigureNetworkingRequest) Marshal() (dAtA []byte, err error) { } func (m *ConfigureNetworkingRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigureNetworkingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.RequestType != 0 { - dAtA[i] = 0x10 - i++ i = encodeVarintNodenetsvc(dAtA, i, uint64(m.RequestType)) + i-- + dAtA[i] = 0x10 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ConfigureNetworkingResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -728,20 +755,26 @@ func (m *ConfigureNetworkingResponse) Marshal() (dAtA []byte, err error) { } func (m *ConfigureNetworkingResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigureNetworkingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - return i, nil + return len(dAtA) - i, nil } func (m *PingNodeNetworkServiceRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -749,26 +782,33 @@ func (m *PingNodeNetworkServiceRequest) Marshal() (dAtA []byte, err error) { } func (m *PingNodeNetworkServiceRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PingNodeNetworkServiceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.PingRequestMessage) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.PingRequestMessage) + copy(dAtA[i:], m.PingRequestMessage) i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.PingRequestMessage))) - i += copy(dAtA[i:], m.PingRequestMessage) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *PingNodeNetworkServiceResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -776,26 +816,33 @@ func (m *PingNodeNetworkServiceResponse) Marshal() (dAtA []byte, err error) { } func (m *PingNodeNetworkServiceResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *PingNodeNetworkServiceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.PingResponseMessage) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.PingResponseMessage) + copy(dAtA[i:], m.PingResponseMessage) i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.PingResponseMessage))) - i += copy(dAtA[i:], m.PingResponseMessage) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ConfigureContainerNetworkingRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -803,37 +850,45 @@ func (m *ConfigureContainerNetworkingRequest) Marshal() (dAtA []byte, err error) } func (m *ConfigureContainerNetworkingRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigureContainerNetworkingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if m.RequestType != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintNodenetsvc(dAtA, i, uint64(m.RequestType)) - } - if len(m.ContainerID) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if len(m.NetworkNamespaceID) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.NetworkNamespaceID) + copy(dAtA[i:], m.NetworkNamespaceID) i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.NetworkNamespaceID))) - i += copy(dAtA[i:], m.NetworkNamespaceID) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.ContainerID) > 0 { + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) + i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.ContainerID))) + i-- + dAtA[i] = 0x12 + } + if m.RequestType != 0 { + i = encodeVarintNodenetsvc(dAtA, i, uint64(m.RequestType)) + i-- + dAtA[i] = 0x8 } - return i, nil + return len(dAtA) - i, nil } func (m *ConfigureContainerNetworkingResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -841,32 +896,40 @@ func (m *ConfigureContainerNetworkingResponse) Marshal() (dAtA []byte, err error } func (m *ConfigureContainerNetworkingResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConfigureContainerNetworkingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.Interfaces) > 0 { - for _, msg := range m.Interfaces { - dAtA[i] = 0xa - i++ - i = encodeVarintNodenetsvc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err + for iNdEx := len(m.Interfaces) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Interfaces[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNodenetsvc(dAtA, i, uint64(size)) } - i += n + i-- + dAtA[i] = 0xa } } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) - } - return i, nil + return len(dAtA) - i, nil } func (m *ContainerIPAddress) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -874,44 +937,54 @@ func (m *ContainerIPAddress) Marshal() (dAtA []byte, err error) { } func (m *ContainerIPAddress) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContainerIPAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Version) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.Version))) - i += copy(dAtA[i:], m.Version) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.Ip) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.Ip))) - i += copy(dAtA[i:], m.Ip) + if len(m.DefaultGateway) > 0 { + i -= len(m.DefaultGateway) + copy(dAtA[i:], m.DefaultGateway) + i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.DefaultGateway))) + i-- + dAtA[i] = 0x2a } if len(m.PrefixLength) > 0 { - dAtA[i] = 0x22 - i++ + i -= len(m.PrefixLength) + copy(dAtA[i:], m.PrefixLength) i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.PrefixLength))) - i += copy(dAtA[i:], m.PrefixLength) + i-- + dAtA[i] = 0x22 } - if len(m.DefaultGateway) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.DefaultGateway))) - i += copy(dAtA[i:], m.DefaultGateway) + if len(m.Ip) > 0 { + i -= len(m.Ip) + copy(dAtA[i:], m.Ip) + i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.Ip))) + i-- + dAtA[i] = 0x1a } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Version) > 0 { + i -= len(m.Version) + copy(dAtA[i:], m.Version) + i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.Version))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *ContainerNetworkInterface) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -919,50 +992,61 @@ func (m *ContainerNetworkInterface) Marshal() (dAtA []byte, err error) { } func (m *ContainerNetworkInterface) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContainerNetworkInterface) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l - if len(m.Name) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } - if len(m.MacAddress) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.MacAddress))) - i += copy(dAtA[i:], m.MacAddress) + if len(m.Ipaddresses) > 0 { + for iNdEx := len(m.Ipaddresses) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Ipaddresses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNodenetsvc(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } } if len(m.NetworkNamespaceID) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.NetworkNamespaceID) + copy(dAtA[i:], m.NetworkNamespaceID) i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.NetworkNamespaceID))) - i += copy(dAtA[i:], m.NetworkNamespaceID) + i-- + dAtA[i] = 0x1a } - if len(m.Ipaddresses) > 0 { - for _, msg := range m.Ipaddresses { - dAtA[i] = 0x22 - i++ - i = encodeVarintNodenetsvc(dAtA, i, uint64(msg.Size())) - n, err := msg.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n - } + if len(m.MacAddress) > 0 { + i -= len(m.MacAddress) + copy(dAtA[i:], m.MacAddress) + i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.MacAddress))) + i-- + dAtA[i] = 0x12 } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetHostLocalIpAddressRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -970,26 +1054,33 @@ func (m *GetHostLocalIpAddressRequest) Marshal() (dAtA []byte, err error) { } func (m *GetHostLocalIpAddressRequest) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetHostLocalIpAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.ContainerID) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.ContainerID) + copy(dAtA[i:], m.ContainerID) i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.ContainerID))) - i += copy(dAtA[i:], m.ContainerID) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func (m *GetHostLocalIpAddressResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) - n, err := m.MarshalTo(dAtA) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } @@ -997,30 +1088,39 @@ func (m *GetHostLocalIpAddressResponse) Marshal() (dAtA []byte, err error) { } func (m *GetHostLocalIpAddressResponse) MarshalTo(dAtA []byte) (int, error) { - var i int + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetHostLocalIpAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) _ = i var l int _ = l + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) + } if len(m.IpAddr) > 0 { - dAtA[i] = 0xa - i++ + i -= len(m.IpAddr) + copy(dAtA[i:], m.IpAddr) i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.IpAddr))) - i += copy(dAtA[i:], m.IpAddr) - } - if m.XXX_unrecognized != nil { - i += copy(dAtA[i:], m.XXX_unrecognized) + i-- + dAtA[i] = 0xa } - return i, nil + return len(dAtA) - i, nil } func encodeVarintNodenetsvc(dAtA []byte, offset int, v uint64) int { + offset -= sovNodenetsvc(v) + base := offset for v >= 1<<7 { dAtA[offset] = uint8(v&0x7f | 0x80) v >>= 7 offset++ } dAtA[offset] = uint8(v) - return offset + 1 + return base } func (m *ConfigureNetworkingRequest) Size() (n int) { if m == nil { @@ -1217,14 +1317,7 @@ func (m *GetHostLocalIpAddressResponse) Size() (n int) { } func sovNodenetsvc(x uint64) (n int) { - for { - n++ - x >>= 7 - if x == 0 { - break - } - } - return n + return (math_bits.Len64(x|1) + 6) / 7 } func sozNodenetsvc(x uint64) (n int) { return sovNodenetsvc(uint64((x << 1) ^ uint64((int64(x) >> 63)))) @@ -1290,8 +1383,13 @@ func (this *ConfigureContainerNetworkingResponse) String() string { if this == nil { return "nil" } + repeatedStringForInterfaces := "[]*ContainerNetworkInterface{" + for _, f := range this.Interfaces { + repeatedStringForInterfaces += strings.Replace(f.String(), "ContainerNetworkInterface", "ContainerNetworkInterface", 1) + "," + } + repeatedStringForInterfaces += "}" s := strings.Join([]string{`&ConfigureContainerNetworkingResponse{`, - `Interfaces:` + strings.Replace(fmt.Sprintf("%v", this.Interfaces), "ContainerNetworkInterface", "ContainerNetworkInterface", 1) + `,`, + `Interfaces:` + repeatedStringForInterfaces + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -1315,11 +1413,16 @@ func (this *ContainerNetworkInterface) String() string { if this == nil { return "nil" } + repeatedStringForIpaddresses := "[]*ContainerIPAddress{" + for _, f := range this.Ipaddresses { + repeatedStringForIpaddresses += strings.Replace(f.String(), "ContainerIPAddress", "ContainerIPAddress", 1) + "," + } + repeatedStringForIpaddresses += "}" s := strings.Join([]string{`&ContainerNetworkInterface{`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `MacAddress:` + fmt.Sprintf("%v", this.MacAddress) + `,`, `NetworkNamespaceID:` + fmt.Sprintf("%v", this.NetworkNamespaceID) + `,`, - `Ipaddresses:` + strings.Replace(fmt.Sprintf("%v", this.Ipaddresses), "ContainerIPAddress", "ContainerIPAddress", 1) + `,`, + `Ipaddresses:` + repeatedStringForIpaddresses + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -1441,10 +1544,7 @@ func (m *ConfigureNetworkingRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNodenetsvc - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNodenetsvc } if (iNdEx + skippy) > l { @@ -1495,10 +1595,7 @@ func (m *ConfigureNetworkingResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNodenetsvc - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNodenetsvc } if (iNdEx + skippy) > l { @@ -1581,10 +1678,7 @@ func (m *PingNodeNetworkServiceRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNodenetsvc - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNodenetsvc } if (iNdEx + skippy) > l { @@ -1667,10 +1761,7 @@ func (m *PingNodeNetworkServiceResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNodenetsvc - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNodenetsvc } if (iNdEx + skippy) > l { @@ -1804,10 +1895,7 @@ func (m *ConfigureContainerNetworkingRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNodenetsvc - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNodenetsvc } if (iNdEx + skippy) > l { @@ -1892,10 +1980,7 @@ func (m *ConfigureContainerNetworkingResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNodenetsvc - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNodenetsvc } if (iNdEx + skippy) > l { @@ -2074,10 +2159,7 @@ func (m *ContainerIPAddress) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNodenetsvc - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNodenetsvc } if (iNdEx + skippy) > l { @@ -2258,10 +2340,7 @@ func (m *ContainerNetworkInterface) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNodenetsvc - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNodenetsvc } if (iNdEx + skippy) > l { @@ -2344,10 +2423,7 @@ func (m *GetHostLocalIpAddressRequest) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNodenetsvc - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNodenetsvc } if (iNdEx + skippy) > l { @@ -2430,10 +2506,7 @@ func (m *GetHostLocalIpAddressResponse) Unmarshal(dAtA []byte) error { if err != nil { return err } - if skippy < 0 { - return ErrInvalidLengthNodenetsvc - } - if (iNdEx + skippy) < 0 { + if (skippy < 0) || (iNdEx+skippy) < 0 { return ErrInvalidLengthNodenetsvc } if (iNdEx + skippy) > l { @@ -2452,6 +2525,7 @@ func (m *GetHostLocalIpAddressResponse) Unmarshal(dAtA []byte) error { func skipNodenetsvc(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 + depth := 0 for iNdEx < l { var wire uint64 for shift := uint(0); ; shift += 7 { @@ -2483,10 +2557,8 @@ func skipNodenetsvc(dAtA []byte) (n int, err error) { break } } - return iNdEx, nil case 1: iNdEx += 8 - return iNdEx, nil case 2: var length int for shift := uint(0); ; shift += 7 { @@ -2507,55 +2579,30 @@ func skipNodenetsvc(dAtA []byte) (n int, err error) { return 0, ErrInvalidLengthNodenetsvc } iNdEx += length - if iNdEx < 0 { - return 0, ErrInvalidLengthNodenetsvc - } - return iNdEx, nil case 3: - for { - var innerWire uint64 - var start int = iNdEx - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowNodenetsvc - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - innerWire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - innerWireType := int(innerWire & 0x7) - if innerWireType == 4 { - break - } - next, err := skipNodenetsvc(dAtA[start:]) - if err != nil { - return 0, err - } - iNdEx = start + next - if iNdEx < 0 { - return 0, ErrInvalidLengthNodenetsvc - } - } - return iNdEx, nil + depth++ case 4: - return iNdEx, nil + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupNodenetsvc + } + depth-- case 5: iNdEx += 4 - return iNdEx, nil default: return 0, fmt.Errorf("proto: illegal wireType %d", wireType) } + if iNdEx < 0 { + return 0, ErrInvalidLengthNodenetsvc + } + if depth == 0 { + return iNdEx, nil + } } - panic("unreachable") + return 0, io.ErrUnexpectedEOF } var ( - ErrInvalidLengthNodenetsvc = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowNodenetsvc = fmt.Errorf("proto: integer overflow") + ErrInvalidLengthNodenetsvc = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowNodenetsvc = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupNodenetsvc = fmt.Errorf("proto: unexpected end of group") )