diff --git a/.ci/Dockerfile.depend b/.ci/Dockerfile.depend index 612236e98..729c668ef 100644 --- a/.ci/Dockerfile.depend +++ b/.ci/Dockerfile.depend @@ -3,7 +3,7 @@ ARG BASE_IMAGE # # Dependencies image # -FROM ${BASE_IMAGE} as dependencies +FROM ${BASE_IMAGE:-ubuntu:22.04} AS dependencies ENV UNATTENDED=y @@ -11,7 +11,7 @@ RUN apt-get update \ && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq \ apt-utils wget cmake curl git -ENV GOVERSION=1.18.2 +ENV GOVERSION=1.24.0 ENV GOROOT="/root/.go" ENV GOPATH="/root/go" ENV PATH=$GOROOT/bin:$PATH @@ -22,9 +22,14 @@ RUN mkdir -p "${GOROOT}" &&\ RUN wget -nv "https://dl.google.com/go/go${GOVERSION}.linux-amd64.tar.gz" -O "/tmp/go.tar.gz" && \ tar -C "${GOROOT}" --strip-components=1 -xzf "/tmp/go.tar.gz" && \ rm -f "/tmp/go.tar.gz" && \ - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.50.1 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.64.8 + +RUN git config --global --add safe.directory /vpp-dataplane # Get modules used by the source code -COPY . /vpp-dataplane +RUN mkdir -p /vpp-dataplane +RUN git config --global --add safe.directory /vpp-dataplane +COPY go.mod /vpp-dataplane +COPY go.sum /vpp-dataplane WORKDIR /vpp-dataplane RUN go get ./... && rm -fr /vpp-dataplane diff --git a/.ci/Makefile b/.ci/Makefile index 789bd9b6a..88dbe97b6 100644 --- a/.ci/Makefile +++ b/.ci/Makefile @@ -13,7 +13,7 @@ ABS_PATH = $(abspath $(shell pwd)/..) # remain stable. # -BASE_IMAGE_BUILDER = ubuntu:20.04 +BASE_IMAGE_BUILDER = ubuntu:22.04 # Compute hash to detect any changes and rebuild /push the image DEPEND_HASH = $(shell echo "${BASE_IMAGE_BUILDER}-DOCKERFILE:$(shell md5sum Dockerfile.depend)" | md5sum | cut -f1 -d' ') diff --git a/.ci/common.mk b/.ci/common.mk index b6a2a8ba4..ceb83cd0d 100644 --- a/.ci/common.mk +++ b/.ci/common.mk @@ -15,6 +15,8 @@ SQUASH := --squash # push dependency PUSH_DEP := image +CGO_ENABLED := 0 + # CI specific variables ifdef CODEBUILD_BUILD_NUMBER # Define variable when building for CI diff --git a/calico-vpp-agent/Makefile b/calico-vpp-agent/Makefile index 5328633b6..930bf2316 100644 --- a/calico-vpp-agent/Makefile +++ b/calico-vpp-agent/Makefile @@ -25,9 +25,8 @@ build: felix-api-proxy bin ${DOCKER_RUN} go build -o ./bin/calico-vpp-agent ./cmd ${DOCKER_RUN} go build -o ./bin/debug ./cmd/debug-state -gobgp: GOBGP_DIR:=$(shell ${DOCKER_RUN} go list -f '{{.Dir}}' -m github.com/osrg/gobgp/v3) gobgp: bin - ${DOCKER_RUN} go build -o ./bin/gobgp $(GOBGP_DIR)/cmd/gobgp/ + ${DOCKER_RUN} go build -o ./bin/gobgp github.com/osrg/gobgp/v3/cmd/gobgp/ image: build gobgp @echo "Image tag : $(TAG)" > $(VERSION_FILE) diff --git a/calico-vpp-agent/cni/cni_server.go b/calico-vpp-agent/cni/cni_server.go index a33f72050..416f9df6b 100644 --- a/calico-vpp-agent/cni/cni_server.go +++ b/calico-vpp-agent/cni/cni_server.go @@ -38,6 +38,7 @@ import ( "github.com/projectcalico/vpp-dataplane/v3/calico-vpp-agent/common" "github.com/projectcalico/vpp-dataplane/v3/calico-vpp-agent/watchers" "github.com/projectcalico/vpp-dataplane/v3/config" + "github.com/projectcalico/vpp-dataplane/v3/vpp-manager/utils" "github.com/projectcalico/vpp-dataplane/v3/vpplink" "github.com/projectcalico/vpp-dataplane/v3/vpplink/types" ) @@ -61,6 +62,8 @@ type Server struct { availableBuffers uint64 + RedirectToHostClassifyTableIndex uint32 + networkDefinitions sync.Map cniMultinetEventChan chan common.CalicoVppEvent nodeBGPSpec *common.LocalNodeSpec @@ -245,6 +248,12 @@ func (s *Server) Add(ctx context.Context, request *cniproto.AddRequest) (*cnipro ErrorMessage: err.Error(), }, nil } + if len(config.GetCalicoVppInitialConfig().RedirectToHostRules) != 0 && podSpec.NetworkName == "" { + err := s.AddRedirectToHostToInterface(podSpec.TunTapSwIfIndex) + if err != nil { + return nil, err + } + } s.podInterfaceMap[podSpec.Key()] = *podSpec cniServerStateFile := fmt.Sprintf("%s%d", config.CniServerStateFile, storage.CniServerStateFileVersion) @@ -315,6 +324,34 @@ func (s *Server) rescanState() { default: s.log.Errorf("Interface add failed %s : %v", podSpecCopy.String(), err) } + if len(config.GetCalicoVppInitialConfig().RedirectToHostRules) != 0 && podSpecCopy.NetworkName == "" { + err := s.AddRedirectToHostToInterface(podSpecCopy.TunTapSwIfIndex) + if err != nil { + s.log.Error(err) + } + } + } +} + +func (s *Server) DelRedirectToHostOnInterface(swIfIndex uint32) error { + err := s.vpp.SetClassifyInputInterfaceTables(swIfIndex, s.RedirectToHostClassifyTableIndex, types.InvalidTableId, types.InvalidTableId, false /*isAdd*/) + if err != nil { + return errors.Wrapf(err, "Error deleting classify input table from interface") + } else { + s.log.Infof("pod(del) delete input acl table %d from interface %d successfully", s.RedirectToHostClassifyTableIndex, swIfIndex) + return nil + } +} + +func (s *Server) AddRedirectToHostToInterface(swIfIndex uint32) error { + s.log.Infof("Setting classify input acl table %d on interface %d", s.RedirectToHostClassifyTableIndex, swIfIndex) + err := s.vpp.SetClassifyInputInterfaceTables(swIfIndex, s.RedirectToHostClassifyTableIndex, types.InvalidTableId, types.InvalidTableId, true) + if err != nil { + s.log.Warnf("Error setting classify input table: %s, retrying...", err) + return errors.Errorf("could not set input acl table %d for interface %d", s.RedirectToHostClassifyTableIndex, swIfIndex) + } else { + s.log.Infof("set input acl table %d for interface %d successfully", s.RedirectToHostClassifyTableIndex, swIfIndex) + return nil } } @@ -442,6 +479,47 @@ forloop: return nil } +func (s *Server) getMainTap0Info() (tapSwIfIndex uint32, address net.IP) { + for _, i := range common.VppManagerInfo.UplinkStatuses { + if i.IsMain { + tapSwIfIndex = i.TapSwIfIndex + break + } + } + address = utils.FakeVppNextHopIP4 + return +} + +func (s *Server) createRedirectToHostRules() (uint32, error) { + var maxNumEntries uint32 + if len(config.GetCalicoVppInitialConfig().RedirectToHostRules) != 0 { + maxNumEntries = uint32(2 * len(config.GetCalicoVppInitialConfig().RedirectToHostRules)) + } else { + maxNumEntries = 1 + } + index, err := s.vpp.AddClassifyTable(&types.ClassifyTable{ + Mask: types.DstThreeTupleMask, + NextTableIndex: types.InvalidID, + MaxNumEntries: maxNumEntries, + MissNextIndex: ^uint32(0), + }) + if err != nil { + return types.InvalidID, err + } + tap0swifindex, tap0nexthop := s.getMainTap0Info() + for _, rule := range config.GetCalicoVppInitialConfig().RedirectToHostRules { + err = s.vpp.AddSessionRedirect(&types.SessionRedirect{ + FiveTuple: types.NewDst3Tuple(rule.Proto, net.ParseIP(rule.Ip), rule.Port), + TableIndex: index, + }, &types.RoutePath{Gw: tap0nexthop, SwIfIndex: tap0swifindex}) + if err != nil { + return types.InvalidID, err + } + } + + return index, nil +} + func (s *Server) ServeCNI(t *tomb.Tomb) error { err := syscall.Unlink(config.CNIServerSocket) if err != nil && !gerrors.Is(err, os.ErrNotExist) { @@ -453,6 +531,10 @@ func (s *Server) ServeCNI(t *tomb.Tomb) error { return errors.Wrapf(err, "failed to listen on %s", config.CNIServerSocket) } + s.RedirectToHostClassifyTableIndex, err = s.createRedirectToHostRules() + if err != nil { + return err + } cniproto.RegisterCniDataplaneServer(s.grpcServer, s) if *config.GetCalicoVppFeatureGates().MultinetEnabled { diff --git a/calico-vpp-agent/cni/network_vpp.go b/calico-vpp-agent/cni/network_vpp.go index 368e97881..a0730419e 100644 --- a/calico-vpp-agent/cni/network_vpp.go +++ b/calico-vpp-agent/cni/network_vpp.go @@ -285,6 +285,12 @@ err: // CleanUpVPPNamespace deletes the devices in the network namespace. func (s *Server) DelVppInterface(podSpec *storage.LocalPodSpec) { + if len(config.GetCalicoVppInitialConfig().RedirectToHostRules) != 0 && podSpec.NetworkName == "" { + err := s.DelRedirectToHostOnInterface(podSpec.TunTapSwIfIndex) + if err != nil { + s.log.Error(err) + } + } err := ns.IsNSorErr(podSpec.NetnsName) if err != nil { s.log.Infof("pod(del) netns '%s' doesn't exist, skipping", podSpec.NetnsName) diff --git a/calico-vpp-agent/cni/network_vpp_routes.go b/calico-vpp-agent/cni/network_vpp_routes.go index ea0f43ece..fe2b73f83 100644 --- a/calico-vpp-agent/cni/network_vpp_routes.go +++ b/calico-vpp-agent/cni/network_vpp_routes.go @@ -62,6 +62,7 @@ func (s *Server) RoutePodInterface(podSpec *storage.LocalPodSpec, stack *vpplink SwIfIndex: swIfIndex, IP: containerIP.IP, HardwareAddr: common.ContainerSideMacAddress, + Flags: types.IPNeighborStatic, }) if err != nil { return errors.Wrapf(err, "Error adding neighbor if[%d] %s", swIfIndex, containerIP.IP.String()) @@ -141,7 +142,7 @@ func (s *Server) RoutePblPortsPodInterface(podSpec *storage.LocalPodSpec, stack } else { stack.Push(s.vpp.DelPblClient, pblIndex) } - podSpec.PblIndexes = append(podSpec.PblIndexes, pblIndex) + podSpec.PblIndex = pblIndex if !isL3 { s.log.Infof("pod(add) neighbor if[%d] %s", swIfIndex, containerIP.IP.String()) @@ -149,6 +150,7 @@ func (s *Server) RoutePblPortsPodInterface(podSpec *storage.LocalPodSpec, stack SwIfIndex: swIfIndex, IP: containerIP.IP, HardwareAddr: common.ContainerSideMacAddress, + Flags: types.IPNeighborStatic, }) if err != nil { return errors.Wrapf(err, "Cannot add neighbor if[%d] %s", swIfIndex, containerIP.IP.String()) @@ -159,12 +161,10 @@ func (s *Server) RoutePblPortsPodInterface(podSpec *storage.LocalPodSpec, stack } func (s *Server) UnroutePblPortsPodInterface(podSpec *storage.LocalPodSpec, swIfIndex uint32) { - for _, pblIndex := range podSpec.PblIndexes { - s.log.Infof("pod(del) PBL client[%d]", pblIndex) - err := s.vpp.DelPblClient(pblIndex) - if err != nil { - s.log.Warnf("Error deleting pbl conf %s", err) - } + s.log.Infof("pod(del) PBL client[%d]", podSpec.PblIndex) + err := s.vpp.DelPblClient(podSpec.PblIndex) + if err != nil { + s.log.Warnf("Error deleting pbl conf %s", err) } } diff --git a/calico-vpp-agent/cni/pod_interface/common.go b/calico-vpp-agent/cni/pod_interface/common.go index 04cc794ec..25b1478b5 100644 --- a/calico-vpp-agent/cni/pod_interface/common.go +++ b/calico-vpp-agent/cni/pod_interface/common.go @@ -105,7 +105,7 @@ func (i *PodInterfaceDriverData) DoPodIfNatConfiguration(podSpec *storage.LocalP stack.Push(i.vpp.RemovePodInterface, swIfIndex) } - err = i.vpp.CnatEnableFeatures(swIfIndex) + err = i.vpp.CnatEnableFeatures(swIfIndex, true, podSpec.GetVrfId(vpplink.IpFamilyV4), podSpec.GetVrfId(vpplink.IpFamilyV6)) if err != nil { return errors.Wrapf(err, "error configuring nat on pod interface") } @@ -129,6 +129,10 @@ func (i *PodInterfaceDriverData) DoPodInterfaceConfiguration(podSpec *storage.Lo } } + err = i.vpp.EnableCnatSNATOnInterfaceVRF(swIfIndex) + if err != nil { + return errors.Wrapf(err, "error configuring cnat snat on pod VRF") + } if !*ifSpec.IsL3 { /* L2 */ err = i.vpp.SetPromiscOn(swIfIndex) diff --git a/calico-vpp-agent/cni/pod_interface/memif.go b/calico-vpp-agent/cni/pod_interface/memif.go index 791066e51..14386bc28 100644 --- a/calico-vpp-agent/cni/pod_interface/memif.go +++ b/calico-vpp-agent/cni/pod_interface/memif.go @@ -93,39 +93,41 @@ func (i *MemifPodInterfaceDriver) CreateInterface(podSpec *storage.LocalPodSpec, } podSpec.MemifSwIfIndex = memif.SwIfIndex - watcher, err := i.vpp.WatchInterfaceEvents(memif.SwIfIndex) - if err != nil { - return err - } else { - stack.Push(watcher.Stop) - } - go func() { - i.log.WithFields(map[string]interface{}{ - "swIfIndex": memif.SwIfIndex, - }).Infof("begin watching interface events for: %v", i.Name) - - for event := range watcher.Events() { + if *(*config.CalicoVppDebug).SpreadTxQueuesOnWorkers { + watcher, err := i.vpp.WatchInterfaceEvents(memif.SwIfIndex) + if err != nil { + return err + } else { + stack.Push(watcher.Stop) + } + go func() { i.log.WithFields(map[string]interface{}{ "swIfIndex": memif.SwIfIndex, - }).Infof("processing interface event for %v: %+v", i.Name, event) - - switch event.Type { - case types.InterfaceEventLinkUp: - err = i.SpreadTxQueuesOnWorkers(memif.SwIfIndex, memif.NumTxQueues) - if err != nil { - i.log.Errorf("error spreading tx queues on workers: %v", err) + }).Infof("begin watching interface events for: %v", i.Name) + + for event := range watcher.Events() { + i.log.WithFields(map[string]interface{}{ + "swIfIndex": memif.SwIfIndex, + }).Infof("processing interface event for %v: %+v", i.Name, event) + + switch event.Type { + case types.InterfaceEventLinkUp: + err = i.SpreadTxQueuesOnWorkers(memif.SwIfIndex, memif.NumTxQueues) + if err != nil { + i.log.Errorf("error spreading tx queues on workers: %v", err) + } + i.SpreadRxQueuesOnWorkers(memif.SwIfIndex, podSpec.IfSpec.NumRxQueues) + case types.InterfaceEventDeleted: // this might not be needed here, it could be handled internally in the watcher + watcher.Stop() } - i.SpreadRxQueuesOnWorkers(memif.SwIfIndex, podSpec.IfSpec.NumRxQueues) - case types.InterfaceEventDeleted: // this might not be needed here, it could be handled internally in the watcher - watcher.Stop() } - } - i.log.WithFields(map[string]interface{}{ - "swIfIndex": memif.SwIfIndex, - }).Infof("done watching interface events for: %v", i.Name) + i.log.WithFields(map[string]interface{}{ + "swIfIndex": memif.SwIfIndex, + }).Infof("done watching interface events for: %v", i.Name) - }() + }() + } err = i.vpp.SetInterfaceTag(memif.SwIfIndex, podSpec.GetInterfaceTag(i.Name)) if err != nil { diff --git a/calico-vpp-agent/cni/storage/storage.go b/calico-vpp-agent/cni/storage/storage.go index b81345ae7..18bdb9289 100644 --- a/calico-vpp-agent/cni/storage/storage.go +++ b/calico-vpp-agent/cni/storage/storage.go @@ -35,7 +35,7 @@ import ( ) const ( - CniServerStateFileVersion = 8 // Used to ensure compatibility wen we reload data + CniServerStateFileVersion = 9 // Used to ensure compatibility wen we reload data MaxApiTagLen = 63 /* No more than 64 characters in API tags */ VrfTagHashLen = 8 /* how many hash charatecters (b64) of the name in tag prefix (useful when trucated) */ ) @@ -126,11 +126,6 @@ func (ps *LocalPodSpec) FullString() string { for _, e := range routes { routesLst = append(routesLst, e.String()) } - pblIndexes := ps.PblIndexes - pblIndexesLst := make([]string, 0, len(pblIndexes)) - for _, e := range pblIndexes { - pblIndexesLst = append(pblIndexesLst, fmt.Sprint(e)) - } s := fmt.Sprintf("InterfaceName: %s\n", ps.InterfaceName) s += fmt.Sprintf("NetnsName: %s\n", ps.NetnsName) s += fmt.Sprintf("AllowIpForwarding: %t\n", ps.AllowIpForwarding) @@ -151,7 +146,7 @@ func (ps *LocalPodSpec) FullString() string { s += fmt.Sprintf("TunTapSwIfIndex: %d\n", ps.TunTapSwIfIndex) s += fmt.Sprintf("MemifSwIfIndex: %d\n", ps.MemifSwIfIndex) s += fmt.Sprintf("LoopbackSwIfIndex: %d\n", ps.LoopbackSwIfIndex) - s += fmt.Sprintf("PblIndexes: %s\n", strings.Join(pblIndexesLst, ", ")) + s += fmt.Sprintf("PblIndex: %d\n", ps.PblIndex) s += fmt.Sprintf("V4VrfId: %d\n", ps.V4VrfId) s += fmt.Sprintf("V6VrfId: %d\n", ps.V6VrfId) return s @@ -238,8 +233,7 @@ type LocalPodSpec struct { TunTapSwIfIndex uint32 MemifSwIfIndex uint32 LoopbackSwIfIndex uint32 - PblIndexesLen int `struc:"int16,sizeof=PblIndexes"` - PblIndexes []uint32 + PblIndex uint32 /** * These fields are only a runtime cache, but we also store them @@ -268,7 +262,6 @@ func (ps *LocalPodSpec) Copy() LocalPodSpec { newPs.ContainerIps = append(make([]LocalIP, 0), ps.ContainerIps...) newPs.HostPorts = append(make([]HostPortBinding, 0), ps.HostPorts...) newPs.IfPortConfigs = append(make([]LocalIfPortConfigs, 0), ps.IfPortConfigs...) - newPs.PblIndexes = append(make([]uint32, 0), ps.PblIndexes...) return newPs @@ -305,7 +298,7 @@ func TruncateStr(text string, size int) string { func (ps *LocalPodSpec) GetVrfTag(ipFamily vpplink.IpFamily, custom string) string { h := hash(fmt.Sprintf("%s%s%s%s", ipFamily.ShortStr, ps.NetnsName, ps.InterfaceName, custom)) - s := fmt.Sprintf("%s-%s-%s-%s", h, ipFamily.ShortStr, ps.InterfaceName, filepath.Base(ps.NetnsName)) + s := fmt.Sprintf("%s-%s-%s%s-%s", h, ipFamily.ShortStr, ps.InterfaceName, custom, filepath.Base(ps.NetnsName)) return TruncateStr(s, MaxApiTagLen) } diff --git a/calico-vpp-agent/common_tests/common_tests.go b/calico-vpp-agent/common_tests/common_tests.go index 126c957a1..8814569b0 100644 --- a/calico-vpp-agent/common_tests/common_tests.go +++ b/calico-vpp-agent/common_tests/common_tests.go @@ -128,7 +128,7 @@ func AssertRPFVRFExistence(vpp *vpplink.VppLink, interfaceName string, netnsName "Failed to retrieve list of VRFs in VPP") hbytes := sha512.Sum512([]byte(fmt.Sprintf("%s%s%s%s", "4", netnsName, interfaceName, "RPF"))) h := base64.StdEncoding.EncodeToString(hbytes[:])[:storage.VrfTagHashLen] - s := fmt.Sprintf("%s-%s-%s-%s", h, "4", interfaceName, filepath.Base(netnsName)) + s := fmt.Sprintf("%s-%s-%sRPF-%s", h, "4", interfaceName, filepath.Base(netnsName)) vrfTag := storage.TruncateStr(s, storage.MaxApiTagLen) foundRPFVRF := false var vrfID uint32 diff --git a/calico-vpp-agent/connectivity/connectivity_server.go b/calico-vpp-agent/connectivity/connectivity_server.go index dbddd98bf..c1dc19275 100644 --- a/calico-vpp-agent/connectivity/connectivity_server.go +++ b/calico-vpp-agent/connectivity/connectivity_server.go @@ -137,6 +137,21 @@ func (s *ConnectivityServer) updateAllIPConnectivity() { } } +func (s *ConnectivityServer) configureRemoteNodeSnat(node *common.LocalNodeSpec, isAdd bool) { + if node.IPv4Address != nil { + err := s.vpp.CnatAddDelSnatPrefix(common.ToMaxLenCIDR(node.IPv4Address.IP), isAdd) + if err != nil { + s.log.Errorf("error configuring snat prefix for current node (%v): %v", node.IPv4Address.IP, err) + } + } + if node.IPv6Address != nil { + err := s.vpp.CnatAddDelSnatPrefix(common.ToMaxLenCIDR(node.IPv6Address.IP), isAdd) + if err != nil { + s.log.Errorf("error configuring snat prefix for current node (%v): %v", node.IPv6Address.IP, err) + } + } +} + func (s *ConnectivityServer) ServeConnectivity(t *tomb.Tomb) error { /** * There might be leftover state in VPP in case we restarted @@ -189,6 +204,7 @@ func (s *ConnectivityServer) ServeConnectivity(t *tomb.Tomb) error { if old.IPv6Address != nil { delete(s.nodeByAddr, old.IPv6Address.IP.String()) } + s.configureRemoteNodeSnat(old, false /* isAdd */) } if new != nil { if new.IPv4Address != nil { @@ -197,6 +213,7 @@ func (s *ConnectivityServer) ServeConnectivity(t *tomb.Tomb) error { if new.IPv6Address != nil { s.nodeByAddr[new.IPv6Address.IP.String()] = *new } + s.configureRemoteNodeSnat(new, true /* isAdd */) } case common.FelixConfChanged: old, _ := evt.Old.(*felixConfig.Config) diff --git a/calico-vpp-agent/connectivity/ipip.go b/calico-vpp-agent/connectivity/ipip.go index 3a971a3c2..ebb4cdd66 100644 --- a/calico-vpp-agent/connectivity/ipip.go +++ b/calico-vpp-agent/connectivity/ipip.go @@ -127,7 +127,7 @@ func (p *IpipProvider) AddConnectivity(cn *common.NodeConnectivity) error { return errors.Wrapf(err, "Error enabling gso for ipip interface") } - err = p.vpp.CnatEnableFeatures(swIfIndex) + err = p.vpp.CnatEnableFeatures(swIfIndex, true, 0, 0) if err != nil { p.errorCleanup(tunnel) return errors.Wrapf(err, "Error enabling nat for ipip interface") diff --git a/calico-vpp-agent/connectivity/ipsec.go b/calico-vpp-agent/connectivity/ipsec.go index ee2489b4c..0ee44084d 100644 --- a/calico-vpp-agent/connectivity/ipsec.go +++ b/calico-vpp-agent/connectivity/ipsec.go @@ -197,7 +197,7 @@ func (p *IpsecProvider) createIPSECTunnel(tunnel *IpsecTunnel, psk string, stack return errors.Wrapf(err, "Error enabling gso for ipip interface") } - err = p.vpp.CnatEnableFeatures(swIfIndex) + err = p.vpp.CnatEnableFeatures(swIfIndex, true, 0, 0) if err != nil { return errors.Wrapf(err, "Error enabling nat for ipip interface") } diff --git a/calico-vpp-agent/connectivity/vxlan.go b/calico-vpp-agent/connectivity/vxlan.go index e4bc1896c..cd142711a 100644 --- a/calico-vpp-agent/connectivity/vxlan.go +++ b/calico-vpp-agent/connectivity/vxlan.go @@ -177,7 +177,7 @@ func (p *VXLanProvider) AddConnectivity(cn *common.NodeConnectivity) error { return errors.Wrapf(err, "Error enabling gso for vxlan interface") } - err = p.vpp.CnatEnableFeatures(swIfIndex) + err = p.vpp.CnatEnableFeatures(swIfIndex, true, 0, 0) if err != nil { // TODO : delete tunnel return errors.Wrapf(err, "Error enabling nat for vxlan interface") diff --git a/calico-vpp-agent/connectivity/wireguard.go b/calico-vpp-agent/connectivity/wireguard.go index 474700057..a6b915137 100644 --- a/calico-vpp-agent/connectivity/wireguard.go +++ b/calico-vpp-agent/connectivity/wireguard.go @@ -217,7 +217,7 @@ func (p *WireguardProvider) createWireguardTunnels() error { return errors.Wrapf(err, "Error enabling gso for wireguard interface") } - err = p.vpp.CnatEnableFeatures(swIfIndex) + err = p.vpp.CnatEnableFeatures(swIfIndex, true, 0, 0) if err != nil { p.errorCleanup(tunnel) return errors.Wrapf(err, "Error enabling nat for wireguard interface") diff --git a/calico-vpp-agent/policy/policy_server.go b/calico-vpp-agent/policy/policy_server.go index 37488b938..cbec6a77a 100644 --- a/calico-vpp-agent/policy/policy_server.go +++ b/calico-vpp-agent/policy/policy_server.go @@ -1205,21 +1205,17 @@ func (s *Server) handleWireguardEndpointRemove(msg *proto.WireguardEndpointRemov } func (s *Server) onNodeUpdated(old *common.LocalNodeSpec, node *common.LocalNodeSpec) (err error) { - // This is used by the routing server to process Wireguard key updates - // As a result we only send an event when a node is updated, not when it is added or deleted - common.SendEvent(common.CalicoVppEvent{ - Type: common.PeerNodeStateChanged, - Old: old, - New: node, - }) change := common.GetIpNetChangeType(old.IPv4Address, node.IPv4Address) | common.GetIpNetChangeType(old.IPv6Address, node.IPv6Address) if change&(common.ChangeDeleted|common.ChangeUpdated) != 0 && node.Name == *config.NodeName { // restart if our BGP config changed return NodeWatcherRestartError{} } if change != common.ChangeSame { - s.configureRemoteNodeSnat(old, false /* isAdd */) - s.configureRemoteNodeSnat(node, true /* isAdd */) + common.SendEvent(common.CalicoVppEvent{ + Type: common.PeerNodeStateChanged, + Old: old, + New: node, + }) } return nil @@ -1232,12 +1228,21 @@ func (s *Server) onNodeAdded(node *common.LocalNodeSpec) (err error) { /* We found a BGP Spec that seems valid enough */ s.GotOurNodeBGPchan <- node } + ip4 := net.IP{} + ip6 := net.IP{} if node.IPv4Address != nil { s.ip4 = &node.IPv4Address.IP + ip4 = node.IPv4Address.IP } if node.IPv6Address != nil { s.ip6 = &node.IPv6Address.IP + ip6 = node.IPv6Address.IP + } + err = s.vpp.CnatSetSnatAddresses(ip4, ip6) + if err != nil { + s.log.Errorf("Failed to configure SNAT addresses %v", err) } + err = s.createAllowFromHostPolicy() if err != nil { return errors.Wrap(err, "Error in creating AllowFromHostPolicy") @@ -1252,26 +1257,10 @@ func (s *Server) onNodeAdded(node *common.LocalNodeSpec) (err error) { Type: common.PeerNodeStateChanged, New: node, }) - s.configureRemoteNodeSnat(node, true /* isAdd */) return nil } -func (s *Server) configureRemoteNodeSnat(node *common.LocalNodeSpec, isAdd bool) { - if node.IPv4Address != nil { - err := s.vpp.CnatAddDelSnatPrefix(common.ToMaxLenCIDR(node.IPv4Address.IP), isAdd) - if err != nil { - s.log.Errorf("error configuring snat prefix for current node (%v): %v", node.IPv4Address.IP, err) - } - } - if node.IPv6Address != nil { - err := s.vpp.CnatAddDelSnatPrefix(common.ToMaxLenCIDR(node.IPv6Address.IP), isAdd) - if err != nil { - s.log.Errorf("error configuring snat prefix for current node (%v): %v", node.IPv6Address.IP, err) - } - } -} - func (s *Server) onNodeDeleted(old *common.LocalNodeSpec, node *common.LocalNodeSpec) error { common.SendEvent(common.CalicoVppEvent{ Type: common.PeerNodeStateChanged, @@ -1282,7 +1271,6 @@ func (s *Server) onNodeDeleted(old *common.LocalNodeSpec, node *common.LocalNode return NodeWatcherRestartError{} } - s.configureRemoteNodeSnat(old, false /* isAdd */) return nil } @@ -1305,8 +1293,8 @@ func (s *Server) handleIpamPoolUpdate(msg *proto.IPAMPoolUpdate, pending bool) ( if msg.Pool.Cidr != existing.Pool.Cidr || msg.Pool.Masquerade != existing.Pool.Masquerade { var err, err2 error - err = s.addDelSnatPrefix(&existing, false /* isAdd */) - err2 = s.addDelSnatPrefix(msg, true /* isAdd */) + err = s.addDelSnatPrefixForIPPool(&existing, false /* isAdd */) + err2 = s.addDelSnatPrefixForIPPool(msg, true /* isAdd */) if err != nil || err2 != nil { return errors.Errorf("error updating snat prefix del:%s, add:%s", err, err2) } @@ -1320,7 +1308,7 @@ func (s *Server) handleIpamPoolUpdate(msg *proto.IPAMPoolUpdate, pending bool) ( s.log.Infof("Adding pool: %s, nat:%t", key, msg.Pool.Masquerade) s.ippoolmap[key] = *msg s.log.Debugf("Pool %v Added, handler called", msg) - err = s.addDelSnatPrefix(msg, true /* isAdd */) + err = s.addDelSnatPrefixForIPPool(msg, true /* isAdd */) if err != nil { return errors.Wrap(err, "error handling ipam add") } @@ -1348,7 +1336,7 @@ func (s *Server) handleIpamPoolRemove(msg *proto.IPAMPoolRemove, pending bool) ( delete(s.ippoolmap, key) s.log.Infof("Deleting pool: %s", key) s.log.Debugf("Pool %s deleted, handler called", existing.Pool.Cidr) - err = s.addDelSnatPrefix(&existing, false /* isAdd */) + err = s.addDelSnatPrefixForIPPool(&existing, false /* isAdd */) if err != nil { return errors.Wrap(err, "error handling ipam deletion") } @@ -1386,12 +1374,12 @@ func equalPools(a *proto.IPAMPoolUpdate, b *proto.IPAMPoolUpdate) bool { return true } -// addDelSnatPrefix configures IP Pool prefixes so that we don't source-NAT the packets going +// addDelSnatPrefixForIPPool configures IP Pool prefixes so that we don't source-NAT the packets going // to these addresses. All the IP Pools prefixes are configured that way so that pod <-> pod // communications are never source-nated in the cluster // Note(aloaugus) - I think the iptables dataplane behaves differently and uses the k8s level // pod CIDR for this rather than the individual pool prefixes -func (s *Server) addDelSnatPrefix(pool *proto.IPAMPoolUpdate, isAdd bool) (err error) { +func (s *Server) addDelSnatPrefixForIPPool(pool *proto.IPAMPoolUpdate, isAdd bool) (err error) { _, ipNet, err := net.ParseCIDR(pool.Pool.Cidr) if err != nil { return errors.Wrapf(err, "Couldn't parse pool CIDR %s", pool.Pool.Cidr) diff --git a/calico-vpp-agent/prometheus/prometheus.go b/calico-vpp-agent/prometheus/prometheus.go index a45dba98a..e31640856 100644 --- a/calico-vpp-agent/prometheus/prometheus.go +++ b/calico-vpp-agent/prometheus/prometheus.go @@ -33,18 +33,10 @@ import ( "github.com/projectcalico/vpp-dataplane/v3/calico-vpp-agent/cni/storage" "github.com/projectcalico/vpp-dataplane/v3/calico-vpp-agent/common" + "github.com/projectcalico/vpp-dataplane/v3/config" "github.com/projectcalico/vpp-dataplane/v3/vpplink" ) -type Event int - -const ( - Add Event = 0 - Delete Event = 1 - - recordMetricInterval int64 = 5 -) - type Server struct { log *logrus.Entry vpp *vpplink.VppLink @@ -63,13 +55,16 @@ func (s *Server) recordMetrics(t *tomb.Tomb) { mux := http.NewServeMux() mux.Handle("/metrics", pe) go func() { - err := http.ListenAndServe(":8888", mux) + err := http.ListenAndServe( + config.GetCalicoVppInitialConfig().PrometheusListenEndpoint, + mux, + ) if err != nil { s.log.Fatalf("Failed to serve metrics: %s", err) } }() - for t.Alive() { - time.Sleep(time.Second * time.Duration(recordMetricInterval)) + ticker := time.NewTicker(*config.GetCalicoVppInitialConfig().PrometheusRecordMetricInterval) + for ; t.Alive(); <-ticker.C { ifNames, dumpStats, _ := vpplink.GetInterfaceStats(s.sc) for _, sta := range dumpStats { if string(sta.Name) != "/if/names" { @@ -84,6 +79,7 @@ func (s *Server) recordMetrics(t *tomb.Tomb) { } } } + ticker.Stop() } var units = map[int]string{0: "packets", 1: "bytes"} @@ -207,12 +203,18 @@ func NewPrometheusServer(vpp *vpplink.VppLink, l *logrus.Entry) *Server { podInterfacesByKey: make(map[string]storage.LocalPodSpec), podInterfacesBySwifIndex: make(map[uint32]storage.LocalPodSpec), } - reg := common.RegisterHandler(server.channel, "prometheus events") - reg.ExpectEvents(common.PodAdded, common.PodDeleted) + if *config.GetCalicoVppFeatureGates().PrometheusEnabled { + reg := common.RegisterHandler(server.channel, "prometheus events") + reg.ExpectEvents(common.PodAdded, common.PodDeleted) + } return server } func (s *Server) ServePrometheus(t *tomb.Tomb) error { + if !(*config.GetCalicoVppFeatureGates().PrometheusEnabled) { + return nil + } + s.log.Infof("Serve() Prometheus exporter") go func() { for t.Alive() { @@ -222,11 +224,12 @@ func (s *Server) ServePrometheus(t *tomb.Tomb) error { case common.PodAdded: podSpec := evt.New.(*storage.LocalPodSpec) s.lock.Lock() - if podSpec.TunTapSwIfIndex == vpplink.INVALID_SW_IF_INDEX { - s.podInterfacesBySwifIndex[podSpec.MemifSwIfIndex] = *podSpec - } else { + if podSpec.TunTapSwIfIndex != vpplink.INVALID_SW_IF_INDEX { s.podInterfacesBySwifIndex[podSpec.TunTapSwIfIndex] = *podSpec } + if podSpec.MemifSwIfIndex != vpplink.INVALID_SW_IF_INDEX { + s.podInterfacesBySwifIndex[podSpec.MemifSwIfIndex] = *podSpec + } s.podInterfacesByKey[podSpec.Key()] = *podSpec s.lock.Unlock() case common.PodDeleted: @@ -234,11 +237,12 @@ func (s *Server) ServePrometheus(t *tomb.Tomb) error { podSpec := evt.Old.(*storage.LocalPodSpec) initialPod := s.podInterfacesByKey[podSpec.Key()] delete(s.podInterfacesByKey, initialPod.Key()) - if podSpec.TunTapSwIfIndex == vpplink.INVALID_SW_IF_INDEX { - delete(s.podInterfacesBySwifIndex, initialPod.MemifSwIfIndex) - } else { + if podSpec.TunTapSwIfIndex != vpplink.INVALID_SW_IF_INDEX { delete(s.podInterfacesBySwifIndex, initialPod.TunTapSwIfIndex) } + if podSpec.MemifSwIfIndex != vpplink.INVALID_SW_IF_INDEX { + delete(s.podInterfacesBySwifIndex, initialPod.MemifSwIfIndex) + } s.lock.Unlock() } } diff --git a/calico-vpp-agent/services/service_handler.go b/calico-vpp-agent/services/service_handler.go index 98693bb76..505b5908f 100644 --- a/calico-vpp-agent/services/service_handler.go +++ b/calico-vpp-agent/services/service_handler.go @@ -108,8 +108,8 @@ func buildCnatEntryForServicePort(servicePort *v1.ServicePort, service *v1.Servi }, Flags: flags, } - /* In nodeports, we also sNAT */ - if isNodePort { + /* In nodeports, we need to sNAT when endpoint is not local to have a symmetric traffic */ + if isNodePort && !isEndpointAddressLocal(&endpointAddress) { backend.SrcEndpoint.IP = serviceIP } backends = append(backends, backend) @@ -143,14 +143,14 @@ func (s *Server) GetLocalService(service *v1.Service, ep *v1.Endpoints) (localSe clusterIP := net.ParseIP(service.Spec.ClusterIP) nodeIP := s.getNodeIP(vpplink.IsIP6(clusterIP)) for _, servicePort := range service.Spec.Ports { - if !clusterIP.IsUnspecified() { + if !clusterIP.IsUnspecified() && len(clusterIP) > 0 { entry := buildCnatEntryForServicePort(&servicePort, service, ep, clusterIP, false /* isNodePort */, *serviceSpec) localService.Entries = append(localService.Entries, *entry) } for _, eip := range service.Spec.ExternalIPs { extIP := net.ParseIP(eip) - if !extIP.IsUnspecified() { + if !extIP.IsUnspecified() && len(extIP) > 0 { entry := buildCnatEntryForServicePort(&servicePort, service, ep, extIP, false /* isNodePort */, *serviceSpec) localService.Entries = append(localService.Entries, *entry) if IsLocalOnly(service) && len(entry.Backends) > 0 { @@ -161,7 +161,7 @@ func (s *Server) GetLocalService(service *v1.Service, ep *v1.Endpoints) (localSe for _, ingress := range service.Status.LoadBalancer.Ingress { ingressIP := net.ParseIP(ingress.IP) - if !ingressIP.IsUnspecified() { + if !ingressIP.IsUnspecified() && len(ingressIP) > 0 { entry := buildCnatEntryForServicePort(&servicePort, service, ep, ingressIP, false /* isNodePort */, *serviceSpec) localService.Entries = append(localService.Entries, *entry) if IsLocalOnly(service) && len(entry.Backends) > 0 { @@ -171,7 +171,7 @@ func (s *Server) GetLocalService(service *v1.Service, ep *v1.Endpoints) (localSe } if service.Spec.Type == v1.ServiceTypeNodePort { - if !nodeIP.IsUnspecified() { + if !nodeIP.IsUnspecified() && len(nodeIP) > 0 { entry := buildCnatEntryForServicePort(&servicePort, service, ep, nodeIP, true /* isNodePort */, *serviceSpec) localService.Entries = append(localService.Entries, *entry) } @@ -181,7 +181,7 @@ func (s *Server) GetLocalService(service *v1.Service, ep *v1.Endpoints) (localSe // Note: type=LoadBalancer only makes sense on cloud providers which support external load balancers and the actual // creation of the load balancer happens asynchronously. if service.Spec.Type == v1.ServiceTypeLoadBalancer && *service.Spec.AllocateLoadBalancerNodePorts { - if !nodeIP.IsUnspecified() { + if !nodeIP.IsUnspecified() && len(nodeIP) > 0 { entry := buildCnatEntryForServicePort(&servicePort, service, ep, nodeIP, true /* isNodePort */, *serviceSpec) localService.Entries = append(localService.Entries, *entry) } diff --git a/calico-vpp-agent/services/service_server.go b/calico-vpp-agent/services/service_server.go index 953460282..602469069 100644 --- a/calico-vpp-agent/services/service_server.go +++ b/calico-vpp-agent/services/service_server.go @@ -257,10 +257,6 @@ func serviceID(meta *metav1.ObjectMeta) string { } func (s *Server) configureSnat() (err error) { - err = s.vpp.CnatSetSnatAddresses(s.getNodeIP(false /* isv6 */), s.getNodeIP(true /* isv6 */)) - if err != nil { - s.log.Errorf("Failed to configure SNAT addresses %v", err) - } nodeIP4, nodeIP6 := common.GetBGPSpecAddresses(s.nodeBGPSpec) if nodeIP6 != nil { err = s.vpp.CnatAddSnatPrefix(common.FullyQualified(*nodeIP6)) @@ -280,6 +276,23 @@ func (s *Server) configureSnat() (err error) { s.log.Errorf("Failed to Add Service CIDR %s %v", serviceCIDR, err) } } + err = s.vpp.SetK8sSnatPolicy() + if err != nil { + return errors.Wrap(err, "Error configuring cnat source policy") + } + for _, uplink := range common.VppManagerInfo.UplinkStatuses { + // register vpptap0 + err = s.vpp.RegisterPodInterface(uplink.TapSwIfIndex) + if err != nil { + return errors.Wrap(err, "error configuring vpptap0 as pod intf") + } + + err = s.vpp.RegisterHostInterface(uplink.TapSwIfIndex) + if err != nil { + return errors.Wrap(err, "error configuring vpptap0 as host intf") + } + } + return nil } @@ -442,11 +455,6 @@ func (s *Server) ServeService(t *tomb.Tomb) error { }) } - err = s.vpp.CnatPurge() - if err != nil { - return err - } - if *config.GetCalicoVppDebug().ServicesEnabled { s.t.Go(func() error { s.serviceInformer.Run(t.Dying()); return nil }) s.t.Go(func() error { s.endpointInformer.Run(t.Dying()); return nil }) diff --git a/calico-vpp-agent/watchers/uplink_link_watcher.go b/calico-vpp-agent/watchers/uplink_link_watcher.go index bd62ad58e..c35154fb5 100644 --- a/calico-vpp-agent/watchers/uplink_link_watcher.go +++ b/calico-vpp-agent/watchers/uplink_link_watcher.go @@ -113,7 +113,7 @@ func (r *LinkWatcher) WatchLinks(t *tomb.Tomb) error { } found := false v := config.UplinkStatus{} - for _, v := range r.UplinkStatuses { + for _, v = range r.UplinkStatuses { if update.Attrs().Index == v.LinkIndex { found = true break @@ -122,7 +122,7 @@ func (r *LinkWatcher) WatchLinks(t *tomb.Tomb) error { if found { if update.Attrs().Name == v.Name { if update.Attrs().MTU != v.Mtu { - if err = netlink.LinkSetMTU(link, v.Mtu); err != nil { + if err = netlink.LinkSetMTU(update.Link, v.Mtu); err != nil { r.log.Warnf("Error resetting link mtu: %v", err) r.safeClose() goto restart diff --git a/config/config.go b/config/config.go index 00bddf4b0..93ead2a4f 100644 --- a/config/config.go +++ b/config/config.go @@ -252,10 +252,18 @@ func (u *UplinkInterfaceSpec) String() string { return string(b) } +type RedirectToHostRulesConfigType struct { + Port uint16 `json:"port,omitempty"` + Ip string `json:"ip,omitempty"` + /* "tcp", "udp",... */ + Proto types.IPProto `json:"proto,omitempty"` +} + type CalicoVppDebugConfigType struct { - PoliciesEnabled *bool `json:"policiesEnabled,omitempty"` - ServicesEnabled *bool `json:"servicesEnabled,omitempty"` - GSOEnabled *bool `json:"gsoEnabled,omitempty"` + PoliciesEnabled *bool `json:"policiesEnabled,omitempty"` + ServicesEnabled *bool `json:"servicesEnabled,omitempty"` + GSOEnabled *bool `json:"gsoEnabled,omitempty"` + SpreadTxQueuesOnWorkers *bool `json:"spreadTxQueuesOnWorkers,omitempty"` } func (self *CalicoVppDebugConfigType) String() string { @@ -273,15 +281,19 @@ func (self *CalicoVppDebugConfigType) Validate() (err error) { if self.GSOEnabled == nil { self.GSOEnabled = &True } + if self.SpreadTxQueuesOnWorkers == nil { + self.SpreadTxQueuesOnWorkers = &False + } return } type CalicoVppFeatureGatesConfigType struct { - MemifEnabled *bool `json:"memifEnabled,omitempty"` - VCLEnabled *bool `json:"vclEnabled,omitempty"` - MultinetEnabled *bool `json:"multinetEnabled,omitempty"` - SRv6Enabled *bool `json:"srv6Enabled,omitempty"` - IPSecEnabled *bool `json:"ipsecEnabled,omitempty"` + MemifEnabled *bool `json:"memifEnabled,omitempty"` + VCLEnabled *bool `json:"vclEnabled,omitempty"` + MultinetEnabled *bool `json:"multinetEnabled,omitempty"` + SRv6Enabled *bool `json:"srv6Enabled,omitempty"` + IPSecEnabled *bool `json:"ipsecEnabled,omitempty"` + PrometheusEnabled *bool `json:"prometheusEnabled,omitempty"` } func (self *CalicoVppFeatureGatesConfigType) Validate() (err error) { @@ -302,6 +314,9 @@ func (self *CalicoVppFeatureGatesConfigType) Validate() (err error) { if self.IPSecEnabled == nil { self.IPSecEnabled = &False } + if self.PrometheusEnabled == nil { + self.PrometheusEnabled = &False + } return } @@ -395,15 +410,63 @@ func (self *CalicoVppInterfacesConfigType) String() string { type CalicoVppInitialConfigConfigType struct { //out of agent and vppmanager VppStartupSleepSeconds int `json:"vppStartupSleepSeconds"` - /* Set the pattern for VPP corefiles. Usually "/var/lib/vpp/vppcore.%e.%p" */ + // CorePattern is the pattern to use for VPP corefiles. + // Usually "/var/lib/vpp/vppcore.%e.%p" CorePattern string `json:"corePattern"` ExtraAddrCount int `json:"extraAddrCount"` IfConfigSavePath string `json:"ifConfigSavePath"` - /* Comma separated list of IPs to be configured in VPP as default GW */ + // DefaultGWs Comma separated list of IPs to be + // configured in VPP as default GW DefaultGWs string `json:"defaultGWs"` + // RedirectToHostRules is a list of rules for redirecting + // traffic to host. This is used for DNS support in kind + RedirectToHostRules []RedirectToHostRulesConfigType `json:"redirectToHostRules"` + // PrometheusListenEndpoint is the endpoint on which prometheus will + // listen and report stats. By default curl http://localhost:8888/metrics + PrometheusListenEndpoint string `json:"prometheusListenEndpoint"` + // PrometheusRecordMetricInterval is the interval at which we update the + // prometheus stats polling VPP stats segment. Default to 5 seconds + PrometheusRecordMetricInterval *time.Duration `json:"prometheusRecordMetricInterval"` + // IP4NeighborsMaxNumber is the maximum number of allowed IPv4 neighbors + // VPP allows. Defaults to 50k + IP4NeighborsMaxNumber *uint32 `json:"ip4NeighborsMaxNumber"` + // IP6NeighborsMaxNumber is the maximum number of allowed IPv4 neighbors + // VPP allows. Defaults to 50k + IP6NeighborsMaxNumber *uint32 `json:"ip6NeighborsMaxNumber"` + // IP4NeighborsMaxAge is the maximum age of IPv4 neighbors in seconds + // ARPs will be issued after said interval. Be aware ARPs in VPP are + // issued using a pre-existing vlib buffer hence dropping a packet + // defaults to 30 seconds. Use 0 to disable. + IP4NeighborsMaxAge *uint32 `json:"ip4NeighborsMaxAge"` + // IP6NeighborsMaxAge is the maximum age of IPv4 neighbors in seconds + // ARPs will be issued after said interval. Be aware ARPs in VPP are + // issued using a pre-existing vlib buffer hence dropping a packet + // defaults to 30 seconds. Use 0 to disable. + IP6NeighborsMaxAge *uint32 `json:"ip6NeighborsMaxAge"` +} + +func (self *CalicoVppInitialConfigConfigType) Validate() (err error) { + if self.PrometheusListenEndpoint == "" { + self.PrometheusListenEndpoint = ":8888" + } + if self.PrometheusRecordMetricInterval == nil { + prometheusRecordMetricInterval := 5 * time.Second + self.PrometheusRecordMetricInterval = &prometheusRecordMetricInterval + } + self.IP4NeighborsMaxNumber = DefaultToPtr( + self.IP4NeighborsMaxNumber, 50000, + ) + self.IP6NeighborsMaxNumber = DefaultToPtr( + self.IP6NeighborsMaxNumber, 50000, + ) + self.IP4NeighborsMaxAge = DefaultToPtr( + self.IP4NeighborsMaxAge, 30, + ) + self.IP6NeighborsMaxAge = DefaultToPtr( + self.IP6NeighborsMaxAge, 30, + ) + return nil } - -func (self *CalicoVppInitialConfigConfigType) Validate() (err error) { return nil } func (self *CalicoVppInitialConfigConfigType) GetDefaultGWs() (gws []net.IP, err error) { gws = make([]net.IP, 0) if self.DefaultGWs != "" { @@ -677,3 +740,10 @@ func PrintAgentConfig(log *logrus.Logger) { } PrintEnvVarConfig(log) } + +func DefaultToPtr[T any](ptr *T, defaultV T) *T { + if ptr == nil { + return &defaultV + } + return ptr +} diff --git a/docs/developper_guide.md b/docs/developper_guide.md index 846d54efd..90b9109dc 100644 --- a/docs/developper_guide.md +++ b/docs/developper_guide.md @@ -5,7 +5,7 @@ We also have a [vagrant based setup](https://github.com/projectcalico/vpp-datapl ### First create a kind cluster : ````bash -make kind-new-cluster N_KIND_WORKERS=3 # 3 is an example of number of worker nodes in your cluster +make kind-new-cluster N_KIND_WORKERS=2 # 3 is an example of number of worker nodes in your cluster ```` This creates a dual-stack cluster with four nodes. The cluster is configured with a local registry to allow sharing images on all nodes without having to copy them [you can read more about his here](https://kind.sigs.k8s.io/docs/user/local-registry/). You can adapt the configuration by editing `./test/kind/new_cluster.sh` @@ -15,7 +15,7 @@ You should now have `kubectl get nodes` reporting four nodes ### Install the calico operator to the cluster ````bash -kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/master/manifests/tigera-operator.yaml +kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.1/manifests/tigera-operator.yaml ```` ### Build development images @@ -61,6 +61,13 @@ export CALICO_ENCAPSULATION_V4=IPIP export CALICO_ENCAPSULATION_V6=None export CALICO_NAT_OUTGOING=Enabled ```` +To add a redirection to host rule: +````bash +# --------------- redirect ---------------- +export CALICOVPP_REDIRECT_PROTO="\"udp\"" +export CALICOVPP_REDIRECT_PORT=53 +export CALICOVPP_REDIRECT_IP="\"172.18.0.1\"" +```` To run with hugepages on: ````bash @@ -82,6 +89,7 @@ export CALICOVPP_CONFIG_TEMPLATE=" plugin calico_plugin.so { enable } plugin dpdk_plugin.so { disable } }" + bash ./yaml/overlays/dev/kustomize.sh up ```` diff --git a/go.mod b/go.mod index 367df106a..d0bd38f9c 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module github.com/projectcalico/vpp-dataplane/v3 -go 1.20 +go 1.23.0 + +toolchain go1.24.3 require ( github.com/calico-vpp/vpplink v0.0.0-20230609075304-43385ab1325d @@ -11,25 +13,25 @@ require ( github.com/google/gopacket v1.1.19 github.com/inconshreveable/mousetrap v1.1.0 github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.3.0 - github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40 + github.com/lunixbochs/struc v0.0.0-20241101090106-8d528fa2c543 github.com/onsi/ginkgo v1.16.5 - github.com/onsi/gomega v1.25.0 + github.com/onsi/gomega v1.33.1 github.com/orijtech/prometheus-go-metrics-exporter v0.0.6 github.com/osrg/gobgp/v3 v3.10.0 github.com/pkg/errors v0.9.1 github.com/projectcalico/api v0.0.0-20230602153125-fb7148692637 // v3.26.0 github.com/projectcalico/calico v0.0.0-20230526220659-8b103f46fbdc // v3.26.0 - github.com/sirupsen/logrus v1.9.0 - github.com/spf13/cobra v1.7.0 + github.com/sirupsen/logrus v1.9.3 + github.com/spf13/cobra v1.8.1 github.com/vishvananda/netlink v1.2.1-beta.2.0.20230206183746-70ca0345eede github.com/vishvananda/netns v0.0.0-20210104183010-2eb08e3e575f github.com/yookoala/realpath v1.0.0 - go.fd.io/govpp v0.8.0-alpha.0.20230612060736-7e90564236d5 + go.fd.io/govpp v0.11.0 go.fd.io/govpp/extras v0.1.1-0.20230330140632-6a7dcb03934f - golang.org/x/net v0.8.0 - golang.org/x/sys v0.6.0 + golang.org/x/net v0.24.0 + golang.org/x/sys v0.31.0 google.golang.org/grpc v1.52.0 - google.golang.org/protobuf v1.28.1 + google.golang.org/protobuf v1.33.0 gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 k8s.io/api v0.26.3 k8s.io/apimachinery v0.26.3 @@ -38,7 +40,7 @@ require ( ) require ( - github.com/bennyscetbun/jsongo v1.1.1 // indirect + github.com/bennyscetbun/jsongo v1.1.2 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/coreos/go-semver v0.3.0 // indirect @@ -49,10 +51,10 @@ require ( github.com/eapache/queue v1.1.0 // indirect github.com/emicklei/go-restful/v3 v3.9.0 // indirect github.com/evanphx/json-patch v4.12.0+incompatible // indirect - github.com/fsnotify/fsnotify v1.6.0 // indirect + github.com/fsnotify/fsnotify v1.8.0 // indirect github.com/ftrvxmtrx/fd v0.0.0-20150925145434-c6d800382fff // indirect github.com/go-ini/ini v1.63.2 // indirect - github.com/go-logr/logr v1.2.3 // indirect + github.com/go-logr/logr v1.4.1 // indirect github.com/go-openapi/jsonpointer v0.19.6 // indirect github.com/go-openapi/jsonreference v0.20.1 // indirect github.com/go-openapi/swag v0.22.3 // indirect @@ -61,7 +63,7 @@ require ( github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/google/gnostic v0.5.7-v3refs // indirect - github.com/google/go-cmp v0.5.9 // indirect + github.com/google/go-cmp v0.6.0 // indirect github.com/google/gofuzz v1.2.0 // indirect github.com/google/uuid v1.3.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect @@ -101,11 +103,11 @@ require ( go.uber.org/atomic v1.9.0 // indirect go.uber.org/multierr v1.8.0 // indirect go.uber.org/zap v1.21.0 // indirect - golang.org/x/crypto v0.1.0 // indirect + golang.org/x/crypto v0.22.0 // indirect golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783 // indirect - golang.org/x/sync v0.1.0 // indirect - golang.org/x/term v0.6.0 // indirect - golang.org/x/text v0.8.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/term v0.19.0 // indirect + golang.org/x/text v0.18.0 // indirect golang.org/x/time v0.1.0 // indirect golang.zx2c4.com/wireguard/wgctrl v0.0.0-20200324154536-ceff61240acf // indirect google.golang.org/appengine v1.6.7 // indirect diff --git a/go.sum b/go.sum index d660f76a3..a3a68937f 100644 --- a/go.sum +++ b/go.sum @@ -45,8 +45,8 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/bennyscetbun/jsongo v1.1.1 h1:ZlYkrwGtF5lKUOQh8t2Bn8XjCvwFI5Qdl6eBqZOtddE= -github.com/bennyscetbun/jsongo v1.1.1/go.mod h1:j5mIRkqjZ4eEoIKQyfVPQpv56ZX0rn+jPETkD/2dRqA= +github.com/bennyscetbun/jsongo v1.1.2 h1:SFH8uSb75O4iJD3+iJq2GKUdhfNsAJzAzPWhrfxneuc= +github.com/bennyscetbun/jsongo v1.1.2/go.mod h1:j5mIRkqjZ4eEoIKQyfVPQpv56ZX0rn+jPETkD/2dRqA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -66,13 +66,14 @@ github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGX github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/containernetworking/cni v1.1.2 h1:wtRGZVv7olUHMOqouPpn3cXJWpJgM6+EUl31EQbXALQ= +github.com/containernetworking/cni v1.1.2/go.mod h1:sDpYKmGVENF3s6uvMvGgldDWeG8dMxakj/u+i9ht9vw= github.com/containernetworking/plugins v1.2.0 h1:SWgg3dQG1yzUo4d9iD8cwSVh1VqI+bP7mkPDoSfP9VU= github.com/containernetworking/plugins v1.2.0/go.mod h1:/VjX4uHecW5vVimFa1wkG4s+r/s9qIfPdqlLF4TW8c4= github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= -github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -95,10 +96,11 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= -github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= -github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= +github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= github.com/ftrvxmtrx/fd v0.0.0-20150925145434-c6d800382fff h1:zk1wwii7uXmI0znwU+lqg+wFL9G5+vm5I+9rv2let60= github.com/ftrvxmtrx/fd v0.0.0-20150925145434-c6d800382fff/go.mod h1:yUhRXHewUVJ1k89wHKP68xfzk7kwXUx/DV1nx4EBMbw= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -115,9 +117,10 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs= github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= -github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-logr/zapr v1.2.0 h1:n4JnPI1T3Qq1SFEi/F8rwLrZERp2bso19PJZDB9dayk= +github.com/go-logr/zapr v1.2.0/go.mod h1:Qa4Bsj2Vb+FAVeAKsLD8RLQ+YRJB8YDmOAKxaBQf7Ro= github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonreference v0.20.1 h1:FBLnyygC4/IZZr893oiomc9XaghoveYTrLC1F86HID8= @@ -129,8 +132,12 @@ github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3yg github.com/go-playground/universal-translator v0.0.0-20170327191703-71201497bace h1:vfBaUX49VsqTxXGADDIWvTPvaU4AbQyX/yENHE0f7AY= github.com/go-playground/universal-translator v0.0.0-20170327191703-71201497bace/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg= +github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= @@ -182,8 +189,8 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 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.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= @@ -202,6 +209,8 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6 h1:k7nVchz72niMH6YLQNvHSdIE7iqsQxK1P41mySCvssg= +github.com/google/pprof v0.0.0-20240424215950-a892ee059fd6/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= @@ -255,14 +264,15 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leodido/go-urn v0.0.0-20181204092800-a67a23e1c1af h1:EhEGUQX36JFkvSWzrwGjjTJxrx7atfJdxv8cxFzmaB0= github.com/leodido/go-urn v0.0.0-20181204092800-a67a23e1c1af/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= -github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40 h1:EnfXoSqDfSNJv0VBNqY/88RNnhSGYkrHaO0mmFGbVsc= -github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40/go.mod h1:vy1vK6wD6j7xX6O6hXe621WabdtNkou2h7uRtTfRMyg= +github.com/lunixbochs/struc v0.0.0-20241101090106-8d528fa2c543 h1:GxMuVb9tJajC1QpbQwYNY1ZAo1EIE8I+UclBjOfjz/M= +github.com/lunixbochs/struc v0.0.0-20241101090106-8d528fa2c543/go.mod h1:vy1vK6wD6j7xX6O6hXe621WabdtNkou2h7uRtTfRMyg= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= @@ -295,11 +305,12 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.7.1 h1:YgLPk+gpqDtAPeRCWEmfO8oxE6ru3xcVSXAM7wn8w9I= +github.com/onsi/ginkgo/v2 v2.17.2 h1:7eMhcy3GimbsA3hEnVKdw/PQM9XN9krpKVXsZdph0/g= +github.com/onsi/ginkgo/v2 v2.17.2/go.mod h1:nP2DPOQoNsQmsVyv5rDA8JkXQoCs6goXIvr/PRJ1eCc= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.25.0 h1:Vw7br2PCDYijJHSfBOWhov+8cAnUf8MfMaIOV323l6Y= -github.com/onsi/gomega v1.25.0/go.mod h1:r+zV744Re+DiYCIPRlYOTxn0YkOLcAnW8k1xXdMPGhM= +github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= +github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= github.com/orijtech/prometheus-go-metrics-exporter v0.0.6 h1:ExkpQsyDDcyp0U3zhoNUQaCQ/o0Ovq7e1jRCL9lQ/4o= github.com/orijtech/prometheus-go-metrics-exporter v0.0.6/go.mod h1:BiTx/ugZex8LheBk3j53tktWaRdFjV5FCfT2o0P7msE= github.com/osrg/gobgp/v3 v3.10.0 h1:gBFOKEFX4ih8IubY7SFuXPwE33HWX+VqSuXyQb6vqyU= @@ -352,18 +363,19 @@ github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5 github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= -github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= -github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= +github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= +github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk= github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= -github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I= -github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= @@ -404,8 +416,8 @@ go.etcd.io/etcd/client/pkg/v3 v3.5.8 h1:tPp9YRn/UBFAHdhOQUII9eUs7aOK35eulpMhX4YB go.etcd.io/etcd/client/pkg/v3 v3.5.8/go.mod h1:y+CzeSmkMpWN2Jyu1npecjB9BBnABxGM4pN8cGuJeL4= go.etcd.io/etcd/client/v3 v3.5.8 h1:B6ngTKZSWWowHEoaucOKHQR/AtZKaoHLiUpWxOLG4l4= go.etcd.io/etcd/client/v3 v3.5.8/go.mod h1:idZYIPVkttBJBiRigkB5EM0MmEyx8jcl18zCV3F5noc= -go.fd.io/govpp v0.8.0-alpha.0.20230612060736-7e90564236d5 h1:1Ou6FKepW/0nVAsbufqCNgXXk1oTlqLuqaFfDMe3/bQ= -go.fd.io/govpp v0.8.0-alpha.0.20230612060736-7e90564236d5/go.mod h1:d5GiAWFhJi8/2FOHaoI/7BaIcrGSxqIGCAD4SD78ML8= +go.fd.io/govpp v0.11.0 h1:foIAJ7dF8QIi6TBizWdBLjaQtMnVcO/dQH0orY1/s/Q= +go.fd.io/govpp v0.11.0/go.mod h1:QAgM1RCcEj/RSUIr/BjRVa1Dy/bjEMUYYUm5J/uTPKo= go.fd.io/govpp/extras v0.1.1-0.20230330140632-6a7dcb03934f h1:a39nZEScxex3OtY8LuEdLsV2YE+Zm0zhKoF2wMcQw54= go.fd.io/govpp/extras v0.1.1-0.20230330140632-6a7dcb03934f/go.mod h1:s2FPOGIWR+p3ItFhlC2Zgbw1U5HwZxNYLffeK8Ld/kE= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -421,6 +433,7 @@ go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= +go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= @@ -436,8 +449,8 @@ golang.org/x/crypto v0.0.0-20200204104054-c9f3fb736b72/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= -golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= +golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= +golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -515,8 +528,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -541,8 +554,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -602,13 +615,12 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220804214406-8e32c043e418/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= +golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.6.0 h1:clScbb1cHjoCkyRbWwBEUZ5H/tIFu5TAXIqaZD0Gcjw= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= +golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= +golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -617,8 +629,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= -golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -675,6 +687,8 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -683,6 +697,7 @@ golang.zx2c4.com/wireguard v0.0.20200121/go.mod h1:P2HsVp8SKwZEufsnezXZA4GRX/T49 golang.zx2c4.com/wireguard/wgctrl v0.0.0-20200324154536-ceff61240acf h1:rWUZHukj3poXegPQMZOXgxjTGIBe3mLNHNVvL5DsHus= golang.zx2c4.com/wireguard/wgctrl v0.0.0-20200324154536-ceff61240acf/go.mod h1:UdS9frhv65KTfwxME1xE8+rHYoFpbm36gOud1GhBe9c= gomodules.xyz/jsonpatch/v2 v2.2.0 h1:4pT439QV83L+G9FkcCriY6EkpcK6r6bK+A5FBUMI7qY= +gomodules.xyz/jsonpatch/v2 v2.2.0/go.mod h1:WXp+iVDkoLQqPudfQ9GBlwB2eZ5DKOnjQZCYdOS8GPY= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= @@ -779,8 +794,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= 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.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= @@ -790,6 +805,7 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/go-playground/assert.v1 v1.2.1 h1:xoYuJVE7KT85PYWrN730RguIQO0ePzVRfFMXadIrXTM= +gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v9 v9.27.0 h1:wCg/0hk9RzcB0CYw8pYV6FiBYug1on0cpco9YZF8jqA= gopkg.in/go-playground/validator.v9 v9.27.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= @@ -823,6 +839,7 @@ honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 k8s.io/api v0.26.3 h1:emf74GIQMTik01Aum9dPP0gAypL8JTLl/lHa4V9RFSU= k8s.io/api v0.26.3/go.mod h1:PXsqwPMXBSBcL1lJ9CYDKy7kIReUydukS5JiRlxC3qE= k8s.io/apiextensions-apiserver v0.26.3 h1:5PGMm3oEzdB1W/FTMgGIDmm100vn7IaUP5er36dB+YE= +k8s.io/apiextensions-apiserver v0.26.3/go.mod h1:jdA5MdjNWGP+njw1EKMZc64xAT5fIhN6VJrElV3sfpQ= k8s.io/apimachinery v0.26.3 h1:dQx6PNETJ7nODU3XPtrwkfuubs6w7sX0M8n61zHIV/k= k8s.io/apimachinery v0.26.3/go.mod h1:ats7nN1LExKHvJ9TmwootT00Yz05MuYqPXEXaVeOy5I= k8s.io/client-go v0.26.3 h1:k1UY+KXfkxV2ScEL3gilKcF7761xkYsSD6BC9szIu8s= diff --git a/vpp-manager/images/dev/Dockerfile b/vpp-manager/images/dev/Dockerfile index f5f3eebc9..b77c95f89 100644 --- a/vpp-manager/images/dev/Dockerfile +++ b/vpp-manager/images/dev/Dockerfile @@ -9,6 +9,8 @@ RUN apt-get update \ libmbedcrypto7 libmbedtls14 libmbedx509-1 libsubunit0 \ iptables iproute2 iputils-ping inetutils-traceroute \ netcat-openbsd ethtool gdb \ + libnl-3-dev libnl-route-3-dev \ + libunwind8 libpcap-dev \ && rm -rf /var/lib/apt/lists/* ADD entrypoint.sh /usr/bin/entrypoint diff --git a/vpp-manager/images/ubuntu-build/Dockerfile b/vpp-manager/images/ubuntu-build/Dockerfile index 63dd35f8a..a68cfc4dd 100644 --- a/vpp-manager/images/ubuntu-build/Dockerfile +++ b/vpp-manager/images/ubuntu-build/Dockerfile @@ -9,22 +9,25 @@ RUN apt-get update \ curl build-essential autoconf automake ccache \ debhelper dkms git libtool libapr1-dev dh-python \ libconfuse-dev git-review exuberant-ctags cscope pkg-config \ - lcov chrpath autoconf libnuma-dev \ + gcovr lcov chrpath autoconf libnuma-dev \ python3-all python3-setuptools check \ - libffi-dev python3-ply \ - cmake ninja-build uuid-dev python3-jsonschema python3-yaml \ + libffi-dev python3-ply libunwind-dev \ + cmake ninja-build python3-jsonschema python3-yaml \ python3-venv \ python3-dev python3-pip \ libnl-3-dev libnl-route-3-dev libmnl-dev \ python3-virtualenv \ libssl-dev \ - libelf-dev \ - libpcap-dev iperf ethtool \ + libelf-dev libpcap-dev \ iperf3 \ nasm \ - clang clang-format-11 \ - enchant-2 \ - libffi7 + iperf ethtool \ + libpcap-dev \ + tshark \ + jq \ + clang clang-format-15 \ + libffi7 \ + enchant-2 WORKDIR / diff --git a/vpp-manager/images/ubuntu/Dockerfile b/vpp-manager/images/ubuntu/Dockerfile index 12b5420e0..d4ee722ae 100644 --- a/vpp-manager/images/ubuntu/Dockerfile +++ b/vpp-manager/images/ubuntu/Dockerfile @@ -6,6 +6,7 @@ RUN apt-get update \ && apt-get install -y openssl libapr1 libnuma1 \ libmbedcrypto7 libmbedtls14 libmbedx509-1 libsubunit0 \ iproute2 ifupdown ethtool libnl-3-dev libnl-route-3-dev \ + libunwind8 libpcap-dev \ && rm -rf /var/lib/apt/lists/* # set work directory diff --git a/vpp-manager/utils/utils.go b/vpp-manager/utils/utils.go index 1fc1515e2..e3f8a4c23 100644 --- a/vpp-manager/utils/utils.go +++ b/vpp-manager/utils/utils.go @@ -47,6 +47,12 @@ import ( "github.com/projectcalico/vpp-dataplane/v3/vpplink" ) +var ( + FakeVppNextHopIP4 = net.ParseIP("169.254.0.1") + FakeVppNextHopIP6 = net.ParseIP("fc00:ffff:ffff:ffff:ca11:c000:fd10:fffe") + VppSideMac, _ = net.ParseMAC("02:ca:11:c0:fd:10") +) + func IsDriverLoaded(driver string) (bool, error) { _, err := os.Stat("/sys/bus/pci/drivers/" + driver) if err == nil { diff --git a/vpp-manager/vpp_runner.go b/vpp-manager/vpp_runner.go index a3dd00e9f..3e6e1c487 100644 --- a/vpp-manager/vpp_runner.go +++ b/vpp-manager/vpp_runner.go @@ -45,12 +45,6 @@ import ( const DefaultPhysicalNetworkName = "" -var ( - fakeVppNextHopIP4 = net.ParseIP("169.254.0.1") - fakeVppNextHopIP6 = net.ParseIP("fc00:ffff:ffff:ffff:ca11:c000:fd10:fffe") - vppSideMac, _ = net.ParseMAC("02:ca:11:c0:fd:10") -) - type VppRunner struct { params *config.VppManagerParams conf []*config.LinuxInterfaceState @@ -147,11 +141,12 @@ func (v *VppRunner) configureGlobalPunt() (err error) { } func (v *VppRunner) configurePunt(tapSwIfIndex uint32, ifState config.LinuxInterfaceState) (err error) { - for _, neigh := range []net.IP{fakeVppNextHopIP4, fakeVppNextHopIP6} { + for _, neigh := range []net.IP{utils.FakeVppNextHopIP4, utils.FakeVppNextHopIP6} { err = v.vpp.AddNeighbor(&types.Neighbor{ SwIfIndex: tapSwIfIndex, IP: neigh, HardwareAddr: ifState.HardwareAddr, + Flags: types.IPNeighborStatic, }) if err != nil { return errors.Wrapf(err, "Error adding neighbor %s to tap", neigh) @@ -469,7 +464,7 @@ func (v *VppRunner) configureVppUplinkInterface( return errors.Wrap(err, "Error disabling ipv6 RA on uplink interface") } - err = v.vpp.CnatEnableFeatures(ifSpec.SwIfIndex) + err = v.vpp.CnatEnableFeatures(ifSpec.SwIfIndex, true, 0, 0) if err != nil { return errors.Wrap(err, "Error configuring NAT on uplink interface") } @@ -550,7 +545,7 @@ func (v *VppRunner) configureVppUplinkInterface( HostInterfaceName: ifSpec.InterfaceName, RxQueueSize: config.GetCalicoVppInterfaces().VppHostTapSpec.RxQueueSize, TxQueueSize: config.GetCalicoVppInterfaces().VppHostTapSpec.TxQueueSize, - HardwareAddr: vppSideMac, + HardwareAddr: utils.VppSideMac, }, HostNamespace: "pid:1", // create tap in root netns Tag: "host-" + ifSpec.InterfaceName, @@ -615,16 +610,11 @@ func (v *VppRunner) configureVppUplinkInterface( log.Errorf("Error SetInterfaceRxMode on vpptap0 %v", err) } - err = v.vpp.CnatEnableFeatures(tapSwIfIndex) + err = v.vpp.CnatEnableFeatures(tapSwIfIndex, true, 0, 0) if err != nil { return errors.Wrap(err, "Error configuring NAT on vpptap0") } - err = v.vpp.RegisterPodInterface(tapSwIfIndex) - if err != nil { - return errors.Wrap(err, "error configuring vpptap0 as pod intf") - } - // Linux side tap setup link, err := netlink.LinkByName(ifSpec.InterfaceName) if err != nil { @@ -663,9 +653,20 @@ func (v *VppRunner) doVppGlobalConfiguration() (err error) { return errors.Wrap(err, "Error creating static VRFs in VPP") } - err = v.vpp.SetK8sSnatPolicy() + err = v.vpp.ConfigureNeighborsV4(&types.NeighborConfig{ + MaxNumber: *config.GetCalicoVppInitialConfig().IP4NeighborsMaxNumber, + MaxAge: *config.GetCalicoVppInitialConfig().IP4NeighborsMaxAge, + }) + if err != nil { + return errors.Wrap(err, "error configuring v4 ip neighbors") + } + + err = v.vpp.ConfigureNeighborsV6(&types.NeighborConfig{ + MaxNumber: *config.GetCalicoVppInitialConfig().IP6NeighborsMaxNumber, + MaxAge: *config.GetCalicoVppInitialConfig().IP6NeighborsMaxAge, + }) if err != nil { - return errors.Wrap(err, "Error configuring cnat source policy") + return errors.Wrap(err, "error configuring v6 ip neighbors") } return nil diff --git a/vpplink/af_xdp.go b/vpplink/af_xdp.go index 52f17319c..78126ee8c 100644 --- a/vpplink/af_xdp.go +++ b/vpplink/af_xdp.go @@ -26,7 +26,7 @@ import ( func (v *VppLink) CreateAfXDP(intf *types.VppXDPInterface) error { client := af_xdp.NewServiceClient(v.GetConnection()) - request := &af_xdp.AfXdpCreate{ + request := &af_xdp.AfXdpCreateV3{ HostIf: intf.HostInterfaceName, Name: intf.Name, RxqNum: uint16(DefaultIntTo(intf.NumRxQueues, 1)), @@ -34,7 +34,7 @@ func (v *VppLink) CreateAfXDP(intf *types.VppXDPInterface) error { TxqSize: uint16(DefaultIntTo(intf.TxQueueSize, 1024)), Mode: af_xdp.AF_XDP_API_MODE_AUTO, } - response, err := client.AfXdpCreate(v.GetContext(), request) + response, err := client.AfXdpCreateV3(v.GetContext(), request) if err != nil { return fmt.Errorf("failed to create AfXDP (%+v): %w", request, err) } diff --git a/vpplink/classify.go b/vpplink/classify.go new file mode 100644 index 000000000..0f6b9541a --- /dev/null +++ b/vpplink/classify.go @@ -0,0 +1,138 @@ +// Copyright (C) 2023 Cisco Systems Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +// implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package vpplink + +import ( + "fmt" + + "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/classify" + "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/interface_types" + "github.com/projectcalico/vpp-dataplane/v3/vpplink/types" +) + +func (v *VppLink) addDelClassifyTable(table *types.ClassifyTable, action types.ClassifyAction) (uint32, error) { + client := classify.NewServiceClient(v.GetConnection()) + + isAdd, delChain := false, false + currentDataFlags := uint8(0) + tableIndex := types.InvalidTableId + switch action { + case types.AddAbsolute: + isAdd = true + case types.AddRelative: + isAdd = true + currentDataFlags = uint8(1) + case types.Del: + tableIndex = table.TableIndex + case types.DelChain: + tableIndex = table.TableIndex + delChain = true + } + + mask := ExtendToVector(table.Mask) + + matchNVectors := table.MatchNVectors + if matchNVectors == 0 { + matchNVectors = uint32(len(mask)) / types.VectorSize + } + + nBuckets := table.NBuckets + if nBuckets == 0 { + // We provide as many buckets as the max number of entries we expect in the table + nBuckets = table.MaxNumEntries + } + + memorySize := table.MemorySize + if memorySize == 0 { + /* memory needed for the table: + * - each entry has a size of (32-bytes + mask vectors) + * - up to 2 entries per page for collision resolution + * - double for margin + */ + memorySize = table.MaxNumEntries * (32 + matchNVectors*types.VectorSize) * 2 * 2 + } + + response, err := client.ClassifyAddDelTable(v.GetContext(), &classify.ClassifyAddDelTable{ + IsAdd: isAdd, + DelChain: delChain, + TableIndex: tableIndex, + Nbuckets: nBuckets, + MemorySize: memorySize, + SkipNVectors: table.SkipNVectors, + MatchNVectors: matchNVectors, + NextTableIndex: table.NextTableIndex, + MissNextIndex: table.MissNextIndex, + CurrentDataFlag: currentDataFlags, + CurrentDataOffset: table.CurrentDataOffset, + MaskLen: uint32(len(mask)), + Mask: mask, + }) + + if err != nil { + return types.InvalidID, fmt.Errorf("Failed to %s the classify table: %w", map[bool]string{true: "add", false: "del"}[isAdd], err) + } + + return response.NewTableIndex, nil +} + +func (v *VppLink) AddClassifyTable(table *types.ClassifyTable) (uint32, error) { + return v.addDelClassifyTable(table, types.AddRelative) +} + +func (v *VppLink) DelClassifyTable(tableIndex uint32) error { + _, err := v.addDelClassifyTable(&types.ClassifyTable{TableIndex: tableIndex}, types.Del) + return err +} + +func ExtendToVector(match []byte) []byte { + n := len(match) % types.VectorSize + if n != 0 { + match = match[:len(match)+types.VectorSize-n] + } + return match +} + +func (v *VppLink) SetClassifyInputInterfaceTables(swIfIndex uint32, ip4TableIndex uint32, ip6TableIndex uint32, l2TableIndex uint32, isAdd bool) error { + client := classify.NewServiceClient(v.GetConnection()) + + _, err := client.InputACLSetInterface(v.GetContext(), &classify.InputACLSetInterface{ + IsAdd: isAdd, + SwIfIndex: interface_types.InterfaceIndex(swIfIndex), + IP4TableIndex: ip4TableIndex, + IP6TableIndex: ip6TableIndex, + L2TableIndex: l2TableIndex, + }) + if err != nil { + return fmt.Errorf("failed to set input acl tables for this interface: %w", err) + } + return nil +} + +func (v *VppLink) SetClassifyOutputInterfaceTables(swIfIndex uint32, ip4TableIndex uint32, ip6TableIndex uint32, l2TableIndex uint32, isAdd bool) error { + client := classify.NewServiceClient(v.GetConnection()) + + _, err := client.OutputACLSetInterface(v.GetContext(), &classify.OutputACLSetInterface{ + IsAdd: isAdd, + SwIfIndex: interface_types.InterfaceIndex(swIfIndex), + IP4TableIndex: ip4TableIndex, + IP6TableIndex: ip6TableIndex, + L2TableIndex: l2TableIndex, + }) + if err != nil { + return fmt.Errorf("failed to set input acl tables for this interface: %w", err) + } + return nil +} diff --git a/vpplink/cnat.go b/vpplink/cnat.go index 772f72522..e0c25d1d2 100644 --- a/vpplink/cnat.go +++ b/vpplink/cnat.go @@ -59,12 +59,12 @@ func (v *VppLink) CnatTranslateAdd(tr *types.CnatTranslateEntry) (uint32, error) response, err := client.CnatTranslationUpdate(v.GetContext(), &cnat.CnatTranslationUpdate{ Translation: cnat.CnatTranslation{ - Vip: types.ToCnatEndpoint(tr.Endpoint), - IPProto: types.ToVppIPProto(tr.Proto), - Paths: paths, - IsRealIP: BoolToU8(tr.IsRealIP), - Flags: uint8(cnat.CNAT_TRANSLATION_ALLOC_PORT), - LbType: cnat.CnatLbType(tr.LbType), + Vip: types.ToCnatEndpoint(tr.Endpoint), + IPProto: types.ToVppIPProto(tr.Proto), + Paths: paths, + IsRealIP: BoolToU8(tr.IsRealIP), + Flags: uint8(cnat.CNAT_TRANSLATION_ALLOC_PORT | cnat.CNAT_TRANSLATION_NO_CLIENT), + LbType: cnat.CnatLbType(tr.LbType), }, }) if err != nil { @@ -95,6 +95,7 @@ func (v *VppLink) CnatSetSnatAddresses(v4, v6 net.IP) error { SnatIP4: types.ToVppIP4Address(v4), SnatIP6: types.ToVppIP6Address(v6), SwIfIndex: types.InvalidInterface, + Flags: cnat.CNAT_TRANSLATION_NO_CLIENT, }) if err != nil { return fmt.Errorf("setting SNAT addresses failed: %w", err) @@ -123,14 +124,18 @@ func (v *VppLink) CnatDelSnatPrefix(prefix *net.IPNet) error { return v.CnatAddDelSnatPrefix(prefix, false) } -func (v *VppLink) CnatEnableFeatures(swIfIndex uint32) (err error) { - err = v.EnableFeatureArc46(swIfIndex, FeatureArcCnatInput) - if err != nil { - return fmt.Errorf("enabling arc dnat input failed: %w", err) +func (v *VppLink) CnatEnableFeatures(swIfIndex uint32, isEnable bool, vrfIdV4 uint32, vrfIdV6 uint32) error { + client := cnat.NewServiceClient(v.GetConnection()) + + request := &cnat.FeatureCnatEnableDisable{ + SwIfIndex: interface_types.InterfaceIndex(swIfIndex), + EnableDisable: isEnable, + TableIDIP4: vrfIdV4, + TableIDIP6: vrfIdV6, } - err = v.EnableFeatureArc46(swIfIndex, FeatureArcCnatOutput) + _, err := client.FeatureCnatEnableDisable(v.GetContext(), request) if err != nil { - return fmt.Errorf("enabling arc dnat output failed: %w", err) + return fmt.Errorf("FeatureEnableDisable %+v failed: %w", request, err) } return nil } @@ -157,6 +162,14 @@ func (v *VppLink) RemovePodInterface(swIfIndex uint32) (err error) { return v.cnatSnatPolicyAddDelPodInterface(swIfIndex, false /* isAdd */, cnat.CNAT_POLICY_POD) } +func (v *VppLink) RegisterHostInterface(swIfIndex uint32) (err error) { + return v.cnatSnatPolicyAddDelPodInterface(swIfIndex, true /* isAdd */, cnat.CNAT_POLICY_HOST) +} + +func (v *VppLink) RemoveHostInterface(swIfIndex uint32) (err error) { + return v.cnatSnatPolicyAddDelPodInterface(swIfIndex, false /* isAdd */, cnat.CNAT_POLICY_HOST) +} + func (v *VppLink) EnableDisableCnatSNAT(swIfIndex uint32, isIp6 bool, isEnable bool) (err error) { if isEnable { return v.enableCnatSNAT(swIfIndex, isIp6) @@ -179,7 +192,7 @@ func (v *VppLink) disableCnatSNAT(swIfIndex uint32, isIp6 bool) (err error) { return v.cnatSnatPolicyAddDelPodInterface(swIfIndex, false /* isAdd */, cnat.CNAT_POLICY_INCLUDE_V4) } -func (v *VppLink) cnatSetSnatPolicy(pol cnat.CnatSnatPolicies) error { +func (v *VppLink) cnatSetSnatPolicyForDefaultVRF(pol cnat.CnatSnatPolicies) error { client := cnat.NewServiceClient(v.GetConnection()) _, err := client.CnatSetSnatPolicy(v.GetContext(), &cnat.CnatSetSnatPolicy{ @@ -192,9 +205,22 @@ func (v *VppLink) cnatSetSnatPolicy(pol cnat.CnatSnatPolicies) error { } func (v *VppLink) SetK8sSnatPolicy() (err error) { - return v.cnatSetSnatPolicy(cnat.CNAT_POLICY_K8S) + return v.cnatSetSnatPolicyForDefaultVRF(cnat.CNAT_POLICY_K8S) } func (v *VppLink) ClearSnatPolicy() (err error) { - return v.cnatSetSnatPolicy(cnat.CNAT_POLICY_NONE) + return v.cnatSetSnatPolicyForDefaultVRF(cnat.CNAT_POLICY_NONE) +} + +func (v *VppLink) EnableCnatSNATOnInterfaceVRF(swifindex uint32) (err error) { + client := cnat.NewServiceClient(v.GetConnection()) + + _, err = client.DuplicateCnatSnatDefaultPolicyToVrf(v.GetContext(), &cnat.DuplicateCnatSnatDefaultPolicyToVrf{ + SwIfIndex: interface_types.InterfaceIndex(swifindex), + }) + if err != nil { + return fmt.Errorf("DuplicateCnatSnatDefaultPolicyToVrf for interface %d failed: %w", swifindex, err) + } + return nil + } diff --git a/vpplink/generated/bindings/af_packet/af_packet.ba.go b/vpplink/generated/bindings/af_packet/af_packet.ba.go index 771ee7baf..341ddb759 100644 --- a/vpplink/generated/bindings/af_packet/af_packet.ba.go +++ b/vpplink/generated/bindings/af_packet/af_packet.ba.go @@ -110,6 +110,7 @@ func (x AfPacketMode) String() string { // - host_if_name - interface name // // AfPacketCreate defines message 'af_packet_create'. +// Deprecated: the message will be removed in the future versions type AfPacketCreate struct { HwAddr ethernet_types.MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"` UseRandomHwAddr bool `binapi:"bool,name=use_random_hw_addr" json:"use_random_hw_addr,omitempty"` @@ -154,6 +155,7 @@ func (m *AfPacketCreate) Unmarshal(b []byte) error { // - retval - return value for request // // AfPacketCreateReply defines message 'af_packet_create_reply'. +// Deprecated: the message will be removed in the future versions type AfPacketCreateReply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` @@ -202,6 +204,7 @@ func (m *AfPacketCreateReply) Unmarshal(b []byte) error { // - num_rx_queues - number of rx queues // // AfPacketCreateV2 defines message 'af_packet_create_v2'. +// Deprecated: the message will be removed in the future versions type AfPacketCreateV2 struct { HwAddr ethernet_types.MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"` UseRandomHwAddr bool `binapi:"bool,name=use_random_hw_addr" json:"use_random_hw_addr,omitempty"` @@ -270,6 +273,7 @@ func (m *AfPacketCreateV2) Unmarshal(b []byte) error { // - retval - return value for request // // AfPacketCreateV2Reply defines message 'af_packet_create_v2_reply'. +// Deprecated: the message will be removed in the future versions type AfPacketCreateV2Reply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` diff --git a/vpplink/generated/bindings/af_xdp/af_xdp.ba.go b/vpplink/generated/bindings/af_xdp/af_xdp.ba.go index 6adb97a82..b07f61389 100644 --- a/vpplink/generated/bindings/af_xdp/af_xdp.ba.go +++ b/vpplink/generated/bindings/af_xdp/af_xdp.ba.go @@ -4,7 +4,7 @@ // // Contents: // - 2 enums -// - 6 messages +// - 4 messages package af_xdp import ( @@ -24,7 +24,7 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "af_xdp" APIVersion = "1.0.0" - VersionCrc = 0x346626ce + VersionCrc = 0x2d18a436 ) // AfXdpMode defines enum 'af_xdp_mode'. @@ -109,9 +109,10 @@ func (x AfXdpFlag) String() string { // - mode - operation mode (optional) // - flags - flags (optional) // - prog - eBPF program path (optional) +// - netns - netns of nic (optional) // -// AfXdpCreate defines message 'af_xdp_create'. -type AfXdpCreate struct { +// AfXdpCreateV3 defines message 'af_xdp_create_v3'. +type AfXdpCreateV3 struct { HostIf string `binapi:"string[64],name=host_if" json:"host_if,omitempty"` Name string `binapi:"string[64],name=name" json:"name,omitempty"` RxqNum uint16 `binapi:"u16,name=rxq_num,default=1" json:"rxq_num,omitempty"` @@ -120,16 +121,17 @@ type AfXdpCreate struct { Mode AfXdpMode `binapi:"af_xdp_mode,name=mode,default=0" json:"mode,omitempty"` Flags AfXdpFlag `binapi:"af_xdp_flag,name=flags,default=0" json:"flags,omitempty"` Prog string `binapi:"string[256],name=prog" json:"prog,omitempty"` + Netns string `binapi:"string[64],name=netns" json:"netns,omitempty"` } -func (m *AfXdpCreate) Reset() { *m = AfXdpCreate{} } -func (*AfXdpCreate) GetMessageName() string { return "af_xdp_create" } -func (*AfXdpCreate) GetCrcString() string { return "21226c99" } -func (*AfXdpCreate) GetMessageType() api.MessageType { +func (m *AfXdpCreateV3) Reset() { *m = AfXdpCreateV3{} } +func (*AfXdpCreateV3) GetMessageName() string { return "af_xdp_create_v3" } +func (*AfXdpCreateV3) GetCrcString() string { return "cf4b1827" } +func (*AfXdpCreateV3) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *AfXdpCreate) Size() (size int) { +func (m *AfXdpCreateV3) Size() (size int) { if m == nil { return 0 } @@ -141,9 +143,10 @@ func (m *AfXdpCreate) Size() (size int) { size += 4 // m.Mode size += 1 // m.Flags size += 256 // m.Prog + size += 64 // m.Netns return size } -func (m *AfXdpCreate) Marshal(b []byte) ([]byte, error) { +func (m *AfXdpCreateV3) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } @@ -156,9 +159,10 @@ func (m *AfXdpCreate) Marshal(b []byte) ([]byte, error) { buf.EncodeUint32(uint32(m.Mode)) buf.EncodeUint8(uint8(m.Flags)) buf.EncodeString(m.Prog, 256) + buf.EncodeString(m.Netns, 64) return buf.Bytes(), nil } -func (m *AfXdpCreate) Unmarshal(b []byte) error { +func (m *AfXdpCreateV3) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.HostIf = buf.DecodeString(64) m.Name = buf.DecodeString(64) @@ -168,6 +172,7 @@ func (m *AfXdpCreate) Unmarshal(b []byte) error { m.Mode = AfXdpMode(buf.DecodeUint32()) m.Flags = AfXdpFlag(buf.DecodeUint8()) m.Prog = buf.DecodeString(256) + m.Netns = buf.DecodeString(64) return nil } @@ -175,20 +180,20 @@ func (m *AfXdpCreate) Unmarshal(b []byte) error { // - retval - return value for request // - sw_if_index - software index for the new af_xdp interface // -// AfXdpCreateReply defines message 'af_xdp_create_reply'. -type AfXdpCreateReply struct { +// AfXdpCreateV3Reply defines message 'af_xdp_create_v3_reply'. +type AfXdpCreateV3Reply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` } -func (m *AfXdpCreateReply) Reset() { *m = AfXdpCreateReply{} } -func (*AfXdpCreateReply) GetMessageName() string { return "af_xdp_create_reply" } -func (*AfXdpCreateReply) GetCrcString() string { return "5383d31f" } -func (*AfXdpCreateReply) GetMessageType() api.MessageType { +func (m *AfXdpCreateV3Reply) Reset() { *m = AfXdpCreateV3Reply{} } +func (*AfXdpCreateV3Reply) GetMessageName() string { return "af_xdp_create_v3_reply" } +func (*AfXdpCreateV3Reply) GetCrcString() string { return "5383d31f" } +func (*AfXdpCreateV3Reply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *AfXdpCreateReply) Size() (size int) { +func (m *AfXdpCreateV3Reply) Size() (size int) { if m == nil { return 0 } @@ -196,7 +201,7 @@ func (m *AfXdpCreateReply) Size() (size int) { size += 4 // m.SwIfIndex return size } -func (m *AfXdpCreateReply) Marshal(b []byte) ([]byte, error) { +func (m *AfXdpCreateV3Reply) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } @@ -205,133 +210,13 @@ func (m *AfXdpCreateReply) Marshal(b []byte) ([]byte, error) { buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } -func (m *AfXdpCreateReply) Unmarshal(b []byte) error { +func (m *AfXdpCreateV3Reply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } -// - client_index - opaque cookie to identify the sender -// - host_if - Linux netdev interface name -// - name - new af_xdp interface name (optional) -// - rxq_num - number of receive queues. 65535 can be used as special value to request all available queues (optional) -// - rxq_size - receive queue size (optional) -// - txq_size - transmit queue size (optional) -// - mode - operation mode (optional) -// - flags - flags (optional) -// - prog - eBPF program path (optional) -// - namespace - netns of nic (optional) -// -// AfXdpCreateV2 defines message 'af_xdp_create_v2'. -type AfXdpCreateV2 struct { - HostIf string `binapi:"string[64],name=host_if" json:"host_if,omitempty"` - Name string `binapi:"string[64],name=name" json:"name,omitempty"` - RxqNum uint16 `binapi:"u16,name=rxq_num,default=1" json:"rxq_num,omitempty"` - RxqSize uint16 `binapi:"u16,name=rxq_size,default=0" json:"rxq_size,omitempty"` - TxqSize uint16 `binapi:"u16,name=txq_size,default=0" json:"txq_size,omitempty"` - Mode AfXdpMode `binapi:"af_xdp_mode,name=mode,default=0" json:"mode,omitempty"` - Flags AfXdpFlag `binapi:"af_xdp_flag,name=flags,default=0" json:"flags,omitempty"` - Prog string `binapi:"string[256],name=prog" json:"prog,omitempty"` - Namespace string `binapi:"string[64],name=namespace" json:"namespace,omitempty"` -} - -func (m *AfXdpCreateV2) Reset() { *m = AfXdpCreateV2{} } -func (*AfXdpCreateV2) GetMessageName() string { return "af_xdp_create_v2" } -func (*AfXdpCreateV2) GetCrcString() string { return "e17ec2eb" } -func (*AfXdpCreateV2) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *AfXdpCreateV2) Size() (size int) { - if m == nil { - return 0 - } - size += 64 // m.HostIf - size += 64 // m.Name - size += 2 // m.RxqNum - size += 2 // m.RxqSize - size += 2 // m.TxqSize - size += 4 // m.Mode - size += 1 // m.Flags - size += 256 // m.Prog - size += 64 // m.Namespace - return size -} -func (m *AfXdpCreateV2) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeString(m.HostIf, 64) - buf.EncodeString(m.Name, 64) - buf.EncodeUint16(m.RxqNum) - buf.EncodeUint16(m.RxqSize) - buf.EncodeUint16(m.TxqSize) - buf.EncodeUint32(uint32(m.Mode)) - buf.EncodeUint8(uint8(m.Flags)) - buf.EncodeString(m.Prog, 256) - buf.EncodeString(m.Namespace, 64) - return buf.Bytes(), nil -} -func (m *AfXdpCreateV2) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.HostIf = buf.DecodeString(64) - m.Name = buf.DecodeString(64) - m.RxqNum = buf.DecodeUint16() - m.RxqSize = buf.DecodeUint16() - m.TxqSize = buf.DecodeUint16() - m.Mode = AfXdpMode(buf.DecodeUint32()) - m.Flags = AfXdpFlag(buf.DecodeUint8()) - m.Prog = buf.DecodeString(256) - m.Namespace = buf.DecodeString(64) - return nil -} - -// - context - sender context, to match reply w/ request -// - retval - return value for request -// - sw_if_index - software index for the new af_xdp interface -// -// AfXdpCreateV2Reply defines message 'af_xdp_create_v2_reply'. -type AfXdpCreateV2Reply struct { - Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` - SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` -} - -func (m *AfXdpCreateV2Reply) Reset() { *m = AfXdpCreateV2Reply{} } -func (*AfXdpCreateV2Reply) GetMessageName() string { return "af_xdp_create_v2_reply" } -func (*AfXdpCreateV2Reply) GetCrcString() string { return "5383d31f" } -func (*AfXdpCreateV2Reply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *AfXdpCreateV2Reply) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Retval - size += 4 // m.SwIfIndex - return size -} -func (m *AfXdpCreateV2Reply) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeInt32(m.Retval) - buf.EncodeUint32(uint32(m.SwIfIndex)) - return buf.Bytes(), nil -} -func (m *AfXdpCreateV2Reply) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Retval = buf.DecodeInt32() - m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) - return nil -} - -// - client_index - opaque cookie to identify the sender -// - sw_if_index - interface index -// // AfXdpDelete defines message 'af_xdp_delete'. type AfXdpDelete struct { SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` @@ -400,10 +285,8 @@ func (m *AfXdpDeleteReply) Unmarshal(b []byte) error { func init() { file_af_xdp_binapi_init() } func file_af_xdp_binapi_init() { - api.RegisterMessage((*AfXdpCreate)(nil), "af_xdp_create_21226c99") - api.RegisterMessage((*AfXdpCreateReply)(nil), "af_xdp_create_reply_5383d31f") - api.RegisterMessage((*AfXdpCreateV2)(nil), "af_xdp_create_v2_e17ec2eb") - api.RegisterMessage((*AfXdpCreateV2Reply)(nil), "af_xdp_create_v2_reply_5383d31f") + api.RegisterMessage((*AfXdpCreateV3)(nil), "af_xdp_create_v3_cf4b1827") + api.RegisterMessage((*AfXdpCreateV3Reply)(nil), "af_xdp_create_v3_reply_5383d31f") api.RegisterMessage((*AfXdpDelete)(nil), "af_xdp_delete_f9e6675e") api.RegisterMessage((*AfXdpDeleteReply)(nil), "af_xdp_delete_reply_e8d4e804") } @@ -411,10 +294,8 @@ func file_af_xdp_binapi_init() { // Messages returns list of all messages in this module. func AllMessages() []api.Message { return []api.Message{ - (*AfXdpCreate)(nil), - (*AfXdpCreateReply)(nil), - (*AfXdpCreateV2)(nil), - (*AfXdpCreateV2Reply)(nil), + (*AfXdpCreateV3)(nil), + (*AfXdpCreateV3Reply)(nil), (*AfXdpDelete)(nil), (*AfXdpDeleteReply)(nil), } diff --git a/vpplink/generated/bindings/af_xdp/af_xdp_rpc.ba.go b/vpplink/generated/bindings/af_xdp/af_xdp_rpc.ba.go index 32ee63423..dac6c55db 100644 --- a/vpplink/generated/bindings/af_xdp/af_xdp_rpc.ba.go +++ b/vpplink/generated/bindings/af_xdp/af_xdp_rpc.ba.go @@ -10,8 +10,7 @@ import ( // RPCService defines RPC service af_xdp. type RPCService interface { - AfXdpCreate(ctx context.Context, in *AfXdpCreate) (*AfXdpCreateReply, error) - AfXdpCreateV2(ctx context.Context, in *AfXdpCreateV2) (*AfXdpCreateV2Reply, error) + AfXdpCreateV3(ctx context.Context, in *AfXdpCreateV3) (*AfXdpCreateV3Reply, error) AfXdpDelete(ctx context.Context, in *AfXdpDelete) (*AfXdpDeleteReply, error) } @@ -23,17 +22,8 @@ func NewServiceClient(conn api.Connection) RPCService { return &serviceClient{conn} } -func (c *serviceClient) AfXdpCreate(ctx context.Context, in *AfXdpCreate) (*AfXdpCreateReply, error) { - out := new(AfXdpCreateReply) - err := c.conn.Invoke(ctx, in, out) - if err != nil { - return nil, err - } - return out, api.RetvalToVPPApiError(out.Retval) -} - -func (c *serviceClient) AfXdpCreateV2(ctx context.Context, in *AfXdpCreateV2) (*AfXdpCreateV2Reply, error) { - out := new(AfXdpCreateV2Reply) +func (c *serviceClient) AfXdpCreateV3(ctx context.Context, in *AfXdpCreateV3) (*AfXdpCreateV3Reply, error) { + out := new(AfXdpCreateV3Reply) err := c.conn.Invoke(ctx, in, out) if err != nil { return nil, err diff --git a/vpplink/generated/bindings/classify/classify.ba.go b/vpplink/generated/bindings/classify/classify.ba.go new file mode 100644 index 000000000..dbff2ca98 --- /dev/null +++ b/vpplink/generated/bindings/classify/classify.ba.go @@ -0,0 +1,2285 @@ +// Code generated by GoVPP's binapi-generator. DO NOT EDIT. + +// Package classify contains generated bindings for API file classify.api. +// +// Contents: +// - 3 enums +// - 44 messages +package classify + +import ( + "strconv" + + interface_types "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/interface_types" + api "go.fd.io/govpp/api" + codec "go.fd.io/govpp/codec" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the GoVPP api package it is being compiled against. +// A compilation error at this line likely means your copy of the +// GoVPP api package needs to be updated. +const _ = api.GoVppAPIPackageIsVersion2 + +const ( + APIFile = "classify" + APIVersion = "3.1.0" + VersionCrc = 0x92a4f2c8 +) + +// ClassifyAction defines enum 'classify_action'. +type ClassifyAction uint8 + +const ( + CLASSIFY_API_ACTION_NONE ClassifyAction = 0 + CLASSIFY_API_ACTION_SET_IP4_FIB_INDEX ClassifyAction = 1 + CLASSIFY_API_ACTION_SET_IP6_FIB_INDEX ClassifyAction = 2 + CLASSIFY_API_ACTION_SET_METADATA ClassifyAction = 3 +) + +var ( + ClassifyAction_name = map[uint8]string{ + 0: "CLASSIFY_API_ACTION_NONE", + 1: "CLASSIFY_API_ACTION_SET_IP4_FIB_INDEX", + 2: "CLASSIFY_API_ACTION_SET_IP6_FIB_INDEX", + 3: "CLASSIFY_API_ACTION_SET_METADATA", + } + ClassifyAction_value = map[string]uint8{ + "CLASSIFY_API_ACTION_NONE": 0, + "CLASSIFY_API_ACTION_SET_IP4_FIB_INDEX": 1, + "CLASSIFY_API_ACTION_SET_IP6_FIB_INDEX": 2, + "CLASSIFY_API_ACTION_SET_METADATA": 3, + } +) + +func (x ClassifyAction) String() string { + s, ok := ClassifyAction_name[uint8(x)] + if ok { + return s + } + return "ClassifyAction(" + strconv.Itoa(int(x)) + ")" +} + +// FlowClassifyTable defines enum 'flow_classify_table'. +type FlowClassifyTable uint8 + +const ( + FLOW_CLASSIFY_API_TABLE_IP4 FlowClassifyTable = 0 + FLOW_CLASSIFY_API_TABLE_IP6 FlowClassifyTable = 1 +) + +var ( + FlowClassifyTable_name = map[uint8]string{ + 0: "FLOW_CLASSIFY_API_TABLE_IP4", + 1: "FLOW_CLASSIFY_API_TABLE_IP6", + } + FlowClassifyTable_value = map[string]uint8{ + "FLOW_CLASSIFY_API_TABLE_IP4": 0, + "FLOW_CLASSIFY_API_TABLE_IP6": 1, + } +) + +func (x FlowClassifyTable) String() string { + s, ok := FlowClassifyTable_name[uint8(x)] + if ok { + return s + } + return "FlowClassifyTable(" + strconv.Itoa(int(x)) + ")" +} + +// PolicerClassifyTable defines enum 'policer_classify_table'. +type PolicerClassifyTable uint8 + +const ( + POLICER_CLASSIFY_API_TABLE_IP4 PolicerClassifyTable = 0 + POLICER_CLASSIFY_API_TABLE_IP6 PolicerClassifyTable = 1 + POLICER_CLASSIFY_API_TABLE_L2 PolicerClassifyTable = 2 +) + +var ( + PolicerClassifyTable_name = map[uint8]string{ + 0: "POLICER_CLASSIFY_API_TABLE_IP4", + 1: "POLICER_CLASSIFY_API_TABLE_IP6", + 2: "POLICER_CLASSIFY_API_TABLE_L2", + } + PolicerClassifyTable_value = map[string]uint8{ + "POLICER_CLASSIFY_API_TABLE_IP4": 0, + "POLICER_CLASSIFY_API_TABLE_IP6": 1, + "POLICER_CLASSIFY_API_TABLE_L2": 2, + } +) + +func (x PolicerClassifyTable) String() string { + s, ok := PolicerClassifyTable_name[uint8(x)] + if ok { + return s + } + return "PolicerClassifyTable(" + strconv.Itoa(int(x)) + ")" +} + +// Classify add / del session request +// - is_add - add session if non-zero, else delete +// - table_index - index of the table to add/del the session, required +// - hit_next_index - for add, hit_next_index of new session, required +// - opaque_index - for add, opaque_index of new session +// - advance -for add, advance value for session +// - action - +// 0: no action (by default) +// metadata is not used. +// 1: Classified IP packets will be looked up from the +// specified ipv4 fib table (configured by metadata as VRF id). +// Only valid for L3 input ACL node +// 2: Classified IP packets will be looked up from the +// specified ipv6 fib table (configured by metadata as VRF id). +// Only valid for L3 input ACL node +// 3: Classified packet will be steered to source routing policy +// of given index (in metadata). +// This is only valid for IPv6 packets redirected to a source +// routing node. +// - metadata - valid only if action != 0 +// VRF id if action is 1 or 2. +// sr policy index if action is 3. +// - match_len - length of match, should be equal to skip_n_vectors plus match_n_vectors +// of target table times sizeof (u32x4) +// - match - for add, match value for session, required, +// needs to include bytes in front +// with length of skip_n_vectors of target table times sizeof (u32x4) +// (values of those bytes will be ignored) +// +// ClassifyAddDelSession defines message 'classify_add_del_session'. +type ClassifyAddDelSession struct { + IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` + TableIndex uint32 `binapi:"u32,name=table_index" json:"table_index,omitempty"` + HitNextIndex uint32 `binapi:"u32,name=hit_next_index,default=4294967295" json:"hit_next_index,omitempty"` + OpaqueIndex uint32 `binapi:"u32,name=opaque_index,default=4294967295" json:"opaque_index,omitempty"` + Advance int32 `binapi:"i32,name=advance,default=0" json:"advance,omitempty"` + Action ClassifyAction `binapi:"classify_action,name=action,default=0" json:"action,omitempty"` + Metadata uint32 `binapi:"u32,name=metadata,default=0" json:"metadata,omitempty"` + MatchLen uint32 `binapi:"u32,name=match_len" json:"-"` + Match []byte `binapi:"u8[match_len],name=match" json:"match,omitempty"` +} + +func (m *ClassifyAddDelSession) Reset() { *m = ClassifyAddDelSession{} } +func (*ClassifyAddDelSession) GetMessageName() string { return "classify_add_del_session" } +func (*ClassifyAddDelSession) GetCrcString() string { return "f20879f0" } +func (*ClassifyAddDelSession) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *ClassifyAddDelSession) Size() (size int) { + if m == nil { + return 0 + } + size += 1 // m.IsAdd + size += 4 // m.TableIndex + size += 4 // m.HitNextIndex + size += 4 // m.OpaqueIndex + size += 4 // m.Advance + size += 1 // m.Action + size += 4 // m.Metadata + size += 4 // m.MatchLen + size += 1 * len(m.Match) // m.Match + return size +} +func (m *ClassifyAddDelSession) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeBool(m.IsAdd) + buf.EncodeUint32(m.TableIndex) + buf.EncodeUint32(m.HitNextIndex) + buf.EncodeUint32(m.OpaqueIndex) + buf.EncodeInt32(m.Advance) + buf.EncodeUint8(uint8(m.Action)) + buf.EncodeUint32(m.Metadata) + buf.EncodeUint32(uint32(len(m.Match))) + buf.EncodeBytes(m.Match, 0) + return buf.Bytes(), nil +} +func (m *ClassifyAddDelSession) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.IsAdd = buf.DecodeBool() + m.TableIndex = buf.DecodeUint32() + m.HitNextIndex = buf.DecodeUint32() + m.OpaqueIndex = buf.DecodeUint32() + m.Advance = buf.DecodeInt32() + m.Action = ClassifyAction(buf.DecodeUint8()) + m.Metadata = buf.DecodeUint32() + m.MatchLen = buf.DecodeUint32() + m.Match = make([]byte, m.MatchLen) + copy(m.Match, buf.DecodeBytes(len(m.Match))) + return nil +} + +// ClassifyAddDelSessionReply defines message 'classify_add_del_session_reply'. +type ClassifyAddDelSessionReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *ClassifyAddDelSessionReply) Reset() { *m = ClassifyAddDelSessionReply{} } +func (*ClassifyAddDelSessionReply) GetMessageName() string { return "classify_add_del_session_reply" } +func (*ClassifyAddDelSessionReply) GetCrcString() string { return "e8d4e804" } +func (*ClassifyAddDelSessionReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *ClassifyAddDelSessionReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *ClassifyAddDelSessionReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *ClassifyAddDelSessionReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + +// Add/Delete classification table request +// - is_add- if non-zero add the table, else delete it +// - del_chain - if non-zero delete the whole chain of tables +// - table_index - if add, returns index of the created table, else specifies the table to delete +// - nbuckets - number of buckets when adding a table +// - memory_size - memory size when adding a table +// - match_n_vectors - number of match vectors +// - next_table_index - index of next table +// - miss_next_index - index of miss table +// - current_data_flag - option to use current node's packet payload +// as the starting point from where packets are classified, +// This option is only valid for L2/L3 input ACL for now. +// 0: by default, classify data from the buffer's start location +// 1: classify packets from VPP node’s current data pointer +// - current_data_offset - a signed value to shift the start location of +// the packet to be classified +// For example, if input IP ACL node is used, L2 header’s first byte +// can be accessible by configuring current_data_offset to -14 +// if there is no vlan tag. +// This is valid only if current_data_flag is set to 1. +// - mask_len - length of match mask, should be equal to match_n_vectors * sizeof (u32x4) +// - mask - match mask +// +// ClassifyAddDelTable defines message 'classify_add_del_table'. +type ClassifyAddDelTable struct { + IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` + DelChain bool `binapi:"bool,name=del_chain" json:"del_chain,omitempty"` + TableIndex uint32 `binapi:"u32,name=table_index,default=4294967295" json:"table_index,omitempty"` + Nbuckets uint32 `binapi:"u32,name=nbuckets,default=2" json:"nbuckets,omitempty"` + MemorySize uint32 `binapi:"u32,name=memory_size,default=2097152" json:"memory_size,omitempty"` + SkipNVectors uint32 `binapi:"u32,name=skip_n_vectors,default=0" json:"skip_n_vectors,omitempty"` + MatchNVectors uint32 `binapi:"u32,name=match_n_vectors,default=1" json:"match_n_vectors,omitempty"` + NextTableIndex uint32 `binapi:"u32,name=next_table_index,default=4294967295" json:"next_table_index,omitempty"` + MissNextIndex uint32 `binapi:"u32,name=miss_next_index,default=4294967295" json:"miss_next_index,omitempty"` + CurrentDataFlag uint8 `binapi:"u8,name=current_data_flag,default=0" json:"current_data_flag,omitempty"` + CurrentDataOffset int16 `binapi:"i16,name=current_data_offset,default=0" json:"current_data_offset,omitempty"` + MaskLen uint32 `binapi:"u32,name=mask_len" json:"-"` + Mask []byte `binapi:"u8[mask_len],name=mask" json:"mask,omitempty"` +} + +func (m *ClassifyAddDelTable) Reset() { *m = ClassifyAddDelTable{} } +func (*ClassifyAddDelTable) GetMessageName() string { return "classify_add_del_table" } +func (*ClassifyAddDelTable) GetCrcString() string { return "6849e39e" } +func (*ClassifyAddDelTable) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *ClassifyAddDelTable) Size() (size int) { + if m == nil { + return 0 + } + size += 1 // m.IsAdd + size += 1 // m.DelChain + size += 4 // m.TableIndex + size += 4 // m.Nbuckets + size += 4 // m.MemorySize + size += 4 // m.SkipNVectors + size += 4 // m.MatchNVectors + size += 4 // m.NextTableIndex + size += 4 // m.MissNextIndex + size += 1 // m.CurrentDataFlag + size += 2 // m.CurrentDataOffset + size += 4 // m.MaskLen + size += 1 * len(m.Mask) // m.Mask + return size +} +func (m *ClassifyAddDelTable) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeBool(m.IsAdd) + buf.EncodeBool(m.DelChain) + buf.EncodeUint32(m.TableIndex) + buf.EncodeUint32(m.Nbuckets) + buf.EncodeUint32(m.MemorySize) + buf.EncodeUint32(m.SkipNVectors) + buf.EncodeUint32(m.MatchNVectors) + buf.EncodeUint32(m.NextTableIndex) + buf.EncodeUint32(m.MissNextIndex) + buf.EncodeUint8(m.CurrentDataFlag) + buf.EncodeInt16(m.CurrentDataOffset) + buf.EncodeUint32(uint32(len(m.Mask))) + buf.EncodeBytes(m.Mask, 0) + return buf.Bytes(), nil +} +func (m *ClassifyAddDelTable) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.IsAdd = buf.DecodeBool() + m.DelChain = buf.DecodeBool() + m.TableIndex = buf.DecodeUint32() + m.Nbuckets = buf.DecodeUint32() + m.MemorySize = buf.DecodeUint32() + m.SkipNVectors = buf.DecodeUint32() + m.MatchNVectors = buf.DecodeUint32() + m.NextTableIndex = buf.DecodeUint32() + m.MissNextIndex = buf.DecodeUint32() + m.CurrentDataFlag = buf.DecodeUint8() + m.CurrentDataOffset = buf.DecodeInt16() + m.MaskLen = buf.DecodeUint32() + m.Mask = make([]byte, m.MaskLen) + copy(m.Mask, buf.DecodeBytes(len(m.Mask))) + return nil +} + +// Add/Delete classification table response +// - retval - return code for the table add/del request +// - new_table_index - for add, returned index of the new table +// - skip_n_vectors - for add, returned value of skip_n_vectors in table +// - match_n_vectors -for add, returned value of match_n_vectors in table +// +// ClassifyAddDelTableReply defines message 'classify_add_del_table_reply'. +type ClassifyAddDelTableReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + NewTableIndex uint32 `binapi:"u32,name=new_table_index" json:"new_table_index,omitempty"` + SkipNVectors uint32 `binapi:"u32,name=skip_n_vectors" json:"skip_n_vectors,omitempty"` + MatchNVectors uint32 `binapi:"u32,name=match_n_vectors" json:"match_n_vectors,omitempty"` +} + +func (m *ClassifyAddDelTableReply) Reset() { *m = ClassifyAddDelTableReply{} } +func (*ClassifyAddDelTableReply) GetMessageName() string { return "classify_add_del_table_reply" } +func (*ClassifyAddDelTableReply) GetCrcString() string { return "05486349" } +func (*ClassifyAddDelTableReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *ClassifyAddDelTableReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.NewTableIndex + size += 4 // m.SkipNVectors + size += 4 // m.MatchNVectors + return size +} +func (m *ClassifyAddDelTableReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.NewTableIndex) + buf.EncodeUint32(m.SkipNVectors) + buf.EncodeUint32(m.MatchNVectors) + return buf.Bytes(), nil +} +func (m *ClassifyAddDelTableReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.NewTableIndex = buf.DecodeUint32() + m.SkipNVectors = buf.DecodeUint32() + m.MatchNVectors = buf.DecodeUint32() + return nil +} + +// Classify get the PCAP table indices for an interface +// ClassifyPcapGetTables defines message 'classify_pcap_get_tables'. +type ClassifyPcapGetTables struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` +} + +func (m *ClassifyPcapGetTables) Reset() { *m = ClassifyPcapGetTables{} } +func (*ClassifyPcapGetTables) GetMessageName() string { return "classify_pcap_get_tables" } +func (*ClassifyPcapGetTables) GetCrcString() string { return "f9e6675e" } +func (*ClassifyPcapGetTables) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *ClassifyPcapGetTables) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + return size +} +func (m *ClassifyPcapGetTables) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + return buf.Bytes(), nil +} +func (m *ClassifyPcapGetTables) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + return nil +} + +// Classify get a PCAP tables response +// - retval - return code for the request +// - count - number of ids returned in response +// - indices - array of classify table indices +// +// ClassifyPcapGetTablesReply defines message 'classify_pcap_get_tables_reply'. +type ClassifyPcapGetTablesReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + Count uint32 `binapi:"u32,name=count" json:"-"` + Indices []uint32 `binapi:"u32[count],name=indices" json:"indices,omitempty"` +} + +func (m *ClassifyPcapGetTablesReply) Reset() { *m = ClassifyPcapGetTablesReply{} } +func (*ClassifyPcapGetTablesReply) GetMessageName() string { return "classify_pcap_get_tables_reply" } +func (*ClassifyPcapGetTablesReply) GetCrcString() string { return "5f5bc9e6" } +func (*ClassifyPcapGetTablesReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *ClassifyPcapGetTablesReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.Count + size += 4 * len(m.Indices) // m.Indices + return size +} +func (m *ClassifyPcapGetTablesReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(uint32(len(m.Indices))) + for i := 0; i < len(m.Indices); i++ { + var x uint32 + if i < len(m.Indices) { + x = uint32(m.Indices[i]) + } + buf.EncodeUint32(x) + } + return buf.Bytes(), nil +} +func (m *ClassifyPcapGetTablesReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.Count = buf.DecodeUint32() + m.Indices = make([]uint32, m.Count) + for i := 0; i < len(m.Indices); i++ { + m.Indices[i] = buf.DecodeUint32() + } + return nil +} + +// Find a compatible Classify table in a PCAP chain +// - sw_if_index - interface whose chain will be searched, 0==system-wide +// - skip_n_vectors - number of u32x4 skip vectors +// - match_n_vectors - number of u32x4 vectors, 1..5 +// - mask_len - length of mask, match_n_vectors * sizeof(u32x4) +// - mask - match mask +// +// ClassifyPcapLookupTable defines message 'classify_pcap_lookup_table'. +type ClassifyPcapLookupTable struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` + SkipNVectors uint32 `binapi:"u32,name=skip_n_vectors,default=0" json:"skip_n_vectors,omitempty"` + MatchNVectors uint32 `binapi:"u32,name=match_n_vectors,default=1" json:"match_n_vectors,omitempty"` + MaskLen uint32 `binapi:"u32,name=mask_len" json:"-"` + Mask []byte `binapi:"u8[mask_len],name=mask" json:"mask,omitempty"` +} + +func (m *ClassifyPcapLookupTable) Reset() { *m = ClassifyPcapLookupTable{} } +func (*ClassifyPcapLookupTable) GetMessageName() string { return "classify_pcap_lookup_table" } +func (*ClassifyPcapLookupTable) GetCrcString() string { return "e1b4cc6b" } +func (*ClassifyPcapLookupTable) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *ClassifyPcapLookupTable) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + size += 4 // m.SkipNVectors + size += 4 // m.MatchNVectors + size += 4 // m.MaskLen + size += 1 * len(m.Mask) // m.Mask + return size +} +func (m *ClassifyPcapLookupTable) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeUint32(m.SkipNVectors) + buf.EncodeUint32(m.MatchNVectors) + buf.EncodeUint32(uint32(len(m.Mask))) + buf.EncodeBytes(m.Mask, 0) + return buf.Bytes(), nil +} +func (m *ClassifyPcapLookupTable) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.SkipNVectors = buf.DecodeUint32() + m.MatchNVectors = buf.DecodeUint32() + m.MaskLen = buf.DecodeUint32() + m.Mask = make([]byte, m.MaskLen) + copy(m.Mask, buf.DecodeBytes(len(m.Mask))) + return nil +} + +// Classify pcap table lookup response +// - retval - return code for the table lookup request +// - table_index - returned index of the found table, or ~0 +// +// ClassifyPcapLookupTableReply defines message 'classify_pcap_lookup_table_reply'. +type ClassifyPcapLookupTableReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + TableIndex uint32 `binapi:"u32,name=table_index" json:"table_index,omitempty"` +} + +func (m *ClassifyPcapLookupTableReply) Reset() { *m = ClassifyPcapLookupTableReply{} } +func (*ClassifyPcapLookupTableReply) GetMessageName() string { + return "classify_pcap_lookup_table_reply" +} +func (*ClassifyPcapLookupTableReply) GetCrcString() string { return "9c6c6773" } +func (*ClassifyPcapLookupTableReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *ClassifyPcapLookupTableReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.TableIndex + return size +} +func (m *ClassifyPcapLookupTableReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.TableIndex) + return buf.Bytes(), nil +} +func (m *ClassifyPcapLookupTableReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.TableIndex = buf.DecodeUint32() + return nil +} + +// Add a Classify table into a PCAP chain on an interface +// - sw_if_index - interface whose chain will be searched, 0==system-wide +// - table_index - Classify table to be added +// - sort_masks - 1=sort masks into most-to-least specific order +// +// ClassifyPcapSetTable defines message 'classify_pcap_set_table'. +type ClassifyPcapSetTable struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + TableIndex uint32 `binapi:"u32,name=table_index,default=4294967295" json:"table_index,omitempty"` + SortMasks bool `binapi:"bool,name=sort_masks,default=0" json:"sort_masks,omitempty"` +} + +func (m *ClassifyPcapSetTable) Reset() { *m = ClassifyPcapSetTable{} } +func (*ClassifyPcapSetTable) GetMessageName() string { return "classify_pcap_set_table" } +func (*ClassifyPcapSetTable) GetCrcString() string { return "006051b3" } +func (*ClassifyPcapSetTable) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *ClassifyPcapSetTable) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + size += 4 // m.TableIndex + size += 1 // m.SortMasks + return size +} +func (m *ClassifyPcapSetTable) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeUint32(m.TableIndex) + buf.EncodeBool(m.SortMasks) + return buf.Bytes(), nil +} +func (m *ClassifyPcapSetTable) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.TableIndex = buf.DecodeUint32() + m.SortMasks = buf.DecodeBool() + return nil +} + +// Classify pcap table lookup response +// - retval - return code for the table lookup request +// - table_index - returned index of the sorted table chain +// +// ClassifyPcapSetTableReply defines message 'classify_pcap_set_table_reply'. +type ClassifyPcapSetTableReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + TableIndex uint32 `binapi:"u32,name=table_index" json:"table_index,omitempty"` +} + +func (m *ClassifyPcapSetTableReply) Reset() { *m = ClassifyPcapSetTableReply{} } +func (*ClassifyPcapSetTableReply) GetMessageName() string { return "classify_pcap_set_table_reply" } +func (*ClassifyPcapSetTableReply) GetCrcString() string { return "9c6c6773" } +func (*ClassifyPcapSetTableReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *ClassifyPcapSetTableReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.TableIndex + return size +} +func (m *ClassifyPcapSetTableReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.TableIndex) + return buf.Bytes(), nil +} +func (m *ClassifyPcapSetTableReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.TableIndex = buf.DecodeUint32() + return nil +} + +// Reply for classify table session dump request +// - count - number of ids returned in response +// - table_id - classify table index +// - hit_next_index - hit_next_index of session +// - opaque_index - for add, opaque_index of session +// - advance - advance value of session +// - match[] - match value for session +// +// ClassifySessionDetails defines message 'classify_session_details'. +type ClassifySessionDetails struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"` + HitNextIndex uint32 `binapi:"u32,name=hit_next_index" json:"hit_next_index,omitempty"` + Advance int32 `binapi:"i32,name=advance" json:"advance,omitempty"` + OpaqueIndex uint32 `binapi:"u32,name=opaque_index" json:"opaque_index,omitempty"` + MatchLength uint32 `binapi:"u32,name=match_length" json:"-"` + Match []byte `binapi:"u8[match_length],name=match" json:"match,omitempty"` +} + +func (m *ClassifySessionDetails) Reset() { *m = ClassifySessionDetails{} } +func (*ClassifySessionDetails) GetMessageName() string { return "classify_session_details" } +func (*ClassifySessionDetails) GetCrcString() string { return "60e3ef94" } +func (*ClassifySessionDetails) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *ClassifySessionDetails) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.TableID + size += 4 // m.HitNextIndex + size += 4 // m.Advance + size += 4 // m.OpaqueIndex + size += 4 // m.MatchLength + size += 1 * len(m.Match) // m.Match + return size +} +func (m *ClassifySessionDetails) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.TableID) + buf.EncodeUint32(m.HitNextIndex) + buf.EncodeInt32(m.Advance) + buf.EncodeUint32(m.OpaqueIndex) + buf.EncodeUint32(uint32(len(m.Match))) + buf.EncodeBytes(m.Match, 0) + return buf.Bytes(), nil +} +func (m *ClassifySessionDetails) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.TableID = buf.DecodeUint32() + m.HitNextIndex = buf.DecodeUint32() + m.Advance = buf.DecodeInt32() + m.OpaqueIndex = buf.DecodeUint32() + m.MatchLength = buf.DecodeUint32() + m.Match = make([]byte, m.MatchLength) + copy(m.Match, buf.DecodeBytes(len(m.Match))) + return nil +} + +// Classify sessions dump request +// - table_id - classify table index +// +// ClassifySessionDump defines message 'classify_session_dump'. +type ClassifySessionDump struct { + TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"` +} + +func (m *ClassifySessionDump) Reset() { *m = ClassifySessionDump{} } +func (*ClassifySessionDump) GetMessageName() string { return "classify_session_dump" } +func (*ClassifySessionDump) GetCrcString() string { return "0cca2cd9" } +func (*ClassifySessionDump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *ClassifySessionDump) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.TableID + return size +} +func (m *ClassifySessionDump) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.TableID) + return buf.Bytes(), nil +} +func (m *ClassifySessionDump) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.TableID = buf.DecodeUint32() + return nil +} + +// Set/unset the classification table for an interface request +// - is_ipv6 - ipv6 if non-zero, else ipv4 +// - sw_if_index - interface to associate with the table +// - table_index - index of the table, if ~0 unset the table +// +// ClassifySetInterfaceIPTable defines message 'classify_set_interface_ip_table'. +type ClassifySetInterfaceIPTable struct { + IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + TableIndex uint32 `binapi:"u32,name=table_index" json:"table_index,omitempty"` +} + +func (m *ClassifySetInterfaceIPTable) Reset() { *m = ClassifySetInterfaceIPTable{} } +func (*ClassifySetInterfaceIPTable) GetMessageName() string { return "classify_set_interface_ip_table" } +func (*ClassifySetInterfaceIPTable) GetCrcString() string { return "e0b097c7" } +func (*ClassifySetInterfaceIPTable) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *ClassifySetInterfaceIPTable) Size() (size int) { + if m == nil { + return 0 + } + size += 1 // m.IsIPv6 + size += 4 // m.SwIfIndex + size += 4 // m.TableIndex + return size +} +func (m *ClassifySetInterfaceIPTable) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeBool(m.IsIPv6) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeUint32(m.TableIndex) + return buf.Bytes(), nil +} +func (m *ClassifySetInterfaceIPTable) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.IsIPv6 = buf.DecodeBool() + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.TableIndex = buf.DecodeUint32() + return nil +} + +// ClassifySetInterfaceIPTableReply defines message 'classify_set_interface_ip_table_reply'. +type ClassifySetInterfaceIPTableReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *ClassifySetInterfaceIPTableReply) Reset() { *m = ClassifySetInterfaceIPTableReply{} } +func (*ClassifySetInterfaceIPTableReply) GetMessageName() string { + return "classify_set_interface_ip_table_reply" +} +func (*ClassifySetInterfaceIPTableReply) GetCrcString() string { return "e8d4e804" } +func (*ClassifySetInterfaceIPTableReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *ClassifySetInterfaceIPTableReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *ClassifySetInterfaceIPTableReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *ClassifySetInterfaceIPTableReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + +// Set/unset l2 classification tables for an interface request +// - sw_if_index - interface to set/unset tables for +// - ip4_table_index - ip4 index, use ~0 for all 3 indexes to unset +// - ip6_table_index - ip6 index +// - other_table_index - other index +// +// ClassifySetInterfaceL2Tables defines message 'classify_set_interface_l2_tables'. +type ClassifySetInterfaceL2Tables struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + IP4TableIndex uint32 `binapi:"u32,name=ip4_table_index" json:"ip4_table_index,omitempty"` + IP6TableIndex uint32 `binapi:"u32,name=ip6_table_index" json:"ip6_table_index,omitempty"` + OtherTableIndex uint32 `binapi:"u32,name=other_table_index" json:"other_table_index,omitempty"` + IsInput bool `binapi:"bool,name=is_input" json:"is_input,omitempty"` +} + +func (m *ClassifySetInterfaceL2Tables) Reset() { *m = ClassifySetInterfaceL2Tables{} } +func (*ClassifySetInterfaceL2Tables) GetMessageName() string { + return "classify_set_interface_l2_tables" +} +func (*ClassifySetInterfaceL2Tables) GetCrcString() string { return "5a6ddf65" } +func (*ClassifySetInterfaceL2Tables) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *ClassifySetInterfaceL2Tables) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + size += 4 // m.IP4TableIndex + size += 4 // m.IP6TableIndex + size += 4 // m.OtherTableIndex + size += 1 // m.IsInput + return size +} +func (m *ClassifySetInterfaceL2Tables) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeUint32(m.IP4TableIndex) + buf.EncodeUint32(m.IP6TableIndex) + buf.EncodeUint32(m.OtherTableIndex) + buf.EncodeBool(m.IsInput) + return buf.Bytes(), nil +} +func (m *ClassifySetInterfaceL2Tables) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.IP4TableIndex = buf.DecodeUint32() + m.IP6TableIndex = buf.DecodeUint32() + m.OtherTableIndex = buf.DecodeUint32() + m.IsInput = buf.DecodeBool() + return nil +} + +// ClassifySetInterfaceL2TablesReply defines message 'classify_set_interface_l2_tables_reply'. +type ClassifySetInterfaceL2TablesReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *ClassifySetInterfaceL2TablesReply) Reset() { *m = ClassifySetInterfaceL2TablesReply{} } +func (*ClassifySetInterfaceL2TablesReply) GetMessageName() string { + return "classify_set_interface_l2_tables_reply" +} +func (*ClassifySetInterfaceL2TablesReply) GetCrcString() string { return "e8d4e804" } +func (*ClassifySetInterfaceL2TablesReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *ClassifySetInterfaceL2TablesReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *ClassifySetInterfaceL2TablesReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *ClassifySetInterfaceL2TablesReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + +// Classify table ids by interface index request +// - sw_if_index - index of the interface +// +// ClassifyTableByInterface defines message 'classify_table_by_interface'. +type ClassifyTableByInterface struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` +} + +func (m *ClassifyTableByInterface) Reset() { *m = ClassifyTableByInterface{} } +func (*ClassifyTableByInterface) GetMessageName() string { return "classify_table_by_interface" } +func (*ClassifyTableByInterface) GetCrcString() string { return "f9e6675e" } +func (*ClassifyTableByInterface) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *ClassifyTableByInterface) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + return size +} +func (m *ClassifyTableByInterface) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + return buf.Bytes(), nil +} +func (m *ClassifyTableByInterface) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + return nil +} + +// Reply for classify table id by interface index request +// - count - number of ids returned in response +// - sw_if_index - index of the interface +// - l2_table_id - l2 classify table index +// - ip4_table_id - ip4 classify table index +// - ip6_table_id - ip6 classify table index +// +// ClassifyTableByInterfaceReply defines message 'classify_table_by_interface_reply'. +type ClassifyTableByInterfaceReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + L2TableID uint32 `binapi:"u32,name=l2_table_id" json:"l2_table_id,omitempty"` + IP4TableID uint32 `binapi:"u32,name=ip4_table_id" json:"ip4_table_id,omitempty"` + IP6TableID uint32 `binapi:"u32,name=ip6_table_id" json:"ip6_table_id,omitempty"` +} + +func (m *ClassifyTableByInterfaceReply) Reset() { *m = ClassifyTableByInterfaceReply{} } +func (*ClassifyTableByInterfaceReply) GetMessageName() string { + return "classify_table_by_interface_reply" +} +func (*ClassifyTableByInterfaceReply) GetCrcString() string { return "ed4197db" } +func (*ClassifyTableByInterfaceReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *ClassifyTableByInterfaceReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.SwIfIndex + size += 4 // m.L2TableID + size += 4 // m.IP4TableID + size += 4 // m.IP6TableID + return size +} +func (m *ClassifyTableByInterfaceReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeUint32(m.L2TableID) + buf.EncodeUint32(m.IP4TableID) + buf.EncodeUint32(m.IP6TableID) + return buf.Bytes(), nil +} +func (m *ClassifyTableByInterfaceReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.L2TableID = buf.DecodeUint32() + m.IP4TableID = buf.DecodeUint32() + m.IP6TableID = buf.DecodeUint32() + return nil +} + +// Classify get table IDs request +// ClassifyTableIds defines message 'classify_table_ids'. +type ClassifyTableIds struct{} + +func (m *ClassifyTableIds) Reset() { *m = ClassifyTableIds{} } +func (*ClassifyTableIds) GetMessageName() string { return "classify_table_ids" } +func (*ClassifyTableIds) GetCrcString() string { return "51077d14" } +func (*ClassifyTableIds) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *ClassifyTableIds) Size() (size int) { + if m == nil { + return 0 + } + return size +} +func (m *ClassifyTableIds) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + return buf.Bytes(), nil +} +func (m *ClassifyTableIds) Unmarshal(b []byte) error { + return nil +} + +// Reply for classify get table IDs request +// - count - number of ids returned in response +// - ids - array of classify table ids +// +// ClassifyTableIdsReply defines message 'classify_table_ids_reply'. +type ClassifyTableIdsReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + Count uint32 `binapi:"u32,name=count" json:"-"` + Ids []uint32 `binapi:"u32[count],name=ids" json:"ids,omitempty"` +} + +func (m *ClassifyTableIdsReply) Reset() { *m = ClassifyTableIdsReply{} } +func (*ClassifyTableIdsReply) GetMessageName() string { return "classify_table_ids_reply" } +func (*ClassifyTableIdsReply) GetCrcString() string { return "d1d20e1d" } +func (*ClassifyTableIdsReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *ClassifyTableIdsReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.Count + size += 4 * len(m.Ids) // m.Ids + return size +} +func (m *ClassifyTableIdsReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(uint32(len(m.Ids))) + for i := 0; i < len(m.Ids); i++ { + var x uint32 + if i < len(m.Ids) { + x = uint32(m.Ids[i]) + } + buf.EncodeUint32(x) + } + return buf.Bytes(), nil +} +func (m *ClassifyTableIdsReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.Count = buf.DecodeUint32() + m.Ids = make([]uint32, m.Count) + for i := 0; i < len(m.Ids); i++ { + m.Ids[i] = buf.DecodeUint32() + } + return nil +} + +// Classify table info +// - table_id - classify table index +// +// ClassifyTableInfo defines message 'classify_table_info'. +type ClassifyTableInfo struct { + TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"` +} + +func (m *ClassifyTableInfo) Reset() { *m = ClassifyTableInfo{} } +func (*ClassifyTableInfo) GetMessageName() string { return "classify_table_info" } +func (*ClassifyTableInfo) GetCrcString() string { return "0cca2cd9" } +func (*ClassifyTableInfo) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *ClassifyTableInfo) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.TableID + return size +} +func (m *ClassifyTableInfo) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.TableID) + return buf.Bytes(), nil +} +func (m *ClassifyTableInfo) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.TableID = buf.DecodeUint32() + return nil +} + +// Reply for classify table info request +// - count - number of ids returned in response +// - table_id - classify table index +// - nbuckets - number of buckets when adding a table +// - match_n_vectors - number of match vectors +// - skip_n_vectors - number of skip_n_vectors +// - active_sessions - number of sessions (active entries) +// - next_table_index - index of next table +// - miss_next_index - index of miss table +// - mask[] - match mask +// +// ClassifyTableInfoReply defines message 'classify_table_info_reply'. +type ClassifyTableInfoReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"` + Nbuckets uint32 `binapi:"u32,name=nbuckets" json:"nbuckets,omitempty"` + MatchNVectors uint32 `binapi:"u32,name=match_n_vectors" json:"match_n_vectors,omitempty"` + SkipNVectors uint32 `binapi:"u32,name=skip_n_vectors" json:"skip_n_vectors,omitempty"` + ActiveSessions uint32 `binapi:"u32,name=active_sessions" json:"active_sessions,omitempty"` + NextTableIndex uint32 `binapi:"u32,name=next_table_index" json:"next_table_index,omitempty"` + MissNextIndex uint32 `binapi:"u32,name=miss_next_index" json:"miss_next_index,omitempty"` + MaskLength uint32 `binapi:"u32,name=mask_length" json:"-"` + Mask []byte `binapi:"u8[mask_length],name=mask" json:"mask,omitempty"` +} + +func (m *ClassifyTableInfoReply) Reset() { *m = ClassifyTableInfoReply{} } +func (*ClassifyTableInfoReply) GetMessageName() string { return "classify_table_info_reply" } +func (*ClassifyTableInfoReply) GetCrcString() string { return "4a573c0e" } +func (*ClassifyTableInfoReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *ClassifyTableInfoReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.TableID + size += 4 // m.Nbuckets + size += 4 // m.MatchNVectors + size += 4 // m.SkipNVectors + size += 4 // m.ActiveSessions + size += 4 // m.NextTableIndex + size += 4 // m.MissNextIndex + size += 4 // m.MaskLength + size += 1 * len(m.Mask) // m.Mask + return size +} +func (m *ClassifyTableInfoReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.TableID) + buf.EncodeUint32(m.Nbuckets) + buf.EncodeUint32(m.MatchNVectors) + buf.EncodeUint32(m.SkipNVectors) + buf.EncodeUint32(m.ActiveSessions) + buf.EncodeUint32(m.NextTableIndex) + buf.EncodeUint32(m.MissNextIndex) + buf.EncodeUint32(uint32(len(m.Mask))) + buf.EncodeBytes(m.Mask, 0) + return buf.Bytes(), nil +} +func (m *ClassifyTableInfoReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.TableID = buf.DecodeUint32() + m.Nbuckets = buf.DecodeUint32() + m.MatchNVectors = buf.DecodeUint32() + m.SkipNVectors = buf.DecodeUint32() + m.ActiveSessions = buf.DecodeUint32() + m.NextTableIndex = buf.DecodeUint32() + m.MissNextIndex = buf.DecodeUint32() + m.MaskLength = buf.DecodeUint32() + m.Mask = make([]byte, m.MaskLength) + copy(m.Mask, buf.DecodeBytes(len(m.Mask))) + return nil +} + +// Classify get the Trace table indices +// ClassifyTraceGetTables defines message 'classify_trace_get_tables'. +type ClassifyTraceGetTables struct{} + +func (m *ClassifyTraceGetTables) Reset() { *m = ClassifyTraceGetTables{} } +func (*ClassifyTraceGetTables) GetMessageName() string { return "classify_trace_get_tables" } +func (*ClassifyTraceGetTables) GetCrcString() string { return "51077d14" } +func (*ClassifyTraceGetTables) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *ClassifyTraceGetTables) Size() (size int) { + if m == nil { + return 0 + } + return size +} +func (m *ClassifyTraceGetTables) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + return buf.Bytes(), nil +} +func (m *ClassifyTraceGetTables) Unmarshal(b []byte) error { + return nil +} + +// Classify get the Trace tables response +// - retval - return code for the request +// - count - number of ids returned in response +// - indices - array of classify table indices +// +// ClassifyTraceGetTablesReply defines message 'classify_trace_get_tables_reply'. +type ClassifyTraceGetTablesReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + Count uint32 `binapi:"u32,name=count" json:"-"` + Indices []uint32 `binapi:"u32[count],name=indices" json:"indices,omitempty"` +} + +func (m *ClassifyTraceGetTablesReply) Reset() { *m = ClassifyTraceGetTablesReply{} } +func (*ClassifyTraceGetTablesReply) GetMessageName() string { return "classify_trace_get_tables_reply" } +func (*ClassifyTraceGetTablesReply) GetCrcString() string { return "5f5bc9e6" } +func (*ClassifyTraceGetTablesReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *ClassifyTraceGetTablesReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.Count + size += 4 * len(m.Indices) // m.Indices + return size +} +func (m *ClassifyTraceGetTablesReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(uint32(len(m.Indices))) + for i := 0; i < len(m.Indices); i++ { + var x uint32 + if i < len(m.Indices) { + x = uint32(m.Indices[i]) + } + buf.EncodeUint32(x) + } + return buf.Bytes(), nil +} +func (m *ClassifyTraceGetTablesReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.Count = buf.DecodeUint32() + m.Indices = make([]uint32, m.Count) + for i := 0; i < len(m.Indices); i++ { + m.Indices[i] = buf.DecodeUint32() + } + return nil +} + +// Find a mask-compatible Classify table in the Trace chain +// - skip_n_vectors - number of u32x4 skip vectors +// - match_n_vectors - number of u32x4 vectors, 1..5 +// - mask_len - length of mask, match_n_vectors * sizeof(u32x4) +// - mask - match mask +// +// ClassifyTraceLookupTable defines message 'classify_trace_lookup_table'. +type ClassifyTraceLookupTable struct { + SkipNVectors uint32 `binapi:"u32,name=skip_n_vectors,default=0" json:"skip_n_vectors,omitempty"` + MatchNVectors uint32 `binapi:"u32,name=match_n_vectors,default=1" json:"match_n_vectors,omitempty"` + MaskLen uint32 `binapi:"u32,name=mask_len" json:"-"` + Mask []byte `binapi:"u8[mask_len],name=mask" json:"mask,omitempty"` +} + +func (m *ClassifyTraceLookupTable) Reset() { *m = ClassifyTraceLookupTable{} } +func (*ClassifyTraceLookupTable) GetMessageName() string { return "classify_trace_lookup_table" } +func (*ClassifyTraceLookupTable) GetCrcString() string { return "3f7b72e4" } +func (*ClassifyTraceLookupTable) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *ClassifyTraceLookupTable) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SkipNVectors + size += 4 // m.MatchNVectors + size += 4 // m.MaskLen + size += 1 * len(m.Mask) // m.Mask + return size +} +func (m *ClassifyTraceLookupTable) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.SkipNVectors) + buf.EncodeUint32(m.MatchNVectors) + buf.EncodeUint32(uint32(len(m.Mask))) + buf.EncodeBytes(m.Mask, 0) + return buf.Bytes(), nil +} +func (m *ClassifyTraceLookupTable) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SkipNVectors = buf.DecodeUint32() + m.MatchNVectors = buf.DecodeUint32() + m.MaskLen = buf.DecodeUint32() + m.Mask = make([]byte, m.MaskLen) + copy(m.Mask, buf.DecodeBytes(len(m.Mask))) + return nil +} + +// Classify trace table lookup response +// - retval - return code for the table lookup request +// - table_index - returned index of the found table, or ~0 +// +// ClassifyTraceLookupTableReply defines message 'classify_trace_lookup_table_reply'. +type ClassifyTraceLookupTableReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + TableIndex uint32 `binapi:"u32,name=table_index" json:"table_index,omitempty"` +} + +func (m *ClassifyTraceLookupTableReply) Reset() { *m = ClassifyTraceLookupTableReply{} } +func (*ClassifyTraceLookupTableReply) GetMessageName() string { + return "classify_trace_lookup_table_reply" +} +func (*ClassifyTraceLookupTableReply) GetCrcString() string { return "9c6c6773" } +func (*ClassifyTraceLookupTableReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *ClassifyTraceLookupTableReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.TableIndex + return size +} +func (m *ClassifyTraceLookupTableReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.TableIndex) + return buf.Bytes(), nil +} +func (m *ClassifyTraceLookupTableReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.TableIndex = buf.DecodeUint32() + return nil +} + +// Add a Classify table into the Trace chain +// - table_index - Classify table to be added +// - sort_masks - 1=sort masks into most-to-least specific order +// +// ClassifyTraceSetTable defines message 'classify_trace_set_table'. +type ClassifyTraceSetTable struct { + TableIndex uint32 `binapi:"u32,name=table_index,default=4294967295" json:"table_index,omitempty"` + SortMasks bool `binapi:"bool,name=sort_masks,default=0" json:"sort_masks,omitempty"` +} + +func (m *ClassifyTraceSetTable) Reset() { *m = ClassifyTraceSetTable{} } +func (*ClassifyTraceSetTable) GetMessageName() string { return "classify_trace_set_table" } +func (*ClassifyTraceSetTable) GetCrcString() string { return "3909b55a" } +func (*ClassifyTraceSetTable) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *ClassifyTraceSetTable) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.TableIndex + size += 1 // m.SortMasks + return size +} +func (m *ClassifyTraceSetTable) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.TableIndex) + buf.EncodeBool(m.SortMasks) + return buf.Bytes(), nil +} +func (m *ClassifyTraceSetTable) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.TableIndex = buf.DecodeUint32() + m.SortMasks = buf.DecodeBool() + return nil +} + +// Classify Trace table lookup response +// - retval - return code for the table lookup request +// - table_index - returned index of the sorted table chain +// +// ClassifyTraceSetTableReply defines message 'classify_trace_set_table_reply'. +type ClassifyTraceSetTableReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + TableIndex uint32 `binapi:"u32,name=table_index" json:"table_index,omitempty"` +} + +func (m *ClassifyTraceSetTableReply) Reset() { *m = ClassifyTraceSetTableReply{} } +func (*ClassifyTraceSetTableReply) GetMessageName() string { return "classify_trace_set_table_reply" } +func (*ClassifyTraceSetTableReply) GetCrcString() string { return "9c6c6773" } +func (*ClassifyTraceSetTableReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *ClassifyTraceSetTableReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.TableIndex + return size +} +func (m *ClassifyTraceSetTableReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.TableIndex) + return buf.Bytes(), nil +} +func (m *ClassifyTraceSetTableReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.TableIndex = buf.DecodeUint32() + return nil +} + +// Flow classify operational state response. +// - sw_if_index - software interface index +// - table_index - classify table index +// +// FlowClassifyDetails defines message 'flow_classify_details'. +type FlowClassifyDetails struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + TableIndex uint32 `binapi:"u32,name=table_index" json:"table_index,omitempty"` +} + +func (m *FlowClassifyDetails) Reset() { *m = FlowClassifyDetails{} } +func (*FlowClassifyDetails) GetMessageName() string { return "flow_classify_details" } +func (*FlowClassifyDetails) GetCrcString() string { return "dfd08765" } +func (*FlowClassifyDetails) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *FlowClassifyDetails) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + size += 4 // m.TableIndex + return size +} +func (m *FlowClassifyDetails) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeUint32(m.TableIndex) + return buf.Bytes(), nil +} +func (m *FlowClassifyDetails) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.TableIndex = buf.DecodeUint32() + return nil +} + +// Get list of flow classify interfaces and tables +// - type - flow classify table type +// - sw_if_index - filter on sw_if_index +// +// FlowClassifyDump defines message 'flow_classify_dump'. +type FlowClassifyDump struct { + Type FlowClassifyTable `binapi:"flow_classify_table,name=type" json:"type,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` +} + +func (m *FlowClassifyDump) Reset() { *m = FlowClassifyDump{} } +func (*FlowClassifyDump) GetMessageName() string { return "flow_classify_dump" } +func (*FlowClassifyDump) GetCrcString() string { return "25dd3e4c" } +func (*FlowClassifyDump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *FlowClassifyDump) Size() (size int) { + if m == nil { + return 0 + } + size += 1 // m.Type + size += 4 // m.SwIfIndex + return size +} +func (m *FlowClassifyDump) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint8(uint8(m.Type)) + buf.EncodeUint32(uint32(m.SwIfIndex)) + return buf.Bytes(), nil +} +func (m *FlowClassifyDump) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Type = FlowClassifyTable(buf.DecodeUint8()) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + return nil +} + +// Set/unset flow classify interface +// - sw_if_index - interface to set/unset flow classify +// - ip4_table_index - ip4 classify table index (~0 for skip) +// - ip6_table_index - ip6 classify table index (~0 for skip) +// - l2_table_index - l2 classify table index (~0 for skip) +// - is_add - Set if non-zero, else unset +// Note: User is recommended to use just one valid table_index per call. +// (ip4_table_index, ip6_table_index, or l2_table_index) +// +// FlowClassifySetInterface defines message 'flow_classify_set_interface'. +type FlowClassifySetInterface struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + IP4TableIndex uint32 `binapi:"u32,name=ip4_table_index" json:"ip4_table_index,omitempty"` + IP6TableIndex uint32 `binapi:"u32,name=ip6_table_index" json:"ip6_table_index,omitempty"` + IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` +} + +func (m *FlowClassifySetInterface) Reset() { *m = FlowClassifySetInterface{} } +func (*FlowClassifySetInterface) GetMessageName() string { return "flow_classify_set_interface" } +func (*FlowClassifySetInterface) GetCrcString() string { return "b6192f1c" } +func (*FlowClassifySetInterface) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *FlowClassifySetInterface) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + size += 4 // m.IP4TableIndex + size += 4 // m.IP6TableIndex + size += 1 // m.IsAdd + return size +} +func (m *FlowClassifySetInterface) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeUint32(m.IP4TableIndex) + buf.EncodeUint32(m.IP6TableIndex) + buf.EncodeBool(m.IsAdd) + return buf.Bytes(), nil +} +func (m *FlowClassifySetInterface) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.IP4TableIndex = buf.DecodeUint32() + m.IP6TableIndex = buf.DecodeUint32() + m.IsAdd = buf.DecodeBool() + return nil +} + +// FlowClassifySetInterfaceReply defines message 'flow_classify_set_interface_reply'. +type FlowClassifySetInterfaceReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *FlowClassifySetInterfaceReply) Reset() { *m = FlowClassifySetInterfaceReply{} } +func (*FlowClassifySetInterfaceReply) GetMessageName() string { + return "flow_classify_set_interface_reply" +} +func (*FlowClassifySetInterfaceReply) GetCrcString() string { return "e8d4e804" } +func (*FlowClassifySetInterfaceReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *FlowClassifySetInterfaceReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *FlowClassifySetInterfaceReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *FlowClassifySetInterfaceReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + +// Set/unset input ACL interface +// - sw_if_index - interface to set/unset input ACL +// - ip4_table_index - ip4 classify table index (~0 for skip) +// - ip6_table_index - ip6 classify table index (~0 for skip) +// - l2_table_index - l2 classify table index (~0 for skip) +// - is_add - Set input ACL if non-zero, else unset +// Note: User is recommended to use just one valid table_index per call. +// (ip4_table_index, ip6_table_index, or l2_table_index) +// +// InputACLSetInterface defines message 'input_acl_set_interface'. +type InputACLSetInterface struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + IP4TableIndex uint32 `binapi:"u32,name=ip4_table_index" json:"ip4_table_index,omitempty"` + IP6TableIndex uint32 `binapi:"u32,name=ip6_table_index" json:"ip6_table_index,omitempty"` + L2TableIndex uint32 `binapi:"u32,name=l2_table_index" json:"l2_table_index,omitempty"` + IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` +} + +func (m *InputACLSetInterface) Reset() { *m = InputACLSetInterface{} } +func (*InputACLSetInterface) GetMessageName() string { return "input_acl_set_interface" } +func (*InputACLSetInterface) GetCrcString() string { return "de7ad708" } +func (*InputACLSetInterface) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *InputACLSetInterface) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + size += 4 // m.IP4TableIndex + size += 4 // m.IP6TableIndex + size += 4 // m.L2TableIndex + size += 1 // m.IsAdd + return size +} +func (m *InputACLSetInterface) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeUint32(m.IP4TableIndex) + buf.EncodeUint32(m.IP6TableIndex) + buf.EncodeUint32(m.L2TableIndex) + buf.EncodeBool(m.IsAdd) + return buf.Bytes(), nil +} +func (m *InputACLSetInterface) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.IP4TableIndex = buf.DecodeUint32() + m.IP6TableIndex = buf.DecodeUint32() + m.L2TableIndex = buf.DecodeUint32() + m.IsAdd = buf.DecodeBool() + return nil +} + +// InputACLSetInterfaceReply defines message 'input_acl_set_interface_reply'. +type InputACLSetInterfaceReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *InputACLSetInterfaceReply) Reset() { *m = InputACLSetInterfaceReply{} } +func (*InputACLSetInterfaceReply) GetMessageName() string { return "input_acl_set_interface_reply" } +func (*InputACLSetInterfaceReply) GetCrcString() string { return "e8d4e804" } +func (*InputACLSetInterfaceReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *InputACLSetInterfaceReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *InputACLSetInterfaceReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *InputACLSetInterfaceReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + +// Set/unset output ACL interface +// - sw_if_index - interface to set/unset output ACL +// - ip4_table_index - ip4 classify table index (~0 for skip) +// - ip6_table_index - ip6 classify table index (~0 for skip) +// - l2_table_index - l2 classify table index (~0 for skip) +// - is_add - Set output ACL if non-zero, else unset +// Note: User is recommended to use just one valid table_index per call. +// (ip4_table_index, ip6_table_index, or l2_table_index) +// +// OutputACLSetInterface defines message 'output_acl_set_interface'. +type OutputACLSetInterface struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + IP4TableIndex uint32 `binapi:"u32,name=ip4_table_index" json:"ip4_table_index,omitempty"` + IP6TableIndex uint32 `binapi:"u32,name=ip6_table_index" json:"ip6_table_index,omitempty"` + L2TableIndex uint32 `binapi:"u32,name=l2_table_index" json:"l2_table_index,omitempty"` + IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` +} + +func (m *OutputACLSetInterface) Reset() { *m = OutputACLSetInterface{} } +func (*OutputACLSetInterface) GetMessageName() string { return "output_acl_set_interface" } +func (*OutputACLSetInterface) GetCrcString() string { return "de7ad708" } +func (*OutputACLSetInterface) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *OutputACLSetInterface) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + size += 4 // m.IP4TableIndex + size += 4 // m.IP6TableIndex + size += 4 // m.L2TableIndex + size += 1 // m.IsAdd + return size +} +func (m *OutputACLSetInterface) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeUint32(m.IP4TableIndex) + buf.EncodeUint32(m.IP6TableIndex) + buf.EncodeUint32(m.L2TableIndex) + buf.EncodeBool(m.IsAdd) + return buf.Bytes(), nil +} +func (m *OutputACLSetInterface) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.IP4TableIndex = buf.DecodeUint32() + m.IP6TableIndex = buf.DecodeUint32() + m.L2TableIndex = buf.DecodeUint32() + m.IsAdd = buf.DecodeBool() + return nil +} + +// OutputACLSetInterfaceReply defines message 'output_acl_set_interface_reply'. +type OutputACLSetInterfaceReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *OutputACLSetInterfaceReply) Reset() { *m = OutputACLSetInterfaceReply{} } +func (*OutputACLSetInterfaceReply) GetMessageName() string { return "output_acl_set_interface_reply" } +func (*OutputACLSetInterfaceReply) GetCrcString() string { return "e8d4e804" } +func (*OutputACLSetInterfaceReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *OutputACLSetInterfaceReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *OutputACLSetInterfaceReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *OutputACLSetInterfaceReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + +// Policer classify operational state response. +// - sw_if_index - software interface index +// - table_index - classify table index +// +// PolicerClassifyDetails defines message 'policer_classify_details'. +type PolicerClassifyDetails struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + TableIndex uint32 `binapi:"u32,name=table_index" json:"table_index,omitempty"` +} + +func (m *PolicerClassifyDetails) Reset() { *m = PolicerClassifyDetails{} } +func (*PolicerClassifyDetails) GetMessageName() string { return "policer_classify_details" } +func (*PolicerClassifyDetails) GetCrcString() string { return "dfd08765" } +func (*PolicerClassifyDetails) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *PolicerClassifyDetails) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + size += 4 // m.TableIndex + return size +} +func (m *PolicerClassifyDetails) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeUint32(m.TableIndex) + return buf.Bytes(), nil +} +func (m *PolicerClassifyDetails) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.TableIndex = buf.DecodeUint32() + return nil +} + +// Get list of policer classify interfaces and tables +// - type - classify table type +// - sw_if_index - filter on sw_if_index +// +// PolicerClassifyDump defines message 'policer_classify_dump'. +type PolicerClassifyDump struct { + Type PolicerClassifyTable `binapi:"policer_classify_table,name=type" json:"type,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` +} + +func (m *PolicerClassifyDump) Reset() { *m = PolicerClassifyDump{} } +func (*PolicerClassifyDump) GetMessageName() string { return "policer_classify_dump" } +func (*PolicerClassifyDump) GetCrcString() string { return "56cbb5fb" } +func (*PolicerClassifyDump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *PolicerClassifyDump) Size() (size int) { + if m == nil { + return 0 + } + size += 1 // m.Type + size += 4 // m.SwIfIndex + return size +} +func (m *PolicerClassifyDump) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint8(uint8(m.Type)) + buf.EncodeUint32(uint32(m.SwIfIndex)) + return buf.Bytes(), nil +} +func (m *PolicerClassifyDump) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Type = PolicerClassifyTable(buf.DecodeUint8()) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + return nil +} + +// Set/unset policer classify interface +// - sw_if_index - interface to set/unset policer classify +// - ip4_table_index - ip4 classify table index (~0 for skip) +// - ip6_table_index - ip6 classify table index (~0 for skip) +// - l2_table_index - l2 classify table index (~0 for skip) +// - is_add - Set if non-zero, else unset +// Note: User is recommended to use just one valid table_index per call. +// (ip4_table_index, ip6_table_index, or l2_table_index) +// +// PolicerClassifySetInterface defines message 'policer_classify_set_interface'. +type PolicerClassifySetInterface struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + IP4TableIndex uint32 `binapi:"u32,name=ip4_table_index" json:"ip4_table_index,omitempty"` + IP6TableIndex uint32 `binapi:"u32,name=ip6_table_index" json:"ip6_table_index,omitempty"` + L2TableIndex uint32 `binapi:"u32,name=l2_table_index" json:"l2_table_index,omitempty"` + IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` +} + +func (m *PolicerClassifySetInterface) Reset() { *m = PolicerClassifySetInterface{} } +func (*PolicerClassifySetInterface) GetMessageName() string { return "policer_classify_set_interface" } +func (*PolicerClassifySetInterface) GetCrcString() string { return "de7ad708" } +func (*PolicerClassifySetInterface) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *PolicerClassifySetInterface) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + size += 4 // m.IP4TableIndex + size += 4 // m.IP6TableIndex + size += 4 // m.L2TableIndex + size += 1 // m.IsAdd + return size +} +func (m *PolicerClassifySetInterface) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeUint32(m.IP4TableIndex) + buf.EncodeUint32(m.IP6TableIndex) + buf.EncodeUint32(m.L2TableIndex) + buf.EncodeBool(m.IsAdd) + return buf.Bytes(), nil +} +func (m *PolicerClassifySetInterface) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.IP4TableIndex = buf.DecodeUint32() + m.IP6TableIndex = buf.DecodeUint32() + m.L2TableIndex = buf.DecodeUint32() + m.IsAdd = buf.DecodeBool() + return nil +} + +// PolicerClassifySetInterfaceReply defines message 'policer_classify_set_interface_reply'. +type PolicerClassifySetInterfaceReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *PolicerClassifySetInterfaceReply) Reset() { *m = PolicerClassifySetInterfaceReply{} } +func (*PolicerClassifySetInterfaceReply) GetMessageName() string { + return "policer_classify_set_interface_reply" +} +func (*PolicerClassifySetInterfaceReply) GetCrcString() string { return "e8d4e804" } +func (*PolicerClassifySetInterfaceReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *PolicerClassifySetInterfaceReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *PolicerClassifySetInterfaceReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *PolicerClassifySetInterfaceReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + +// Add/del punt ACL +// - ip4_table_index - ip4 punt classify table index (~0 for skip) +// - ip6_table_index - ip6 punt classify table index (~0 for skip) +// - is_add - add punt ACL if non-zero, else delete +// +// PuntACLAddDel defines message 'punt_acl_add_del'. +type PuntACLAddDel struct { + IP4TableIndex uint32 `binapi:"u32,name=ip4_table_index,default=4294967295" json:"ip4_table_index,omitempty"` + IP6TableIndex uint32 `binapi:"u32,name=ip6_table_index,default=4294967295" json:"ip6_table_index,omitempty"` + IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` +} + +func (m *PuntACLAddDel) Reset() { *m = PuntACLAddDel{} } +func (*PuntACLAddDel) GetMessageName() string { return "punt_acl_add_del" } +func (*PuntACLAddDel) GetCrcString() string { return "a93bf3a0" } +func (*PuntACLAddDel) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *PuntACLAddDel) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.IP4TableIndex + size += 4 // m.IP6TableIndex + size += 1 // m.IsAdd + return size +} +func (m *PuntACLAddDel) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.IP4TableIndex) + buf.EncodeUint32(m.IP6TableIndex) + buf.EncodeBool(m.IsAdd) + return buf.Bytes(), nil +} +func (m *PuntACLAddDel) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.IP4TableIndex = buf.DecodeUint32() + m.IP6TableIndex = buf.DecodeUint32() + m.IsAdd = buf.DecodeBool() + return nil +} + +// PuntACLAddDelReply defines message 'punt_acl_add_del_reply'. +type PuntACLAddDelReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *PuntACLAddDelReply) Reset() { *m = PuntACLAddDelReply{} } +func (*PuntACLAddDelReply) GetMessageName() string { return "punt_acl_add_del_reply" } +func (*PuntACLAddDelReply) GetCrcString() string { return "e8d4e804" } +func (*PuntACLAddDelReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *PuntACLAddDelReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *PuntACLAddDelReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *PuntACLAddDelReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + +// Get classify table ids configured for punt ACL +// PuntACLGet defines message 'punt_acl_get'. +type PuntACLGet struct{} + +func (m *PuntACLGet) Reset() { *m = PuntACLGet{} } +func (*PuntACLGet) GetMessageName() string { return "punt_acl_get" } +func (*PuntACLGet) GetCrcString() string { return "51077d14" } +func (*PuntACLGet) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *PuntACLGet) Size() (size int) { + if m == nil { + return 0 + } + return size +} +func (m *PuntACLGet) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + return buf.Bytes(), nil +} +func (m *PuntACLGet) Unmarshal(b []byte) error { + return nil +} + +// Reply for punt_acl_get +// - retval - return value (0 for success) +// - ip4_table_index - ip4 punt classify table index (~0 for none) +// - ip6_table_index - ip6 punt classify table index (~0 for none) +// +// PuntACLGetReply defines message 'punt_acl_get_reply'. +type PuntACLGetReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + IP4TableIndex uint32 `binapi:"u32,name=ip4_table_index" json:"ip4_table_index,omitempty"` + IP6TableIndex uint32 `binapi:"u32,name=ip6_table_index" json:"ip6_table_index,omitempty"` +} + +func (m *PuntACLGetReply) Reset() { *m = PuntACLGetReply{} } +func (*PuntACLGetReply) GetMessageName() string { return "punt_acl_get_reply" } +func (*PuntACLGetReply) GetCrcString() string { return "8409b9dd" } +func (*PuntACLGetReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *PuntACLGetReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.IP4TableIndex + size += 4 // m.IP6TableIndex + return size +} +func (m *PuntACLGetReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.IP4TableIndex) + buf.EncodeUint32(m.IP6TableIndex) + return buf.Bytes(), nil +} +func (m *PuntACLGetReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.IP4TableIndex = buf.DecodeUint32() + m.IP6TableIndex = buf.DecodeUint32() + return nil +} + +func init() { file_classify_binapi_init() } +func file_classify_binapi_init() { + api.RegisterMessage((*ClassifyAddDelSession)(nil), "classify_add_del_session_f20879f0") + api.RegisterMessage((*ClassifyAddDelSessionReply)(nil), "classify_add_del_session_reply_e8d4e804") + api.RegisterMessage((*ClassifyAddDelTable)(nil), "classify_add_del_table_6849e39e") + api.RegisterMessage((*ClassifyAddDelTableReply)(nil), "classify_add_del_table_reply_05486349") + api.RegisterMessage((*ClassifyPcapGetTables)(nil), "classify_pcap_get_tables_f9e6675e") + api.RegisterMessage((*ClassifyPcapGetTablesReply)(nil), "classify_pcap_get_tables_reply_5f5bc9e6") + api.RegisterMessage((*ClassifyPcapLookupTable)(nil), "classify_pcap_lookup_table_e1b4cc6b") + api.RegisterMessage((*ClassifyPcapLookupTableReply)(nil), "classify_pcap_lookup_table_reply_9c6c6773") + api.RegisterMessage((*ClassifyPcapSetTable)(nil), "classify_pcap_set_table_006051b3") + api.RegisterMessage((*ClassifyPcapSetTableReply)(nil), "classify_pcap_set_table_reply_9c6c6773") + api.RegisterMessage((*ClassifySessionDetails)(nil), "classify_session_details_60e3ef94") + api.RegisterMessage((*ClassifySessionDump)(nil), "classify_session_dump_0cca2cd9") + api.RegisterMessage((*ClassifySetInterfaceIPTable)(nil), "classify_set_interface_ip_table_e0b097c7") + api.RegisterMessage((*ClassifySetInterfaceIPTableReply)(nil), "classify_set_interface_ip_table_reply_e8d4e804") + api.RegisterMessage((*ClassifySetInterfaceL2Tables)(nil), "classify_set_interface_l2_tables_5a6ddf65") + api.RegisterMessage((*ClassifySetInterfaceL2TablesReply)(nil), "classify_set_interface_l2_tables_reply_e8d4e804") + api.RegisterMessage((*ClassifyTableByInterface)(nil), "classify_table_by_interface_f9e6675e") + api.RegisterMessage((*ClassifyTableByInterfaceReply)(nil), "classify_table_by_interface_reply_ed4197db") + api.RegisterMessage((*ClassifyTableIds)(nil), "classify_table_ids_51077d14") + api.RegisterMessage((*ClassifyTableIdsReply)(nil), "classify_table_ids_reply_d1d20e1d") + api.RegisterMessage((*ClassifyTableInfo)(nil), "classify_table_info_0cca2cd9") + api.RegisterMessage((*ClassifyTableInfoReply)(nil), "classify_table_info_reply_4a573c0e") + api.RegisterMessage((*ClassifyTraceGetTables)(nil), "classify_trace_get_tables_51077d14") + api.RegisterMessage((*ClassifyTraceGetTablesReply)(nil), "classify_trace_get_tables_reply_5f5bc9e6") + api.RegisterMessage((*ClassifyTraceLookupTable)(nil), "classify_trace_lookup_table_3f7b72e4") + api.RegisterMessage((*ClassifyTraceLookupTableReply)(nil), "classify_trace_lookup_table_reply_9c6c6773") + api.RegisterMessage((*ClassifyTraceSetTable)(nil), "classify_trace_set_table_3909b55a") + api.RegisterMessage((*ClassifyTraceSetTableReply)(nil), "classify_trace_set_table_reply_9c6c6773") + api.RegisterMessage((*FlowClassifyDetails)(nil), "flow_classify_details_dfd08765") + api.RegisterMessage((*FlowClassifyDump)(nil), "flow_classify_dump_25dd3e4c") + api.RegisterMessage((*FlowClassifySetInterface)(nil), "flow_classify_set_interface_b6192f1c") + api.RegisterMessage((*FlowClassifySetInterfaceReply)(nil), "flow_classify_set_interface_reply_e8d4e804") + api.RegisterMessage((*InputACLSetInterface)(nil), "input_acl_set_interface_de7ad708") + api.RegisterMessage((*InputACLSetInterfaceReply)(nil), "input_acl_set_interface_reply_e8d4e804") + api.RegisterMessage((*OutputACLSetInterface)(nil), "output_acl_set_interface_de7ad708") + api.RegisterMessage((*OutputACLSetInterfaceReply)(nil), "output_acl_set_interface_reply_e8d4e804") + api.RegisterMessage((*PolicerClassifyDetails)(nil), "policer_classify_details_dfd08765") + api.RegisterMessage((*PolicerClassifyDump)(nil), "policer_classify_dump_56cbb5fb") + api.RegisterMessage((*PolicerClassifySetInterface)(nil), "policer_classify_set_interface_de7ad708") + api.RegisterMessage((*PolicerClassifySetInterfaceReply)(nil), "policer_classify_set_interface_reply_e8d4e804") + api.RegisterMessage((*PuntACLAddDel)(nil), "punt_acl_add_del_a93bf3a0") + api.RegisterMessage((*PuntACLAddDelReply)(nil), "punt_acl_add_del_reply_e8d4e804") + api.RegisterMessage((*PuntACLGet)(nil), "punt_acl_get_51077d14") + api.RegisterMessage((*PuntACLGetReply)(nil), "punt_acl_get_reply_8409b9dd") +} + +// Messages returns list of all messages in this module. +func AllMessages() []api.Message { + return []api.Message{ + (*ClassifyAddDelSession)(nil), + (*ClassifyAddDelSessionReply)(nil), + (*ClassifyAddDelTable)(nil), + (*ClassifyAddDelTableReply)(nil), + (*ClassifyPcapGetTables)(nil), + (*ClassifyPcapGetTablesReply)(nil), + (*ClassifyPcapLookupTable)(nil), + (*ClassifyPcapLookupTableReply)(nil), + (*ClassifyPcapSetTable)(nil), + (*ClassifyPcapSetTableReply)(nil), + (*ClassifySessionDetails)(nil), + (*ClassifySessionDump)(nil), + (*ClassifySetInterfaceIPTable)(nil), + (*ClassifySetInterfaceIPTableReply)(nil), + (*ClassifySetInterfaceL2Tables)(nil), + (*ClassifySetInterfaceL2TablesReply)(nil), + (*ClassifyTableByInterface)(nil), + (*ClassifyTableByInterfaceReply)(nil), + (*ClassifyTableIds)(nil), + (*ClassifyTableIdsReply)(nil), + (*ClassifyTableInfo)(nil), + (*ClassifyTableInfoReply)(nil), + (*ClassifyTraceGetTables)(nil), + (*ClassifyTraceGetTablesReply)(nil), + (*ClassifyTraceLookupTable)(nil), + (*ClassifyTraceLookupTableReply)(nil), + (*ClassifyTraceSetTable)(nil), + (*ClassifyTraceSetTableReply)(nil), + (*FlowClassifyDetails)(nil), + (*FlowClassifyDump)(nil), + (*FlowClassifySetInterface)(nil), + (*FlowClassifySetInterfaceReply)(nil), + (*InputACLSetInterface)(nil), + (*InputACLSetInterfaceReply)(nil), + (*OutputACLSetInterface)(nil), + (*OutputACLSetInterfaceReply)(nil), + (*PolicerClassifyDetails)(nil), + (*PolicerClassifyDump)(nil), + (*PolicerClassifySetInterface)(nil), + (*PolicerClassifySetInterfaceReply)(nil), + (*PuntACLAddDel)(nil), + (*PuntACLAddDelReply)(nil), + (*PuntACLGet)(nil), + (*PuntACLGetReply)(nil), + } +} diff --git a/vpplink/generated/bindings/classify/classify_rpc.ba.go b/vpplink/generated/bindings/classify/classify_rpc.ba.go new file mode 100644 index 000000000..71b2b1637 --- /dev/null +++ b/vpplink/generated/bindings/classify/classify_rpc.ba.go @@ -0,0 +1,346 @@ +// Code generated by GoVPP's binapi-generator. DO NOT EDIT. + +package classify + +import ( + "context" + "fmt" + "io" + + memclnt "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/memclnt" + api "go.fd.io/govpp/api" +) + +// RPCService defines RPC service classify. +type RPCService interface { + ClassifyAddDelSession(ctx context.Context, in *ClassifyAddDelSession) (*ClassifyAddDelSessionReply, error) + ClassifyAddDelTable(ctx context.Context, in *ClassifyAddDelTable) (*ClassifyAddDelTableReply, error) + ClassifyPcapGetTables(ctx context.Context, in *ClassifyPcapGetTables) (*ClassifyPcapGetTablesReply, error) + ClassifyPcapLookupTable(ctx context.Context, in *ClassifyPcapLookupTable) (*ClassifyPcapLookupTableReply, error) + ClassifyPcapSetTable(ctx context.Context, in *ClassifyPcapSetTable) (*ClassifyPcapSetTableReply, error) + ClassifySessionDump(ctx context.Context, in *ClassifySessionDump) (RPCService_ClassifySessionDumpClient, error) + ClassifySetInterfaceIPTable(ctx context.Context, in *ClassifySetInterfaceIPTable) (*ClassifySetInterfaceIPTableReply, error) + ClassifySetInterfaceL2Tables(ctx context.Context, in *ClassifySetInterfaceL2Tables) (*ClassifySetInterfaceL2TablesReply, error) + ClassifyTableByInterface(ctx context.Context, in *ClassifyTableByInterface) (*ClassifyTableByInterfaceReply, error) + ClassifyTableIds(ctx context.Context, in *ClassifyTableIds) (*ClassifyTableIdsReply, error) + ClassifyTableInfo(ctx context.Context, in *ClassifyTableInfo) (*ClassifyTableInfoReply, error) + ClassifyTraceGetTables(ctx context.Context, in *ClassifyTraceGetTables) (*ClassifyTraceGetTablesReply, error) + ClassifyTraceLookupTable(ctx context.Context, in *ClassifyTraceLookupTable) (*ClassifyTraceLookupTableReply, error) + ClassifyTraceSetTable(ctx context.Context, in *ClassifyTraceSetTable) (*ClassifyTraceSetTableReply, error) + FlowClassifyDump(ctx context.Context, in *FlowClassifyDump) (RPCService_FlowClassifyDumpClient, error) + FlowClassifySetInterface(ctx context.Context, in *FlowClassifySetInterface) (*FlowClassifySetInterfaceReply, error) + InputACLSetInterface(ctx context.Context, in *InputACLSetInterface) (*InputACLSetInterfaceReply, error) + OutputACLSetInterface(ctx context.Context, in *OutputACLSetInterface) (*OutputACLSetInterfaceReply, error) + PolicerClassifyDump(ctx context.Context, in *PolicerClassifyDump) (RPCService_PolicerClassifyDumpClient, error) + PolicerClassifySetInterface(ctx context.Context, in *PolicerClassifySetInterface) (*PolicerClassifySetInterfaceReply, error) + PuntACLAddDel(ctx context.Context, in *PuntACLAddDel) (*PuntACLAddDelReply, error) + PuntACLGet(ctx context.Context, in *PuntACLGet) (*PuntACLGetReply, error) +} + +type serviceClient struct { + conn api.Connection +} + +func NewServiceClient(conn api.Connection) RPCService { + return &serviceClient{conn} +} + +func (c *serviceClient) ClassifyAddDelSession(ctx context.Context, in *ClassifyAddDelSession) (*ClassifyAddDelSessionReply, error) { + out := new(ClassifyAddDelSessionReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) ClassifyAddDelTable(ctx context.Context, in *ClassifyAddDelTable) (*ClassifyAddDelTableReply, error) { + out := new(ClassifyAddDelTableReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) ClassifyPcapGetTables(ctx context.Context, in *ClassifyPcapGetTables) (*ClassifyPcapGetTablesReply, error) { + out := new(ClassifyPcapGetTablesReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) ClassifyPcapLookupTable(ctx context.Context, in *ClassifyPcapLookupTable) (*ClassifyPcapLookupTableReply, error) { + out := new(ClassifyPcapLookupTableReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) ClassifyPcapSetTable(ctx context.Context, in *ClassifyPcapSetTable) (*ClassifyPcapSetTableReply, error) { + out := new(ClassifyPcapSetTableReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) ClassifySessionDump(ctx context.Context, in *ClassifySessionDump) (RPCService_ClassifySessionDumpClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_ClassifySessionDumpClient{stream} + if err := x.Stream.SendMsg(in); err != nil { + return nil, err + } + if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil { + return nil, err + } + return x, nil +} + +type RPCService_ClassifySessionDumpClient interface { + Recv() (*ClassifySessionDetails, error) + api.Stream +} + +type serviceClient_ClassifySessionDumpClient struct { + api.Stream +} + +func (c *serviceClient_ClassifySessionDumpClient) Recv() (*ClassifySessionDetails, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *ClassifySessionDetails: + return m, nil + case *memclnt.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } + return nil, io.EOF + default: + return nil, fmt.Errorf("unexpected message: %T %v", m, m) + } +} + +func (c *serviceClient) ClassifySetInterfaceIPTable(ctx context.Context, in *ClassifySetInterfaceIPTable) (*ClassifySetInterfaceIPTableReply, error) { + out := new(ClassifySetInterfaceIPTableReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) ClassifySetInterfaceL2Tables(ctx context.Context, in *ClassifySetInterfaceL2Tables) (*ClassifySetInterfaceL2TablesReply, error) { + out := new(ClassifySetInterfaceL2TablesReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) ClassifyTableByInterface(ctx context.Context, in *ClassifyTableByInterface) (*ClassifyTableByInterfaceReply, error) { + out := new(ClassifyTableByInterfaceReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) ClassifyTableIds(ctx context.Context, in *ClassifyTableIds) (*ClassifyTableIdsReply, error) { + out := new(ClassifyTableIdsReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) ClassifyTableInfo(ctx context.Context, in *ClassifyTableInfo) (*ClassifyTableInfoReply, error) { + out := new(ClassifyTableInfoReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) ClassifyTraceGetTables(ctx context.Context, in *ClassifyTraceGetTables) (*ClassifyTraceGetTablesReply, error) { + out := new(ClassifyTraceGetTablesReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) ClassifyTraceLookupTable(ctx context.Context, in *ClassifyTraceLookupTable) (*ClassifyTraceLookupTableReply, error) { + out := new(ClassifyTraceLookupTableReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) ClassifyTraceSetTable(ctx context.Context, in *ClassifyTraceSetTable) (*ClassifyTraceSetTableReply, error) { + out := new(ClassifyTraceSetTableReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) FlowClassifyDump(ctx context.Context, in *FlowClassifyDump) (RPCService_FlowClassifyDumpClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_FlowClassifyDumpClient{stream} + if err := x.Stream.SendMsg(in); err != nil { + return nil, err + } + if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil { + return nil, err + } + return x, nil +} + +type RPCService_FlowClassifyDumpClient interface { + Recv() (*FlowClassifyDetails, error) + api.Stream +} + +type serviceClient_FlowClassifyDumpClient struct { + api.Stream +} + +func (c *serviceClient_FlowClassifyDumpClient) Recv() (*FlowClassifyDetails, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *FlowClassifyDetails: + return m, nil + case *memclnt.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } + return nil, io.EOF + default: + return nil, fmt.Errorf("unexpected message: %T %v", m, m) + } +} + +func (c *serviceClient) FlowClassifySetInterface(ctx context.Context, in *FlowClassifySetInterface) (*FlowClassifySetInterfaceReply, error) { + out := new(FlowClassifySetInterfaceReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) InputACLSetInterface(ctx context.Context, in *InputACLSetInterface) (*InputACLSetInterfaceReply, error) { + out := new(InputACLSetInterfaceReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) OutputACLSetInterface(ctx context.Context, in *OutputACLSetInterface) (*OutputACLSetInterfaceReply, error) { + out := new(OutputACLSetInterfaceReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) PolicerClassifyDump(ctx context.Context, in *PolicerClassifyDump) (RPCService_PolicerClassifyDumpClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_PolicerClassifyDumpClient{stream} + if err := x.Stream.SendMsg(in); err != nil { + return nil, err + } + if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil { + return nil, err + } + return x, nil +} + +type RPCService_PolicerClassifyDumpClient interface { + Recv() (*PolicerClassifyDetails, error) + api.Stream +} + +type serviceClient_PolicerClassifyDumpClient struct { + api.Stream +} + +func (c *serviceClient_PolicerClassifyDumpClient) Recv() (*PolicerClassifyDetails, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *PolicerClassifyDetails: + return m, nil + case *memclnt.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } + return nil, io.EOF + default: + return nil, fmt.Errorf("unexpected message: %T %v", m, m) + } +} + +func (c *serviceClient) PolicerClassifySetInterface(ctx context.Context, in *PolicerClassifySetInterface) (*PolicerClassifySetInterfaceReply, error) { + out := new(PolicerClassifySetInterfaceReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) PuntACLAddDel(ctx context.Context, in *PuntACLAddDel) (*PuntACLAddDelReply, error) { + out := new(PuntACLAddDelReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) PuntACLGet(ctx context.Context, in *PuntACLGet) (*PuntACLGetReply, error) { + out := new(PuntACLGetReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} diff --git a/vpplink/generated/bindings/cnat/cnat.ba.go b/vpplink/generated/bindings/cnat/cnat.ba.go index a9b0a8a48..7ff03f3c7 100644 --- a/vpplink/generated/bindings/cnat/cnat.ba.go +++ b/vpplink/generated/bindings/cnat/cnat.ba.go @@ -4,16 +4,19 @@ // // Contents: // - 5 enums -// - 4 structs -// - 20 messages +// - 5 structs +// - 26 messages package cnat import ( "strconv" + _ "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/ethernet_types" _ "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/fib_types" interface_types "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/interface_types" + ip "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/ip" ip_types "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/ip_types" + _ "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/mfib_types" api "go.fd.io/govpp/api" codec "go.fd.io/govpp/codec" ) @@ -26,23 +29,23 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "cnat" - APIVersion = "0.2.0" - VersionCrc = 0xfd05573b + APIVersion = "0.3.0" + VersionCrc = 0xfccc89cf ) // CnatEndpointTupleFlags defines enum 'cnat_endpoint_tuple_flags'. type CnatEndpointTupleFlags uint8 const ( - CNAT_EPT_NO_NAT CnatEndpointTupleFlags = 1 + CNAT_EPT_NO_NAT CnatEndpointTupleFlags = 2 ) var ( CnatEndpointTupleFlags_name = map[uint8]string{ - 1: "CNAT_EPT_NO_NAT", + 2: "CNAT_EPT_NO_NAT", } CnatEndpointTupleFlags_value = map[string]uint8{ - "CNAT_EPT_NO_NAT": 1, + "CNAT_EPT_NO_NAT": 2, } ) @@ -137,6 +140,7 @@ const ( CNAT_POLICY_INCLUDE_V4 CnatSnatPolicyTable = 0 CNAT_POLICY_INCLUDE_V6 CnatSnatPolicyTable = 1 CNAT_POLICY_POD CnatSnatPolicyTable = 2 + CNAT_POLICY_HOST CnatSnatPolicyTable = 3 ) var ( @@ -144,11 +148,13 @@ var ( 0: "CNAT_POLICY_INCLUDE_V4", 1: "CNAT_POLICY_INCLUDE_V6", 2: "CNAT_POLICY_POD", + 3: "CNAT_POLICY_HOST", } CnatSnatPolicyTable_value = map[string]uint8{ "CNAT_POLICY_INCLUDE_V4": 0, "CNAT_POLICY_INCLUDE_V6": 1, "CNAT_POLICY_POD": 2, + "CNAT_POLICY_HOST": 3, } ) @@ -164,15 +170,21 @@ func (x CnatSnatPolicyTable) String() string { type CnatTranslationFlags uint8 const ( - CNAT_TRANSLATION_ALLOC_PORT CnatTranslationFlags = 1 + CNAT_TRANSLATION_ALLOC_PORT CnatTranslationFlags = 1 + CNAT_TRANSLATION_NO_RETURN_SESSION CnatTranslationFlags = 4 + CNAT_TRANSLATION_NO_CLIENT CnatTranslationFlags = 8 ) var ( CnatTranslationFlags_name = map[uint8]string{ 1: "CNAT_TRANSLATION_ALLOC_PORT", + 4: "CNAT_TRANSLATION_NO_RETURN_SESSION", + 8: "CNAT_TRANSLATION_NO_CLIENT", } CnatTranslationFlags_value = map[string]uint8{ - "CNAT_TRANSLATION_ALLOC_PORT": 1, + "CNAT_TRANSLATION_ALLOC_PORT": 1, + "CNAT_TRANSLATION_NO_RETURN_SESSION": 4, + "CNAT_TRANSLATION_NO_CLIENT": 8, } ) @@ -203,6 +215,13 @@ func (x CnatTranslationFlags) String() string { return s } +// Cnat5tuple defines type 'cnat_5tuple'. +type Cnat5tuple struct { + Addr [2]ip_types.Address `binapi:"address[2],name=addr" json:"addr,omitempty"` + Port []uint16 `binapi:"u16[2],name=port" json:"port,omitempty"` + IPProto ip_types.IPProto `binapi:"ip_proto,name=ip_proto" json:"ip_proto,omitempty"` +} + // CnatEndpoint defines type 'cnat_endpoint'. type CnatEndpoint struct { Addr ip_types.Address `binapi:"address,name=addr" json:"addr,omitempty"` @@ -220,24 +239,22 @@ type CnatEndpointTuple struct { // CnatSession defines type 'cnat_session'. type CnatSession struct { - Src CnatEndpoint `binapi:"cnat_endpoint,name=src" json:"src,omitempty"` - Dst CnatEndpoint `binapi:"cnat_endpoint,name=dst" json:"dst,omitempty"` - New CnatEndpoint `binapi:"cnat_endpoint,name=new" json:"new,omitempty"` - IPProto ip_types.IPProto `binapi:"ip_proto,name=ip_proto" json:"ip_proto,omitempty"` - Location uint8 `binapi:"u8,name=location" json:"location,omitempty"` - Timestamp float64 `binapi:"f64,name=timestamp" json:"timestamp,omitempty"` + Tuple Cnat5tuple `binapi:"cnat_5tuple,name=tuple" json:"tuple,omitempty"` + TsIndex uint32 `binapi:"u32,name=ts_index" json:"ts_index,omitempty"` + Flags uint32 `binapi:"u32,name=flags" json:"flags,omitempty"` } // CnatTranslation defines type 'cnat_translation'. type CnatTranslation struct { - Vip CnatEndpoint `binapi:"cnat_endpoint,name=vip" json:"vip,omitempty"` - ID uint32 `binapi:"u32,name=id" json:"id,omitempty"` - IPProto ip_types.IPProto `binapi:"ip_proto,name=ip_proto" json:"ip_proto,omitempty"` - IsRealIP uint8 `binapi:"u8,name=is_real_ip" json:"is_real_ip,omitempty"` - Flags uint8 `binapi:"u8,name=flags" json:"flags,omitempty"` - LbType CnatLbType `binapi:"cnat_lb_type,name=lb_type" json:"lb_type,omitempty"` - NPaths uint32 `binapi:"u32,name=n_paths" json:"-"` - Paths []CnatEndpointTuple `binapi:"cnat_endpoint_tuple[n_paths],name=paths" json:"paths,omitempty"` + Vip CnatEndpoint `binapi:"cnat_endpoint,name=vip" json:"vip,omitempty"` + ID uint32 `binapi:"u32,name=id" json:"id,omitempty"` + IPProto ip_types.IPProto `binapi:"ip_proto,name=ip_proto" json:"ip_proto,omitempty"` + IsRealIP uint8 `binapi:"u8,name=is_real_ip" json:"is_real_ip,omitempty"` + Flags uint8 `binapi:"u8,name=flags" json:"flags,omitempty"` + LbType CnatLbType `binapi:"cnat_lb_type,name=lb_type" json:"lb_type,omitempty"` + NPaths uint32 `binapi:"u32,name=n_paths" json:"-"` + FlowHashConfig ip.IPFlowHashConfigV2 `binapi:"ip_flow_hash_config_v2,name=flow_hash_config" json:"flow_hash_config,omitempty"` + Paths []CnatEndpointTuple `binapi:"cnat_endpoint_tuple[n_paths],name=paths" json:"paths,omitempty"` } // CnatGetSnatAddresses defines message 'cnat_get_snat_addresses'. @@ -323,7 +340,7 @@ type CnatSessionDetails struct { func (m *CnatSessionDetails) Reset() { *m = CnatSessionDetails{} } func (*CnatSessionDetails) GetMessageName() string { return "cnat_session_details" } -func (*CnatSessionDetails) GetCrcString() string { return "7e5017c7" } +func (*CnatSessionDetails) GetCrcString() string { return "7a78bf3f" } func (*CnatSessionDetails) GetMessageType() api.MessageType { return api.ReplyMessage } @@ -332,24 +349,14 @@ func (m *CnatSessionDetails) Size() (size int) { if m == nil { return 0 } - size += 1 // m.Session.Src.Addr.Af - size += 1 * 16 // m.Session.Src.Addr.Un - size += 4 // m.Session.Src.SwIfIndex - size += 1 // m.Session.Src.IfAf - size += 2 // m.Session.Src.Port - size += 1 // m.Session.Dst.Addr.Af - size += 1 * 16 // m.Session.Dst.Addr.Un - size += 4 // m.Session.Dst.SwIfIndex - size += 1 // m.Session.Dst.IfAf - size += 2 // m.Session.Dst.Port - size += 1 // m.Session.New.Addr.Af - size += 1 * 16 // m.Session.New.Addr.Un - size += 4 // m.Session.New.SwIfIndex - size += 1 // m.Session.New.IfAf - size += 2 // m.Session.New.Port - size += 1 // m.Session.IPProto - size += 1 // m.Session.Location - size += 8 // m.Session.Timestamp + for j3 := 0; j3 < 2; j3++ { + size += 1 // m.Session.Tuple.Addr[j3].Af + size += 1 * 16 // m.Session.Tuple.Addr[j3].Un + } + size += 2 * 2 // m.Session.Tuple.Port + size += 1 // m.Session.Tuple.IPProto + size += 4 // m.Session.TsIndex + size += 4 // m.Session.Flags return size } func (m *CnatSessionDetails) Marshal(b []byte) ([]byte, error) { @@ -357,46 +364,35 @@ func (m *CnatSessionDetails) Marshal(b []byte) ([]byte, error) { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) - buf.EncodeUint8(uint8(m.Session.Src.Addr.Af)) - buf.EncodeBytes(m.Session.Src.Addr.Un.XXX_UnionData[:], 16) - buf.EncodeUint32(uint32(m.Session.Src.SwIfIndex)) - buf.EncodeUint8(uint8(m.Session.Src.IfAf)) - buf.EncodeUint16(m.Session.Src.Port) - buf.EncodeUint8(uint8(m.Session.Dst.Addr.Af)) - buf.EncodeBytes(m.Session.Dst.Addr.Un.XXX_UnionData[:], 16) - buf.EncodeUint32(uint32(m.Session.Dst.SwIfIndex)) - buf.EncodeUint8(uint8(m.Session.Dst.IfAf)) - buf.EncodeUint16(m.Session.Dst.Port) - buf.EncodeUint8(uint8(m.Session.New.Addr.Af)) - buf.EncodeBytes(m.Session.New.Addr.Un.XXX_UnionData[:], 16) - buf.EncodeUint32(uint32(m.Session.New.SwIfIndex)) - buf.EncodeUint8(uint8(m.Session.New.IfAf)) - buf.EncodeUint16(m.Session.New.Port) - buf.EncodeUint8(uint8(m.Session.IPProto)) - buf.EncodeUint8(m.Session.Location) - buf.EncodeFloat64(m.Session.Timestamp) + for j2 := 0; j2 < 2; j2++ { + buf.EncodeUint8(uint8(m.Session.Tuple.Addr[j2].Af)) + buf.EncodeBytes(m.Session.Tuple.Addr[j2].Un.XXX_UnionData[:], 16) + } + for i := 0; i < 2; i++ { + var x uint16 + if i < len(m.Session.Tuple.Port) { + x = uint16(m.Session.Tuple.Port[i]) + } + buf.EncodeUint16(x) + } + buf.EncodeUint8(uint8(m.Session.Tuple.IPProto)) + buf.EncodeUint32(m.Session.TsIndex) + buf.EncodeUint32(m.Session.Flags) return buf.Bytes(), nil } func (m *CnatSessionDetails) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Session.Src.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8()) - copy(m.Session.Src.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) - m.Session.Src.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) - m.Session.Src.IfAf = ip_types.AddressFamily(buf.DecodeUint8()) - m.Session.Src.Port = buf.DecodeUint16() - m.Session.Dst.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8()) - copy(m.Session.Dst.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) - m.Session.Dst.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) - m.Session.Dst.IfAf = ip_types.AddressFamily(buf.DecodeUint8()) - m.Session.Dst.Port = buf.DecodeUint16() - m.Session.New.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8()) - copy(m.Session.New.Addr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) - m.Session.New.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) - m.Session.New.IfAf = ip_types.AddressFamily(buf.DecodeUint8()) - m.Session.New.Port = buf.DecodeUint16() - m.Session.IPProto = ip_types.IPProto(buf.DecodeUint8()) - m.Session.Location = buf.DecodeUint8() - m.Session.Timestamp = buf.DecodeFloat64() + for j2 := 0; j2 < 2; j2++ { + m.Session.Tuple.Addr[j2].Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Session.Tuple.Addr[j2].Un.XXX_UnionData[:], buf.DecodeBytes(16)) + } + m.Session.Tuple.Port = make([]uint16, 2) + for i := 0; i < len(m.Session.Tuple.Port); i++ { + m.Session.Tuple.Port[i] = buf.DecodeUint16() + } + m.Session.Tuple.IPProto = ip_types.IPProto(buf.DecodeUint8()) + m.Session.TsIndex = buf.DecodeUint32() + m.Session.Flags = buf.DecodeUint32() return nil } @@ -492,11 +488,12 @@ type CnatSetSnatAddresses struct { SnatIP4 ip_types.IP4Address `binapi:"ip4_address,name=snat_ip4" json:"snat_ip4,omitempty"` SnatIP6 ip_types.IP6Address `binapi:"ip6_address,name=snat_ip6" json:"snat_ip6,omitempty"` SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + Flags CnatTranslationFlags `binapi:"cnat_translation_flags,name=flags" json:"flags,omitempty"` } func (m *CnatSetSnatAddresses) Reset() { *m = CnatSetSnatAddresses{} } func (*CnatSetSnatAddresses) GetMessageName() string { return "cnat_set_snat_addresses" } -func (*CnatSetSnatAddresses) GetCrcString() string { return "d997e96c" } +func (*CnatSetSnatAddresses) GetCrcString() string { return "e9472ed4" } func (*CnatSetSnatAddresses) GetMessageType() api.MessageType { return api.RequestMessage } @@ -508,6 +505,7 @@ func (m *CnatSetSnatAddresses) Size() (size int) { size += 1 * 4 // m.SnatIP4 size += 1 * 16 // m.SnatIP6 size += 4 // m.SwIfIndex + size += 1 // m.Flags return size } func (m *CnatSetSnatAddresses) Marshal(b []byte) ([]byte, error) { @@ -518,6 +516,7 @@ func (m *CnatSetSnatAddresses) Marshal(b []byte) ([]byte, error) { buf.EncodeBytes(m.SnatIP4[:], 4) buf.EncodeBytes(m.SnatIP6[:], 16) buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeUint8(uint8(m.Flags)) return buf.Bytes(), nil } func (m *CnatSetSnatAddresses) Unmarshal(b []byte) error { @@ -525,6 +524,7 @@ func (m *CnatSetSnatAddresses) Unmarshal(b []byte) error { copy(m.SnatIP4[:], buf.DecodeBytes(4)) copy(m.SnatIP6[:], buf.DecodeBytes(16)) m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.Flags = CnatTranslationFlags(buf.DecodeUint8()) return nil } @@ -628,6 +628,94 @@ func (m *CnatSetSnatPolicyReply) Unmarshal(b []byte) error { return nil } +// CnatSnatAddressesDetails defines message 'cnat_snat_addresses_details'. +type CnatSnatAddressesDetails struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + FwdTableID4 uint32 `binapi:"u32,name=fwd_table_id4" json:"fwd_table_id4,omitempty"` + FwdTableID6 uint32 `binapi:"u32,name=fwd_table_id6" json:"fwd_table_id6,omitempty"` + RetTableID4 uint32 `binapi:"u32,name=ret_table_id4" json:"ret_table_id4,omitempty"` + RetTableID6 uint32 `binapi:"u32,name=ret_table_id6" json:"ret_table_id6,omitempty"` + SnatIP4 ip_types.IP4Address `binapi:"ip4_address,name=snat_ip4" json:"snat_ip4,omitempty"` + SnatIP6 ip_types.IP6Address `binapi:"ip6_address,name=snat_ip6" json:"snat_ip6,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` +} + +func (m *CnatSnatAddressesDetails) Reset() { *m = CnatSnatAddressesDetails{} } +func (*CnatSnatAddressesDetails) GetMessageName() string { return "cnat_snat_addresses_details" } +func (*CnatSnatAddressesDetails) GetCrcString() string { return "09ae6b38" } +func (*CnatSnatAddressesDetails) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *CnatSnatAddressesDetails) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.FwdTableID4 + size += 4 // m.FwdTableID6 + size += 4 // m.RetTableID4 + size += 4 // m.RetTableID6 + size += 1 * 4 // m.SnatIP4 + size += 1 * 16 // m.SnatIP6 + size += 4 // m.SwIfIndex + return size +} +func (m *CnatSnatAddressesDetails) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.FwdTableID4) + buf.EncodeUint32(m.FwdTableID6) + buf.EncodeUint32(m.RetTableID4) + buf.EncodeUint32(m.RetTableID6) + buf.EncodeBytes(m.SnatIP4[:], 4) + buf.EncodeBytes(m.SnatIP6[:], 16) + buf.EncodeUint32(uint32(m.SwIfIndex)) + return buf.Bytes(), nil +} +func (m *CnatSnatAddressesDetails) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.FwdTableID4 = buf.DecodeUint32() + m.FwdTableID6 = buf.DecodeUint32() + m.RetTableID4 = buf.DecodeUint32() + m.RetTableID6 = buf.DecodeUint32() + copy(m.SnatIP4[:], buf.DecodeBytes(4)) + copy(m.SnatIP6[:], buf.DecodeBytes(16)) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + return nil +} + +// CnatSnatAddressesDump defines message 'cnat_snat_addresses_dump'. +type CnatSnatAddressesDump struct{} + +func (m *CnatSnatAddressesDump) Reset() { *m = CnatSnatAddressesDump{} } +func (*CnatSnatAddressesDump) GetMessageName() string { return "cnat_snat_addresses_dump" } +func (*CnatSnatAddressesDump) GetCrcString() string { return "51077d14" } +func (*CnatSnatAddressesDump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *CnatSnatAddressesDump) Size() (size int) { + if m == nil { + return 0 + } + return size +} +func (m *CnatSnatAddressesDump) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + return buf.Bytes(), nil +} +func (m *CnatSnatAddressesDump) Unmarshal(b []byte) error { + return nil +} + // CnatSnatPolicyAddDelExcludePfx defines message 'cnat_snat_policy_add_del_exclude_pfx'. type CnatSnatPolicyAddDelExcludePfx struct { IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"` @@ -717,7 +805,7 @@ type CnatSnatPolicyAddDelIf struct { func (m *CnatSnatPolicyAddDelIf) Reset() { *m = CnatSnatPolicyAddDelIf{} } func (*CnatSnatPolicyAddDelIf) GetMessageName() string { return "cnat_snat_policy_add_del_if" } -func (*CnatSnatPolicyAddDelIf) GetCrcString() string { return "6828deca" } +func (*CnatSnatPolicyAddDelIf) GetCrcString() string { return "4ebb8d02" } func (*CnatSnatPolicyAddDelIf) GetMessageType() api.MessageType { return api.RequestMessage } @@ -857,7 +945,7 @@ type CnatTranslationDetails struct { func (m *CnatTranslationDetails) Reset() { *m = CnatTranslationDetails{} } func (*CnatTranslationDetails) GetMessageName() string { return "cnat_translation_details" } -func (*CnatTranslationDetails) GetCrcString() string { return "347e1f16" } +func (*CnatTranslationDetails) GetCrcString() string { return "1a5140b7" } func (*CnatTranslationDetails) GetMessageType() api.MessageType { return api.ReplyMessage } @@ -877,6 +965,7 @@ func (m *CnatTranslationDetails) Size() (size int) { size += 1 // m.Translation.Flags size += 1 // m.Translation.LbType size += 4 // m.Translation.NPaths + size += 4 // m.Translation.FlowHashConfig for j2 := 0; j2 < len(m.Translation.Paths); j2++ { var s2 CnatEndpointTuple _ = s2 @@ -913,6 +1002,7 @@ func (m *CnatTranslationDetails) Marshal(b []byte) ([]byte, error) { buf.EncodeUint8(m.Translation.Flags) buf.EncodeUint8(uint8(m.Translation.LbType)) buf.EncodeUint32(uint32(len(m.Translation.Paths))) + buf.EncodeUint32(uint32(m.Translation.FlowHashConfig)) for j1 := 0; j1 < len(m.Translation.Paths); j1++ { var v1 CnatEndpointTuple // Paths if j1 < len(m.Translation.Paths) { @@ -945,6 +1035,7 @@ func (m *CnatTranslationDetails) Unmarshal(b []byte) error { m.Translation.Flags = buf.DecodeUint8() m.Translation.LbType = CnatLbType(buf.DecodeUint8()) m.Translation.NPaths = buf.DecodeUint32() + m.Translation.FlowHashConfig = ip.IPFlowHashConfigV2(buf.DecodeUint32()) m.Translation.Paths = make([]CnatEndpointTuple, m.Translation.NPaths) for j1 := 0; j1 < len(m.Translation.Paths); j1++ { m.Translation.Paths[j1].DstEp.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8()) @@ -1000,7 +1091,7 @@ type CnatTranslationUpdate struct { func (m *CnatTranslationUpdate) Reset() { *m = CnatTranslationUpdate{} } func (*CnatTranslationUpdate) GetMessageName() string { return "cnat_translation_update" } -func (*CnatTranslationUpdate) GetCrcString() string { return "cd5aedf5" } +func (*CnatTranslationUpdate) GetCrcString() string { return "f8d40bc5" } func (*CnatTranslationUpdate) GetMessageType() api.MessageType { return api.RequestMessage } @@ -1020,6 +1111,7 @@ func (m *CnatTranslationUpdate) Size() (size int) { size += 1 // m.Translation.Flags size += 1 // m.Translation.LbType size += 4 // m.Translation.NPaths + size += 4 // m.Translation.FlowHashConfig for j2 := 0; j2 < len(m.Translation.Paths); j2++ { var s2 CnatEndpointTuple _ = s2 @@ -1056,6 +1148,7 @@ func (m *CnatTranslationUpdate) Marshal(b []byte) ([]byte, error) { buf.EncodeUint8(m.Translation.Flags) buf.EncodeUint8(uint8(m.Translation.LbType)) buf.EncodeUint32(uint32(len(m.Translation.Paths))) + buf.EncodeUint32(uint32(m.Translation.FlowHashConfig)) for j1 := 0; j1 < len(m.Translation.Paths); j1++ { var v1 CnatEndpointTuple // Paths if j1 < len(m.Translation.Paths) { @@ -1088,6 +1181,7 @@ func (m *CnatTranslationUpdate) Unmarshal(b []byte) error { m.Translation.Flags = buf.DecodeUint8() m.Translation.LbType = CnatLbType(buf.DecodeUint8()) m.Translation.NPaths = buf.DecodeUint32() + m.Translation.FlowHashConfig = ip.IPFlowHashConfigV2(buf.DecodeUint32()) m.Translation.Paths = make([]CnatEndpointTuple, m.Translation.NPaths) for j1 := 0; j1 < len(m.Translation.Paths); j1++ { m.Translation.Paths[j1].DstEp.Addr.Af = ip_types.AddressFamily(buf.DecodeUint8()) @@ -1142,28 +1236,193 @@ func (m *CnatTranslationUpdateReply) Unmarshal(b []byte) error { return nil } +// Duplicate the cnat snat policy of the default vrf into another vrf +// - table_id_ip4 - +// +// DuplicateCnatSnatDefaultPolicyToVrf defines message 'duplicate_cnat_snat_default_policy_to_vrf'. +type DuplicateCnatSnatDefaultPolicyToVrf struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` +} + +func (m *DuplicateCnatSnatDefaultPolicyToVrf) Reset() { *m = DuplicateCnatSnatDefaultPolicyToVrf{} } +func (*DuplicateCnatSnatDefaultPolicyToVrf) GetMessageName() string { + return "duplicate_cnat_snat_default_policy_to_vrf" +} +func (*DuplicateCnatSnatDefaultPolicyToVrf) GetCrcString() string { return "f9e6675e" } +func (*DuplicateCnatSnatDefaultPolicyToVrf) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *DuplicateCnatSnatDefaultPolicyToVrf) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + return size +} +func (m *DuplicateCnatSnatDefaultPolicyToVrf) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + return buf.Bytes(), nil +} +func (m *DuplicateCnatSnatDefaultPolicyToVrf) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + return nil +} + +// DuplicateCnatSnatDefaultPolicyToVrfReply defines message 'duplicate_cnat_snat_default_policy_to_vrf_reply'. +type DuplicateCnatSnatDefaultPolicyToVrfReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *DuplicateCnatSnatDefaultPolicyToVrfReply) Reset() { + *m = DuplicateCnatSnatDefaultPolicyToVrfReply{} +} +func (*DuplicateCnatSnatDefaultPolicyToVrfReply) GetMessageName() string { + return "duplicate_cnat_snat_default_policy_to_vrf_reply" +} +func (*DuplicateCnatSnatDefaultPolicyToVrfReply) GetCrcString() string { return "e8d4e804" } +func (*DuplicateCnatSnatDefaultPolicyToVrfReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *DuplicateCnatSnatDefaultPolicyToVrfReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *DuplicateCnatSnatDefaultPolicyToVrfReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *DuplicateCnatSnatDefaultPolicyToVrfReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + +// Enable or disable interface feature cnat arc +// - sw_if_index - The interface to enable/disable cnat feature arc. +// - enable_disable - set to 1 to enable, 0 to disable cnat feature arc +// +// FeatureCnatEnableDisable defines message 'feature_cnat_enable_disable'. +type FeatureCnatEnableDisable struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"` + TableIDIP4 uint32 `binapi:"u32,name=table_id_ip4" json:"table_id_ip4,omitempty"` + TableIDIP6 uint32 `binapi:"u32,name=table_id_ip6" json:"table_id_ip6,omitempty"` +} + +func (m *FeatureCnatEnableDisable) Reset() { *m = FeatureCnatEnableDisable{} } +func (*FeatureCnatEnableDisable) GetMessageName() string { return "feature_cnat_enable_disable" } +func (*FeatureCnatEnableDisable) GetCrcString() string { return "572d40f6" } +func (*FeatureCnatEnableDisable) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *FeatureCnatEnableDisable) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + size += 1 // m.EnableDisable + size += 4 // m.TableIDIP4 + size += 4 // m.TableIDIP6 + return size +} +func (m *FeatureCnatEnableDisable) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeBool(m.EnableDisable) + buf.EncodeUint32(m.TableIDIP4) + buf.EncodeUint32(m.TableIDIP6) + return buf.Bytes(), nil +} +func (m *FeatureCnatEnableDisable) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.EnableDisable = buf.DecodeBool() + m.TableIDIP4 = buf.DecodeUint32() + m.TableIDIP6 = buf.DecodeUint32() + return nil +} + +// FeatureCnatEnableDisableReply defines message 'feature_cnat_enable_disable_reply'. +type FeatureCnatEnableDisableReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *FeatureCnatEnableDisableReply) Reset() { *m = FeatureCnatEnableDisableReply{} } +func (*FeatureCnatEnableDisableReply) GetMessageName() string { + return "feature_cnat_enable_disable_reply" +} +func (*FeatureCnatEnableDisableReply) GetCrcString() string { return "e8d4e804" } +func (*FeatureCnatEnableDisableReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *FeatureCnatEnableDisableReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *FeatureCnatEnableDisableReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *FeatureCnatEnableDisableReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + func init() { file_cnat_binapi_init() } func file_cnat_binapi_init() { api.RegisterMessage((*CnatGetSnatAddresses)(nil), "cnat_get_snat_addresses_51077d14") api.RegisterMessage((*CnatGetSnatAddressesReply)(nil), "cnat_get_snat_addresses_reply_879513c1") - api.RegisterMessage((*CnatSessionDetails)(nil), "cnat_session_details_7e5017c7") + api.RegisterMessage((*CnatSessionDetails)(nil), "cnat_session_details_7a78bf3f") api.RegisterMessage((*CnatSessionDump)(nil), "cnat_session_dump_51077d14") api.RegisterMessage((*CnatSessionPurge)(nil), "cnat_session_purge_51077d14") api.RegisterMessage((*CnatSessionPurgeReply)(nil), "cnat_session_purge_reply_e8d4e804") - api.RegisterMessage((*CnatSetSnatAddresses)(nil), "cnat_set_snat_addresses_d997e96c") + api.RegisterMessage((*CnatSetSnatAddresses)(nil), "cnat_set_snat_addresses_e9472ed4") api.RegisterMessage((*CnatSetSnatAddressesReply)(nil), "cnat_set_snat_addresses_reply_e8d4e804") api.RegisterMessage((*CnatSetSnatPolicy)(nil), "cnat_set_snat_policy_d3e6eaf4") api.RegisterMessage((*CnatSetSnatPolicyReply)(nil), "cnat_set_snat_policy_reply_e8d4e804") + api.RegisterMessage((*CnatSnatAddressesDetails)(nil), "cnat_snat_addresses_details_09ae6b38") + api.RegisterMessage((*CnatSnatAddressesDump)(nil), "cnat_snat_addresses_dump_51077d14") api.RegisterMessage((*CnatSnatPolicyAddDelExcludePfx)(nil), "cnat_snat_policy_add_del_exclude_pfx_e26dd79a") api.RegisterMessage((*CnatSnatPolicyAddDelExcludePfxReply)(nil), "cnat_snat_policy_add_del_exclude_pfx_reply_e8d4e804") - api.RegisterMessage((*CnatSnatPolicyAddDelIf)(nil), "cnat_snat_policy_add_del_if_6828deca") + api.RegisterMessage((*CnatSnatPolicyAddDelIf)(nil), "cnat_snat_policy_add_del_if_4ebb8d02") api.RegisterMessage((*CnatSnatPolicyAddDelIfReply)(nil), "cnat_snat_policy_add_del_if_reply_e8d4e804") api.RegisterMessage((*CnatTranslationDel)(nil), "cnat_translation_del_3a91bde5") api.RegisterMessage((*CnatTranslationDelReply)(nil), "cnat_translation_del_reply_e8d4e804") - api.RegisterMessage((*CnatTranslationDetails)(nil), "cnat_translation_details_347e1f16") + api.RegisterMessage((*CnatTranslationDetails)(nil), "cnat_translation_details_1a5140b7") api.RegisterMessage((*CnatTranslationDump)(nil), "cnat_translation_dump_51077d14") - api.RegisterMessage((*CnatTranslationUpdate)(nil), "cnat_translation_update_cd5aedf5") + api.RegisterMessage((*CnatTranslationUpdate)(nil), "cnat_translation_update_f8d40bc5") api.RegisterMessage((*CnatTranslationUpdateReply)(nil), "cnat_translation_update_reply_e2fc8294") + api.RegisterMessage((*DuplicateCnatSnatDefaultPolicyToVrf)(nil), "duplicate_cnat_snat_default_policy_to_vrf_f9e6675e") + api.RegisterMessage((*DuplicateCnatSnatDefaultPolicyToVrfReply)(nil), "duplicate_cnat_snat_default_policy_to_vrf_reply_e8d4e804") + api.RegisterMessage((*FeatureCnatEnableDisable)(nil), "feature_cnat_enable_disable_572d40f6") + api.RegisterMessage((*FeatureCnatEnableDisableReply)(nil), "feature_cnat_enable_disable_reply_e8d4e804") } // Messages returns list of all messages in this module. @@ -1179,6 +1438,8 @@ func AllMessages() []api.Message { (*CnatSetSnatAddressesReply)(nil), (*CnatSetSnatPolicy)(nil), (*CnatSetSnatPolicyReply)(nil), + (*CnatSnatAddressesDetails)(nil), + (*CnatSnatAddressesDump)(nil), (*CnatSnatPolicyAddDelExcludePfx)(nil), (*CnatSnatPolicyAddDelExcludePfxReply)(nil), (*CnatSnatPolicyAddDelIf)(nil), @@ -1189,5 +1450,9 @@ func AllMessages() []api.Message { (*CnatTranslationDump)(nil), (*CnatTranslationUpdate)(nil), (*CnatTranslationUpdateReply)(nil), + (*DuplicateCnatSnatDefaultPolicyToVrf)(nil), + (*DuplicateCnatSnatDefaultPolicyToVrfReply)(nil), + (*FeatureCnatEnableDisable)(nil), + (*FeatureCnatEnableDisableReply)(nil), } } diff --git a/vpplink/generated/bindings/cnat/cnat_rpc.ba.go b/vpplink/generated/bindings/cnat/cnat_rpc.ba.go index 034995b2a..81725cf32 100644 --- a/vpplink/generated/bindings/cnat/cnat_rpc.ba.go +++ b/vpplink/generated/bindings/cnat/cnat_rpc.ba.go @@ -18,11 +18,14 @@ type RPCService interface { CnatSessionPurge(ctx context.Context, in *CnatSessionPurge) (*CnatSessionPurgeReply, error) CnatSetSnatAddresses(ctx context.Context, in *CnatSetSnatAddresses) (*CnatSetSnatAddressesReply, error) CnatSetSnatPolicy(ctx context.Context, in *CnatSetSnatPolicy) (*CnatSetSnatPolicyReply, error) + CnatSnatAddressesDump(ctx context.Context, in *CnatSnatAddressesDump) (RPCService_CnatSnatAddressesDumpClient, error) CnatSnatPolicyAddDelExcludePfx(ctx context.Context, in *CnatSnatPolicyAddDelExcludePfx) (*CnatSnatPolicyAddDelExcludePfxReply, error) CnatSnatPolicyAddDelIf(ctx context.Context, in *CnatSnatPolicyAddDelIf) (*CnatSnatPolicyAddDelIfReply, error) CnatTranslationDel(ctx context.Context, in *CnatTranslationDel) (*CnatTranslationDelReply, error) CnatTranslationDump(ctx context.Context, in *CnatTranslationDump) (RPCService_CnatTranslationDumpClient, error) CnatTranslationUpdate(ctx context.Context, in *CnatTranslationUpdate) (*CnatTranslationUpdateReply, error) + DuplicateCnatSnatDefaultPolicyToVrf(ctx context.Context, in *DuplicateCnatSnatDefaultPolicyToVrf) (*DuplicateCnatSnatDefaultPolicyToVrfReply, error) + FeatureCnatEnableDisable(ctx context.Context, in *FeatureCnatEnableDisable) (*FeatureCnatEnableDisableReply, error) } type serviceClient struct { @@ -112,6 +115,49 @@ func (c *serviceClient) CnatSetSnatPolicy(ctx context.Context, in *CnatSetSnatPo return out, api.RetvalToVPPApiError(out.Retval) } +func (c *serviceClient) CnatSnatAddressesDump(ctx context.Context, in *CnatSnatAddressesDump) (RPCService_CnatSnatAddressesDumpClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_CnatSnatAddressesDumpClient{stream} + if err := x.Stream.SendMsg(in); err != nil { + return nil, err + } + if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil { + return nil, err + } + return x, nil +} + +type RPCService_CnatSnatAddressesDumpClient interface { + Recv() (*CnatSnatAddressesDetails, error) + api.Stream +} + +type serviceClient_CnatSnatAddressesDumpClient struct { + api.Stream +} + +func (c *serviceClient_CnatSnatAddressesDumpClient) Recv() (*CnatSnatAddressesDetails, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *CnatSnatAddressesDetails: + return m, nil + case *memclnt.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } + return nil, io.EOF + default: + return nil, fmt.Errorf("unexpected message: %T %v", m, m) + } +} + func (c *serviceClient) CnatSnatPolicyAddDelExcludePfx(ctx context.Context, in *CnatSnatPolicyAddDelExcludePfx) (*CnatSnatPolicyAddDelExcludePfxReply, error) { out := new(CnatSnatPolicyAddDelExcludePfxReply) err := c.conn.Invoke(ctx, in, out) @@ -190,3 +236,21 @@ func (c *serviceClient) CnatTranslationUpdate(ctx context.Context, in *CnatTrans } return out, api.RetvalToVPPApiError(out.Retval) } + +func (c *serviceClient) DuplicateCnatSnatDefaultPolicyToVrf(ctx context.Context, in *DuplicateCnatSnatDefaultPolicyToVrf) (*DuplicateCnatSnatDefaultPolicyToVrfReply, error) { + out := new(DuplicateCnatSnatDefaultPolicyToVrfReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) FeatureCnatEnableDisable(ctx context.Context, in *FeatureCnatEnableDisable) (*FeatureCnatEnableDisableReply, error) { + out := new(FeatureCnatEnableDisableReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} diff --git a/vpplink/generated/bindings/crypto_sw_scheduler/crypto_sw_scheduler.ba.go b/vpplink/generated/bindings/crypto_sw_scheduler/crypto_sw_scheduler.ba.go index a86b30492..84d140519 100644 --- a/vpplink/generated/bindings/crypto_sw_scheduler/crypto_sw_scheduler.ba.go +++ b/vpplink/generated/bindings/crypto_sw_scheduler/crypto_sw_scheduler.ba.go @@ -19,7 +19,7 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "crypto_sw_scheduler" - APIVersion = "0.1.0" + APIVersion = "1.1.0" VersionCrc = 0xf4b02951 ) diff --git a/vpplink/generated/bindings/feature/feature.ba.go b/vpplink/generated/bindings/feature/feature.ba.go index 5010d77d4..1c526504b 100644 --- a/vpplink/generated/bindings/feature/feature.ba.go +++ b/vpplink/generated/bindings/feature/feature.ba.go @@ -3,7 +3,7 @@ // Package feature contains generated bindings for API file feature.api. // // Contents: -// - 2 messages +// - 4 messages package feature import ( @@ -21,7 +21,7 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "feature" APIVersion = "1.0.2" - VersionCrc = 0x8a6e6da1 + VersionCrc = 0x30d6f180 ) // Feature path enable/disable request @@ -106,10 +106,90 @@ func (m *FeatureEnableDisableReply) Unmarshal(b []byte) error { return nil } +// FeatureIsEnabled defines message 'feature_is_enabled'. +type FeatureIsEnabled struct { + ArcName string `binapi:"string[64],name=arc_name" json:"arc_name,omitempty"` + FeatureName string `binapi:"string[64],name=feature_name" json:"feature_name,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` +} + +func (m *FeatureIsEnabled) Reset() { *m = FeatureIsEnabled{} } +func (*FeatureIsEnabled) GetMessageName() string { return "feature_is_enabled" } +func (*FeatureIsEnabled) GetCrcString() string { return "55db09e2" } +func (*FeatureIsEnabled) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *FeatureIsEnabled) Size() (size int) { + if m == nil { + return 0 + } + size += 64 // m.ArcName + size += 64 // m.FeatureName + size += 4 // m.SwIfIndex + return size +} +func (m *FeatureIsEnabled) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeString(m.ArcName, 64) + buf.EncodeString(m.FeatureName, 64) + buf.EncodeUint32(uint32(m.SwIfIndex)) + return buf.Bytes(), nil +} +func (m *FeatureIsEnabled) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.ArcName = buf.DecodeString(64) + m.FeatureName = buf.DecodeString(64) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + return nil +} + +// FeatureIsEnabledReply defines message 'feature_is_enabled_reply'. +type FeatureIsEnabledReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + IsEnabled bool `binapi:"bool,name=is_enabled" json:"is_enabled,omitempty"` +} + +func (m *FeatureIsEnabledReply) Reset() { *m = FeatureIsEnabledReply{} } +func (*FeatureIsEnabledReply) GetMessageName() string { return "feature_is_enabled_reply" } +func (*FeatureIsEnabledReply) GetCrcString() string { return "03f284b5" } +func (*FeatureIsEnabledReply) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *FeatureIsEnabledReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 1 // m.IsEnabled + return size +} +func (m *FeatureIsEnabledReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeBool(m.IsEnabled) + return buf.Bytes(), nil +} +func (m *FeatureIsEnabledReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.IsEnabled = buf.DecodeBool() + return nil +} + func init() { file_feature_binapi_init() } func file_feature_binapi_init() { api.RegisterMessage((*FeatureEnableDisable)(nil), "feature_enable_disable_7531c862") api.RegisterMessage((*FeatureEnableDisableReply)(nil), "feature_enable_disable_reply_e8d4e804") + api.RegisterMessage((*FeatureIsEnabled)(nil), "feature_is_enabled_55db09e2") + api.RegisterMessage((*FeatureIsEnabledReply)(nil), "feature_is_enabled_reply_03f284b5") } // Messages returns list of all messages in this module. @@ -117,5 +197,7 @@ func AllMessages() []api.Message { return []api.Message{ (*FeatureEnableDisable)(nil), (*FeatureEnableDisableReply)(nil), + (*FeatureIsEnabled)(nil), + (*FeatureIsEnabledReply)(nil), } } diff --git a/vpplink/generated/bindings/feature/feature_rpc.ba.go b/vpplink/generated/bindings/feature/feature_rpc.ba.go index 8f98139ed..2b40fb562 100644 --- a/vpplink/generated/bindings/feature/feature_rpc.ba.go +++ b/vpplink/generated/bindings/feature/feature_rpc.ba.go @@ -11,6 +11,7 @@ import ( // RPCService defines RPC service feature. type RPCService interface { FeatureEnableDisable(ctx context.Context, in *FeatureEnableDisable) (*FeatureEnableDisableReply, error) + FeatureIsEnabled(ctx context.Context, in *FeatureIsEnabled) (*FeatureIsEnabledReply, error) } type serviceClient struct { @@ -29,3 +30,12 @@ func (c *serviceClient) FeatureEnableDisable(ctx context.Context, in *FeatureEna } return out, api.RetvalToVPPApiError(out.Retval) } + +func (c *serviceClient) FeatureIsEnabled(ctx context.Context, in *FeatureIsEnabled) (*FeatureIsEnabledReply, error) { + out := new(FeatureIsEnabledReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} diff --git a/vpplink/generated/bindings/ikev2/ikev2.ba.go b/vpplink/generated/bindings/ikev2/ikev2.ba.go index fdea70d36..846b35249 100644 --- a/vpplink/generated/bindings/ikev2/ikev2.ba.go +++ b/vpplink/generated/bindings/ikev2/ikev2.ba.go @@ -3,7 +3,7 @@ // Package ikev2 contains generated bindings for API file ikev2.api. // // Contents: -// - 50 messages +// - 60 messages package ikev2 import ( @@ -23,7 +23,7 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "ikev2" APIVersion = "1.0.1" - VersionCrc = 0x8eb2437c + VersionCrc = 0xfdeb2617 ) // Child SA details @@ -31,7 +31,6 @@ const ( // - child_sa - child SA data // // Ikev2ChildSaDetails defines message 'ikev2_child_sa_details'. -// InProgress: the message form may change in the future versions type Ikev2ChildSaDetails struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` ChildSa ikev2_types.Ikev2ChildSa `binapi:"ikev2_child_sa,name=child_sa" json:"child_sa,omitempty"` @@ -184,7 +183,6 @@ func (m *Ikev2ChildSaDetails) Unmarshal(b []byte) error { // - sa_index - index of specific sa // // Ikev2ChildSaDump defines message 'ikev2_child_sa_dump'. -// InProgress: the message form may change in the future versions type Ikev2ChildSaDump struct { SaIndex uint32 `binapi:"u32,name=sa_index" json:"sa_index,omitempty"` } @@ -217,6 +215,268 @@ func (m *Ikev2ChildSaDump) Unmarshal(b []byte) error { return nil } +// Child SA details +// - retval - return code +// - child_sa - child SA data +// +// Ikev2ChildSaV2Details defines message 'ikev2_child_sa_v2_details'. +// InProgress: the message form may change in the future versions +type Ikev2ChildSaV2Details struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + ChildSa ikev2_types.Ikev2ChildSaV2 `binapi:"ikev2_child_sa_v2,name=child_sa" json:"child_sa,omitempty"` +} + +func (m *Ikev2ChildSaV2Details) Reset() { *m = Ikev2ChildSaV2Details{} } +func (*Ikev2ChildSaV2Details) GetMessageName() string { return "ikev2_child_sa_v2_details" } +func (*Ikev2ChildSaV2Details) GetCrcString() string { return "1db62aa2" } +func (*Ikev2ChildSaV2Details) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *Ikev2ChildSaV2Details) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.ChildSa.SaIndex + size += 4 // m.ChildSa.ChildSaIndex + size += 4 // m.ChildSa.ISpi + size += 4 // m.ChildSa.RSpi + size += 1 * 64 // m.ChildSa.Keys.SkD + size += 1 // m.ChildSa.Keys.SkDLen + size += 1 * 64 // m.ChildSa.Keys.SkAi + size += 1 // m.ChildSa.Keys.SkAiLen + size += 1 * 64 // m.ChildSa.Keys.SkAr + size += 1 // m.ChildSa.Keys.SkArLen + size += 1 * 64 // m.ChildSa.Keys.SkEi + size += 1 // m.ChildSa.Keys.SkEiLen + size += 1 * 64 // m.ChildSa.Keys.SkEr + size += 1 // m.ChildSa.Keys.SkErLen + size += 1 * 64 // m.ChildSa.Keys.SkPi + size += 1 // m.ChildSa.Keys.SkPiLen + size += 1 * 64 // m.ChildSa.Keys.SkPr + size += 1 // m.ChildSa.Keys.SkPrLen + size += 1 // m.ChildSa.Encryption.TransformType + size += 2 // m.ChildSa.Encryption.TransformID + size += 2 // m.ChildSa.Encryption.KeyLen + size += 2 // m.ChildSa.Encryption.KeyTrunc + size += 2 // m.ChildSa.Encryption.BlockSize + size += 1 // m.ChildSa.Encryption.DhGroup + size += 1 // m.ChildSa.Integrity.TransformType + size += 2 // m.ChildSa.Integrity.TransformID + size += 2 // m.ChildSa.Integrity.KeyLen + size += 2 // m.ChildSa.Integrity.KeyTrunc + size += 2 // m.ChildSa.Integrity.BlockSize + size += 1 // m.ChildSa.Integrity.DhGroup + size += 1 // m.ChildSa.Esn.TransformType + size += 2 // m.ChildSa.Esn.TransformID + size += 2 // m.ChildSa.Esn.KeyLen + size += 2 // m.ChildSa.Esn.KeyTrunc + size += 2 // m.ChildSa.Esn.BlockSize + size += 1 // m.ChildSa.Esn.DhGroup + size += 8 // m.ChildSa.Uptime + return size +} +func (m *Ikev2ChildSaV2Details) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.ChildSa.SaIndex) + buf.EncodeUint32(m.ChildSa.ChildSaIndex) + buf.EncodeUint32(m.ChildSa.ISpi) + buf.EncodeUint32(m.ChildSa.RSpi) + buf.EncodeBytes(m.ChildSa.Keys.SkD, 64) + buf.EncodeUint8(m.ChildSa.Keys.SkDLen) + buf.EncodeBytes(m.ChildSa.Keys.SkAi, 64) + buf.EncodeUint8(m.ChildSa.Keys.SkAiLen) + buf.EncodeBytes(m.ChildSa.Keys.SkAr, 64) + buf.EncodeUint8(m.ChildSa.Keys.SkArLen) + buf.EncodeBytes(m.ChildSa.Keys.SkEi, 64) + buf.EncodeUint8(m.ChildSa.Keys.SkEiLen) + buf.EncodeBytes(m.ChildSa.Keys.SkEr, 64) + buf.EncodeUint8(m.ChildSa.Keys.SkErLen) + buf.EncodeBytes(m.ChildSa.Keys.SkPi, 64) + buf.EncodeUint8(m.ChildSa.Keys.SkPiLen) + buf.EncodeBytes(m.ChildSa.Keys.SkPr, 64) + buf.EncodeUint8(m.ChildSa.Keys.SkPrLen) + buf.EncodeUint8(m.ChildSa.Encryption.TransformType) + buf.EncodeUint16(m.ChildSa.Encryption.TransformID) + buf.EncodeUint16(m.ChildSa.Encryption.KeyLen) + buf.EncodeUint16(m.ChildSa.Encryption.KeyTrunc) + buf.EncodeUint16(m.ChildSa.Encryption.BlockSize) + buf.EncodeUint8(m.ChildSa.Encryption.DhGroup) + buf.EncodeUint8(m.ChildSa.Integrity.TransformType) + buf.EncodeUint16(m.ChildSa.Integrity.TransformID) + buf.EncodeUint16(m.ChildSa.Integrity.KeyLen) + buf.EncodeUint16(m.ChildSa.Integrity.KeyTrunc) + buf.EncodeUint16(m.ChildSa.Integrity.BlockSize) + buf.EncodeUint8(m.ChildSa.Integrity.DhGroup) + buf.EncodeUint8(m.ChildSa.Esn.TransformType) + buf.EncodeUint16(m.ChildSa.Esn.TransformID) + buf.EncodeUint16(m.ChildSa.Esn.KeyLen) + buf.EncodeUint16(m.ChildSa.Esn.KeyTrunc) + buf.EncodeUint16(m.ChildSa.Esn.BlockSize) + buf.EncodeUint8(m.ChildSa.Esn.DhGroup) + buf.EncodeFloat64(m.ChildSa.Uptime) + return buf.Bytes(), nil +} +func (m *Ikev2ChildSaV2Details) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.ChildSa.SaIndex = buf.DecodeUint32() + m.ChildSa.ChildSaIndex = buf.DecodeUint32() + m.ChildSa.ISpi = buf.DecodeUint32() + m.ChildSa.RSpi = buf.DecodeUint32() + m.ChildSa.Keys.SkD = make([]byte, 64) + copy(m.ChildSa.Keys.SkD, buf.DecodeBytes(len(m.ChildSa.Keys.SkD))) + m.ChildSa.Keys.SkDLen = buf.DecodeUint8() + m.ChildSa.Keys.SkAi = make([]byte, 64) + copy(m.ChildSa.Keys.SkAi, buf.DecodeBytes(len(m.ChildSa.Keys.SkAi))) + m.ChildSa.Keys.SkAiLen = buf.DecodeUint8() + m.ChildSa.Keys.SkAr = make([]byte, 64) + copy(m.ChildSa.Keys.SkAr, buf.DecodeBytes(len(m.ChildSa.Keys.SkAr))) + m.ChildSa.Keys.SkArLen = buf.DecodeUint8() + m.ChildSa.Keys.SkEi = make([]byte, 64) + copy(m.ChildSa.Keys.SkEi, buf.DecodeBytes(len(m.ChildSa.Keys.SkEi))) + m.ChildSa.Keys.SkEiLen = buf.DecodeUint8() + m.ChildSa.Keys.SkEr = make([]byte, 64) + copy(m.ChildSa.Keys.SkEr, buf.DecodeBytes(len(m.ChildSa.Keys.SkEr))) + m.ChildSa.Keys.SkErLen = buf.DecodeUint8() + m.ChildSa.Keys.SkPi = make([]byte, 64) + copy(m.ChildSa.Keys.SkPi, buf.DecodeBytes(len(m.ChildSa.Keys.SkPi))) + m.ChildSa.Keys.SkPiLen = buf.DecodeUint8() + m.ChildSa.Keys.SkPr = make([]byte, 64) + copy(m.ChildSa.Keys.SkPr, buf.DecodeBytes(len(m.ChildSa.Keys.SkPr))) + m.ChildSa.Keys.SkPrLen = buf.DecodeUint8() + m.ChildSa.Encryption.TransformType = buf.DecodeUint8() + m.ChildSa.Encryption.TransformID = buf.DecodeUint16() + m.ChildSa.Encryption.KeyLen = buf.DecodeUint16() + m.ChildSa.Encryption.KeyTrunc = buf.DecodeUint16() + m.ChildSa.Encryption.BlockSize = buf.DecodeUint16() + m.ChildSa.Encryption.DhGroup = buf.DecodeUint8() + m.ChildSa.Integrity.TransformType = buf.DecodeUint8() + m.ChildSa.Integrity.TransformID = buf.DecodeUint16() + m.ChildSa.Integrity.KeyLen = buf.DecodeUint16() + m.ChildSa.Integrity.KeyTrunc = buf.DecodeUint16() + m.ChildSa.Integrity.BlockSize = buf.DecodeUint16() + m.ChildSa.Integrity.DhGroup = buf.DecodeUint8() + m.ChildSa.Esn.TransformType = buf.DecodeUint8() + m.ChildSa.Esn.TransformID = buf.DecodeUint16() + m.ChildSa.Esn.KeyLen = buf.DecodeUint16() + m.ChildSa.Esn.KeyTrunc = buf.DecodeUint16() + m.ChildSa.Esn.BlockSize = buf.DecodeUint16() + m.ChildSa.Esn.DhGroup = buf.DecodeUint8() + m.ChildSa.Uptime = buf.DecodeFloat64() + return nil +} + +// Dump child SA of specific SA +// - sa_index - index of specific sa +// +// Ikev2ChildSaV2Dump defines message 'ikev2_child_sa_v2_dump'. +// InProgress: the message form may change in the future versions +type Ikev2ChildSaV2Dump struct { + SaIndex uint32 `binapi:"u32,name=sa_index" json:"sa_index,omitempty"` +} + +func (m *Ikev2ChildSaV2Dump) Reset() { *m = Ikev2ChildSaV2Dump{} } +func (*Ikev2ChildSaV2Dump) GetMessageName() string { return "ikev2_child_sa_v2_dump" } +func (*Ikev2ChildSaV2Dump) GetCrcString() string { return "01eab609" } +func (*Ikev2ChildSaV2Dump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *Ikev2ChildSaV2Dump) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SaIndex + return size +} +func (m *Ikev2ChildSaV2Dump) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.SaIndex) + return buf.Bytes(), nil +} +func (m *Ikev2ChildSaV2Dump) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SaIndex = buf.DecodeUint32() + return nil +} + +// IKEv2: Get the current sleep interval for the ikev2_manager_process +// Ikev2GetSleepInterval defines message 'ikev2_get_sleep_interval'. +type Ikev2GetSleepInterval struct{} + +func (m *Ikev2GetSleepInterval) Reset() { *m = Ikev2GetSleepInterval{} } +func (*Ikev2GetSleepInterval) GetMessageName() string { return "ikev2_get_sleep_interval" } +func (*Ikev2GetSleepInterval) GetCrcString() string { return "51077d14" } +func (*Ikev2GetSleepInterval) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *Ikev2GetSleepInterval) Size() (size int) { + if m == nil { + return 0 + } + return size +} +func (m *Ikev2GetSleepInterval) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + return buf.Bytes(), nil +} +func (m *Ikev2GetSleepInterval) Unmarshal(b []byte) error { + return nil +} + +// IKEv2: Reply with the current sleep interval +// - sleep_interval - current sleep interval in seconds +// +// Ikev2GetSleepIntervalReply defines message 'ikev2_get_sleep_interval_reply'. +type Ikev2GetSleepIntervalReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + SleepInterval float64 `binapi:"f64,name=sleep_interval" json:"sleep_interval,omitempty"` +} + +func (m *Ikev2GetSleepIntervalReply) Reset() { *m = Ikev2GetSleepIntervalReply{} } +func (*Ikev2GetSleepIntervalReply) GetMessageName() string { return "ikev2_get_sleep_interval_reply" } +func (*Ikev2GetSleepIntervalReply) GetCrcString() string { return "78ab91dc" } +func (*Ikev2GetSleepIntervalReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *Ikev2GetSleepIntervalReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 8 // m.SleepInterval + return size +} +func (m *Ikev2GetSleepIntervalReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeFloat64(m.SleepInterval) + return buf.Bytes(), nil +} +func (m *Ikev2GetSleepIntervalReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.SleepInterval = buf.DecodeFloat64() + return nil +} + // IKEv2: Initiate the delete Child SA exchange // - ispi - Child SA initiator SPI // @@ -664,69 +924,64 @@ func (m *Ikev2PluginGetVersionReply) Unmarshal(b []byte) error { return nil } -// IKEv2: Add/delete profile -// - name - IKEv2 profile name -// - is_add - Add IKEv2 profile if non-zero, else delete +// IKEv2: Set sleep interval for ikev2_manager_process node +// - timeout - sleep timeout duration in seconds // -// Ikev2ProfileAddDel defines message 'ikev2_profile_add_del'. -// InProgress: the message form may change in the future versions -type Ikev2ProfileAddDel struct { - Name string `binapi:"string[64],name=name" json:"name,omitempty"` - IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` +// Ikev2PluginSetSleepInterval defines message 'ikev2_plugin_set_sleep_interval'. +type Ikev2PluginSetSleepInterval struct { + Timeout float64 `binapi:"f64,name=timeout" json:"timeout,omitempty"` } -func (m *Ikev2ProfileAddDel) Reset() { *m = Ikev2ProfileAddDel{} } -func (*Ikev2ProfileAddDel) GetMessageName() string { return "ikev2_profile_add_del" } -func (*Ikev2ProfileAddDel) GetCrcString() string { return "2c925b55" } -func (*Ikev2ProfileAddDel) GetMessageType() api.MessageType { +func (m *Ikev2PluginSetSleepInterval) Reset() { *m = Ikev2PluginSetSleepInterval{} } +func (*Ikev2PluginSetSleepInterval) GetMessageName() string { return "ikev2_plugin_set_sleep_interval" } +func (*Ikev2PluginSetSleepInterval) GetCrcString() string { return "b7c096ae" } +func (*Ikev2PluginSetSleepInterval) GetMessageType() api.MessageType { return api.RequestMessage } -func (m *Ikev2ProfileAddDel) Size() (size int) { +func (m *Ikev2PluginSetSleepInterval) Size() (size int) { if m == nil { return 0 } - size += 64 // m.Name - size += 1 // m.IsAdd + size += 8 // m.Timeout return size } -func (m *Ikev2ProfileAddDel) Marshal(b []byte) ([]byte, error) { +func (m *Ikev2PluginSetSleepInterval) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) - buf.EncodeString(m.Name, 64) - buf.EncodeBool(m.IsAdd) + buf.EncodeFloat64(m.Timeout) return buf.Bytes(), nil } -func (m *Ikev2ProfileAddDel) Unmarshal(b []byte) error { +func (m *Ikev2PluginSetSleepInterval) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) - m.Name = buf.DecodeString(64) - m.IsAdd = buf.DecodeBool() + m.Timeout = buf.DecodeFloat64() return nil } -// Ikev2ProfileAddDelReply defines message 'ikev2_profile_add_del_reply'. -// InProgress: the message form may change in the future versions -type Ikev2ProfileAddDelReply struct { +// Ikev2PluginSetSleepIntervalReply defines message 'ikev2_plugin_set_sleep_interval_reply'. +type Ikev2PluginSetSleepIntervalReply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` } -func (m *Ikev2ProfileAddDelReply) Reset() { *m = Ikev2ProfileAddDelReply{} } -func (*Ikev2ProfileAddDelReply) GetMessageName() string { return "ikev2_profile_add_del_reply" } -func (*Ikev2ProfileAddDelReply) GetCrcString() string { return "e8d4e804" } -func (*Ikev2ProfileAddDelReply) GetMessageType() api.MessageType { +func (m *Ikev2PluginSetSleepIntervalReply) Reset() { *m = Ikev2PluginSetSleepIntervalReply{} } +func (*Ikev2PluginSetSleepIntervalReply) GetMessageName() string { + return "ikev2_plugin_set_sleep_interval_reply" +} +func (*Ikev2PluginSetSleepIntervalReply) GetCrcString() string { return "e8d4e804" } +func (*Ikev2PluginSetSleepIntervalReply) GetMessageType() api.MessageType { return api.ReplyMessage } -func (m *Ikev2ProfileAddDelReply) Size() (size int) { +func (m *Ikev2PluginSetSleepIntervalReply) Size() (size int) { if m == nil { return 0 } size += 4 // m.Retval return size } -func (m *Ikev2ProfileAddDelReply) Marshal(b []byte) ([]byte, error) { +func (m *Ikev2PluginSetSleepIntervalReply) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } @@ -734,19 +989,95 @@ func (m *Ikev2ProfileAddDelReply) Marshal(b []byte) ([]byte, error) { buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } -func (m *Ikev2ProfileAddDelReply) Unmarshal(b []byte) error { +func (m *Ikev2PluginSetSleepIntervalReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Retval = buf.DecodeInt32() return nil } -// Details about all profiles -// - profile - profile element with encapsulated attributes +// IKEv2: Add/delete profile +// - name - IKEv2 profile name +// - is_add - Add IKEv2 profile if non-zero, else delete // -// Ikev2ProfileDetails defines message 'ikev2_profile_details'. +// Ikev2ProfileAddDel defines message 'ikev2_profile_add_del'. // InProgress: the message form may change in the future versions -type Ikev2ProfileDetails struct { - Profile ikev2_types.Ikev2Profile `binapi:"ikev2_profile,name=profile" json:"profile,omitempty"` +type Ikev2ProfileAddDel struct { + Name string `binapi:"string[64],name=name" json:"name,omitempty"` + IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` +} + +func (m *Ikev2ProfileAddDel) Reset() { *m = Ikev2ProfileAddDel{} } +func (*Ikev2ProfileAddDel) GetMessageName() string { return "ikev2_profile_add_del" } +func (*Ikev2ProfileAddDel) GetCrcString() string { return "2c925b55" } +func (*Ikev2ProfileAddDel) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *Ikev2ProfileAddDel) Size() (size int) { + if m == nil { + return 0 + } + size += 64 // m.Name + size += 1 // m.IsAdd + return size +} +func (m *Ikev2ProfileAddDel) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeString(m.Name, 64) + buf.EncodeBool(m.IsAdd) + return buf.Bytes(), nil +} +func (m *Ikev2ProfileAddDel) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Name = buf.DecodeString(64) + m.IsAdd = buf.DecodeBool() + return nil +} + +// Ikev2ProfileAddDelReply defines message 'ikev2_profile_add_del_reply'. +// InProgress: the message form may change in the future versions +type Ikev2ProfileAddDelReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *Ikev2ProfileAddDelReply) Reset() { *m = Ikev2ProfileAddDelReply{} } +func (*Ikev2ProfileAddDelReply) GetMessageName() string { return "ikev2_profile_add_del_reply" } +func (*Ikev2ProfileAddDelReply) GetCrcString() string { return "e8d4e804" } +func (*Ikev2ProfileAddDelReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *Ikev2ProfileAddDelReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *Ikev2ProfileAddDelReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *Ikev2ProfileAddDelReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + +// Details about all profiles +// - profile - profile element with encapsulated attributes +// +// Ikev2ProfileDetails defines message 'ikev2_profile_details'. +// InProgress: the message form may change in the future versions +type Ikev2ProfileDetails struct { + Profile ikev2_types.Ikev2Profile `binapi:"ikev2_profile,name=profile" json:"profile,omitempty"` } func (m *Ikev2ProfileDetails) Reset() { *m = Ikev2ProfileDetails{} } @@ -1552,7 +1883,6 @@ func (m *Ikev2ProfileSetUDPEncapReply) Unmarshal(b []byte) error { // - sa - SA data // // Ikev2SaDetails defines message 'ikev2_sa_details'. -// InProgress: the message form may change in the future versions type Ikev2SaDetails struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` Sa ikev2_types.Ikev2Sa `binapi:"ikev2_sa,name=sa" json:"sa,omitempty"` @@ -1769,7 +2099,6 @@ func (m *Ikev2SaDetails) Unmarshal(b []byte) error { // Dump all SAs // Ikev2SaDump defines message 'ikev2_sa_dump'. -// InProgress: the message form may change in the future versions type Ikev2SaDump struct{} func (m *Ikev2SaDump) Reset() { *m = Ikev2SaDump{} } @@ -1796,6 +2125,511 @@ func (m *Ikev2SaDump) Unmarshal(b []byte) error { return nil } +// Details about IKE SA +// - retval - return code +// - sa - SA data +// +// Ikev2SaV2Details defines message 'ikev2_sa_v2_details'. +type Ikev2SaV2Details struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + Sa ikev2_types.Ikev2SaV2 `binapi:"ikev2_sa_v2,name=sa" json:"sa,omitempty"` +} + +func (m *Ikev2SaV2Details) Reset() { *m = Ikev2SaV2Details{} } +func (*Ikev2SaV2Details) GetMessageName() string { return "ikev2_sa_v2_details" } +func (*Ikev2SaV2Details) GetCrcString() string { return "a616e604" } +func (*Ikev2SaV2Details) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *Ikev2SaV2Details) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.Sa.SaIndex + size += 64 // m.Sa.ProfileName + size += 4 // m.Sa.State + size += 8 // m.Sa.Ispi + size += 8 // m.Sa.Rspi + size += 1 // m.Sa.Iaddr.Af + size += 1 * 16 // m.Sa.Iaddr.Un + size += 1 // m.Sa.Raddr.Af + size += 1 * 16 // m.Sa.Raddr.Un + size += 1 * 64 // m.Sa.Keys.SkD + size += 1 // m.Sa.Keys.SkDLen + size += 1 * 64 // m.Sa.Keys.SkAi + size += 1 // m.Sa.Keys.SkAiLen + size += 1 * 64 // m.Sa.Keys.SkAr + size += 1 // m.Sa.Keys.SkArLen + size += 1 * 64 // m.Sa.Keys.SkEi + size += 1 // m.Sa.Keys.SkEiLen + size += 1 * 64 // m.Sa.Keys.SkEr + size += 1 // m.Sa.Keys.SkErLen + size += 1 * 64 // m.Sa.Keys.SkPi + size += 1 // m.Sa.Keys.SkPiLen + size += 1 * 64 // m.Sa.Keys.SkPr + size += 1 // m.Sa.Keys.SkPrLen + size += 1 // m.Sa.IID.Type + size += 1 // m.Sa.IID.DataLen + size += 64 // m.Sa.IID.Data + size += 1 // m.Sa.RID.Type + size += 1 // m.Sa.RID.DataLen + size += 64 // m.Sa.RID.Data + size += 1 // m.Sa.Encryption.TransformType + size += 2 // m.Sa.Encryption.TransformID + size += 2 // m.Sa.Encryption.KeyLen + size += 2 // m.Sa.Encryption.KeyTrunc + size += 2 // m.Sa.Encryption.BlockSize + size += 1 // m.Sa.Encryption.DhGroup + size += 1 // m.Sa.Integrity.TransformType + size += 2 // m.Sa.Integrity.TransformID + size += 2 // m.Sa.Integrity.KeyLen + size += 2 // m.Sa.Integrity.KeyTrunc + size += 2 // m.Sa.Integrity.BlockSize + size += 1 // m.Sa.Integrity.DhGroup + size += 1 // m.Sa.Prf.TransformType + size += 2 // m.Sa.Prf.TransformID + size += 2 // m.Sa.Prf.KeyLen + size += 2 // m.Sa.Prf.KeyTrunc + size += 2 // m.Sa.Prf.BlockSize + size += 1 // m.Sa.Prf.DhGroup + size += 1 // m.Sa.Dh.TransformType + size += 2 // m.Sa.Dh.TransformID + size += 2 // m.Sa.Dh.KeyLen + size += 2 // m.Sa.Dh.KeyTrunc + size += 2 // m.Sa.Dh.BlockSize + size += 1 // m.Sa.Dh.DhGroup + size += 2 // m.Sa.Stats.NKeepalives + size += 2 // m.Sa.Stats.NRekeyReq + size += 2 // m.Sa.Stats.NSaInitReq + size += 2 // m.Sa.Stats.NSaAuthReq + size += 2 // m.Sa.Stats.NRetransmit + size += 2 // m.Sa.Stats.NInitSaRetransmit + return size +} +func (m *Ikev2SaV2Details) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.Sa.SaIndex) + buf.EncodeString(m.Sa.ProfileName, 64) + buf.EncodeUint32(uint32(m.Sa.State)) + buf.EncodeUint64(m.Sa.Ispi) + buf.EncodeUint64(m.Sa.Rspi) + buf.EncodeUint8(uint8(m.Sa.Iaddr.Af)) + buf.EncodeBytes(m.Sa.Iaddr.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(uint8(m.Sa.Raddr.Af)) + buf.EncodeBytes(m.Sa.Raddr.Un.XXX_UnionData[:], 16) + buf.EncodeBytes(m.Sa.Keys.SkD, 64) + buf.EncodeUint8(m.Sa.Keys.SkDLen) + buf.EncodeBytes(m.Sa.Keys.SkAi, 64) + buf.EncodeUint8(m.Sa.Keys.SkAiLen) + buf.EncodeBytes(m.Sa.Keys.SkAr, 64) + buf.EncodeUint8(m.Sa.Keys.SkArLen) + buf.EncodeBytes(m.Sa.Keys.SkEi, 64) + buf.EncodeUint8(m.Sa.Keys.SkEiLen) + buf.EncodeBytes(m.Sa.Keys.SkEr, 64) + buf.EncodeUint8(m.Sa.Keys.SkErLen) + buf.EncodeBytes(m.Sa.Keys.SkPi, 64) + buf.EncodeUint8(m.Sa.Keys.SkPiLen) + buf.EncodeBytes(m.Sa.Keys.SkPr, 64) + buf.EncodeUint8(m.Sa.Keys.SkPrLen) + buf.EncodeUint8(m.Sa.IID.Type) + buf.EncodeUint8(m.Sa.IID.DataLen) + buf.EncodeString(m.Sa.IID.Data, 64) + buf.EncodeUint8(m.Sa.RID.Type) + buf.EncodeUint8(m.Sa.RID.DataLen) + buf.EncodeString(m.Sa.RID.Data, 64) + buf.EncodeUint8(m.Sa.Encryption.TransformType) + buf.EncodeUint16(m.Sa.Encryption.TransformID) + buf.EncodeUint16(m.Sa.Encryption.KeyLen) + buf.EncodeUint16(m.Sa.Encryption.KeyTrunc) + buf.EncodeUint16(m.Sa.Encryption.BlockSize) + buf.EncodeUint8(m.Sa.Encryption.DhGroup) + buf.EncodeUint8(m.Sa.Integrity.TransformType) + buf.EncodeUint16(m.Sa.Integrity.TransformID) + buf.EncodeUint16(m.Sa.Integrity.KeyLen) + buf.EncodeUint16(m.Sa.Integrity.KeyTrunc) + buf.EncodeUint16(m.Sa.Integrity.BlockSize) + buf.EncodeUint8(m.Sa.Integrity.DhGroup) + buf.EncodeUint8(m.Sa.Prf.TransformType) + buf.EncodeUint16(m.Sa.Prf.TransformID) + buf.EncodeUint16(m.Sa.Prf.KeyLen) + buf.EncodeUint16(m.Sa.Prf.KeyTrunc) + buf.EncodeUint16(m.Sa.Prf.BlockSize) + buf.EncodeUint8(m.Sa.Prf.DhGroup) + buf.EncodeUint8(m.Sa.Dh.TransformType) + buf.EncodeUint16(m.Sa.Dh.TransformID) + buf.EncodeUint16(m.Sa.Dh.KeyLen) + buf.EncodeUint16(m.Sa.Dh.KeyTrunc) + buf.EncodeUint16(m.Sa.Dh.BlockSize) + buf.EncodeUint8(m.Sa.Dh.DhGroup) + buf.EncodeUint16(m.Sa.Stats.NKeepalives) + buf.EncodeUint16(m.Sa.Stats.NRekeyReq) + buf.EncodeUint16(m.Sa.Stats.NSaInitReq) + buf.EncodeUint16(m.Sa.Stats.NSaAuthReq) + buf.EncodeUint16(m.Sa.Stats.NRetransmit) + buf.EncodeUint16(m.Sa.Stats.NInitSaRetransmit) + return buf.Bytes(), nil +} +func (m *Ikev2SaV2Details) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.Sa.SaIndex = buf.DecodeUint32() + m.Sa.ProfileName = buf.DecodeString(64) + m.Sa.State = ikev2_types.Ikev2State(buf.DecodeUint32()) + m.Sa.Ispi = buf.DecodeUint64() + m.Sa.Rspi = buf.DecodeUint64() + m.Sa.Iaddr.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Sa.Iaddr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Sa.Raddr.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Sa.Raddr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Sa.Keys.SkD = make([]byte, 64) + copy(m.Sa.Keys.SkD, buf.DecodeBytes(len(m.Sa.Keys.SkD))) + m.Sa.Keys.SkDLen = buf.DecodeUint8() + m.Sa.Keys.SkAi = make([]byte, 64) + copy(m.Sa.Keys.SkAi, buf.DecodeBytes(len(m.Sa.Keys.SkAi))) + m.Sa.Keys.SkAiLen = buf.DecodeUint8() + m.Sa.Keys.SkAr = make([]byte, 64) + copy(m.Sa.Keys.SkAr, buf.DecodeBytes(len(m.Sa.Keys.SkAr))) + m.Sa.Keys.SkArLen = buf.DecodeUint8() + m.Sa.Keys.SkEi = make([]byte, 64) + copy(m.Sa.Keys.SkEi, buf.DecodeBytes(len(m.Sa.Keys.SkEi))) + m.Sa.Keys.SkEiLen = buf.DecodeUint8() + m.Sa.Keys.SkEr = make([]byte, 64) + copy(m.Sa.Keys.SkEr, buf.DecodeBytes(len(m.Sa.Keys.SkEr))) + m.Sa.Keys.SkErLen = buf.DecodeUint8() + m.Sa.Keys.SkPi = make([]byte, 64) + copy(m.Sa.Keys.SkPi, buf.DecodeBytes(len(m.Sa.Keys.SkPi))) + m.Sa.Keys.SkPiLen = buf.DecodeUint8() + m.Sa.Keys.SkPr = make([]byte, 64) + copy(m.Sa.Keys.SkPr, buf.DecodeBytes(len(m.Sa.Keys.SkPr))) + m.Sa.Keys.SkPrLen = buf.DecodeUint8() + m.Sa.IID.Type = buf.DecodeUint8() + m.Sa.IID.DataLen = buf.DecodeUint8() + m.Sa.IID.Data = buf.DecodeString(64) + m.Sa.RID.Type = buf.DecodeUint8() + m.Sa.RID.DataLen = buf.DecodeUint8() + m.Sa.RID.Data = buf.DecodeString(64) + m.Sa.Encryption.TransformType = buf.DecodeUint8() + m.Sa.Encryption.TransformID = buf.DecodeUint16() + m.Sa.Encryption.KeyLen = buf.DecodeUint16() + m.Sa.Encryption.KeyTrunc = buf.DecodeUint16() + m.Sa.Encryption.BlockSize = buf.DecodeUint16() + m.Sa.Encryption.DhGroup = buf.DecodeUint8() + m.Sa.Integrity.TransformType = buf.DecodeUint8() + m.Sa.Integrity.TransformID = buf.DecodeUint16() + m.Sa.Integrity.KeyLen = buf.DecodeUint16() + m.Sa.Integrity.KeyTrunc = buf.DecodeUint16() + m.Sa.Integrity.BlockSize = buf.DecodeUint16() + m.Sa.Integrity.DhGroup = buf.DecodeUint8() + m.Sa.Prf.TransformType = buf.DecodeUint8() + m.Sa.Prf.TransformID = buf.DecodeUint16() + m.Sa.Prf.KeyLen = buf.DecodeUint16() + m.Sa.Prf.KeyTrunc = buf.DecodeUint16() + m.Sa.Prf.BlockSize = buf.DecodeUint16() + m.Sa.Prf.DhGroup = buf.DecodeUint8() + m.Sa.Dh.TransformType = buf.DecodeUint8() + m.Sa.Dh.TransformID = buf.DecodeUint16() + m.Sa.Dh.KeyLen = buf.DecodeUint16() + m.Sa.Dh.KeyTrunc = buf.DecodeUint16() + m.Sa.Dh.BlockSize = buf.DecodeUint16() + m.Sa.Dh.DhGroup = buf.DecodeUint8() + m.Sa.Stats.NKeepalives = buf.DecodeUint16() + m.Sa.Stats.NRekeyReq = buf.DecodeUint16() + m.Sa.Stats.NSaInitReq = buf.DecodeUint16() + m.Sa.Stats.NSaAuthReq = buf.DecodeUint16() + m.Sa.Stats.NRetransmit = buf.DecodeUint16() + m.Sa.Stats.NInitSaRetransmit = buf.DecodeUint16() + return nil +} + +// Dump all SAs +// Ikev2SaV2Dump defines message 'ikev2_sa_v2_dump'. +type Ikev2SaV2Dump struct{} + +func (m *Ikev2SaV2Dump) Reset() { *m = Ikev2SaV2Dump{} } +func (*Ikev2SaV2Dump) GetMessageName() string { return "ikev2_sa_v2_dump" } +func (*Ikev2SaV2Dump) GetCrcString() string { return "51077d14" } +func (*Ikev2SaV2Dump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *Ikev2SaV2Dump) Size() (size int) { + if m == nil { + return 0 + } + return size +} +func (m *Ikev2SaV2Dump) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + return buf.Bytes(), nil +} +func (m *Ikev2SaV2Dump) Unmarshal(b []byte) error { + return nil +} + +// Details about IKE SA +// - retval - return code +// - sa - SA data +// +// Ikev2SaV3Details defines message 'ikev2_sa_v3_details'. +// InProgress: the message form may change in the future versions +type Ikev2SaV3Details struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + Sa ikev2_types.Ikev2SaV3 `binapi:"ikev2_sa_v3,name=sa" json:"sa,omitempty"` +} + +func (m *Ikev2SaV3Details) Reset() { *m = Ikev2SaV3Details{} } +func (*Ikev2SaV3Details) GetMessageName() string { return "ikev2_sa_v3_details" } +func (*Ikev2SaV3Details) GetCrcString() string { return "85c9a941" } +func (*Ikev2SaV3Details) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *Ikev2SaV3Details) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.Sa.SaIndex + size += 64 // m.Sa.ProfileName + size += 4 // m.Sa.State + size += 8 // m.Sa.Ispi + size += 8 // m.Sa.Rspi + size += 1 // m.Sa.Iaddr.Af + size += 1 * 16 // m.Sa.Iaddr.Un + size += 1 // m.Sa.Raddr.Af + size += 1 * 16 // m.Sa.Raddr.Un + size += 1 * 64 // m.Sa.Keys.SkD + size += 1 // m.Sa.Keys.SkDLen + size += 1 * 64 // m.Sa.Keys.SkAi + size += 1 // m.Sa.Keys.SkAiLen + size += 1 * 64 // m.Sa.Keys.SkAr + size += 1 // m.Sa.Keys.SkArLen + size += 1 * 64 // m.Sa.Keys.SkEi + size += 1 // m.Sa.Keys.SkEiLen + size += 1 * 64 // m.Sa.Keys.SkEr + size += 1 // m.Sa.Keys.SkErLen + size += 1 * 64 // m.Sa.Keys.SkPi + size += 1 // m.Sa.Keys.SkPiLen + size += 1 * 64 // m.Sa.Keys.SkPr + size += 1 // m.Sa.Keys.SkPrLen + size += 1 // m.Sa.IID.Type + size += 1 // m.Sa.IID.DataLen + size += 64 // m.Sa.IID.Data + size += 1 // m.Sa.RID.Type + size += 1 // m.Sa.RID.DataLen + size += 64 // m.Sa.RID.Data + size += 1 // m.Sa.Encryption.TransformType + size += 2 // m.Sa.Encryption.TransformID + size += 2 // m.Sa.Encryption.KeyLen + size += 2 // m.Sa.Encryption.KeyTrunc + size += 2 // m.Sa.Encryption.BlockSize + size += 1 // m.Sa.Encryption.DhGroup + size += 1 // m.Sa.Integrity.TransformType + size += 2 // m.Sa.Integrity.TransformID + size += 2 // m.Sa.Integrity.KeyLen + size += 2 // m.Sa.Integrity.KeyTrunc + size += 2 // m.Sa.Integrity.BlockSize + size += 1 // m.Sa.Integrity.DhGroup + size += 1 // m.Sa.Prf.TransformType + size += 2 // m.Sa.Prf.TransformID + size += 2 // m.Sa.Prf.KeyLen + size += 2 // m.Sa.Prf.KeyTrunc + size += 2 // m.Sa.Prf.BlockSize + size += 1 // m.Sa.Prf.DhGroup + size += 1 // m.Sa.Dh.TransformType + size += 2 // m.Sa.Dh.TransformID + size += 2 // m.Sa.Dh.KeyLen + size += 2 // m.Sa.Dh.KeyTrunc + size += 2 // m.Sa.Dh.BlockSize + size += 1 // m.Sa.Dh.DhGroup + size += 2 // m.Sa.Stats.NKeepalives + size += 2 // m.Sa.Stats.NRekeyReq + size += 2 // m.Sa.Stats.NSaInitReq + size += 2 // m.Sa.Stats.NSaAuthReq + size += 2 // m.Sa.Stats.NRetransmit + size += 2 // m.Sa.Stats.NInitSaRetransmit + size += 8 // m.Sa.Uptime + return size +} +func (m *Ikev2SaV3Details) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.Sa.SaIndex) + buf.EncodeString(m.Sa.ProfileName, 64) + buf.EncodeUint32(uint32(m.Sa.State)) + buf.EncodeUint64(m.Sa.Ispi) + buf.EncodeUint64(m.Sa.Rspi) + buf.EncodeUint8(uint8(m.Sa.Iaddr.Af)) + buf.EncodeBytes(m.Sa.Iaddr.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(uint8(m.Sa.Raddr.Af)) + buf.EncodeBytes(m.Sa.Raddr.Un.XXX_UnionData[:], 16) + buf.EncodeBytes(m.Sa.Keys.SkD, 64) + buf.EncodeUint8(m.Sa.Keys.SkDLen) + buf.EncodeBytes(m.Sa.Keys.SkAi, 64) + buf.EncodeUint8(m.Sa.Keys.SkAiLen) + buf.EncodeBytes(m.Sa.Keys.SkAr, 64) + buf.EncodeUint8(m.Sa.Keys.SkArLen) + buf.EncodeBytes(m.Sa.Keys.SkEi, 64) + buf.EncodeUint8(m.Sa.Keys.SkEiLen) + buf.EncodeBytes(m.Sa.Keys.SkEr, 64) + buf.EncodeUint8(m.Sa.Keys.SkErLen) + buf.EncodeBytes(m.Sa.Keys.SkPi, 64) + buf.EncodeUint8(m.Sa.Keys.SkPiLen) + buf.EncodeBytes(m.Sa.Keys.SkPr, 64) + buf.EncodeUint8(m.Sa.Keys.SkPrLen) + buf.EncodeUint8(m.Sa.IID.Type) + buf.EncodeUint8(m.Sa.IID.DataLen) + buf.EncodeString(m.Sa.IID.Data, 64) + buf.EncodeUint8(m.Sa.RID.Type) + buf.EncodeUint8(m.Sa.RID.DataLen) + buf.EncodeString(m.Sa.RID.Data, 64) + buf.EncodeUint8(m.Sa.Encryption.TransformType) + buf.EncodeUint16(m.Sa.Encryption.TransformID) + buf.EncodeUint16(m.Sa.Encryption.KeyLen) + buf.EncodeUint16(m.Sa.Encryption.KeyTrunc) + buf.EncodeUint16(m.Sa.Encryption.BlockSize) + buf.EncodeUint8(m.Sa.Encryption.DhGroup) + buf.EncodeUint8(m.Sa.Integrity.TransformType) + buf.EncodeUint16(m.Sa.Integrity.TransformID) + buf.EncodeUint16(m.Sa.Integrity.KeyLen) + buf.EncodeUint16(m.Sa.Integrity.KeyTrunc) + buf.EncodeUint16(m.Sa.Integrity.BlockSize) + buf.EncodeUint8(m.Sa.Integrity.DhGroup) + buf.EncodeUint8(m.Sa.Prf.TransformType) + buf.EncodeUint16(m.Sa.Prf.TransformID) + buf.EncodeUint16(m.Sa.Prf.KeyLen) + buf.EncodeUint16(m.Sa.Prf.KeyTrunc) + buf.EncodeUint16(m.Sa.Prf.BlockSize) + buf.EncodeUint8(m.Sa.Prf.DhGroup) + buf.EncodeUint8(m.Sa.Dh.TransformType) + buf.EncodeUint16(m.Sa.Dh.TransformID) + buf.EncodeUint16(m.Sa.Dh.KeyLen) + buf.EncodeUint16(m.Sa.Dh.KeyTrunc) + buf.EncodeUint16(m.Sa.Dh.BlockSize) + buf.EncodeUint8(m.Sa.Dh.DhGroup) + buf.EncodeUint16(m.Sa.Stats.NKeepalives) + buf.EncodeUint16(m.Sa.Stats.NRekeyReq) + buf.EncodeUint16(m.Sa.Stats.NSaInitReq) + buf.EncodeUint16(m.Sa.Stats.NSaAuthReq) + buf.EncodeUint16(m.Sa.Stats.NRetransmit) + buf.EncodeUint16(m.Sa.Stats.NInitSaRetransmit) + buf.EncodeFloat64(m.Sa.Uptime) + return buf.Bytes(), nil +} +func (m *Ikev2SaV3Details) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.Sa.SaIndex = buf.DecodeUint32() + m.Sa.ProfileName = buf.DecodeString(64) + m.Sa.State = ikev2_types.Ikev2State(buf.DecodeUint32()) + m.Sa.Ispi = buf.DecodeUint64() + m.Sa.Rspi = buf.DecodeUint64() + m.Sa.Iaddr.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Sa.Iaddr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Sa.Raddr.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Sa.Raddr.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Sa.Keys.SkD = make([]byte, 64) + copy(m.Sa.Keys.SkD, buf.DecodeBytes(len(m.Sa.Keys.SkD))) + m.Sa.Keys.SkDLen = buf.DecodeUint8() + m.Sa.Keys.SkAi = make([]byte, 64) + copy(m.Sa.Keys.SkAi, buf.DecodeBytes(len(m.Sa.Keys.SkAi))) + m.Sa.Keys.SkAiLen = buf.DecodeUint8() + m.Sa.Keys.SkAr = make([]byte, 64) + copy(m.Sa.Keys.SkAr, buf.DecodeBytes(len(m.Sa.Keys.SkAr))) + m.Sa.Keys.SkArLen = buf.DecodeUint8() + m.Sa.Keys.SkEi = make([]byte, 64) + copy(m.Sa.Keys.SkEi, buf.DecodeBytes(len(m.Sa.Keys.SkEi))) + m.Sa.Keys.SkEiLen = buf.DecodeUint8() + m.Sa.Keys.SkEr = make([]byte, 64) + copy(m.Sa.Keys.SkEr, buf.DecodeBytes(len(m.Sa.Keys.SkEr))) + m.Sa.Keys.SkErLen = buf.DecodeUint8() + m.Sa.Keys.SkPi = make([]byte, 64) + copy(m.Sa.Keys.SkPi, buf.DecodeBytes(len(m.Sa.Keys.SkPi))) + m.Sa.Keys.SkPiLen = buf.DecodeUint8() + m.Sa.Keys.SkPr = make([]byte, 64) + copy(m.Sa.Keys.SkPr, buf.DecodeBytes(len(m.Sa.Keys.SkPr))) + m.Sa.Keys.SkPrLen = buf.DecodeUint8() + m.Sa.IID.Type = buf.DecodeUint8() + m.Sa.IID.DataLen = buf.DecodeUint8() + m.Sa.IID.Data = buf.DecodeString(64) + m.Sa.RID.Type = buf.DecodeUint8() + m.Sa.RID.DataLen = buf.DecodeUint8() + m.Sa.RID.Data = buf.DecodeString(64) + m.Sa.Encryption.TransformType = buf.DecodeUint8() + m.Sa.Encryption.TransformID = buf.DecodeUint16() + m.Sa.Encryption.KeyLen = buf.DecodeUint16() + m.Sa.Encryption.KeyTrunc = buf.DecodeUint16() + m.Sa.Encryption.BlockSize = buf.DecodeUint16() + m.Sa.Encryption.DhGroup = buf.DecodeUint8() + m.Sa.Integrity.TransformType = buf.DecodeUint8() + m.Sa.Integrity.TransformID = buf.DecodeUint16() + m.Sa.Integrity.KeyLen = buf.DecodeUint16() + m.Sa.Integrity.KeyTrunc = buf.DecodeUint16() + m.Sa.Integrity.BlockSize = buf.DecodeUint16() + m.Sa.Integrity.DhGroup = buf.DecodeUint8() + m.Sa.Prf.TransformType = buf.DecodeUint8() + m.Sa.Prf.TransformID = buf.DecodeUint16() + m.Sa.Prf.KeyLen = buf.DecodeUint16() + m.Sa.Prf.KeyTrunc = buf.DecodeUint16() + m.Sa.Prf.BlockSize = buf.DecodeUint16() + m.Sa.Prf.DhGroup = buf.DecodeUint8() + m.Sa.Dh.TransformType = buf.DecodeUint8() + m.Sa.Dh.TransformID = buf.DecodeUint16() + m.Sa.Dh.KeyLen = buf.DecodeUint16() + m.Sa.Dh.KeyTrunc = buf.DecodeUint16() + m.Sa.Dh.BlockSize = buf.DecodeUint16() + m.Sa.Dh.DhGroup = buf.DecodeUint8() + m.Sa.Stats.NKeepalives = buf.DecodeUint16() + m.Sa.Stats.NRekeyReq = buf.DecodeUint16() + m.Sa.Stats.NSaInitReq = buf.DecodeUint16() + m.Sa.Stats.NSaAuthReq = buf.DecodeUint16() + m.Sa.Stats.NRetransmit = buf.DecodeUint16() + m.Sa.Stats.NInitSaRetransmit = buf.DecodeUint16() + m.Sa.Uptime = buf.DecodeFloat64() + return nil +} + +// Dump all SAs +// Ikev2SaV3Dump defines message 'ikev2_sa_v3_dump'. +// InProgress: the message form may change in the future versions +type Ikev2SaV3Dump struct{} + +func (m *Ikev2SaV3Dump) Reset() { *m = Ikev2SaV3Dump{} } +func (*Ikev2SaV3Dump) GetMessageName() string { return "ikev2_sa_v3_dump" } +func (*Ikev2SaV3Dump) GetCrcString() string { return "51077d14" } +func (*Ikev2SaV3Dump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *Ikev2SaV3Dump) Size() (size int) { + if m == nil { + return 0 + } + return size +} +func (m *Ikev2SaV3Dump) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + return buf.Bytes(), nil +} +func (m *Ikev2SaV3Dump) Unmarshal(b []byte) error { + return nil +} + // IKEv2: Set IKEv2 ESP transforms in SA_INIT proposal (RFC 7296) // - name - IKEv2 profile name // - tr - ESP transforms @@ -2485,6 +3319,10 @@ func init() { file_ikev2_binapi_init() } func file_ikev2_binapi_init() { api.RegisterMessage((*Ikev2ChildSaDetails)(nil), "ikev2_child_sa_details_ff67741f") api.RegisterMessage((*Ikev2ChildSaDump)(nil), "ikev2_child_sa_dump_01eab609") + api.RegisterMessage((*Ikev2ChildSaV2Details)(nil), "ikev2_child_sa_v2_details_1db62aa2") + api.RegisterMessage((*Ikev2ChildSaV2Dump)(nil), "ikev2_child_sa_v2_dump_01eab609") + api.RegisterMessage((*Ikev2GetSleepInterval)(nil), "ikev2_get_sleep_interval_51077d14") + api.RegisterMessage((*Ikev2GetSleepIntervalReply)(nil), "ikev2_get_sleep_interval_reply_78ab91dc") api.RegisterMessage((*Ikev2InitiateDelChildSa)(nil), "ikev2_initiate_del_child_sa_7f004d2e") api.RegisterMessage((*Ikev2InitiateDelChildSaReply)(nil), "ikev2_initiate_del_child_sa_reply_e8d4e804") api.RegisterMessage((*Ikev2InitiateDelIkeSa)(nil), "ikev2_initiate_del_ike_sa_8d125bdd") @@ -2497,6 +3335,8 @@ func file_ikev2_binapi_init() { api.RegisterMessage((*Ikev2NonceGetReply)(nil), "ikev2_nonce_get_reply_1b37a342") api.RegisterMessage((*Ikev2PluginGetVersion)(nil), "ikev2_plugin_get_version_51077d14") api.RegisterMessage((*Ikev2PluginGetVersionReply)(nil), "ikev2_plugin_get_version_reply_9b32cf86") + api.RegisterMessage((*Ikev2PluginSetSleepInterval)(nil), "ikev2_plugin_set_sleep_interval_b7c096ae") + api.RegisterMessage((*Ikev2PluginSetSleepIntervalReply)(nil), "ikev2_plugin_set_sleep_interval_reply_e8d4e804") api.RegisterMessage((*Ikev2ProfileAddDel)(nil), "ikev2_profile_add_del_2c925b55") api.RegisterMessage((*Ikev2ProfileAddDelReply)(nil), "ikev2_profile_add_del_reply_e8d4e804") api.RegisterMessage((*Ikev2ProfileDetails)(nil), "ikev2_profile_details_670d01d9") @@ -2517,6 +3357,10 @@ func file_ikev2_binapi_init() { api.RegisterMessage((*Ikev2ProfileSetUDPEncapReply)(nil), "ikev2_profile_set_udp_encap_reply_e8d4e804") api.RegisterMessage((*Ikev2SaDetails)(nil), "ikev2_sa_details_937c22d5") api.RegisterMessage((*Ikev2SaDump)(nil), "ikev2_sa_dump_51077d14") + api.RegisterMessage((*Ikev2SaV2Details)(nil), "ikev2_sa_v2_details_a616e604") + api.RegisterMessage((*Ikev2SaV2Dump)(nil), "ikev2_sa_v2_dump_51077d14") + api.RegisterMessage((*Ikev2SaV3Details)(nil), "ikev2_sa_v3_details_85c9a941") + api.RegisterMessage((*Ikev2SaV3Dump)(nil), "ikev2_sa_v3_dump_51077d14") api.RegisterMessage((*Ikev2SetEspTransforms)(nil), "ikev2_set_esp_transforms_a63dc205") api.RegisterMessage((*Ikev2SetEspTransformsReply)(nil), "ikev2_set_esp_transforms_reply_e8d4e804") api.RegisterMessage((*Ikev2SetIkeTransforms)(nil), "ikev2_set_ike_transforms_076d7378") @@ -2540,6 +3384,10 @@ func AllMessages() []api.Message { return []api.Message{ (*Ikev2ChildSaDetails)(nil), (*Ikev2ChildSaDump)(nil), + (*Ikev2ChildSaV2Details)(nil), + (*Ikev2ChildSaV2Dump)(nil), + (*Ikev2GetSleepInterval)(nil), + (*Ikev2GetSleepIntervalReply)(nil), (*Ikev2InitiateDelChildSa)(nil), (*Ikev2InitiateDelChildSaReply)(nil), (*Ikev2InitiateDelIkeSa)(nil), @@ -2552,6 +3400,8 @@ func AllMessages() []api.Message { (*Ikev2NonceGetReply)(nil), (*Ikev2PluginGetVersion)(nil), (*Ikev2PluginGetVersionReply)(nil), + (*Ikev2PluginSetSleepInterval)(nil), + (*Ikev2PluginSetSleepIntervalReply)(nil), (*Ikev2ProfileAddDel)(nil), (*Ikev2ProfileAddDelReply)(nil), (*Ikev2ProfileDetails)(nil), @@ -2572,6 +3422,10 @@ func AllMessages() []api.Message { (*Ikev2ProfileSetUDPEncapReply)(nil), (*Ikev2SaDetails)(nil), (*Ikev2SaDump)(nil), + (*Ikev2SaV2Details)(nil), + (*Ikev2SaV2Dump)(nil), + (*Ikev2SaV3Details)(nil), + (*Ikev2SaV3Dump)(nil), (*Ikev2SetEspTransforms)(nil), (*Ikev2SetEspTransformsReply)(nil), (*Ikev2SetIkeTransforms)(nil), diff --git a/vpplink/generated/bindings/ikev2/ikev2_rpc.ba.go b/vpplink/generated/bindings/ikev2/ikev2_rpc.ba.go index 92901ff04..c0068cd5a 100644 --- a/vpplink/generated/bindings/ikev2/ikev2_rpc.ba.go +++ b/vpplink/generated/bindings/ikev2/ikev2_rpc.ba.go @@ -14,12 +14,15 @@ import ( // RPCService defines RPC service ikev2. type RPCService interface { Ikev2ChildSaDump(ctx context.Context, in *Ikev2ChildSaDump) (RPCService_Ikev2ChildSaDumpClient, error) + Ikev2ChildSaV2Dump(ctx context.Context, in *Ikev2ChildSaV2Dump) (RPCService_Ikev2ChildSaV2DumpClient, error) + Ikev2GetSleepInterval(ctx context.Context, in *Ikev2GetSleepInterval) (*Ikev2GetSleepIntervalReply, error) Ikev2InitiateDelChildSa(ctx context.Context, in *Ikev2InitiateDelChildSa) (*Ikev2InitiateDelChildSaReply, error) Ikev2InitiateDelIkeSa(ctx context.Context, in *Ikev2InitiateDelIkeSa) (*Ikev2InitiateDelIkeSaReply, error) Ikev2InitiateRekeyChildSa(ctx context.Context, in *Ikev2InitiateRekeyChildSa) (*Ikev2InitiateRekeyChildSaReply, error) Ikev2InitiateSaInit(ctx context.Context, in *Ikev2InitiateSaInit) (*Ikev2InitiateSaInitReply, error) Ikev2NonceGet(ctx context.Context, in *Ikev2NonceGet) (*Ikev2NonceGetReply, error) Ikev2PluginGetVersion(ctx context.Context, in *Ikev2PluginGetVersion) (*Ikev2PluginGetVersionReply, error) + Ikev2PluginSetSleepInterval(ctx context.Context, in *Ikev2PluginSetSleepInterval) (*Ikev2PluginSetSleepIntervalReply, error) Ikev2ProfileAddDel(ctx context.Context, in *Ikev2ProfileAddDel) (*Ikev2ProfileAddDelReply, error) Ikev2ProfileDisableNatt(ctx context.Context, in *Ikev2ProfileDisableNatt) (*Ikev2ProfileDisableNattReply, error) Ikev2ProfileDump(ctx context.Context, in *Ikev2ProfileDump) (RPCService_Ikev2ProfileDumpClient, error) @@ -30,6 +33,8 @@ type RPCService interface { Ikev2ProfileSetTs(ctx context.Context, in *Ikev2ProfileSetTs) (*Ikev2ProfileSetTsReply, error) Ikev2ProfileSetUDPEncap(ctx context.Context, in *Ikev2ProfileSetUDPEncap) (*Ikev2ProfileSetUDPEncapReply, error) Ikev2SaDump(ctx context.Context, in *Ikev2SaDump) (RPCService_Ikev2SaDumpClient, error) + Ikev2SaV2Dump(ctx context.Context, in *Ikev2SaV2Dump) (RPCService_Ikev2SaV2DumpClient, error) + Ikev2SaV3Dump(ctx context.Context, in *Ikev2SaV3Dump) (RPCService_Ikev2SaV3DumpClient, error) Ikev2SetEspTransforms(ctx context.Context, in *Ikev2SetEspTransforms) (*Ikev2SetEspTransformsReply, error) Ikev2SetIkeTransforms(ctx context.Context, in *Ikev2SetIkeTransforms) (*Ikev2SetIkeTransformsReply, error) Ikev2SetLocalKey(ctx context.Context, in *Ikev2SetLocalKey) (*Ikev2SetLocalKeyReply, error) @@ -91,6 +96,58 @@ func (c *serviceClient_Ikev2ChildSaDumpClient) Recv() (*Ikev2ChildSaDetails, err } } +func (c *serviceClient) Ikev2ChildSaV2Dump(ctx context.Context, in *Ikev2ChildSaV2Dump) (RPCService_Ikev2ChildSaV2DumpClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_Ikev2ChildSaV2DumpClient{stream} + if err := x.Stream.SendMsg(in); err != nil { + return nil, err + } + if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil { + return nil, err + } + return x, nil +} + +type RPCService_Ikev2ChildSaV2DumpClient interface { + Recv() (*Ikev2ChildSaV2Details, error) + api.Stream +} + +type serviceClient_Ikev2ChildSaV2DumpClient struct { + api.Stream +} + +func (c *serviceClient_Ikev2ChildSaV2DumpClient) Recv() (*Ikev2ChildSaV2Details, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *Ikev2ChildSaV2Details: + return m, nil + case *memclnt.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } + return nil, io.EOF + default: + return nil, fmt.Errorf("unexpected message: %T %v", m, m) + } +} + +func (c *serviceClient) Ikev2GetSleepInterval(ctx context.Context, in *Ikev2GetSleepInterval) (*Ikev2GetSleepIntervalReply, error) { + out := new(Ikev2GetSleepIntervalReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + func (c *serviceClient) Ikev2InitiateDelChildSa(ctx context.Context, in *Ikev2InitiateDelChildSa) (*Ikev2InitiateDelChildSaReply, error) { out := new(Ikev2InitiateDelChildSaReply) err := c.conn.Invoke(ctx, in, out) @@ -145,6 +202,15 @@ func (c *serviceClient) Ikev2PluginGetVersion(ctx context.Context, in *Ikev2Plug return out, nil } +func (c *serviceClient) Ikev2PluginSetSleepInterval(ctx context.Context, in *Ikev2PluginSetSleepInterval) (*Ikev2PluginSetSleepIntervalReply, error) { + out := new(Ikev2PluginSetSleepIntervalReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + func (c *serviceClient) Ikev2ProfileAddDel(ctx context.Context, in *Ikev2ProfileAddDel) (*Ikev2ProfileAddDelReply, error) { out := new(Ikev2ProfileAddDelReply) err := c.conn.Invoke(ctx, in, out) @@ -303,6 +369,92 @@ func (c *serviceClient_Ikev2SaDumpClient) Recv() (*Ikev2SaDetails, error) { } } +func (c *serviceClient) Ikev2SaV2Dump(ctx context.Context, in *Ikev2SaV2Dump) (RPCService_Ikev2SaV2DumpClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_Ikev2SaV2DumpClient{stream} + if err := x.Stream.SendMsg(in); err != nil { + return nil, err + } + if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil { + return nil, err + } + return x, nil +} + +type RPCService_Ikev2SaV2DumpClient interface { + Recv() (*Ikev2SaV2Details, error) + api.Stream +} + +type serviceClient_Ikev2SaV2DumpClient struct { + api.Stream +} + +func (c *serviceClient_Ikev2SaV2DumpClient) Recv() (*Ikev2SaV2Details, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *Ikev2SaV2Details: + return m, nil + case *memclnt.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } + return nil, io.EOF + default: + return nil, fmt.Errorf("unexpected message: %T %v", m, m) + } +} + +func (c *serviceClient) Ikev2SaV3Dump(ctx context.Context, in *Ikev2SaV3Dump) (RPCService_Ikev2SaV3DumpClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_Ikev2SaV3DumpClient{stream} + if err := x.Stream.SendMsg(in); err != nil { + return nil, err + } + if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil { + return nil, err + } + return x, nil +} + +type RPCService_Ikev2SaV3DumpClient interface { + Recv() (*Ikev2SaV3Details, error) + api.Stream +} + +type serviceClient_Ikev2SaV3DumpClient struct { + api.Stream +} + +func (c *serviceClient_Ikev2SaV3DumpClient) Recv() (*Ikev2SaV3Details, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *Ikev2SaV3Details: + return m, nil + case *memclnt.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } + return nil, io.EOF + default: + return nil, fmt.Errorf("unexpected message: %T %v", m, m) + } +} + func (c *serviceClient) Ikev2SetEspTransforms(ctx context.Context, in *Ikev2SetEspTransforms) (*Ikev2SetEspTransformsReply, error) { out := new(Ikev2SetEspTransformsReply) err := c.conn.Invoke(ctx, in, out) diff --git a/vpplink/generated/bindings/ikev2_types/ikev2_types.ba.go b/vpplink/generated/bindings/ikev2_types/ikev2_types.ba.go index 37c8e10f3..81324d2f5 100644 --- a/vpplink/generated/bindings/ikev2_types/ikev2_types.ba.go +++ b/vpplink/generated/bindings/ikev2_types/ikev2_types.ba.go @@ -3,10 +3,13 @@ // Package ikev2_types contains generated bindings for API file ikev2_types.api. // // Contents: -// - 12 structs +// - 1 enum +// - 15 structs package ikev2_types import ( + "strconv" + interface_types "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/interface_types" ip_types "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/ip_types" api "go.fd.io/govpp/api" @@ -21,9 +24,54 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "ikev2_types" APIVersion = "1.0.0" - VersionCrc = 0xe7510e + VersionCrc = 0x64c72418 +) + +// Ikev2State defines enum 'ikev2_state'. +type Ikev2State uint32 + +const ( + UNKNOWN Ikev2State = 0 + SA_INIT Ikev2State = 1 + DELETED Ikev2State = 2 + AUTH_FAILED Ikev2State = 3 + AUTHENTICATED Ikev2State = 4 + NOTIFY_AND_DELETE Ikev2State = 5 + TS_UNACCEPTABLE Ikev2State = 6 + NO_PROPOSAL_CHOSEN Ikev2State = 7 +) + +var ( + Ikev2State_name = map[uint32]string{ + 0: "UNKNOWN", + 1: "SA_INIT", + 2: "DELETED", + 3: "AUTH_FAILED", + 4: "AUTHENTICATED", + 5: "NOTIFY_AND_DELETE", + 6: "TS_UNACCEPTABLE", + 7: "NO_PROPOSAL_CHOSEN", + } + Ikev2State_value = map[string]uint32{ + "UNKNOWN": 0, + "SA_INIT": 1, + "DELETED": 2, + "AUTH_FAILED": 3, + "AUTHENTICATED": 4, + "NOTIFY_AND_DELETE": 5, + "TS_UNACCEPTABLE": 6, + "NO_PROPOSAL_CHOSEN": 7, + } ) +func (x Ikev2State) String() string { + s, ok := Ikev2State_name[uint32(x)] + if ok { + return s + } + return "Ikev2State(" + strconv.Itoa(int(x)) + ")" +} + // Ikev2Auth defines type 'ikev2_auth'. type Ikev2Auth struct { Method uint8 `binapi:"u8,name=method" json:"method,omitempty"` @@ -44,6 +92,19 @@ type Ikev2ChildSa struct { Esn Ikev2SaTransform `binapi:"ikev2_sa_transform,name=esn" json:"esn,omitempty"` } +// Ikev2ChildSaV2 defines type 'ikev2_child_sa_v2'. +type Ikev2ChildSaV2 struct { + SaIndex uint32 `binapi:"u32,name=sa_index" json:"sa_index,omitempty"` + ChildSaIndex uint32 `binapi:"u32,name=child_sa_index" json:"child_sa_index,omitempty"` + ISpi uint32 `binapi:"u32,name=i_spi" json:"i_spi,omitempty"` + RSpi uint32 `binapi:"u32,name=r_spi" json:"r_spi,omitempty"` + Keys Ikev2Keys `binapi:"ikev2_keys,name=keys" json:"keys,omitempty"` + Encryption Ikev2SaTransform `binapi:"ikev2_sa_transform,name=encryption" json:"encryption,omitempty"` + Integrity Ikev2SaTransform `binapi:"ikev2_sa_transform,name=integrity" json:"integrity,omitempty"` + Esn Ikev2SaTransform `binapi:"ikev2_sa_transform,name=esn" json:"esn,omitempty"` + Uptime float64 `binapi:"f64,name=uptime" json:"uptime,omitempty"` +} + // Ikev2EspTransforms defines type 'ikev2_esp_transforms'. type Ikev2EspTransforms struct { CryptoAlg uint8 `binapi:"u8,name=crypto_alg" json:"crypto_alg,omitempty"` @@ -149,6 +210,45 @@ type Ikev2SaTransform struct { DhGroup uint8 `binapi:"u8,name=dh_group" json:"dh_group,omitempty"` } +// Ikev2SaV2 defines type 'ikev2_sa_v2'. +type Ikev2SaV2 struct { + SaIndex uint32 `binapi:"u32,name=sa_index" json:"sa_index,omitempty"` + ProfileName string `binapi:"string[64],name=profile_name" json:"profile_name,omitempty"` + State Ikev2State `binapi:"ikev2_state,name=state" json:"state,omitempty"` + Ispi uint64 `binapi:"u64,name=ispi" json:"ispi,omitempty"` + Rspi uint64 `binapi:"u64,name=rspi" json:"rspi,omitempty"` + Iaddr ip_types.Address `binapi:"address,name=iaddr" json:"iaddr,omitempty"` + Raddr ip_types.Address `binapi:"address,name=raddr" json:"raddr,omitempty"` + Keys Ikev2Keys `binapi:"ikev2_keys,name=keys" json:"keys,omitempty"` + IID Ikev2ID `binapi:"ikev2_id,name=i_id" json:"i_id,omitempty"` + RID Ikev2ID `binapi:"ikev2_id,name=r_id" json:"r_id,omitempty"` + Encryption Ikev2SaTransform `binapi:"ikev2_sa_transform,name=encryption" json:"encryption,omitempty"` + Integrity Ikev2SaTransform `binapi:"ikev2_sa_transform,name=integrity" json:"integrity,omitempty"` + Prf Ikev2SaTransform `binapi:"ikev2_sa_transform,name=prf" json:"prf,omitempty"` + Dh Ikev2SaTransform `binapi:"ikev2_sa_transform,name=dh" json:"dh,omitempty"` + Stats Ikev2SaStats `binapi:"ikev2_sa_stats,name=stats" json:"stats,omitempty"` +} + +// Ikev2SaV3 defines type 'ikev2_sa_v3'. +type Ikev2SaV3 struct { + SaIndex uint32 `binapi:"u32,name=sa_index" json:"sa_index,omitempty"` + ProfileName string `binapi:"string[64],name=profile_name" json:"profile_name,omitempty"` + State Ikev2State `binapi:"ikev2_state,name=state" json:"state,omitempty"` + Ispi uint64 `binapi:"u64,name=ispi" json:"ispi,omitempty"` + Rspi uint64 `binapi:"u64,name=rspi" json:"rspi,omitempty"` + Iaddr ip_types.Address `binapi:"address,name=iaddr" json:"iaddr,omitempty"` + Raddr ip_types.Address `binapi:"address,name=raddr" json:"raddr,omitempty"` + Keys Ikev2Keys `binapi:"ikev2_keys,name=keys" json:"keys,omitempty"` + IID Ikev2ID `binapi:"ikev2_id,name=i_id" json:"i_id,omitempty"` + RID Ikev2ID `binapi:"ikev2_id,name=r_id" json:"r_id,omitempty"` + Encryption Ikev2SaTransform `binapi:"ikev2_sa_transform,name=encryption" json:"encryption,omitempty"` + Integrity Ikev2SaTransform `binapi:"ikev2_sa_transform,name=integrity" json:"integrity,omitempty"` + Prf Ikev2SaTransform `binapi:"ikev2_sa_transform,name=prf" json:"prf,omitempty"` + Dh Ikev2SaTransform `binapi:"ikev2_sa_transform,name=dh" json:"dh,omitempty"` + Stats Ikev2SaStats `binapi:"ikev2_sa_stats,name=stats" json:"stats,omitempty"` + Uptime float64 `binapi:"f64,name=uptime" json:"uptime,omitempty"` +} + // Ikev2Ts defines type 'ikev2_ts'. type Ikev2Ts struct { SaIndex uint32 `binapi:"u32,name=sa_index" json:"sa_index,omitempty"` diff --git a/vpplink/generated/bindings/interface/interface.ba.go b/vpplink/generated/bindings/interface/interface.ba.go index 7224f6746..b4d4ced44 100644 --- a/vpplink/generated/bindings/interface/interface.ba.go +++ b/vpplink/generated/bindings/interface/interface.ba.go @@ -3,7 +3,7 @@ // Package interfaces contains generated bindings for API file interface.api. // // Contents: -// - 72 messages +// - 74 messages package interfaces import ( @@ -23,7 +23,7 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "interface" APIVersion = "3.2.3" - VersionCrc = 0x82b1edb3 + VersionCrc = 0x2c32eb46 ) // Enable or disable detailed interface stats @@ -801,6 +801,76 @@ func (m *InterfaceNameRenumberReply) Unmarshal(b []byte) error { return nil } +// pcap_set_filter_function +// - filter_function_name - the name of the filter function +// to set for pcap capture +// +// PcapSetFilterFunction defines message 'pcap_set_filter_function'. +type PcapSetFilterFunction struct { + FilterFunctionName string `binapi:"string[],name=filter_function_name" json:"filter_function_name,omitempty"` +} + +func (m *PcapSetFilterFunction) Reset() { *m = PcapSetFilterFunction{} } +func (*PcapSetFilterFunction) GetMessageName() string { return "pcap_set_filter_function" } +func (*PcapSetFilterFunction) GetCrcString() string { return "616abb92" } +func (*PcapSetFilterFunction) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *PcapSetFilterFunction) Size() (size int) { + if m == nil { + return 0 + } + size += 4 + len(m.FilterFunctionName) // m.FilterFunctionName + return size +} +func (m *PcapSetFilterFunction) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeString(m.FilterFunctionName, 0) + return buf.Bytes(), nil +} +func (m *PcapSetFilterFunction) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.FilterFunctionName = buf.DecodeString(0) + return nil +} + +// PcapSetFilterFunctionReply defines message 'pcap_set_filter_function_reply'. +type PcapSetFilterFunctionReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *PcapSetFilterFunctionReply) Reset() { *m = PcapSetFilterFunctionReply{} } +func (*PcapSetFilterFunctionReply) GetMessageName() string { return "pcap_set_filter_function_reply" } +func (*PcapSetFilterFunctionReply) GetCrcString() string { return "e8d4e804" } +func (*PcapSetFilterFunctionReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *PcapSetFilterFunctionReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *PcapSetFilterFunctionReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *PcapSetFilterFunctionReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + // PcapTraceOff defines message 'pcap_trace_off'. type PcapTraceOff struct{} @@ -2636,13 +2706,13 @@ func (m *SwInterfaceSetTableReply) Unmarshal(b []byte) error { type SwInterfaceSetTxPlacement struct { SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` QueueID uint32 `binapi:"u32,name=queue_id" json:"queue_id,omitempty"` - ArraySize uint8 `binapi:"u8,name=array_size" json:"-"` + ArraySize uint32 `binapi:"u32,name=array_size" json:"-"` Threads []uint32 `binapi:"u32[array_size],name=threads" json:"threads,omitempty"` } func (m *SwInterfaceSetTxPlacement) Reset() { *m = SwInterfaceSetTxPlacement{} } func (*SwInterfaceSetTxPlacement) GetMessageName() string { return "sw_interface_set_tx_placement" } -func (*SwInterfaceSetTxPlacement) GetCrcString() string { return "0b855b40" } +func (*SwInterfaceSetTxPlacement) GetCrcString() string { return "4e0cd5ff" } func (*SwInterfaceSetTxPlacement) GetMessageType() api.MessageType { return api.RequestMessage } @@ -2653,7 +2723,7 @@ func (m *SwInterfaceSetTxPlacement) Size() (size int) { } size += 4 // m.SwIfIndex size += 4 // m.QueueID - size += 1 // m.ArraySize + size += 4 // m.ArraySize size += 4 * len(m.Threads) // m.Threads return size } @@ -2664,7 +2734,7 @@ func (m *SwInterfaceSetTxPlacement) Marshal(b []byte) ([]byte, error) { buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint32(m.QueueID) - buf.EncodeUint8(uint8(len(m.Threads))) + buf.EncodeUint32(uint32(len(m.Threads))) for i := 0; i < len(m.Threads); i++ { var x uint32 if i < len(m.Threads) { @@ -2678,7 +2748,7 @@ func (m *SwInterfaceSetTxPlacement) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) m.QueueID = buf.DecodeUint32() - m.ArraySize = buf.DecodeUint8() + m.ArraySize = buf.DecodeUint32() m.Threads = make([]uint32, m.ArraySize) for i := 0; i < len(m.Threads); i++ { m.Threads[i] = buf.DecodeUint32() @@ -3134,6 +3204,8 @@ func file_interfaces_binapi_init() { api.RegisterMessage((*HwInterfaceSetMtuReply)(nil), "hw_interface_set_mtu_reply_e8d4e804") api.RegisterMessage((*InterfaceNameRenumber)(nil), "interface_name_renumber_2b8858b8") api.RegisterMessage((*InterfaceNameRenumberReply)(nil), "interface_name_renumber_reply_e8d4e804") + api.RegisterMessage((*PcapSetFilterFunction)(nil), "pcap_set_filter_function_616abb92") + api.RegisterMessage((*PcapSetFilterFunctionReply)(nil), "pcap_set_filter_function_reply_e8d4e804") api.RegisterMessage((*PcapTraceOff)(nil), "pcap_trace_off_51077d14") api.RegisterMessage((*PcapTraceOffReply)(nil), "pcap_trace_off_reply_e8d4e804") api.RegisterMessage((*PcapTraceOn)(nil), "pcap_trace_on_cb39e968") @@ -3175,7 +3247,7 @@ func file_interfaces_binapi_init() { api.RegisterMessage((*SwInterfaceSetRxPlacementReply)(nil), "sw_interface_set_rx_placement_reply_e8d4e804") api.RegisterMessage((*SwInterfaceSetTable)(nil), "sw_interface_set_table_df42a577") api.RegisterMessage((*SwInterfaceSetTableReply)(nil), "sw_interface_set_table_reply_e8d4e804") - api.RegisterMessage((*SwInterfaceSetTxPlacement)(nil), "sw_interface_set_tx_placement_0b855b40") + api.RegisterMessage((*SwInterfaceSetTxPlacement)(nil), "sw_interface_set_tx_placement_4e0cd5ff") api.RegisterMessage((*SwInterfaceSetTxPlacementReply)(nil), "sw_interface_set_tx_placement_reply_e8d4e804") api.RegisterMessage((*SwInterfaceSetUnnumbered)(nil), "sw_interface_set_unnumbered_154a6439") api.RegisterMessage((*SwInterfaceSetUnnumberedReply)(nil), "sw_interface_set_unnumbered_reply_e8d4e804") @@ -3211,6 +3283,8 @@ func AllMessages() []api.Message { (*HwInterfaceSetMtuReply)(nil), (*InterfaceNameRenumber)(nil), (*InterfaceNameRenumberReply)(nil), + (*PcapSetFilterFunction)(nil), + (*PcapSetFilterFunctionReply)(nil), (*PcapTraceOff)(nil), (*PcapTraceOffReply)(nil), (*PcapTraceOn)(nil), diff --git a/vpplink/generated/bindings/interface/interface_rpc.ba.go b/vpplink/generated/bindings/interface/interface_rpc.ba.go index a823d8c9c..dd24702a1 100644 --- a/vpplink/generated/bindings/interface/interface_rpc.ba.go +++ b/vpplink/generated/bindings/interface/interface_rpc.ba.go @@ -23,6 +23,7 @@ type RPCService interface { GetBuffersStats(ctx context.Context, in *GetBuffersStats) (*GetBuffersStatsReply, error) HwInterfaceSetMtu(ctx context.Context, in *HwInterfaceSetMtu) (*HwInterfaceSetMtuReply, error) InterfaceNameRenumber(ctx context.Context, in *InterfaceNameRenumber) (*InterfaceNameRenumberReply, error) + PcapSetFilterFunction(ctx context.Context, in *PcapSetFilterFunction) (*PcapSetFilterFunctionReply, error) PcapTraceOff(ctx context.Context, in *PcapTraceOff) (*PcapTraceOffReply, error) PcapTraceOn(ctx context.Context, in *PcapTraceOn) (*PcapTraceOnReply, error) SwInterfaceAddDelAddress(ctx context.Context, in *SwInterfaceAddDelAddress) (*SwInterfaceAddDelAddressReply, error) @@ -148,6 +149,15 @@ func (c *serviceClient) InterfaceNameRenumber(ctx context.Context, in *Interface return out, api.RetvalToVPPApiError(out.Retval) } +func (c *serviceClient) PcapSetFilterFunction(ctx context.Context, in *PcapSetFilterFunction) (*PcapSetFilterFunctionReply, error) { + out := new(PcapSetFilterFunctionReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + func (c *serviceClient) PcapTraceOff(ctx context.Context, in *PcapTraceOff) (*PcapTraceOffReply, error) { out := new(PcapTraceOffReply) err := c.conn.Invoke(ctx, in, out) @@ -454,11 +464,12 @@ func (c *serviceClient_SwInterfaceTxPlacementGetClient) Recv() (*SwInterfaceTxPl return m, nil, nil case *SwInterfaceTxPlacementGetReply: if err := api.RetvalToVPPApiError(m.Retval); err != nil { - return nil, nil, err + c.Stream.Close() + return nil, m, err } err = c.Stream.Close() if err != nil { - return nil, nil, err + return nil, m, err } return nil, m, io.EOF default: diff --git a/vpplink/generated/bindings/ip/ip.ba.go b/vpplink/generated/bindings/ip/ip.ba.go index 47961d989..870c26cc6 100644 --- a/vpplink/generated/bindings/ip/ip.ba.go +++ b/vpplink/generated/bindings/ip/ip.ba.go @@ -5,7 +5,7 @@ // Contents: // - 3 enums // - 7 structs -// - 93 messages +// - 97 messages package ip import ( @@ -29,7 +29,7 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "ip" APIVersion = "3.2.0" - VersionCrc = 0xbd2f873b + VersionCrc = 0xc2b1c41 ) // IPReassType defines enum 'ip_reass_type'. @@ -1908,6 +1908,7 @@ func (m *IPPuntRedirect) Unmarshal(b []byte) error { } // IPPuntRedirectDetails defines message 'ip_punt_redirect_details'. +// Deprecated: the message will be removed in the future versions type IPPuntRedirectDetails struct { Punt PuntRedirect `binapi:"punt_redirect,name=punt" json:"punt,omitempty"` } @@ -1950,6 +1951,7 @@ func (m *IPPuntRedirectDetails) Unmarshal(b []byte) error { } // IPPuntRedirectDump defines message 'ip_punt_redirect_dump'. +// Deprecated: the message will be removed in the future versions type IPPuntRedirectDump struct { SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"` @@ -3772,6 +3774,93 @@ func (m *IPTableAddDelReply) Unmarshal(b []byte) error { return nil } +// Add / del table request - version 2 +// +// A table can be added multiple times, but need be deleted only once. +// - table - the FIB table to add or del +// - create_mfib - whether to create mfib or not +// - is_add - add or del +// +// IPTableAddDelV2 defines message 'ip_table_add_del_v2'. +type IPTableAddDelV2 struct { + Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"` + CreateMfib bool `binapi:"bool,name=create_mfib,default=true" json:"create_mfib,omitempty"` + IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` +} + +func (m *IPTableAddDelV2) Reset() { *m = IPTableAddDelV2{} } +func (*IPTableAddDelV2) GetMessageName() string { return "ip_table_add_del_v2" } +func (*IPTableAddDelV2) GetCrcString() string { return "14e5081f" } +func (*IPTableAddDelV2) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *IPTableAddDelV2) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Table.TableID + size += 1 // m.Table.IsIP6 + size += 64 // m.Table.Name + size += 1 // m.CreateMfib + size += 1 // m.IsAdd + return size +} +func (m *IPTableAddDelV2) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Table.TableID) + buf.EncodeBool(m.Table.IsIP6) + buf.EncodeString(m.Table.Name, 64) + buf.EncodeBool(m.CreateMfib) + buf.EncodeBool(m.IsAdd) + return buf.Bytes(), nil +} +func (m *IPTableAddDelV2) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Table.TableID = buf.DecodeUint32() + m.Table.IsIP6 = buf.DecodeBool() + m.Table.Name = buf.DecodeString(64) + m.CreateMfib = buf.DecodeBool() + m.IsAdd = buf.DecodeBool() + return nil +} + +// IPTableAddDelV2Reply defines message 'ip_table_add_del_v2_reply'. +type IPTableAddDelV2Reply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *IPTableAddDelV2Reply) Reset() { *m = IPTableAddDelV2Reply{} } +func (*IPTableAddDelV2Reply) GetMessageName() string { return "ip_table_add_del_v2_reply" } +func (*IPTableAddDelV2Reply) GetCrcString() string { return "e8d4e804" } +func (*IPTableAddDelV2Reply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *IPTableAddDelV2Reply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *IPTableAddDelV2Reply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *IPTableAddDelV2Reply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + // Allocate an unused table // // A table can be added multiple times. @@ -4693,6 +4782,82 @@ func (m *SetIPFlowHashV3Reply) Unmarshal(b []byte) error { return nil } +// IPv4 interface enable / disable request +// - sw_if_index - interface used to reach neighbor +// - enable - if non-zero enable ip4 on interface, else disable +// +// SwInterfaceIP4EnableDisable defines message 'sw_interface_ip4_enable_disable'. +type SwInterfaceIP4EnableDisable struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"` +} + +func (m *SwInterfaceIP4EnableDisable) Reset() { *m = SwInterfaceIP4EnableDisable{} } +func (*SwInterfaceIP4EnableDisable) GetMessageName() string { return "sw_interface_ip4_enable_disable" } +func (*SwInterfaceIP4EnableDisable) GetCrcString() string { return "ae6cfcfb" } +func (*SwInterfaceIP4EnableDisable) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *SwInterfaceIP4EnableDisable) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + size += 1 // m.Enable + return size +} +func (m *SwInterfaceIP4EnableDisable) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeBool(m.Enable) + return buf.Bytes(), nil +} +func (m *SwInterfaceIP4EnableDisable) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.Enable = buf.DecodeBool() + return nil +} + +// SwInterfaceIP4EnableDisableReply defines message 'sw_interface_ip4_enable_disable_reply'. +type SwInterfaceIP4EnableDisableReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *SwInterfaceIP4EnableDisableReply) Reset() { *m = SwInterfaceIP4EnableDisableReply{} } +func (*SwInterfaceIP4EnableDisableReply) GetMessageName() string { + return "sw_interface_ip4_enable_disable_reply" +} +func (*SwInterfaceIP4EnableDisableReply) GetCrcString() string { return "e8d4e804" } +func (*SwInterfaceIP4EnableDisableReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *SwInterfaceIP4EnableDisableReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *SwInterfaceIP4EnableDisableReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *SwInterfaceIP4EnableDisableReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + // IPv6 interface enable / disable request // - sw_if_index - interface used to reach neighbor // - enable - if non-zero enable ip6 on interface, else disable @@ -4998,6 +5163,8 @@ func file_ip_binapi_init() { api.RegisterMessage((*IPSourceAndPortRangeCheckInterfaceAddDelReply)(nil), "ip_source_and_port_range_check_interface_add_del_reply_e8d4e804") api.RegisterMessage((*IPTableAddDel)(nil), "ip_table_add_del_0ffdaec0") api.RegisterMessage((*IPTableAddDelReply)(nil), "ip_table_add_del_reply_e8d4e804") + api.RegisterMessage((*IPTableAddDelV2)(nil), "ip_table_add_del_v2_14e5081f") + api.RegisterMessage((*IPTableAddDelV2Reply)(nil), "ip_table_add_del_v2_reply_e8d4e804") api.RegisterMessage((*IPTableAllocate)(nil), "ip_table_allocate_b9d2e09e") api.RegisterMessage((*IPTableAllocateReply)(nil), "ip_table_allocate_reply_1728303a") api.RegisterMessage((*IPTableDetails)(nil), "ip_table_details_c79fca0f") @@ -5020,6 +5187,8 @@ func file_ip_binapi_init() { api.RegisterMessage((*SetIPFlowHashV2Reply)(nil), "set_ip_flow_hash_v2_reply_e8d4e804") api.RegisterMessage((*SetIPFlowHashV3)(nil), "set_ip_flow_hash_v3_b7876e07") api.RegisterMessage((*SetIPFlowHashV3Reply)(nil), "set_ip_flow_hash_v3_reply_e8d4e804") + api.RegisterMessage((*SwInterfaceIP4EnableDisable)(nil), "sw_interface_ip4_enable_disable_ae6cfcfb") + api.RegisterMessage((*SwInterfaceIP4EnableDisableReply)(nil), "sw_interface_ip4_enable_disable_reply_e8d4e804") api.RegisterMessage((*SwInterfaceIP6EnableDisable)(nil), "sw_interface_ip6_enable_disable_ae6cfcfb") api.RegisterMessage((*SwInterfaceIP6EnableDisableReply)(nil), "sw_interface_ip6_enable_disable_reply_e8d4e804") api.RegisterMessage((*SwInterfaceIP6GetLinkLocalAddress)(nil), "sw_interface_ip6_get_link_local_address_f9e6675e") @@ -5096,6 +5265,8 @@ func AllMessages() []api.Message { (*IPSourceAndPortRangeCheckInterfaceAddDelReply)(nil), (*IPTableAddDel)(nil), (*IPTableAddDelReply)(nil), + (*IPTableAddDelV2)(nil), + (*IPTableAddDelV2Reply)(nil), (*IPTableAllocate)(nil), (*IPTableAllocateReply)(nil), (*IPTableDetails)(nil), @@ -5118,6 +5289,8 @@ func AllMessages() []api.Message { (*SetIPFlowHashV2Reply)(nil), (*SetIPFlowHashV3)(nil), (*SetIPFlowHashV3Reply)(nil), + (*SwInterfaceIP4EnableDisable)(nil), + (*SwInterfaceIP4EnableDisableReply)(nil), (*SwInterfaceIP6EnableDisable)(nil), (*SwInterfaceIP6EnableDisableReply)(nil), (*SwInterfaceIP6GetLinkLocalAddress)(nil), diff --git a/vpplink/generated/bindings/ip/ip_rpc.ba.go b/vpplink/generated/bindings/ip/ip_rpc.ba.go index 5a2cb4701..af6f25b2b 100644 --- a/vpplink/generated/bindings/ip/ip_rpc.ba.go +++ b/vpplink/generated/bindings/ip/ip_rpc.ba.go @@ -45,6 +45,7 @@ type RPCService interface { IPSourceAndPortRangeCheckAddDel(ctx context.Context, in *IPSourceAndPortRangeCheckAddDel) (*IPSourceAndPortRangeCheckAddDelReply, error) IPSourceAndPortRangeCheckInterfaceAddDel(ctx context.Context, in *IPSourceAndPortRangeCheckInterfaceAddDel) (*IPSourceAndPortRangeCheckInterfaceAddDelReply, error) IPTableAddDel(ctx context.Context, in *IPTableAddDel) (*IPTableAddDelReply, error) + IPTableAddDelV2(ctx context.Context, in *IPTableAddDelV2) (*IPTableAddDelV2Reply, error) IPTableAllocate(ctx context.Context, in *IPTableAllocate) (*IPTableAllocateReply, error) IPTableDump(ctx context.Context, in *IPTableDump) (RPCService_IPTableDumpClient, error) IPTableFlush(ctx context.Context, in *IPTableFlush) (*IPTableFlushReply, error) @@ -56,6 +57,7 @@ type RPCService interface { SetIPFlowHashRouterID(ctx context.Context, in *SetIPFlowHashRouterID) (*SetIPFlowHashRouterIDReply, error) SetIPFlowHashV2(ctx context.Context, in *SetIPFlowHashV2) (*SetIPFlowHashV2Reply, error) SetIPFlowHashV3(ctx context.Context, in *SetIPFlowHashV3) (*SetIPFlowHashV3Reply, error) + SwInterfaceIP4EnableDisable(ctx context.Context, in *SwInterfaceIP4EnableDisable) (*SwInterfaceIP4EnableDisableReply, error) SwInterfaceIP6EnableDisable(ctx context.Context, in *SwInterfaceIP6EnableDisable) (*SwInterfaceIP6EnableDisableReply, error) SwInterfaceIP6GetLinkLocalAddress(ctx context.Context, in *SwInterfaceIP6GetLinkLocalAddress) (*SwInterfaceIP6GetLinkLocalAddressReply, error) SwInterfaceIP6SetLinkLocalAddress(ctx context.Context, in *SwInterfaceIP6SetLinkLocalAddress) (*SwInterfaceIP6SetLinkLocalAddressReply, error) @@ -378,11 +380,12 @@ func (c *serviceClient_IPPathMtuGetClient) Recv() (*IPPathMtuDetails, *IPPathMtu return m, nil, nil case *IPPathMtuGetReply: if err := api.RetvalToVPPApiError(m.Retval); err != nil { - return nil, nil, err + c.Stream.Close() + return nil, m, err } err = c.Stream.Close() if err != nil { - return nil, nil, err + return nil, m, err } return nil, m, io.EOF default: @@ -697,6 +700,15 @@ func (c *serviceClient) IPTableAddDel(ctx context.Context, in *IPTableAddDel) (* return out, api.RetvalToVPPApiError(out.Retval) } +func (c *serviceClient) IPTableAddDelV2(ctx context.Context, in *IPTableAddDelV2) (*IPTableAddDelV2Reply, error) { + out := new(IPTableAddDelV2Reply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + func (c *serviceClient) IPTableAllocate(ctx context.Context, in *IPTableAllocate) (*IPTableAllocateReply, error) { out := new(IPTableAllocateReply) err := c.conn.Invoke(ctx, in, out) @@ -898,6 +910,15 @@ func (c *serviceClient) SetIPFlowHashV3(ctx context.Context, in *SetIPFlowHashV3 return out, api.RetvalToVPPApiError(out.Retval) } +func (c *serviceClient) SwInterfaceIP4EnableDisable(ctx context.Context, in *SwInterfaceIP4EnableDisable) (*SwInterfaceIP4EnableDisableReply, error) { + out := new(SwInterfaceIP4EnableDisableReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + func (c *serviceClient) SwInterfaceIP6EnableDisable(ctx context.Context, in *SwInterfaceIP6EnableDisable) (*SwInterfaceIP6EnableDisableReply, error) { out := new(SwInterfaceIP6EnableDisableReply) err := c.conn.Invoke(ctx, in, out) diff --git a/vpplink/generated/bindings/ip_neighbor/ip_neighbor.ba.go b/vpplink/generated/bindings/ip_neighbor/ip_neighbor.ba.go index e508ea7b2..05fae9ead 100644 --- a/vpplink/generated/bindings/ip_neighbor/ip_neighbor.ba.go +++ b/vpplink/generated/bindings/ip_neighbor/ip_neighbor.ba.go @@ -5,7 +5,7 @@ // Contents: // - 2 enums // - 1 struct -// - 18 messages +// - 20 messages package ip_neighbor import ( @@ -26,8 +26,8 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "ip_neighbor" - APIVersion = "1.0.0" - VersionCrc = 0xfde4a69a + APIVersion = "1.0.1" + VersionCrc = 0x36db39bd ) // IPNeighborEventFlags defines enum 'ip_neighbor_event_flags'. @@ -282,6 +282,102 @@ func (m *IPNeighborConfig) Unmarshal(b []byte) error { return nil } +// Get neighbor database configuration per AF +// - af - Address family (v4/v6) +// +// IPNeighborConfigGet defines message 'ip_neighbor_config_get'. +// InProgress: the message form may change in the future versions +type IPNeighborConfigGet struct { + Af ip_types.AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"` +} + +func (m *IPNeighborConfigGet) Reset() { *m = IPNeighborConfigGet{} } +func (*IPNeighborConfigGet) GetMessageName() string { return "ip_neighbor_config_get" } +func (*IPNeighborConfigGet) GetCrcString() string { return "a5db7bf7" } +func (*IPNeighborConfigGet) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *IPNeighborConfigGet) Size() (size int) { + if m == nil { + return 0 + } + size += 1 // m.Af + return size +} +func (m *IPNeighborConfigGet) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint8(uint8(m.Af)) + return buf.Bytes(), nil +} +func (m *IPNeighborConfigGet) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Af = ip_types.AddressFamily(buf.DecodeUint8()) + return nil +} + +// Neighbor database configuration reply +// - retval - error (0 is "no error") +// - af - Address family (v4/v6) +// - max_number - The maximum number of neighbours that will be created +// - max_age - The maximum age (in seconds) before an inactive neighbour +// is flushed +// - recycle - If max_number of neighbours is reached and new ones need +// to be created, should the oldest neighbour be 'recycled' +// +// IPNeighborConfigGetReply defines message 'ip_neighbor_config_get_reply'. +// InProgress: the message form may change in the future versions +type IPNeighborConfigGetReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + Af ip_types.AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"` + MaxNumber uint32 `binapi:"u32,name=max_number" json:"max_number,omitempty"` + MaxAge uint32 `binapi:"u32,name=max_age" json:"max_age,omitempty"` + Recycle bool `binapi:"bool,name=recycle" json:"recycle,omitempty"` +} + +func (m *IPNeighborConfigGetReply) Reset() { *m = IPNeighborConfigGetReply{} } +func (*IPNeighborConfigGetReply) GetMessageName() string { return "ip_neighbor_config_get_reply" } +func (*IPNeighborConfigGetReply) GetCrcString() string { return "798e6fdd" } +func (*IPNeighborConfigGetReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *IPNeighborConfigGetReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 1 // m.Af + size += 4 // m.MaxNumber + size += 4 // m.MaxAge + size += 1 // m.Recycle + return size +} +func (m *IPNeighborConfigGetReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint8(uint8(m.Af)) + buf.EncodeUint32(m.MaxNumber) + buf.EncodeUint32(m.MaxAge) + buf.EncodeBool(m.Recycle) + return buf.Bytes(), nil +} +func (m *IPNeighborConfigGetReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.Af = ip_types.AddressFamily(buf.DecodeUint8()) + m.MaxNumber = buf.DecodeUint32() + m.MaxAge = buf.DecodeUint32() + m.Recycle = buf.DecodeBool() + return nil +} + // IPNeighborConfigReply defines message 'ip_neighbor_config_reply'. type IPNeighborConfigReply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` @@ -923,6 +1019,8 @@ func file_ip_neighbor_binapi_init() { api.RegisterMessage((*IPNeighborAddDel)(nil), "ip_neighbor_add_del_0607c257") api.RegisterMessage((*IPNeighborAddDelReply)(nil), "ip_neighbor_add_del_reply_1992deab") api.RegisterMessage((*IPNeighborConfig)(nil), "ip_neighbor_config_f4a5cf44") + api.RegisterMessage((*IPNeighborConfigGet)(nil), "ip_neighbor_config_get_a5db7bf7") + api.RegisterMessage((*IPNeighborConfigGetReply)(nil), "ip_neighbor_config_get_reply_798e6fdd") api.RegisterMessage((*IPNeighborConfigReply)(nil), "ip_neighbor_config_reply_e8d4e804") api.RegisterMessage((*IPNeighborDetails)(nil), "ip_neighbor_details_e29d79f0") api.RegisterMessage((*IPNeighborDump)(nil), "ip_neighbor_dump_d817a484") @@ -946,6 +1044,8 @@ func AllMessages() []api.Message { (*IPNeighborAddDel)(nil), (*IPNeighborAddDelReply)(nil), (*IPNeighborConfig)(nil), + (*IPNeighborConfigGet)(nil), + (*IPNeighborConfigGetReply)(nil), (*IPNeighborConfigReply)(nil), (*IPNeighborDetails)(nil), (*IPNeighborDump)(nil), diff --git a/vpplink/generated/bindings/ip_neighbor/ip_neighbor_rpc.ba.go b/vpplink/generated/bindings/ip_neighbor/ip_neighbor_rpc.ba.go index 83f0ab368..a025665a9 100644 --- a/vpplink/generated/bindings/ip_neighbor/ip_neighbor_rpc.ba.go +++ b/vpplink/generated/bindings/ip_neighbor/ip_neighbor_rpc.ba.go @@ -15,6 +15,7 @@ import ( type RPCService interface { IPNeighborAddDel(ctx context.Context, in *IPNeighborAddDel) (*IPNeighborAddDelReply, error) IPNeighborConfig(ctx context.Context, in *IPNeighborConfig) (*IPNeighborConfigReply, error) + IPNeighborConfigGet(ctx context.Context, in *IPNeighborConfigGet) (*IPNeighborConfigGetReply, error) IPNeighborDump(ctx context.Context, in *IPNeighborDump) (RPCService_IPNeighborDumpClient, error) IPNeighborFlush(ctx context.Context, in *IPNeighborFlush) (*IPNeighborFlushReply, error) IPNeighborReplaceBegin(ctx context.Context, in *IPNeighborReplaceBegin) (*IPNeighborReplaceBeginReply, error) @@ -49,6 +50,15 @@ func (c *serviceClient) IPNeighborConfig(ctx context.Context, in *IPNeighborConf return out, api.RetvalToVPPApiError(out.Retval) } +func (c *serviceClient) IPNeighborConfigGet(ctx context.Context, in *IPNeighborConfigGet) (*IPNeighborConfigGetReply, error) { + out := new(IPNeighborConfigGetReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + func (c *serviceClient) IPNeighborDump(ctx context.Context, in *IPNeighborDump) (RPCService_IPNeighborDumpClient, error) { stream, err := c.conn.NewStream(ctx) if err != nil { diff --git a/vpplink/generated/bindings/ip_session_redirect/ip_session_redirect.ba.go b/vpplink/generated/bindings/ip_session_redirect/ip_session_redirect.ba.go new file mode 100644 index 000000000..902866370 --- /dev/null +++ b/vpplink/generated/bindings/ip_session_redirect/ip_session_redirect.ba.go @@ -0,0 +1,668 @@ +// Code generated by GoVPP's binapi-generator. DO NOT EDIT. + +// Package ip_session_redirect contains generated bindings for API file ip_session_redirect.api. +// +// Contents: +// - 8 messages +package ip_session_redirect + +import ( + fib_types "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/fib_types" + _ "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/interface_types" + _ "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/ip_types" + api "go.fd.io/govpp/api" + codec "go.fd.io/govpp/codec" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the GoVPP api package it is being compiled against. +// A compilation error at this line likely means your copy of the +// GoVPP api package needs to be updated. +const _ = api.GoVppAPIPackageIsVersion2 + +const ( + APIFile = "ip_session_redirect" + APIVersion = "0.3.0" + VersionCrc = 0x54be863a +) + +// Add or update a session redirection +// - table_index - classifier table index +// - opaque_index - classifier session opaque index +// - match_len - classifier session match length in bytes (max is 80-bytes) +// - match - classifier session match +// - is_punt - true = punted traffic, false = forwarded traffic +// - n_paths - number of paths +// - paths - the paths of the redirect +// +// IPSessionRedirectAdd defines message 'ip_session_redirect_add'. +// Deprecated: the message will be removed in the future versions +type IPSessionRedirectAdd struct { + TableIndex uint32 `binapi:"u32,name=table_index" json:"table_index,omitempty"` + MatchLen uint8 `binapi:"u8,name=match_len" json:"match_len,omitempty"` + Match []byte `binapi:"u8[80],name=match" json:"match,omitempty"` + OpaqueIndex uint32 `binapi:"u32,name=opaque_index,default=4294967295" json:"opaque_index,omitempty"` + IsPunt bool `binapi:"bool,name=is_punt" json:"is_punt,omitempty"` + NPaths uint8 `binapi:"u8,name=n_paths" json:"-"` + Paths []fib_types.FibPath `binapi:"fib_path[n_paths],name=paths" json:"paths,omitempty"` +} + +func (m *IPSessionRedirectAdd) Reset() { *m = IPSessionRedirectAdd{} } +func (*IPSessionRedirectAdd) GetMessageName() string { return "ip_session_redirect_add" } +func (*IPSessionRedirectAdd) GetCrcString() string { return "2f78ffda" } +func (*IPSessionRedirectAdd) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *IPSessionRedirectAdd) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.TableIndex + size += 1 // m.MatchLen + size += 1 * 80 // m.Match + size += 4 // m.OpaqueIndex + size += 1 // m.IsPunt + size += 1 // m.NPaths + for j1 := 0; j1 < len(m.Paths); j1++ { + var s1 fib_types.FibPath + _ = s1 + if j1 < len(m.Paths) { + s1 = m.Paths[j1] + } + size += 4 // s1.SwIfIndex + size += 4 // s1.TableID + size += 4 // s1.RpfID + size += 1 // s1.Weight + size += 1 // s1.Preference + size += 4 // s1.Type + size += 4 // s1.Flags + size += 4 // s1.Proto + size += 1 * 16 // s1.Nh.Address + size += 4 // s1.Nh.ViaLabel + size += 4 // s1.Nh.ObjID + size += 4 // s1.Nh.ClassifyTableIndex + size += 1 // s1.NLabels + for j2 := 0; j2 < 16; j2++ { + size += 1 // s1.LabelStack[j2].IsUniform + size += 4 // s1.LabelStack[j2].Label + size += 1 // s1.LabelStack[j2].TTL + size += 1 // s1.LabelStack[j2].Exp + } + } + return size +} +func (m *IPSessionRedirectAdd) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.TableIndex) + buf.EncodeUint8(m.MatchLen) + buf.EncodeBytes(m.Match, 80) + buf.EncodeUint32(m.OpaqueIndex) + buf.EncodeBool(m.IsPunt) + buf.EncodeUint8(uint8(len(m.Paths))) + for j0 := 0; j0 < len(m.Paths); j0++ { + var v0 fib_types.FibPath // Paths + if j0 < len(m.Paths) { + v0 = m.Paths[j0] + } + buf.EncodeUint32(v0.SwIfIndex) + buf.EncodeUint32(v0.TableID) + buf.EncodeUint32(v0.RpfID) + buf.EncodeUint8(v0.Weight) + buf.EncodeUint8(v0.Preference) + buf.EncodeUint32(uint32(v0.Type)) + buf.EncodeUint32(uint32(v0.Flags)) + buf.EncodeUint32(uint32(v0.Proto)) + buf.EncodeBytes(v0.Nh.Address.XXX_UnionData[:], 16) + buf.EncodeUint32(v0.Nh.ViaLabel) + buf.EncodeUint32(v0.Nh.ObjID) + buf.EncodeUint32(v0.Nh.ClassifyTableIndex) + buf.EncodeUint8(v0.NLabels) + for j1 := 0; j1 < 16; j1++ { + buf.EncodeUint8(v0.LabelStack[j1].IsUniform) + buf.EncodeUint32(v0.LabelStack[j1].Label) + buf.EncodeUint8(v0.LabelStack[j1].TTL) + buf.EncodeUint8(v0.LabelStack[j1].Exp) + } + } + return buf.Bytes(), nil +} +func (m *IPSessionRedirectAdd) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.TableIndex = buf.DecodeUint32() + m.MatchLen = buf.DecodeUint8() + m.Match = make([]byte, 80) + copy(m.Match, buf.DecodeBytes(len(m.Match))) + m.OpaqueIndex = buf.DecodeUint32() + m.IsPunt = buf.DecodeBool() + m.NPaths = buf.DecodeUint8() + m.Paths = make([]fib_types.FibPath, m.NPaths) + for j0 := 0; j0 < len(m.Paths); j0++ { + m.Paths[j0].SwIfIndex = buf.DecodeUint32() + m.Paths[j0].TableID = buf.DecodeUint32() + m.Paths[j0].RpfID = buf.DecodeUint32() + m.Paths[j0].Weight = buf.DecodeUint8() + m.Paths[j0].Preference = buf.DecodeUint8() + m.Paths[j0].Type = fib_types.FibPathType(buf.DecodeUint32()) + m.Paths[j0].Flags = fib_types.FibPathFlags(buf.DecodeUint32()) + m.Paths[j0].Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) + copy(m.Paths[j0].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Paths[j0].Nh.ViaLabel = buf.DecodeUint32() + m.Paths[j0].Nh.ObjID = buf.DecodeUint32() + m.Paths[j0].Nh.ClassifyTableIndex = buf.DecodeUint32() + m.Paths[j0].NLabels = buf.DecodeUint8() + for j1 := 0; j1 < 16; j1++ { + m.Paths[j0].LabelStack[j1].IsUniform = buf.DecodeUint8() + m.Paths[j0].LabelStack[j1].Label = buf.DecodeUint32() + m.Paths[j0].LabelStack[j1].TTL = buf.DecodeUint8() + m.Paths[j0].LabelStack[j1].Exp = buf.DecodeUint8() + } + } + return nil +} + +// IPSessionRedirectAddReply defines message 'ip_session_redirect_add_reply'. +// Deprecated: the message will be removed in the future versions +type IPSessionRedirectAddReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *IPSessionRedirectAddReply) Reset() { *m = IPSessionRedirectAddReply{} } +func (*IPSessionRedirectAddReply) GetMessageName() string { return "ip_session_redirect_add_reply" } +func (*IPSessionRedirectAddReply) GetCrcString() string { return "e8d4e804" } +func (*IPSessionRedirectAddReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *IPSessionRedirectAddReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *IPSessionRedirectAddReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *IPSessionRedirectAddReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + +// Add or update a session redirection - version 2 +// - table_index - classifier table index +// - opaque_index - classifier session opaque index +// - proto - protocol of forwarded packets (default autodetect from path nh) +// - is_punt - true = punted traffic, false = forwarded traffic +// - match_len - classifier session match length in bytes (max is 80-bytes) +// - match - classifier session match +// - n_paths - number of paths +// - paths - the paths of the redirect +// +// IPSessionRedirectAddV2 defines message 'ip_session_redirect_add_v2'. +// InProgress: the message form may change in the future versions +type IPSessionRedirectAddV2 struct { + TableIndex uint32 `binapi:"u32,name=table_index" json:"table_index,omitempty"` + OpaqueIndex uint32 `binapi:"u32,name=opaque_index,default=4294967295" json:"opaque_index,omitempty"` + Proto fib_types.FibPathNhProto `binapi:"fib_path_nh_proto,name=proto,default=4294967295" json:"proto,omitempty"` + IsPunt bool `binapi:"bool,name=is_punt" json:"is_punt,omitempty"` + MatchLen uint8 `binapi:"u8,name=match_len" json:"match_len,omitempty"` + Match []byte `binapi:"u8[80],name=match" json:"match,omitempty"` + NPaths uint8 `binapi:"u8,name=n_paths" json:"-"` + Paths []fib_types.FibPath `binapi:"fib_path[n_paths],name=paths" json:"paths,omitempty"` +} + +func (m *IPSessionRedirectAddV2) Reset() { *m = IPSessionRedirectAddV2{} } +func (*IPSessionRedirectAddV2) GetMessageName() string { return "ip_session_redirect_add_v2" } +func (*IPSessionRedirectAddV2) GetCrcString() string { return "0765f51f" } +func (*IPSessionRedirectAddV2) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *IPSessionRedirectAddV2) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.TableIndex + size += 4 // m.OpaqueIndex + size += 4 // m.Proto + size += 1 // m.IsPunt + size += 1 // m.MatchLen + size += 1 * 80 // m.Match + size += 1 // m.NPaths + for j1 := 0; j1 < len(m.Paths); j1++ { + var s1 fib_types.FibPath + _ = s1 + if j1 < len(m.Paths) { + s1 = m.Paths[j1] + } + size += 4 // s1.SwIfIndex + size += 4 // s1.TableID + size += 4 // s1.RpfID + size += 1 // s1.Weight + size += 1 // s1.Preference + size += 4 // s1.Type + size += 4 // s1.Flags + size += 4 // s1.Proto + size += 1 * 16 // s1.Nh.Address + size += 4 // s1.Nh.ViaLabel + size += 4 // s1.Nh.ObjID + size += 4 // s1.Nh.ClassifyTableIndex + size += 1 // s1.NLabels + for j2 := 0; j2 < 16; j2++ { + size += 1 // s1.LabelStack[j2].IsUniform + size += 4 // s1.LabelStack[j2].Label + size += 1 // s1.LabelStack[j2].TTL + size += 1 // s1.LabelStack[j2].Exp + } + } + return size +} +func (m *IPSessionRedirectAddV2) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.TableIndex) + buf.EncodeUint32(m.OpaqueIndex) + buf.EncodeUint32(uint32(m.Proto)) + buf.EncodeBool(m.IsPunt) + buf.EncodeUint8(m.MatchLen) + buf.EncodeBytes(m.Match, 80) + buf.EncodeUint8(uint8(len(m.Paths))) + for j0 := 0; j0 < len(m.Paths); j0++ { + var v0 fib_types.FibPath // Paths + if j0 < len(m.Paths) { + v0 = m.Paths[j0] + } + buf.EncodeUint32(v0.SwIfIndex) + buf.EncodeUint32(v0.TableID) + buf.EncodeUint32(v0.RpfID) + buf.EncodeUint8(v0.Weight) + buf.EncodeUint8(v0.Preference) + buf.EncodeUint32(uint32(v0.Type)) + buf.EncodeUint32(uint32(v0.Flags)) + buf.EncodeUint32(uint32(v0.Proto)) + buf.EncodeBytes(v0.Nh.Address.XXX_UnionData[:], 16) + buf.EncodeUint32(v0.Nh.ViaLabel) + buf.EncodeUint32(v0.Nh.ObjID) + buf.EncodeUint32(v0.Nh.ClassifyTableIndex) + buf.EncodeUint8(v0.NLabels) + for j1 := 0; j1 < 16; j1++ { + buf.EncodeUint8(v0.LabelStack[j1].IsUniform) + buf.EncodeUint32(v0.LabelStack[j1].Label) + buf.EncodeUint8(v0.LabelStack[j1].TTL) + buf.EncodeUint8(v0.LabelStack[j1].Exp) + } + } + return buf.Bytes(), nil +} +func (m *IPSessionRedirectAddV2) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.TableIndex = buf.DecodeUint32() + m.OpaqueIndex = buf.DecodeUint32() + m.Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) + m.IsPunt = buf.DecodeBool() + m.MatchLen = buf.DecodeUint8() + m.Match = make([]byte, 80) + copy(m.Match, buf.DecodeBytes(len(m.Match))) + m.NPaths = buf.DecodeUint8() + m.Paths = make([]fib_types.FibPath, m.NPaths) + for j0 := 0; j0 < len(m.Paths); j0++ { + m.Paths[j0].SwIfIndex = buf.DecodeUint32() + m.Paths[j0].TableID = buf.DecodeUint32() + m.Paths[j0].RpfID = buf.DecodeUint32() + m.Paths[j0].Weight = buf.DecodeUint8() + m.Paths[j0].Preference = buf.DecodeUint8() + m.Paths[j0].Type = fib_types.FibPathType(buf.DecodeUint32()) + m.Paths[j0].Flags = fib_types.FibPathFlags(buf.DecodeUint32()) + m.Paths[j0].Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) + copy(m.Paths[j0].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Paths[j0].Nh.ViaLabel = buf.DecodeUint32() + m.Paths[j0].Nh.ObjID = buf.DecodeUint32() + m.Paths[j0].Nh.ClassifyTableIndex = buf.DecodeUint32() + m.Paths[j0].NLabels = buf.DecodeUint8() + for j1 := 0; j1 < 16; j1++ { + m.Paths[j0].LabelStack[j1].IsUniform = buf.DecodeUint8() + m.Paths[j0].LabelStack[j1].Label = buf.DecodeUint32() + m.Paths[j0].LabelStack[j1].TTL = buf.DecodeUint8() + m.Paths[j0].LabelStack[j1].Exp = buf.DecodeUint8() + } + } + return nil +} + +// IPSessionRedirectAddV2Reply defines message 'ip_session_redirect_add_v2_reply'. +// InProgress: the message form may change in the future versions +type IPSessionRedirectAddV2Reply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *IPSessionRedirectAddV2Reply) Reset() { *m = IPSessionRedirectAddV2Reply{} } +func (*IPSessionRedirectAddV2Reply) GetMessageName() string { + return "ip_session_redirect_add_v2_reply" +} +func (*IPSessionRedirectAddV2Reply) GetCrcString() string { return "e8d4e804" } +func (*IPSessionRedirectAddV2Reply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *IPSessionRedirectAddV2Reply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *IPSessionRedirectAddV2Reply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *IPSessionRedirectAddV2Reply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + +// Delete a session redirection +// - table_index - classifier table index +// - match_len - classifier session match length in bytes (max is 80-bytes) +// - match - classifier session match +// +// IPSessionRedirectDel defines message 'ip_session_redirect_del'. +// InProgress: the message form may change in the future versions +type IPSessionRedirectDel struct { + TableIndex uint32 `binapi:"u32,name=table_index" json:"table_index,omitempty"` + MatchLen uint8 `binapi:"u8,name=match_len" json:"-"` + Match []byte `binapi:"u8[match_len],name=match" json:"match,omitempty"` +} + +func (m *IPSessionRedirectDel) Reset() { *m = IPSessionRedirectDel{} } +func (*IPSessionRedirectDel) GetMessageName() string { return "ip_session_redirect_del" } +func (*IPSessionRedirectDel) GetCrcString() string { return "fb643388" } +func (*IPSessionRedirectDel) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *IPSessionRedirectDel) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.TableIndex + size += 1 // m.MatchLen + size += 1 * len(m.Match) // m.Match + return size +} +func (m *IPSessionRedirectDel) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.TableIndex) + buf.EncodeUint8(uint8(len(m.Match))) + buf.EncodeBytes(m.Match, 0) + return buf.Bytes(), nil +} +func (m *IPSessionRedirectDel) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.TableIndex = buf.DecodeUint32() + m.MatchLen = buf.DecodeUint8() + m.Match = make([]byte, m.MatchLen) + copy(m.Match, buf.DecodeBytes(len(m.Match))) + return nil +} + +// IPSessionRedirectDelReply defines message 'ip_session_redirect_del_reply'. +// InProgress: the message form may change in the future versions +type IPSessionRedirectDelReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *IPSessionRedirectDelReply) Reset() { *m = IPSessionRedirectDelReply{} } +func (*IPSessionRedirectDelReply) GetMessageName() string { return "ip_session_redirect_del_reply" } +func (*IPSessionRedirectDelReply) GetCrcString() string { return "e8d4e804" } +func (*IPSessionRedirectDelReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *IPSessionRedirectDelReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *IPSessionRedirectDelReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *IPSessionRedirectDelReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + +// Session redirection operational state response +// - table_index - classifier table index +// - opaque_index - classifier session opaque index +// - is_punt - true = punted traffic, false = forwarded traffic +// - is_ip6 - true = payload proto is ip6, false = payload proto is ip4 +// - match_len - classifier session match length in bytes (max is 80-bytes) +// - match - classifier session match +// - n_paths - number of paths +// - paths - the paths of the redirect +// +// IPSessionRedirectDetails defines message 'ip_session_redirect_details'. +type IPSessionRedirectDetails struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + TableIndex uint32 `binapi:"u32,name=table_index" json:"table_index,omitempty"` + OpaqueIndex uint32 `binapi:"u32,name=opaque_index" json:"opaque_index,omitempty"` + IsPunt bool `binapi:"bool,name=is_punt" json:"is_punt,omitempty"` + IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"` + MatchLength uint32 `binapi:"u32,name=match_length" json:"match_length,omitempty"` + Match []byte `binapi:"u8[80],name=match" json:"match,omitempty"` + NPaths uint8 `binapi:"u8,name=n_paths" json:"-"` + Paths []fib_types.FibPath `binapi:"fib_path[n_paths],name=paths" json:"paths,omitempty"` +} + +func (m *IPSessionRedirectDetails) Reset() { *m = IPSessionRedirectDetails{} } +func (*IPSessionRedirectDetails) GetMessageName() string { return "ip_session_redirect_details" } +func (*IPSessionRedirectDetails) GetCrcString() string { return "4487a233" } +func (*IPSessionRedirectDetails) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *IPSessionRedirectDetails) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.TableIndex + size += 4 // m.OpaqueIndex + size += 1 // m.IsPunt + size += 1 // m.IsIP6 + size += 4 // m.MatchLength + size += 1 * 80 // m.Match + size += 1 // m.NPaths + for j1 := 0; j1 < len(m.Paths); j1++ { + var s1 fib_types.FibPath + _ = s1 + if j1 < len(m.Paths) { + s1 = m.Paths[j1] + } + size += 4 // s1.SwIfIndex + size += 4 // s1.TableID + size += 4 // s1.RpfID + size += 1 // s1.Weight + size += 1 // s1.Preference + size += 4 // s1.Type + size += 4 // s1.Flags + size += 4 // s1.Proto + size += 1 * 16 // s1.Nh.Address + size += 4 // s1.Nh.ViaLabel + size += 4 // s1.Nh.ObjID + size += 4 // s1.Nh.ClassifyTableIndex + size += 1 // s1.NLabels + for j2 := 0; j2 < 16; j2++ { + size += 1 // s1.LabelStack[j2].IsUniform + size += 4 // s1.LabelStack[j2].Label + size += 1 // s1.LabelStack[j2].TTL + size += 1 // s1.LabelStack[j2].Exp + } + } + return size +} +func (m *IPSessionRedirectDetails) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.TableIndex) + buf.EncodeUint32(m.OpaqueIndex) + buf.EncodeBool(m.IsPunt) + buf.EncodeBool(m.IsIP6) + buf.EncodeUint32(m.MatchLength) + buf.EncodeBytes(m.Match, 80) + buf.EncodeUint8(uint8(len(m.Paths))) + for j0 := 0; j0 < len(m.Paths); j0++ { + var v0 fib_types.FibPath // Paths + if j0 < len(m.Paths) { + v0 = m.Paths[j0] + } + buf.EncodeUint32(v0.SwIfIndex) + buf.EncodeUint32(v0.TableID) + buf.EncodeUint32(v0.RpfID) + buf.EncodeUint8(v0.Weight) + buf.EncodeUint8(v0.Preference) + buf.EncodeUint32(uint32(v0.Type)) + buf.EncodeUint32(uint32(v0.Flags)) + buf.EncodeUint32(uint32(v0.Proto)) + buf.EncodeBytes(v0.Nh.Address.XXX_UnionData[:], 16) + buf.EncodeUint32(v0.Nh.ViaLabel) + buf.EncodeUint32(v0.Nh.ObjID) + buf.EncodeUint32(v0.Nh.ClassifyTableIndex) + buf.EncodeUint8(v0.NLabels) + for j1 := 0; j1 < 16; j1++ { + buf.EncodeUint8(v0.LabelStack[j1].IsUniform) + buf.EncodeUint32(v0.LabelStack[j1].Label) + buf.EncodeUint8(v0.LabelStack[j1].TTL) + buf.EncodeUint8(v0.LabelStack[j1].Exp) + } + } + return buf.Bytes(), nil +} +func (m *IPSessionRedirectDetails) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.TableIndex = buf.DecodeUint32() + m.OpaqueIndex = buf.DecodeUint32() + m.IsPunt = buf.DecodeBool() + m.IsIP6 = buf.DecodeBool() + m.MatchLength = buf.DecodeUint32() + m.Match = make([]byte, 80) + copy(m.Match, buf.DecodeBytes(len(m.Match))) + m.NPaths = buf.DecodeUint8() + m.Paths = make([]fib_types.FibPath, m.NPaths) + for j0 := 0; j0 < len(m.Paths); j0++ { + m.Paths[j0].SwIfIndex = buf.DecodeUint32() + m.Paths[j0].TableID = buf.DecodeUint32() + m.Paths[j0].RpfID = buf.DecodeUint32() + m.Paths[j0].Weight = buf.DecodeUint8() + m.Paths[j0].Preference = buf.DecodeUint8() + m.Paths[j0].Type = fib_types.FibPathType(buf.DecodeUint32()) + m.Paths[j0].Flags = fib_types.FibPathFlags(buf.DecodeUint32()) + m.Paths[j0].Proto = fib_types.FibPathNhProto(buf.DecodeUint32()) + copy(m.Paths[j0].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Paths[j0].Nh.ViaLabel = buf.DecodeUint32() + m.Paths[j0].Nh.ObjID = buf.DecodeUint32() + m.Paths[j0].Nh.ClassifyTableIndex = buf.DecodeUint32() + m.Paths[j0].NLabels = buf.DecodeUint8() + for j1 := 0; j1 < 16; j1++ { + m.Paths[j0].LabelStack[j1].IsUniform = buf.DecodeUint8() + m.Paths[j0].LabelStack[j1].Label = buf.DecodeUint32() + m.Paths[j0].LabelStack[j1].TTL = buf.DecodeUint8() + m.Paths[j0].LabelStack[j1].Exp = buf.DecodeUint8() + } + } + return nil +} + +// Dump available session redirections +// - table_index - classifier table index +// +// IPSessionRedirectDump defines message 'ip_session_redirect_dump'. +type IPSessionRedirectDump struct { + TableIndex uint32 `binapi:"u32,name=table_index" json:"table_index,omitempty"` +} + +func (m *IPSessionRedirectDump) Reset() { *m = IPSessionRedirectDump{} } +func (*IPSessionRedirectDump) GetMessageName() string { return "ip_session_redirect_dump" } +func (*IPSessionRedirectDump) GetCrcString() string { return "33554253" } +func (*IPSessionRedirectDump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *IPSessionRedirectDump) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.TableIndex + return size +} +func (m *IPSessionRedirectDump) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.TableIndex) + return buf.Bytes(), nil +} +func (m *IPSessionRedirectDump) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.TableIndex = buf.DecodeUint32() + return nil +} + +func init() { file_ip_session_redirect_binapi_init() } +func file_ip_session_redirect_binapi_init() { + api.RegisterMessage((*IPSessionRedirectAdd)(nil), "ip_session_redirect_add_2f78ffda") + api.RegisterMessage((*IPSessionRedirectAddReply)(nil), "ip_session_redirect_add_reply_e8d4e804") + api.RegisterMessage((*IPSessionRedirectAddV2)(nil), "ip_session_redirect_add_v2_0765f51f") + api.RegisterMessage((*IPSessionRedirectAddV2Reply)(nil), "ip_session_redirect_add_v2_reply_e8d4e804") + api.RegisterMessage((*IPSessionRedirectDel)(nil), "ip_session_redirect_del_fb643388") + api.RegisterMessage((*IPSessionRedirectDelReply)(nil), "ip_session_redirect_del_reply_e8d4e804") + api.RegisterMessage((*IPSessionRedirectDetails)(nil), "ip_session_redirect_details_4487a233") + api.RegisterMessage((*IPSessionRedirectDump)(nil), "ip_session_redirect_dump_33554253") +} + +// Messages returns list of all messages in this module. +func AllMessages() []api.Message { + return []api.Message{ + (*IPSessionRedirectAdd)(nil), + (*IPSessionRedirectAddReply)(nil), + (*IPSessionRedirectAddV2)(nil), + (*IPSessionRedirectAddV2Reply)(nil), + (*IPSessionRedirectDel)(nil), + (*IPSessionRedirectDelReply)(nil), + (*IPSessionRedirectDetails)(nil), + (*IPSessionRedirectDump)(nil), + } +} diff --git a/vpplink/generated/bindings/ip_session_redirect/ip_session_redirect_rpc.ba.go b/vpplink/generated/bindings/ip_session_redirect/ip_session_redirect_rpc.ba.go new file mode 100644 index 000000000..79175cceb --- /dev/null +++ b/vpplink/generated/bindings/ip_session_redirect/ip_session_redirect_rpc.ba.go @@ -0,0 +1,98 @@ +// Code generated by GoVPP's binapi-generator. DO NOT EDIT. + +package ip_session_redirect + +import ( + "context" + "fmt" + "io" + + memclnt "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/memclnt" + api "go.fd.io/govpp/api" +) + +// RPCService defines RPC service ip_session_redirect. +type RPCService interface { + IPSessionRedirectAdd(ctx context.Context, in *IPSessionRedirectAdd) (*IPSessionRedirectAddReply, error) + IPSessionRedirectAddV2(ctx context.Context, in *IPSessionRedirectAddV2) (*IPSessionRedirectAddV2Reply, error) + IPSessionRedirectDel(ctx context.Context, in *IPSessionRedirectDel) (*IPSessionRedirectDelReply, error) + IPSessionRedirectDump(ctx context.Context, in *IPSessionRedirectDump) (RPCService_IPSessionRedirectDumpClient, error) +} + +type serviceClient struct { + conn api.Connection +} + +func NewServiceClient(conn api.Connection) RPCService { + return &serviceClient{conn} +} + +func (c *serviceClient) IPSessionRedirectAdd(ctx context.Context, in *IPSessionRedirectAdd) (*IPSessionRedirectAddReply, error) { + out := new(IPSessionRedirectAddReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) IPSessionRedirectAddV2(ctx context.Context, in *IPSessionRedirectAddV2) (*IPSessionRedirectAddV2Reply, error) { + out := new(IPSessionRedirectAddV2Reply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) IPSessionRedirectDel(ctx context.Context, in *IPSessionRedirectDel) (*IPSessionRedirectDelReply, error) { + out := new(IPSessionRedirectDelReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) IPSessionRedirectDump(ctx context.Context, in *IPSessionRedirectDump) (RPCService_IPSessionRedirectDumpClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_IPSessionRedirectDumpClient{stream} + if err := x.Stream.SendMsg(in); err != nil { + return nil, err + } + if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil { + return nil, err + } + return x, nil +} + +type RPCService_IPSessionRedirectDumpClient interface { + Recv() (*IPSessionRedirectDetails, error) + api.Stream +} + +type serviceClient_IPSessionRedirectDumpClient struct { + api.Stream +} + +func (c *serviceClient_IPSessionRedirectDumpClient) Recv() (*IPSessionRedirectDetails, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *IPSessionRedirectDetails: + return m, nil + case *memclnt.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } + return nil, io.EOF + default: + return nil, fmt.Errorf("unexpected message: %T %v", m, m) + } +} diff --git a/vpplink/generated/bindings/ipsec/ipsec.ba.go b/vpplink/generated/bindings/ipsec/ipsec.ba.go index 90e847b0a..caf0c9c71 100644 --- a/vpplink/generated/bindings/ipsec/ipsec.ba.go +++ b/vpplink/generated/bindings/ipsec/ipsec.ba.go @@ -4,7 +4,7 @@ // // Contents: // - 2 structs -// - 50 messages +// - 60 messages package ipsec import ( @@ -25,7 +25,7 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "ipsec" APIVersion = "5.0.2" - VersionCrc = 0x9dfdcc71 + VersionCrc = 0x8d9c3489 ) // IpsecItf defines type 'ipsec_itf'. @@ -583,6 +583,7 @@ func (m *IpsecSaDump) Unmarshal(b []byte) error { } // IpsecSaV2Details defines message 'ipsec_sa_v2_details'. +// Deprecated: the message will be removed in the future versions type IpsecSaV2Details struct { Entry ipsec_types.IpsecSadEntryV2 `binapi:"ipsec_sad_entry_v2,name=entry" json:"entry,omitempty"` SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` @@ -699,6 +700,7 @@ func (m *IpsecSaV2Details) Unmarshal(b []byte) error { } // IpsecSaV2Dump defines message 'ipsec_sa_v2_dump'. +// Deprecated: the message will be removed in the future versions type IpsecSaV2Dump struct { SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"` } @@ -891,6 +893,411 @@ func (m *IpsecSaV3Dump) Unmarshal(b []byte) error { return nil } +// IpsecSaV4Details defines message 'ipsec_sa_v4_details'. +type IpsecSaV4Details struct { + Entry ipsec_types.IpsecSadEntryV3 `binapi:"ipsec_sad_entry_v3,name=entry" json:"entry,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + SeqOutbound uint64 `binapi:"u64,name=seq_outbound" json:"seq_outbound,omitempty"` + LastSeqInbound uint64 `binapi:"u64,name=last_seq_inbound" json:"last_seq_inbound,omitempty"` + ReplayWindow uint64 `binapi:"u64,name=replay_window" json:"replay_window,omitempty"` + ThreadIndex uint32 `binapi:"u32,name=thread_index" json:"thread_index,omitempty"` + StatIndex uint32 `binapi:"u32,name=stat_index" json:"stat_index,omitempty"` +} + +func (m *IpsecSaV4Details) Reset() { *m = IpsecSaV4Details{} } +func (*IpsecSaV4Details) GetMessageName() string { return "ipsec_sa_v4_details" } +func (*IpsecSaV4Details) GetCrcString() string { return "87a322d7" } +func (*IpsecSaV4Details) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *IpsecSaV4Details) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Entry.SadID + size += 4 // m.Entry.Spi + size += 4 // m.Entry.Protocol + size += 4 // m.Entry.CryptoAlgorithm + size += 1 // m.Entry.CryptoKey.Length + size += 1 * 128 // m.Entry.CryptoKey.Data + size += 4 // m.Entry.IntegrityAlgorithm + size += 1 // m.Entry.IntegrityKey.Length + size += 1 * 128 // m.Entry.IntegrityKey.Data + size += 4 // m.Entry.Flags + size += 4 // m.Entry.Tunnel.Instance + size += 1 // m.Entry.Tunnel.Src.Af + size += 1 * 16 // m.Entry.Tunnel.Src.Un + size += 1 // m.Entry.Tunnel.Dst.Af + size += 1 * 16 // m.Entry.Tunnel.Dst.Un + size += 4 // m.Entry.Tunnel.SwIfIndex + size += 4 // m.Entry.Tunnel.TableID + size += 1 // m.Entry.Tunnel.EncapDecapFlags + size += 1 // m.Entry.Tunnel.Mode + size += 1 // m.Entry.Tunnel.Flags + size += 1 // m.Entry.Tunnel.Dscp + size += 1 // m.Entry.Tunnel.HopLimit + size += 4 // m.Entry.Salt + size += 2 // m.Entry.UDPSrcPort + size += 2 // m.Entry.UDPDstPort + size += 4 // m.SwIfIndex + size += 8 // m.SeqOutbound + size += 8 // m.LastSeqInbound + size += 8 // m.ReplayWindow + size += 4 // m.ThreadIndex + size += 4 // m.StatIndex + return size +} +func (m *IpsecSaV4Details) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Entry.SadID) + buf.EncodeUint32(m.Entry.Spi) + buf.EncodeUint32(uint32(m.Entry.Protocol)) + buf.EncodeUint32(uint32(m.Entry.CryptoAlgorithm)) + buf.EncodeUint8(m.Entry.CryptoKey.Length) + buf.EncodeBytes(m.Entry.CryptoKey.Data, 128) + buf.EncodeUint32(uint32(m.Entry.IntegrityAlgorithm)) + buf.EncodeUint8(m.Entry.IntegrityKey.Length) + buf.EncodeBytes(m.Entry.IntegrityKey.Data, 128) + buf.EncodeUint32(uint32(m.Entry.Flags)) + buf.EncodeUint32(m.Entry.Tunnel.Instance) + buf.EncodeUint8(uint8(m.Entry.Tunnel.Src.Af)) + buf.EncodeBytes(m.Entry.Tunnel.Src.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(uint8(m.Entry.Tunnel.Dst.Af)) + buf.EncodeBytes(m.Entry.Tunnel.Dst.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(uint32(m.Entry.Tunnel.SwIfIndex)) + buf.EncodeUint32(m.Entry.Tunnel.TableID) + buf.EncodeUint8(uint8(m.Entry.Tunnel.EncapDecapFlags)) + buf.EncodeUint8(uint8(m.Entry.Tunnel.Mode)) + buf.EncodeUint8(uint8(m.Entry.Tunnel.Flags)) + buf.EncodeUint8(uint8(m.Entry.Tunnel.Dscp)) + buf.EncodeUint8(m.Entry.Tunnel.HopLimit) + buf.EncodeUint32(m.Entry.Salt) + buf.EncodeUint16(m.Entry.UDPSrcPort) + buf.EncodeUint16(m.Entry.UDPDstPort) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeUint64(m.SeqOutbound) + buf.EncodeUint64(m.LastSeqInbound) + buf.EncodeUint64(m.ReplayWindow) + buf.EncodeUint32(m.ThreadIndex) + buf.EncodeUint32(m.StatIndex) + return buf.Bytes(), nil +} +func (m *IpsecSaV4Details) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Entry.SadID = buf.DecodeUint32() + m.Entry.Spi = buf.DecodeUint32() + m.Entry.Protocol = ipsec_types.IpsecProto(buf.DecodeUint32()) + m.Entry.CryptoAlgorithm = ipsec_types.IpsecCryptoAlg(buf.DecodeUint32()) + m.Entry.CryptoKey.Length = buf.DecodeUint8() + m.Entry.CryptoKey.Data = make([]byte, 128) + copy(m.Entry.CryptoKey.Data, buf.DecodeBytes(len(m.Entry.CryptoKey.Data))) + m.Entry.IntegrityAlgorithm = ipsec_types.IpsecIntegAlg(buf.DecodeUint32()) + m.Entry.IntegrityKey.Length = buf.DecodeUint8() + m.Entry.IntegrityKey.Data = make([]byte, 128) + copy(m.Entry.IntegrityKey.Data, buf.DecodeBytes(len(m.Entry.IntegrityKey.Data))) + m.Entry.Flags = ipsec_types.IpsecSadFlags(buf.DecodeUint32()) + m.Entry.Tunnel.Instance = buf.DecodeUint32() + m.Entry.Tunnel.Src.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Entry.Tunnel.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Entry.Tunnel.Dst.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Entry.Tunnel.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Entry.Tunnel.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.Entry.Tunnel.TableID = buf.DecodeUint32() + m.Entry.Tunnel.EncapDecapFlags = tunnel_types.TunnelEncapDecapFlags(buf.DecodeUint8()) + m.Entry.Tunnel.Mode = tunnel_types.TunnelMode(buf.DecodeUint8()) + m.Entry.Tunnel.Flags = tunnel_types.TunnelFlags(buf.DecodeUint8()) + m.Entry.Tunnel.Dscp = ip_types.IPDscp(buf.DecodeUint8()) + m.Entry.Tunnel.HopLimit = buf.DecodeUint8() + m.Entry.Salt = buf.DecodeUint32() + m.Entry.UDPSrcPort = buf.DecodeUint16() + m.Entry.UDPDstPort = buf.DecodeUint16() + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.SeqOutbound = buf.DecodeUint64() + m.LastSeqInbound = buf.DecodeUint64() + m.ReplayWindow = buf.DecodeUint64() + m.ThreadIndex = buf.DecodeUint32() + m.StatIndex = buf.DecodeUint32() + return nil +} + +// IpsecSaV4Dump defines message 'ipsec_sa_v4_dump'. +type IpsecSaV4Dump struct { + SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"` +} + +func (m *IpsecSaV4Dump) Reset() { *m = IpsecSaV4Dump{} } +func (*IpsecSaV4Dump) GetMessageName() string { return "ipsec_sa_v4_dump" } +func (*IpsecSaV4Dump) GetCrcString() string { return "2076c2f4" } +func (*IpsecSaV4Dump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *IpsecSaV4Dump) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SaID + return size +} +func (m *IpsecSaV4Dump) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.SaID) + return buf.Bytes(), nil +} +func (m *IpsecSaV4Dump) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SaID = buf.DecodeUint32() + return nil +} + +// IpsecSaV5Details defines message 'ipsec_sa_v5_details'. +type IpsecSaV5Details struct { + Entry ipsec_types.IpsecSadEntryV4 `binapi:"ipsec_sad_entry_v4,name=entry" json:"entry,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + SeqOutbound uint64 `binapi:"u64,name=seq_outbound" json:"seq_outbound,omitempty"` + LastSeqInbound uint64 `binapi:"u64,name=last_seq_inbound" json:"last_seq_inbound,omitempty"` + ReplayWindow uint64 `binapi:"u64,name=replay_window" json:"replay_window,omitempty"` + ThreadIndex uint32 `binapi:"u32,name=thread_index" json:"thread_index,omitempty"` + StatIndex uint32 `binapi:"u32,name=stat_index" json:"stat_index,omitempty"` +} + +func (m *IpsecSaV5Details) Reset() { *m = IpsecSaV5Details{} } +func (*IpsecSaV5Details) GetMessageName() string { return "ipsec_sa_v5_details" } +func (*IpsecSaV5Details) GetCrcString() string { return "3cfecfbd" } +func (*IpsecSaV5Details) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *IpsecSaV5Details) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Entry.SadID + size += 4 // m.Entry.Spi + size += 4 // m.Entry.Protocol + size += 4 // m.Entry.CryptoAlgorithm + size += 1 // m.Entry.CryptoKey.Length + size += 1 * 128 // m.Entry.CryptoKey.Data + size += 4 // m.Entry.IntegrityAlgorithm + size += 1 // m.Entry.IntegrityKey.Length + size += 1 * 128 // m.Entry.IntegrityKey.Data + size += 4 // m.Entry.Flags + size += 4 // m.Entry.Tunnel.Instance + size += 1 // m.Entry.Tunnel.Src.Af + size += 1 * 16 // m.Entry.Tunnel.Src.Un + size += 1 // m.Entry.Tunnel.Dst.Af + size += 1 * 16 // m.Entry.Tunnel.Dst.Un + size += 4 // m.Entry.Tunnel.SwIfIndex + size += 4 // m.Entry.Tunnel.TableID + size += 1 // m.Entry.Tunnel.EncapDecapFlags + size += 1 // m.Entry.Tunnel.Mode + size += 1 // m.Entry.Tunnel.Flags + size += 1 // m.Entry.Tunnel.Dscp + size += 1 // m.Entry.Tunnel.HopLimit + size += 4 // m.Entry.Salt + size += 2 // m.Entry.UDPSrcPort + size += 2 // m.Entry.UDPDstPort + size += 4 // m.Entry.AntiReplayWindowSize + size += 4 // m.SwIfIndex + size += 8 // m.SeqOutbound + size += 8 // m.LastSeqInbound + size += 8 // m.ReplayWindow + size += 4 // m.ThreadIndex + size += 4 // m.StatIndex + return size +} +func (m *IpsecSaV5Details) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Entry.SadID) + buf.EncodeUint32(m.Entry.Spi) + buf.EncodeUint32(uint32(m.Entry.Protocol)) + buf.EncodeUint32(uint32(m.Entry.CryptoAlgorithm)) + buf.EncodeUint8(m.Entry.CryptoKey.Length) + buf.EncodeBytes(m.Entry.CryptoKey.Data, 128) + buf.EncodeUint32(uint32(m.Entry.IntegrityAlgorithm)) + buf.EncodeUint8(m.Entry.IntegrityKey.Length) + buf.EncodeBytes(m.Entry.IntegrityKey.Data, 128) + buf.EncodeUint32(uint32(m.Entry.Flags)) + buf.EncodeUint32(m.Entry.Tunnel.Instance) + buf.EncodeUint8(uint8(m.Entry.Tunnel.Src.Af)) + buf.EncodeBytes(m.Entry.Tunnel.Src.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(uint8(m.Entry.Tunnel.Dst.Af)) + buf.EncodeBytes(m.Entry.Tunnel.Dst.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(uint32(m.Entry.Tunnel.SwIfIndex)) + buf.EncodeUint32(m.Entry.Tunnel.TableID) + buf.EncodeUint8(uint8(m.Entry.Tunnel.EncapDecapFlags)) + buf.EncodeUint8(uint8(m.Entry.Tunnel.Mode)) + buf.EncodeUint8(uint8(m.Entry.Tunnel.Flags)) + buf.EncodeUint8(uint8(m.Entry.Tunnel.Dscp)) + buf.EncodeUint8(m.Entry.Tunnel.HopLimit) + buf.EncodeUint32(m.Entry.Salt) + buf.EncodeUint16(m.Entry.UDPSrcPort) + buf.EncodeUint16(m.Entry.UDPDstPort) + buf.EncodeUint32(m.Entry.AntiReplayWindowSize) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeUint64(m.SeqOutbound) + buf.EncodeUint64(m.LastSeqInbound) + buf.EncodeUint64(m.ReplayWindow) + buf.EncodeUint32(m.ThreadIndex) + buf.EncodeUint32(m.StatIndex) + return buf.Bytes(), nil +} +func (m *IpsecSaV5Details) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Entry.SadID = buf.DecodeUint32() + m.Entry.Spi = buf.DecodeUint32() + m.Entry.Protocol = ipsec_types.IpsecProto(buf.DecodeUint32()) + m.Entry.CryptoAlgorithm = ipsec_types.IpsecCryptoAlg(buf.DecodeUint32()) + m.Entry.CryptoKey.Length = buf.DecodeUint8() + m.Entry.CryptoKey.Data = make([]byte, 128) + copy(m.Entry.CryptoKey.Data, buf.DecodeBytes(len(m.Entry.CryptoKey.Data))) + m.Entry.IntegrityAlgorithm = ipsec_types.IpsecIntegAlg(buf.DecodeUint32()) + m.Entry.IntegrityKey.Length = buf.DecodeUint8() + m.Entry.IntegrityKey.Data = make([]byte, 128) + copy(m.Entry.IntegrityKey.Data, buf.DecodeBytes(len(m.Entry.IntegrityKey.Data))) + m.Entry.Flags = ipsec_types.IpsecSadFlags(buf.DecodeUint32()) + m.Entry.Tunnel.Instance = buf.DecodeUint32() + m.Entry.Tunnel.Src.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Entry.Tunnel.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Entry.Tunnel.Dst.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Entry.Tunnel.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Entry.Tunnel.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.Entry.Tunnel.TableID = buf.DecodeUint32() + m.Entry.Tunnel.EncapDecapFlags = tunnel_types.TunnelEncapDecapFlags(buf.DecodeUint8()) + m.Entry.Tunnel.Mode = tunnel_types.TunnelMode(buf.DecodeUint8()) + m.Entry.Tunnel.Flags = tunnel_types.TunnelFlags(buf.DecodeUint8()) + m.Entry.Tunnel.Dscp = ip_types.IPDscp(buf.DecodeUint8()) + m.Entry.Tunnel.HopLimit = buf.DecodeUint8() + m.Entry.Salt = buf.DecodeUint32() + m.Entry.UDPSrcPort = buf.DecodeUint16() + m.Entry.UDPDstPort = buf.DecodeUint16() + m.Entry.AntiReplayWindowSize = buf.DecodeUint32() + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.SeqOutbound = buf.DecodeUint64() + m.LastSeqInbound = buf.DecodeUint64() + m.ReplayWindow = buf.DecodeUint64() + m.ThreadIndex = buf.DecodeUint32() + m.StatIndex = buf.DecodeUint32() + return nil +} + +// IpsecSaV5Dump defines message 'ipsec_sa_v5_dump'. +type IpsecSaV5Dump struct { + SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"` +} + +func (m *IpsecSaV5Dump) Reset() { *m = IpsecSaV5Dump{} } +func (*IpsecSaV5Dump) GetMessageName() string { return "ipsec_sa_v5_dump" } +func (*IpsecSaV5Dump) GetCrcString() string { return "2076c2f4" } +func (*IpsecSaV5Dump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *IpsecSaV5Dump) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SaID + return size +} +func (m *IpsecSaV5Dump) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.SaID) + return buf.Bytes(), nil +} +func (m *IpsecSaV5Dump) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SaID = buf.DecodeUint32() + return nil +} + +// An API to bind an SAD entry to a specific worker +// - sa_id - the id of the SA to bind +// - worker - the worker's index to which the SA will be bound to +// +// IpsecSadBind defines message 'ipsec_sad_bind'. +type IpsecSadBind struct { + SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"` + Worker uint32 `binapi:"u32,name=worker" json:"worker,omitempty"` +} + +func (m *IpsecSadBind) Reset() { *m = IpsecSadBind{} } +func (*IpsecSadBind) GetMessageName() string { return "ipsec_sad_bind" } +func (*IpsecSadBind) GetCrcString() string { return "0649c0d9" } +func (*IpsecSadBind) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *IpsecSadBind) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SaID + size += 4 // m.Worker + return size +} +func (m *IpsecSadBind) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.SaID) + buf.EncodeUint32(m.Worker) + return buf.Bytes(), nil +} +func (m *IpsecSadBind) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SaID = buf.DecodeUint32() + m.Worker = buf.DecodeUint32() + return nil +} + +// IpsecSadBindReply defines message 'ipsec_sad_bind_reply'. +type IpsecSadBindReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *IpsecSadBindReply) Reset() { *m = IpsecSadBindReply{} } +func (*IpsecSadBindReply) GetMessageName() string { return "ipsec_sad_bind_reply" } +func (*IpsecSadBindReply) GetCrcString() string { return "e8d4e804" } +func (*IpsecSadBindReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *IpsecSadBindReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *IpsecSadBindReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *IpsecSadBindReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + // IpsecSadEntryAdd defines message 'ipsec_sad_entry_add'. type IpsecSadEntryAdd struct { Entry ipsec_types.IpsecSadEntryV3 `binapi:"ipsec_sad_entry_v3,name=entry" json:"entry,omitempty"` @@ -1131,6 +1538,7 @@ func (m *IpsecSadEntryAddDelReply) Unmarshal(b []byte) error { } // IpsecSadEntryAddDelV2 defines message 'ipsec_sad_entry_add_del_v2'. +// Deprecated: the message will be removed in the future versions type IpsecSadEntryAddDelV2 struct { IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` Entry ipsec_types.IpsecSadEntryV2 `binapi:"ipsec_sad_entry_v2,name=entry" json:"entry,omitempty"` @@ -1227,6 +1635,7 @@ func (m *IpsecSadEntryAddDelV2) Unmarshal(b []byte) error { } // IpsecSadEntryAddDelV2Reply defines message 'ipsec_sad_entry_add_del_v2_reply'. +// Deprecated: the message will be removed in the future versions type IpsecSadEntryAddDelV2Reply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` StatIndex uint32 `binapi:"u32,name=stat_index" json:"stat_index,omitempty"` @@ -1448,6 +1857,153 @@ func (m *IpsecSadEntryAddReply) Unmarshal(b []byte) error { return nil } +// IpsecSadEntryAddV2 defines message 'ipsec_sad_entry_add_v2'. +type IpsecSadEntryAddV2 struct { + Entry ipsec_types.IpsecSadEntryV4 `binapi:"ipsec_sad_entry_v4,name=entry" json:"entry,omitempty"` +} + +func (m *IpsecSadEntryAddV2) Reset() { *m = IpsecSadEntryAddV2{} } +func (*IpsecSadEntryAddV2) GetMessageName() string { return "ipsec_sad_entry_add_v2" } +func (*IpsecSadEntryAddV2) GetCrcString() string { return "9611297a" } +func (*IpsecSadEntryAddV2) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *IpsecSadEntryAddV2) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Entry.SadID + size += 4 // m.Entry.Spi + size += 4 // m.Entry.Protocol + size += 4 // m.Entry.CryptoAlgorithm + size += 1 // m.Entry.CryptoKey.Length + size += 1 * 128 // m.Entry.CryptoKey.Data + size += 4 // m.Entry.IntegrityAlgorithm + size += 1 // m.Entry.IntegrityKey.Length + size += 1 * 128 // m.Entry.IntegrityKey.Data + size += 4 // m.Entry.Flags + size += 4 // m.Entry.Tunnel.Instance + size += 1 // m.Entry.Tunnel.Src.Af + size += 1 * 16 // m.Entry.Tunnel.Src.Un + size += 1 // m.Entry.Tunnel.Dst.Af + size += 1 * 16 // m.Entry.Tunnel.Dst.Un + size += 4 // m.Entry.Tunnel.SwIfIndex + size += 4 // m.Entry.Tunnel.TableID + size += 1 // m.Entry.Tunnel.EncapDecapFlags + size += 1 // m.Entry.Tunnel.Mode + size += 1 // m.Entry.Tunnel.Flags + size += 1 // m.Entry.Tunnel.Dscp + size += 1 // m.Entry.Tunnel.HopLimit + size += 4 // m.Entry.Salt + size += 2 // m.Entry.UDPSrcPort + size += 2 // m.Entry.UDPDstPort + size += 4 // m.Entry.AntiReplayWindowSize + return size +} +func (m *IpsecSadEntryAddV2) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.Entry.SadID) + buf.EncodeUint32(m.Entry.Spi) + buf.EncodeUint32(uint32(m.Entry.Protocol)) + buf.EncodeUint32(uint32(m.Entry.CryptoAlgorithm)) + buf.EncodeUint8(m.Entry.CryptoKey.Length) + buf.EncodeBytes(m.Entry.CryptoKey.Data, 128) + buf.EncodeUint32(uint32(m.Entry.IntegrityAlgorithm)) + buf.EncodeUint8(m.Entry.IntegrityKey.Length) + buf.EncodeBytes(m.Entry.IntegrityKey.Data, 128) + buf.EncodeUint32(uint32(m.Entry.Flags)) + buf.EncodeUint32(m.Entry.Tunnel.Instance) + buf.EncodeUint8(uint8(m.Entry.Tunnel.Src.Af)) + buf.EncodeBytes(m.Entry.Tunnel.Src.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(uint8(m.Entry.Tunnel.Dst.Af)) + buf.EncodeBytes(m.Entry.Tunnel.Dst.Un.XXX_UnionData[:], 16) + buf.EncodeUint32(uint32(m.Entry.Tunnel.SwIfIndex)) + buf.EncodeUint32(m.Entry.Tunnel.TableID) + buf.EncodeUint8(uint8(m.Entry.Tunnel.EncapDecapFlags)) + buf.EncodeUint8(uint8(m.Entry.Tunnel.Mode)) + buf.EncodeUint8(uint8(m.Entry.Tunnel.Flags)) + buf.EncodeUint8(uint8(m.Entry.Tunnel.Dscp)) + buf.EncodeUint8(m.Entry.Tunnel.HopLimit) + buf.EncodeUint32(m.Entry.Salt) + buf.EncodeUint16(m.Entry.UDPSrcPort) + buf.EncodeUint16(m.Entry.UDPDstPort) + buf.EncodeUint32(m.Entry.AntiReplayWindowSize) + return buf.Bytes(), nil +} +func (m *IpsecSadEntryAddV2) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Entry.SadID = buf.DecodeUint32() + m.Entry.Spi = buf.DecodeUint32() + m.Entry.Protocol = ipsec_types.IpsecProto(buf.DecodeUint32()) + m.Entry.CryptoAlgorithm = ipsec_types.IpsecCryptoAlg(buf.DecodeUint32()) + m.Entry.CryptoKey.Length = buf.DecodeUint8() + m.Entry.CryptoKey.Data = make([]byte, 128) + copy(m.Entry.CryptoKey.Data, buf.DecodeBytes(len(m.Entry.CryptoKey.Data))) + m.Entry.IntegrityAlgorithm = ipsec_types.IpsecIntegAlg(buf.DecodeUint32()) + m.Entry.IntegrityKey.Length = buf.DecodeUint8() + m.Entry.IntegrityKey.Data = make([]byte, 128) + copy(m.Entry.IntegrityKey.Data, buf.DecodeBytes(len(m.Entry.IntegrityKey.Data))) + m.Entry.Flags = ipsec_types.IpsecSadFlags(buf.DecodeUint32()) + m.Entry.Tunnel.Instance = buf.DecodeUint32() + m.Entry.Tunnel.Src.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Entry.Tunnel.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Entry.Tunnel.Dst.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Entry.Tunnel.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Entry.Tunnel.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.Entry.Tunnel.TableID = buf.DecodeUint32() + m.Entry.Tunnel.EncapDecapFlags = tunnel_types.TunnelEncapDecapFlags(buf.DecodeUint8()) + m.Entry.Tunnel.Mode = tunnel_types.TunnelMode(buf.DecodeUint8()) + m.Entry.Tunnel.Flags = tunnel_types.TunnelFlags(buf.DecodeUint8()) + m.Entry.Tunnel.Dscp = ip_types.IPDscp(buf.DecodeUint8()) + m.Entry.Tunnel.HopLimit = buf.DecodeUint8() + m.Entry.Salt = buf.DecodeUint32() + m.Entry.UDPSrcPort = buf.DecodeUint16() + m.Entry.UDPDstPort = buf.DecodeUint16() + m.Entry.AntiReplayWindowSize = buf.DecodeUint32() + return nil +} + +// IpsecSadEntryAddV2Reply defines message 'ipsec_sad_entry_add_v2_reply'. +type IpsecSadEntryAddV2Reply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + StatIndex uint32 `binapi:"u32,name=stat_index" json:"stat_index,omitempty"` +} + +func (m *IpsecSadEntryAddV2Reply) Reset() { *m = IpsecSadEntryAddV2Reply{} } +func (*IpsecSadEntryAddV2Reply) GetMessageName() string { return "ipsec_sad_entry_add_v2_reply" } +func (*IpsecSadEntryAddV2Reply) GetCrcString() string { return "9ffac24b" } +func (*IpsecSadEntryAddV2Reply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *IpsecSadEntryAddV2Reply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.StatIndex + return size +} +func (m *IpsecSadEntryAddV2Reply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(m.StatIndex) + return buf.Bytes(), nil +} +func (m *IpsecSadEntryAddV2Reply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.StatIndex = buf.DecodeUint32() + return nil +} + // IpsecSadEntryDel defines message 'ipsec_sad_entry_del'. type IpsecSadEntryDel struct { ID uint32 `binapi:"u32,name=id" json:"id,omitempty"` @@ -1638,6 +2194,72 @@ func (m *IpsecSadEntryUpdateReply) Unmarshal(b []byte) error { return nil } +// IpsecSadUnbind defines message 'ipsec_sad_unbind'. +type IpsecSadUnbind struct { + SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"` +} + +func (m *IpsecSadUnbind) Reset() { *m = IpsecSadUnbind{} } +func (*IpsecSadUnbind) GetMessageName() string { return "ipsec_sad_unbind" } +func (*IpsecSadUnbind) GetCrcString() string { return "2076c2f4" } +func (*IpsecSadUnbind) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *IpsecSadUnbind) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SaID + return size +} +func (m *IpsecSadUnbind) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.SaID) + return buf.Bytes(), nil +} +func (m *IpsecSadUnbind) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SaID = buf.DecodeUint32() + return nil +} + +// IpsecSadUnbindReply defines message 'ipsec_sad_unbind_reply'. +type IpsecSadUnbindReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *IpsecSadUnbindReply) Reset() { *m = IpsecSadUnbindReply{} } +func (*IpsecSadUnbindReply) GetMessageName() string { return "ipsec_sad_unbind_reply" } +func (*IpsecSadUnbindReply) GetCrcString() string { return "e8d4e804" } +func (*IpsecSadUnbindReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *IpsecSadUnbindReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *IpsecSadUnbindReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *IpsecSadUnbindReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + // Select IPsec backend // - protocol - IPsec protocol (value from ipsec_protocol_t) // - index - backend index @@ -2717,6 +3339,12 @@ func file_ipsec_binapi_init() { api.RegisterMessage((*IpsecSaV2Dump)(nil), "ipsec_sa_v2_dump_2076c2f4") api.RegisterMessage((*IpsecSaV3Details)(nil), "ipsec_sa_v3_details_2fc991ee") api.RegisterMessage((*IpsecSaV3Dump)(nil), "ipsec_sa_v3_dump_2076c2f4") + api.RegisterMessage((*IpsecSaV4Details)(nil), "ipsec_sa_v4_details_87a322d7") + api.RegisterMessage((*IpsecSaV4Dump)(nil), "ipsec_sa_v4_dump_2076c2f4") + api.RegisterMessage((*IpsecSaV5Details)(nil), "ipsec_sa_v5_details_3cfecfbd") + api.RegisterMessage((*IpsecSaV5Dump)(nil), "ipsec_sa_v5_dump_2076c2f4") + api.RegisterMessage((*IpsecSadBind)(nil), "ipsec_sad_bind_0649c0d9") + api.RegisterMessage((*IpsecSadBindReply)(nil), "ipsec_sad_bind_reply_e8d4e804") api.RegisterMessage((*IpsecSadEntryAdd)(nil), "ipsec_sad_entry_add_50229353") api.RegisterMessage((*IpsecSadEntryAddDel)(nil), "ipsec_sad_entry_add_del_ab64b5c6") api.RegisterMessage((*IpsecSadEntryAddDelReply)(nil), "ipsec_sad_entry_add_del_reply_9ffac24b") @@ -2725,10 +3353,14 @@ func file_ipsec_binapi_init() { api.RegisterMessage((*IpsecSadEntryAddDelV3)(nil), "ipsec_sad_entry_add_del_v3_c77ebd92") api.RegisterMessage((*IpsecSadEntryAddDelV3Reply)(nil), "ipsec_sad_entry_add_del_v3_reply_9ffac24b") api.RegisterMessage((*IpsecSadEntryAddReply)(nil), "ipsec_sad_entry_add_reply_9ffac24b") + api.RegisterMessage((*IpsecSadEntryAddV2)(nil), "ipsec_sad_entry_add_v2_9611297a") + api.RegisterMessage((*IpsecSadEntryAddV2Reply)(nil), "ipsec_sad_entry_add_v2_reply_9ffac24b") api.RegisterMessage((*IpsecSadEntryDel)(nil), "ipsec_sad_entry_del_3a91bde5") api.RegisterMessage((*IpsecSadEntryDelReply)(nil), "ipsec_sad_entry_del_reply_e8d4e804") api.RegisterMessage((*IpsecSadEntryUpdate)(nil), "ipsec_sad_entry_update_1412af86") api.RegisterMessage((*IpsecSadEntryUpdateReply)(nil), "ipsec_sad_entry_update_reply_e8d4e804") + api.RegisterMessage((*IpsecSadUnbind)(nil), "ipsec_sad_unbind_2076c2f4") + api.RegisterMessage((*IpsecSadUnbindReply)(nil), "ipsec_sad_unbind_reply_e8d4e804") api.RegisterMessage((*IpsecSelectBackend)(nil), "ipsec_select_backend_5bcfd3b7") api.RegisterMessage((*IpsecSelectBackendReply)(nil), "ipsec_select_backend_reply_e8d4e804") api.RegisterMessage((*IpsecSetAsyncMode)(nil), "ipsec_set_async_mode_a6465f7c") @@ -2772,6 +3404,12 @@ func AllMessages() []api.Message { (*IpsecSaV2Dump)(nil), (*IpsecSaV3Details)(nil), (*IpsecSaV3Dump)(nil), + (*IpsecSaV4Details)(nil), + (*IpsecSaV4Dump)(nil), + (*IpsecSaV5Details)(nil), + (*IpsecSaV5Dump)(nil), + (*IpsecSadBind)(nil), + (*IpsecSadBindReply)(nil), (*IpsecSadEntryAdd)(nil), (*IpsecSadEntryAddDel)(nil), (*IpsecSadEntryAddDelReply)(nil), @@ -2780,10 +3418,14 @@ func AllMessages() []api.Message { (*IpsecSadEntryAddDelV3)(nil), (*IpsecSadEntryAddDelV3Reply)(nil), (*IpsecSadEntryAddReply)(nil), + (*IpsecSadEntryAddV2)(nil), + (*IpsecSadEntryAddV2Reply)(nil), (*IpsecSadEntryDel)(nil), (*IpsecSadEntryDelReply)(nil), (*IpsecSadEntryUpdate)(nil), (*IpsecSadEntryUpdateReply)(nil), + (*IpsecSadUnbind)(nil), + (*IpsecSadUnbindReply)(nil), (*IpsecSelectBackend)(nil), (*IpsecSelectBackendReply)(nil), (*IpsecSetAsyncMode)(nil), diff --git a/vpplink/generated/bindings/ipsec/ipsec_rpc.ba.go b/vpplink/generated/bindings/ipsec/ipsec_rpc.ba.go index 0e795f066..5afc642f5 100644 --- a/vpplink/generated/bindings/ipsec/ipsec_rpc.ba.go +++ b/vpplink/generated/bindings/ipsec/ipsec_rpc.ba.go @@ -21,12 +21,17 @@ type RPCService interface { IpsecSaDump(ctx context.Context, in *IpsecSaDump) (RPCService_IpsecSaDumpClient, error) IpsecSaV2Dump(ctx context.Context, in *IpsecSaV2Dump) (RPCService_IpsecSaV2DumpClient, error) IpsecSaV3Dump(ctx context.Context, in *IpsecSaV3Dump) (RPCService_IpsecSaV3DumpClient, error) + IpsecSaV4Dump(ctx context.Context, in *IpsecSaV4Dump) (RPCService_IpsecSaV4DumpClient, error) + IpsecSaV5Dump(ctx context.Context, in *IpsecSaV5Dump) (RPCService_IpsecSaV5DumpClient, error) + IpsecSadBind(ctx context.Context, in *IpsecSadBind) (*IpsecSadBindReply, error) IpsecSadEntryAdd(ctx context.Context, in *IpsecSadEntryAdd) (*IpsecSadEntryAddReply, error) IpsecSadEntryAddDel(ctx context.Context, in *IpsecSadEntryAddDel) (*IpsecSadEntryAddDelReply, error) IpsecSadEntryAddDelV2(ctx context.Context, in *IpsecSadEntryAddDelV2) (*IpsecSadEntryAddDelV2Reply, error) IpsecSadEntryAddDelV3(ctx context.Context, in *IpsecSadEntryAddDelV3) (*IpsecSadEntryAddDelV3Reply, error) + IpsecSadEntryAddV2(ctx context.Context, in *IpsecSadEntryAddV2) (*IpsecSadEntryAddV2Reply, error) IpsecSadEntryDel(ctx context.Context, in *IpsecSadEntryDel) (*IpsecSadEntryDelReply, error) IpsecSadEntryUpdate(ctx context.Context, in *IpsecSadEntryUpdate) (*IpsecSadEntryUpdateReply, error) + IpsecSadUnbind(ctx context.Context, in *IpsecSadUnbind) (*IpsecSadUnbindReply, error) IpsecSelectBackend(ctx context.Context, in *IpsecSelectBackend) (*IpsecSelectBackendReply, error) IpsecSetAsyncMode(ctx context.Context, in *IpsecSetAsyncMode) (*IpsecSetAsyncModeReply, error) IpsecSpdAddDel(ctx context.Context, in *IpsecSpdAddDel) (*IpsecSpdAddDelReply, error) @@ -290,6 +295,101 @@ func (c *serviceClient_IpsecSaV3DumpClient) Recv() (*IpsecSaV3Details, error) { } } +func (c *serviceClient) IpsecSaV4Dump(ctx context.Context, in *IpsecSaV4Dump) (RPCService_IpsecSaV4DumpClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_IpsecSaV4DumpClient{stream} + if err := x.Stream.SendMsg(in); err != nil { + return nil, err + } + if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil { + return nil, err + } + return x, nil +} + +type RPCService_IpsecSaV4DumpClient interface { + Recv() (*IpsecSaV4Details, error) + api.Stream +} + +type serviceClient_IpsecSaV4DumpClient struct { + api.Stream +} + +func (c *serviceClient_IpsecSaV4DumpClient) Recv() (*IpsecSaV4Details, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *IpsecSaV4Details: + return m, nil + case *memclnt.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } + return nil, io.EOF + default: + return nil, fmt.Errorf("unexpected message: %T %v", m, m) + } +} + +func (c *serviceClient) IpsecSaV5Dump(ctx context.Context, in *IpsecSaV5Dump) (RPCService_IpsecSaV5DumpClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_IpsecSaV5DumpClient{stream} + if err := x.Stream.SendMsg(in); err != nil { + return nil, err + } + if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil { + return nil, err + } + return x, nil +} + +type RPCService_IpsecSaV5DumpClient interface { + Recv() (*IpsecSaV5Details, error) + api.Stream +} + +type serviceClient_IpsecSaV5DumpClient struct { + api.Stream +} + +func (c *serviceClient_IpsecSaV5DumpClient) Recv() (*IpsecSaV5Details, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *IpsecSaV5Details: + return m, nil + case *memclnt.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } + return nil, io.EOF + default: + return nil, fmt.Errorf("unexpected message: %T %v", m, m) + } +} + +func (c *serviceClient) IpsecSadBind(ctx context.Context, in *IpsecSadBind) (*IpsecSadBindReply, error) { + out := new(IpsecSadBindReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + func (c *serviceClient) IpsecSadEntryAdd(ctx context.Context, in *IpsecSadEntryAdd) (*IpsecSadEntryAddReply, error) { out := new(IpsecSadEntryAddReply) err := c.conn.Invoke(ctx, in, out) @@ -326,6 +426,15 @@ func (c *serviceClient) IpsecSadEntryAddDelV3(ctx context.Context, in *IpsecSadE return out, api.RetvalToVPPApiError(out.Retval) } +func (c *serviceClient) IpsecSadEntryAddV2(ctx context.Context, in *IpsecSadEntryAddV2) (*IpsecSadEntryAddV2Reply, error) { + out := new(IpsecSadEntryAddV2Reply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + func (c *serviceClient) IpsecSadEntryDel(ctx context.Context, in *IpsecSadEntryDel) (*IpsecSadEntryDelReply, error) { out := new(IpsecSadEntryDelReply) err := c.conn.Invoke(ctx, in, out) @@ -344,6 +453,15 @@ func (c *serviceClient) IpsecSadEntryUpdate(ctx context.Context, in *IpsecSadEnt return out, api.RetvalToVPPApiError(out.Retval) } +func (c *serviceClient) IpsecSadUnbind(ctx context.Context, in *IpsecSadUnbind) (*IpsecSadUnbindReply, error) { + out := new(IpsecSadUnbindReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + func (c *serviceClient) IpsecSelectBackend(ctx context.Context, in *IpsecSelectBackend) (*IpsecSelectBackendReply, error) { out := new(IpsecSelectBackendReply) err := c.conn.Invoke(ctx, in, out) diff --git a/vpplink/generated/bindings/ipsec_types/ipsec_types.ba.go b/vpplink/generated/bindings/ipsec_types/ipsec_types.ba.go index 20133b60d..120eba126 100644 --- a/vpplink/generated/bindings/ipsec_types/ipsec_types.ba.go +++ b/vpplink/generated/bindings/ipsec_types/ipsec_types.ba.go @@ -4,7 +4,7 @@ // // Contents: // - 5 enums -// - 6 structs +// - 7 structs package ipsec_types import ( @@ -25,7 +25,7 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "ipsec_types" APIVersion = "3.0.1" - VersionCrc = 0x7892423b + VersionCrc = 0x9b9b8bc ) // IpsecCryptoAlg defines enum 'ipsec_crypto_alg'. @@ -45,6 +45,9 @@ const ( IPSEC_API_CRYPTO_ALG_DES_CBC IpsecCryptoAlg = 10 IPSEC_API_CRYPTO_ALG_3DES_CBC IpsecCryptoAlg = 11 IPSEC_API_CRYPTO_ALG_CHACHA20_POLY1305 IpsecCryptoAlg = 12 + IPSEC_API_CRYPTO_ALG_AES_NULL_GMAC_128 IpsecCryptoAlg = 13 + IPSEC_API_CRYPTO_ALG_AES_NULL_GMAC_192 IpsecCryptoAlg = 14 + IPSEC_API_CRYPTO_ALG_AES_NULL_GMAC_256 IpsecCryptoAlg = 15 ) var ( @@ -62,6 +65,9 @@ var ( 10: "IPSEC_API_CRYPTO_ALG_DES_CBC", 11: "IPSEC_API_CRYPTO_ALG_3DES_CBC", 12: "IPSEC_API_CRYPTO_ALG_CHACHA20_POLY1305", + 13: "IPSEC_API_CRYPTO_ALG_AES_NULL_GMAC_128", + 14: "IPSEC_API_CRYPTO_ALG_AES_NULL_GMAC_192", + 15: "IPSEC_API_CRYPTO_ALG_AES_NULL_GMAC_256", } IpsecCryptoAlg_value = map[string]uint32{ "IPSEC_API_CRYPTO_ALG_NONE": 0, @@ -77,6 +83,9 @@ var ( "IPSEC_API_CRYPTO_ALG_DES_CBC": 10, "IPSEC_API_CRYPTO_ALG_3DES_CBC": 11, "IPSEC_API_CRYPTO_ALG_CHACHA20_POLY1305": 12, + "IPSEC_API_CRYPTO_ALG_AES_NULL_GMAC_128": 13, + "IPSEC_API_CRYPTO_ALG_AES_NULL_GMAC_192": 14, + "IPSEC_API_CRYPTO_ALG_AES_NULL_GMAC_256": 15, } ) @@ -308,6 +317,23 @@ type IpsecSadEntryV3 struct { UDPDstPort uint16 `binapi:"u16,name=udp_dst_port,default=4500" json:"udp_dst_port,omitempty"` } +// IpsecSadEntryV4 defines type 'ipsec_sad_entry_v4'. +type IpsecSadEntryV4 struct { + SadID uint32 `binapi:"u32,name=sad_id" json:"sad_id,omitempty"` + Spi uint32 `binapi:"u32,name=spi" json:"spi,omitempty"` + Protocol IpsecProto `binapi:"ipsec_proto,name=protocol" json:"protocol,omitempty"` + CryptoAlgorithm IpsecCryptoAlg `binapi:"ipsec_crypto_alg,name=crypto_algorithm" json:"crypto_algorithm,omitempty"` + CryptoKey Key `binapi:"key,name=crypto_key" json:"crypto_key,omitempty"` + IntegrityAlgorithm IpsecIntegAlg `binapi:"ipsec_integ_alg,name=integrity_algorithm" json:"integrity_algorithm,omitempty"` + IntegrityKey Key `binapi:"key,name=integrity_key" json:"integrity_key,omitempty"` + Flags IpsecSadFlags `binapi:"ipsec_sad_flags,name=flags" json:"flags,omitempty"` + Tunnel tunnel_types.Tunnel `binapi:"tunnel,name=tunnel" json:"tunnel,omitempty"` + Salt uint32 `binapi:"u32,name=salt" json:"salt,omitempty"` + UDPSrcPort uint16 `binapi:"u16,name=udp_src_port,default=4500" json:"udp_src_port,omitempty"` + UDPDstPort uint16 `binapi:"u16,name=udp_dst_port,default=4500" json:"udp_dst_port,omitempty"` + AntiReplayWindowSize uint32 `binapi:"u32,name=anti_replay_window_size,default=64" json:"anti_replay_window_size,omitempty"` +} + // IpsecSpdEntry defines type 'ipsec_spd_entry'. type IpsecSpdEntry struct { SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"` diff --git a/vpplink/generated/bindings/memclnt/memclnt.ba.go b/vpplink/generated/bindings/memclnt/memclnt.ba.go index 87f475531..fcffc9589 100644 --- a/vpplink/generated/bindings/memclnt/memclnt.ba.go +++ b/vpplink/generated/bindings/memclnt/memclnt.ba.go @@ -4,7 +4,7 @@ // // Contents: // - 2 structs -// - 26 messages +// - 28 messages package memclnt import ( @@ -21,7 +21,7 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "memclnt" APIVersion = "2.1.0" - VersionCrc = 0x21d36234 + VersionCrc = 0xb197c551 ) // MessageTableEntry defines type 'message_table_entry'. @@ -207,6 +207,70 @@ func (m *ControlPingReply) Unmarshal(b []byte) error { return nil } +// GetAPIJSON defines message 'get_api_json'. +type GetAPIJSON struct{} + +func (m *GetAPIJSON) Reset() { *m = GetAPIJSON{} } +func (*GetAPIJSON) GetMessageName() string { return "get_api_json" } +func (*GetAPIJSON) GetCrcString() string { return "51077d14" } +func (*GetAPIJSON) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *GetAPIJSON) Size() (size int) { + if m == nil { + return 0 + } + return size +} +func (m *GetAPIJSON) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + return buf.Bytes(), nil +} +func (m *GetAPIJSON) Unmarshal(b []byte) error { + return nil +} + +// GetAPIJSONReply defines message 'get_api_json_reply'. +type GetAPIJSONReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + JSON string `binapi:"string[],name=json" json:"json,omitempty"` +} + +func (m *GetAPIJSONReply) Reset() { *m = GetAPIJSONReply{} } +func (*GetAPIJSONReply) GetMessageName() string { return "get_api_json_reply" } +func (*GetAPIJSONReply) GetCrcString() string { return "ea715b59" } +func (*GetAPIJSONReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *GetAPIJSONReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 + len(m.JSON) // m.JSON + return size +} +func (m *GetAPIJSONReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeString(m.JSON, 0) + return buf.Bytes(), nil +} +func (m *GetAPIJSONReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.JSON = buf.DecodeString(0) + return nil +} + // /* // - Lookup message-ID base by name // @@ -284,6 +348,7 @@ func (m *GetFirstMsgIDReply) Unmarshal(b []byte) error { // - Create a client registration // // MemclntCreate defines message 'memclnt_create'. +// Deprecated: the message will be removed in the future versions type MemclntCreate struct { CtxQuota int32 `binapi:"i32,name=ctx_quota" json:"ctx_quota,omitempty"` InputQueue uint64 `binapi:"u64,name=input_queue" json:"input_queue,omitempty"` @@ -338,6 +403,7 @@ func (m *MemclntCreate) Unmarshal(b []byte) error { } // MemclntCreateReply defines message 'memclnt_create_reply'. +// Deprecated: the message will be removed in the future versions type MemclntCreateReply struct { Response int32 `binapi:"i32,name=response" json:"response,omitempty"` Handle uint64 `binapi:"u64,name=handle" json:"handle,omitempty"` @@ -1135,6 +1201,8 @@ func file_memclnt_binapi_init() { api.RegisterMessage((*APIVersionsReply)(nil), "api_versions_reply_5f0d99d6") api.RegisterMessage((*ControlPing)(nil), "control_ping_51077d14") api.RegisterMessage((*ControlPingReply)(nil), "control_ping_reply_f6b0b8ca") + api.RegisterMessage((*GetAPIJSON)(nil), "get_api_json_51077d14") + api.RegisterMessage((*GetAPIJSONReply)(nil), "get_api_json_reply_ea715b59") api.RegisterMessage((*GetFirstMsgID)(nil), "get_first_msg_id_ebf79a66") api.RegisterMessage((*GetFirstMsgIDReply)(nil), "get_first_msg_id_reply_7d337472") api.RegisterMessage((*MemclntCreate)(nil), "memclnt_create_9c5e1c2f") @@ -1166,6 +1234,8 @@ func AllMessages() []api.Message { (*APIVersionsReply)(nil), (*ControlPing)(nil), (*ControlPingReply)(nil), + (*GetAPIJSON)(nil), + (*GetAPIJSONReply)(nil), (*GetFirstMsgID)(nil), (*GetFirstMsgIDReply)(nil), (*MemclntCreate)(nil), diff --git a/vpplink/generated/bindings/memclnt/memclnt_rpc.ba.go b/vpplink/generated/bindings/memclnt/memclnt_rpc.ba.go index c8efe37e9..fb2028e39 100644 --- a/vpplink/generated/bindings/memclnt/memclnt_rpc.ba.go +++ b/vpplink/generated/bindings/memclnt/memclnt_rpc.ba.go @@ -12,6 +12,7 @@ import ( type RPCService interface { APIVersions(ctx context.Context, in *APIVersions) (*APIVersionsReply, error) ControlPing(ctx context.Context, in *ControlPing) (*ControlPingReply, error) + GetAPIJSON(ctx context.Context, in *GetAPIJSON) (*GetAPIJSONReply, error) GetFirstMsgID(ctx context.Context, in *GetFirstMsgID) (*GetFirstMsgIDReply, error) MemclntCreate(ctx context.Context, in *MemclntCreate) (*MemclntCreateReply, error) MemclntCreateV2(ctx context.Context, in *MemclntCreateV2) (*MemclntCreateV2Reply, error) @@ -53,6 +54,15 @@ func (c *serviceClient) ControlPing(ctx context.Context, in *ControlPing) (*Cont return out, api.RetvalToVPPApiError(out.Retval) } +func (c *serviceClient) GetAPIJSON(ctx context.Context, in *GetAPIJSON) (*GetAPIJSONReply, error) { + out := new(GetAPIJSONReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + func (c *serviceClient) GetFirstMsgID(ctx context.Context, in *GetFirstMsgID) (*GetFirstMsgIDReply, error) { out := new(GetFirstMsgIDReply) err := c.conn.Invoke(ctx, in, out) diff --git a/vpplink/generated/bindings/memif/memif.ba.go b/vpplink/generated/bindings/memif/memif.ba.go index 75ab7e115..5d760b18c 100644 --- a/vpplink/generated/bindings/memif/memif.ba.go +++ b/vpplink/generated/bindings/memif/memif.ba.go @@ -101,6 +101,7 @@ func (x MemifRole) String() string { // - secret - optional, default is "", max length 24 // // MemifCreate defines message 'memif_create'. +// Deprecated: the message will be removed in the future versions type MemifCreate struct { Role MemifRole `binapi:"memif_role,name=role" json:"role,omitempty"` Mode MemifMode `binapi:"memif_mode,name=mode" json:"mode,omitempty"` @@ -178,6 +179,7 @@ func (m *MemifCreate) Unmarshal(b []byte) error { // - sw_if_index - software index of the newly created interface // // MemifCreateReply defines message 'memif_create_reply'. +// Deprecated: the message will be removed in the future versions type MemifCreateReply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` @@ -540,6 +542,7 @@ func (m *MemifDump) Unmarshal(b []byte) error { // no socket filename needed when is_add == 0. // // MemifSocketFilenameAddDel defines message 'memif_socket_filename_add_del'. +// Deprecated: the message will be removed in the future versions type MemifSocketFilenameAddDel struct { IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` SocketID uint32 `binapi:"u32,name=socket_id" json:"socket_id,omitempty"` @@ -581,6 +584,7 @@ func (m *MemifSocketFilenameAddDel) Unmarshal(b []byte) error { } // MemifSocketFilenameAddDelReply defines message 'memif_socket_filename_add_del_reply'. +// Deprecated: the message will be removed in the future versions type MemifSocketFilenameAddDelReply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` } diff --git a/vpplink/generated/bindings/nat44_ed/nat44_ed.ba.go b/vpplink/generated/bindings/nat44_ed/nat44_ed.ba.go index 819531dd2..3a4d727bf 100644 --- a/vpplink/generated/bindings/nat44_ed/nat44_ed.ba.go +++ b/vpplink/generated/bindings/nat44_ed/nat44_ed.ba.go @@ -533,6 +533,7 @@ func (m *Nat44AddDelLbStaticMappingReply) Unmarshal(b []byte) error { // - tag - opaque string tag // // Nat44AddDelStaticMapping defines message 'nat44_add_del_static_mapping'. +// Deprecated: the message will be removed in the future versions type Nat44AddDelStaticMapping struct { IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` Flags nat_types.NatConfigFlags `binapi:"nat_config_flags,name=flags" json:"flags,omitempty"` @@ -602,6 +603,7 @@ func (m *Nat44AddDelStaticMapping) Unmarshal(b []byte) error { } // Nat44AddDelStaticMappingReply defines message 'nat44_add_del_static_mapping_reply'. +// Deprecated: the message will be removed in the future versions type Nat44AddDelStaticMappingReply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` } @@ -2738,6 +2740,7 @@ func (m *Nat44UserDump) Unmarshal(b []byte) error { // twice-nat session) // // Nat44UserSessionDetails defines message 'nat44_user_session_details'. +// Deprecated: the message will be removed in the future versions type Nat44UserSessionDetails struct { OutsideIPAddress ip_types.IP4Address `binapi:"ip4_address,name=outside_ip_address" json:"outside_ip_address,omitempty"` OutsidePort uint16 `binapi:"u16,name=outside_port" json:"outside_port,omitempty"` @@ -2823,6 +2826,7 @@ func (m *Nat44UserSessionDetails) Unmarshal(b []byte) error { // - vrf_id - VRF_ID // // Nat44UserSessionDump defines message 'nat44_user_session_dump'. +// Deprecated: the message will be removed in the future versions type Nat44UserSessionDump struct { IPAddress ip_types.IP4Address `binapi:"ip4_address,name=ip_address" json:"ip_address,omitempty"` VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"` @@ -2882,6 +2886,7 @@ func (m *Nat44UserSessionDump) Unmarshal(b []byte) error { // is active // // Nat44UserSessionV2Details defines message 'nat44_user_session_v2_details'. +// Deprecated: the message will be removed in the future versions type Nat44UserSessionV2Details struct { OutsideIPAddress ip_types.IP4Address `binapi:"ip4_address,name=outside_ip_address" json:"outside_ip_address,omitempty"` OutsidePort uint16 `binapi:"u16,name=outside_port" json:"outside_port,omitempty"` @@ -2971,6 +2976,7 @@ func (m *Nat44UserSessionV2Details) Unmarshal(b []byte) error { // - vrf_id - VRF_ID // // Nat44UserSessionV2Dump defines message 'nat44_user_session_v2_dump'. +// Deprecated: the message will be removed in the future versions type Nat44UserSessionV2Dump struct { IPAddress ip_types.IP4Address `binapi:"ip4_address,name=ip_address" json:"ip_address,omitempty"` VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"` diff --git a/vpplink/generated/bindings/nat44_ed/nat44_ed_rpc.ba.go b/vpplink/generated/bindings/nat44_ed/nat44_ed_rpc.ba.go index cec01d5a7..f80b505c9 100644 --- a/vpplink/generated/bindings/nat44_ed/nat44_ed_rpc.ba.go +++ b/vpplink/generated/bindings/nat44_ed/nat44_ed_rpc.ba.go @@ -224,11 +224,12 @@ func (c *serviceClient_Nat44EdOutputInterfaceGetClient) Recv() (*Nat44EdOutputIn return m, nil, nil case *Nat44EdOutputInterfaceGetReply: if err := api.RetvalToVPPApiError(m.Retval); err != nil { - return nil, nil, err + c.Stream.Close() + return nil, m, err } err = c.Stream.Close() if err != nil { - return nil, nil, err + return nil, m, err } return nil, m, io.EOF default: diff --git a/vpplink/generated/bindings/rdma/rdma.ba.go b/vpplink/generated/bindings/rdma/rdma.ba.go index 499a3c5b1..1ac0507ba 100644 --- a/vpplink/generated/bindings/rdma/rdma.ba.go +++ b/vpplink/generated/bindings/rdma/rdma.ba.go @@ -4,7 +4,7 @@ // // Contents: // - 3 enums -// - 8 messages +// - 10 messages package rdma import ( @@ -24,7 +24,7 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "rdma" APIVersion = "3.0.0" - VersionCrc = 0xdab70fa9 + VersionCrc = 0x351383c2 ) // RdmaMode defines enum 'rdma_mode'. @@ -341,7 +341,7 @@ func (m *RdmaCreateV2Reply) Unmarshal(b []byte) error { return nil } -// - client_index - opaque cookie to identify the sender +// Same as v4, just not an autoendian (expect buggy handling of flag values). // - host_if - Linux netdev interface name // - name - new rdma interface name // - rxq_num - number of receive queues (optional) @@ -354,6 +354,7 @@ func (m *RdmaCreateV2Reply) Unmarshal(b []byte) error { // - rss6 (optional) - IPv6 RSS // // RdmaCreateV3 defines message 'rdma_create_v3'. +// Deprecated: the message will be removed in the future versions type RdmaCreateV3 struct { HostIf string `binapi:"string[64],name=host_if" json:"host_if,omitempty"` Name string `binapi:"string[64],name=name" json:"name,omitempty"` @@ -462,6 +463,127 @@ func (m *RdmaCreateV3Reply) Unmarshal(b []byte) error { return nil } +// - client_index - opaque cookie to identify the sender +// - host_if - Linux netdev interface name +// - name - new rdma interface name +// - rxq_num - number of receive queues (optional) +// - rxq_size - receive queue size (optional) +// - txq_size - transmit queue size (optional) +// - mode - operation mode (optional) +// - no_multi_seg (optional) - disable chained buffer RX +// - max_pktlen (optional) - maximal RX packet size. +// - rss4 (optional) - IPv4 RSS +// - rss6 (optional) - IPv6 RSS +// +// RdmaCreateV4 defines message 'rdma_create_v4'. +type RdmaCreateV4 struct { + HostIf string `binapi:"string[64],name=host_if" json:"host_if,omitempty"` + Name string `binapi:"string[64],name=name" json:"name,omitempty"` + RxqNum uint16 `binapi:"u16,name=rxq_num,default=1" json:"rxq_num,omitempty"` + RxqSize uint16 `binapi:"u16,name=rxq_size,default=1024" json:"rxq_size,omitempty"` + TxqSize uint16 `binapi:"u16,name=txq_size,default=1024" json:"txq_size,omitempty"` + Mode RdmaMode `binapi:"rdma_mode,name=mode,default=0" json:"mode,omitempty"` + NoMultiSeg bool `binapi:"bool,name=no_multi_seg,default=0" json:"no_multi_seg,omitempty"` + MaxPktlen uint16 `binapi:"u16,name=max_pktlen,default=0" json:"max_pktlen,omitempty"` + Rss4 RdmaRss4 `binapi:"rdma_rss4,name=rss4,default=0" json:"rss4,omitempty"` + Rss6 RdmaRss6 `binapi:"rdma_rss6,name=rss6,default=0" json:"rss6,omitempty"` +} + +func (m *RdmaCreateV4) Reset() { *m = RdmaCreateV4{} } +func (*RdmaCreateV4) GetMessageName() string { return "rdma_create_v4" } +func (*RdmaCreateV4) GetCrcString() string { return "c6287ea8" } +func (*RdmaCreateV4) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *RdmaCreateV4) Size() (size int) { + if m == nil { + return 0 + } + size += 64 // m.HostIf + size += 64 // m.Name + size += 2 // m.RxqNum + size += 2 // m.RxqSize + size += 2 // m.TxqSize + size += 4 // m.Mode + size += 1 // m.NoMultiSeg + size += 2 // m.MaxPktlen + size += 4 // m.Rss4 + size += 4 // m.Rss6 + return size +} +func (m *RdmaCreateV4) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeString(m.HostIf, 64) + buf.EncodeString(m.Name, 64) + buf.EncodeUint16(m.RxqNum) + buf.EncodeUint16(m.RxqSize) + buf.EncodeUint16(m.TxqSize) + buf.EncodeUint32(uint32(m.Mode)) + buf.EncodeBool(m.NoMultiSeg) + buf.EncodeUint16(m.MaxPktlen) + buf.EncodeUint32(uint32(m.Rss4)) + buf.EncodeUint32(uint32(m.Rss6)) + return buf.Bytes(), nil +} +func (m *RdmaCreateV4) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.HostIf = buf.DecodeString(64) + m.Name = buf.DecodeString(64) + m.RxqNum = buf.DecodeUint16() + m.RxqSize = buf.DecodeUint16() + m.TxqSize = buf.DecodeUint16() + m.Mode = RdmaMode(buf.DecodeUint32()) + m.NoMultiSeg = buf.DecodeBool() + m.MaxPktlen = buf.DecodeUint16() + m.Rss4 = RdmaRss4(buf.DecodeUint32()) + m.Rss6 = RdmaRss6(buf.DecodeUint32()) + return nil +} + +// - client_index - opaque cookie to identify the sender +// - sw_if_index - interface index +// +// RdmaCreateV4Reply defines message 'rdma_create_v4_reply'. +type RdmaCreateV4Reply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` +} + +func (m *RdmaCreateV4Reply) Reset() { *m = RdmaCreateV4Reply{} } +func (*RdmaCreateV4Reply) GetMessageName() string { return "rdma_create_v4_reply" } +func (*RdmaCreateV4Reply) GetCrcString() string { return "5383d31f" } +func (*RdmaCreateV4Reply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *RdmaCreateV4Reply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + size += 4 // m.SwIfIndex + return size +} +func (m *RdmaCreateV4Reply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + buf.EncodeUint32(uint32(m.SwIfIndex)) + return buf.Bytes(), nil +} +func (m *RdmaCreateV4Reply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + return nil +} + // - client_index - opaque cookie to identify the sender // - sw_if_index - interface index // @@ -539,6 +661,8 @@ func file_rdma_binapi_init() { api.RegisterMessage((*RdmaCreateV2Reply)(nil), "rdma_create_v2_reply_5383d31f") api.RegisterMessage((*RdmaCreateV3)(nil), "rdma_create_v3_c6287ea8") api.RegisterMessage((*RdmaCreateV3Reply)(nil), "rdma_create_v3_reply_5383d31f") + api.RegisterMessage((*RdmaCreateV4)(nil), "rdma_create_v4_c6287ea8") + api.RegisterMessage((*RdmaCreateV4Reply)(nil), "rdma_create_v4_reply_5383d31f") api.RegisterMessage((*RdmaDelete)(nil), "rdma_delete_f9e6675e") api.RegisterMessage((*RdmaDeleteReply)(nil), "rdma_delete_reply_e8d4e804") } @@ -552,6 +676,8 @@ func AllMessages() []api.Message { (*RdmaCreateV2Reply)(nil), (*RdmaCreateV3)(nil), (*RdmaCreateV3Reply)(nil), + (*RdmaCreateV4)(nil), + (*RdmaCreateV4Reply)(nil), (*RdmaDelete)(nil), (*RdmaDeleteReply)(nil), } diff --git a/vpplink/generated/bindings/rdma/rdma_rpc.ba.go b/vpplink/generated/bindings/rdma/rdma_rpc.ba.go index 77db494ea..93c3e432f 100644 --- a/vpplink/generated/bindings/rdma/rdma_rpc.ba.go +++ b/vpplink/generated/bindings/rdma/rdma_rpc.ba.go @@ -13,6 +13,7 @@ type RPCService interface { RdmaCreate(ctx context.Context, in *RdmaCreate) (*RdmaCreateReply, error) RdmaCreateV2(ctx context.Context, in *RdmaCreateV2) (*RdmaCreateV2Reply, error) RdmaCreateV3(ctx context.Context, in *RdmaCreateV3) (*RdmaCreateV3Reply, error) + RdmaCreateV4(ctx context.Context, in *RdmaCreateV4) (*RdmaCreateV4Reply, error) RdmaDelete(ctx context.Context, in *RdmaDelete) (*RdmaDeleteReply, error) } @@ -51,6 +52,15 @@ func (c *serviceClient) RdmaCreateV3(ctx context.Context, in *RdmaCreateV3) (*Rd return out, api.RetvalToVPPApiError(out.Retval) } +func (c *serviceClient) RdmaCreateV4(ctx context.Context, in *RdmaCreateV4) (*RdmaCreateV4Reply, error) { + out := new(RdmaCreateV4Reply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + func (c *serviceClient) RdmaDelete(ctx context.Context, in *RdmaDelete) (*RdmaDeleteReply, error) { out := new(RdmaDeleteReply) err := c.conn.Invoke(ctx, in, out) diff --git a/vpplink/generated/bindings/session/session.ba.go b/vpplink/generated/bindings/session/session.ba.go index aac6ab6dd..ff7e346b1 100644 --- a/vpplink/generated/bindings/session/session.ba.go +++ b/vpplink/generated/bindings/session/session.ba.go @@ -3,8 +3,9 @@ // Package session contains generated bindings for API file session.api. // // Contents: -// - 2 enums -// - 26 messages +// - 3 enums +// - 2 structs +// - 40 messages package session import ( @@ -24,10 +25,43 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "session" - APIVersion = "4.0.0" - VersionCrc = 0x37cc4b71 + APIVersion = "4.0.3" + VersionCrc = 0x85f82b54 ) +// RtBackendEngine defines enum 'rt_backend_engine'. +type RtBackendEngine uint8 + +const ( + RT_BACKEND_ENGINE_API_DISABLE RtBackendEngine = 0 + RT_BACKEND_ENGINE_API_RULE_TABLE RtBackendEngine = 1 + RT_BACKEND_ENGINE_API_NONE RtBackendEngine = 2 + RT_BACKEND_ENGINE_API_SDL RtBackendEngine = 3 +) + +var ( + RtBackendEngine_name = map[uint8]string{ + 0: "RT_BACKEND_ENGINE_API_DISABLE", + 1: "RT_BACKEND_ENGINE_API_RULE_TABLE", + 2: "RT_BACKEND_ENGINE_API_NONE", + 3: "RT_BACKEND_ENGINE_API_SDL", + } + RtBackendEngine_value = map[string]uint8{ + "RT_BACKEND_ENGINE_API_DISABLE": 0, + "RT_BACKEND_ENGINE_API_RULE_TABLE": 1, + "RT_BACKEND_ENGINE_API_NONE": 2, + "RT_BACKEND_ENGINE_API_SDL": 3, + } +) + +func (x RtBackendEngine) String() string { + s, ok := RtBackendEngine_name[uint8(x)] + if ok { + return s + } + return "RtBackendEngine(" + strconv.Itoa(int(x)) + ")" +} + // SessionRuleScope defines enum 'session_rule_scope'. type SessionRuleScope uint32 @@ -94,6 +128,20 @@ func (x TransportProto) String() string { return "TransportProto(" + strconv.Itoa(int(x)) + ")" } +// SdlRule defines type 'sdl_rule'. +type SdlRule struct { + Lcl ip_types.Prefix `binapi:"prefix,name=lcl" json:"lcl,omitempty"` + ActionIndex uint32 `binapi:"u32,name=action_index" json:"action_index,omitempty"` + Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"` +} + +// SdlRuleV2 defines type 'sdl_rule_v2'. +type SdlRuleV2 struct { + Rmt ip_types.Prefix `binapi:"prefix,name=rmt" json:"rmt,omitempty"` + ActionIndex uint32 `binapi:"u32,name=action_index" json:"action_index,omitempty"` + Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"` +} + // Add certificate and key // - engine - crypto engine // - cert_len - cert length (comes first) @@ -1011,6 +1059,7 @@ func (m *ApplicationDetachReply) Unmarshal(b []byte) error { // - is_enable - disable session layer if 0, enable otherwise // // SessionEnableDisable defines message 'session_enable_disable'. +// Deprecated: the message will be removed in the future versions type SessionEnableDisable struct { IsEnable bool `binapi:"bool,name=is_enable,default=true" json:"is_enable,omitempty"` } @@ -1044,6 +1093,7 @@ func (m *SessionEnableDisable) Unmarshal(b []byte) error { } // SessionEnableDisableReply defines message 'session_enable_disable_reply'. +// Deprecated: the message will be removed in the future versions type SessionEnableDisableReply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` } @@ -1076,6 +1126,72 @@ func (m *SessionEnableDisableReply) Unmarshal(b []byte) error { return nil } +// SessionEnableDisableV2 defines message 'session_enable_disable_v2'. +type SessionEnableDisableV2 struct { + RtEngineType RtBackendEngine `binapi:"rt_backend_engine,name=rt_engine_type" json:"rt_engine_type,omitempty"` +} + +func (m *SessionEnableDisableV2) Reset() { *m = SessionEnableDisableV2{} } +func (*SessionEnableDisableV2) GetMessageName() string { return "session_enable_disable_v2" } +func (*SessionEnableDisableV2) GetCrcString() string { return "f09fbf32" } +func (*SessionEnableDisableV2) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *SessionEnableDisableV2) Size() (size int) { + if m == nil { + return 0 + } + size += 1 // m.RtEngineType + return size +} +func (m *SessionEnableDisableV2) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint8(uint8(m.RtEngineType)) + return buf.Bytes(), nil +} +func (m *SessionEnableDisableV2) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.RtEngineType = RtBackendEngine(buf.DecodeUint8()) + return nil +} + +// SessionEnableDisableV2Reply defines message 'session_enable_disable_v2_reply'. +type SessionEnableDisableV2Reply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *SessionEnableDisableV2Reply) Reset() { *m = SessionEnableDisableV2Reply{} } +func (*SessionEnableDisableV2Reply) GetMessageName() string { return "session_enable_disable_v2_reply" } +func (*SessionEnableDisableV2Reply) GetCrcString() string { return "e8d4e804" } +func (*SessionEnableDisableV2Reply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *SessionEnableDisableV2Reply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *SessionEnableDisableV2Reply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *SessionEnableDisableV2Reply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + // add/del session rule // // client to vpp direction only @@ -1226,6 +1342,7 @@ func (m *SessionRuleAddDelReply) Unmarshal(b []byte) error { // - tag - tag // // SessionRulesDetails defines message 'session_rules_details'. +// Deprecated: the message will be removed in the future versions type SessionRulesDetails struct { TransportProto TransportProto `binapi:"transport_proto,name=transport_proto" json:"transport_proto,omitempty"` Lcl ip_types.Prefix `binapi:"prefix,name=lcl" json:"lcl,omitempty"` @@ -1304,6 +1421,7 @@ func (m *SessionRulesDetails) Unmarshal(b []byte) error { // Dump session rules // SessionRulesDump defines message 'session_rules_dump'. +// Deprecated: the message will be removed in the future versions type SessionRulesDump struct{} func (m *SessionRulesDump) Reset() { *m = SessionRulesDump{} } @@ -1330,6 +1448,141 @@ func (m *SessionRulesDump) Unmarshal(b []byte) error { return nil } +// Session rules details +// - transport_proto - transport protocol +// - is_ip4 - flag to indicate if ip addresses are ip4 or 6 +// - lcl_ip - local ip +// - lcl_plen - local prefix length +// - rmt_ip - remote ip +// - rmt_ple - remote prefix length +// - lcl_port - local port +// - rmt_port - remote port +// - action_index - the only action defined now is forward to +// application with index action_index +// - scope - enum that indicates scope of the rule: global or local. +// If 0, default is global, 1 is global 2 is local, 3 is both +// - tag - tag +// - count - count of the number of appns_index +// - appns_index - application namespaces where rule is to be applied to +// +// SessionRulesV2Details defines message 'session_rules_v2_details'. +type SessionRulesV2Details struct { + TransportProto TransportProto `binapi:"transport_proto,name=transport_proto" json:"transport_proto,omitempty"` + Lcl ip_types.Prefix `binapi:"prefix,name=lcl" json:"lcl,omitempty"` + Rmt ip_types.Prefix `binapi:"prefix,name=rmt" json:"rmt,omitempty"` + LclPort uint16 `binapi:"u16,name=lcl_port" json:"lcl_port,omitempty"` + RmtPort uint16 `binapi:"u16,name=rmt_port" json:"rmt_port,omitempty"` + ActionIndex uint32 `binapi:"u32,name=action_index" json:"action_index,omitempty"` + Scope SessionRuleScope `binapi:"session_rule_scope,name=scope" json:"scope,omitempty"` + Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"` + Count uint32 `binapi:"u32,name=count" json:"-"` + AppnsIndex []uint32 `binapi:"u32[count],name=appns_index" json:"appns_index,omitempty"` +} + +func (m *SessionRulesV2Details) Reset() { *m = SessionRulesV2Details{} } +func (*SessionRulesV2Details) GetMessageName() string { return "session_rules_v2_details" } +func (*SessionRulesV2Details) GetCrcString() string { return "f91993dc" } +func (*SessionRulesV2Details) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *SessionRulesV2Details) Size() (size int) { + if m == nil { + return 0 + } + size += 1 // m.TransportProto + size += 1 // m.Lcl.Address.Af + size += 1 * 16 // m.Lcl.Address.Un + size += 1 // m.Lcl.Len + size += 1 // m.Rmt.Address.Af + size += 1 * 16 // m.Rmt.Address.Un + size += 1 // m.Rmt.Len + size += 2 // m.LclPort + size += 2 // m.RmtPort + size += 4 // m.ActionIndex + size += 4 // m.Scope + size += 64 // m.Tag + size += 4 // m.Count + size += 4 * len(m.AppnsIndex) // m.AppnsIndex + return size +} +func (m *SessionRulesV2Details) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint8(uint8(m.TransportProto)) + buf.EncodeUint8(uint8(m.Lcl.Address.Af)) + buf.EncodeBytes(m.Lcl.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Lcl.Len) + buf.EncodeUint8(uint8(m.Rmt.Address.Af)) + buf.EncodeBytes(m.Rmt.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Rmt.Len) + buf.EncodeUint16(m.LclPort) + buf.EncodeUint16(m.RmtPort) + buf.EncodeUint32(m.ActionIndex) + buf.EncodeUint32(uint32(m.Scope)) + buf.EncodeString(m.Tag, 64) + buf.EncodeUint32(uint32(len(m.AppnsIndex))) + for i := 0; i < len(m.AppnsIndex); i++ { + var x uint32 + if i < len(m.AppnsIndex) { + x = uint32(m.AppnsIndex[i]) + } + buf.EncodeUint32(x) + } + return buf.Bytes(), nil +} +func (m *SessionRulesV2Details) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.TransportProto = TransportProto(buf.DecodeUint8()) + m.Lcl.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Lcl.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Lcl.Len = buf.DecodeUint8() + m.Rmt.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Rmt.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Rmt.Len = buf.DecodeUint8() + m.LclPort = buf.DecodeUint16() + m.RmtPort = buf.DecodeUint16() + m.ActionIndex = buf.DecodeUint32() + m.Scope = SessionRuleScope(buf.DecodeUint32()) + m.Tag = buf.DecodeString(64) + m.Count = buf.DecodeUint32() + m.AppnsIndex = make([]uint32, m.Count) + for i := 0; i < len(m.AppnsIndex); i++ { + m.AppnsIndex[i] = buf.DecodeUint32() + } + return nil +} + +// Dump session rules +// SessionRulesV2Dump defines message 'session_rules_v2_dump'. +type SessionRulesV2Dump struct{} + +func (m *SessionRulesV2Dump) Reset() { *m = SessionRulesV2Dump{} } +func (*SessionRulesV2Dump) GetMessageName() string { return "session_rules_v2_dump" } +func (*SessionRulesV2Dump) GetCrcString() string { return "51077d14" } +func (*SessionRulesV2Dump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *SessionRulesV2Dump) Size() (size int) { + if m == nil { + return 0 + } + return size +} +func (m *SessionRulesV2Dump) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + return buf.Bytes(), nil +} +func (m *SessionRulesV2Dump) Unmarshal(b []byte) error { + return nil +} + // enable/disable session layer socket api // // client to vpp direction only @@ -1403,6 +1656,496 @@ func (m *SessionSapiEnableDisableReply) Unmarshal(b []byte) error { return nil } +// SessionSdlAddDel defines message 'session_sdl_add_del'. +// Deprecated: the message will be removed in the future versions +type SessionSdlAddDel struct { + AppnsIndex uint32 `binapi:"u32,name=appns_index" json:"appns_index,omitempty"` + IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` + Count uint32 `binapi:"u32,name=count" json:"-"` + R []SdlRule `binapi:"sdl_rule[count],name=r" json:"r,omitempty"` +} + +func (m *SessionSdlAddDel) Reset() { *m = SessionSdlAddDel{} } +func (*SessionSdlAddDel) GetMessageName() string { return "session_sdl_add_del" } +func (*SessionSdlAddDel) GetCrcString() string { return "faeb89fc" } +func (*SessionSdlAddDel) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *SessionSdlAddDel) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.AppnsIndex + size += 1 // m.IsAdd + size += 4 // m.Count + for j1 := 0; j1 < len(m.R); j1++ { + var s1 SdlRule + _ = s1 + if j1 < len(m.R) { + s1 = m.R[j1] + } + size += 1 // s1.Lcl.Address.Af + size += 1 * 16 // s1.Lcl.Address.Un + size += 1 // s1.Lcl.Len + size += 4 // s1.ActionIndex + size += 64 // s1.Tag + } + return size +} +func (m *SessionSdlAddDel) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.AppnsIndex) + buf.EncodeBool(m.IsAdd) + buf.EncodeUint32(uint32(len(m.R))) + for j0 := 0; j0 < len(m.R); j0++ { + var v0 SdlRule // R + if j0 < len(m.R) { + v0 = m.R[j0] + } + buf.EncodeUint8(uint8(v0.Lcl.Address.Af)) + buf.EncodeBytes(v0.Lcl.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(v0.Lcl.Len) + buf.EncodeUint32(v0.ActionIndex) + buf.EncodeString(v0.Tag, 64) + } + return buf.Bytes(), nil +} +func (m *SessionSdlAddDel) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.AppnsIndex = buf.DecodeUint32() + m.IsAdd = buf.DecodeBool() + m.Count = buf.DecodeUint32() + m.R = make([]SdlRule, m.Count) + for j0 := 0; j0 < len(m.R); j0++ { + m.R[j0].Lcl.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.R[j0].Lcl.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.R[j0].Lcl.Len = buf.DecodeUint8() + m.R[j0].ActionIndex = buf.DecodeUint32() + m.R[j0].Tag = buf.DecodeString(64) + } + return nil +} + +// SessionSdlAddDelReply defines message 'session_sdl_add_del_reply'. +// Deprecated: the message will be removed in the future versions +type SessionSdlAddDelReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *SessionSdlAddDelReply) Reset() { *m = SessionSdlAddDelReply{} } +func (*SessionSdlAddDelReply) GetMessageName() string { return "session_sdl_add_del_reply" } +func (*SessionSdlAddDelReply) GetCrcString() string { return "e8d4e804" } +func (*SessionSdlAddDelReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *SessionSdlAddDelReply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *SessionSdlAddDelReply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *SessionSdlAddDelReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + +// SessionSdlAddDelV2 defines message 'session_sdl_add_del_v2'. +type SessionSdlAddDelV2 struct { + AppnsIndex uint32 `binapi:"u32,name=appns_index" json:"appns_index,omitempty"` + IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` + Count uint32 `binapi:"u32,name=count" json:"-"` + R []SdlRuleV2 `binapi:"sdl_rule_v2[count],name=r" json:"r,omitempty"` +} + +func (m *SessionSdlAddDelV2) Reset() { *m = SessionSdlAddDelV2{} } +func (*SessionSdlAddDelV2) GetMessageName() string { return "session_sdl_add_del_v2" } +func (*SessionSdlAddDelV2) GetCrcString() string { return "7f89d3fa" } +func (*SessionSdlAddDelV2) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *SessionSdlAddDelV2) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.AppnsIndex + size += 1 // m.IsAdd + size += 4 // m.Count + for j1 := 0; j1 < len(m.R); j1++ { + var s1 SdlRuleV2 + _ = s1 + if j1 < len(m.R) { + s1 = m.R[j1] + } + size += 1 // s1.Rmt.Address.Af + size += 1 * 16 // s1.Rmt.Address.Un + size += 1 // s1.Rmt.Len + size += 4 // s1.ActionIndex + size += 64 // s1.Tag + } + return size +} +func (m *SessionSdlAddDelV2) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(m.AppnsIndex) + buf.EncodeBool(m.IsAdd) + buf.EncodeUint32(uint32(len(m.R))) + for j0 := 0; j0 < len(m.R); j0++ { + var v0 SdlRuleV2 // R + if j0 < len(m.R) { + v0 = m.R[j0] + } + buf.EncodeUint8(uint8(v0.Rmt.Address.Af)) + buf.EncodeBytes(v0.Rmt.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(v0.Rmt.Len) + buf.EncodeUint32(v0.ActionIndex) + buf.EncodeString(v0.Tag, 64) + } + return buf.Bytes(), nil +} +func (m *SessionSdlAddDelV2) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.AppnsIndex = buf.DecodeUint32() + m.IsAdd = buf.DecodeBool() + m.Count = buf.DecodeUint32() + m.R = make([]SdlRuleV2, m.Count) + for j0 := 0; j0 < len(m.R); j0++ { + m.R[j0].Rmt.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.R[j0].Rmt.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.R[j0].Rmt.Len = buf.DecodeUint8() + m.R[j0].ActionIndex = buf.DecodeUint32() + m.R[j0].Tag = buf.DecodeString(64) + } + return nil +} + +// SessionSdlAddDelV2Reply defines message 'session_sdl_add_del_v2_reply'. +type SessionSdlAddDelV2Reply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *SessionSdlAddDelV2Reply) Reset() { *m = SessionSdlAddDelV2Reply{} } +func (*SessionSdlAddDelV2Reply) GetMessageName() string { return "session_sdl_add_del_v2_reply" } +func (*SessionSdlAddDelV2Reply) GetCrcString() string { return "e8d4e804" } +func (*SessionSdlAddDelV2Reply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *SessionSdlAddDelV2Reply) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.Retval + return size +} +func (m *SessionSdlAddDelV2Reply) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeInt32(m.Retval) + return buf.Bytes(), nil +} +func (m *SessionSdlAddDelV2Reply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = buf.DecodeInt32() + return nil +} + +// Session sdl details +// - lcl - local prefix +// - action_index - the only action defined now is forward to +// application with index action_index +// - appns_index - application namespace where rule is to be applied to +// - tag - tag +// +// SessionSdlDetails defines message 'session_sdl_details'. +// Deprecated: the message will be removed in the future versions +type SessionSdlDetails struct { + Lcl ip_types.Prefix `binapi:"prefix,name=lcl" json:"lcl,omitempty"` + ActionIndex uint32 `binapi:"u32,name=action_index" json:"action_index,omitempty"` + AppnsIndex uint32 `binapi:"u32,name=appns_index" json:"appns_index,omitempty"` + Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"` +} + +func (m *SessionSdlDetails) Reset() { *m = SessionSdlDetails{} } +func (*SessionSdlDetails) GetMessageName() string { return "session_sdl_details" } +func (*SessionSdlDetails) GetCrcString() string { return "9a8ef5d0" } +func (*SessionSdlDetails) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *SessionSdlDetails) Size() (size int) { + if m == nil { + return 0 + } + size += 1 // m.Lcl.Address.Af + size += 1 * 16 // m.Lcl.Address.Un + size += 1 // m.Lcl.Len + size += 4 // m.ActionIndex + size += 4 // m.AppnsIndex + size += 64 // m.Tag + return size +} +func (m *SessionSdlDetails) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint8(uint8(m.Lcl.Address.Af)) + buf.EncodeBytes(m.Lcl.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Lcl.Len) + buf.EncodeUint32(m.ActionIndex) + buf.EncodeUint32(m.AppnsIndex) + buf.EncodeString(m.Tag, 64) + return buf.Bytes(), nil +} +func (m *SessionSdlDetails) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Lcl.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Lcl.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Lcl.Len = buf.DecodeUint8() + m.ActionIndex = buf.DecodeUint32() + m.AppnsIndex = buf.DecodeUint32() + m.Tag = buf.DecodeString(64) + return nil +} + +// Dump session sdl +// SessionSdlDump defines message 'session_sdl_dump'. +// Deprecated: the message will be removed in the future versions +type SessionSdlDump struct{} + +func (m *SessionSdlDump) Reset() { *m = SessionSdlDump{} } +func (*SessionSdlDump) GetMessageName() string { return "session_sdl_dump" } +func (*SessionSdlDump) GetCrcString() string { return "51077d14" } +func (*SessionSdlDump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *SessionSdlDump) Size() (size int) { + if m == nil { + return 0 + } + return size +} +func (m *SessionSdlDump) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + return buf.Bytes(), nil +} +func (m *SessionSdlDump) Unmarshal(b []byte) error { + return nil +} + +// Session sdl details v2 +// - rmt - remote prefix +// - action_index - the only action defined now is forward to +// application with index action_index +// - appns_index - application namespace where rule is to be applied to +// - tag - tag +// +// SessionSdlV2Details defines message 'session_sdl_v2_details'. +// Deprecated: the message will be removed in the future versions +type SessionSdlV2Details struct { + Rmt ip_types.Prefix `binapi:"prefix,name=rmt" json:"rmt,omitempty"` + ActionIndex uint32 `binapi:"u32,name=action_index" json:"action_index,omitempty"` + AppnsIndex uint32 `binapi:"u32,name=appns_index" json:"appns_index,omitempty"` + Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"` +} + +func (m *SessionSdlV2Details) Reset() { *m = SessionSdlV2Details{} } +func (*SessionSdlV2Details) GetMessageName() string { return "session_sdl_v2_details" } +func (*SessionSdlV2Details) GetCrcString() string { return "0a057683" } +func (*SessionSdlV2Details) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *SessionSdlV2Details) Size() (size int) { + if m == nil { + return 0 + } + size += 1 // m.Rmt.Address.Af + size += 1 * 16 // m.Rmt.Address.Un + size += 1 // m.Rmt.Len + size += 4 // m.ActionIndex + size += 4 // m.AppnsIndex + size += 64 // m.Tag + return size +} +func (m *SessionSdlV2Details) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint8(uint8(m.Rmt.Address.Af)) + buf.EncodeBytes(m.Rmt.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Rmt.Len) + buf.EncodeUint32(m.ActionIndex) + buf.EncodeUint32(m.AppnsIndex) + buf.EncodeString(m.Tag, 64) + return buf.Bytes(), nil +} +func (m *SessionSdlV2Details) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Rmt.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Rmt.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Rmt.Len = buf.DecodeUint8() + m.ActionIndex = buf.DecodeUint32() + m.AppnsIndex = buf.DecodeUint32() + m.Tag = buf.DecodeString(64) + return nil +} + +// Dump session sdl v2 +// SessionSdlV2Dump defines message 'session_sdl_v2_dump'. +// Deprecated: the message will be removed in the future versions +type SessionSdlV2Dump struct{} + +func (m *SessionSdlV2Dump) Reset() { *m = SessionSdlV2Dump{} } +func (*SessionSdlV2Dump) GetMessageName() string { return "session_sdl_v2_dump" } +func (*SessionSdlV2Dump) GetCrcString() string { return "51077d14" } +func (*SessionSdlV2Dump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *SessionSdlV2Dump) Size() (size int) { + if m == nil { + return 0 + } + return size +} +func (m *SessionSdlV2Dump) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + return buf.Bytes(), nil +} +func (m *SessionSdlV2Dump) Unmarshal(b []byte) error { + return nil +} + +// Session sdl details v3 +// - rmt - remote prefix +// - action_index - the only action defined now is forward to +// application with index action_index +// - tag - tag +// - count - count of the number of appns_index +// - appns_index - application namespaces where rule is to be applied to +// +// SessionSdlV3Details defines message 'session_sdl_v3_details'. +type SessionSdlV3Details struct { + Rmt ip_types.Prefix `binapi:"prefix,name=rmt" json:"rmt,omitempty"` + ActionIndex uint32 `binapi:"u32,name=action_index" json:"action_index,omitempty"` + Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"` + Count uint32 `binapi:"u32,name=count" json:"-"` + AppnsIndex []uint32 `binapi:"u32[count],name=appns_index" json:"appns_index,omitempty"` +} + +func (m *SessionSdlV3Details) Reset() { *m = SessionSdlV3Details{} } +func (*SessionSdlV3Details) GetMessageName() string { return "session_sdl_v3_details" } +func (*SessionSdlV3Details) GetCrcString() string { return "829e367f" } +func (*SessionSdlV3Details) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *SessionSdlV3Details) Size() (size int) { + if m == nil { + return 0 + } + size += 1 // m.Rmt.Address.Af + size += 1 * 16 // m.Rmt.Address.Un + size += 1 // m.Rmt.Len + size += 4 // m.ActionIndex + size += 64 // m.Tag + size += 4 // m.Count + size += 4 * len(m.AppnsIndex) // m.AppnsIndex + return size +} +func (m *SessionSdlV3Details) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint8(uint8(m.Rmt.Address.Af)) + buf.EncodeBytes(m.Rmt.Address.Un.XXX_UnionData[:], 16) + buf.EncodeUint8(m.Rmt.Len) + buf.EncodeUint32(m.ActionIndex) + buf.EncodeString(m.Tag, 64) + buf.EncodeUint32(uint32(len(m.AppnsIndex))) + for i := 0; i < len(m.AppnsIndex); i++ { + var x uint32 + if i < len(m.AppnsIndex) { + x = uint32(m.AppnsIndex[i]) + } + buf.EncodeUint32(x) + } + return buf.Bytes(), nil +} +func (m *SessionSdlV3Details) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Rmt.Address.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Rmt.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.Rmt.Len = buf.DecodeUint8() + m.ActionIndex = buf.DecodeUint32() + m.Tag = buf.DecodeString(64) + m.Count = buf.DecodeUint32() + m.AppnsIndex = make([]uint32, m.Count) + for i := 0; i < len(m.AppnsIndex); i++ { + m.AppnsIndex[i] = buf.DecodeUint32() + } + return nil +} + +// Dump session sdl v3 +// SessionSdlV3Dump defines message 'session_sdl_v3_dump'. +type SessionSdlV3Dump struct{} + +func (m *SessionSdlV3Dump) Reset() { *m = SessionSdlV3Dump{} } +func (*SessionSdlV3Dump) GetMessageName() string { return "session_sdl_v3_dump" } +func (*SessionSdlV3Dump) GetCrcString() string { return "51077d14" } +func (*SessionSdlV3Dump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *SessionSdlV3Dump) Size() (size int) { + if m == nil { + return 0 + } + return size +} +func (m *SessionSdlV3Dump) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + return buf.Bytes(), nil +} +func (m *SessionSdlV3Dump) Unmarshal(b []byte) error { + return nil +} + func init() { file_session_binapi_init() } func file_session_binapi_init() { api.RegisterMessage((*AppAddCertKeyPair)(nil), "app_add_cert_key_pair_02eb8016") @@ -1425,12 +2168,26 @@ func file_session_binapi_init() { api.RegisterMessage((*ApplicationDetachReply)(nil), "application_detach_reply_e8d4e804") api.RegisterMessage((*SessionEnableDisable)(nil), "session_enable_disable_c264d7bf") api.RegisterMessage((*SessionEnableDisableReply)(nil), "session_enable_disable_reply_e8d4e804") + api.RegisterMessage((*SessionEnableDisableV2)(nil), "session_enable_disable_v2_f09fbf32") + api.RegisterMessage((*SessionEnableDisableV2Reply)(nil), "session_enable_disable_v2_reply_e8d4e804") api.RegisterMessage((*SessionRuleAddDel)(nil), "session_rule_add_del_82a90af5") api.RegisterMessage((*SessionRuleAddDelReply)(nil), "session_rule_add_del_reply_e8d4e804") api.RegisterMessage((*SessionRulesDetails)(nil), "session_rules_details_4ef746e7") api.RegisterMessage((*SessionRulesDump)(nil), "session_rules_dump_51077d14") + api.RegisterMessage((*SessionRulesV2Details)(nil), "session_rules_v2_details_f91993dc") + api.RegisterMessage((*SessionRulesV2Dump)(nil), "session_rules_v2_dump_51077d14") api.RegisterMessage((*SessionSapiEnableDisable)(nil), "session_sapi_enable_disable_c264d7bf") api.RegisterMessage((*SessionSapiEnableDisableReply)(nil), "session_sapi_enable_disable_reply_e8d4e804") + api.RegisterMessage((*SessionSdlAddDel)(nil), "session_sdl_add_del_faeb89fc") + api.RegisterMessage((*SessionSdlAddDelReply)(nil), "session_sdl_add_del_reply_e8d4e804") + api.RegisterMessage((*SessionSdlAddDelV2)(nil), "session_sdl_add_del_v2_7f89d3fa") + api.RegisterMessage((*SessionSdlAddDelV2Reply)(nil), "session_sdl_add_del_v2_reply_e8d4e804") + api.RegisterMessage((*SessionSdlDetails)(nil), "session_sdl_details_9a8ef5d0") + api.RegisterMessage((*SessionSdlDump)(nil), "session_sdl_dump_51077d14") + api.RegisterMessage((*SessionSdlV2Details)(nil), "session_sdl_v2_details_0a057683") + api.RegisterMessage((*SessionSdlV2Dump)(nil), "session_sdl_v2_dump_51077d14") + api.RegisterMessage((*SessionSdlV3Details)(nil), "session_sdl_v3_details_829e367f") + api.RegisterMessage((*SessionSdlV3Dump)(nil), "session_sdl_v3_dump_51077d14") } // Messages returns list of all messages in this module. @@ -1456,11 +2213,25 @@ func AllMessages() []api.Message { (*ApplicationDetachReply)(nil), (*SessionEnableDisable)(nil), (*SessionEnableDisableReply)(nil), + (*SessionEnableDisableV2)(nil), + (*SessionEnableDisableV2Reply)(nil), (*SessionRuleAddDel)(nil), (*SessionRuleAddDelReply)(nil), (*SessionRulesDetails)(nil), (*SessionRulesDump)(nil), + (*SessionRulesV2Details)(nil), + (*SessionRulesV2Dump)(nil), (*SessionSapiEnableDisable)(nil), (*SessionSapiEnableDisableReply)(nil), + (*SessionSdlAddDel)(nil), + (*SessionSdlAddDelReply)(nil), + (*SessionSdlAddDelV2)(nil), + (*SessionSdlAddDelV2Reply)(nil), + (*SessionSdlDetails)(nil), + (*SessionSdlDump)(nil), + (*SessionSdlV2Details)(nil), + (*SessionSdlV2Dump)(nil), + (*SessionSdlV3Details)(nil), + (*SessionSdlV3Dump)(nil), } } diff --git a/vpplink/generated/bindings/session/session_rpc.ba.go b/vpplink/generated/bindings/session/session_rpc.ba.go index 14f3acf6a..9466a6735 100644 --- a/vpplink/generated/bindings/session/session_rpc.ba.go +++ b/vpplink/generated/bindings/session/session_rpc.ba.go @@ -23,9 +23,16 @@ type RPCService interface { AppWorkerAddDel(ctx context.Context, in *AppWorkerAddDel) (*AppWorkerAddDelReply, error) ApplicationDetach(ctx context.Context, in *ApplicationDetach) (*ApplicationDetachReply, error) SessionEnableDisable(ctx context.Context, in *SessionEnableDisable) (*SessionEnableDisableReply, error) + SessionEnableDisableV2(ctx context.Context, in *SessionEnableDisableV2) (*SessionEnableDisableV2Reply, error) SessionRuleAddDel(ctx context.Context, in *SessionRuleAddDel) (*SessionRuleAddDelReply, error) SessionRulesDump(ctx context.Context, in *SessionRulesDump) (RPCService_SessionRulesDumpClient, error) + SessionRulesV2Dump(ctx context.Context, in *SessionRulesV2Dump) (RPCService_SessionRulesV2DumpClient, error) SessionSapiEnableDisable(ctx context.Context, in *SessionSapiEnableDisable) (*SessionSapiEnableDisableReply, error) + SessionSdlAddDel(ctx context.Context, in *SessionSdlAddDel) (*SessionSdlAddDelReply, error) + SessionSdlAddDelV2(ctx context.Context, in *SessionSdlAddDelV2) (*SessionSdlAddDelV2Reply, error) + SessionSdlDump(ctx context.Context, in *SessionSdlDump) (RPCService_SessionSdlDumpClient, error) + SessionSdlV2Dump(ctx context.Context, in *SessionSdlV2Dump) (RPCService_SessionSdlV2DumpClient, error) + SessionSdlV3Dump(ctx context.Context, in *SessionSdlV3Dump) (RPCService_SessionSdlV3DumpClient, error) } type serviceClient struct { @@ -126,6 +133,15 @@ func (c *serviceClient) SessionEnableDisable(ctx context.Context, in *SessionEna return out, api.RetvalToVPPApiError(out.Retval) } +func (c *serviceClient) SessionEnableDisableV2(ctx context.Context, in *SessionEnableDisableV2) (*SessionEnableDisableV2Reply, error) { + out := new(SessionEnableDisableV2Reply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + func (c *serviceClient) SessionRuleAddDel(ctx context.Context, in *SessionRuleAddDel) (*SessionRuleAddDelReply, error) { out := new(SessionRuleAddDelReply) err := c.conn.Invoke(ctx, in, out) @@ -178,6 +194,49 @@ func (c *serviceClient_SessionRulesDumpClient) Recv() (*SessionRulesDetails, err } } +func (c *serviceClient) SessionRulesV2Dump(ctx context.Context, in *SessionRulesV2Dump) (RPCService_SessionRulesV2DumpClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_SessionRulesV2DumpClient{stream} + if err := x.Stream.SendMsg(in); err != nil { + return nil, err + } + if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil { + return nil, err + } + return x, nil +} + +type RPCService_SessionRulesV2DumpClient interface { + Recv() (*SessionRulesV2Details, error) + api.Stream +} + +type serviceClient_SessionRulesV2DumpClient struct { + api.Stream +} + +func (c *serviceClient_SessionRulesV2DumpClient) Recv() (*SessionRulesV2Details, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *SessionRulesV2Details: + return m, nil + case *memclnt.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } + return nil, io.EOF + default: + return nil, fmt.Errorf("unexpected message: %T %v", m, m) + } +} + func (c *serviceClient) SessionSapiEnableDisable(ctx context.Context, in *SessionSapiEnableDisable) (*SessionSapiEnableDisableReply, error) { out := new(SessionSapiEnableDisableReply) err := c.conn.Invoke(ctx, in, out) @@ -186,3 +245,150 @@ func (c *serviceClient) SessionSapiEnableDisable(ctx context.Context, in *Sessio } return out, api.RetvalToVPPApiError(out.Retval) } + +func (c *serviceClient) SessionSdlAddDel(ctx context.Context, in *SessionSdlAddDel) (*SessionSdlAddDelReply, error) { + out := new(SessionSdlAddDelReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) SessionSdlAddDelV2(ctx context.Context, in *SessionSdlAddDelV2) (*SessionSdlAddDelV2Reply, error) { + out := new(SessionSdlAddDelV2Reply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + +func (c *serviceClient) SessionSdlDump(ctx context.Context, in *SessionSdlDump) (RPCService_SessionSdlDumpClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_SessionSdlDumpClient{stream} + if err := x.Stream.SendMsg(in); err != nil { + return nil, err + } + if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil { + return nil, err + } + return x, nil +} + +type RPCService_SessionSdlDumpClient interface { + Recv() (*SessionSdlDetails, error) + api.Stream +} + +type serviceClient_SessionSdlDumpClient struct { + api.Stream +} + +func (c *serviceClient_SessionSdlDumpClient) Recv() (*SessionSdlDetails, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *SessionSdlDetails: + return m, nil + case *memclnt.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } + return nil, io.EOF + default: + return nil, fmt.Errorf("unexpected message: %T %v", m, m) + } +} + +func (c *serviceClient) SessionSdlV2Dump(ctx context.Context, in *SessionSdlV2Dump) (RPCService_SessionSdlV2DumpClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_SessionSdlV2DumpClient{stream} + if err := x.Stream.SendMsg(in); err != nil { + return nil, err + } + if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil { + return nil, err + } + return x, nil +} + +type RPCService_SessionSdlV2DumpClient interface { + Recv() (*SessionSdlV2Details, error) + api.Stream +} + +type serviceClient_SessionSdlV2DumpClient struct { + api.Stream +} + +func (c *serviceClient_SessionSdlV2DumpClient) Recv() (*SessionSdlV2Details, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *SessionSdlV2Details: + return m, nil + case *memclnt.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } + return nil, io.EOF + default: + return nil, fmt.Errorf("unexpected message: %T %v", m, m) + } +} + +func (c *serviceClient) SessionSdlV3Dump(ctx context.Context, in *SessionSdlV3Dump) (RPCService_SessionSdlV3DumpClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_SessionSdlV3DumpClient{stream} + if err := x.Stream.SendMsg(in); err != nil { + return nil, err + } + if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil { + return nil, err + } + return x, nil +} + +type RPCService_SessionSdlV3DumpClient interface { + Recv() (*SessionSdlV3Details, error) + api.Stream +} + +type serviceClient_SessionSdlV3DumpClient struct { + api.Stream +} + +func (c *serviceClient_SessionSdlV3DumpClient) Recv() (*SessionSdlV3Details, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *SessionSdlV3Details: + return m, nil + case *memclnt.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } + return nil, io.EOF + default: + return nil, fmt.Errorf("unexpected message: %T %v", m, m) + } +} diff --git a/vpplink/generated/bindings/sr/sr.ba.go b/vpplink/generated/bindings/sr/sr.ba.go index 18e71c23c..c73db68f8 100644 --- a/vpplink/generated/bindings/sr/sr.ba.go +++ b/vpplink/generated/bindings/sr/sr.ba.go @@ -464,6 +464,7 @@ func (m *SrPoliciesDetails) Unmarshal(b []byte) error { // Dump the list of SR policies // SrPoliciesDump defines message 'sr_policies_dump'. +// Deprecated: the message will be removed in the future versions type SrPoliciesDump struct{} func (m *SrPoliciesDump) Reset() { *m = SrPoliciesDump{} } @@ -491,7 +492,6 @@ func (m *SrPoliciesDump) Unmarshal(b []byte) error { } // SrPoliciesV2Details defines message 'sr_policies_v2_details'. -// InProgress: the message form may change in the future versions type SrPoliciesV2Details struct { Bsid ip_types.IP6Address `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"` EncapSrc ip_types.IP6Address `binapi:"ip6_address,name=encap_src" json:"encap_src,omitempty"` diff --git a/vpplink/generated/bindings/sr_types/sr_types.ba.go b/vpplink/generated/bindings/sr_types/sr_types.ba.go index 823fefa2a..c281c1a8d 100644 --- a/vpplink/generated/bindings/sr_types/sr_types.ba.go +++ b/vpplink/generated/bindings/sr_types/sr_types.ba.go @@ -28,16 +28,19 @@ const ( type SrBehavior uint8 const ( - SR_BEHAVIOR_API_END SrBehavior = 1 - SR_BEHAVIOR_API_X SrBehavior = 2 - SR_BEHAVIOR_API_T SrBehavior = 3 - SR_BEHAVIOR_API_D_FIRST SrBehavior = 4 - SR_BEHAVIOR_API_DX2 SrBehavior = 5 - SR_BEHAVIOR_API_DX6 SrBehavior = 6 - SR_BEHAVIOR_API_DX4 SrBehavior = 7 - SR_BEHAVIOR_API_DT6 SrBehavior = 8 - SR_BEHAVIOR_API_DT4 SrBehavior = 9 - SR_BEHAVIOR_API_LAST SrBehavior = 10 + SR_BEHAVIOR_API_END SrBehavior = 1 + SR_BEHAVIOR_API_X SrBehavior = 2 + SR_BEHAVIOR_API_T SrBehavior = 3 + SR_BEHAVIOR_API_D_FIRST SrBehavior = 4 + SR_BEHAVIOR_API_DX2 SrBehavior = 5 + SR_BEHAVIOR_API_DX6 SrBehavior = 6 + SR_BEHAVIOR_API_DX4 SrBehavior = 7 + SR_BEHAVIOR_API_DT6 SrBehavior = 8 + SR_BEHAVIOR_API_DT4 SrBehavior = 9 + SR_BEHAVIOR_API_LAST SrBehavior = 10 + SR_BEHAVIOR_API_END_UN_PERF SrBehavior = 11 + SR_BEHAVIOR_API_END_UN SrBehavior = 12 + SR_BEHAVIOR_API_UA SrBehavior = 13 ) var ( @@ -52,18 +55,24 @@ var ( 8: "SR_BEHAVIOR_API_DT6", 9: "SR_BEHAVIOR_API_DT4", 10: "SR_BEHAVIOR_API_LAST", + 11: "SR_BEHAVIOR_API_END_UN_PERF", + 12: "SR_BEHAVIOR_API_END_UN", + 13: "SR_BEHAVIOR_API_UA", } SrBehavior_value = map[string]uint8{ - "SR_BEHAVIOR_API_END": 1, - "SR_BEHAVIOR_API_X": 2, - "SR_BEHAVIOR_API_T": 3, - "SR_BEHAVIOR_API_D_FIRST": 4, - "SR_BEHAVIOR_API_DX2": 5, - "SR_BEHAVIOR_API_DX6": 6, - "SR_BEHAVIOR_API_DX4": 7, - "SR_BEHAVIOR_API_DT6": 8, - "SR_BEHAVIOR_API_DT4": 9, - "SR_BEHAVIOR_API_LAST": 10, + "SR_BEHAVIOR_API_END": 1, + "SR_BEHAVIOR_API_X": 2, + "SR_BEHAVIOR_API_T": 3, + "SR_BEHAVIOR_API_D_FIRST": 4, + "SR_BEHAVIOR_API_DX2": 5, + "SR_BEHAVIOR_API_DX6": 6, + "SR_BEHAVIOR_API_DX4": 7, + "SR_BEHAVIOR_API_DT6": 8, + "SR_BEHAVIOR_API_DT4": 9, + "SR_BEHAVIOR_API_LAST": 10, + "SR_BEHAVIOR_API_END_UN_PERF": 11, + "SR_BEHAVIOR_API_END_UN": 12, + "SR_BEHAVIOR_API_UA": 13, } ) diff --git a/vpplink/generated/bindings/tapv2/tapv2.ba.go b/vpplink/generated/bindings/tapv2/tapv2.ba.go index e4eb32408..67326df2d 100644 --- a/vpplink/generated/bindings/tapv2/tapv2.ba.go +++ b/vpplink/generated/bindings/tapv2/tapv2.ba.go @@ -33,14 +33,15 @@ const ( type TapFlags uint32 const ( - TAP_API_FLAG_GSO TapFlags = 1 - TAP_API_FLAG_CSUM_OFFLOAD TapFlags = 2 - TAP_API_FLAG_PERSIST TapFlags = 4 - TAP_API_FLAG_ATTACH TapFlags = 8 - TAP_API_FLAG_TUN TapFlags = 16 - TAP_API_FLAG_GRO_COALESCE TapFlags = 32 - TAP_API_FLAG_PACKED TapFlags = 64 - TAP_API_FLAG_IN_ORDER TapFlags = 128 + TAP_API_FLAG_GSO TapFlags = 1 + TAP_API_FLAG_CSUM_OFFLOAD TapFlags = 2 + TAP_API_FLAG_PERSIST TapFlags = 4 + TAP_API_FLAG_ATTACH TapFlags = 8 + TAP_API_FLAG_TUN TapFlags = 16 + TAP_API_FLAG_GRO_COALESCE TapFlags = 32 + TAP_API_FLAG_PACKED TapFlags = 64 + TAP_API_FLAG_IN_ORDER TapFlags = 128 + TAP_API_FLAG_CONSISTENT_QP TapFlags = 256 ) var ( @@ -53,16 +54,18 @@ var ( 32: "TAP_API_FLAG_GRO_COALESCE", 64: "TAP_API_FLAG_PACKED", 128: "TAP_API_FLAG_IN_ORDER", + 256: "TAP_API_FLAG_CONSISTENT_QP", } TapFlags_value = map[string]uint32{ - "TAP_API_FLAG_GSO": 1, - "TAP_API_FLAG_CSUM_OFFLOAD": 2, - "TAP_API_FLAG_PERSIST": 4, - "TAP_API_FLAG_ATTACH": 8, - "TAP_API_FLAG_TUN": 16, - "TAP_API_FLAG_GRO_COALESCE": 32, - "TAP_API_FLAG_PACKED": 64, - "TAP_API_FLAG_IN_ORDER": 128, + "TAP_API_FLAG_GSO": 1, + "TAP_API_FLAG_CSUM_OFFLOAD": 2, + "TAP_API_FLAG_PERSIST": 4, + "TAP_API_FLAG_ATTACH": 8, + "TAP_API_FLAG_TUN": 16, + "TAP_API_FLAG_GRO_COALESCE": 32, + "TAP_API_FLAG_PACKED": 64, + "TAP_API_FLAG_IN_ORDER": 128, + "TAP_API_FLAG_CONSISTENT_QP": 256, } ) @@ -260,6 +263,7 @@ func (m *SwInterfaceTapV2Dump) Unmarshal(b []byte) error { // - tag - tag // // TapCreateV2 defines message 'tap_create_v2'. +// Deprecated: the message will be removed in the future versions type TapCreateV2 struct { ID uint32 `binapi:"u32,name=id,default=4294967295" json:"id,omitempty"` UseRandomMac bool `binapi:"bool,name=use_random_mac,default=true" json:"use_random_mac,omitempty"` @@ -403,6 +407,7 @@ func (m *TapCreateV2) Unmarshal(b []byte) error { // - sw_if_index - software index allocated for the new tap interface // // TapCreateV2Reply defines message 'tap_create_v2_reply'. +// Deprecated: the message will be removed in the future versions type TapCreateV2Reply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` diff --git a/vpplink/generated/bindings/urpf/urpf.ba.go b/vpplink/generated/bindings/urpf/urpf.ba.go index 232e76c49..f51a5c41a 100644 --- a/vpplink/generated/bindings/urpf/urpf.ba.go +++ b/vpplink/generated/bindings/urpf/urpf.ba.go @@ -4,7 +4,7 @@ // // Contents: // - 1 enum -// - 4 messages +// - 6 messages package urpf import ( @@ -26,7 +26,7 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "urpf" APIVersion = "1.0.0" - VersionCrc = 0xd0c7b3c9 + VersionCrc = 0x88759016 ) // UrpfMode defines enum 'urpf_mode'. @@ -59,6 +59,93 @@ func (x UrpfMode) String() string { return "UrpfMode(" + strconv.Itoa(int(x)) + ")" } +// @brief uRPF enabled interface details +// UrpfInterfaceDetails defines message 'urpf_interface_details'. +type UrpfInterfaceDetails struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + IsInput bool `binapi:"bool,name=is_input" json:"is_input,omitempty"` + Mode UrpfMode `binapi:"urpf_mode,name=mode" json:"mode,omitempty"` + Af ip_types.AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"` + TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"` +} + +func (m *UrpfInterfaceDetails) Reset() { *m = UrpfInterfaceDetails{} } +func (*UrpfInterfaceDetails) GetMessageName() string { return "urpf_interface_details" } +func (*UrpfInterfaceDetails) GetCrcString() string { return "f94b5374" } +func (*UrpfInterfaceDetails) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *UrpfInterfaceDetails) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + size += 1 // m.IsInput + size += 1 // m.Mode + size += 1 // m.Af + size += 4 // m.TableID + return size +} +func (m *UrpfInterfaceDetails) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeBool(m.IsInput) + buf.EncodeUint8(uint8(m.Mode)) + buf.EncodeUint8(uint8(m.Af)) + buf.EncodeUint32(m.TableID) + return buf.Bytes(), nil +} +func (m *UrpfInterfaceDetails) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.IsInput = buf.DecodeBool() + m.Mode = UrpfMode(buf.DecodeUint8()) + m.Af = ip_types.AddressFamily(buf.DecodeUint8()) + m.TableID = buf.DecodeUint32() + return nil +} + +// @brief Dump uRPF enabled interface(s) in zero or more urpf_interface_details replies +// - sw_if_index - sw_if_index of a specific interface, or -1 (default) +// to return all uRPF enabled interfaces +// +// UrpfInterfaceDump defines message 'urpf_interface_dump'. +type UrpfInterfaceDump struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"` +} + +func (m *UrpfInterfaceDump) Reset() { *m = UrpfInterfaceDump{} } +func (*UrpfInterfaceDump) GetMessageName() string { return "urpf_interface_dump" } +func (*UrpfInterfaceDump) GetCrcString() string { return "f9e6675e" } +func (*UrpfInterfaceDump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *UrpfInterfaceDump) Size() (size int) { + if m == nil { + return 0 + } + size += 4 // m.SwIfIndex + return size +} +func (m *UrpfInterfaceDump) Marshal(b []byte) ([]byte, error) { + if b == nil { + b = make([]byte, m.Size()) + } + buf := codec.NewBuffer(b) + buf.EncodeUint32(uint32(m.SwIfIndex)) + return buf.Bytes(), nil +} +func (m *UrpfInterfaceDump) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + return nil +} + // * @brief Enable uRPF on a given interface in a given direction // - - mode - Mode // - - af - Address Family @@ -234,6 +321,8 @@ func (m *UrpfUpdateV2Reply) Unmarshal(b []byte) error { func init() { file_urpf_binapi_init() } func file_urpf_binapi_init() { + api.RegisterMessage((*UrpfInterfaceDetails)(nil), "urpf_interface_details_f94b5374") + api.RegisterMessage((*UrpfInterfaceDump)(nil), "urpf_interface_dump_f9e6675e") api.RegisterMessage((*UrpfUpdate)(nil), "urpf_update_cc274cd1") api.RegisterMessage((*UrpfUpdateReply)(nil), "urpf_update_reply_e8d4e804") api.RegisterMessage((*UrpfUpdateV2)(nil), "urpf_update_v2_b873d028") @@ -243,6 +332,8 @@ func file_urpf_binapi_init() { // Messages returns list of all messages in this module. func AllMessages() []api.Message { return []api.Message{ + (*UrpfInterfaceDetails)(nil), + (*UrpfInterfaceDump)(nil), (*UrpfUpdate)(nil), (*UrpfUpdateReply)(nil), (*UrpfUpdateV2)(nil), diff --git a/vpplink/generated/bindings/urpf/urpf_rpc.ba.go b/vpplink/generated/bindings/urpf/urpf_rpc.ba.go index 889acd94e..f252acc7f 100644 --- a/vpplink/generated/bindings/urpf/urpf_rpc.ba.go +++ b/vpplink/generated/bindings/urpf/urpf_rpc.ba.go @@ -4,12 +4,16 @@ package urpf import ( "context" + "fmt" + "io" + memclnt "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/memclnt" api "go.fd.io/govpp/api" ) // RPCService defines RPC service urpf. type RPCService interface { + UrpfInterfaceDump(ctx context.Context, in *UrpfInterfaceDump) (RPCService_UrpfInterfaceDumpClient, error) UrpfUpdate(ctx context.Context, in *UrpfUpdate) (*UrpfUpdateReply, error) UrpfUpdateV2(ctx context.Context, in *UrpfUpdateV2) (*UrpfUpdateV2Reply, error) } @@ -22,6 +26,49 @@ func NewServiceClient(conn api.Connection) RPCService { return &serviceClient{conn} } +func (c *serviceClient) UrpfInterfaceDump(ctx context.Context, in *UrpfInterfaceDump) (RPCService_UrpfInterfaceDumpClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_UrpfInterfaceDumpClient{stream} + if err := x.Stream.SendMsg(in); err != nil { + return nil, err + } + if err = x.Stream.SendMsg(&memclnt.ControlPing{}); err != nil { + return nil, err + } + return x, nil +} + +type RPCService_UrpfInterfaceDumpClient interface { + Recv() (*UrpfInterfaceDetails, error) + api.Stream +} + +type serviceClient_UrpfInterfaceDumpClient struct { + api.Stream +} + +func (c *serviceClient_UrpfInterfaceDumpClient) Recv() (*UrpfInterfaceDetails, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *UrpfInterfaceDetails: + return m, nil + case *memclnt.ControlPingReply: + err = c.Stream.Close() + if err != nil { + return nil, err + } + return nil, io.EOF + default: + return nil, fmt.Errorf("unexpected message: %T %v", m, m) + } +} + func (c *serviceClient) UrpfUpdate(ctx context.Context, in *UrpfUpdate) (*UrpfUpdateReply, error) { out := new(UrpfUpdateReply) err := c.conn.Invoke(ctx, in, out) diff --git a/vpplink/generated/bindings/virtio/virtio.ba.go b/vpplink/generated/bindings/virtio/virtio.ba.go index c18697950..d293d8054 100644 --- a/vpplink/generated/bindings/virtio/virtio.ba.go +++ b/vpplink/generated/bindings/virtio/virtio.ba.go @@ -39,6 +39,7 @@ const ( VIRTIO_API_FLAG_PACKED VirtioFlags = 8 VIRTIO_API_FLAG_IN_ORDER VirtioFlags = 16 VIRTIO_API_FLAG_BUFFERING VirtioFlags = 32 + VIRTIO_API_FLAG_RSS VirtioFlags = 64 ) var ( @@ -49,6 +50,7 @@ var ( 8: "VIRTIO_API_FLAG_PACKED", 16: "VIRTIO_API_FLAG_IN_ORDER", 32: "VIRTIO_API_FLAG_BUFFERING", + 64: "VIRTIO_API_FLAG_RSS", } VirtioFlags_value = map[string]uint32{ "VIRTIO_API_FLAG_GSO": 1, @@ -57,6 +59,7 @@ var ( "VIRTIO_API_FLAG_PACKED": 8, "VIRTIO_API_FLAG_IN_ORDER": 16, "VIRTIO_API_FLAG_BUFFERING": 32, + "VIRTIO_API_FLAG_RSS": 64, } ) diff --git a/vpplink/generated/bindings/vxlan/vxlan.ba.go b/vpplink/generated/bindings/vxlan/vxlan.ba.go index dfd3d3ee6..c1e96a844 100644 --- a/vpplink/generated/bindings/vxlan/vxlan.ba.go +++ b/vpplink/generated/bindings/vxlan/vxlan.ba.go @@ -117,6 +117,7 @@ func (m *SwInterfaceSetVxlanBypassReply) Unmarshal(b []byte) error { // - vni - The VXLAN Network Identifier, uint24 // // VxlanAddDelTunnel defines message 'vxlan_add_del_tunnel'. +// Deprecated: the message will be removed in the future versions type VxlanAddDelTunnel struct { IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` Instance uint32 `binapi:"u32,name=instance" json:"instance,omitempty"` @@ -184,6 +185,7 @@ func (m *VxlanAddDelTunnel) Unmarshal(b []byte) error { } // VxlanAddDelTunnelReply defines message 'vxlan_add_del_tunnel_reply'. +// Deprecated: the message will be removed in the future versions type VxlanAddDelTunnelReply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` @@ -233,6 +235,7 @@ func (m *VxlanAddDelTunnelReply) Unmarshal(b []byte) error { // - vni - The VXLAN Network Identifier, uint24 // // VxlanAddDelTunnelV2 defines message 'vxlan_add_del_tunnel_v2'. +// Deprecated: the message will be removed in the future versions type VxlanAddDelTunnelV2 struct { IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` Instance uint32 `binapi:"u32,name=instance,default=4294967295" json:"instance,omitempty"` @@ -308,6 +311,7 @@ func (m *VxlanAddDelTunnelV2) Unmarshal(b []byte) error { } // VxlanAddDelTunnelV2Reply defines message 'vxlan_add_del_tunnel_v2_reply'. +// Deprecated: the message will be removed in the future versions type VxlanAddDelTunnelV2Reply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` @@ -553,6 +557,7 @@ func (m *VxlanOffloadRxReply) Unmarshal(b []byte) error { } // VxlanTunnelDetails defines message 'vxlan_tunnel_details'. +// Deprecated: the message will be removed in the future versions type VxlanTunnelDetails struct { SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` Instance uint32 `binapi:"u32,name=instance" json:"instance,omitempty"` @@ -620,6 +625,7 @@ func (m *VxlanTunnelDetails) Unmarshal(b []byte) error { } // VxlanTunnelDump defines message 'vxlan_tunnel_dump'. +// Deprecated: the message will be removed in the future versions type VxlanTunnelDump struct { SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` } diff --git a/vpplink/generated/bindings/wireguard/wireguard.ba.go b/vpplink/generated/bindings/wireguard/wireguard.ba.go index ba8cae72e..6a7cc3d25 100644 --- a/vpplink/generated/bindings/wireguard/wireguard.ba.go +++ b/vpplink/generated/bindings/wireguard/wireguard.ba.go @@ -25,7 +25,7 @@ const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "wireguard" - APIVersion = "0.3.0" + APIVersion = "1.3.0" VersionCrc = 0x5d8f9252 ) diff --git a/vpplink/generated/gen.go b/vpplink/generated/gen.go index 916ab60c0..20cd02371 100644 --- a/vpplink/generated/gen.go +++ b/vpplink/generated/gen.go @@ -8,4 +8,4 @@ import ( ) //go:generate go build -buildmode=plugin -o ./.bin/vpplink_plugin.so github.com/calico-vpp/vpplink/pkg -//go:generate go run go.fd.io/govpp/cmd/binapi-generator --no-version-info --no-source-path-info --gen rpc,./.bin/vpplink_plugin.so -o ./bindings --input $VPP_DIR ikev2 gso arp interface ip ipip ipsec ip_neighbor tapv2 nat44_ed cnat af_packet feature ip6_nd punt vxlan af_xdp vlib virtio avf wireguard capo memif acl abf crypto_sw_scheduler sr rdma vmxnet3 pbl memclnt session vpe urpf +//go:generate go run go.fd.io/govpp/cmd/binapi-generator --no-version-info --no-source-path-info --gen rpc,./.bin/vpplink_plugin.so -o ./bindings --input $VPP_DIR ikev2 gso arp interface ip ipip ipsec ip_neighbor tapv2 nat44_ed cnat af_packet feature ip6_nd punt vxlan af_xdp vlib virtio avf wireguard capo memif acl abf crypto_sw_scheduler sr rdma vmxnet3 pbl memclnt session vpe urpf classify ip_session_redirect diff --git a/vpplink/generated/generate.log b/vpplink/generated/generate.log index 8fe493015..eed7cf743 100755 --- a/vpplink/generated/generate.log +++ b/vpplink/generated/generate.log @@ -1,13 +1,14 @@ -VPP Version : 23.10-rc0~8-g97c83709b -Binapi-generator version : v0.8.0-dev -VPP Base commit : 7199f37dc gerrit:34726/3 interface: add buffer stats api +VPP Version : 25.10-rc0~68-g388371f0f +Binapi-generator version : v0.11.0 +VPP Base commit : 691b179ae cnat: combine multiple changes ------------------ Cherry picked commits -------------------- -interface: Fix interface.api endianness +ip: add support for checksum in IP midchain capo: Calico Policies plugin acl: acl-plugin custom policies cnat: [WIP] no k8s maglev from pods pbl: Port based balancer -gerrit:40078/3 vnet: allow format deleted swifidx -gerrit:40090/3 cnat: undo fib_entry_contribute_forwarding +gerrit:43369/2 cnat: converge new cnat implementation to support old usecases (calico) +gerrit:revert:39675/5 Revert "ip-neighbor: do not use sas to determine NS source address" gerrit:34726/3 interface: add buffer stats api +cnat: combine multiple changes ------------------------------------------------------------- diff --git a/vpplink/generated/patches/0002-cnat-WIP-no-k8s-maglev-from-pods.patch b/vpplink/generated/patches/0002-cnat-WIP-no-k8s-maglev-from-pods.patch index 646662513..014b203d4 100644 --- a/vpplink/generated/patches/0002-cnat-WIP-no-k8s-maglev-from-pods.patch +++ b/vpplink/generated/patches/0002-cnat-WIP-no-k8s-maglev-from-pods.patch @@ -12,38 +12,35 @@ Signed-off-by: Nathan Skrzypczak 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/cnat/cnat_node_feature.c b/src/plugins/cnat/cnat_node_feature.c -index 76aa89398..fd3b90a1a 100644 +index a1bf6c74e..cbfdc1deb 100644 --- a/src/plugins/cnat/cnat_node_feature.c +++ b/src/plugins/cnat/cnat_node_feature.c -@@ -43,6 +43,7 @@ cnat_input_feature_fn (vlib_main_t *vm, vlib_node_runtime_t *node, - int session_not_found, cnat_session_t *session) +@@ -43,6 +43,7 @@ cnat_input_feature_new_flow_inline (vlib_main_t *vm, vlib_buffer_t *b, + cnat_timestamp_t *ts) { vlib_combined_counter_main_t *cntm = &cnat_translation_counters; -+ cnat_snat_policy_main_t *cpm = &cnat_snat_policy_main; ++ cnat_snat_policy_entry_t *cpe = cnat_snat_policy_entry_get_default (); + cnat_main_t *cm = &cnat_main; const cnat_translation_t *ct = NULL; - ip4_header_t *ip4 = NULL; - ip_protocol_t iproto; -@@ -53,6 +54,9 @@ cnat_input_feature_fn (vlib_main_t *vm, vlib_node_runtime_t *node, + cnat_timestamp_rewrite_t *rw = NULL; +@@ -55,6 +56,8 @@ cnat_input_feature_new_flow_inline (vlib_main_t *vm, vlib_buffer_t *b, + udp_header_t *udp0; index_t cti; - u8 trace_flags = 0; + u32 in_if = vnet_buffer (b)->sw_if_index[VLIB_RX]; -+ int ispod; -+ - /* By default follow arc default next */ - vnet_feature_next (&next0, b); ++ int ispod = 0; + if (AF_IP4 == af) + { + ip4 = vlib_buffer_get_current (b); +@@ -113,7 +116,10 @@ cnat_input_feature_new_flow_inline (vlib_main_t *vm, vlib_buffer_t *b, + rw->tuple.port[VLIB_TX]; -@@ -127,7 +131,9 @@ cnat_input_feature_fn (vlib_main_t *vm, vlib_node_runtime_t *node, - session->value.cs_port[VLIB_RX] = udp0->src_port; - session->value.flags = 0; - -- if (trk0->ct_flags & CNAT_TRK_FLAG_NO_NAT) -+ ispod = clib_bitmap_get ( -+ cpm->interface_maps[CNAT_SNAT_IF_MAP_INCLUDE_POD], in_if); -+ if (trk0->ct_flags & CNAT_TRK_FLAG_NO_NAT && !ispod) - { - const dpo_id_t *dpo0; - const load_balance_t *lb1; --- -2.39.2 - + ts->trk = trk0; +- if (trk0->ct_flags & CNAT_TRK_FLAG_NO_NAT) ++ if (cpe) ++ ispod = clib_bitmap_get (cpe->interface_maps[CNAT_SNAT_IF_MAP_INCLUDE_POD], ++ in_if); ++ if (trk0->ct_flags & CNAT_TRK_FLAG_NO_NAT && !ispod) + { + const dpo_id_t *dpo0; + const load_balance_t *lb1; diff --git a/vpplink/generated/patches/0005-partial-revert-arthur-gso.patch b/vpplink/generated/patches/0005-partial-revert-arthur-gso.patch new file mode 100644 index 000000000..03419ab23 --- /dev/null +++ b/vpplink/generated/patches/0005-partial-revert-arthur-gso.patch @@ -0,0 +1,103 @@ +From a5efb646c1e2575abe427f8f5f211a988464cde1 Mon Sep 17 00:00:00 2001 +From: Mohsin Kazmi +Date: Mon, 28 Oct 2024 16:44:11 +0000 +Subject: [PATCH] ip: add support for checksum in IP midchain + +Type: fix + +This is a temporary patch which should not be merged +in upstream VPP. +It only reverts partial support of the patch added by +https://gerrit.fd.io/r/c/vpp/+/32695 + +Today, virtual interfaces on egress does not support +checksum and GSO offload packets which are +encapsulated in tunnel. + +Signed-off-by: Mohsin Kazmi +Change-Id: Ib8c98bedc227419154aaaf1bebed46890ab69026 +--- + +diff --git a/src/vnet/ip/ip4_forward.c b/src/vnet/ip/ip4_forward.c +index ff74b52..e18e688 100644 +--- a/src/vnet/ip/ip4_forward.c ++++ b/src/vnet/ip/ip4_forward.c +@@ -2225,6 +2225,9 @@ + adj0->ia_cfg_index); + + next[0] = next_index; ++ if (is_midchain) ++ vnet_calc_checksums_inline (vm, b[0], 1 /* is_ip4 */, ++ 0 /* is_ip6 */); + } + else + { +@@ -2247,6 +2250,9 @@ + &next_index, b[1], + adj1->ia_cfg_index); + next[1] = next_index; ++ if (is_midchain) ++ vnet_calc_checksums_inline (vm, b[1], 1 /* is_ip4 */, ++ 0 /* is_ip6 */); + } + else + { +@@ -2396,6 +2402,8 @@ + + if (is_midchain) + { ++ vnet_calc_checksums_inline (vm, b[0], 1 /* is_ip4 */, ++ 0 /* is_ip6 */); + /* Guess we are only writing on ipv4 header. */ + vnet_rewrite_one_header (adj0[0], ip0, sizeof (ip4_header_t)); + } +@@ -2499,6 +2507,8 @@ + + if (is_midchain) + { ++ vnet_calc_checksums_inline (vm, b[0], 1 /* is_ip4 */, ++ 0 /* is_ip6 */); + /* Guess we are only writing on ipv4 header. */ + vnet_rewrite_one_header (adj0[0], ip0, sizeof (ip4_header_t)); + } +diff --git a/src/vnet/ip/ip6_forward.c b/src/vnet/ip/ip6_forward.c +index 31adc90..e697018 100644 +--- a/src/vnet/ip/ip6_forward.c ++++ b/src/vnet/ip/ip6_forward.c +@@ -1955,9 +1955,17 @@ + } + + if (is_midchain) +- /* Guess we are only writing on ipv6 header. */ +- vnet_rewrite_two_headers (adj0[0], adj1[0], ip0, ip1, +- sizeof (ip6_header_t)); ++ { ++ /* before we paint on the next header, update the L4 ++ * checksums if required, since there's no offload on a tunnel */ ++ vnet_calc_checksums_inline (vm, p0, 0 /* is_ip4 */, ++ 1 /* is_ip6 */); ++ vnet_calc_checksums_inline (vm, p1, 0 /* is_ip4 */, ++ 1 /* is_ip6 */); ++ /* Guess we are only writing on ipv6 header. */ ++ vnet_rewrite_two_headers (adj0[0], adj1[0], ip0, ip1, ++ sizeof (ip6_header_t)); ++ } + else + /* Guess we are only writing on simple Ethernet header. */ + vnet_rewrite_two_headers (adj0[0], adj1[0], +@@ -2085,8 +2093,13 @@ + adj0->ia_cfg_index); + + if (is_midchain) +- /* Guess we are only writing on ip6 header. */ +- vnet_rewrite_one_header (adj0[0], ip0, sizeof (ip6_header_t)); ++ { ++ vnet_calc_checksums_inline (vm, p0, 0 /* is_ip4 */, ++ 1 /* is_ip6 */); ++ /* Guess we are only writing on ip6 header. */ ++ vnet_rewrite_one_header (adj0[0], ip0, ++ sizeof (ip6_header_t)); ++ } + else + /* Guess we are only writing on simple Ethernet header. */ + vnet_rewrite_one_header (adj0[0], ip0, diff --git a/vpplink/generated/patches/cnatmaglevpatchdiff.patch b/vpplink/generated/patches/cnatmaglevpatchdiff.patch new file mode 100644 index 000000000..a8ef873ea --- /dev/null +++ b/vpplink/generated/patches/cnatmaglevpatchdiff.patch @@ -0,0 +1,45 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nathan Skrzypczak +Date: Mon, 8 Mar 2021 19:00:04 +0100 +Subject: [PATCH 2/5] cnat: [WIP] no k8s maglev from pods + +Type: improvement + +Change-Id: If0702dbc51c308f0bb0ed16149c293d7adf9a984 +Signed-off-by: Nathan Skrzypczak +--- + src/plugins/cnat/cnat_node_feature.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/plugins/cnat/cnat_node_feature.c b/src/plugins/cnat/cnat_node_feature.c +index 0108d09dc..a82086fbf 100644 +--- a/src/plugins/cnat/cnat_node_feature.c ++++ b/src/plugins/cnat/cnat_node_feature.c +@@ -43,6 +43,7 @@ cnat_input_feature_new_flow_inline (vlib_main_t *vm, vlib_buffer_t *b, + cnat_timestamp_t *ts) + { + vlib_combined_counter_main_t *cntm = &cnat_translation_counters; ++ cnat_snat_policy_entry_t *cpe = cnat_snat_policy_entry_get_default (); + const cnat_translation_t *ct = NULL; + cnat_timestamp_rewrite_t *rw = NULL; + cnat_client_t *cc; +@@ -54,6 +55,8 @@ cnat_input_feature_new_flow_inline (vlib_main_t *vm, vlib_buffer_t *b, + udp_header_t *udp0; + index_t cti; + ++ u32 in_if = vnet_buffer (b)->sw_if_index[VLIB_RX]; ++ int ispod; + if (AF_IP4 == af) + { + ip4 = vlib_buffer_get_current (b); +@@ -112,7 +115,9 @@ cnat_input_feature_new_flow_inline (vlib_main_t *vm, vlib_buffer_t *b, + rw->tuple.port[VLIB_TX]; + + ts->trk = trk0; +- if (trk0->ct_flags & CNAT_TRK_FLAG_NO_NAT) ++ ispod = ++ clib_bitmap_get (cpe->interface_maps[CNAT_SNAT_IF_MAP_INCLUDE_POD], in_if); ++ if (trk0->ct_flags & CNAT_TRK_FLAG_NO_NAT && !ispod) + { + const dpo_id_t *dpo0; + const load_balance_t *lb1; \ No newline at end of file diff --git a/vpplink/generated/tempdiff.patch b/vpplink/generated/tempdiff.patch new file mode 100644 index 000000000..32b135eac --- /dev/null +++ b/vpplink/generated/tempdiff.patch @@ -0,0 +1,32 @@ +diff --git a/src/plugins/cnat/cnat_node_feature.c b/src/plugins/cnat/cnat_node_feature.c +index 0108d09dc..a82086fbf 100644 +--- a/src/plugins/cnat/cnat_node_feature.c ++++ b/src/plugins/cnat/cnat_node_feature.c +@@ -43,6 +43,7 @@ cnat_input_feature_new_flow_inline (vlib_main_t *vm, vlib_buffer_t *b, + cnat_timestamp_t *ts) + { + vlib_combined_counter_main_t *cntm = &cnat_translation_counters; ++ cnat_snat_policy_entry_t *cpe = cnat_snat_policy_entry_get_default (); + const cnat_translation_t *ct = NULL; + cnat_timestamp_rewrite_t *rw = NULL; + cnat_client_t *cc; +@@ -54,6 +55,8 @@ cnat_input_feature_new_flow_inline (vlib_main_t *vm, vlib_buffer_t *b, + udp_header_t *udp0; + index_t cti; + ++ u32 in_if = vnet_buffer (b)->sw_if_index[VLIB_RX]; ++ int ispod; + if (AF_IP4 == af) + { + ip4 = vlib_buffer_get_current (b); +@@ -112,7 +115,9 @@ cnat_input_feature_new_flow_inline (vlib_main_t *vm, vlib_buffer_t *b, + rw->tuple.port[VLIB_TX]; + + ts->trk = trk0; +- if (trk0->ct_flags & CNAT_TRK_FLAG_NO_NAT) ++ ispod = ++ clib_bitmap_get (cpe->interface_maps[CNAT_SNAT_IF_MAP_INCLUDE_POD], in_if); ++ if (trk0->ct_flags & CNAT_TRK_FLAG_NO_NAT && !ispod) + { + const dpo_id_t *dpo0; + const load_balance_t *lb1; diff --git a/vpplink/generated/vpp_clone_current.sh b/vpplink/generated/vpp_clone_current.sh index 2254c8793..f7eb58702 100755 --- a/vpplink/generated/vpp_clone_current.sh +++ b/vpplink/generated/vpp_clone_current.sh @@ -92,11 +92,14 @@ function git_clone_cd_and_reset () # --------------- Things to cherry pick --------------- -git_clone_cd_and_reset "$1" a7dd04d73bf5abed944fb77a5e957bbad24e2750 # misc: Initial 23.10-rc0 commit - +# VPP latest commit as on 12/May/2025 +git_clone_cd_and_reset "$1" 691b179ae9dd9980ee104e7a5446ab9385dac9dc # benoit patch git_cherry_pick refs/changes/26/34726/3 # 34726: interface: add buffer stats api | https://gerrit.fd.io/r/c/vpp/+/34726 -git_cherry_pick refs/changes/90/40090/3 # 40090: cnat: undo fib_entry_contribute_forwarding | https://gerrit.fd.io/r/c/vpp/+/40090 -git_cherry_pick refs/changes/78/40078/3 # 40078: vnet: allow format deleted swifidx | https://gerrit.fd.io/r/c/vpp/+/40078 +git_cherry_pick refs/changes/43/42343/2 # 42343: vcl: LDP default to regular option | https://gerrit.fd.io/r/c/vpp/+/42343 + +# testing new cnat stuff +git_cherry_pick refs/changes/69/43369/2 https://gerrit.fd.io/r/c/vpp/+/43369 + # --------------- private plugins --------------- # Generated with 'git format-patch --zero-commit -o ./patches/ HEAD^^^' @@ -105,3 +108,4 @@ git_apply_private 0002-cnat-WIP-no-k8s-maglev-from-pods.patch git_apply_private 0003-acl-acl-plugin-custom-policies.patch git_apply_private 0004-capo-Calico-Policies-plugin.patch git_apply_private 0005-interface-Fix-interface.api-endianness.patch +git_apply_private 0005-partial-revert-arthur-gso.patch diff --git a/vpplink/neighbor.go b/vpplink/neighbor.go new file mode 100644 index 000000000..d4a9d6035 --- /dev/null +++ b/vpplink/neighbor.go @@ -0,0 +1,74 @@ +// Copyright (C) 2025 Cisco Systems Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +// implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package vpplink + +import ( + "fmt" + + "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/interface_types" + "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/ip_neighbor" + "github.com/projectcalico/vpp-dataplane/v3/vpplink/types" +) + +func (v *VppLink) AddNeighbor(neighbor *types.Neighbor) error { + return v.addDelNeighbor(neighbor, true) +} + +func (v *VppLink) DelNeighbor(neighbor *types.Neighbor) error { + return v.addDelNeighbor(neighbor, false) +} + +func (v *VppLink) addDelNeighbor(neighbor *types.Neighbor, isAdd bool) error { + client := ip_neighbor.NewServiceClient(v.GetConnection()) + + _, err := client.IPNeighborAddDel(v.GetContext(), &ip_neighbor.IPNeighborAddDel{ + IsAdd: isAdd, + Neighbor: ip_neighbor.IPNeighbor{ + SwIfIndex: interface_types.InterfaceIndex(neighbor.SwIfIndex), + Flags: types.ToVppNeighborFlags(neighbor.Flags), + MacAddress: types.MacAddress(neighbor.HardwareAddr), + IPAddress: types.ToVppAddress(neighbor.IP), + }, + }) + if err != nil { + return fmt.Errorf("failed to %s neighbor from VPP: %w", isAddStr(isAdd), err) + } + v.GetLog().Debugf("%sed neighbor %+v", isAddStr(isAdd), neighbor) + return nil +} + +func (v *VppLink) configureNeighbors(neighborConfig *types.NeighborConfig, isIP6 bool) error { + client := ip_neighbor.NewServiceClient(v.GetConnection()) + _, err := client.IPNeighborConfig(v.GetContext(), &ip_neighbor.IPNeighborConfig{ + Af: types.ToVppAddressFamily(isIP6), + MaxNumber: neighborConfig.MaxNumber, + MaxAge: neighborConfig.MaxAge, + Recycle: neighborConfig.Recycle, + }) + if err != nil { + return fmt.Errorf("failed to set neighbor config in VPP: %s, %w", neighborConfig, err) + } + v.GetLog().Debugf("set neighbor config %s", neighborConfig) + return nil +} + +func (v *VppLink) ConfigureNeighborsV4(neighborConfig *types.NeighborConfig) error { + return v.configureNeighbors(neighborConfig, false /* isIP6 */) +} + +func (v *VppLink) ConfigureNeighborsV6(neighborConfig *types.NeighborConfig) error { + return v.configureNeighbors(neighborConfig, true /* isIP6 */) +} diff --git a/vpplink/redirect.go b/vpplink/redirect.go new file mode 100644 index 000000000..bbf3fba18 --- /dev/null +++ b/vpplink/redirect.go @@ -0,0 +1,66 @@ +// Copyright (C) 2023 Cisco Systems Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +// implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package vpplink + +import ( + "fmt" + + fib_types "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/fib_types" + "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/ip_session_redirect" + "github.com/projectcalico/vpp-dataplane/v3/vpplink/types" +) + +func (v *VppLink) AddSessionRedirect(redirect *types.SessionRedirect, paths ...*types.RoutePath) (err error) { + client := ip_session_redirect.NewServiceClient(v.GetConnection()) + + fibPaths := make([]fib_types.FibPath, 0, len(paths)) + for _, routePath := range paths { + fibPaths = append(fibPaths, routePath.ToFibPath(false)) + } + match, err := redirect.GetMatch() + if err != nil { + return err + } + _, err = client.IPSessionRedirectAddV2(v.GetContext(), &ip_session_redirect.IPSessionRedirectAddV2{ + TableIndex: redirect.TableIndex, + MatchLen: uint8(len(match)), + Match: match, + NPaths: uint8(len(fibPaths)), + Paths: fibPaths, + }) + if err != nil { + return fmt.Errorf("failed to add ip session redirect: %w", err) + } + return nil +} + +func (v *VppLink) DelSessionRedirect(redirect *types.SessionRedirect) error { + client := ip_session_redirect.NewServiceClient(v.GetConnection()) + + match, err := redirect.GetMatch() + if err != nil { + return err + } + _, err = client.IPSessionRedirectDel(v.GetContext(), &ip_session_redirect.IPSessionRedirectDel{ + TableIndex: redirect.TableIndex, + MatchLen: uint8(len(match)), + Match: match, + }) + if err != nil { + return fmt.Errorf("failed to del ip session redirect: %w", err) + } + return nil +} diff --git a/vpplink/routes.go b/vpplink/routes.go index cbf49a1f2..ac11f2259 100644 --- a/vpplink/routes.go +++ b/vpplink/routes.go @@ -21,9 +21,7 @@ import ( "net" "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/fib_types" - "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/interface_types" vppip "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/ip" - "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/ip_neighbor" "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/ip_types" "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/mfib_types" "github.com/projectcalico/vpp-dataplane/v3/vpplink/types" @@ -60,33 +58,6 @@ func (v *VppLink) GetRoutes(tableID uint32, isIPv6 bool) ([]types.Route, error) return routes, nil } -func (v *VppLink) AddNeighbor(neighbor *types.Neighbor) error { - return v.addDelNeighbor(neighbor, true) -} - -func (v *VppLink) DelNeighbor(neighbor *types.Neighbor) error { - return v.addDelNeighbor(neighbor, false) -} - -func (v *VppLink) addDelNeighbor(neighbor *types.Neighbor, isAdd bool) error { - client := ip_neighbor.NewServiceClient(v.GetConnection()) - - _, err := client.IPNeighborAddDel(v.GetContext(), &ip_neighbor.IPNeighborAddDel{ - IsAdd: isAdd, - Neighbor: ip_neighbor.IPNeighbor{ - SwIfIndex: interface_types.InterfaceIndex(neighbor.SwIfIndex), - Flags: types.ToVppNeighborFlags(neighbor.Flags), - MacAddress: types.MacAddress(neighbor.HardwareAddr), - IPAddress: types.ToVppAddress(neighbor.IP), - }, - }) - if err != nil { - return fmt.Errorf("failed to %s neighbor from VPP: %w", isAddStr(isAdd), err) - } - v.GetLog().Debugf("%sed neighbor %+v", isAddStr(isAdd), neighbor) - return nil -} - func (v *VppLink) RoutesAdd(Dsts []*net.IPNet, routepath *types.RoutePath) error { /* add the same route for multiple dsts */ for _, dst := range Dsts { diff --git a/vpplink/types/classify.go b/vpplink/types/classify.go new file mode 100644 index 000000000..a86c8786f --- /dev/null +++ b/vpplink/types/classify.go @@ -0,0 +1,374 @@ +// Copyright (C) 2023 Cisco Systems Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +// implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package types + +import ( + "bytes" + "encoding/binary" + "fmt" + "net" + "net/netip" + "strings" +) + +const InvalidTableId = ^uint32(0) + +type IPv4Header struct { + VersionIHL uint8 + Tos uint8 + TotLen uint16 + Id uint16 + FragOff uint16 + Ttl uint8 + Protocol uint8 + Csum uint16 + Saddr [4]byte + Daddr [4]byte +} + +type UDPHeader struct { + Sport uint16 + Dport uint16 + Len uint16 + Csum uint16 +} + +type GeneveHeader struct { + VersionOptLen uint8 + Flags uint8 + ProtocolType uint16 + Vni uint32 + Options []byte +} + +func (h GeneveHeader) FixedBytes() []byte { + buf := make([]byte, 0, 8) + buf = append(buf, h.VersionOptLen, h.Flags) + buf = binary.BigEndian.AppendUint16(buf, h.ProtocolType) + buf = binary.BigEndian.AppendUint32(buf, h.Vni) + return buf +} + +type UDPv4Header struct { + IP IPv4Header + UDP UDPHeader +} + +func NewUDPv4Header(buffer []byte) (*UDPv4Header, error) { + udpHdr := UDPv4Header{} + reader := bytes.NewReader(buffer) + err := binary.Read(reader, binary.BigEndian, &udpHdr) + return &udpHdr, err +} + +func (h UDPv4Header) Bytes() ([]byte, error) { + var buf bytes.Buffer + err := binary.Write(&buf, binary.BigEndian, h) + if err != nil { + return nil, err + } + return buf.Bytes(), nil +} + +type GeneveV4Header struct { + UDPv4Header + GeneveHeader +} + +func (h GeneveV4Header) Bytes() ([]byte, error) { + var buf bytes.Buffer + err := binary.Write(&buf, binary.BigEndian, h.UDPv4Header) + if err != nil { + return nil, err + } + buf.Write(h.FixedBytes()) + buf.Write(h.Options) + return buf.Bytes(), nil +} + +type TCPPorts struct { + Sport uint16 + Dport uint16 +} + +type TCPv4Header struct { + IP IPv4Header + TCP TCPPorts +} + +func (h TCPv4Header) Bytes() ([]byte, error) { + var buf bytes.Buffer + err := binary.Write(&buf, binary.BigEndian, h) + if err != nil { + return nil, err + } + return buf.Bytes(), nil +} + +var ( + FiveTupleMask []byte + DstFourTupleMask []byte + DstThreeTupleMask []byte + SrcThreeTupleMask []byte + DstAddrMask []byte + SrcAddrMask []byte +) + +type DstThreeTuple struct { + Protocol IPProto + DstAddr netip.Addr + DstPort uint16 +} + +type FiveTuple struct { + Protocol IPProto + SrcAddr netip.Addr + SrcPort uint16 + DstAddr netip.Addr + DstPort uint16 +} + +func IPToAddr(a net.IP) netip.Addr { + if a == nil { + return netip.AddrFrom4([4]byte{0, 0, 0, 0}) + } + if a.To4() == nil { + addr, _ := netip.AddrFromSlice(a) + return addr + } + addr, _ := netip.AddrFromSlice(a) + return netip.AddrFrom4(addr.As4()) +} + +func New5Tuple(protocol IPProto, srcAddr net.IP, srcPort uint16, dstAddr net.IP, dstPort uint16) FiveTuple { + return FiveTuple{ + Protocol: protocol, + SrcPort: srcPort, DstPort: dstPort, + SrcAddr: IPToAddr(srcAddr), DstAddr: IPToAddr(dstAddr), + } +} + +func NewDst4Tuple(protocol IPProto, srcAddr net.IP, dstAddr net.IP, dstPort uint16) FiveTuple { + return New5Tuple(protocol, srcAddr, 0, dstAddr, dstPort) +} + +func NewDst3Tuple(protocol IPProto, dstAddr net.IP, dstPort uint16) FiveTuple { + return New5Tuple(protocol, net.IPv4zero, 0, dstAddr, dstPort) +} + +func NewSrc3Tuple(protocol IPProto, srcAddr net.IP, srcPort uint16) FiveTuple { + return New5Tuple(protocol, srcAddr, srcPort, net.IPv4zero, 0) +} + +func (tuple *FiveTuple) String() string { + return fmt.Sprintf("%s,%s:%d->%s:%d", tuple.Protocol.String(), + tuple.SrcAddr, tuple.SrcPort, tuple.DstAddr, tuple.DstPort) +} + +func (tuple *FiveTuple) GetMatch() ([]byte, error) { + var match UDPv4Header + match.IP.Protocol = uint8(tuple.Protocol) + match.IP.Saddr = tuple.SrcAddr.As4() + match.IP.Daddr = tuple.DstAddr.As4() + match.UDP.Sport = tuple.SrcPort + match.UDP.Dport = tuple.DstPort + matchBytes, err := match.Bytes() + if err != nil { + return nil, err + } + return matchBytes, nil +} + +func (tuple *FiveTuple) GetMask() ([]byte, error) { + var mask UDPv4Header + + if tuple.Protocol != IPProto(0) { + mask.IP.Protocol = 0xff + } + if !tuple.SrcAddr.IsUnspecified() && tuple.SrcAddr.IsValid() { + mask.IP.Saddr = [4]byte{0xff, 0xff, 0xff, 0xff} + } + if tuple.SrcPort != 0 { + mask.UDP.Sport = 0xffff + } + if !tuple.DstAddr.IsUnspecified() && tuple.DstAddr.IsValid() { + mask.IP.Daddr = [4]byte{0xff, 0xff, 0xff, 0xff} + } + if tuple.DstPort != 0 { + mask.UDP.Dport = 0xffff + } + maskBytes, err := mask.Bytes() + if err != nil { + return nil, err + } + return maskBytes, nil +} + +func (tuple *FiveTuple) GetBPF() string { + expressions := make([]string, 0, 4) + if !tuple.SrcAddr.IsUnspecified() && tuple.SrcAddr.IsValid() { + expressions = append(expressions, fmt.Sprintf("src host %s", tuple.SrcAddr)) + } + if !tuple.DstAddr.IsUnspecified() && tuple.DstAddr.IsValid() { + expressions = append(expressions, fmt.Sprintf("dst host %s", tuple.DstAddr)) + } + if tuple.SrcPort != 0 { + expressions = append(expressions, fmt.Sprintf("src port %d", tuple.SrcPort)) + } + if tuple.DstPort != 0 { + expressions = append(expressions, fmt.Sprintf("dst port %d", tuple.DstPort)) + } + return strings.Join(expressions, " and ") +} + +func NewGeneveHeader(outerFiveTuple FiveTuple, vni uint32) GeneveV4Header { + return GeneveV4Header{ + UDPv4Header{ + IP: IPv4Header{Protocol: uint8(UDP), Saddr: outerFiveTuple.SrcAddr.As4(), Daddr: outerFiveTuple.DstAddr.As4()}, + UDP: UDPHeader{Sport: outerFiveTuple.SrcPort, Dport: outerFiveTuple.DstPort}, + }, + GeneveHeader{ + Vni: vni << 8, + }, + } +} + +func (gnv *GeneveV4Header) GetMatch() ([]byte, error) { + matchBytes, err := gnv.Bytes() + if err != nil { + return nil, err + } + return matchBytes, nil +} + +func (gnv *GeneveV4Header) GetMask() ([]byte, error) { + var mask GeneveV4Header + srcIP := netip.AddrFrom4(gnv.IP.Saddr) + dstIP := netip.AddrFrom4(gnv.IP.Daddr) + + if gnv.IP.Protocol != 0 { + mask.IP.Protocol = 0xff + } + if !srcIP.IsUnspecified() && srcIP.IsValid() { + mask.IP.Saddr = [4]byte{0xff, 0xff, 0xff, 0xff} + } + if gnv.UDP.Sport != 0 { + mask.UDP.Sport = 0xffff + } + if !dstIP.IsUnspecified() && dstIP.IsValid() { + mask.IP.Daddr = [4]byte{0xff, 0xff, 0xff, 0xff} + } + if gnv.UDP.Dport != 0 { + mask.UDP.Dport = 0xffff + } + // if vni != INVALID_ID<<8 + if gnv.Vni != 0xffffff00 { + mask.Vni = 0xffffff00 + } + maskBytes, err := mask.Bytes() + if err != nil { + return nil, err + } + return maskBytes, nil +} + +func init() { + var err error + FiveTupleMask, err = (UDPv4Header{ + IP: IPv4Header{ + Protocol: 0xff, + Saddr: [4]byte{0xff, 0xff, 0xff, 0xff}, + Daddr: [4]byte{0xff, 0xff, 0xff, 0xff}, + }, + UDP: UDPHeader{ + Sport: 0xffff, + Dport: 0xffff, + }, + }).Bytes() + if err != nil { + panic(err) + } + + DstFourTupleMask, err = (UDPv4Header{ + IP: IPv4Header{ + Protocol: 0xff, + Saddr: [4]byte{0xff, 0xff, 0xff, 0xff}, + Daddr: [4]byte{0xff, 0xff, 0xff, 0xff}, + }, + UDP: UDPHeader{ + Dport: 0xffff, + }, + }).Bytes() + if err != nil { + panic(err) + } + + DstThreeTupleMask, err = (UDPv4Header{ + IP: IPv4Header{Protocol: 0xff, Daddr: [4]byte{0xff, 0xff, 0xff, 0xff}}, + UDP: UDPHeader{Dport: 0xffff}, + }).Bytes() + if err != nil { + panic(err) + } + + SrcThreeTupleMask, err = (UDPv4Header{ + IP: IPv4Header{Protocol: 0xff, Saddr: [4]byte{0xff, 0xff, 0xff, 0xff}}, + UDP: UDPHeader{Sport: 0xffff}, + }).Bytes() + if err != nil { + panic(err) + } + + DstAddrMask, err = (UDPv4Header{ + IP: IPv4Header{Daddr: [4]byte{0xff, 0xff, 0xff, 0xff}}, + }).Bytes() + if err != nil { + panic(err) + } + + SrcAddrMask, err = (UDPv4Header{ + IP: IPv4Header{Saddr: [4]byte{0xff, 0xff, 0xff, 0xff}}, + }).Bytes() + if err != nil { + panic(err) + } +} + +type ClassifyAction int + +const ( + AddAbsolute ClassifyAction = iota + AddRelative + Del + DelChain +) + +const ( + VectorSize = 16 +) + +type ClassifyTable struct { + TableIndex uint32 + NBuckets uint32 + MaxNumEntries uint32 + MatchNVectors uint32 + SkipNVectors uint32 + NextTableIndex uint32 + MissNextIndex uint32 + Mask []byte + MemorySize uint32 + CurrentDataOffset int16 +} diff --git a/vpplink/types/ip_types.go b/vpplink/types/ip_types.go index 75134026e..20610dd8d 100644 --- a/vpplink/types/ip_types.go +++ b/vpplink/types/ip_types.go @@ -37,6 +37,18 @@ const ( INVALID IPProto = IPProto(ip_types.IP_API_PROTO_RESERVED) ) +func (mode *IPProto) UnmarshalText(text []byte) error { + switch string(text) { + case "tcp": + *mode = TCP + case "udp": + *mode = UDP + default: + *mode = TCP + } + return nil +} + type IPFlowHash uint8 const ( diff --git a/vpplink/types/neigh.go b/vpplink/types/neigh.go index 17e066bc1..1b16eaf73 100644 --- a/vpplink/types/neigh.go +++ b/vpplink/types/neigh.go @@ -16,6 +16,7 @@ package types import ( + "fmt" "net" "github.com/projectcalico/vpp-dataplane/v3/vpplink/generated/bindings/ip_neighbor" @@ -43,3 +44,18 @@ func ToVppNeighborFlags(flags IPNeighborFlags) ip_neighbor.IPNeighborFlags { func FromVppNeighborFlags(flags ip_neighbor.IPNeighborFlags) IPNeighborFlags { return IPNeighborFlags(flags) } + +type NeighborConfig struct { + MaxNumber uint32 + MaxAge uint32 + Recycle bool +} + +func (neighborConfig *NeighborConfig) String() string { + return fmt.Sprintf( + "max-number:%d max-age:%d recycle:%t", + neighborConfig.MaxNumber, + neighborConfig.MaxAge, + neighborConfig.Recycle, + ) +} diff --git a/vpplink/types/redirect.go b/vpplink/types/redirect.go new file mode 100644 index 000000000..787278206 --- /dev/null +++ b/vpplink/types/redirect.go @@ -0,0 +1,39 @@ +// Copyright (C) 2022 Cisco Systems Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +// implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package types + +import ( + "fmt" +) + +type SessionRedirect struct { + FiveTuple + TableIndex uint32 + IsPunt bool + OpaqueIndex uint32 +} + +func (sr *SessionRedirect) String() string { + return fmt.Sprintf("[tbl:%d %s]", sr.TableIndex, sr.FiveTuple.String()) +} + +func (sr *SessionRedirect) VppString() string { + match, err := sr.GetMatch() + if err != nil { + return "" + } + return fmt.Sprintf("%x", match) +} diff --git a/yaml/overlays/dev/kustomize.sh b/yaml/overlays/dev/kustomize.sh index 172187a31..57c1c2d80 100755 --- a/yaml/overlays/dev/kustomize.sh +++ b/yaml/overlays/dev/kustomize.sh @@ -112,7 +112,14 @@ function get_initial_config () echo "{ \"vppStartupSleepSeconds\": ${CALICOVPP_VPP_STARTUP_SLEEP:-0}, \"corePattern\": \"${CALICOVPP_CORE_PATTERN:-/var/lib/vpp/vppcore.%e.%p}\", - \"defaultGWs\": \"${CALICOVPP_DEFAULT_GW}\" + \"defaultGWs\": \"${CALICOVPP_DEFAULT_GW}\", + \"redirectToHostRules\": [ + { + \"proto\": \"${CALICOVPP_REDIRECT_PROTO:-udp}\", + \"port\": ${CALICOVPP_REDIRECT_PORT:-53}, + \"ip\": \"${CALICOVPP_REDIRECT_IP:-172.18.0.1}\" + } + ] }" }