From e874771c19e996595ac5df3b393d9a51efafcf02 Mon Sep 17 00:00:00 2001 From: Hamza El-Saawy <84944216+helsaawy@users.noreply.github.com> Date: Mon, 18 Sep 2023 20:03:43 -0400 Subject: [PATCH] [release/0.9] Update CI (#1891) * [release/0.9] Update CI Incorporate several CI changes from multiple PRs: - https://github.com/microsoft/hcsshim/pull/1632 - https://github.com/microsoft/hcsshim/pull/1752 - https://github.com/microsoft/hcsshim/pull/1755 - https://github.com/microsoft/hcsshim/pull/1799 - https://github.com/microsoft/hcsshim/pull/1820 - https://github.com/microsoft/hcsshim/pull/1836 - https://github.com/microsoft/hcsshim/pull/1853 - https://github.com/microsoft/hcsshim/pull/1854 It is easier to checkout the changes directly rather than cherry-pick commits and undo any changes that affect code not backported to this release. Remove `/usr/local/include` from `Protobuild.toml`, since it does not exist on Windows, and our CI build logic does not rely on it. Update `.gitignore` and `.gitattributes` to match main. Signed-off-by: Hamza El-Saawy * [release/0.9] Skip failaing symlink tests CRI integration tests `TestContainerSymlinkVolumes/*` are consistently failing. Skip until a fix is backported from containerd 1.7 to 1.6. Signed-off-by: Hamza El-Saawy [release/0.9] Skip failing symlink tests Signed-off-by: Hamza El-Saawy * [release/0.9] Update proto files to v3 Many files were last updated with `github.com/gogo/protobuf@v1.2`, hence the `proto.GoGoProtoPackageIsVersion2` assertion in the `*.pb.go` files. Regenerate them using new version (v1.6.2) of `protoc-gen-gogoctrd`. Signed-off-by: Hamza El-Saawy * [release/0.9] Update generated files Run `go generate` on repo to bring all auto-generated files up to date. Fix bug in `internal\winapi\winapi.go` where `user.go` is referenced but does not exist. Signed-off-by: Hamza El-Saawy --------- Signed-off-by: Hamza El-Saawy --- .gitattributes | 4 +- .github/workflows/ci.yml | 464 +++- .gitignore | 19 +- Protobuild.toml | 2 +- .../options/runhcs.pb.go | 389 ++- .../resource_windows_386.syso | Bin 977 -> 982 bytes .../resource_windows_amd64.syso | Bin 977 -> 982 bytes .../resource_windows_arm.syso | Bin 0 -> 982 bytes .../resource_windows_arm64.syso | Bin 0 -> 982 bytes .../stats/stats.pb.go | 759 +++--- .../ncproxygrpc/networkconfigproxy.pb.go | 1311 +++++----- cmd/ncproxy/nodenetsvc/nodenetsvc.pb.go | 321 +-- cmd/runhcs/resource_windows_386.syso | Bin 968 -> 966 bytes cmd/runhcs/resource_windows_amd64.syso | Bin 968 -> 966 bytes cmd/runhcs/resource_windows_arm.syso | Bin 0 -> 966 bytes cmd/runhcs/resource_windows_arm64.syso | Bin 0 -> 966 bytes cmd/wclayer/resource_windows_386.syso | Bin 969 -> 966 bytes cmd/wclayer/resource_windows_amd64.syso | Bin 969 -> 966 bytes cmd/wclayer/resource_windows_arm.syso | Bin 0 -> 966 bytes cmd/wclayer/resource_windows_arm64.syso | Bin 0 -> 966 bytes internal/computeagent/computeagent.pb.go | 355 +-- .../ncproxyttrpc/networkconfigproxy.pb.go | 248 +- internal/regstate/zsyscall_windows.go | 3 +- internal/shimdiag/shimdiag.pb.go | 388 ++- internal/vmservice/vmservice.pb.go | 2290 ++++++++--------- internal/winapi/winapi.go | 2 +- 26 files changed, 3482 insertions(+), 3073 deletions(-) create mode 100644 cmd/containerd-shim-runhcs-v1/resource_windows_arm.syso create mode 100644 cmd/containerd-shim-runhcs-v1/resource_windows_arm64.syso create mode 100644 cmd/runhcs/resource_windows_arm.syso create mode 100644 cmd/runhcs/resource_windows_arm64.syso create mode 100644 cmd/wclayer/resource_windows_arm.syso create mode 100644 cmd/wclayer/resource_windows_arm64.syso diff --git a/.gitattributes b/.gitattributes index 94f480de94..dd0d09faac 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,3 @@ -* text=auto eol=lf \ No newline at end of file +* text=auto eol=lf +vendor/** -text +test/vendor/** -text \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 563f70c0c3..bec3e7ac18 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,70 +4,285 @@ on: - pull_request env: - GO_VERSION: '1.19.x' + GO_VERSION: "1.19.x" + CONTAINERD_VERSION: "v1.6.23" + GOTESTSUM_VERSION: "latest" + GOTESTCMD: "gotestsum --format standard-verbose --debug --" jobs: lint: - runs-on: 'windows-2019' + runs-on: "windows-2022" + strategy: + fail-fast: false + matrix: + root: ["", test] # cannot specify "./... ./test/..." unless in go workspace + steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - name: Checkout + uses: actions/checkout@v3 + + - name: Install go + uses: actions/setup-go@v4 with: go-version: ${{ env.GO_VERSION }} + # sometimes go cache causes issues with lint + cache: false + + # lint issues in Windows code + # linter does not work for GOOS=linux since not Windows-specific code is gated with `//go:build windows` + - uses: golangci/golangci-lint-action@v3 + with: + version: v1.52 + args: >- + --verbose + --max-issues-per-linter=0 + --max-same-issues=0 + --modules-download-mode=readonly + --timeout=10m + --issues-exit-code 0 + working-directory: ${{ matrix.root }} + env: + GOOS: windows + + protos: + runs-on: "windows-2022" - - name: golangci-lint - uses: golangci/golangci-lint-action@v2 + env: + # translating from github.com/Microsoft/hcsshim/ (via `go list`) to is easier if hcsshim is in GOPATH/src + GOPATH: '${{ github.workspace }}\go' + + steps: + # protobuild requires the code to be in $GOPATH to translate from github.com/Microsoft/hcsshim + # to the correct path on disk + - name: Checkout hcsshim + uses: actions/checkout@v3 + with: + path: "${{ github.workspace }}/go/src/github.com/Microsoft/hcsshim" + + - name: Checkout containerd + uses: actions/checkout@v3 with: - version: v1.48 - args: --timeout=5m -v - skip-go-installation: true - only-new-issues: true + repository: containerd/containerd + ref: ${{ env.CONTAINERD_VERSION }} + path: "${{ github.workspace }}/go/src/github.com/containerd/containerd" + + - name: Install go + uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + cache-dependency-path: | + ${{ github.workspace }}/go/src/github.com/Microsoft/hcsshim/go.sum + ${{ github.workspace }}/go/src/github.com/containerd/containerd/go.sum + + # cannot use `go install` because of replace directive in `go.mod` + - name: Install protoc-gen-gogoctrd + shell: powershell + run: | + $bin = Join-Path (go env GOPATH) 'bin' + mkdir -f $bin + + go build -o $bin ./cmd/protoc-gen-gogoctrd + working-directory: "${{ github.workspace }}/go/src/github.com/containerd/containerd" + + - name: Install protoc + shell: powershell + run: | + gh release download -R protocolbuffers/protobuf -p 'protoc-*-win32.zip' -O protoc.zip 'v23.2' + if ( $LASTEXITCODE ) { + Write-Output '::error::Could not download protoc.' + exit $LASTEXITCODE + } + + tar.exe xf protoc.zip + if ( $LASTEXITCODE ) { + Write-Output '::error::Could not install protoc.' + exit $LASTEXITCODE + } + + mkdir -f ${{ github.workspace }}/go/src/github.com/Microsoft/hcsshim/protobuf + mv include/* ${{ github.workspace }}/go/src/github.com/Microsoft/hcsshim/protobuf + + # put protoc in GOBIN to make things easier + $bin = Join-Path (go env GOPATH) 'bin' + mkdir -f $bin + mv bin\protoc.exe $bin + + $bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Run protobuild + shell: powershell + run: | + go install github.com/containerd/protobuild@v0.3.0 + + Write-Output "::group::protobuild" + protobuild $(go list ./... | grep -v /vendor/) + Write-Output "::endgroup::" - verify-main-vendor: - runs-on: 'windows-2019' + # look for any new files not previously tracked + git add --all --intent-to-add . + Write-Output "::group::git diff" + git diff --exit-code + Write-Output "::endgroup::" + working-directory: "${{ github.workspace }}/go/src/github.com/Microsoft/hcsshim" + + verify-vendor: + runs-on: "windows-2022" env: GOPROXY: "https://proxy.golang.org,direct" steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - name: Checkout + uses: actions/checkout@v3 + + - name: Install go + uses: actions/setup-go@v4 with: go-version: ${{ env.GO_VERSION }} - - name: Validate main modules + + - name: Validate go.mod and vendoring + shell: powershell + run: | + Write-Output "::group::go mod tidy & vendor" + go mod tidy + go mod vendor + Write-Output "::endgroup::" + + git add --all --intent-to-add . + Write-Output "::group::git diff" + git diff --stat --exit-code + Write-Output "::endgroup::" + + if ($LASTEXITCODE -ne 0) { + Write-Output "::error ::./go.mod is not up to date. Please run ``go mod tidy && go mod vendor`` " + exit $LASTEXITCODE + } + + - name: Validate test/go.mod shell: powershell + working-directory: test run: | - $currentPath = (Get-Location).Path - $process = Start-Process powershell.exe -PassThru -Verb runAs -Wait -ArgumentList $currentPath/scripts/Verify-GoModules.ps1, $currentPath - if ($process.ExitCode -ne 0) { - Write-Error "Main modules are not up to date. Please validate your go version >= this job's and run `go mod vendor` followed by `go mod tidy` in the repo root path." + Write-Output "::group::go mod tidy" + go mod tidy + Write-Output "::endgroup::" + + git add --all --intent-to-add . + Write-Output "::group::git diff" + git diff --stat --exit-code + Write-Output "::endgroup::" + + if ($LASTEXITCODE -ne 0) { + Write-Output "::error ::./test/go.mod is not up to date. Please run ``go mod tidy && go mod vendor`` from within ``./test``" + exit $LASTEXITCODE } - exit $process.ExitCode - test: + go-gen: + name: Go Generate + runs-on: "windows-2022" + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install go + uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install goversioninfo + run: | + go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@v1.4.0 + + - name: Validate go generate + shell: powershell + run: | + Write-Output "::group::go generate" + go generate -x .\... + Write-Output "::endgroup::" + if ($LASTEXITCODE -ne 0) { + Write-Output "::error title=Go Generate::Error running go generate." + exit $LASTEXITCODE + } + + git add --all --intent-to-add . + Write-Output "::group::git diff" + git diff --stat --exit-code + Write-Output "::endgroup::" + if ($LASTEXITCODE -ne 0) { + Write-Output "::error ::Generated files are not up to date. Please run ``go generate .\...``." + exit $LASTEXITCODE + } + + test-linux: + needs: [lint, protos, verify-vendor, go-gen] + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install go + uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Install gotestsum + run: go install gotest.tools/gotestsum@${{ env.GOTESTSUM_VERSION }} + + - name: Run guest code unit tests + run: ${{ env.GOTESTCMD }} -gcflags=all=-d=checkptr ./internal/guest/... + + test-windows: + needs: [lint, protos, verify-vendor, go-gen] runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [windows-2019, windows-2022] steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - name: Checkout + uses: actions/checkout@v3 + + - name: Install go + uses: actions/setup-go@v4 with: go-version: ${{ env.GO_VERSION }} - - run: go test -gcflags=all=-d=checkptr -v ./... -tags admin - - run: go test -mod=mod -gcflags=all=-d=checkptr -v ./internal -tags admin - working-directory: test - - run: go test -mod=mod -gcflags=all=-d=checkptr -c ./containerd-shim-runhcs-v1/ -tags functional + - name: Install gotestsum + run: go install gotest.tools/gotestsum@${{ env.GOTESTSUM_VERSION }} + + # run tests + - name: Test repo + run: ${{ env.GOTESTCMD }} -gcflags=all=-d=checkptr -tags admin ./... + + - name: Run non-functional tests + run: ${{ env.GOTESTCMD }} -mod=mod -gcflags=all=-d=checkptr ./internal/... working-directory: test - - run: go test -mod=mod -gcflags=all=-d=checkptr -c ./cri-containerd/ -tags functional + + - name: Run containerd-shim-runhcs-v1 tests + shell: powershell + run: | + powershell { + cd '../..' + go build -trimpath -o './test/containerd-shim-runhcs-v1' ./cmd/containerd-shim-runhcs-v1 + } + ${{ env.GOTESTCMD }} -mod=mod -tags functional -gcflags=all=-d=checkptr ./... + working-directory: test/containerd-shim-runhcs-v1 + + # build testing binaries + - name: Build cri-containerd Testing Binary + run: go test -mod=mod -gcflags=all=-d=checkptr -c -tags functional ./cri-containerd working-directory: test - - run: go test -mod=mod -gcflags=all=-d=checkptr -c ./functional/ -tags functional + - name: Build functional Testing Binary + run: go test -mod=mod -gcflags=all=-d=checkptr -c -tags functional ./functional working-directory: test - - run: go test -mod=mod -gcflags=all=-d=checkptr -c ./runhcs/ -tags functional + - name: Build runhcs Testing Binary + run: go test -mod=mod -gcflags=all=-d=checkptr -c -tags functional ./runhcs working-directory: test - - run: go build -mod=mod -o sample-logging-driver.exe ./cri-containerd/helpers/log.go + - name: Build logging-driver Binary + run: go build -mod=mod -o sample-logging-driver.exe ./cri-containerd/helpers/log.go working-directory: test - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 + if: ${{ github.event_name == 'pull_request' }} with: name: test_binaries_${{ matrix.os }} path: | @@ -77,11 +292,162 @@ jobs: test/runhcs.test.exe test/sample-logging-driver.exe + integration-tests: + needs: [lint, protos, verify-vendor, go-gen] + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [windows-2019, windows-2022] + + steps: + - name: Checkout hcsshim + uses: actions/checkout@v3 + with: + path: src/github.com/Microsoft/hcsshim + + - name: Checkout containerd + uses: actions/checkout@v3 + with: + path: src/github.com/containerd/containerd + repository: "containerd/containerd" + ref: ${{ env.CONTAINERD_VERSION }} + + - name: Install go + uses: actions/setup-go@v4 + with: + go-version: ${{ env.GO_VERSION }} + check-latest: true + cache-dependency-path: | + src/github.com/Microsoft/hcsshim/go.sum + src/github.com/containerd/containerd/go.sum + + - name: Set env + shell: bash + run: | + mkdir -p "${{ github.workspace }}/bin" + echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV + echo "${{ github.workspace }}/bin" >> $GITHUB_PATH + echo "${{ github.workspace }}/src/github.com/containerd/containerd/bin" >> $GITHUB_PATH + + - name: Install crictl + shell: powershell + run: | + gh release download -R kubernetes-sigs/cri-tools -p 'crictl-*-windows-amd64.tar.gz' -O c:\crictl.tar.gz 'v1.24.2' + tar.exe xf c:\crictl.tar.gz -C '${{ github.workspace }}/bin' + + if ( $LASTEXITCODE ) { + Write-Output '::error::Could not install crictl.' + exit $LASTEXITCODE + } + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # needs to be a separate step since terminal reload is required to bring in new env variables and PATH + - name: Upgrade Chocolaty + shell: powershell + run: | + choco upgrade -y chocolatey 2>&1 + + - name: Install mingw + shell: powershell + run: | + $VerbosePreference = 'Continue' + # dont set $ErrorActionPreference since we want to allow choco install to fail later on + + Write-Output 'Install mingw' + # Install sometimes fails when downloading mingw zip from source-forge with: + # "ERROR: The remote file either doesn't exist, is unauthorized, or is forbidden for url" + # Issue is with accessing from source-forge, which version 10.3+ do not use, but cannot upgrade versions. + + # Add retry and backoff + foreach ( $i in 1..3 ) { + Write-Output "::group::Attempt $i" + if ( $i -gt 1 ) { + # remove any left-over state + choco uninstall -y --no-progress --force mingw + + Write-Output 'Sleeping for 60 seconds' + Sleep -Seconds 60 + } + + choco install -y --no-progress --stop-on-first-failure --force mingw --allow-downgrade --version 10.3.0 + Write-Output '::endgroup::' + if ( -not $LASTEXITCODE ) { + Write-Output "Attempt $i succeeded (exit code: $LASTEXITCODE)" + break + } + Write-Output "::warning title=mingw::Attempt $i failed (exit code: $LASTEXITCODE)" + } + + if ( $LASTEXITCODE ) { + Write-Output "::error::Could not install mingw after $i attempts." + exit $LASTEXITCODE + } + + # verify mingw32-make was installed + Get-Command -CommandType Application -ErrorAction Stop mingw32-make.exe + + - name: Build binaries + shell: bash + working-directory: src/github.com/containerd/containerd + run: | + set -o xtrace + mingw32-make.exe binaries + script/setup/install-cni-windows + + - name: Build the shim + working-directory: src/github.com/Microsoft/hcsshim + shell: powershell + run: | + go build -mod vendor -o "${{ github.workspace }}/src/github.com/containerd/containerd/bin/containerd-shim-runhcs-v1.exe" .\cmd\containerd-shim-runhcs-v1 + + - name: Install gotestsum + run: go install gotest.tools/gotestsum@${{ env.GOTESTSUM_VERSION }} + + - name: Run containerd integration tests + shell: bash + working-directory: src/github.com/containerd/containerd + run: | + # TODO: when https://github.com/containerd/containerd/pull/8691 makes it into the next release (container v1.6.22?), remove the skip + # `-skip` is only available in go1.20 + export EXTRA_TESTFLAGS='-timeout=20m -run="[^(TestConvert)]"' + export GOTEST='gotestsum --format=standard-verbose --debug --' + make integration + + - name: Run containerd CRI integration tests + shell: bash + working-directory: src/github.com/containerd/containerd + env: + TEST_IMAGE_LIST: ${{github.workspace}}/repolist.toml + BUSYBOX_TESTING_IMAGE_REF: "k8s.gcr.io/e2e-test-images/busybox:1.29-2" + RESOURCE_CONSUMER_TESTING_IMAGE_REF: "k8s.gcr.io/e2e-test-images/resource-consumer:1.10" + CGO_ENABLED: 1 + run: | + cat > "${{ env.TEST_IMAGE_LIST }}" << EOF + busybox = "${{ env.BUSYBOX_TESTING_IMAGE_REF }}" + ResourceConsumer = "${{ env.RESOURCE_CONSUMER_TESTING_IMAGE_REF }}" + EOF + # In the stable version of hcsshim that is used in containerd, killing a task + # that has already exited or a task that has not yet been started, yields a + # ErrNotFound. The master version of hcsshim returns nil, which is in line with + # how the linux runtime behaves. See: + # https://github.com/containerd/containerd/blob/f4f41296c2b0ac7d60aae3dd9c219a7636b0a07e/integration/restart_test.go#L152-L160 + # + # We skip this test here, until a new release of hcsshim is cut and the one in + # containerd is updated. When the shim is updated in containerd, this test will + # also need to be updated and the special case for windows, removed. + FOCUS="[^(TestContainerdRestart|TestContainerSymlinkVolumes)]" make cri-integration + build: - runs-on: 'windows-2019' + needs: [test-windows, test-linux] + runs-on: "windows-2022" steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 + - name: Checkout + uses: actions/checkout@v3 + + - name: Install go + uses: actions/setup-go@v4 with: go-version: ${{ env.GO_VERSION }} @@ -92,36 +458,48 @@ jobs: - run: go build ./cmd/device-util - run: go build ./cmd/ncproxy - run: go build ./cmd/dmverity-vhd + - run: go build ./cmd/dmverity-vhd + env: + GOOS: linux + GOARCH: amd64 - run: go build ./internal/tools/grantvmgroupaccess - run: go build ./internal/tools/securitypolicy - run: go build ./internal/tools/uvmboot - run: go build ./internal/tools/zapdir - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 + if: ${{ github.event_name == 'pull_request' }} with: name: binaries path: | containerd-shim-runhcs-v1.exe runhcs.exe tar2ext4.exe - device-util.exe wclayer.exe + device-util.exe + ncproxy.exe + dmverity-vhd.exe + dmverity-vhd grantvmgroupaccess.exe + securitypolicy.exe uvmboot.exe zapdir.exe - ncproxy.exe build_gcs: + needs: test-linux runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install go - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: go-version: ${{ env.GO_VERSION }} + - name: Test + run: make test + - name: Pull busybox image run: docker pull busybox @@ -132,7 +510,5 @@ jobs: run: | docker export base_image_container | gzip > base.tar.gz - - name: Build And Test - run: | - BASE=./base.tar.gz - make all test + - name: Build + run: make BASE=./base.tar.gz all diff --git a/.gitignore b/.gitignore index 54ed6f06c9..74b68f0ad9 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ # Ignore vscode setting files .vscode/ +.idea/ # Test binary, build with `go test -c` *.test @@ -23,16 +24,30 @@ service/pkg/ *.img *.vhd *.tar.gz +*.tar # Make stuff .rootfs-done bin/* rootfs/* +rootfs-conv/* *.o /build/ deps/* out/* -.idea/ -.vscode/ \ No newline at end of file +# protobuf files +# only files at root of the repo, otherwise this will cause issues with vendoring +/protobuf/* + +# test results +test/results + +# go workspace files +go.work +go.work.sum + +# keys and related artifacts +*.pem +*.cose diff --git a/Protobuild.toml b/Protobuild.toml index ee18671aa6..413caab899 100644 --- a/Protobuild.toml +++ b/Protobuild.toml @@ -17,7 +17,7 @@ plugins = ["grpc", "fieldpath"] # Paths that will be added untouched to the end of the includes. We use # `/usr/local/include` to pickup the common install location of protobuf. # This is the default. - after = ["/usr/local/include"] + after = [""] # This section maps protobuf imports to Go packages. These will become # `-M` directives in the call to the go protobuf generator. diff --git a/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go b/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go index 89aff3723a..33754d63ea 100644 --- a/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go +++ b/cmd/containerd-shim-runhcs-v1/options/runhcs.pb.go @@ -10,6 +10,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" @@ -25,7 +26,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 @@ -162,7 +163,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 } @@ -211,7 +212,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 } @@ -308,7 +309,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 } @@ -316,131 +317,144 @@ 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.IoRetryTimeoutInSec != 0 { + i = encodeVarintRunhcs(dAtA, i, uint64(m.IoRetryTimeoutInSec)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x88 + } + 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.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.ShareScratch { + i-- + if m.ShareScratch { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if m.DebugType != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(m.DebugType)) + i-- + dAtA[i] = 0x70 } - if len(m.RegistryRoot) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.RegistryRoot))) - i += copy(dAtA[i:], m.RegistryRoot) + if m.DefaultVmScratchSizeInGb != 0 { + i = encodeVarintRunhcs(dAtA, i, uint64(m.DefaultVmScratchSizeInGb)) + i-- + dAtA[i] = 0x68 } - if len(m.SandboxImage) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.SandboxImage))) - i += copy(dAtA[i:], m.SandboxImage) + if m.DefaultContainerScratchSizeInGb != 0 { + i = encodeVarintRunhcs(dAtA, i, uint64(m.DefaultContainerScratchSizeInGb)) + i-- + dAtA[i] = 0x60 } - 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.ScaleCpuLimitsToSandbox { + i-- + if m.ScaleCpuLimitsToSandbox { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x58 } - if m.SandboxIsolation != 0 { - dAtA[i] = 0x30 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(m.SandboxIsolation)) + 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.BootFilesRootPath) > 0 { - dAtA[i] = 0x3a - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.BootFilesRootPath))) - i += copy(dAtA[i:], m.BootFilesRootPath) + if m.VmMemorySizeInMb != 0 { + i = encodeVarintRunhcs(dAtA, i, uint64(m.VmMemorySizeInMb)) + i-- + dAtA[i] = 0x48 } if m.VmProcessorCount != 0 { - dAtA[i] = 0x40 - i++ i = encodeVarintRunhcs(dAtA, i, uint64(m.VmProcessorCount)) + i-- + dAtA[i] = 0x40 } - if m.VmMemorySizeInMb != 0 { - dAtA[i] = 0x48 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(m.VmMemorySizeInMb)) + 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 len(m.GPUVHDPath) > 0 { - dAtA[i] = 0x52 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(len(m.GPUVHDPath))) - i += copy(dAtA[i:], m.GPUVHDPath) + if m.SandboxIsolation != 0 { + i = encodeVarintRunhcs(dAtA, i, uint64(m.SandboxIsolation)) + i-- + dAtA[i] = 0x30 } - if m.ScaleCpuLimitsToSandbox { - dAtA[i] = 0x58 - i++ - if m.ScaleCpuLimitsToSandbox { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ + 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 m.DefaultContainerScratchSizeInGb != 0 { - dAtA[i] = 0x60 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(m.DefaultContainerScratchSizeInGb)) + 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 m.DefaultVmScratchSizeInGb != 0 { - dAtA[i] = 0x68 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(m.DefaultVmScratchSizeInGb)) + 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.ShareScratch { - dAtA[i] = 0x70 - i++ - if m.ShareScratch { + 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 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.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.IoRetryTimeoutInSec != 0 { - dAtA[i] = 0x88 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintRunhcs(dAtA, i, uint64(m.IoRetryTimeoutInSec)) - } - 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 } @@ -448,74 +462,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 + } + 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 i, nil + 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 { @@ -628,14 +652,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)))) @@ -673,7 +690,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) + `,`, @@ -1146,10 +1163,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 { @@ -1411,10 +1425,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 { @@ -1433,6 +1444,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 { @@ -1464,10 +1476,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 { @@ -1488,55 +1498,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/resource_windows_386.syso b/cmd/containerd-shim-runhcs-v1/resource_windows_386.syso index 6214bb79ba35a9d3ed44fad890662b06ee6a2968..25143b01c6b6a5e3093519a44a5431752767a52d 100644 GIT binary patch delta 52 zcmcb}evO^ehmny11P)B(l;$j8W?--Za@I`LozJ*q<5^`!7LeTL4~*M^$|f&o)&c-C C6%1wo delta 45 ycmcb{evzHihmny11a?p4l;+H4W?--Za+XijozJ*s<5^|K&0iR|GfrN^tOWq@F$`A# diff --git a/cmd/containerd-shim-runhcs-v1/resource_windows_amd64.syso b/cmd/containerd-shim-runhcs-v1/resource_windows_amd64.syso index 2d325aa55348c4d56cb73f88458756c00b454d3b..831af5e8a5f8271ad91a8230b8316b7204b2dde5 100644 GIT binary patch delta 52 zcmcb}evO?orHzpR1P)B(l;$j8W?--Za@I`LozJ*q<5^`!7LeTL4~*Lx85t%oXVwA$ DPh$-O delta 45 ycmcb{evzFsrHzpR1a?p4l;+H4W?--Za+XijozJ*s<5^|K&0iR|GfrN^tOWoFLk#o) diff --git a/cmd/containerd-shim-runhcs-v1/resource_windows_arm.syso b/cmd/containerd-shim-runhcs-v1/resource_windows_arm.syso new file mode 100644 index 0000000000000000000000000000000000000000..1f1f0d902b635ca90f845a1b9238fc96ceb68c64 GIT binary patch literal 982 zcma)5!EVz)5FMwvG$#%{a9k{|o5YX^r*e`CL8V-1MN2rMjlFJGvUe@76Q~eUKY>r+ z12}Ml3lazZhd)5PwXsME2gaVA*_k(Q#+%J|&m$+_4u~4B>-9@p#&xt=3gjZVA7Pzz zpeOa~cCB>i4qQfba~Jj;7G_7hnm_zU{II(hL|ubl@1;C)`1e43fF3nN!z20v|MSlN z$QvQLqzih5^(j4vx1ck6hW!HTDSRhiyFY$5U*8rtc3x+Rx_H{m?+{gRJn&Uik|Ir4 zU{jQl1hb};4DvVwV1_h;PHOuYD^W;?h@Yd^KtN@3_Gy=>mBjMaWIRHiTH+jakvb4(RsUP%*K9f2&iPBe7|Hb7g z4}E4Up%alAEvNpqwEle7i-ff@UuD+}_1aGTO{tGc)(Zb>LDMcGUTg?81qq>CgY(9#$qDg`GY?+(O|E8G`KY^j(pIb`K(7b?#F|4 R>f7IVyZ=>pM-S>d@C)-=ySM-V literal 0 HcmV?d00001 diff --git a/cmd/containerd-shim-runhcs-v1/resource_windows_arm64.syso b/cmd/containerd-shim-runhcs-v1/resource_windows_arm64.syso new file mode 100644 index 0000000000000000000000000000000000000000..b0e6a4c328b85a1f8dd90ae57430acd1d1f52747 GIT binary patch literal 982 zcma)5!EVz)5FMwvG$#%{a9k{|o5YX^r*e`CL8V-1MN2rMjlFJGvUe@76Q~eUKY>r+ zj5u(E3le|CA0Xb^SfqplW6#d)%$qmk%_jNik(2KSM2*+=`lT)7I@&A+auM85uueMA zllpbLRyuSCE+e|R3wsU=vm;*3AO0hL*xd`FuEDSOQXV<{dmuhQkD8(35q*XKWoLin zjSyYZ1--)hl%B&|&>20$eu4EAzLRg=A3vL~Z;Kl{ud_s5JZ8q*#;_{S- zKC_k3iO7tWQ~z38e?IF)!djWHvTKHVZKwXG)W-v&O* zg;uGw)pEDltj8cxB5ho%qQVff*yu_qEz5-4waR(9(d*dqZ4eE1VND?#6rxfqm8t4K zX1N7-Q#JkT8AMTJDh3&5sL5T_Npz2M_EPD@ytXVDGS2_X+f7lJvXaT!1zRLj|7|FT z=_3(5;Hz}?kdIOs^3_C)`6x`2@lXU~F%j?l!5^Avu-82r+!_`~K4{N;)}tHu<3T$0 Q?Qgu@|EjyA2lXBJ1q#)?0RR91 literal 0 HcmV?d00001 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/cmd/ncproxy/ncproxygrpc/networkconfigproxy.pb.go b/cmd/ncproxy/ncproxygrpc/networkconfigproxy.pb.go index 1af5200ca2..a3e59f2835 100644 --- a/cmd/ncproxy/ncproxygrpc/networkconfigproxy.pb.go +++ b/cmd/ncproxy/ncproxygrpc/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 CreateNetworkRequest_NetworkMode int32 @@ -97,7 +100,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 } @@ -135,7 +138,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 } @@ -177,7 +180,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 } @@ -215,7 +218,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 } @@ -256,7 +259,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 } @@ -294,7 +297,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 } @@ -338,7 +341,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 } @@ -377,7 +380,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 } @@ -416,7 +419,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 } @@ -457,7 +460,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 } @@ -498,7 +501,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 } @@ -544,7 +547,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 } @@ -583,7 +586,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 } @@ -623,7 +626,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 } @@ -661,7 +664,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 } @@ -700,7 +703,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 } @@ -738,7 +741,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 } @@ -777,7 +780,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 } @@ -815,7 +818,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 } @@ -854,7 +857,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 } @@ -897,7 +900,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 } @@ -936,7 +939,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 } @@ -976,7 +979,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 } @@ -1014,7 +1017,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 } @@ -1053,7 +1056,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 } @@ -1091,7 +1094,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 } @@ -1130,7 +1133,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 } @@ -1426,6 +1429,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) } @@ -1706,7 +1750,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 } @@ -1714,38 +1758,47 @@ 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 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 *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 } @@ -1753,20 +1806,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 } @@ -1774,48 +1833,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.IovPolicySettings != nil { + { + size, err := m.IovPolicySettings.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.IovPolicySettings != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IovPolicySettings.Size())) - n1, err := m.IovPolicySettings.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 *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 } @@ -1823,20 +1893,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 } @@ -1844,38 +1920,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 } @@ -1883,20 +1968,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 } @@ -1904,63 +1995,66 @@ 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 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 } @@ -1968,26 +2062,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 } @@ -1995,26 +2096,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 } @@ -2022,35 +2130,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 } - return i, nil + if m.IovOffloadWeight != 0 { + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IovOffloadWeight)) + i-- + dAtA[i] = 0x8 + } + 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 } @@ -2058,56 +2172,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 } @@ -2115,82 +2224,99 @@ 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 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.Macaddress) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Macaddress))) - i += copy(dAtA[i:], m.Macaddress) + 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] = 0x1 + i-- + dAtA[i] = 0x82 } - 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.IovPolicySettings != nil { + { + size, err := m.IovPolicySettings.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a } - if len(m.IpaddressPrefixlength) > 0 { - dAtA[i] = 0x22 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.IpaddressPrefixlength))) - i += copy(dAtA[i:], m.IpaddressPrefixlength) + 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] = 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.PortnamePolicySetting != nil { - dAtA[i] = 0x32 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.PortnamePolicySetting.Size())) - n2, err := m.PortnamePolicySetting.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n2 + if len(m.IpaddressPrefixlength) > 0 { + i -= len(m.IpaddressPrefixlength) + copy(dAtA[i:], m.IpaddressPrefixlength) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.IpaddressPrefixlength))) + i-- + dAtA[i] = 0x22 } - if m.IovPolicySettings != nil { - dAtA[i] = 0x3a - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.IovPolicySettings.Size())) - n3, err := m.IovPolicySettings.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n3 + 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.DnsSetting != nil { - dAtA[i] = 0x82 - i++ - dAtA[i] = 0x1 - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.DnsSetting.Size())) - n4, err := m.DnsSetting.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n4 + 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 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 *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 } @@ -2198,26 +2324,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 } @@ -2225,32 +2358,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 } @@ -2258,20 +2399,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 } @@ -2279,26 +2426,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 } @@ -2306,20 +2460,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 } @@ -2327,26 +2487,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 } @@ -2354,20 +2521,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 } @@ -2375,26 +2548,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 } @@ -2402,54 +2582,66 @@ 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.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - if len(m.Name) > 0 { - dAtA[i] = 0x12 - 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.Network) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Network))) - i += copy(dAtA[i:], m.Network) + 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] = 0x2a } if len(m.Namespace) > 0 { - dAtA[i] = 0x22 - i++ + i -= len(m.Namespace) + copy(dAtA[i:], m.Namespace) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Namespace))) - i += copy(dAtA[i:], m.Namespace) + i-- + dAtA[i] = 0x22 } - if m.DnsSetting != nil { - dAtA[i] = 0x2a - i++ - i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(m.DnsSetting.Size())) - n5, err := m.DnsSetting.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n5 + if len(m.Network) > 0 { + i -= len(m.Network) + copy(dAtA[i:], m.Network) + i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Network))) + i-- + dAtA[i] = 0x1a } - 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] = 0x12 } - return i, nil + 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 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 } @@ -2457,26 +2649,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 } @@ -2484,32 +2683,40 @@ 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 len(m.Name) > 0 { - dAtA[i] = 0x12 - i++ + i -= len(m.Name) + copy(dAtA[i:], m.Name) i = encodeVarintNetworkconfigproxy(dAtA, i, uint64(len(m.Name))) - i += copy(dAtA[i:], m.Name) + 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 } @@ -2517,20 +2724,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 } @@ -2538,32 +2751,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 } @@ -2571,20 +2792,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 } @@ -2592,36 +2819,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 { @@ -3145,14 +3382,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)))) @@ -3188,7 +3418,7 @@ func (this *ModifyNICRequest) String() string { `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, `NicID:` + fmt.Sprintf("%v", this.NicID) + `,`, `EndpointName:` + fmt.Sprintf("%v", this.EndpointName) + `,`, - `IovPolicySettings:` + strings.Replace(fmt.Sprintf("%v", this.IovPolicySettings), "IovEndpointPolicySetting", "IovEndpointPolicySetting", 1) + `,`, + `IovPolicySettings:` + strings.Replace(this.IovPolicySettings.String(), "IovEndpointPolicySetting", "IovEndpointPolicySetting", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -3301,9 +3531,9 @@ func (this *CreateEndpointRequest) String() string { `Ipaddress:` + fmt.Sprintf("%v", this.Ipaddress) + `,`, `IpaddressPrefixlength:` + fmt.Sprintf("%v", this.IpaddressPrefixlength) + `,`, `NetworkName:` + fmt.Sprintf("%v", this.NetworkName) + `,`, - `PortnamePolicySetting:` + strings.Replace(fmt.Sprintf("%v", this.PortnamePolicySetting), "PortNameEndpointPolicySetting", "PortNameEndpointPolicySetting", 1) + `,`, - `IovPolicySettings:` + strings.Replace(fmt.Sprintf("%v", this.IovPolicySettings), "IovEndpointPolicySetting", "IovEndpointPolicySetting", 1) + `,`, - `DnsSetting:` + strings.Replace(fmt.Sprintf("%v", this.DnsSetting), "DnsSetting", "DnsSetting", 1) + `,`, + `PortnamePolicySetting:` + strings.Replace(this.PortnamePolicySetting.String(), "PortNameEndpointPolicySetting", "PortNameEndpointPolicySetting", 1) + `,`, + `IovPolicySettings:` + strings.Replace(this.IovPolicySettings.String(), "IovEndpointPolicySetting", "IovEndpointPolicySetting", 1) + `,`, + `DnsSetting:` + strings.Replace(this.DnsSetting.String(), "DnsSetting", "DnsSetting", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -3404,7 +3634,7 @@ func (this *GetEndpointResponse) String() string { `Name:` + fmt.Sprintf("%v", this.Name) + `,`, `Network:` + fmt.Sprintf("%v", this.Network) + `,`, `Namespace:` + fmt.Sprintf("%v", this.Namespace) + `,`, - `DnsSetting:` + strings.Replace(fmt.Sprintf("%v", this.DnsSetting), "DnsSetting", "DnsSetting", 1) + `,`, + `DnsSetting:` + strings.Replace(this.DnsSetting.String(), "DnsSetting", "DnsSetting", 1) + `,`, `XXX_unrecognized:` + fmt.Sprintf("%v", this.XXX_unrecognized) + `,`, `}`, }, "") @@ -3447,8 +3677,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) + `,`, `}`, }, "") @@ -3468,8 +3703,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) + `,`, `}`, }, "") @@ -3614,10 +3854,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 { @@ -3668,10 +3905,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 { @@ -3854,10 +4088,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 { @@ -3908,10 +4139,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 { @@ -4058,10 +4286,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 { @@ -4112,10 +4337,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 { @@ -4332,10 +4554,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 { @@ -4418,10 +4637,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 { @@ -4504,10 +4720,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 { @@ -4615,10 +4828,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 { @@ -4765,10 +4975,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 { @@ -5087,10 +5294,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 { @@ -5173,10 +5377,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 { @@ -5291,10 +5492,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 { @@ -5345,10 +5543,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 { @@ -5431,10 +5626,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 { @@ -5485,10 +5677,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 { @@ -5571,10 +5760,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 { @@ -5625,10 +5811,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 { @@ -5711,10 +5894,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 { @@ -5929,10 +6109,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 { @@ -6015,10 +6192,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 { @@ -6133,10 +6307,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 { @@ -6187,10 +6358,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 { @@ -6275,10 +6443,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 { @@ -6329,10 +6494,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 { @@ -6417,10 +6579,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 { @@ -6439,6 +6598,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 { @@ -6470,10 +6630,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 { @@ -6494,55 +6652,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/cmd/ncproxy/nodenetsvc/nodenetsvc.pb.go b/cmd/ncproxy/nodenetsvc/nodenetsvc.pb.go index 61a2a8beed..74fac16530 100644 --- a/cmd/ncproxy/nodenetsvc/nodenetsvc.pb.go +++ b/cmd/ncproxy/nodenetsvc/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 } @@ -269,7 +272,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 } @@ -398,6 +401,20 @@ type NodeNetworkServiceServer interface { PingNodeNetworkService(context.Context, *PingNodeNetworkServiceRequest) (*PingNodeNetworkServiceResponse, 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 RegisterNodeNetworkServiceServer(s *grpc.Server, srv NodeNetworkServiceServer) { s.RegisterService(&_NodeNetworkService_serviceDesc, srv) } @@ -480,7 +497,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 } @@ -488,31 +505,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 } @@ -520,20 +544,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 } @@ -541,26 +571,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 } @@ -568,26 +605,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 } @@ -595,37 +639,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.NetworkNamespace) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.NetworkNamespace) + copy(dAtA[i:], m.NetworkNamespace) i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.NetworkNamespace))) - i += copy(dAtA[i:], m.NetworkNamespace) + 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 } - return i, nil + if m.RequestType != 0 { + i = encodeVarintNodenetsvc(dAtA, i, uint64(m.RequestType)) + i-- + dAtA[i] = 0x8 + } + 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 } @@ -633,46 +685,56 @@ 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.ErrorJson) > 0 { + i -= len(m.ErrorJson) + copy(dAtA[i:], m.ErrorJson) + i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.ErrorJson))) + i-- + dAtA[i] = 0x1a + } + if len(m.ResponseJson) > 0 { + i -= len(m.ResponseJson) + copy(dAtA[i:], m.ResponseJson) + i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.ResponseJson))) + i-- + dAtA[i] = 0x12 + } if m.Success { - dAtA[i] = 0x8 - i++ + i-- if m.Success { dAtA[i] = 1 } else { dAtA[i] = 0 } - i++ - } - if len(m.ResponseJson) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.ResponseJson))) - i += copy(dAtA[i:], m.ResponseJson) - } - if len(m.ErrorJson) > 0 { - dAtA[i] = 0x1a - i++ - i = encodeVarintNodenetsvc(dAtA, i, uint64(len(m.ErrorJson))) - i += copy(dAtA[i:], m.ErrorJson) - } - 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 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 { @@ -784,14 +846,7 @@ func (m *ConfigureContainerNetworkingResponse) 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)))) @@ -960,10 +1015,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 { @@ -1014,10 +1066,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 { @@ -1100,10 +1149,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 { @@ -1186,10 +1232,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 { @@ -1323,10 +1366,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 { @@ -1461,10 +1501,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 { @@ -1483,6 +1520,7 @@ func (m *ConfigureContainerNetworkingResponse) 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 { @@ -1514,10 +1552,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 { @@ -1538,55 +1574,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") ) diff --git a/cmd/runhcs/resource_windows_386.syso b/cmd/runhcs/resource_windows_386.syso index b4320575e4c5c95bfe35813298ae82a61e87fa35..3aabc3b51bcd13952db32117633a65b4434caa1f 100644 GIT binary patch delta 158 zcmX@XevF;dhmny11U5|Ml;%ueW?--Za^_6bozJ=hD6wSYMR`URko@EijOLRyn7k$z zGpS9U#pEu=r2qvsi3J5YnaPPInfZBklYcTPOqODHw?#V=Kufz delta 145 zcmX@ceuACThmny11U60Nl;%ugW?--Za^_9cozJ=jD6wwiMR~@_Ul`39c_(W#c>&2% zCN&^Ao5@{*mrDT(Y!V9!ax#+>OEUBG?06^tU{U}okzjTQlJU&qst|=X`pNmZ1wb`P bnK_vym3F*bHu{Oh#i_YTIUvsDIm}uB+*2hg diff --git a/cmd/runhcs/resource_windows_amd64.syso b/cmd/runhcs/resource_windows_amd64.syso index d6100a85b94087599ac086568b810e2fba5e51c1..628336e15acee8970ff3626b89b282251930e25e 100644 GIT binary patch delta 158 zcmX@XevF+nrHzpR1U5|Ml;%ueW?--Za^_6bozJ=hD6wSYMR`URko@EijOLRyn7k$z zGpS9U#pEu=r2qvsi3J5YnaPPInfZBklYcTPOqODHw?#&2% zCN&^Ao5@{*mrDT(Y!V9!ax#+>OEUBG?06^tU{U}okzjTQlJU&qst|=X`pNmZ1wb`P bnK_vym3F*bHu{Oh#i_YTIUvsDIm}uBF}Wqj diff --git a/cmd/runhcs/resource_windows_arm.syso b/cmd/runhcs/resource_windows_arm.syso new file mode 100644 index 0000000000000000000000000000000000000000..36c921d0bd9e720a290133c883783a6355436b54 GIT binary patch literal 966 zcma)5y^hmB5FY2!Tq=qyC>M)%lNb`=oSXz9I4KQx;*LY zuqnz&f>~2a26fy4Fhd$aC$)b9OBB)}@@MEYl+cD^uq@G8k_CrBKhc%~>I2;>QuGw+ z0V#mopGI^adlFrsD!^f}jR14YNVvBf2cT&FF3;FjmR1=(^@IM$ws;IEUtla2zY@@+$u0esV5S3b~OjZ9e_!iu)&C`^;_Py}N!5g+`)ADU>eH$58MS{C;^XfJrybIM)%lNb`=oSXz9I4KQx;*L3= z$Mx5pTItXogpBC=F8moh+>UrPfB295VRtWyz6QVED|zJbAA$G`J!+OlMDz{um!0#G zH$rwv=kyx(8NEQXpi_E|^8)q+v6JuJA3vL4-!?aXURQ~___USZDXI{7;H#)4MVc)Nu#E3~2fTH=kJY!o~T4nUq5Bfu&NgbO+>C37A^5TSt zKC_k3iO7tWQ~yd@e?IF)!djWHvMYvuZKwXG)W-v&O* zg;uGw)pB>(tj8cxB5ho%qQVlha--L=jRw291_ic4RBEL%RsF}{TX45RGprsciXu}n z$S|-bcUdRVJSz87 DB_Oo8 literal 0 HcmV?d00001 diff --git a/cmd/wclayer/resource_windows_386.syso b/cmd/wclayer/resource_windows_386.syso index b974a7ead661d38ec39e143b14892c108a77f86d..d6c1b22ef96f3d09f87480d57efbedc7fd08de80 100644 GIT binary patch delta 157 zcmX@fevF;dhmny11U5|Ml;%ueW?--Za^_6bozJ=hD6w?oMR`URko@EijOLRyn7k$z zGpSFW&Ezh|r2qvsi3J5YnaPPInfZBklYcQOOqOPLw?RnjBg=z@ZS<4#a|?hPk}`8L YODgTSZ1fY0i&Jxxa)4}*UGtf>0Q_hv?EnA( delta 145 zcmX@cev+Njhmny11U66Pl;%ukW?--Za^_FeozJ=jD6xLyMR~@_Ul`39c_(W#c>&2% zCUqb=hsj-nmrDT(Y!V9!ax#+>OEUBG?06^tWKsYskz{rUk_pV>st|=X`pNmZ1wb`P bnK_vym3F*bHu{Oh#i_YTIUvsDIm}uB;1eY@ diff --git a/cmd/wclayer/resource_windows_amd64.syso b/cmd/wclayer/resource_windows_amd64.syso index 4ffce84cfd00a645faf7df363c5aa7168589e7fa..421c14c0cee23f8a539b48619f4e53028fb567a5 100644 GIT binary patch delta 157 zcmX@fevF+nrHzpR1U5|Ml;%ueW?--Za^_6bozJ=hD6w?oMR`URko@EijOLRyn7k$z zGpSFW&Ezh|r2qvsi3J5YnaPPInfZBklYcQOOqOPLw?RnjBg=z@ZS<4#a|?hPk}`8L YODgTSZ1fY0i&Jxxa)4}*UGtf>09h(3iU0rr delta 145 zcmX@cev+LtrHzpR1U66Pl;%ukW?--Za^_FeozJ=jD6xLyMR~@_Ul`39c_(W#c>&2% zCUqb=hsj-nmrDT(Y!V9!ax#+>OEUBG?06^tWKsYskz{rUk_pV>st|=X`pNmZ1wb`P bnK_vym3F*bHu{Oh#i_YTIUvsDIm}uBHF+h` diff --git a/cmd/wclayer/resource_windows_arm.syso b/cmd/wclayer/resource_windows_arm.syso new file mode 100644 index 0000000000000000000000000000000000000000..9123d7ad33dd986509445c6fe90559d31e8f8dec GIT binary patch literal 966 zcma)5!EVz)5FMwvG$#%{a9k{|o5YX^r*hH?L8V-1MN2rs#$LB8*}In4Nr@0rKY%2q9yz()BWk>^*Dq}u*U@Hqi(CZv6ReXC z^tgWAu9XhmgUg6+?!%tJ!fc6G^N0V4?{{~CsB7?7J1LJG{v!~dp$E;-@QA*`|FX3| z@J5I(=$zhQeNHdo&FPe0U_Zxt0^iBE?vJ0%uWySRdsJtMx_H{m?+{gRJn&Uik|Ir) zU{jQl1hb};4DvVwV1_h;PHOuUD^W=Mh@YX-P(mw;!LmSQNfsOi^+an5s1J0j2+=dB z2c!UUw;Rzz%t>^CtN@3_Gy=>mBjMa`9e|>vcX`Ivvb4(RsUP%*K9f2&iPD!-|JB6_ z4}E4Up%alAEvNoQTK{O)i-ff@UuGMIdTpovs?>)zzLL4HJXdjPtVt^#oBUANyuS{7 zmJ6*?X{*I{vssTpqD0!bR7Hg$X4i2hHnNNc+rb6~xC(#4W*=wZ}b8T5LWSsw%x2vKsWhIl-b2d+={`*i4(4#ey9yz()BWk>^*Dq}u*U@Hqi(CZv6ReXC z^tgWAu9XhmgUg6+?!%tJ!fc6G^N0V4?{{~CsB7?7J1LJG{v!~dp$E;-@QA*_|FX3| z@J5I(=$zhQeNHdo&FPe0U_Zxt0^iB^?vJ0%uWySRdsJtMx_H{m?+{gRJn&Uik|Ir) zU{jQl1hb};4DvVwV1_h;PHOuUD^W=Mh@YX-P(mw;!LmSQNfsOi^+an5s1J0j2+=dB z2c!UUw;Rzz%t>^CtN@3_Gy=>mBjMa`9e|>vcX`Ivvb4(RsUP%*K9f2&iPD!-|JB6_ z4}E4Up%alAEvNoQTK{O)i-ff@UuGMIdTpovs?>)zzLL4HJXdjPtVt^#oBUANyuS{7 zmJ6*?X{*I{vssTpqD0!bR7Hg$X4i2hHnNNc+rb6~xC(#4W*=wZ}b8T5LWSsw%x2vKsWhIl-b2d+={`*i4(4 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 len(m.EndpointName) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.EndpointName) + copy(dAtA[i:], m.EndpointName) i = encodeVarintComputeagent(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 = 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 } @@ -402,20 +412,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 } @@ -423,42 +439,52 @@ 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 len(m.EndpointName) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(len(m.EndpointName))) - i += copy(dAtA[i:], m.EndpointName) + if m.XXX_unrecognized != nil { + i -= len(m.XXX_unrecognized) + copy(dAtA[i:], m.XXX_unrecognized) } if m.IovPolicySettings != nil { - dAtA[i] = 0x1a - i++ - i = encodeVarintComputeagent(dAtA, i, uint64(m.IovPolicySettings.Size())) - n1, 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 = 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.EndpointName) > 0 { + i -= len(m.EndpointName) + copy(dAtA[i:], m.EndpointName) + i = encodeVarintComputeagent(dAtA, i, uint64(len(m.EndpointName))) + i-- + dAtA[i] = 0x12 + } + 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 } @@ -466,20 +492,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 } @@ -487,38 +519,47 @@ 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 len(m.EndpointName) > 0 { - dAtA[i] = 0x1a - i++ + i -= len(m.EndpointName) + copy(dAtA[i:], m.EndpointName) i = encodeVarintComputeagent(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 = 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 } @@ -526,20 +567,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 } @@ -547,39 +594,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 + } + if m.IovOffloadWeight != 0 { + i = encodeVarintComputeagent(dAtA, i, uint64(m.IovOffloadWeight)) + i-- + dAtA[i] = 0x8 } - return i, nil + 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 *AddNICInternalRequest) Size() (n int) { if m == nil { @@ -711,14 +766,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)))) @@ -753,7 +801,7 @@ func (this *ModifyNICInternalRequest) String() string { s := strings.Join([]string{`&ModifyNICInternalRequest{`, `NicID:` + fmt.Sprintf("%v", this.NicID) + `,`, `EndpointName:` + fmt.Sprintf("%v", this.EndpointName) + `,`, - `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) + `,`, `}`, }, "") @@ -1010,10 +1058,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 { @@ -1064,10 +1109,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 { @@ -1218,10 +1260,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 { @@ -1272,10 +1311,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 { @@ -1422,10 +1458,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 { @@ -1476,10 +1509,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 { @@ -1587,10 +1617,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 { @@ -1609,6 +1636,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 { @@ -1640,10 +1668,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 { @@ -1664,55 +1690,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/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/regstate/zsyscall_windows.go b/internal/regstate/zsyscall_windows.go index 4e349ad498..a53d07c24d 100644 --- a/internal/regstate/zsyscall_windows.go +++ b/internal/regstate/zsyscall_windows.go @@ -19,6 +19,7 @@ const ( var ( errERROR_IO_PENDING error = syscall.Errno(errnoERROR_IO_PENDING) + errERROR_EINVAL error = syscall.EINVAL ) // errnoErr returns common boxed Errno values, to prevent @@ -26,7 +27,7 @@ var ( func errnoErr(e syscall.Errno) error { switch e { case 0: - return nil + return errERROR_EINVAL case errnoERROR_IO_PENDING: return errERROR_IO_PENDING } 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 9a97c1c738..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) + `,`, `}`, }, "") @@ -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/internal/winapi/winapi.go b/internal/winapi/winapi.go index d2cc9d9fba..76ef2aa46e 100644 --- a/internal/winapi/winapi.go +++ b/internal/winapi/winapi.go @@ -2,4 +2,4 @@ // be thought of as an extension to golang.org/x/sys/windows. package winapi -//go:generate go run ..\..\mksyscall_windows.go -output zsyscall_windows.go user.go console.go system.go net.go path.go thread.go jobobject.go logon.go memory.go process.go processor.go devices.go filesystem.go errors.go +//go:generate go run ..\..\mksyscall_windows.go -output zsyscall_windows.go console.go system.go net.go path.go thread.go jobobject.go logon.go memory.go process.go processor.go devices.go filesystem.go errors.go