diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..5f81b359 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,9 @@ +# SPDX-FileCopyrightText: 2024 P4 API Working Group +# SPDX-License-Identifier: Apache-2.0 + +*.go text eol=lf +*.mod text eol=lf +*.py text eol=lf +*.sh text eol=lf +*.sum text eol=lf +*.toml text eol=lf diff --git a/.github/workflows/codegen.yml b/.github/workflows/codegen.yml index b750a503..a30ce6a4 100644 --- a/.github/workflows/codegen.yml +++ b/.github/workflows/codegen.yml @@ -16,13 +16,13 @@ on: jobs: check-codegen: - runs-on: [ubuntu-latest] + runs-on: ubuntu-22.04 steps: - - uses: actions/checkout@v3 - - name: Compile protobufs - run: | - docker build -t p4runtime-ci -f codegen/Dockerfile . - docker run -t p4runtime-ci /p4runtime/codegen/compile_protos.sh /tmp - - name: Check codegen - run: | - ./CI/check_codegen.sh + - uses: actions/checkout@v4 + - name: Compile protobufs + run: | + docker build -t p4runtime-ci -f codegen/Dockerfile . + docker run --rm -t p4runtime-ci /p4runtime/codegen/compile_protos.sh /tmp + - name: Check codegen + run: | + ./CI/check_codegen.sh diff --git a/CI/check_codegen.sh b/CI/check_codegen.sh index 9c0d83a0..ea8d3a74 100755 --- a/CI/check_codegen.sh +++ b/CI/check_codegen.sh @@ -26,20 +26,29 @@ rm -rf go/* rm -rf py/p4 ./codegen/update.sh -diff="$(git status --porcelain go go.mod go.sum)" - -if [ ! -z "$diff" ]; then - echo "The generated Go files are not up-to-date" - echo "You can regenerate them with './codegen/update.sh' and commit the changes" +go_diff="$(git diff --name-only go/ go.mod go.sum)" + +# Ensure generated Go files are up-to-date +if [ -n "$go_diff" ]; then + echo "ERROR: The generated Go files are not up-to-date." + echo "Run './codegen/update.sh' locally and commit the result." + echo "" + echo "Diff:" + echo "$go_diff" exit 1 fi -diff="$(git status --porcelain py)" +py_diff="$(git diff --name-only py/)" -if [ ! -z "$diff" ]; then - echo "The generated Python files are not up-to-date" - echo "You can regenerate them with './codegen/update.sh' and commit the changes" +if [ -n "$py_diff" ]; then + echo "ERROR: The generated Python files are not up-to-date." + echo "Run './codegen/update.sh' locally and commit the result." + echo "" + echo "Diff:" + echo "$py_diff" exit 1 fi +echo "Codegen check passed: all generated files are up-to-date." + popd >/dev/null diff --git a/codegen/Dockerfile b/codegen/Dockerfile index acd5b8ec..a8cf2bbf 100644 --- a/codegen/Dockerfile +++ b/codegen/Dockerfile @@ -14,7 +14,12 @@ # # SPDX-License-Identifier: Apache-2.0 -FROM p4lang/third-party:latest +# Pin the base image to a specific digest so that codegen output is +# reproducible across machines and CI runs. To update, pull the new +# image, run `docker inspect --format='{{index .RepoDigests 0}}' +# p4lang/third-party:latest`, and replace the digest below. +FROM p4lang/third-party@sha256:e9ea666a19d5ab51520ffe40e4c06ee5b8407f80e4ec1a4ae9501f21687255c1 + LABEL maintainer="P4 API Working Group " LABEL description="Dockerfile used for CI testing of p4lang/p4runtime" @@ -22,25 +27,41 @@ LABEL description="Dockerfile used for CI testing of p4lang/p4runtime" ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update && \ - apt-get install -y --no-install-recommends software-properties-common git curl + apt-get install -y --no-install-recommends \ + software-properties-common \ + git \ + curl && \ + rm -rf /var/lib/apt/lists/* -ARG GO_VERSION=1.20.5 +# Go toolchain — bump this arg (and re-verify the SHA-256 below) when +# upgrading. SHA-256 values are taken directly from https://go.dev/dl/ +# and must be updated together with GO_VERSION. +ARG GO_VERSION=1.25.11 RUN set -eux; \ dpkgArch="$(dpkg --print-architecture)"; \ case "${dpkgArch##*-}" in \ - amd64) arch='amd64' ;; \ - arm64) arch='arm64' ;; \ + amd64) arch='amd64'; \ + goSHA256='34f14304e856893f4ba30c2cacfe93906e9de7915c5f6aaaf3a81cdccd7ba30b' ;; \ + arm64) arch='arm64'; \ + goSHA256='c30bf9e156a54ea4e31fbbbf31a712b32734b58cc9a22426fa5ee632d0885124' ;; \ *) arch=''; echo >&2; echo >&2 "unsupported architecture '$dpkgArch'"; echo >&2 ; exit 1 ;; \ esac; \ - curl -L -o go.tar.gz https://dl.google.com/go/go${GO_VERSION}.linux-${arch}.tar.gz; \ + curl -fsSL -o go.tar.gz "https://dl.google.com/go/go${GO_VERSION}.linux-${arch}.tar.gz"; \ + echo "${goSHA256} go.tar.gz" | sha256sum -c -; \ tar -C /usr/local -xzf go.tar.gz; \ rm -f go.tar.gz ENV PATH="${PATH}:/usr/local/go/bin:/root/go/bin" -RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.31 -RUN go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.3 +# Pin protoc plugin versions explicitly. These must stay in sync with +# the versions recorded in the generated file headers under go/. When +# bumping either plugin, regenerate the Go outputs and commit them. +ARG PROTOC_GEN_GO_VERSION=v1.34.2 +ARG PROTOC_GEN_GO_GRPC_VERSION=v1.5.1 + +RUN go install "google.golang.org/protobuf/cmd/protoc-gen-go@${PROTOC_GEN_GO_VERSION}" +RUN go install "google.golang.org/grpc/cmd/protoc-gen-go-grpc@${PROTOC_GEN_GO_GRPC_VERSION}" COPY . /p4runtime/ WORKDIR /p4runtime/ diff --git a/codegen/update.sh b/codegen/update.sh index ee29d287..2023a08a 100755 --- a/codegen/update.sh +++ b/codegen/update.sh @@ -42,12 +42,14 @@ docker run --rm \ -v "$tmpdir:/tmp/gen" \ p4runtime-ci bash -c "rm -r /tmp/gen/*" +# Keep go mod tidy pinned to the same Go version declared in go.mod so +# that the toolchain directive stays stable across developer machines. docker run --rm -u "$(id -u):$(id -g)" \ -e "GOCACHE=/tmp/gocache" \ -e "GOPATH=/tmp/gopath" \ -v "$(pwd):/p4runtime" \ -w /p4runtime \ - golang:1.20 bash -c "go mod tidy" + golang:1.25.11 bash -c "go mod tidy" rm -rf "$tmpdir" diff --git a/go.mod b/go.mod index 3cabec2d..36425294 100644 --- a/go.mod +++ b/go.mod @@ -1,15 +1,14 @@ module github.com/p4lang/p4runtime -go 1.20 +go 1.25 require ( - google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 - google.golang.org/grpc v1.56.3 - google.golang.org/protobuf v1.33.0 + google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf + google.golang.org/grpc v1.65.0 + google.golang.org/protobuf v1.34.2 ) require ( - github.com/golang/protobuf v1.5.3 // indirect golang.org/x/net v0.38.0 // indirect golang.org/x/sys v0.31.0 // indirect golang.org/x/text v0.23.0 // indirect diff --git a/go.sum b/go.sum index 51e02d10..44d6b757 100644 --- a/go.sum +++ b/go.sum @@ -1,20 +1,14 @@ -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 h1:KpwkzHKEF7B9Zxg18WzOa7djJ+Ha5DzthMyZYQfEn2A= -google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= -google.golang.org/grpc v1.56.3 h1:8I4C0Yq1EjstUzUJzpcRVbuYA2mODtEmpWiQoN/b2nc= -google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf h1:liao9UHurZLtiEwBgT9LMOnKYsHze6eA6w1KQCMVN2Q= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240730163845-b1a4ccb954bf/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc= +google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ= +google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= +google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= diff --git a/go/p4/config/v1/p4info.pb.go b/go/p4/config/v1/p4info.pb.go index 243d66fe..3f054782 100644 --- a/go/p4/config/v1/p4info.pb.go +++ b/go/p4/config/v1/p4info.pb.go @@ -4,7 +4,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.34.2 // protoc v3.18.1 // source: p4/config/v1/p4info.proto @@ -3295,7 +3295,7 @@ func file_p4_config_v1_p4info_proto_rawDescGZIP() []byte { var file_p4_config_v1_p4info_proto_enumTypes = make([]protoimpl.EnumInfo, 7) var file_p4_config_v1_p4info_proto_msgTypes = make([]protoimpl.MessageInfo, 29) -var file_p4_config_v1_p4info_proto_goTypes = []interface{}{ +var file_p4_config_v1_p4info_proto_goTypes = []any{ (P4Ids_Prefix)(0), // 0: p4.config.v1.P4Ids.Prefix (MatchField_MatchType)(0), // 1: p4.config.v1.MatchField.MatchType (Table_IdleTimeoutBehavior)(0), // 2: p4.config.v1.Table.IdleTimeoutBehavior @@ -3427,7 +3427,7 @@ func file_p4_config_v1_p4info_proto_init() { } file_p4_config_v1_p4types_proto_init() if !protoimpl.UnsafeEnabled { - file_p4_config_v1_p4info_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*P4Info); i { case 0: return &v.state @@ -3439,7 +3439,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*Documentation); i { case 0: return &v.state @@ -3451,7 +3451,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*PlatformProperties); i { case 0: return &v.state @@ -3463,7 +3463,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*PkgInfo); i { case 0: return &v.state @@ -3475,7 +3475,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*P4Ids); i { case 0: return &v.state @@ -3487,7 +3487,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*Preamble); i { case 0: return &v.state @@ -3499,7 +3499,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*Extern); i { case 0: return &v.state @@ -3511,7 +3511,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[7].Exporter = func(v any, i int) any { switch v := v.(*ExternInstance); i { case 0: return &v.state @@ -3523,7 +3523,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[8].Exporter = func(v any, i int) any { switch v := v.(*MatchField); i { case 0: return &v.state @@ -3535,7 +3535,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[9].Exporter = func(v any, i int) any { switch v := v.(*TableActionCall); i { case 0: return &v.state @@ -3547,7 +3547,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[10].Exporter = func(v any, i int) any { switch v := v.(*Table); i { case 0: return &v.state @@ -3559,7 +3559,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[11].Exporter = func(v any, i int) any { switch v := v.(*ActionRef); i { case 0: return &v.state @@ -3571,7 +3571,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[12].Exporter = func(v any, i int) any { switch v := v.(*Action); i { case 0: return &v.state @@ -3583,7 +3583,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[13].Exporter = func(v any, i int) any { switch v := v.(*ActionProfile); i { case 0: return &v.state @@ -3595,7 +3595,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[14].Exporter = func(v any, i int) any { switch v := v.(*CounterSpec); i { case 0: return &v.state @@ -3607,7 +3607,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[15].Exporter = func(v any, i int) any { switch v := v.(*Counter); i { case 0: return &v.state @@ -3619,7 +3619,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[16].Exporter = func(v any, i int) any { switch v := v.(*DirectCounter); i { case 0: return &v.state @@ -3631,7 +3631,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[17].Exporter = func(v any, i int) any { switch v := v.(*MeterSpec); i { case 0: return &v.state @@ -3643,7 +3643,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[18].Exporter = func(v any, i int) any { switch v := v.(*Meter); i { case 0: return &v.state @@ -3655,7 +3655,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[19].Exporter = func(v any, i int) any { switch v := v.(*DirectMeter); i { case 0: return &v.state @@ -3667,7 +3667,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[20].Exporter = func(v any, i int) any { switch v := v.(*ControllerPacketMetadata); i { case 0: return &v.state @@ -3679,7 +3679,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[21].Exporter = func(v any, i int) any { switch v := v.(*ValueSet); i { case 0: return &v.state @@ -3691,7 +3691,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[22].Exporter = func(v any, i int) any { switch v := v.(*Register); i { case 0: return &v.state @@ -3703,7 +3703,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[23].Exporter = func(v any, i int) any { switch v := v.(*Digest); i { case 0: return &v.state @@ -3715,7 +3715,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[24].Exporter = func(v any, i int) any { switch v := v.(*TableActionCall_Argument); i { case 0: return &v.state @@ -3727,7 +3727,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[25].Exporter = func(v any, i int) any { switch v := v.(*Action_Param); i { case 0: return &v.state @@ -3739,7 +3739,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[26].Exporter = func(v any, i int) any { switch v := v.(*ActionProfile_SumOfWeights); i { case 0: return &v.state @@ -3751,7 +3751,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[27].Exporter = func(v any, i int) any { switch v := v.(*ActionProfile_SumOfMembers); i { case 0: return &v.state @@ -3763,7 +3763,7 @@ func file_p4_config_v1_p4info_proto_init() { return nil } } - file_p4_config_v1_p4info_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4info_proto_msgTypes[28].Exporter = func(v any, i int) any { switch v := v.(*ControllerPacketMetadata_Metadata); i { case 0: return &v.state @@ -3776,11 +3776,11 @@ func file_p4_config_v1_p4info_proto_init() { } } } - file_p4_config_v1_p4info_proto_msgTypes[8].OneofWrappers = []interface{}{ + file_p4_config_v1_p4info_proto_msgTypes[8].OneofWrappers = []any{ (*MatchField_MatchType_)(nil), (*MatchField_OtherMatchType)(nil), } - file_p4_config_v1_p4info_proto_msgTypes[13].OneofWrappers = []interface{}{ + file_p4_config_v1_p4info_proto_msgTypes[13].OneofWrappers = []any{ (*ActionProfile_SumOfWeights_)(nil), (*ActionProfile_SumOfMembers_)(nil), } diff --git a/go/p4/config/v1/p4types.pb.go b/go/p4/config/v1/p4types.pb.go index 7cc25ea4..8e1e7433 100644 --- a/go/p4/config/v1/p4types.pb.go +++ b/go/p4/config/v1/p4types.pb.go @@ -4,7 +4,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.34.2 // protoc v3.18.1 // source: p4/config/v1/p4types.proto @@ -2721,7 +2721,7 @@ func file_p4_config_v1_p4types_proto_rawDescGZIP() []byte { } var file_p4_config_v1_p4types_proto_msgTypes = make([]protoimpl.MessageInfo, 38) -var file_p4_config_v1_p4types_proto_goTypes = []interface{}{ +var file_p4_config_v1_p4types_proto_goTypes = []any{ (*P4TypeInfo)(nil), // 0: p4.config.v1.P4TypeInfo (*P4DataTypeSpec)(nil), // 1: p4.config.v1.P4DataTypeSpec (*P4NamedType)(nil), // 2: p4.config.v1.P4NamedType @@ -2842,7 +2842,7 @@ func file_p4_config_v1_p4types_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_p4_config_v1_p4types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*P4TypeInfo); i { case 0: return &v.state @@ -2854,7 +2854,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*P4DataTypeSpec); i { case 0: return &v.state @@ -2866,7 +2866,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*P4NamedType); i { case 0: return &v.state @@ -2878,7 +2878,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*P4BoolType); i { case 0: return &v.state @@ -2890,7 +2890,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*P4ErrorType); i { case 0: return &v.state @@ -2902,7 +2902,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*P4BitstringLikeTypeSpec); i { case 0: return &v.state @@ -2914,7 +2914,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*P4BitTypeSpec); i { case 0: return &v.state @@ -2926,7 +2926,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[7].Exporter = func(v any, i int) any { switch v := v.(*P4IntTypeSpec); i { case 0: return &v.state @@ -2938,7 +2938,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[8].Exporter = func(v any, i int) any { switch v := v.(*P4VarbitTypeSpec); i { case 0: return &v.state @@ -2950,7 +2950,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[9].Exporter = func(v any, i int) any { switch v := v.(*P4TupleTypeSpec); i { case 0: return &v.state @@ -2962,7 +2962,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[10].Exporter = func(v any, i int) any { switch v := v.(*P4StructTypeSpec); i { case 0: return &v.state @@ -2974,7 +2974,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[11].Exporter = func(v any, i int) any { switch v := v.(*P4HeaderTypeSpec); i { case 0: return &v.state @@ -2986,7 +2986,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[12].Exporter = func(v any, i int) any { switch v := v.(*P4HeaderUnionTypeSpec); i { case 0: return &v.state @@ -2998,7 +2998,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[13].Exporter = func(v any, i int) any { switch v := v.(*P4HeaderStackTypeSpec); i { case 0: return &v.state @@ -3010,7 +3010,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[14].Exporter = func(v any, i int) any { switch v := v.(*P4HeaderUnionStackTypeSpec); i { case 0: return &v.state @@ -3022,7 +3022,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[15].Exporter = func(v any, i int) any { switch v := v.(*KeyValuePair); i { case 0: return &v.state @@ -3034,7 +3034,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[16].Exporter = func(v any, i int) any { switch v := v.(*KeyValuePairList); i { case 0: return &v.state @@ -3046,7 +3046,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[17].Exporter = func(v any, i int) any { switch v := v.(*Expression); i { case 0: return &v.state @@ -3058,7 +3058,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[18].Exporter = func(v any, i int) any { switch v := v.(*ExpressionList); i { case 0: return &v.state @@ -3070,7 +3070,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[19].Exporter = func(v any, i int) any { switch v := v.(*StructuredAnnotation); i { case 0: return &v.state @@ -3082,7 +3082,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[20].Exporter = func(v any, i int) any { switch v := v.(*SourceLocation); i { case 0: return &v.state @@ -3094,7 +3094,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[21].Exporter = func(v any, i int) any { switch v := v.(*P4EnumTypeSpec); i { case 0: return &v.state @@ -3106,7 +3106,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[22].Exporter = func(v any, i int) any { switch v := v.(*P4SerializableEnumTypeSpec); i { case 0: return &v.state @@ -3118,7 +3118,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[23].Exporter = func(v any, i int) any { switch v := v.(*P4ErrorTypeSpec); i { case 0: return &v.state @@ -3130,7 +3130,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[24].Exporter = func(v any, i int) any { switch v := v.(*P4NewTypeTranslation); i { case 0: return &v.state @@ -3142,7 +3142,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[25].Exporter = func(v any, i int) any { switch v := v.(*P4NewTypeSpec); i { case 0: return &v.state @@ -3154,7 +3154,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[32].Exporter = func(v any, i int) any { switch v := v.(*P4StructTypeSpec_Member); i { case 0: return &v.state @@ -3166,7 +3166,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[33].Exporter = func(v any, i int) any { switch v := v.(*P4HeaderTypeSpec_Member); i { case 0: return &v.state @@ -3178,7 +3178,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[34].Exporter = func(v any, i int) any { switch v := v.(*P4HeaderUnionTypeSpec_Member); i { case 0: return &v.state @@ -3190,7 +3190,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[35].Exporter = func(v any, i int) any { switch v := v.(*P4EnumTypeSpec_Member); i { case 0: return &v.state @@ -3202,7 +3202,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[36].Exporter = func(v any, i int) any { switch v := v.(*P4SerializableEnumTypeSpec_Member); i { case 0: return &v.state @@ -3214,7 +3214,7 @@ func file_p4_config_v1_p4types_proto_init() { return nil } } - file_p4_config_v1_p4types_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + file_p4_config_v1_p4types_proto_msgTypes[37].Exporter = func(v any, i int) any { switch v := v.(*P4NewTypeTranslation_SdnString); i { case 0: return &v.state @@ -3227,7 +3227,7 @@ func file_p4_config_v1_p4types_proto_init() { } } } - file_p4_config_v1_p4types_proto_msgTypes[1].OneofWrappers = []interface{}{ + file_p4_config_v1_p4types_proto_msgTypes[1].OneofWrappers = []any{ (*P4DataTypeSpec_Bitstring)(nil), (*P4DataTypeSpec_Bool)(nil), (*P4DataTypeSpec_Tuple)(nil), @@ -3241,25 +3241,25 @@ func file_p4_config_v1_p4types_proto_init() { (*P4DataTypeSpec_SerializableEnum)(nil), (*P4DataTypeSpec_NewType)(nil), } - file_p4_config_v1_p4types_proto_msgTypes[5].OneofWrappers = []interface{}{ + file_p4_config_v1_p4types_proto_msgTypes[5].OneofWrappers = []any{ (*P4BitstringLikeTypeSpec_Bit)(nil), (*P4BitstringLikeTypeSpec_Int)(nil), (*P4BitstringLikeTypeSpec_Varbit)(nil), } - file_p4_config_v1_p4types_proto_msgTypes[17].OneofWrappers = []interface{}{ + file_p4_config_v1_p4types_proto_msgTypes[17].OneofWrappers = []any{ (*Expression_StringValue)(nil), (*Expression_Int64Value)(nil), (*Expression_BoolValue)(nil), } - file_p4_config_v1_p4types_proto_msgTypes[19].OneofWrappers = []interface{}{ + file_p4_config_v1_p4types_proto_msgTypes[19].OneofWrappers = []any{ (*StructuredAnnotation_ExpressionList)(nil), (*StructuredAnnotation_KvPairList)(nil), } - file_p4_config_v1_p4types_proto_msgTypes[24].OneofWrappers = []interface{}{ + file_p4_config_v1_p4types_proto_msgTypes[24].OneofWrappers = []any{ (*P4NewTypeTranslation_SdnBitwidth)(nil), (*P4NewTypeTranslation_SdnString_)(nil), } - file_p4_config_v1_p4types_proto_msgTypes[25].OneofWrappers = []interface{}{ + file_p4_config_v1_p4types_proto_msgTypes[25].OneofWrappers = []any{ (*P4NewTypeSpec_OriginalType)(nil), (*P4NewTypeSpec_TranslatedType)(nil), } diff --git a/go/p4/v1/p4data.pb.go b/go/p4/v1/p4data.pb.go index bfccb390..02340178 100644 --- a/go/p4/v1/p4data.pb.go +++ b/go/p4/v1/p4data.pb.go @@ -4,7 +4,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.34.2 // protoc v3.18.1 // source: p4/v1/p4data.proto @@ -644,7 +644,7 @@ func file_p4_v1_p4data_proto_rawDescGZIP() []byte { } var file_p4_v1_p4data_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_p4_v1_p4data_proto_goTypes = []interface{}{ +var file_p4_v1_p4data_proto_goTypes = []any{ (*P4Data)(nil), // 0: p4.v1.P4Data (*P4Varbit)(nil), // 1: p4.v1.P4Varbit (*P4StructLike)(nil), // 2: p4.v1.P4StructLike @@ -678,7 +678,7 @@ func file_p4_v1_p4data_proto_init() { return } if !protoimpl.UnsafeEnabled { - file_p4_v1_p4data_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4data_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*P4Data); i { case 0: return &v.state @@ -690,7 +690,7 @@ func file_p4_v1_p4data_proto_init() { return nil } } - file_p4_v1_p4data_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4data_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*P4Varbit); i { case 0: return &v.state @@ -702,7 +702,7 @@ func file_p4_v1_p4data_proto_init() { return nil } } - file_p4_v1_p4data_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4data_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*P4StructLike); i { case 0: return &v.state @@ -714,7 +714,7 @@ func file_p4_v1_p4data_proto_init() { return nil } } - file_p4_v1_p4data_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4data_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*P4Header); i { case 0: return &v.state @@ -726,7 +726,7 @@ func file_p4_v1_p4data_proto_init() { return nil } } - file_p4_v1_p4data_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4data_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*P4HeaderUnion); i { case 0: return &v.state @@ -738,7 +738,7 @@ func file_p4_v1_p4data_proto_init() { return nil } } - file_p4_v1_p4data_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4data_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*P4HeaderStack); i { case 0: return &v.state @@ -750,7 +750,7 @@ func file_p4_v1_p4data_proto_init() { return nil } } - file_p4_v1_p4data_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4data_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*P4HeaderUnionStack); i { case 0: return &v.state @@ -763,7 +763,7 @@ func file_p4_v1_p4data_proto_init() { } } } - file_p4_v1_p4data_proto_msgTypes[0].OneofWrappers = []interface{}{ + file_p4_v1_p4data_proto_msgTypes[0].OneofWrappers = []any{ (*P4Data_Bitstring)(nil), (*P4Data_Varbit)(nil), (*P4Data_Bool)(nil), diff --git a/go/p4/v1/p4runtime.pb.go b/go/p4/v1/p4runtime.pb.go index 09473855..be3bac9d 100644 --- a/go/p4/v1/p4runtime.pb.go +++ b/go/p4/v1/p4runtime.pb.go @@ -4,7 +4,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.31.0 +// protoc-gen-go v1.34.2 // protoc v3.18.1 // source: p4/v1/p4runtime.proto @@ -29,7 +29,7 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// ------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Reserved controller-specified SDN port numbers for reference. type SdnPort int32 @@ -460,7 +460,7 @@ func (GetForwardingPipelineConfigRequest_ResponseType) EnumDescriptor() ([]byte, return file_p4_v1_p4runtime_proto_rawDescGZIP(), []int{50, 0} } -// ------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ type WriteRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1085,7 +1085,6 @@ type TableEntry struct { // meter (if any) to its default configuration, while leaving counter_data // or meter_counter_data unset means that the counter (if any) will not be // updated. - // // Table read: // - If the table does not contain a direct resource, then the corresponding // field will not be set in the read table entry. @@ -1113,13 +1112,12 @@ type TableEntry struct { Metadata []byte `protobuf:"bytes,11,opt,name=metadata,proto3" json:"metadata,omitempty"` // True if and only if the entry cannot be deleted or modified, // i.e. any of the following: - // - Any entry read from a table declared with `const entries` - // - The default entry read from a table declared with `const - // default_action` - // - Any entry declared with `entries` without the `const` qualifier - // before `entries`, where the individual entry has the `const` - // qualifier on it in the P4 source code. - // + // + Any entry read from a table declared with `const entries` + // + The default entry read from a table declared with `const + // default_action` + // + Any entry declared with `entries` without the `const` qualifier + // before `entries`, where the individual entry has the `const` + // qualifier on it in the P4 source code. // Note: Older P4Runtime API servers before the `is_const` field was // added to this message will not return a value for `is_const` in // the first two cases above, but newer P4Runtime API servers will. @@ -1741,7 +1739,7 @@ func (*ActionProfileAction_Watch) isActionProfileAction_WatchKind() {} func (*ActionProfileAction_WatchPort) isActionProfileAction_WatchKind() {} -// ------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ type ActionProfileMember struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1805,7 +1803,7 @@ func (x *ActionProfileMember) GetAction() *Action { return nil } -// ------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ type ActionProfileGroup struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1937,7 +1935,7 @@ func (x *Index) GetIndex() int64 { return 0 } -// ------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // For WriteRequest, Update.Type must be MODIFY. // For ReadRequest, the scope is defined as follows: // - All meter cells for all meters if meter_id = 0 (default). @@ -2014,14 +2012,14 @@ func (x *MeterEntry) GetCounterData() *MeterCounterData { return nil } -// ------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // For WriteRequest, Update.Type must be MODIFY. INSERT and DELETE on direct // meters is not allowed and will return an error. The insertion/deletion // should happen as part of INSERT/DELETE on the associated table-entry. // For ReadRequest, the scope is defined as follows: -// - All meter cells for all tables if table_entry.table_id = 0. -// - All meter cells of a table if table_entry.table_id is present and -// table_entry.match is empty. +// - All meter cells for all tables if table_entry.table_id = 0. +// - All meter cells of a table if table_entry.table_id is present and +// table_entry.match is empty. type DirectMeterEntry struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2191,7 +2189,7 @@ func (x *MeterConfig) GetEburst() int64 { return 0 } -// ------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // For WriteRequest, Update.Type must be MODIFY. // For ReadRequest, the scope is defined as follows: // - All counter cells for all counters if counter_id = 0 (default). @@ -2259,14 +2257,14 @@ func (x *CounterEntry) GetData() *CounterData { return nil } -// ------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // For WriteRequest, Update.Type must be MODIFY. INSERT and DELETE on direct // counters is not allowed and will return an error. The insertion/deletion // should happen as part of INSERT/DELETE on the associated table-entry. // For ReadRequest, the scope is defined as follows: -// - All counter cells for all tables if table_entry.table_id = 0. -// - All counter cells of a table if table_entry.table_id is present and -// table_entry.match is empty. +// - All counter cells for all tables if table_entry.table_id = 0. +// - All counter cells of a table if table_entry.table_id is present and +// table_entry.match is empty. type DirectCounterEntry struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2443,7 +2441,7 @@ func (x *MeterCounterData) GetRed() *CounterData { return nil } -// ------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Only one instance of a Packet Replication Engine (PRE) is expected in the // P4 pipeline. Hence, no instance id is needed to access the PRE. type PacketReplicationEngineEntry struct { @@ -2895,7 +2893,7 @@ func (x *ValueSetMember) GetMatch() []*FieldMatch { return nil } -// ------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // For writing and reading matches in a parser value set. A state transition // on an empty value set will never be taken. The number of matches must be at // most the size of the value set as specified by the size argument of the @@ -2965,7 +2963,7 @@ func (x *ValueSetEntry) GetMembers() []*ValueSetMember { return nil } -// ------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ type RegisterEntry struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3029,7 +3027,7 @@ func (x *RegisterEntry) GetData() *P4Data { return nil } -// ------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // Used to configure the digest extern only, not to stream digests or acks type DigestEntry struct { state protoimpl.MessageState @@ -3086,7 +3084,7 @@ func (x *DigestEntry) GetConfig() *DigestEntry_Config { return nil } -// ------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ type StreamMessageRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4206,7 +4204,7 @@ func (x *Uint128) GetLow() uint64 { return 0 } -// ------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ type SetForwardingPipelineConfigRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4592,7 +4590,7 @@ func (x *Error) GetDetails() *anypb.Any { return nil } -// ------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ type CapabilitiesRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -6000,7 +5998,7 @@ func file_p4_v1_p4runtime_proto_rawDescGZIP() []byte { var file_p4_v1_p4runtime_proto_enumTypes = make([]protoimpl.EnumInfo, 7) var file_p4_v1_p4runtime_proto_msgTypes = make([]protoimpl.MessageInfo, 65) -var file_p4_v1_p4runtime_proto_goTypes = []interface{}{ +var file_p4_v1_p4runtime_proto_goTypes = []any{ (SdnPort)(0), // 0: p4.v1.SdnPort (WriteRequest_Atomicity)(0), // 1: p4.v1.WriteRequest.Atomicity (Update_Type)(0), // 2: p4.v1.Update.Type @@ -6203,7 +6201,7 @@ func file_p4_v1_p4runtime_proto_init() { } file_p4_v1_p4data_proto_init() if !protoimpl.UnsafeEnabled { - file_p4_v1_p4runtime_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[0].Exporter = func(v any, i int) any { switch v := v.(*WriteRequest); i { case 0: return &v.state @@ -6215,7 +6213,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[1].Exporter = func(v any, i int) any { switch v := v.(*WriteResponse); i { case 0: return &v.state @@ -6227,7 +6225,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[2].Exporter = func(v any, i int) any { switch v := v.(*ReadRequest); i { case 0: return &v.state @@ -6239,7 +6237,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[3].Exporter = func(v any, i int) any { switch v := v.(*ReadResponse); i { case 0: return &v.state @@ -6251,7 +6249,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[4].Exporter = func(v any, i int) any { switch v := v.(*Update); i { case 0: return &v.state @@ -6263,7 +6261,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[5].Exporter = func(v any, i int) any { switch v := v.(*Entity); i { case 0: return &v.state @@ -6275,7 +6273,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[6].Exporter = func(v any, i int) any { switch v := v.(*ExternEntry); i { case 0: return &v.state @@ -6287,7 +6285,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[7].Exporter = func(v any, i int) any { switch v := v.(*TableEntry); i { case 0: return &v.state @@ -6299,7 +6297,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[8].Exporter = func(v any, i int) any { switch v := v.(*FieldMatch); i { case 0: return &v.state @@ -6311,7 +6309,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[9].Exporter = func(v any, i int) any { switch v := v.(*TableAction); i { case 0: return &v.state @@ -6323,7 +6321,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[10].Exporter = func(v any, i int) any { switch v := v.(*Action); i { case 0: return &v.state @@ -6335,7 +6333,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[11].Exporter = func(v any, i int) any { switch v := v.(*ActionProfileActionSet); i { case 0: return &v.state @@ -6347,7 +6345,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[12].Exporter = func(v any, i int) any { switch v := v.(*ActionProfileAction); i { case 0: return &v.state @@ -6359,7 +6357,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[13].Exporter = func(v any, i int) any { switch v := v.(*ActionProfileMember); i { case 0: return &v.state @@ -6371,7 +6369,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[14].Exporter = func(v any, i int) any { switch v := v.(*ActionProfileGroup); i { case 0: return &v.state @@ -6383,7 +6381,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[15].Exporter = func(v any, i int) any { switch v := v.(*Index); i { case 0: return &v.state @@ -6395,7 +6393,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[16].Exporter = func(v any, i int) any { switch v := v.(*MeterEntry); i { case 0: return &v.state @@ -6407,7 +6405,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[17].Exporter = func(v any, i int) any { switch v := v.(*DirectMeterEntry); i { case 0: return &v.state @@ -6419,7 +6417,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[18].Exporter = func(v any, i int) any { switch v := v.(*MeterConfig); i { case 0: return &v.state @@ -6431,7 +6429,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[19].Exporter = func(v any, i int) any { switch v := v.(*CounterEntry); i { case 0: return &v.state @@ -6443,7 +6441,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[20].Exporter = func(v any, i int) any { switch v := v.(*DirectCounterEntry); i { case 0: return &v.state @@ -6455,7 +6453,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[21].Exporter = func(v any, i int) any { switch v := v.(*CounterData); i { case 0: return &v.state @@ -6467,7 +6465,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[22].Exporter = func(v any, i int) any { switch v := v.(*MeterCounterData); i { case 0: return &v.state @@ -6479,7 +6477,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[23].Exporter = func(v any, i int) any { switch v := v.(*PacketReplicationEngineEntry); i { case 0: return &v.state @@ -6491,7 +6489,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[24].Exporter = func(v any, i int) any { switch v := v.(*BackupReplica); i { case 0: return &v.state @@ -6503,7 +6501,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[25].Exporter = func(v any, i int) any { switch v := v.(*Replica); i { case 0: return &v.state @@ -6515,7 +6513,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[26].Exporter = func(v any, i int) any { switch v := v.(*MulticastGroupEntry); i { case 0: return &v.state @@ -6527,7 +6525,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[27].Exporter = func(v any, i int) any { switch v := v.(*CloneSessionEntry); i { case 0: return &v.state @@ -6539,7 +6537,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[28].Exporter = func(v any, i int) any { switch v := v.(*ValueSetMember); i { case 0: return &v.state @@ -6551,7 +6549,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[29].Exporter = func(v any, i int) any { switch v := v.(*ValueSetEntry); i { case 0: return &v.state @@ -6563,7 +6561,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[30].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[30].Exporter = func(v any, i int) any { switch v := v.(*RegisterEntry); i { case 0: return &v.state @@ -6575,7 +6573,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[31].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[31].Exporter = func(v any, i int) any { switch v := v.(*DigestEntry); i { case 0: return &v.state @@ -6587,7 +6585,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[32].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[32].Exporter = func(v any, i int) any { switch v := v.(*StreamMessageRequest); i { case 0: return &v.state @@ -6599,7 +6597,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[33].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[33].Exporter = func(v any, i int) any { switch v := v.(*PacketOut); i { case 0: return &v.state @@ -6611,7 +6609,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[34].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[34].Exporter = func(v any, i int) any { switch v := v.(*DigestListAck); i { case 0: return &v.state @@ -6623,7 +6621,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[35].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[35].Exporter = func(v any, i int) any { switch v := v.(*StreamMessageResponse); i { case 0: return &v.state @@ -6635,7 +6633,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[36].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[36].Exporter = func(v any, i int) any { switch v := v.(*PacketIn); i { case 0: return &v.state @@ -6647,7 +6645,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[37].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[37].Exporter = func(v any, i int) any { switch v := v.(*DigestList); i { case 0: return &v.state @@ -6659,7 +6657,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[38].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[38].Exporter = func(v any, i int) any { switch v := v.(*PacketMetadata); i { case 0: return &v.state @@ -6671,7 +6669,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[39].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[39].Exporter = func(v any, i int) any { switch v := v.(*MasterArbitrationUpdate); i { case 0: return &v.state @@ -6683,7 +6681,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[40].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[40].Exporter = func(v any, i int) any { switch v := v.(*Role); i { case 0: return &v.state @@ -6695,7 +6693,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[41].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[41].Exporter = func(v any, i int) any { switch v := v.(*IdleTimeoutNotification); i { case 0: return &v.state @@ -6707,7 +6705,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[42].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[42].Exporter = func(v any, i int) any { switch v := v.(*StreamError); i { case 0: return &v.state @@ -6719,7 +6717,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[43].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[43].Exporter = func(v any, i int) any { switch v := v.(*PacketOutError); i { case 0: return &v.state @@ -6731,7 +6729,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[44].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[44].Exporter = func(v any, i int) any { switch v := v.(*DigestListAckError); i { case 0: return &v.state @@ -6743,7 +6741,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[45].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[45].Exporter = func(v any, i int) any { switch v := v.(*StreamOtherError); i { case 0: return &v.state @@ -6755,7 +6753,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[46].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[46].Exporter = func(v any, i int) any { switch v := v.(*Uint128); i { case 0: return &v.state @@ -6767,7 +6765,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[47].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[47].Exporter = func(v any, i int) any { switch v := v.(*SetForwardingPipelineConfigRequest); i { case 0: return &v.state @@ -6779,7 +6777,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[48].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[48].Exporter = func(v any, i int) any { switch v := v.(*SetForwardingPipelineConfigResponse); i { case 0: return &v.state @@ -6791,7 +6789,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[49].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[49].Exporter = func(v any, i int) any { switch v := v.(*ForwardingPipelineConfig); i { case 0: return &v.state @@ -6803,7 +6801,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[50].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[50].Exporter = func(v any, i int) any { switch v := v.(*GetForwardingPipelineConfigRequest); i { case 0: return &v.state @@ -6815,7 +6813,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[51].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[51].Exporter = func(v any, i int) any { switch v := v.(*GetForwardingPipelineConfigResponse); i { case 0: return &v.state @@ -6827,7 +6825,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[52].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[52].Exporter = func(v any, i int) any { switch v := v.(*Error); i { case 0: return &v.state @@ -6839,7 +6837,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[53].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[53].Exporter = func(v any, i int) any { switch v := v.(*CapabilitiesRequest); i { case 0: return &v.state @@ -6851,7 +6849,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[54].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[54].Exporter = func(v any, i int) any { switch v := v.(*CapabilitiesResponse); i { case 0: return &v.state @@ -6863,7 +6861,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[55].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[55].Exporter = func(v any, i int) any { switch v := v.(*TableEntry_IdleTimeout); i { case 0: return &v.state @@ -6875,7 +6873,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[56].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[56].Exporter = func(v any, i int) any { switch v := v.(*FieldMatch_Exact); i { case 0: return &v.state @@ -6887,7 +6885,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[57].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[57].Exporter = func(v any, i int) any { switch v := v.(*FieldMatch_Ternary); i { case 0: return &v.state @@ -6899,7 +6897,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[58].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[58].Exporter = func(v any, i int) any { switch v := v.(*FieldMatch_LPM); i { case 0: return &v.state @@ -6911,7 +6909,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[59].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[59].Exporter = func(v any, i int) any { switch v := v.(*FieldMatch_Range); i { case 0: return &v.state @@ -6923,7 +6921,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[60].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[60].Exporter = func(v any, i int) any { switch v := v.(*FieldMatch_Optional); i { case 0: return &v.state @@ -6935,7 +6933,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[61].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[61].Exporter = func(v any, i int) any { switch v := v.(*Action_Param); i { case 0: return &v.state @@ -6947,7 +6945,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[62].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[62].Exporter = func(v any, i int) any { switch v := v.(*ActionProfileGroup_Member); i { case 0: return &v.state @@ -6959,7 +6957,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[63].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[63].Exporter = func(v any, i int) any { switch v := v.(*DigestEntry_Config); i { case 0: return &v.state @@ -6971,7 +6969,7 @@ func file_p4_v1_p4runtime_proto_init() { return nil } } - file_p4_v1_p4runtime_proto_msgTypes[64].Exporter = func(v interface{}, i int) interface{} { + file_p4_v1_p4runtime_proto_msgTypes[64].Exporter = func(v any, i int) any { switch v := v.(*ForwardingPipelineConfig_Cookie); i { case 0: return &v.state @@ -6984,7 +6982,7 @@ func file_p4_v1_p4runtime_proto_init() { } } } - file_p4_v1_p4runtime_proto_msgTypes[5].OneofWrappers = []interface{}{ + file_p4_v1_p4runtime_proto_msgTypes[5].OneofWrappers = []any{ (*Entity_ExternEntry)(nil), (*Entity_TableEntry)(nil), (*Entity_ActionProfileMember)(nil), @@ -6998,7 +6996,7 @@ func file_p4_v1_p4runtime_proto_init() { (*Entity_RegisterEntry)(nil), (*Entity_DigestEntry)(nil), } - file_p4_v1_p4runtime_proto_msgTypes[8].OneofWrappers = []interface{}{ + file_p4_v1_p4runtime_proto_msgTypes[8].OneofWrappers = []any{ (*FieldMatch_Exact_)(nil), (*FieldMatch_Ternary_)(nil), (*FieldMatch_Lpm)(nil), @@ -7006,31 +7004,31 @@ func file_p4_v1_p4runtime_proto_init() { (*FieldMatch_Optional_)(nil), (*FieldMatch_Other)(nil), } - file_p4_v1_p4runtime_proto_msgTypes[9].OneofWrappers = []interface{}{ + file_p4_v1_p4runtime_proto_msgTypes[9].OneofWrappers = []any{ (*TableAction_Action)(nil), (*TableAction_ActionProfileMemberId)(nil), (*TableAction_ActionProfileGroupId)(nil), (*TableAction_ActionProfileActionSet)(nil), } - file_p4_v1_p4runtime_proto_msgTypes[12].OneofWrappers = []interface{}{ + file_p4_v1_p4runtime_proto_msgTypes[12].OneofWrappers = []any{ (*ActionProfileAction_Watch)(nil), (*ActionProfileAction_WatchPort)(nil), } - file_p4_v1_p4runtime_proto_msgTypes[23].OneofWrappers = []interface{}{ + file_p4_v1_p4runtime_proto_msgTypes[23].OneofWrappers = []any{ (*PacketReplicationEngineEntry_MulticastGroupEntry)(nil), (*PacketReplicationEngineEntry_CloneSessionEntry)(nil), } - file_p4_v1_p4runtime_proto_msgTypes[25].OneofWrappers = []interface{}{ + file_p4_v1_p4runtime_proto_msgTypes[25].OneofWrappers = []any{ (*Replica_EgressPort)(nil), (*Replica_Port)(nil), } - file_p4_v1_p4runtime_proto_msgTypes[32].OneofWrappers = []interface{}{ + file_p4_v1_p4runtime_proto_msgTypes[32].OneofWrappers = []any{ (*StreamMessageRequest_Arbitration)(nil), (*StreamMessageRequest_Packet)(nil), (*StreamMessageRequest_DigestAck)(nil), (*StreamMessageRequest_Other)(nil), } - file_p4_v1_p4runtime_proto_msgTypes[35].OneofWrappers = []interface{}{ + file_p4_v1_p4runtime_proto_msgTypes[35].OneofWrappers = []any{ (*StreamMessageResponse_Arbitration)(nil), (*StreamMessageResponse_Packet)(nil), (*StreamMessageResponse_Digest)(nil), @@ -7038,12 +7036,12 @@ func file_p4_v1_p4runtime_proto_init() { (*StreamMessageResponse_Other)(nil), (*StreamMessageResponse_Error)(nil), } - file_p4_v1_p4runtime_proto_msgTypes[42].OneofWrappers = []interface{}{ + file_p4_v1_p4runtime_proto_msgTypes[42].OneofWrappers = []any{ (*StreamError_PacketOut)(nil), (*StreamError_DigestListAck)(nil), (*StreamError_Other)(nil), } - file_p4_v1_p4runtime_proto_msgTypes[62].OneofWrappers = []interface{}{ + file_p4_v1_p4runtime_proto_msgTypes[62].OneofWrappers = []any{ (*ActionProfileGroup_Member_Watch)(nil), (*ActionProfileGroup_Member_WatchPort)(nil), } diff --git a/go/p4/v1/p4runtime_grpc.pb.go b/go/p4/v1/p4runtime_grpc.pb.go index 495e3501..449e1b3b 100644 --- a/go/p4/v1/p4runtime_grpc.pb.go +++ b/go/p4/v1/p4runtime_grpc.pb.go @@ -4,7 +4,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: -// - protoc-gen-go-grpc v1.3.0 +// - protoc-gen-go-grpc v1.5.1 // - protoc v3.18.1 // source: p4/v1/p4runtime.proto @@ -21,8 +21,8 @@ import ( // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -// Requires gRPC-Go v1.32.0 or later. -const _ = grpc.SupportPackageIsVersion7 +// Requires gRPC-Go v1.64.0 or later. +const _ = grpc.SupportPackageIsVersion9 const ( P4Runtime_Write_FullMethodName = "/p4.v1.P4Runtime/Write" @@ -40,7 +40,7 @@ type P4RuntimeClient interface { // Update one or more P4 entities on the target. Write(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error) // Read one or more P4 entities from the target. - Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (P4Runtime_ReadClient, error) + Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ReadResponse], error) // Sets the P4 forwarding-pipeline config. SetForwardingPipelineConfig(ctx context.Context, in *SetForwardingPipelineConfigRequest, opts ...grpc.CallOption) (*SetForwardingPipelineConfigResponse, error) // Gets the current P4 forwarding-pipeline config. @@ -48,14 +48,14 @@ type P4RuntimeClient interface { // Represents the bidirectional stream between the controller and the // switch (initiated by the controller), and is managed for the following // purposes: - // - connection initiation through client arbitration - // - indicating switch session liveness: the session is live when switch - // sends a positive client arbitration update to the controller, and is - // considered dead when either the stream breaks or the switch sends a - // negative update for client arbitration - // - the controller sending/receiving packets to/from the switch - // - streaming of notifications from the switch - StreamChannel(ctx context.Context, opts ...grpc.CallOption) (P4Runtime_StreamChannelClient, error) + // - connection initiation through client arbitration + // - indicating switch session liveness: the session is live when switch + // sends a positive client arbitration update to the controller, and is + // considered dead when either the stream breaks or the switch sends a + // negative update for client arbitration + // - the controller sending/receiving packets to/from the switch + // - streaming of notifications from the switch + StreamChannel(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StreamMessageRequest, StreamMessageResponse], error) Capabilities(ctx context.Context, in *CapabilitiesRequest, opts ...grpc.CallOption) (*CapabilitiesResponse, error) } @@ -68,20 +68,22 @@ func NewP4RuntimeClient(cc grpc.ClientConnInterface) P4RuntimeClient { } func (c *p4RuntimeClient) Write(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(WriteResponse) - err := c.cc.Invoke(ctx, P4Runtime_Write_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, P4Runtime_Write_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *p4RuntimeClient) Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (P4Runtime_ReadClient, error) { - stream, err := c.cc.NewStream(ctx, &P4Runtime_ServiceDesc.Streams[0], P4Runtime_Read_FullMethodName, opts...) +func (c *p4RuntimeClient) Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ReadResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &P4Runtime_ServiceDesc.Streams[0], P4Runtime_Read_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &p4RuntimeReadClient{stream} + x := &grpc.GenericClientStream[ReadRequest, ReadResponse]{ClientStream: stream} if err := x.ClientStream.SendMsg(in); err != nil { return nil, err } @@ -91,26 +93,13 @@ func (c *p4RuntimeClient) Read(ctx context.Context, in *ReadRequest, opts ...grp return x, nil } -type P4Runtime_ReadClient interface { - Recv() (*ReadResponse, error) - grpc.ClientStream -} - -type p4RuntimeReadClient struct { - grpc.ClientStream -} - -func (x *p4RuntimeReadClient) Recv() (*ReadResponse, error) { - m := new(ReadResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type P4Runtime_ReadClient = grpc.ServerStreamingClient[ReadResponse] func (c *p4RuntimeClient) SetForwardingPipelineConfig(ctx context.Context, in *SetForwardingPipelineConfigRequest, opts ...grpc.CallOption) (*SetForwardingPipelineConfigResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(SetForwardingPipelineConfigResponse) - err := c.cc.Invoke(ctx, P4Runtime_SetForwardingPipelineConfig_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, P4Runtime_SetForwardingPipelineConfig_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -118,48 +107,32 @@ func (c *p4RuntimeClient) SetForwardingPipelineConfig(ctx context.Context, in *S } func (c *p4RuntimeClient) GetForwardingPipelineConfig(ctx context.Context, in *GetForwardingPipelineConfigRequest, opts ...grpc.CallOption) (*GetForwardingPipelineConfigResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(GetForwardingPipelineConfigResponse) - err := c.cc.Invoke(ctx, P4Runtime_GetForwardingPipelineConfig_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, P4Runtime_GetForwardingPipelineConfig_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } return out, nil } -func (c *p4RuntimeClient) StreamChannel(ctx context.Context, opts ...grpc.CallOption) (P4Runtime_StreamChannelClient, error) { - stream, err := c.cc.NewStream(ctx, &P4Runtime_ServiceDesc.Streams[1], P4Runtime_StreamChannel_FullMethodName, opts...) +func (c *p4RuntimeClient) StreamChannel(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[StreamMessageRequest, StreamMessageResponse], error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + stream, err := c.cc.NewStream(ctx, &P4Runtime_ServiceDesc.Streams[1], P4Runtime_StreamChannel_FullMethodName, cOpts...) if err != nil { return nil, err } - x := &p4RuntimeStreamChannelClient{stream} + x := &grpc.GenericClientStream[StreamMessageRequest, StreamMessageResponse]{ClientStream: stream} return x, nil } -type P4Runtime_StreamChannelClient interface { - Send(*StreamMessageRequest) error - Recv() (*StreamMessageResponse, error) - grpc.ClientStream -} - -type p4RuntimeStreamChannelClient struct { - grpc.ClientStream -} - -func (x *p4RuntimeStreamChannelClient) Send(m *StreamMessageRequest) error { - return x.ClientStream.SendMsg(m) -} - -func (x *p4RuntimeStreamChannelClient) Recv() (*StreamMessageResponse, error) { - m := new(StreamMessageResponse) - if err := x.ClientStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type P4Runtime_StreamChannelClient = grpc.BidiStreamingClient[StreamMessageRequest, StreamMessageResponse] func (c *p4RuntimeClient) Capabilities(ctx context.Context, in *CapabilitiesRequest, opts ...grpc.CallOption) (*CapabilitiesResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) out := new(CapabilitiesResponse) - err := c.cc.Invoke(ctx, P4Runtime_Capabilities_FullMethodName, in, out, opts...) + err := c.cc.Invoke(ctx, P4Runtime_Capabilities_FullMethodName, in, out, cOpts...) if err != nil { return nil, err } @@ -168,12 +141,12 @@ func (c *p4RuntimeClient) Capabilities(ctx context.Context, in *CapabilitiesRequ // P4RuntimeServer is the server API for P4Runtime service. // All implementations must embed UnimplementedP4RuntimeServer -// for forward compatibility +// for forward compatibility. type P4RuntimeServer interface { // Update one or more P4 entities on the target. Write(context.Context, *WriteRequest) (*WriteResponse, error) // Read one or more P4 entities from the target. - Read(*ReadRequest, P4Runtime_ReadServer) error + Read(*ReadRequest, grpc.ServerStreamingServer[ReadResponse]) error // Sets the P4 forwarding-pipeline config. SetForwardingPipelineConfig(context.Context, *SetForwardingPipelineConfigRequest) (*SetForwardingPipelineConfigResponse, error) // Gets the current P4 forwarding-pipeline config. @@ -181,26 +154,29 @@ type P4RuntimeServer interface { // Represents the bidirectional stream between the controller and the // switch (initiated by the controller), and is managed for the following // purposes: - // - connection initiation through client arbitration - // - indicating switch session liveness: the session is live when switch - // sends a positive client arbitration update to the controller, and is - // considered dead when either the stream breaks or the switch sends a - // negative update for client arbitration - // - the controller sending/receiving packets to/from the switch - // - streaming of notifications from the switch - StreamChannel(P4Runtime_StreamChannelServer) error + // - connection initiation through client arbitration + // - indicating switch session liveness: the session is live when switch + // sends a positive client arbitration update to the controller, and is + // considered dead when either the stream breaks or the switch sends a + // negative update for client arbitration + // - the controller sending/receiving packets to/from the switch + // - streaming of notifications from the switch + StreamChannel(grpc.BidiStreamingServer[StreamMessageRequest, StreamMessageResponse]) error Capabilities(context.Context, *CapabilitiesRequest) (*CapabilitiesResponse, error) mustEmbedUnimplementedP4RuntimeServer() } -// UnimplementedP4RuntimeServer must be embedded to have forward compatible implementations. -type UnimplementedP4RuntimeServer struct { -} +// UnimplementedP4RuntimeServer must be embedded to have +// forward compatible implementations. +// +// NOTE: this should be embedded by value instead of pointer to avoid a nil +// pointer dereference when methods are called. +type UnimplementedP4RuntimeServer struct{} func (UnimplementedP4RuntimeServer) Write(context.Context, *WriteRequest) (*WriteResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Write not implemented") } -func (UnimplementedP4RuntimeServer) Read(*ReadRequest, P4Runtime_ReadServer) error { +func (UnimplementedP4RuntimeServer) Read(*ReadRequest, grpc.ServerStreamingServer[ReadResponse]) error { return status.Errorf(codes.Unimplemented, "method Read not implemented") } func (UnimplementedP4RuntimeServer) SetForwardingPipelineConfig(context.Context, *SetForwardingPipelineConfigRequest) (*SetForwardingPipelineConfigResponse, error) { @@ -209,13 +185,14 @@ func (UnimplementedP4RuntimeServer) SetForwardingPipelineConfig(context.Context, func (UnimplementedP4RuntimeServer) GetForwardingPipelineConfig(context.Context, *GetForwardingPipelineConfigRequest) (*GetForwardingPipelineConfigResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetForwardingPipelineConfig not implemented") } -func (UnimplementedP4RuntimeServer) StreamChannel(P4Runtime_StreamChannelServer) error { +func (UnimplementedP4RuntimeServer) StreamChannel(grpc.BidiStreamingServer[StreamMessageRequest, StreamMessageResponse]) error { return status.Errorf(codes.Unimplemented, "method StreamChannel not implemented") } func (UnimplementedP4RuntimeServer) Capabilities(context.Context, *CapabilitiesRequest) (*CapabilitiesResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Capabilities not implemented") } func (UnimplementedP4RuntimeServer) mustEmbedUnimplementedP4RuntimeServer() {} +func (UnimplementedP4RuntimeServer) testEmbeddedByValue() {} // UnsafeP4RuntimeServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to P4RuntimeServer will @@ -225,6 +202,13 @@ type UnsafeP4RuntimeServer interface { } func RegisterP4RuntimeServer(s grpc.ServiceRegistrar, srv P4RuntimeServer) { + // If the following call pancis, it indicates UnimplementedP4RuntimeServer was + // embedded by pointer and is nil. This will cause panics if an + // unimplemented method is ever invoked, so we test this at initialization + // time to prevent it from happening at runtime later due to I/O. + if t, ok := srv.(interface{ testEmbeddedByValue() }); ok { + t.testEmbeddedByValue() + } s.RegisterService(&P4Runtime_ServiceDesc, srv) } @@ -251,21 +235,11 @@ func _P4Runtime_Read_Handler(srv interface{}, stream grpc.ServerStream) error { if err := stream.RecvMsg(m); err != nil { return err } - return srv.(P4RuntimeServer).Read(m, &p4RuntimeReadServer{stream}) -} - -type P4Runtime_ReadServer interface { - Send(*ReadResponse) error - grpc.ServerStream + return srv.(P4RuntimeServer).Read(m, &grpc.GenericServerStream[ReadRequest, ReadResponse]{ServerStream: stream}) } -type p4RuntimeReadServer struct { - grpc.ServerStream -} - -func (x *p4RuntimeReadServer) Send(m *ReadResponse) error { - return x.ServerStream.SendMsg(m) -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type P4Runtime_ReadServer = grpc.ServerStreamingServer[ReadResponse] func _P4Runtime_SetForwardingPipelineConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(SetForwardingPipelineConfigRequest) @@ -304,30 +278,11 @@ func _P4Runtime_GetForwardingPipelineConfig_Handler(srv interface{}, ctx context } func _P4Runtime_StreamChannel_Handler(srv interface{}, stream grpc.ServerStream) error { - return srv.(P4RuntimeServer).StreamChannel(&p4RuntimeStreamChannelServer{stream}) -} - -type P4Runtime_StreamChannelServer interface { - Send(*StreamMessageResponse) error - Recv() (*StreamMessageRequest, error) - grpc.ServerStream -} - -type p4RuntimeStreamChannelServer struct { - grpc.ServerStream -} - -func (x *p4RuntimeStreamChannelServer) Send(m *StreamMessageResponse) error { - return x.ServerStream.SendMsg(m) + return srv.(P4RuntimeServer).StreamChannel(&grpc.GenericServerStream[StreamMessageRequest, StreamMessageResponse]{ServerStream: stream}) } -func (x *p4RuntimeStreamChannelServer) Recv() (*StreamMessageRequest, error) { - m := new(StreamMessageRequest) - if err := x.ServerStream.RecvMsg(m); err != nil { - return nil, err - } - return m, nil -} +// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name. +type P4Runtime_StreamChannelServer = grpc.BidiStreamingServer[StreamMessageRequest, StreamMessageResponse] func _P4Runtime_Capabilities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(CapabilitiesRequest)