From d1858c4c000a95e35803e6df91def86711c74a69 Mon Sep 17 00:00:00 2001 From: Nathan Skrzypczak Date: Thu, 24 Mar 2022 12:47:33 +0100 Subject: [PATCH 1/2] vpplink: adapt to new govpp Signed-off-by: Nathan Skrzypczak --- calico-vpp-agent/connectivity/ipip.go | 15 +- calico-vpp-agent/connectivity/ipsec.go | 10 +- go.mod | 3 + go.sum | 3 + vpplink/abf.go | 12 +- vpplink/acl.go | 12 +- vpplink/af_packet.go | 12 +- vpplink/af_xdp.go | 12 +- vpplink/arp.go | 8 +- vpplink/avf.go | 16 +- vpplink/binapi/generate_binapi.sh | 1 + vpplink/binapi/vppapi/abf/abf.ba.go | 30 ++ vpplink/binapi/vppapi/acl/acl.ba.go | 126 +++++++ .../binapi/vppapi/af_packet/af_packet.ba.go | 30 ++ vpplink/binapi/vppapi/af_xdp/af_xdp.ba.go | 18 + vpplink/binapi/vppapi/arp/arp.ba.go | 24 ++ vpplink/binapi/vppapi/avf/avf.ba.go | 12 + vpplink/binapi/vppapi/capo/capo.ba.go | 72 ++++ vpplink/binapi/vppapi/cnat/cnat.ba.go | 60 ++++ .../crypto_sw_scheduler.ba.go | 6 + .../ethernet_types/ethernet_types.ba.go | 4 + vpplink/binapi/vppapi/feature/feature.ba.go | 6 + vpplink/binapi/vppapi/generate.log | 4 +- vpplink/binapi/vppapi/gso/gso.ba.go | 6 + vpplink/binapi/vppapi/ikev2/ikev2.ba.go | 150 +++++++++ .../binapi/vppapi/interface/interface.ba.go | 204 ++++++++++++ vpplink/binapi/vppapi/ip/ip.ba.go | 273 +++++++++++++++ vpplink/binapi/vppapi/ip6_nd/ip6_nd.ba.go | 45 +++ .../vppapi/ip_neighbor/ip_neighbor.ba.go | 54 +++ vpplink/binapi/vppapi/ip_types/ip_types.ba.go | 31 +- vpplink/{ => binapi/vppapi}/ipip.go | 47 +-- vpplink/binapi/vppapi/ipip/ipip.ba.go | 30 ++ vpplink/binapi/vppapi/ipsec/ipsec.ba.go | 138 ++++++++ vpplink/binapi/vppapi/memclnt/memclnt.ba.go | 72 ++++ vpplink/binapi/vppapi/memif/memif.ba.go | 36 ++ vpplink/binapi/vppapi/nat44_ed/nat44_ed.ba.go | 312 ++++++++++++++++++ vpplink/binapi/vppapi/pbl/pbl.ba.go | 18 + vpplink/binapi/vppapi/punt/punt.ba.go | 30 ++ vpplink/binapi/vppapi/rdma/rdma.ba.go | 24 ++ vpplink/binapi/vppapi/session/session.ba.go | 84 +++++ vpplink/binapi/vppapi/sr/sr.ba.go | 66 ++++ vpplink/binapi/vppapi/tapv2/tapv2.ba.go | 24 ++ vpplink/binapi/vppapi/virtio/virtio.ba.go | 24 ++ vpplink/binapi/vppapi/vlib/vlib.ba.go | 54 +++ vpplink/binapi/vppapi/vmxnet3/vmxnet3.ba.go | 24 ++ vpplink/binapi/vppapi/vpe/vpe.ba.go | 18 + .../binapi/vppapi/vpe_types/vpe_types.ba.go | 4 + vpplink/binapi/vppapi/vpp.go | 122 +++++++ vpplink/binapi/vppapi/vxlan/vxlan.ba.go | 42 +++ .../binapi/vppapi/wireguard/wireguard.ba.go | 51 +++ vpplink/capo.go | 60 ++-- vpplink/cnat.go | 42 +-- vpplink/crypto_sw_scheduler.go | 6 +- vpplink/feature.go | 6 +- vpplink/ikev2.go | 78 ++--- vpplink/interfaces.go | 150 ++++----- vpplink/ip.go | 36 +- vpplink/ip6_nd.go | 14 +- vpplink/ipsec.go | 12 +- vpplink/memif.go | 24 +- vpplink/nat44.go | 40 +-- vpplink/pbl.go | 12 +- vpplink/rdma.go | 6 +- vpplink/routes.go | 32 +- vpplink/session.go | 18 +- vpplink/srv6.go | 60 ++-- vpplink/stats.go | 6 +- vpplink/types/ipip.go | 35 -- vpplink/virtio.go | 12 +- vpplink/vlib.go | 18 +- vpplink/vmxnet3.go | 6 +- vpplink/vpe.go | 6 +- vpplink/vpplink.go | 59 +--- vpplink/vxlan.go | 12 +- vpplink/wireguard.go | 36 +- 75 files changed, 2750 insertions(+), 515 deletions(-) rename vpplink/{ => binapi/vppapi}/ipip.go (58%) create mode 100644 vpplink/binapi/vppapi/vpp.go delete mode 100644 vpplink/types/ipip.go diff --git a/calico-vpp-agent/connectivity/ipip.go b/calico-vpp-agent/connectivity/ipip.go index 7f37667f..1ac6358f 100644 --- a/calico-vpp-agent/connectivity/ipip.go +++ b/calico-vpp-agent/connectivity/ipip.go @@ -20,6 +20,7 @@ import ( "github.com/pkg/errors" + vpptypes "git.fd.io/govpp.git/api/v0" "github.com/projectcalico/vpp-dataplane/calico-vpp-agent/common" "github.com/projectcalico/vpp-dataplane/calico-vpp-agent/config" "github.com/projectcalico/vpp-dataplane/vpplink" @@ -28,15 +29,15 @@ import ( type IpipProvider struct { *ConnectivityProviderData - ipipIfs map[string]*types.IPIPTunnel + ipipIfs map[string]*vpptypes.IPIPTunnel ipipRoutes map[uint32]map[string]bool } func NewIPIPProvider(d *ConnectivityProviderData) *IpipProvider { - return &IpipProvider{d, make(map[string]*types.IPIPTunnel), make(map[uint32]map[string]bool)} + return &IpipProvider{d, make(map[string]*vpptypes.IPIPTunnel), make(map[uint32]map[string]bool)} } -func (p *IpipProvider) EnableDisable(isEnable bool) () { +func (p *IpipProvider) EnableDisable(isEnable bool) { } func (p *IpipProvider) Enabled(cn *common.NodeConnectivity) bool { @@ -45,7 +46,7 @@ func (p *IpipProvider) Enabled(cn *common.NodeConnectivity) bool { func (p *IpipProvider) RescanState() { p.log.Infof("Rescanning existing tunnels") - p.ipipIfs = make(map[string]*types.IPIPTunnel) + p.ipipIfs = make(map[string]*vpptypes.IPIPTunnel) tunnels, err := p.vpp.ListIPIPTunnels() if err != nil { p.log.Errorf("Error listing ipip tunnels: %v", err) @@ -59,7 +60,7 @@ func (p *IpipProvider) RescanState() { } } - indexTunnel := make(map[uint32]*types.IPIPTunnel) + indexTunnel := make(map[uint32]*vpptypes.IPIPTunnel) for _, tunnel := range p.ipipIfs { indexTunnel[tunnel.SwIfIndex] = tunnel } @@ -83,7 +84,7 @@ func (p *IpipProvider) RescanState() { } } -func (p *IpipProvider) errorCleanup(tunnel *types.IPIPTunnel) { +func (p *IpipProvider) errorCleanup(tunnel *vpptypes.IPIPTunnel) { err := p.vpp.DelIPIPTunnel(tunnel) if err != nil { p.log.Errorf("Error deleting ipip tunnel %s after error: %v", tunnel.String(), err) @@ -94,7 +95,7 @@ func (p *IpipProvider) AddConnectivity(cn *common.NodeConnectivity) error { p.log.Debugf("connectivity(add) IPIP Tunnel to VPP") tunnel, found := p.ipipIfs[cn.NextHop.String()] if !found { - tunnel = &types.IPIPTunnel{ + tunnel = &vpptypes.IPIPTunnel{ Dst: cn.NextHop, } ip4, ip6 := p.server.GetNodeIPs() diff --git a/calico-vpp-agent/connectivity/ipsec.go b/calico-vpp-agent/connectivity/ipsec.go index 2f4ecde1..a246e9c2 100644 --- a/calico-vpp-agent/connectivity/ipsec.go +++ b/calico-vpp-agent/connectivity/ipsec.go @@ -22,6 +22,7 @@ import ( "strings" "time" + vpptypes "git.fd.io/govpp.git/api/v0" "github.com/pkg/errors" "github.com/projectcalico/vpp-dataplane/calico-vpp-agent/common" "github.com/projectcalico/vpp-dataplane/calico-vpp-agent/config" @@ -30,11 +31,11 @@ import ( ) type IpsecTunnel struct { - *types.IPIPTunnel + *vpptypes.IPIPTunnel cancel func() } -func NewIpsecTunnel(ipipTunnel *types.IPIPTunnel) *IpsecTunnel { +func NewIpsecTunnel(ipipTunnel *vpptypes.IPIPTunnel) *IpsecTunnel { return &IpsecTunnel{IPIPTunnel: ipipTunnel, cancel: func() {}} } @@ -143,7 +144,7 @@ func (p *IpsecProvider) getIPSECTunnelSpecs(nodeIP4, destNodeAddr *net.IP) (tunn if config.CrossIpsecTunnels { for i := 0; i < config.IpsecAddressCount; i++ { for j := 0; j < config.IpsecAddressCount; j++ { - tunnel := NewIpsecTunnel(&types.IPIPTunnel{}) + tunnel := NewIpsecTunnel(&vpptypes.IPIPTunnel{}) tunnel.Src = net.IP(append([]byte(nil), nodeIP4.To4()...)) tunnel.Src[2] += byte(i) tunnel.Dst = net.IP(append([]byte(nil), destNodeAddr.To4()...)) @@ -153,7 +154,7 @@ func (p *IpsecProvider) getIPSECTunnelSpecs(nodeIP4, destNodeAddr *net.IP) (tunn } } else { for i := 0; i < config.IpsecAddressCount; i++ { - tunnel := NewIpsecTunnel(&types.IPIPTunnel{}) + tunnel := NewIpsecTunnel(&vpptypes.IPIPTunnel{}) tunnel.Src = net.IP(append([]byte(nil), nodeIP4.To4()...)) tunnel.Src[2] += byte(i) tunnel.Dst = net.IP(append([]byte(nil), destNodeAddr.To4()...)) @@ -295,7 +296,6 @@ func (p *IpsecProvider) waitForIPsecSA(tunnel IpsecTunnel) func() { p.log.Infof("connectivity(add) tunnel now up Profile=%s", tunnel.Profile()) return } - if tunnel.IsInitiator() { p.log.Warnf("IPIP tunnel still down, re-trying initiate IKE for IPsec tunnel=%s", tunnel.String()) err = p.vpp.IKEv2Initiate(tunnel.Profile()) diff --git a/go.mod b/go.mod index 8479a195..535a8169 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( github.com/containernetworking/plugins v0.8.5 github.com/gogo/protobuf v1.3.2 github.com/golang/protobuf v1.5.2 + github.com/hashicorp/go-version v1.4.0 // indirect github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40 github.com/orijtech/prometheus-go-metrics-exporter v0.0.6 github.com/osrg/gobgp v0.0.0-20210801043420-9e48a36ed97c @@ -31,6 +32,8 @@ require ( ) replace ( + git.fd.io/govpp.git v0.3.6-0.20210927044411-385ccc0d8ba9 => /Users/nskrzypc/wrk/calico/govpp + github.com/projectcalico/api => github.com/projectcalico/api v0.0.0-20220129171738-695e97a25204 // v3.22.0 google.golang.org/grpc => google.golang.org/grpc v1.29.1 diff --git a/go.sum b/go.sum index 21c6c564..1552e8e9 100644 --- a/go.sum +++ b/go.sum @@ -448,6 +448,9 @@ github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerX github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.4.0 h1:aAQzgqIrRKRa7w75CKpbBxYsmUoPjzVm1W59ca1L0J4= +github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= diff --git a/vpplink/abf.go b/vpplink/abf.go index 7aba7d5f..492b74fe 100644 --- a/vpplink/abf.go +++ b/vpplink/abf.go @@ -30,8 +30,8 @@ var ( ) func (v *VppLink) attachDetachAbfPolicy(policyID uint32, swIfIndex uint32, isv6 bool, isAdd bool) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &abf.AbfItfAttachAddDelReply{} request := &abf.AbfItfAttachAddDel{ @@ -42,7 +42,7 @@ func (v *VppLink) attachDetachAbfPolicy(policyID uint32, swIfIndex uint32, isv6 IsIPv6: isv6, }, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) opStr := "Detach" if isAdd { opStr = "Attach" @@ -64,8 +64,8 @@ func (v *VppLink) DetachAbfPolicy(policyID uint32, swIfIndex uint32, isv6 bool) } func (v *VppLink) addDelAbfPolicy(policy *types.AbfPolicy, isAdd bool) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() paths := make([]fib_types.FibPath, 0, len(policy.Paths)) for _, routePath := range policy.Paths { @@ -81,7 +81,7 @@ func (v *VppLink) addDelAbfPolicy(policy *types.AbfPolicy, isAdd bool) (err erro Paths: paths, }, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) opStr := "Del" if isAdd { opStr = "Add" diff --git a/vpplink/acl.go b/vpplink/acl.go index 006539c0..e990b18d 100644 --- a/vpplink/acl.go +++ b/vpplink/acl.go @@ -25,8 +25,8 @@ import ( ) func (v *VppLink) AddACL(acl *types.ACL) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() rules := make([]acl_types.ACLRule, 0, len(acl.Rules)) for _, aclRule := range acl.Rules { @@ -40,7 +40,7 @@ func (v *VppLink) AddACL(acl *types.ACL) (err error) { R: rules, Count: uint32(len(rules)), } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "Add ACL failed") } else if response.Retval != 0 { @@ -51,14 +51,14 @@ func (v *VppLink) AddACL(acl *types.ACL) (err error) { } func (v *VppLink) DelACL(aclIndex uint32) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &vppacl.ACLDelReply{} request := &vppacl.ACLDel{ ACLIndex: aclIndex, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "Del ACL failed") } else if response.Retval != 0 { diff --git a/vpplink/af_packet.go b/vpplink/af_packet.go index 51512e6a..0d4f2c17 100644 --- a/vpplink/af_packet.go +++ b/vpplink/af_packet.go @@ -24,8 +24,8 @@ import ( ) func (v *VppLink) CreateAfPacket(intf *types.AfPacketInterface) (swIfIndex uint32, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &af_packet.AfPacketCreateV2Reply{} request := &af_packet.AfPacketCreateV2{ UseRandomHwAddr: true, @@ -38,7 +38,7 @@ func (v *VppLink) CreateAfPacket(intf *types.AfPacketInterface) (swIfIndex uint3 request.UseRandomHwAddr = false request.HwAddr = types.ToVppMacAddress(intf.HardwareAddr) } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return INVALID_SW_IF_INDEX, errors.Wrapf(err, "AfPacketCreate failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { @@ -49,13 +49,13 @@ func (v *VppLink) CreateAfPacket(intf *types.AfPacketInterface) (swIfIndex uint3 } func (v *VppLink) DeleteAfPacket(ifName string) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &af_packet.AfPacketDeleteReply{} request := &af_packet.AfPacketDelete{ HostIfName: ifName, } - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "AfPacketDelete failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { diff --git a/vpplink/af_xdp.go b/vpplink/af_xdp.go index 91033432..2d6fd853 100644 --- a/vpplink/af_xdp.go +++ b/vpplink/af_xdp.go @@ -25,8 +25,8 @@ import ( ) func (v *VppLink) CreateAfXDP(intf *types.VppXDPInterface) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &af_xdp.AfXdpCreateReply{} request := &af_xdp.AfXdpCreate{ HostIf: intf.HostInterfaceName, @@ -36,7 +36,7 @@ func (v *VppLink) CreateAfXDP(intf *types.VppXDPInterface) (err error) { TxqSize: uint16(DefaultIntTo(intf.TxQueueSize, 1024)), Mode: af_xdp.AF_XDP_API_MODE_AUTO, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "CreateAfXDP failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { @@ -47,13 +47,13 @@ func (v *VppLink) CreateAfXDP(intf *types.VppXDPInterface) (err error) { } func (v *VppLink) DeleteAfXDP(intf *types.VppXDPInterface) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &af_xdp.AfXdpDeleteReply{} request := &af_xdp.AfXdpDelete{ SwIfIndex: interface_types.InterfaceIndex(intf.SwIfIndex), } - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "DeleteAfXDP failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { diff --git a/vpplink/arp.go b/vpplink/arp.go index 7aa0b280..66c6af48 100644 --- a/vpplink/arp.go +++ b/vpplink/arp.go @@ -25,8 +25,8 @@ import ( ) func (v *VppLink) EnableArpProxy(swIfIndex, tableID uint32) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() // First enable global arp proxy //set arp proxy table-id 0 start 0.0.0.0 end 255.255.255.255 @@ -39,7 +39,7 @@ func (v *VppLink) EnableArpProxy(swIfIndex, tableID uint32) (err error) { Hi: ip_types.IP4Address{255, 255, 255, 255}, }, } - err = v.ch.SendRequest(request1).ReceiveReply(response1) + err = v.GetChannel().SendRequest(request1).ReceiveReply(response1) if err != nil { return errors.Wrapf(err, "Enabling proxyarp swif %d failed", swIfIndex) } else if response1.Retval != 0 { @@ -51,7 +51,7 @@ func (v *VppLink) EnableArpProxy(swIfIndex, tableID uint32) (err error) { Enable: true, SwIfIndex: interface_types.InterfaceIndex(swIfIndex), } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "Enabling proxyarp swif %d failed", swIfIndex) } else if response.Retval != 0 { diff --git a/vpplink/avf.go b/vpplink/avf.go index 4b243cef..c1a1903b 100644 --- a/vpplink/avf.go +++ b/vpplink/avf.go @@ -30,8 +30,8 @@ const ( ) func (v *VppLink) CreateAVF(intf *types.AVFInterface) (swIfIndex uint32, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() addr, err := types.GetPciIdInt(intf.PciId) if err != nil { return INVALID_SW_IF_INDEX, errors.Wrapf(err, "CreateAVF error parsing PCI id") @@ -43,9 +43,9 @@ func (v *VppLink) CreateAVF(intf *types.AVFInterface) (swIfIndex uint32, err err RxqSize: uint16(intf.RxQueueSize), TxqSize: uint16(intf.TxQueueSize), } - defer v.ch.SetReplyTimeout(DefaultReplyTimeout) - v.ch.SetReplyTimeout(AvfReplyTimeout) - err = v.ch.SendRequest(request).ReceiveReply(response) + defer v.GetChannel().SetReplyTimeout(DefaultReplyTimeout) + v.GetChannel().SetReplyTimeout(AvfReplyTimeout) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return INVALID_SW_IF_INDEX, errors.Wrapf(err, "CreateAVF failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { @@ -55,13 +55,13 @@ func (v *VppLink) CreateAVF(intf *types.AVFInterface) (swIfIndex uint32, err err } func (v *VppLink) DeleteAVF(swIfIndex uint32) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &avf.AvfDeleteReply{} request := &avf.AvfDelete{ SwIfIndex: interface_types.InterfaceIndex(swIfIndex), } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "DeleteAVF failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { diff --git a/vpplink/binapi/generate_binapi.sh b/vpplink/binapi/generate_binapi.sh index fdba81c2..c7e096e7 100755 --- a/vpplink/binapi/generate_binapi.sh +++ b/vpplink/binapi/generate_binapi.sh @@ -64,6 +64,7 @@ function generate_govpp_apis () --import-prefix=$VPP_API_IMPORT_PREFIX \ --no-source-path-info \ --no-version-info \ + --with-wrappers \ ikev2 \ gso \ arp \ diff --git a/vpplink/binapi/vppapi/abf/abf.ba.go b/vpplink/binapi/vppapi/abf/abf.ba.go index 9c7de3e1..d8e42607 100644 --- a/vpplink/binapi/vppapi/abf/abf.ba.go +++ b/vpplink/binapi/vppapi/abf/abf.ba.go @@ -57,6 +57,9 @@ func (*AbfItfAttachAddDel) GetCrcString() string { return "25c8621b" } func (*AbfItfAttachAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AbfItfAttachAddDel) GetRetVal() error { + return nil +} func (m *AbfItfAttachAddDel) Size() (size int) { if m == nil { @@ -103,6 +106,9 @@ func (*AbfItfAttachAddDelReply) GetCrcString() string { return "e8d4e804" } func (*AbfItfAttachAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AbfItfAttachAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *AbfItfAttachAddDelReply) Size() (size int) { if m == nil { @@ -137,6 +143,9 @@ func (*AbfItfAttachDetails) GetCrcString() string { return "7819523e" } func (*AbfItfAttachDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AbfItfAttachDetails) GetRetVal() error { + return nil +} func (m *AbfItfAttachDetails) Size() (size int) { if m == nil { @@ -178,6 +187,9 @@ func (*AbfItfAttachDump) GetCrcString() string { return "51077d14" } func (*AbfItfAttachDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AbfItfAttachDump) GetRetVal() error { + return nil +} func (m *AbfItfAttachDump) Size() (size int) { if m == nil { @@ -206,6 +218,9 @@ func (*AbfPluginGetVersion) GetCrcString() string { return "51077d14" } func (*AbfPluginGetVersion) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AbfPluginGetVersion) GetRetVal() error { + return nil +} func (m *AbfPluginGetVersion) Size() (size int) { if m == nil { @@ -237,6 +252,9 @@ func (*AbfPluginGetVersionReply) GetCrcString() string { return "9b32cf86" } func (*AbfPluginGetVersionReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AbfPluginGetVersionReply) GetRetVal() error { + return nil +} func (m *AbfPluginGetVersionReply) Size() (size int) { if m == nil { @@ -275,6 +293,9 @@ func (*AbfPolicyAddDel) GetCrcString() string { return "c6131197" } func (*AbfPolicyAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AbfPolicyAddDel) GetRetVal() error { + return nil +} func (m *AbfPolicyAddDel) Size() (size int) { if m == nil { @@ -391,6 +412,9 @@ func (*AbfPolicyAddDelReply) GetCrcString() string { return "e8d4e804" } func (*AbfPolicyAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AbfPolicyAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *AbfPolicyAddDelReply) Size() (size int) { if m == nil { @@ -425,6 +449,9 @@ func (*AbfPolicyDetails) GetCrcString() string { return "b7487fa4" } func (*AbfPolicyDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AbfPolicyDetails) GetRetVal() error { + return nil +} func (m *AbfPolicyDetails) Size() (size int) { if m == nil { @@ -536,6 +563,9 @@ func (*AbfPolicyDump) GetCrcString() string { return "51077d14" } func (*AbfPolicyDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AbfPolicyDump) GetRetVal() error { + return nil +} func (m *AbfPolicyDump) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/acl/acl.ba.go b/vpplink/binapi/vppapi/acl/acl.ba.go index 39564dd5..189c143b 100644 --- a/vpplink/binapi/vppapi/acl/acl.ba.go +++ b/vpplink/binapi/vppapi/acl/acl.ba.go @@ -42,6 +42,9 @@ func (*ACLAddReplace) GetCrcString() string { return "ee5c2f18" } func (*ACLAddReplace) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ACLAddReplace) GetRetVal() error { + return nil +} func (m *ACLAddReplace) Size() (size int) { if m == nil { @@ -140,6 +143,9 @@ func (*ACLAddReplaceReply) GetCrcString() string { return "ac407b0c" } func (*ACLAddReplaceReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ACLAddReplaceReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *ACLAddReplaceReply) Size() (size int) { if m == nil { @@ -176,6 +182,9 @@ func (*ACLDel) GetCrcString() string { return "ef34fea4" } func (*ACLDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ACLDel) GetRetVal() error { + return nil +} func (m *ACLDel) Size() (size int) { if m == nil { @@ -209,6 +218,9 @@ func (*ACLDelReply) GetCrcString() string { return "e8d4e804" } func (*ACLDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ACLDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *ACLDelReply) Size() (size int) { if m == nil { @@ -245,6 +257,9 @@ func (*ACLDetails) GetCrcString() string { return "95babae0" } func (*ACLDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ACLDetails) GetRetVal() error { + return nil +} func (m *ACLDetails) Size() (size int) { if m == nil { @@ -342,6 +357,9 @@ func (*ACLDump) GetCrcString() string { return "ef34fea4" } func (*ACLDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ACLDump) GetRetVal() error { + return nil +} func (m *ACLDump) Size() (size int) { if m == nil { @@ -378,6 +396,9 @@ func (*ACLInterfaceAddDel) GetCrcString() string { return "4b54bebd" } func (*ACLInterfaceAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ACLInterfaceAddDel) GetRetVal() error { + return nil +} func (m *ACLInterfaceAddDel) Size() (size int) { if m == nil { @@ -420,6 +441,9 @@ func (*ACLInterfaceAddDelReply) GetCrcString() string { return "e8d4e804" } func (*ACLInterfaceAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ACLInterfaceAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *ACLInterfaceAddDelReply) Size() (size int) { if m == nil { @@ -458,6 +482,9 @@ func (*ACLInterfaceEtypeWhitelistDetails) GetCrcString() string { return "cc2bfd func (*ACLInterfaceEtypeWhitelistDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ACLInterfaceEtypeWhitelistDetails) GetRetVal() error { + return nil +} func (m *ACLInterfaceEtypeWhitelistDetails) Size() (size int) { if m == nil { @@ -511,6 +538,9 @@ func (*ACLInterfaceEtypeWhitelistDump) GetCrcString() string { return "f9e6675e" func (*ACLInterfaceEtypeWhitelistDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ACLInterfaceEtypeWhitelistDump) GetRetVal() error { + return nil +} func (m *ACLInterfaceEtypeWhitelistDump) Size() (size int) { if m == nil { @@ -547,6 +577,9 @@ func (*ACLInterfaceListDetails) GetCrcString() string { return "e695d256" } func (*ACLInterfaceListDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ACLInterfaceListDetails) GetRetVal() error { + return nil +} func (m *ACLInterfaceListDetails) Size() (size int) { if m == nil { @@ -598,6 +631,9 @@ func (*ACLInterfaceListDump) GetCrcString() string { return "f9e6675e" } func (*ACLInterfaceListDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ACLInterfaceListDump) GetRetVal() error { + return nil +} func (m *ACLInterfaceListDump) Size() (size int) { if m == nil { @@ -634,6 +670,9 @@ func (*ACLInterfaceSetACLList) GetCrcString() string { return "473982bd" } func (*ACLInterfaceSetACLList) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ACLInterfaceSetACLList) GetRetVal() error { + return nil +} func (m *ACLInterfaceSetACLList) Size() (size int) { if m == nil { @@ -687,6 +726,9 @@ func (*ACLInterfaceSetACLListReply) GetCrcString() string { return "e8d4e804" } func (*ACLInterfaceSetACLListReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ACLInterfaceSetACLListReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *ACLInterfaceSetACLListReply) Size() (size int) { if m == nil { @@ -725,6 +767,9 @@ func (*ACLInterfaceSetEtypeWhitelist) GetCrcString() string { return "3f5c2d2d" func (*ACLInterfaceSetEtypeWhitelist) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ACLInterfaceSetEtypeWhitelist) GetRetVal() error { + return nil +} func (m *ACLInterfaceSetEtypeWhitelist) Size() (size int) { if m == nil { @@ -778,6 +823,9 @@ func (*ACLInterfaceSetEtypeWhitelistReply) GetCrcString() string { return "e8d4e func (*ACLInterfaceSetEtypeWhitelistReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ACLInterfaceSetEtypeWhitelistReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *ACLInterfaceSetEtypeWhitelistReply) Size() (size int) { if m == nil { @@ -809,6 +857,9 @@ func (*ACLPluginControlPing) GetCrcString() string { return "51077d14" } func (*ACLPluginControlPing) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ACLPluginControlPing) GetRetVal() error { + return nil +} func (m *ACLPluginControlPing) Size() (size int) { if m == nil { @@ -840,6 +891,9 @@ func (*ACLPluginControlPingReply) GetCrcString() string { return "f6b0b8ca" } func (*ACLPluginControlPingReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ACLPluginControlPingReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *ACLPluginControlPingReply) Size() (size int) { if m == nil { @@ -879,6 +933,9 @@ func (*ACLPluginGetConnTableMaxEntries) GetCrcString() string { return "51077d14 func (*ACLPluginGetConnTableMaxEntries) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ACLPluginGetConnTableMaxEntries) GetRetVal() error { + return nil +} func (m *ACLPluginGetConnTableMaxEntries) Size() (size int) { if m == nil { @@ -910,6 +967,9 @@ func (*ACLPluginGetConnTableMaxEntriesReply) GetCrcString() string { return "7a0 func (*ACLPluginGetConnTableMaxEntriesReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ACLPluginGetConnTableMaxEntriesReply) GetRetVal() error { + return nil +} func (m *ACLPluginGetConnTableMaxEntriesReply) Size() (size int) { if m == nil { @@ -941,6 +1001,9 @@ func (*ACLPluginGetVersion) GetCrcString() string { return "51077d14" } func (*ACLPluginGetVersion) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ACLPluginGetVersion) GetRetVal() error { + return nil +} func (m *ACLPluginGetVersion) Size() (size int) { if m == nil { @@ -971,6 +1034,9 @@ func (*ACLPluginGetVersionReply) GetCrcString() string { return "9b32cf86" } func (*ACLPluginGetVersionReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ACLPluginGetVersionReply) GetRetVal() error { + return nil +} func (m *ACLPluginGetVersionReply) Size() (size int) { if m == nil { @@ -1006,6 +1072,9 @@ func (*ACLPluginUseHashLookupGet) GetCrcString() string { return "51077d14" } func (*ACLPluginUseHashLookupGet) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ACLPluginUseHashLookupGet) GetRetVal() error { + return nil +} func (m *ACLPluginUseHashLookupGet) Size() (size int) { if m == nil { @@ -1038,6 +1107,9 @@ func (*ACLPluginUseHashLookupGetReply) GetCrcString() string { return "5392ad31" func (*ACLPluginUseHashLookupGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ACLPluginUseHashLookupGetReply) GetRetVal() error { + return nil +} func (m *ACLPluginUseHashLookupGetReply) Size() (size int) { if m == nil { @@ -1072,6 +1144,9 @@ func (*ACLPluginUseHashLookupSet) GetCrcString() string { return "b3e225d2" } func (*ACLPluginUseHashLookupSet) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ACLPluginUseHashLookupSet) GetRetVal() error { + return nil +} func (m *ACLPluginUseHashLookupSet) Size() (size int) { if m == nil { @@ -1108,6 +1183,9 @@ func (*ACLPluginUseHashLookupSetReply) GetCrcString() string { return "e8d4e804" func (*ACLPluginUseHashLookupSetReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ACLPluginUseHashLookupSetReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *ACLPluginUseHashLookupSetReply) Size() (size int) { if m == nil { @@ -1141,6 +1219,9 @@ func (*ACLStatsIntfCountersEnable) GetCrcString() string { return "b3e225d2" } func (*ACLStatsIntfCountersEnable) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ACLStatsIntfCountersEnable) GetRetVal() error { + return nil +} func (m *ACLStatsIntfCountersEnable) Size() (size int) { if m == nil { @@ -1176,6 +1257,9 @@ func (*ACLStatsIntfCountersEnableReply) GetCrcString() string { return "e8d4e804 func (*ACLStatsIntfCountersEnableReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ACLStatsIntfCountersEnableReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *ACLStatsIntfCountersEnableReply) Size() (size int) { if m == nil { @@ -1211,6 +1295,9 @@ func (*MacipACLAdd) GetCrcString() string { return "ce6fbad0" } func (*MacipACLAdd) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *MacipACLAdd) GetRetVal() error { + return nil +} func (m *MacipACLAdd) Size() (size int) { if m == nil { @@ -1284,6 +1371,9 @@ func (*MacipACLAddReplace) GetCrcString() string { return "2a461dd4" } func (*MacipACLAddReplace) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *MacipACLAddReplace) GetRetVal() error { + return nil +} func (m *MacipACLAddReplace) Size() (size int) { if m == nil { @@ -1358,6 +1448,9 @@ func (*MacipACLAddReplaceReply) GetCrcString() string { return "ac407b0c" } func (*MacipACLAddReplaceReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *MacipACLAddReplaceReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *MacipACLAddReplaceReply) Size() (size int) { if m == nil { @@ -1395,6 +1488,9 @@ func (*MacipACLAddReply) GetCrcString() string { return "ac407b0c" } func (*MacipACLAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *MacipACLAddReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *MacipACLAddReply) Size() (size int) { if m == nil { @@ -1431,6 +1527,9 @@ func (*MacipACLDel) GetCrcString() string { return "ef34fea4" } func (*MacipACLDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *MacipACLDel) GetRetVal() error { + return nil +} func (m *MacipACLDel) Size() (size int) { if m == nil { @@ -1464,6 +1563,9 @@ func (*MacipACLDelReply) GetCrcString() string { return "e8d4e804" } func (*MacipACLDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *MacipACLDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *MacipACLDelReply) Size() (size int) { if m == nil { @@ -1500,6 +1602,9 @@ func (*MacipACLDetails) GetCrcString() string { return "27135b59" } func (*MacipACLDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *MacipACLDetails) GetRetVal() error { + return nil +} func (m *MacipACLDetails) Size() (size int) { if m == nil { @@ -1573,6 +1678,9 @@ func (*MacipACLDump) GetCrcString() string { return "ef34fea4" } func (*MacipACLDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *MacipACLDump) GetRetVal() error { + return nil +} func (m *MacipACLDump) Size() (size int) { if m == nil { @@ -1608,6 +1716,9 @@ func (*MacipACLInterfaceAddDel) GetCrcString() string { return "4b8690b1" } func (*MacipACLInterfaceAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *MacipACLInterfaceAddDel) GetRetVal() error { + return nil +} func (m *MacipACLInterfaceAddDel) Size() (size int) { if m == nil { @@ -1649,6 +1760,9 @@ func (*MacipACLInterfaceAddDelReply) GetCrcString() string { return "e8d4e804" } func (*MacipACLInterfaceAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *MacipACLInterfaceAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *MacipACLInterfaceAddDelReply) Size() (size int) { if m == nil { @@ -1680,6 +1794,9 @@ func (*MacipACLInterfaceGet) GetCrcString() string { return "51077d14" } func (*MacipACLInterfaceGet) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *MacipACLInterfaceGet) GetRetVal() error { + return nil +} func (m *MacipACLInterfaceGet) Size() (size int) { if m == nil { @@ -1710,6 +1827,9 @@ func (*MacipACLInterfaceGetReply) GetCrcString() string { return "accf9b05" } func (*MacipACLInterfaceGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *MacipACLInterfaceGetReply) GetRetVal() error { + return nil +} func (m *MacipACLInterfaceGetReply) Size() (size int) { if m == nil { @@ -1759,6 +1879,9 @@ func (*MacipACLInterfaceListDetails) GetCrcString() string { return "a0c5d56d" } func (*MacipACLInterfaceListDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *MacipACLInterfaceListDetails) GetRetVal() error { + return nil +} func (m *MacipACLInterfaceListDetails) Size() (size int) { if m == nil { @@ -1807,6 +1930,9 @@ func (*MacipACLInterfaceListDump) GetCrcString() string { return "f9e6675e" } func (*MacipACLInterfaceListDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *MacipACLInterfaceListDump) GetRetVal() error { + return nil +} func (m *MacipACLInterfaceListDump) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/af_packet/af_packet.ba.go b/vpplink/binapi/vppapi/af_packet/af_packet.ba.go index 08b923b8..013c8825 100644 --- a/vpplink/binapi/vppapi/af_packet/af_packet.ba.go +++ b/vpplink/binapi/vppapi/af_packet/af_packet.ba.go @@ -39,6 +39,9 @@ func (*AfPacketCreate) GetCrcString() string { return "a190415f" } func (*AfPacketCreate) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AfPacketCreate) GetRetVal() error { + return nil +} func (m *AfPacketCreate) Size() (size int) { if m == nil { @@ -79,6 +82,9 @@ func (*AfPacketCreateReply) GetCrcString() string { return "5383d31f" } func (*AfPacketCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AfPacketCreateReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *AfPacketCreateReply) Size() (size int) { if m == nil { @@ -123,6 +129,9 @@ func (*AfPacketCreateV2) GetCrcString() string { return "4aff0436" } func (*AfPacketCreateV2) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AfPacketCreateV2) GetRetVal() error { + return nil +} func (m *AfPacketCreateV2) Size() (size int) { if m == nil { @@ -181,6 +190,9 @@ func (*AfPacketCreateV2Reply) GetCrcString() string { return "5383d31f" } func (*AfPacketCreateV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AfPacketCreateV2Reply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *AfPacketCreateV2Reply) Size() (size int) { if m == nil { @@ -217,6 +229,9 @@ func (*AfPacketDelete) GetCrcString() string { return "863fa648" } func (*AfPacketDelete) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AfPacketDelete) GetRetVal() error { + return nil +} func (m *AfPacketDelete) Size() (size int) { if m == nil { @@ -250,6 +265,9 @@ func (*AfPacketDeleteReply) GetCrcString() string { return "e8d4e804" } func (*AfPacketDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AfPacketDeleteReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *AfPacketDeleteReply) Size() (size int) { if m == nil { @@ -284,6 +302,9 @@ func (*AfPacketDetails) GetCrcString() string { return "58c7c042" } func (*AfPacketDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AfPacketDetails) GetRetVal() error { + return nil +} func (m *AfPacketDetails) Size() (size int) { if m == nil { @@ -318,6 +339,9 @@ func (*AfPacketDump) GetCrcString() string { return "51077d14" } func (*AfPacketDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AfPacketDump) GetRetVal() error { + return nil +} func (m *AfPacketDump) Size() (size int) { if m == nil { @@ -348,6 +372,9 @@ func (*AfPacketSetL4CksumOffload) GetCrcString() string { return "319cd5c8" } func (*AfPacketSetL4CksumOffload) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AfPacketSetL4CksumOffload) GetRetVal() error { + return nil +} func (m *AfPacketSetL4CksumOffload) Size() (size int) { if m == nil { @@ -386,6 +413,9 @@ func (*AfPacketSetL4CksumOffloadReply) GetCrcString() string { return "e8d4e804" func (*AfPacketSetL4CksumOffloadReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AfPacketSetL4CksumOffloadReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *AfPacketSetL4CksumOffloadReply) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/af_xdp/af_xdp.ba.go b/vpplink/binapi/vppapi/af_xdp/af_xdp.ba.go index 206dc933..d394cae3 100644 --- a/vpplink/binapi/vppapi/af_xdp/af_xdp.ba.go +++ b/vpplink/binapi/vppapi/af_xdp/af_xdp.ba.go @@ -119,6 +119,9 @@ func (*AfXdpCreate) GetCrcString() string { return "21226c99" } func (*AfXdpCreate) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AfXdpCreate) GetRetVal() error { + return nil +} func (m *AfXdpCreate) Size() (size int) { if m == nil { @@ -174,6 +177,9 @@ func (*AfXdpCreateReply) GetCrcString() string { return "5383d31f" } func (*AfXdpCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AfXdpCreateReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *AfXdpCreateReply) Size() (size int) { if m == nil { @@ -218,6 +224,9 @@ func (*AfXdpCreateV2) GetCrcString() string { return "e17ec2eb" } func (*AfXdpCreateV2) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AfXdpCreateV2) GetRetVal() error { + return nil +} func (m *AfXdpCreateV2) Size() (size int) { if m == nil { @@ -276,6 +285,9 @@ func (*AfXdpCreateV2Reply) GetCrcString() string { return "5383d31f" } func (*AfXdpCreateV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AfXdpCreateV2Reply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *AfXdpCreateV2Reply) Size() (size int) { if m == nil { @@ -312,6 +324,9 @@ func (*AfXdpDelete) GetCrcString() string { return "f9e6675e" } func (*AfXdpDelete) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AfXdpDelete) GetRetVal() error { + return nil +} func (m *AfXdpDelete) Size() (size int) { if m == nil { @@ -345,6 +360,9 @@ func (*AfXdpDeleteReply) GetCrcString() string { return "e8d4e804" } func (*AfXdpDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AfXdpDeleteReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *AfXdpDeleteReply) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/arp/arp.ba.go b/vpplink/binapi/vppapi/arp/arp.ba.go index 2d5e6e2b..4054b81e 100644 --- a/vpplink/binapi/vppapi/arp/arp.ba.go +++ b/vpplink/binapi/vppapi/arp/arp.ba.go @@ -47,6 +47,9 @@ func (*ProxyArpAddDel) GetCrcString() string { return "1823c3e7" } func (*ProxyArpAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ProxyArpAddDel) GetRetVal() error { + return nil +} func (m *ProxyArpAddDel) Size() (size int) { if m == nil { @@ -89,6 +92,9 @@ func (*ProxyArpAddDelReply) GetCrcString() string { return "e8d4e804" } func (*ProxyArpAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ProxyArpAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *ProxyArpAddDelReply) Size() (size int) { if m == nil { @@ -122,6 +128,9 @@ func (*ProxyArpDetails) GetCrcString() string { return "5b948673" } func (*ProxyArpDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ProxyArpDetails) GetRetVal() error { + return nil +} func (m *ProxyArpDetails) Size() (size int) { if m == nil { @@ -159,6 +168,9 @@ func (*ProxyArpDump) GetCrcString() string { return "51077d14" } func (*ProxyArpDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ProxyArpDump) GetRetVal() error { + return nil +} func (m *ProxyArpDump) Size() (size int) { if m == nil { @@ -188,6 +200,9 @@ func (*ProxyArpIntfcDetails) GetCrcString() string { return "f6458e5f" } func (*ProxyArpIntfcDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ProxyArpIntfcDetails) GetRetVal() error { + return nil +} func (m *ProxyArpIntfcDetails) Size() (size int) { if m == nil { @@ -219,6 +234,9 @@ func (*ProxyArpIntfcDump) GetCrcString() string { return "51077d14" } func (*ProxyArpIntfcDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ProxyArpIntfcDump) GetRetVal() error { + return nil +} func (m *ProxyArpIntfcDump) Size() (size int) { if m == nil { @@ -249,6 +267,9 @@ func (*ProxyArpIntfcEnableDisable) GetCrcString() string { return "ae6cfcfb" } func (*ProxyArpIntfcEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ProxyArpIntfcEnableDisable) GetRetVal() error { + return nil +} func (m *ProxyArpIntfcEnableDisable) Size() (size int) { if m == nil { @@ -287,6 +308,9 @@ func (*ProxyArpIntfcEnableDisableReply) GetCrcString() string { return "e8d4e804 func (*ProxyArpIntfcEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ProxyArpIntfcEnableDisableReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *ProxyArpIntfcEnableDisableReply) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/avf/avf.ba.go b/vpplink/binapi/vppapi/avf/avf.ba.go index e6991463..6cd79cf3 100644 --- a/vpplink/binapi/vppapi/avf/avf.ba.go +++ b/vpplink/binapi/vppapi/avf/avf.ba.go @@ -40,6 +40,9 @@ func (*AvfCreate) GetCrcString() string { return "daab8ae2" } func (*AvfCreate) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AvfCreate) GetRetVal() error { + return nil +} func (m *AvfCreate) Size() (size int) { if m == nil { @@ -86,6 +89,9 @@ func (*AvfCreateReply) GetCrcString() string { return "5383d31f" } func (*AvfCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AvfCreateReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *AvfCreateReply) Size() (size int) { if m == nil { @@ -122,6 +128,9 @@ func (*AvfDelete) GetCrcString() string { return "f9e6675e" } func (*AvfDelete) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AvfDelete) GetRetVal() error { + return nil +} func (m *AvfDelete) Size() (size int) { if m == nil { @@ -155,6 +164,9 @@ func (*AvfDeleteReply) GetCrcString() string { return "e8d4e804" } func (*AvfDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AvfDeleteReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *AvfDeleteReply) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/capo/capo.ba.go b/vpplink/binapi/vppapi/capo/capo.ba.go index 6e6d1d50..d64dea9e 100644 --- a/vpplink/binapi/vppapi/capo/capo.ba.go +++ b/vpplink/binapi/vppapi/capo/capo.ba.go @@ -349,6 +349,9 @@ func (*CapoConfigurePolicies) GetCrcString() string { return "3ca1772c" } func (*CapoConfigurePolicies) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CapoConfigurePolicies) GetRetVal() error { + return nil +} func (m *CapoConfigurePolicies) Size() (size int) { if m == nil { @@ -404,6 +407,9 @@ func (*CapoConfigurePoliciesReply) GetCrcString() string { return "e8d4e804" } func (*CapoConfigurePoliciesReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CapoConfigurePoliciesReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CapoConfigurePoliciesReply) Size() (size int) { if m == nil { @@ -436,6 +442,9 @@ func (*CapoControlPing) GetCrcString() string { return "51077d14" } func (*CapoControlPing) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CapoControlPing) GetRetVal() error { + return nil +} func (m *CapoControlPing) Size() (size int) { if m == nil { @@ -468,6 +477,9 @@ func (*CapoControlPingReply) GetCrcString() string { return "f6b0b8ca" } func (*CapoControlPingReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CapoControlPingReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CapoControlPingReply) Size() (size int) { if m == nil { @@ -506,6 +518,9 @@ func (*CapoGetVersion) GetCrcString() string { return "51077d14" } func (*CapoGetVersion) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CapoGetVersion) GetRetVal() error { + return nil +} func (m *CapoGetVersion) Size() (size int) { if m == nil { @@ -537,6 +552,9 @@ func (*CapoGetVersionReply) GetCrcString() string { return "9b32cf86" } func (*CapoGetVersionReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CapoGetVersionReply) GetRetVal() error { + return nil +} func (m *CapoGetVersionReply) Size() (size int) { if m == nil { @@ -577,6 +595,9 @@ func (*CapoIpsetAddDelMembers) GetCrcString() string { return "e7056d10" } func (*CapoIpsetAddDelMembers) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CapoIpsetAddDelMembers) GetRetVal() error { + return nil +} func (m *CapoIpsetAddDelMembers) Size() (size int) { if m == nil { @@ -638,6 +659,9 @@ func (*CapoIpsetAddDelMembersReply) GetCrcString() string { return "e8d4e804" } func (*CapoIpsetAddDelMembersReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CapoIpsetAddDelMembersReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CapoIpsetAddDelMembersReply) Size() (size int) { if m == nil { @@ -672,6 +696,9 @@ func (*CapoIpsetCreate) GetCrcString() string { return "69150c8a" } func (*CapoIpsetCreate) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CapoIpsetCreate) GetRetVal() error { + return nil +} func (m *CapoIpsetCreate) Size() (size int) { if m == nil { @@ -707,6 +734,9 @@ func (*CapoIpsetCreateReply) GetCrcString() string { return "6a43f193" } func (*CapoIpsetCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CapoIpsetCreateReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CapoIpsetCreateReply) Size() (size int) { if m == nil { @@ -744,6 +774,9 @@ func (*CapoIpsetDelete) GetCrcString() string { return "ceacdbcb" } func (*CapoIpsetDelete) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CapoIpsetDelete) GetRetVal() error { + return nil +} func (m *CapoIpsetDelete) Size() (size int) { if m == nil { @@ -778,6 +811,9 @@ func (*CapoIpsetDeleteReply) GetCrcString() string { return "e8d4e804" } func (*CapoIpsetDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CapoIpsetDeleteReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CapoIpsetDeleteReply) Size() (size int) { if m == nil { @@ -813,6 +849,9 @@ func (*CapoPolicyCreate) GetCrcString() string { return "f7ed31a8" } func (*CapoPolicyCreate) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CapoPolicyCreate) GetRetVal() error { + return nil +} func (m *CapoPolicyCreate) Size() (size int) { if m == nil { @@ -870,6 +909,9 @@ func (*CapoPolicyCreateReply) GetCrcString() string { return "90f27405" } func (*CapoPolicyCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CapoPolicyCreateReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CapoPolicyCreateReply) Size() (size int) { if m == nil { @@ -907,6 +949,9 @@ func (*CapoPolicyDelete) GetCrcString() string { return "ad833868" } func (*CapoPolicyDelete) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CapoPolicyDelete) GetRetVal() error { + return nil +} func (m *CapoPolicyDelete) Size() (size int) { if m == nil { @@ -941,6 +986,9 @@ func (*CapoPolicyDeleteReply) GetCrcString() string { return "e8d4e804" } func (*CapoPolicyDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CapoPolicyDeleteReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CapoPolicyDeleteReply) Size() (size int) { if m == nil { @@ -977,6 +1025,9 @@ func (*CapoPolicyUpdate) GetCrcString() string { return "e2097dd0" } func (*CapoPolicyUpdate) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CapoPolicyUpdate) GetRetVal() error { + return nil +} func (m *CapoPolicyUpdate) Size() (size int) { if m == nil { @@ -1036,6 +1087,9 @@ func (*CapoPolicyUpdateReply) GetCrcString() string { return "e8d4e804" } func (*CapoPolicyUpdateReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CapoPolicyUpdateReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CapoPolicyUpdateReply) Size() (size int) { if m == nil { @@ -1070,6 +1124,9 @@ func (*CapoRuleCreate) GetCrcString() string { return "0a2d5fd6" } func (*CapoRuleCreate) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CapoRuleCreate) GetRetVal() error { + return nil +} func (m *CapoRuleCreate) Size() (size int) { if m == nil { @@ -1154,6 +1211,9 @@ func (*CapoRuleCreateReply) GetCrcString() string { return "b48f8052" } func (*CapoRuleCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CapoRuleCreateReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CapoRuleCreateReply) Size() (size int) { if m == nil { @@ -1191,6 +1251,9 @@ func (*CapoRuleDelete) GetCrcString() string { return "d19bb6be" } func (*CapoRuleDelete) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CapoRuleDelete) GetRetVal() error { + return nil +} func (m *CapoRuleDelete) Size() (size int) { if m == nil { @@ -1225,6 +1288,9 @@ func (*CapoRuleDeleteReply) GetCrcString() string { return "e8d4e804" } func (*CapoRuleDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CapoRuleDeleteReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CapoRuleDeleteReply) Size() (size int) { if m == nil { @@ -1260,6 +1326,9 @@ func (*CapoRuleUpdate) GetCrcString() string { return "a0535ee2" } func (*CapoRuleUpdate) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CapoRuleUpdate) GetRetVal() error { + return nil +} func (m *CapoRuleUpdate) Size() (size int) { if m == nil { @@ -1346,6 +1415,9 @@ func (*CapoRuleUpdateReply) GetCrcString() string { return "e8d4e804" } func (*CapoRuleUpdateReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CapoRuleUpdateReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CapoRuleUpdateReply) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/cnat/cnat.ba.go b/vpplink/binapi/vppapi/cnat/cnat.ba.go index 08689329..a883bbb9 100644 --- a/vpplink/binapi/vppapi/cnat/cnat.ba.go +++ b/vpplink/binapi/vppapi/cnat/cnat.ba.go @@ -251,6 +251,9 @@ func (*CnatGetSnatAddresses) GetCrcString() string { return "51077d14" } func (*CnatGetSnatAddresses) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CnatGetSnatAddresses) GetRetVal() error { + return nil +} func (m *CnatGetSnatAddresses) Size() (size int) { if m == nil { @@ -285,6 +288,9 @@ func (*CnatGetSnatAddressesReply) GetCrcString() string { return "879513c1" } func (*CnatGetSnatAddressesReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CnatGetSnatAddressesReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CnatGetSnatAddressesReply) Size() (size int) { if m == nil { @@ -331,6 +337,9 @@ func (*CnatSessionDetails) GetCrcString() string { return "7e5017c7" } func (*CnatSessionDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CnatSessionDetails) GetRetVal() error { + return nil +} func (m *CnatSessionDetails) Size() (size int) { if m == nil { @@ -414,6 +423,9 @@ func (*CnatSessionDump) GetCrcString() string { return "51077d14" } func (*CnatSessionDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CnatSessionDump) GetRetVal() error { + return nil +} func (m *CnatSessionDump) Size() (size int) { if m == nil { @@ -442,6 +454,9 @@ func (*CnatSessionPurge) GetCrcString() string { return "51077d14" } func (*CnatSessionPurge) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CnatSessionPurge) GetRetVal() error { + return nil +} func (m *CnatSessionPurge) Size() (size int) { if m == nil { @@ -472,6 +487,9 @@ func (*CnatSessionPurgeReply) GetCrcString() string { return "e8d4e804" } func (*CnatSessionPurgeReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CnatSessionPurgeReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CnatSessionPurgeReply) Size() (size int) { if m == nil { @@ -508,6 +526,9 @@ func (*CnatSetSnatAddresses) GetCrcString() string { return "d997e96c" } func (*CnatSetSnatAddresses) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CnatSetSnatAddresses) GetRetVal() error { + return nil +} func (m *CnatSetSnatAddresses) Size() (size int) { if m == nil { @@ -548,6 +569,9 @@ func (*CnatSetSnatAddressesReply) GetCrcString() string { return "e8d4e804" } func (*CnatSetSnatAddressesReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CnatSetSnatAddressesReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CnatSetSnatAddressesReply) Size() (size int) { if m == nil { @@ -582,6 +606,9 @@ func (*CnatSetSnatPolicy) GetCrcString() string { return "d3e6eaf4" } func (*CnatSetSnatPolicy) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CnatSetSnatPolicy) GetRetVal() error { + return nil +} func (m *CnatSetSnatPolicy) Size() (size int) { if m == nil { @@ -616,6 +643,9 @@ func (*CnatSetSnatPolicyReply) GetCrcString() string { return "e8d4e804" } func (*CnatSetSnatPolicyReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CnatSetSnatPolicyReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CnatSetSnatPolicyReply) Size() (size int) { if m == nil { @@ -653,6 +683,9 @@ func (*CnatSnatPolicyAddDelExcludePfx) GetCrcString() string { return "e26dd79a" func (*CnatSnatPolicyAddDelExcludePfx) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CnatSnatPolicyAddDelExcludePfx) GetRetVal() error { + return nil +} func (m *CnatSnatPolicyAddDelExcludePfx) Size() (size int) { if m == nil { @@ -698,6 +731,9 @@ func (*CnatSnatPolicyAddDelExcludePfxReply) GetCrcString() string { return "e8d4 func (*CnatSnatPolicyAddDelExcludePfxReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CnatSnatPolicyAddDelExcludePfxReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CnatSnatPolicyAddDelExcludePfxReply) Size() (size int) { if m == nil { @@ -734,6 +770,9 @@ func (*CnatSnatPolicyAddDelIf) GetCrcString() string { return "6828deca" } func (*CnatSnatPolicyAddDelIf) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CnatSnatPolicyAddDelIf) GetRetVal() error { + return nil +} func (m *CnatSnatPolicyAddDelIf) Size() (size int) { if m == nil { @@ -776,6 +815,9 @@ func (*CnatSnatPolicyAddDelIfReply) GetCrcString() string { return "e8d4e804" } func (*CnatSnatPolicyAddDelIfReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CnatSnatPolicyAddDelIfReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CnatSnatPolicyAddDelIfReply) Size() (size int) { if m == nil { @@ -810,6 +852,9 @@ func (*CnatTranslationDel) GetCrcString() string { return "3a91bde5" } func (*CnatTranslationDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CnatTranslationDel) GetRetVal() error { + return nil +} func (m *CnatTranslationDel) Size() (size int) { if m == nil { @@ -844,6 +889,9 @@ func (*CnatTranslationDelReply) GetCrcString() string { return "e8d4e804" } func (*CnatTranslationDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CnatTranslationDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CnatTranslationDelReply) Size() (size int) { if m == nil { @@ -878,6 +926,9 @@ func (*CnatTranslationDetails) GetCrcString() string { return "347e1f16" } func (*CnatTranslationDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CnatTranslationDetails) GetRetVal() error { + return nil +} func (m *CnatTranslationDetails) Size() (size int) { if m == nil { @@ -989,6 +1040,9 @@ func (*CnatTranslationDump) GetCrcString() string { return "51077d14" } func (*CnatTranslationDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CnatTranslationDump) GetRetVal() error { + return nil +} func (m *CnatTranslationDump) Size() (size int) { if m == nil { @@ -1019,6 +1073,9 @@ func (*CnatTranslationUpdate) GetCrcString() string { return "cd5aedf5" } func (*CnatTranslationUpdate) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CnatTranslationUpdate) GetRetVal() error { + return nil +} func (m *CnatTranslationUpdate) Size() (size int) { if m == nil { @@ -1133,6 +1190,9 @@ func (*CnatTranslationUpdateReply) GetCrcString() string { return "e2fc8294" } func (*CnatTranslationUpdateReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CnatTranslationUpdateReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CnatTranslationUpdateReply) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/crypto_sw_scheduler/crypto_sw_scheduler.ba.go b/vpplink/binapi/vppapi/crypto_sw_scheduler/crypto_sw_scheduler.ba.go index afe4c5cc..0fca0c7b 100644 --- a/vpplink/binapi/vppapi/crypto_sw_scheduler/crypto_sw_scheduler.ba.go +++ b/vpplink/binapi/vppapi/crypto_sw_scheduler/crypto_sw_scheduler.ba.go @@ -37,6 +37,9 @@ func (*CryptoSwSchedulerSetWorker) GetCrcString() string { return "b4274502" } func (*CryptoSwSchedulerSetWorker) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CryptoSwSchedulerSetWorker) GetRetVal() error { + return nil +} func (m *CryptoSwSchedulerSetWorker) Size() (size int) { if m == nil { @@ -76,6 +79,9 @@ func (*CryptoSwSchedulerSetWorkerReply) GetCrcString() string { return "e8d4e804 func (*CryptoSwSchedulerSetWorkerReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CryptoSwSchedulerSetWorkerReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CryptoSwSchedulerSetWorkerReply) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/ethernet_types/ethernet_types.ba.go b/vpplink/binapi/vppapi/ethernet_types/ethernet_types.ba.go index 4a9ad664..e31ef8d3 100644 --- a/vpplink/binapi/vppapi/ethernet_types/ethernet_types.ba.go +++ b/vpplink/binapi/vppapi/ethernet_types/ethernet_types.ba.go @@ -31,15 +31,19 @@ func ParseMacAddress(s string) (MacAddress, error) { copy(macaddr[:], mac[:]) return macaddr, nil } + func (x MacAddress) ToMAC() net.HardwareAddr { return net.HardwareAddr(x[:]) } + func (x MacAddress) String() string { return x.ToMAC().String() } + func (x *MacAddress) MarshalText() ([]byte, error) { return []byte(x.String()), nil } + func (x *MacAddress) UnmarshalText(text []byte) error { mac, err := ParseMacAddress(string(text)) if err != nil { diff --git a/vpplink/binapi/vppapi/feature/feature.ba.go b/vpplink/binapi/vppapi/feature/feature.ba.go index fe4a4f79..5e576266 100644 --- a/vpplink/binapi/vppapi/feature/feature.ba.go +++ b/vpplink/binapi/vppapi/feature/feature.ba.go @@ -39,6 +39,9 @@ func (*FeatureEnableDisable) GetCrcString() string { return "7531c862" } func (*FeatureEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *FeatureEnableDisable) GetRetVal() error { + return nil +} func (m *FeatureEnableDisable) Size() (size int) { if m == nil { @@ -81,6 +84,9 @@ func (*FeatureEnableDisableReply) GetCrcString() string { return "e8d4e804" } func (*FeatureEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *FeatureEnableDisableReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *FeatureEnableDisableReply) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/generate.log b/vpplink/binapi/vppapi/generate.log index e4ed11f3..7f69f84b 100644 --- a/vpplink/binapi/vppapi/generate.log +++ b/vpplink/binapi/vppapi/generate.log @@ -1,5 +1,5 @@ -VPP Version : 22.06-rc0~148-gd4df3f2ca -Binapi-generator version : govpp v0.4.0-dev +VPP Version : 22.06-rc0~149-g70a9a1d9f +Binapi-generator version : govpp v0.5.0-dev VPP Base commit : 45207e0fb wireguard: fix dereferences null pointer ------------------ Cherry picked commits -------------------- gerrit:28513/25 capo: Calico Policies plugin diff --git a/vpplink/binapi/vppapi/gso/gso.ba.go b/vpplink/binapi/vppapi/gso/gso.ba.go index f3479507..45abbd67 100644 --- a/vpplink/binapi/vppapi/gso/gso.ba.go +++ b/vpplink/binapi/vppapi/gso/gso.ba.go @@ -37,6 +37,9 @@ func (*FeatureGsoEnableDisable) GetCrcString() string { return "5501adee" } func (*FeatureGsoEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *FeatureGsoEnableDisable) GetRetVal() error { + return nil +} func (m *FeatureGsoEnableDisable) Size() (size int) { if m == nil { @@ -75,6 +78,9 @@ func (*FeatureGsoEnableDisableReply) GetCrcString() string { return "e8d4e804" } func (*FeatureGsoEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *FeatureGsoEnableDisableReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *FeatureGsoEnableDisableReply) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/ikev2/ikev2.ba.go b/vpplink/binapi/vppapi/ikev2/ikev2.ba.go index 619e0b2d..173178e8 100644 --- a/vpplink/binapi/vppapi/ikev2/ikev2.ba.go +++ b/vpplink/binapi/vppapi/ikev2/ikev2.ba.go @@ -40,6 +40,9 @@ func (*Ikev2ChildSaDetails) GetCrcString() string { return "ff67741f" } func (*Ikev2ChildSaDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2ChildSaDetails) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ikev2ChildSaDetails) Size() (size int) { if m == nil { @@ -189,6 +192,9 @@ func (*Ikev2ChildSaDump) GetCrcString() string { return "01eab609" } func (*Ikev2ChildSaDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2ChildSaDump) GetRetVal() error { + return nil +} func (m *Ikev2ChildSaDump) Size() (size int) { if m == nil { @@ -223,6 +229,9 @@ func (*Ikev2InitiateDelChildSa) GetCrcString() string { return "7f004d2e" } func (*Ikev2InitiateDelChildSa) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2InitiateDelChildSa) GetRetVal() error { + return nil +} func (m *Ikev2InitiateDelChildSa) Size() (size int) { if m == nil { @@ -259,6 +268,9 @@ func (*Ikev2InitiateDelChildSaReply) GetCrcString() string { return "e8d4e804" } func (*Ikev2InitiateDelChildSaReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2InitiateDelChildSaReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ikev2InitiateDelChildSaReply) Size() (size int) { if m == nil { @@ -293,6 +305,9 @@ func (*Ikev2InitiateDelIkeSa) GetCrcString() string { return "8d125bdd" } func (*Ikev2InitiateDelIkeSa) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2InitiateDelIkeSa) GetRetVal() error { + return nil +} func (m *Ikev2InitiateDelIkeSa) Size() (size int) { if m == nil { @@ -327,6 +342,9 @@ func (*Ikev2InitiateDelIkeSaReply) GetCrcString() string { return "e8d4e804" } func (*Ikev2InitiateDelIkeSaReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2InitiateDelIkeSaReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ikev2InitiateDelIkeSaReply) Size() (size int) { if m == nil { @@ -361,6 +379,9 @@ func (*Ikev2InitiateRekeyChildSa) GetCrcString() string { return "7f004d2e" } func (*Ikev2InitiateRekeyChildSa) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2InitiateRekeyChildSa) GetRetVal() error { + return nil +} func (m *Ikev2InitiateRekeyChildSa) Size() (size int) { if m == nil { @@ -397,6 +418,9 @@ func (*Ikev2InitiateRekeyChildSaReply) GetCrcString() string { return "e8d4e804" func (*Ikev2InitiateRekeyChildSaReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2InitiateRekeyChildSaReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ikev2InitiateRekeyChildSaReply) Size() (size int) { if m == nil { @@ -431,6 +455,9 @@ func (*Ikev2InitiateSaInit) GetCrcString() string { return "ebf79a66" } func (*Ikev2InitiateSaInit) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2InitiateSaInit) GetRetVal() error { + return nil +} func (m *Ikev2InitiateSaInit) Size() (size int) { if m == nil { @@ -465,6 +492,9 @@ func (*Ikev2InitiateSaInitReply) GetCrcString() string { return "e8d4e804" } func (*Ikev2InitiateSaInitReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2InitiateSaInitReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ikev2InitiateSaInitReply) Size() (size int) { if m == nil { @@ -500,6 +530,9 @@ func (*Ikev2NonceGet) GetCrcString() string { return "7fe9ad51" } func (*Ikev2NonceGet) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2NonceGet) GetRetVal() error { + return nil +} func (m *Ikev2NonceGet) Size() (size int) { if m == nil { @@ -539,6 +572,9 @@ func (*Ikev2NonceGetReply) GetCrcString() string { return "1b37a342" } func (*Ikev2NonceGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2NonceGetReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ikev2NonceGetReply) Size() (size int) { if m == nil { @@ -577,6 +613,9 @@ func (*Ikev2PluginGetVersion) GetCrcString() string { return "51077d14" } func (*Ikev2PluginGetVersion) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2PluginGetVersion) GetRetVal() error { + return nil +} func (m *Ikev2PluginGetVersion) Size() (size int) { if m == nil { @@ -607,6 +646,9 @@ func (*Ikev2PluginGetVersionReply) GetCrcString() string { return "9b32cf86" } func (*Ikev2PluginGetVersionReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2PluginGetVersionReply) GetRetVal() error { + return nil +} func (m *Ikev2PluginGetVersionReply) Size() (size int) { if m == nil { @@ -645,6 +687,9 @@ func (*Ikev2ProfileAddDel) GetCrcString() string { return "2c925b55" } func (*Ikev2ProfileAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2ProfileAddDel) GetRetVal() error { + return nil +} func (m *Ikev2ProfileAddDel) Size() (size int) { if m == nil { @@ -682,6 +727,9 @@ func (*Ikev2ProfileAddDelReply) GetCrcString() string { return "e8d4e804" } func (*Ikev2ProfileAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2ProfileAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ikev2ProfileAddDelReply) Size() (size int) { if m == nil { @@ -716,6 +764,9 @@ func (*Ikev2ProfileDetails) GetCrcString() string { return "670d01d9" } func (*Ikev2ProfileDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2ProfileDetails) GetRetVal() error { + return nil +} func (m *Ikev2ProfileDetails) Size() (size int) { if m == nil { @@ -895,6 +946,9 @@ func (*Ikev2ProfileDisableNatt) GetCrcString() string { return "ebf79a66" } func (*Ikev2ProfileDisableNatt) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2ProfileDisableNatt) GetRetVal() error { + return nil +} func (m *Ikev2ProfileDisableNatt) Size() (size int) { if m == nil { @@ -931,6 +985,9 @@ func (*Ikev2ProfileDisableNattReply) GetCrcString() string { return "e8d4e804" } func (*Ikev2ProfileDisableNattReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2ProfileDisableNattReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ikev2ProfileDisableNattReply) Size() (size int) { if m == nil { @@ -963,6 +1020,9 @@ func (*Ikev2ProfileDump) GetCrcString() string { return "51077d14" } func (*Ikev2ProfileDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2ProfileDump) GetRetVal() error { + return nil +} func (m *Ikev2ProfileDump) Size() (size int) { if m == nil { @@ -997,6 +1057,9 @@ func (*Ikev2ProfileSetAuth) GetCrcString() string { return "642c97cd" } func (*Ikev2ProfileSetAuth) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2ProfileSetAuth) GetRetVal() error { + return nil +} func (m *Ikev2ProfileSetAuth) Size() (size int) { if m == nil { @@ -1044,6 +1107,9 @@ func (*Ikev2ProfileSetAuthReply) GetCrcString() string { return "e8d4e804" } func (*Ikev2ProfileSetAuthReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2ProfileSetAuthReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ikev2ProfileSetAuthReply) Size() (size int) { if m == nil { @@ -1082,6 +1148,9 @@ func (*Ikev2ProfileSetID) GetCrcString() string { return "4d7e2418" } func (*Ikev2ProfileSetID) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2ProfileSetID) GetRetVal() error { + return nil +} func (m *Ikev2ProfileSetID) Size() (size int) { if m == nil { @@ -1129,6 +1198,9 @@ func (*Ikev2ProfileSetIDReply) GetCrcString() string { return "e8d4e804" } func (*Ikev2ProfileSetIDReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2ProfileSetIDReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ikev2ProfileSetIDReply) Size() (size int) { if m == nil { @@ -1167,6 +1239,9 @@ func (*Ikev2ProfileSetIpsecUDPPort) GetCrcString() string { return "615ce758" } func (*Ikev2ProfileSetIpsecUDPPort) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2ProfileSetIpsecUDPPort) GetRetVal() error { + return nil +} func (m *Ikev2ProfileSetIpsecUDPPort) Size() (size int) { if m == nil { @@ -1209,6 +1284,9 @@ func (*Ikev2ProfileSetIpsecUDPPortReply) GetCrcString() string { return "e8d4e80 func (*Ikev2ProfileSetIpsecUDPPortReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2ProfileSetIpsecUDPPortReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ikev2ProfileSetIpsecUDPPortReply) Size() (size int) { if m == nil { @@ -1244,6 +1322,9 @@ func (*Ikev2ProfileSetLiveness) GetCrcString() string { return "6bdf4d65" } func (*Ikev2ProfileSetLiveness) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2ProfileSetLiveness) GetRetVal() error { + return nil +} func (m *Ikev2ProfileSetLiveness) Size() (size int) { if m == nil { @@ -1283,6 +1364,9 @@ func (*Ikev2ProfileSetLivenessReply) GetCrcString() string { return "e8d4e804" } func (*Ikev2ProfileSetLivenessReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2ProfileSetLivenessReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ikev2ProfileSetLivenessReply) Size() (size int) { if m == nil { @@ -1318,6 +1402,9 @@ func (*Ikev2ProfileSetTs) GetCrcString() string { return "8eb8cfd1" } func (*Ikev2ProfileSetTs) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2ProfileSetTs) GetRetVal() error { + return nil +} func (m *Ikev2ProfileSetTs) Size() (size int) { if m == nil { @@ -1382,6 +1469,9 @@ func (*Ikev2ProfileSetTsReply) GetCrcString() string { return "e8d4e804" } func (*Ikev2ProfileSetTsReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2ProfileSetTsReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ikev2ProfileSetTsReply) Size() (size int) { if m == nil { @@ -1416,6 +1506,9 @@ func (*Ikev2ProfileSetUDPEncap) GetCrcString() string { return "ebf79a66" } func (*Ikev2ProfileSetUDPEncap) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2ProfileSetUDPEncap) GetRetVal() error { + return nil +} func (m *Ikev2ProfileSetUDPEncap) Size() (size int) { if m == nil { @@ -1452,6 +1545,9 @@ func (*Ikev2ProfileSetUDPEncapReply) GetCrcString() string { return "e8d4e804" } func (*Ikev2ProfileSetUDPEncapReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2ProfileSetUDPEncapReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ikev2ProfileSetUDPEncapReply) Size() (size int) { if m == nil { @@ -1487,6 +1583,9 @@ func (*Ikev2SaDetails) GetCrcString() string { return "937c22d5" } func (*Ikev2SaDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2SaDetails) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ikev2SaDetails) Size() (size int) { if m == nil { @@ -1700,6 +1799,9 @@ func (*Ikev2SaDump) GetCrcString() string { return "51077d14" } func (*Ikev2SaDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2SaDump) GetRetVal() error { + return nil +} func (m *Ikev2SaDump) Size() (size int) { if m == nil { @@ -1731,6 +1833,9 @@ func (*Ikev2SetEspTransforms) GetCrcString() string { return "a63dc205" } func (*Ikev2SetEspTransforms) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2SetEspTransforms) GetRetVal() error { + return nil +} func (m *Ikev2SetEspTransforms) Size() (size int) { if m == nil { @@ -1774,6 +1879,9 @@ func (*Ikev2SetEspTransformsReply) GetCrcString() string { return "e8d4e804" } func (*Ikev2SetEspTransformsReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2SetEspTransformsReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ikev2SetEspTransformsReply) Size() (size int) { if m == nil { @@ -1809,6 +1917,9 @@ func (*Ikev2SetIkeTransforms) GetCrcString() string { return "076d7378" } func (*Ikev2SetIkeTransforms) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2SetIkeTransforms) GetRetVal() error { + return nil +} func (m *Ikev2SetIkeTransforms) Size() (size int) { if m == nil { @@ -1855,6 +1966,9 @@ func (*Ikev2SetIkeTransformsReply) GetCrcString() string { return "e8d4e804" } func (*Ikev2SetIkeTransformsReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2SetIkeTransformsReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ikev2SetIkeTransformsReply) Size() (size int) { if m == nil { @@ -1889,6 +2003,9 @@ func (*Ikev2SetLocalKey) GetCrcString() string { return "799b69ec" } func (*Ikev2SetLocalKey) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2SetLocalKey) GetRetVal() error { + return nil +} func (m *Ikev2SetLocalKey) Size() (size int) { if m == nil { @@ -1923,6 +2040,9 @@ func (*Ikev2SetLocalKeyReply) GetCrcString() string { return "e8d4e804" } func (*Ikev2SetLocalKeyReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2SetLocalKeyReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ikev2SetLocalKeyReply) Size() (size int) { if m == nil { @@ -1958,6 +2078,9 @@ func (*Ikev2SetResponder) GetCrcString() string { return "a2055df1" } func (*Ikev2SetResponder) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2SetResponder) GetRetVal() error { + return nil +} func (m *Ikev2SetResponder) Size() (size int) { if m == nil { @@ -2003,6 +2126,9 @@ func (*Ikev2SetResponderHostname) GetCrcString() string { return "350d6949" } func (*Ikev2SetResponderHostname) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2SetResponderHostname) GetRetVal() error { + return nil +} func (m *Ikev2SetResponderHostname) Size() (size int) { if m == nil { @@ -2045,6 +2171,9 @@ func (*Ikev2SetResponderHostnameReply) GetCrcString() string { return "e8d4e804" func (*Ikev2SetResponderHostnameReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2SetResponderHostnameReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ikev2SetResponderHostnameReply) Size() (size int) { if m == nil { @@ -2079,6 +2208,9 @@ func (*Ikev2SetResponderReply) GetCrcString() string { return "e8d4e804" } func (*Ikev2SetResponderReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2SetResponderReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ikev2SetResponderReply) Size() (size int) { if m == nil { @@ -2117,6 +2249,9 @@ func (*Ikev2SetSaLifetime) GetCrcString() string { return "7039feaa" } func (*Ikev2SetSaLifetime) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2SetSaLifetime) GetRetVal() error { + return nil +} func (m *Ikev2SetSaLifetime) Size() (size int) { if m == nil { @@ -2163,6 +2298,9 @@ func (*Ikev2SetSaLifetimeReply) GetCrcString() string { return "e8d4e804" } func (*Ikev2SetSaLifetimeReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2SetSaLifetimeReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ikev2SetSaLifetimeReply) Size() (size int) { if m == nil { @@ -2198,6 +2336,9 @@ func (*Ikev2SetTunnelInterface) GetCrcString() string { return "ca67182c" } func (*Ikev2SetTunnelInterface) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2SetTunnelInterface) GetRetVal() error { + return nil +} func (m *Ikev2SetTunnelInterface) Size() (size int) { if m == nil { @@ -2237,6 +2378,9 @@ func (*Ikev2SetTunnelInterfaceReply) GetCrcString() string { return "e8d4e804" } func (*Ikev2SetTunnelInterfaceReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2SetTunnelInterfaceReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ikev2SetTunnelInterfaceReply) Size() (size int) { if m == nil { @@ -2272,6 +2416,9 @@ func (*Ikev2TrafficSelectorDetails) GetCrcString() string { return "518cb06f" func (*Ikev2TrafficSelectorDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ikev2TrafficSelectorDetails) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ikev2TrafficSelectorDetails) Size() (size int) { if m == nil { @@ -2338,6 +2485,9 @@ func (*Ikev2TrafficSelectorDump) GetCrcString() string { return "a7385e33" } func (*Ikev2TrafficSelectorDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ikev2TrafficSelectorDump) GetRetVal() error { + return nil +} func (m *Ikev2TrafficSelectorDump) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/interface/interface.ba.go b/vpplink/binapi/vppapi/interface/interface.ba.go index a56c68d1..dd801ac5 100644 --- a/vpplink/binapi/vppapi/interface/interface.ba.go +++ b/vpplink/binapi/vppapi/interface/interface.ba.go @@ -41,6 +41,9 @@ func (*CollectDetailedInterfaceStats) GetCrcString() string { return "5501adee" func (*CollectDetailedInterfaceStats) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CollectDetailedInterfaceStats) GetRetVal() error { + return nil +} func (m *CollectDetailedInterfaceStats) Size() (size int) { if m == nil { @@ -79,6 +82,9 @@ func (*CollectDetailedInterfaceStatsReply) GetCrcString() string { return "e8d4e func (*CollectDetailedInterfaceStatsReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CollectDetailedInterfaceStatsReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CollectDetailedInterfaceStatsReply) Size() (size int) { if m == nil { @@ -112,6 +118,9 @@ func (*CreateLoopback) GetCrcString() string { return "42bb5d22" } func (*CreateLoopback) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CreateLoopback) GetRetVal() error { + return nil +} func (m *CreateLoopback) Size() (size int) { if m == nil { @@ -147,6 +156,9 @@ func (*CreateLoopbackInstance) GetCrcString() string { return "d36a3ee2" } func (*CreateLoopbackInstance) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CreateLoopbackInstance) GetRetVal() error { + return nil +} func (m *CreateLoopbackInstance) Size() (size int) { if m == nil { @@ -187,6 +199,9 @@ func (*CreateLoopbackInstanceReply) GetCrcString() string { return "5383d31f" func (*CreateLoopbackInstanceReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CreateLoopbackInstanceReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CreateLoopbackInstanceReply) Size() (size int) { if m == nil { @@ -224,6 +239,9 @@ func (*CreateLoopbackReply) GetCrcString() string { return "5383d31f" } func (*CreateLoopbackReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CreateLoopbackReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CreateLoopbackReply) Size() (size int) { if m == nil { @@ -264,6 +282,9 @@ func (*CreateSubif) GetCrcString() string { return "790ca755" } func (*CreateSubif) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CreateSubif) GetRetVal() error { + return nil +} func (m *CreateSubif) Size() (size int) { if m == nil { @@ -310,6 +331,9 @@ func (*CreateSubifReply) GetCrcString() string { return "5383d31f" } func (*CreateSubifReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CreateSubifReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CreateSubifReply) Size() (size int) { if m == nil { @@ -347,6 +371,9 @@ func (*CreateVlanSubif) GetCrcString() string { return "af34ac8b" } func (*CreateVlanSubif) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CreateVlanSubif) GetRetVal() error { + return nil +} func (m *CreateVlanSubif) Size() (size int) { if m == nil { @@ -384,6 +411,9 @@ func (*CreateVlanSubifReply) GetCrcString() string { return "5383d31f" } func (*CreateVlanSubifReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CreateVlanSubifReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CreateVlanSubifReply) Size() (size int) { if m == nil { @@ -420,6 +450,9 @@ func (*DeleteLoopback) GetCrcString() string { return "f9e6675e" } func (*DeleteLoopback) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *DeleteLoopback) GetRetVal() error { + return nil +} func (m *DeleteLoopback) Size() (size int) { if m == nil { @@ -453,6 +486,9 @@ func (*DeleteLoopbackReply) GetCrcString() string { return "e8d4e804" } func (*DeleteLoopbackReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *DeleteLoopbackReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *DeleteLoopbackReply) Size() (size int) { if m == nil { @@ -486,6 +522,9 @@ func (*DeleteSubif) GetCrcString() string { return "f9e6675e" } func (*DeleteSubif) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *DeleteSubif) GetRetVal() error { + return nil +} func (m *DeleteSubif) Size() (size int) { if m == nil { @@ -519,6 +558,9 @@ func (*DeleteSubifReply) GetCrcString() string { return "e8d4e804" } func (*DeleteSubifReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *DeleteSubifReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *DeleteSubifReply) Size() (size int) { if m == nil { @@ -552,6 +594,9 @@ func (*GetBuffersStats) GetCrcString() string { return "d698f87e" } func (*GetBuffersStats) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *GetBuffersStats) GetRetVal() error { + return nil +} func (m *GetBuffersStats) Size() (size int) { if m == nil { @@ -588,6 +633,9 @@ func (*GetBuffersStatsReply) GetCrcString() string { return "22c0649d" } func (*GetBuffersStatsReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *GetBuffersStatsReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *GetBuffersStatsReply) Size() (size int) { if m == nil { @@ -631,6 +679,9 @@ func (*HwInterfaceSetMtu) GetCrcString() string { return "e6746899" } func (*HwInterfaceSetMtu) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *HwInterfaceSetMtu) GetRetVal() error { + return nil +} func (m *HwInterfaceSetMtu) Size() (size int) { if m == nil { @@ -667,6 +718,9 @@ func (*HwInterfaceSetMtuReply) GetCrcString() string { return "e8d4e804" } func (*HwInterfaceSetMtuReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *HwInterfaceSetMtuReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *HwInterfaceSetMtuReply) Size() (size int) { if m == nil { @@ -701,6 +755,9 @@ func (*InterfaceNameRenumber) GetCrcString() string { return "2b8858b8" } func (*InterfaceNameRenumber) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *InterfaceNameRenumber) GetRetVal() error { + return nil +} func (m *InterfaceNameRenumber) Size() (size int) { if m == nil { @@ -737,6 +794,9 @@ func (*InterfaceNameRenumberReply) GetCrcString() string { return "e8d4e804" } func (*InterfaceNameRenumberReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *InterfaceNameRenumberReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *InterfaceNameRenumberReply) Size() (size int) { if m == nil { @@ -773,6 +833,9 @@ func (*SwInterfaceAddDelAddress) GetCrcString() string { return "5463d73b" } func (*SwInterfaceAddDelAddress) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceAddDelAddress) GetRetVal() error { + return nil +} func (m *SwInterfaceAddDelAddress) Size() (size int) { if m == nil { @@ -823,6 +886,9 @@ func (*SwInterfaceAddDelAddressReply) GetCrcString() string { return "e8d4e804" func (*SwInterfaceAddDelAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceAddDelAddressReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceAddDelAddressReply) Size() (size int) { if m == nil { @@ -860,6 +926,9 @@ func (*SwInterfaceAddDelMacAddress) GetCrcString() string { return "638bb9f4" } func (*SwInterfaceAddDelMacAddress) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceAddDelMacAddress) GetRetVal() error { + return nil +} func (m *SwInterfaceAddDelMacAddress) Size() (size int) { if m == nil { @@ -901,6 +970,9 @@ func (*SwInterfaceAddDelMacAddressReply) GetCrcString() string { return "e8d4e80 func (*SwInterfaceAddDelMacAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceAddDelMacAddressReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceAddDelMacAddressReply) Size() (size int) { if m == nil { @@ -934,6 +1006,9 @@ func (*SwInterfaceAddressReplaceBegin) GetCrcString() string { return "51077d14" func (*SwInterfaceAddressReplaceBegin) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceAddressReplaceBegin) GetRetVal() error { + return nil +} func (m *SwInterfaceAddressReplaceBegin) Size() (size int) { if m == nil { @@ -965,6 +1040,9 @@ func (*SwInterfaceAddressReplaceBeginReply) GetCrcString() string { return "e8d4 func (*SwInterfaceAddressReplaceBeginReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceAddressReplaceBeginReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceAddressReplaceBeginReply) Size() (size int) { if m == nil { @@ -998,6 +1076,9 @@ func (*SwInterfaceAddressReplaceEnd) GetCrcString() string { return "51077d14" } func (*SwInterfaceAddressReplaceEnd) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceAddressReplaceEnd) GetRetVal() error { + return nil +} func (m *SwInterfaceAddressReplaceEnd) Size() (size int) { if m == nil { @@ -1029,6 +1110,9 @@ func (*SwInterfaceAddressReplaceEndReply) GetCrcString() string { return "e8d4e8 func (*SwInterfaceAddressReplaceEndReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceAddressReplaceEndReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceAddressReplaceEndReply) Size() (size int) { if m == nil { @@ -1062,6 +1146,9 @@ func (*SwInterfaceClearStats) GetCrcString() string { return "f9e6675e" } func (*SwInterfaceClearStats) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceClearStats) GetRetVal() error { + return nil +} func (m *SwInterfaceClearStats) Size() (size int) { if m == nil { @@ -1095,6 +1182,9 @@ func (*SwInterfaceClearStatsReply) GetCrcString() string { return "e8d4e804" } func (*SwInterfaceClearStatsReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceClearStatsReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceClearStatsReply) Size() (size int) { if m == nil { @@ -1153,6 +1243,9 @@ func (*SwInterfaceDetails) GetCrcString() string { return "6c221fc7" } func (*SwInterfaceDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceDetails) GetRetVal() error { + return nil +} func (m *SwInterfaceDetails) Size() (size int) { if m == nil { @@ -1272,6 +1365,9 @@ func (*SwInterfaceDump) GetCrcString() string { return "aa610c27" } func (*SwInterfaceDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceDump) GetRetVal() error { + return nil +} func (m *SwInterfaceDump) Size() (size int) { if m == nil { @@ -1314,6 +1410,9 @@ func (*SwInterfaceEvent) GetCrcString() string { return "2d3d95a7" } func (*SwInterfaceEvent) GetMessageType() api.MessageType { return api.EventMessage } +func (m *SwInterfaceEvent) GetRetVal() error { + return nil +} func (m *SwInterfaceEvent) Size() (size int) { if m == nil { @@ -1356,6 +1455,9 @@ func (*SwInterfaceGetMacAddress) GetCrcString() string { return "f9e6675e" } func (*SwInterfaceGetMacAddress) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceGetMacAddress) GetRetVal() error { + return nil +} func (m *SwInterfaceGetMacAddress) Size() (size int) { if m == nil { @@ -1392,6 +1494,9 @@ func (*SwInterfaceGetMacAddressReply) GetCrcString() string { return "40ef2c08" func (*SwInterfaceGetMacAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceGetMacAddressReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceGetMacAddressReply) Size() (size int) { if m == nil { @@ -1429,6 +1534,9 @@ func (*SwInterfaceGetTable) GetCrcString() string { return "2d033de4" } func (*SwInterfaceGetTable) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceGetTable) GetRetVal() error { + return nil +} func (m *SwInterfaceGetTable) Size() (size int) { if m == nil { @@ -1466,6 +1574,9 @@ func (*SwInterfaceGetTableReply) GetCrcString() string { return "a6eb0109" } func (*SwInterfaceGetTableReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceGetTableReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceGetTableReply) Size() (size int) { if m == nil { @@ -1507,6 +1618,9 @@ func (*SwInterfaceRxPlacementDetails) GetCrcString() string { return "9e44a7ce" func (*SwInterfaceRxPlacementDetails) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceRxPlacementDetails) GetRetVal() error { + return nil +} func (m *SwInterfaceRxPlacementDetails) Size() (size int) { if m == nil { @@ -1549,6 +1663,9 @@ func (*SwInterfaceRxPlacementDump) GetCrcString() string { return "f9e6675e" } func (*SwInterfaceRxPlacementDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceRxPlacementDump) GetRetVal() error { + return nil +} func (m *SwInterfaceRxPlacementDump) Size() (size int) { if m == nil { @@ -1583,6 +1700,9 @@ func (*SwInterfaceSetFlags) GetCrcString() string { return "f5aec1b8" } func (*SwInterfaceSetFlags) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceSetFlags) GetRetVal() error { + return nil +} func (m *SwInterfaceSetFlags) Size() (size int) { if m == nil { @@ -1619,6 +1739,9 @@ func (*SwInterfaceSetFlagsReply) GetCrcString() string { return "e8d4e804" } func (*SwInterfaceSetFlagsReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceSetFlagsReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceSetFlagsReply) Size() (size int) { if m == nil { @@ -1653,6 +1776,9 @@ func (*SwInterfaceSetInterfaceName) GetCrcString() string { return "45a1d548" func (*SwInterfaceSetInterfaceName) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceSetInterfaceName) GetRetVal() error { + return nil +} func (m *SwInterfaceSetInterfaceName) Size() (size int) { if m == nil { @@ -1691,6 +1817,9 @@ func (*SwInterfaceSetInterfaceNameReply) GetCrcString() string { return "e8d4e80 func (*SwInterfaceSetInterfaceNameReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceSetInterfaceNameReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceSetInterfaceNameReply) Size() (size int) { if m == nil { @@ -1727,6 +1856,9 @@ func (*SwInterfaceSetIPDirectedBroadcast) GetCrcString() string { return "ae6cfc func (*SwInterfaceSetIPDirectedBroadcast) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceSetIPDirectedBroadcast) GetRetVal() error { + return nil +} func (m *SwInterfaceSetIPDirectedBroadcast) Size() (size int) { if m == nil { @@ -1767,6 +1899,9 @@ func (*SwInterfaceSetIPDirectedBroadcastReply) GetCrcString() string { return "e func (*SwInterfaceSetIPDirectedBroadcastReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceSetIPDirectedBroadcastReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceSetIPDirectedBroadcastReply) Size() (size int) { if m == nil { @@ -1801,6 +1936,9 @@ func (*SwInterfaceSetMacAddress) GetCrcString() string { return "c536e7eb" } func (*SwInterfaceSetMacAddress) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceSetMacAddress) GetRetVal() error { + return nil +} func (m *SwInterfaceSetMacAddress) Size() (size int) { if m == nil { @@ -1839,6 +1977,9 @@ func (*SwInterfaceSetMacAddressReply) GetCrcString() string { return "e8d4e804" func (*SwInterfaceSetMacAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceSetMacAddressReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceSetMacAddressReply) Size() (size int) { if m == nil { @@ -1873,6 +2014,9 @@ func (*SwInterfaceSetMtu) GetCrcString() string { return "5cbe85e5" } func (*SwInterfaceSetMtu) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceSetMtu) GetRetVal() error { + return nil +} func (m *SwInterfaceSetMtu) Size() (size int) { if m == nil { @@ -1918,6 +2062,9 @@ func (*SwInterfaceSetMtuReply) GetCrcString() string { return "e8d4e804" } func (*SwInterfaceSetMtuReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceSetMtuReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceSetMtuReply) Size() (size int) { if m == nil { @@ -1952,6 +2099,9 @@ func (*SwInterfaceSetPromisc) GetCrcString() string { return "d40860d4" } func (*SwInterfaceSetPromisc) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceSetPromisc) GetRetVal() error { + return nil +} func (m *SwInterfaceSetPromisc) Size() (size int) { if m == nil { @@ -1988,6 +2138,9 @@ func (*SwInterfaceSetPromiscReply) GetCrcString() string { return "e8d4e804" } func (*SwInterfaceSetPromiscReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceSetPromiscReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceSetPromiscReply) Size() (size int) { if m == nil { @@ -2024,6 +2177,9 @@ func (*SwInterfaceSetRxMode) GetCrcString() string { return "b04d1cfe" } func (*SwInterfaceSetRxMode) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceSetRxMode) GetRetVal() error { + return nil +} func (m *SwInterfaceSetRxMode) Size() (size int) { if m == nil { @@ -2066,6 +2222,9 @@ func (*SwInterfaceSetRxModeReply) GetCrcString() string { return "e8d4e804" } func (*SwInterfaceSetRxModeReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceSetRxModeReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceSetRxModeReply) Size() (size int) { if m == nil { @@ -2102,6 +2261,9 @@ func (*SwInterfaceSetRxPlacement) GetCrcString() string { return "db65f3c9" } func (*SwInterfaceSetRxPlacement) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceSetRxPlacement) GetRetVal() error { + return nil +} func (m *SwInterfaceSetRxPlacement) Size() (size int) { if m == nil { @@ -2146,6 +2308,9 @@ func (*SwInterfaceSetRxPlacementReply) GetCrcString() string { return "e8d4e804" func (*SwInterfaceSetRxPlacementReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceSetRxPlacementReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceSetRxPlacementReply) Size() (size int) { if m == nil { @@ -2181,6 +2346,9 @@ func (*SwInterfaceSetTable) GetCrcString() string { return "df42a577" } func (*SwInterfaceSetTable) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceSetTable) GetRetVal() error { + return nil +} func (m *SwInterfaceSetTable) Size() (size int) { if m == nil { @@ -2220,6 +2388,9 @@ func (*SwInterfaceSetTableReply) GetCrcString() string { return "e8d4e804" } func (*SwInterfaceSetTableReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceSetTableReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceSetTableReply) Size() (size int) { if m == nil { @@ -2256,6 +2427,9 @@ func (*SwInterfaceSetTxPlacement) GetCrcString() string { return "4e0cd5ff" } func (*SwInterfaceSetTxPlacement) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceSetTxPlacement) GetRetVal() error { + return nil +} func (m *SwInterfaceSetTxPlacement) Size() (size int) { if m == nil { @@ -2309,6 +2483,9 @@ func (*SwInterfaceSetTxPlacementReply) GetCrcString() string { return "e8d4e804" func (*SwInterfaceSetTxPlacementReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceSetTxPlacementReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceSetTxPlacementReply) Size() (size int) { if m == nil { @@ -2344,6 +2521,9 @@ func (*SwInterfaceSetUnnumbered) GetCrcString() string { return "154a6439" } func (*SwInterfaceSetUnnumbered) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceSetUnnumbered) GetRetVal() error { + return nil +} func (m *SwInterfaceSetUnnumbered) Size() (size int) { if m == nil { @@ -2385,6 +2565,9 @@ func (*SwInterfaceSetUnnumberedReply) GetCrcString() string { return "e8d4e804" func (*SwInterfaceSetUnnumberedReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceSetUnnumberedReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceSetUnnumberedReply) Size() (size int) { if m == nil { @@ -2420,6 +2603,9 @@ func (*SwInterfaceTagAddDel) GetCrcString() string { return "426f8bc1" } func (*SwInterfaceTagAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceTagAddDel) GetRetVal() error { + return nil +} func (m *SwInterfaceTagAddDel) Size() (size int) { if m == nil { @@ -2459,6 +2645,9 @@ func (*SwInterfaceTagAddDelReply) GetCrcString() string { return "e8d4e804" } func (*SwInterfaceTagAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceTagAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceTagAddDelReply) Size() (size int) { if m == nil { @@ -2498,6 +2687,9 @@ func (*SwInterfaceTxPlacementDetails) GetCrcString() string { return "00381a2e" func (*SwInterfaceTxPlacementDetails) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceTxPlacementDetails) GetRetVal() error { + return nil +} func (m *SwInterfaceTxPlacementDetails) Size() (size int) { if m == nil { @@ -2553,6 +2745,9 @@ func (*SwInterfaceTxPlacementGet) GetCrcString() string { return "47250981" } func (*SwInterfaceTxPlacementGet) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceTxPlacementGet) GetRetVal() error { + return nil +} func (m *SwInterfaceTxPlacementGet) Size() (size int) { if m == nil { @@ -2592,6 +2787,9 @@ func (*SwInterfaceTxPlacementGetReply) GetCrcString() string { return "53b48f5d" func (*SwInterfaceTxPlacementGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceTxPlacementGetReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceTxPlacementGetReply) Size() (size int) { if m == nil { @@ -2629,6 +2827,9 @@ func (*WantInterfaceEvents) GetCrcString() string { return "476f5a08" } func (*WantInterfaceEvents) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *WantInterfaceEvents) GetRetVal() error { + return nil +} func (m *WantInterfaceEvents) Size() (size int) { if m == nil { @@ -2665,6 +2866,9 @@ func (*WantInterfaceEventsReply) GetCrcString() string { return "e8d4e804" } func (*WantInterfaceEventsReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *WantInterfaceEventsReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *WantInterfaceEventsReply) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/ip/ip.ba.go b/vpplink/binapi/vppapi/ip/ip.ba.go index 0c5d26f6..63d8ded3 100644 --- a/vpplink/binapi/vppapi/ip/ip.ba.go +++ b/vpplink/binapi/vppapi/ip/ip.ba.go @@ -196,6 +196,9 @@ func (*AddDelIPPuntRedirectV2) GetCrcString() string { return "9e804227" } func (*AddDelIPPuntRedirectV2) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AddDelIPPuntRedirectV2) GetRetVal() error { + return nil +} func (m *AddDelIPPuntRedirectV2) Size() (size int) { if m == nil { @@ -313,6 +316,9 @@ func (*AddDelIPPuntRedirectV2Reply) GetCrcString() string { return "e8d4e804" } func (*AddDelIPPuntRedirectV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AddDelIPPuntRedirectV2Reply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *AddDelIPPuntRedirectV2Reply) Size() (size int) { if m == nil { @@ -346,6 +352,9 @@ func (*IoamDisable) GetCrcString() string { return "6b16a45e" } func (*IoamDisable) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IoamDisable) GetRetVal() error { + return nil +} func (m *IoamDisable) Size() (size int) { if m == nil { @@ -379,6 +388,9 @@ func (*IoamDisableReply) GetCrcString() string { return "e8d4e804" } func (*IoamDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IoamDisableReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IoamDisableReply) Size() (size int) { if m == nil { @@ -417,6 +429,9 @@ func (*IoamEnable) GetCrcString() string { return "51ccd868" } func (*IoamEnable) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IoamEnable) GetRetVal() error { + return nil +} func (m *IoamEnable) Size() (size int) { if m == nil { @@ -465,6 +480,9 @@ func (*IoamEnableReply) GetCrcString() string { return "e8d4e804" } func (*IoamEnableReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IoamEnableReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IoamEnableReply) Size() (size int) { if m == nil { @@ -499,6 +517,9 @@ func (*IPAddressDetails) GetCrcString() string { return "ee29b797" } func (*IPAddressDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPAddressDetails) GetRetVal() error { + return nil +} func (m *IPAddressDetails) Size() (size int) { if m == nil { @@ -542,6 +563,9 @@ func (*IPAddressDump) GetCrcString() string { return "2d033de4" } func (*IPAddressDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPAddressDump) GetRetVal() error { + return nil +} func (m *IPAddressDump) Size() (size int) { if m == nil { @@ -580,6 +604,9 @@ func (*IPContainerProxyAddDel) GetCrcString() string { return "7df1dff1" } func (*IPContainerProxyAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPContainerProxyAddDel) GetRetVal() error { + return nil +} func (m *IPContainerProxyAddDel) Size() (size int) { if m == nil { @@ -627,6 +654,9 @@ func (*IPContainerProxyAddDelReply) GetCrcString() string { return "e8d4e804" } func (*IPContainerProxyAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPContainerProxyAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPContainerProxyAddDelReply) Size() (size int) { if m == nil { @@ -661,6 +691,9 @@ func (*IPContainerProxyDetails) GetCrcString() string { return "a8085523" } func (*IPContainerProxyDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPContainerProxyDetails) GetRetVal() error { + return nil +} func (m *IPContainerProxyDetails) Size() (size int) { if m == nil { @@ -701,6 +734,9 @@ func (*IPContainerProxyDump) GetCrcString() string { return "51077d14" } func (*IPContainerProxyDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPContainerProxyDump) GetRetVal() error { + return nil +} func (m *IPContainerProxyDump) Size() (size int) { if m == nil { @@ -731,6 +767,9 @@ func (*IPDetails) GetCrcString() string { return "eb152d07" } func (*IPDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPDetails) GetRetVal() error { + return nil +} func (m *IPDetails) Size() (size int) { if m == nil { @@ -767,6 +806,9 @@ func (*IPDump) GetCrcString() string { return "98d231ca" } func (*IPDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPDump) GetRetVal() error { + return nil +} func (m *IPDump) Size() (size int) { if m == nil { @@ -801,6 +843,9 @@ func (*IPLocalReassEnableDisable) GetCrcString() string { return "34e2ccc4" } func (*IPLocalReassEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPLocalReassEnableDisable) GetRetVal() error { + return nil +} func (m *IPLocalReassEnableDisable) Size() (size int) { if m == nil { @@ -839,6 +884,9 @@ func (*IPLocalReassEnableDisableReply) GetCrcString() string { return "e8d4e804" func (*IPLocalReassEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPLocalReassEnableDisableReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPLocalReassEnableDisableReply) Size() (size int) { if m == nil { @@ -870,6 +918,9 @@ func (*IPLocalReassGet) GetCrcString() string { return "51077d14" } func (*IPLocalReassGet) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPLocalReassGet) GetRetVal() error { + return nil +} func (m *IPLocalReassGet) Size() (size int) { if m == nil { @@ -901,6 +952,9 @@ func (*IPLocalReassGetReply) GetCrcString() string { return "3e93a702" } func (*IPLocalReassGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPLocalReassGetReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPLocalReassGetReply) Size() (size int) { if m == nil { @@ -942,6 +996,9 @@ func (*IPMrouteAddDel) GetCrcString() string { return "0dd7e790" } func (*IPMrouteAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPMrouteAddDel) GetRetVal() error { + return nil +} func (m *IPMrouteAddDel) Size() (size int) { if m == nil { @@ -1079,6 +1136,9 @@ func (*IPMrouteAddDelReply) GetCrcString() string { return "1992deab" } func (*IPMrouteAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPMrouteAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPMrouteAddDelReply) Size() (size int) { if m == nil { @@ -1115,6 +1175,9 @@ func (*IPMrouteDetails) GetCrcString() string { return "c5cb23fc" } func (*IPMrouteDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPMrouteDetails) GetRetVal() error { + return nil +} func (m *IPMrouteDetails) Size() (size int) { if m == nil { @@ -1245,6 +1308,9 @@ func (*IPMrouteDump) GetCrcString() string { return "b9d2e09e" } func (*IPMrouteDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPMrouteDump) GetRetVal() error { + return nil +} func (m *IPMrouteDump) Size() (size int) { if m == nil { @@ -1284,6 +1350,9 @@ func (*IPMtableDetails) GetCrcString() string { return "b9d2e09e" } func (*IPMtableDetails) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPMtableDetails) GetRetVal() error { + return nil +} func (m *IPMtableDetails) Size() (size int) { if m == nil { @@ -1321,6 +1390,9 @@ func (*IPMtableDump) GetCrcString() string { return "51077d14" } func (*IPMtableDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPMtableDump) GetRetVal() error { + return nil +} func (m *IPMtableDump) Size() (size int) { if m == nil { @@ -1350,6 +1422,9 @@ func (*IPPathMtuDetails) GetCrcString() string { return "ac9539a7" } func (*IPPathMtuDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPPathMtuDetails) GetRetVal() error { + return nil +} func (m *IPPathMtuDetails) Size() (size int) { if m == nil { @@ -1398,6 +1473,9 @@ func (*IPPathMtuGet) GetCrcString() string { return "f75ba505" } func (*IPPathMtuGet) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPPathMtuGet) GetRetVal() error { + return nil +} func (m *IPPathMtuGet) Size() (size int) { if m == nil { @@ -1432,6 +1510,9 @@ func (*IPPathMtuGetReply) GetCrcString() string { return "53b48f5d" } func (*IPPathMtuGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPPathMtuGetReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPPathMtuGetReply) Size() (size int) { if m == nil { @@ -1466,6 +1547,9 @@ func (*IPPathMtuReplaceBegin) GetCrcString() string { return "51077d14" } func (*IPPathMtuReplaceBegin) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPPathMtuReplaceBegin) GetRetVal() error { + return nil +} func (m *IPPathMtuReplaceBegin) Size() (size int) { if m == nil { @@ -1495,6 +1579,9 @@ func (*IPPathMtuReplaceBeginReply) GetCrcString() string { return "e8d4e804" } func (*IPPathMtuReplaceBeginReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPPathMtuReplaceBeginReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPPathMtuReplaceBeginReply) Size() (size int) { if m == nil { @@ -1526,6 +1613,9 @@ func (*IPPathMtuReplaceEnd) GetCrcString() string { return "51077d14" } func (*IPPathMtuReplaceEnd) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPPathMtuReplaceEnd) GetRetVal() error { + return nil +} func (m *IPPathMtuReplaceEnd) Size() (size int) { if m == nil { @@ -1555,6 +1645,9 @@ func (*IPPathMtuReplaceEndReply) GetCrcString() string { return "e8d4e804" } func (*IPPathMtuReplaceEndReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPPathMtuReplaceEndReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPPathMtuReplaceEndReply) Size() (size int) { if m == nil { @@ -1588,6 +1681,9 @@ func (*IPPathMtuUpdate) GetCrcString() string { return "10bbe5cb" } func (*IPPathMtuUpdate) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPPathMtuUpdate) GetRetVal() error { + return nil +} func (m *IPPathMtuUpdate) Size() (size int) { if m == nil { @@ -1636,6 +1732,9 @@ func (*IPPathMtuUpdateReply) GetCrcString() string { return "e8d4e804" } func (*IPPathMtuUpdateReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPPathMtuUpdateReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPPathMtuUpdateReply) Size() (size int) { if m == nil { @@ -1671,6 +1770,9 @@ func (*IPPuntPolice) GetCrcString() string { return "db867cea" } func (*IPPuntPolice) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPPuntPolice) GetRetVal() error { + return nil +} func (m *IPPuntPolice) Size() (size int) { if m == nil { @@ -1710,6 +1812,9 @@ func (*IPPuntPoliceReply) GetCrcString() string { return "e8d4e804" } func (*IPPuntPoliceReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPPuntPoliceReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPPuntPoliceReply) Size() (size int) { if m == nil { @@ -1745,6 +1850,9 @@ func (*IPPuntRedirect) GetCrcString() string { return "6580f635" } func (*IPPuntRedirect) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPPuntRedirect) GetRetVal() error { + return nil +} func (m *IPPuntRedirect) Size() (size int) { if m == nil { @@ -1790,6 +1898,9 @@ func (*IPPuntRedirectDetails) GetCrcString() string { return "2cef63e7" } func (*IPPuntRedirectDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPPuntRedirectDetails) GetRetVal() error { + return nil +} func (m *IPPuntRedirectDetails) Size() (size int) { if m == nil { @@ -1833,6 +1944,9 @@ func (*IPPuntRedirectDump) GetCrcString() string { return "2d033de4" } func (*IPPuntRedirectDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPPuntRedirectDump) GetRetVal() error { + return nil +} func (m *IPPuntRedirectDump) Size() (size int) { if m == nil { @@ -1870,6 +1984,9 @@ func (*IPPuntRedirectReply) GetCrcString() string { return "e8d4e804" } func (*IPPuntRedirectReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPPuntRedirectReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPPuntRedirectReply) Size() (size int) { if m == nil { @@ -1903,6 +2020,9 @@ func (*IPPuntRedirectV2Details) GetCrcString() string { return "7ba42e1d" } func (*IPPuntRedirectV2Details) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPPuntRedirectV2Details) GetRetVal() error { + return nil +} func (m *IPPuntRedirectV2Details) Size() (size int) { if m == nil { @@ -2016,6 +2136,9 @@ func (*IPPuntRedirectV2Dump) GetCrcString() string { return "d817a484" } func (*IPPuntRedirectV2Dump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPPuntRedirectV2Dump) GetRetVal() error { + return nil +} func (m *IPPuntRedirectV2Dump) Size() (size int) { if m == nil { @@ -2055,6 +2178,9 @@ func (*IPReassemblyEnableDisable) GetCrcString() string { return "eb77968d" } func (*IPReassemblyEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPReassemblyEnableDisable) GetRetVal() error { + return nil +} func (m *IPReassemblyEnableDisable) Size() (size int) { if m == nil { @@ -2099,6 +2225,9 @@ func (*IPReassemblyEnableDisableReply) GetCrcString() string { return "e8d4e804" func (*IPReassemblyEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPReassemblyEnableDisableReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPReassemblyEnableDisableReply) Size() (size int) { if m == nil { @@ -2133,6 +2262,9 @@ func (*IPReassemblyGet) GetCrcString() string { return "ea13ff63" } func (*IPReassemblyGet) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPReassemblyGet) GetRetVal() error { + return nil +} func (m *IPReassemblyGet) Size() (size int) { if m == nil { @@ -2174,6 +2306,9 @@ func (*IPReassemblyGetReply) GetCrcString() string { return "d5eb8d34" } func (*IPReassemblyGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPReassemblyGetReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPReassemblyGetReply) Size() (size int) { if m == nil { @@ -2227,6 +2362,9 @@ func (*IPReassemblySet) GetCrcString() string { return "16467d25" } func (*IPReassemblySet) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPReassemblySet) GetRetVal() error { + return nil +} func (m *IPReassemblySet) Size() (size int) { if m == nil { @@ -2275,6 +2413,9 @@ func (*IPReassemblySetReply) GetCrcString() string { return "e8d4e804" } func (*IPReassemblySetReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPReassemblySetReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPReassemblySetReply) Size() (size int) { if m == nil { @@ -2310,6 +2451,9 @@ func (*IPRouteAddDel) GetCrcString() string { return "b8ecfe0d" } func (*IPRouteAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPRouteAddDel) GetRetVal() error { + return nil +} func (m *IPRouteAddDel) Size() (size int) { if m == nil { @@ -2438,6 +2582,9 @@ func (*IPRouteAddDelReply) GetCrcString() string { return "1992deab" } func (*IPRouteAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPRouteAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPRouteAddDelReply) Size() (size int) { if m == nil { @@ -2477,6 +2624,9 @@ func (*IPRouteAddDelV2) GetCrcString() string { return "521ef330" } func (*IPRouteAddDelV2) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPRouteAddDelV2) GetRetVal() error { + return nil +} func (m *IPRouteAddDelV2) Size() (size int) { if m == nil { @@ -2609,6 +2759,9 @@ func (*IPRouteAddDelV2Reply) GetCrcString() string { return "1992deab" } func (*IPRouteAddDelV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPRouteAddDelV2Reply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPRouteAddDelV2Reply) Size() (size int) { if m == nil { @@ -2645,6 +2798,9 @@ func (*IPRouteDetails) GetCrcString() string { return "bda8f315" } func (*IPRouteDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPRouteDetails) GetRetVal() error { + return nil +} func (m *IPRouteDetails) Size() (size int) { if m == nil { @@ -2766,6 +2922,9 @@ func (*IPRouteDump) GetCrcString() string { return "b9d2e09e" } func (*IPRouteDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPRouteDump) GetRetVal() error { + return nil +} func (m *IPRouteDump) Size() (size int) { if m == nil { @@ -2807,6 +2966,9 @@ func (*IPRouteLookup) GetCrcString() string { return "710d6471" } func (*IPRouteLookup) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPRouteLookup) GetRetVal() error { + return nil +} func (m *IPRouteLookup) Size() (size int) { if m == nil { @@ -2853,6 +3015,9 @@ func (*IPRouteLookupReply) GetCrcString() string { return "5d8febcb" } func (*IPRouteLookupReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPRouteLookupReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPRouteLookupReply) Size() (size int) { if m == nil { @@ -2980,6 +3145,9 @@ func (*IPRouteLookupV2) GetCrcString() string { return "710d6471" } func (*IPRouteLookupV2) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPRouteLookupV2) GetRetVal() error { + return nil +} func (m *IPRouteLookupV2) Size() (size int) { if m == nil { @@ -3027,6 +3195,9 @@ func (*IPRouteLookupV2Reply) GetCrcString() string { return "84cc9e03" } func (*IPRouteLookupV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPRouteLookupV2Reply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPRouteLookupV2Reply) Size() (size int) { if m == nil { @@ -3155,6 +3326,9 @@ func (*IPRouteV2Details) GetCrcString() string { return "b09aa6c0" } func (*IPRouteV2Details) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPRouteV2Details) GetRetVal() error { + return nil +} func (m *IPRouteV2Details) Size() (size int) { if m == nil { @@ -3281,6 +3455,9 @@ func (*IPRouteV2Dump) GetCrcString() string { return "d16f72e6" } func (*IPRouteV2Dump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPRouteV2Dump) GetRetVal() error { + return nil +} func (m *IPRouteV2Dump) Size() (size int) { if m == nil { @@ -3330,6 +3507,9 @@ func (*IPSourceAndPortRangeCheckAddDel) GetCrcString() string { return "92a067e3 func (*IPSourceAndPortRangeCheckAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPSourceAndPortRangeCheckAddDel) GetRetVal() error { + return nil +} func (m *IPSourceAndPortRangeCheckAddDel) Size() (size int) { if m == nil { @@ -3404,6 +3584,9 @@ func (*IPSourceAndPortRangeCheckAddDelReply) GetCrcString() string { return "e8d func (*IPSourceAndPortRangeCheckAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPSourceAndPortRangeCheckAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPSourceAndPortRangeCheckAddDelReply) Size() (size int) { if m == nil { @@ -3446,6 +3629,9 @@ func (*IPSourceAndPortRangeCheckInterfaceAddDel) GetCrcString() string { return func (*IPSourceAndPortRangeCheckInterfaceAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPSourceAndPortRangeCheckInterfaceAddDel) GetRetVal() error { + return nil +} func (m *IPSourceAndPortRangeCheckInterfaceAddDel) Size() (size int) { if m == nil { @@ -3498,6 +3684,9 @@ func (*IPSourceAndPortRangeCheckInterfaceAddDelReply) GetCrcString() string { re func (*IPSourceAndPortRangeCheckInterfaceAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) Size() (size int) { if m == nil { @@ -3532,6 +3721,9 @@ func (*IPTableAddDel) GetCrcString() string { return "0ffdaec0" } func (*IPTableAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPTableAddDel) GetRetVal() error { + return nil +} func (m *IPTableAddDel) Size() (size int) { if m == nil { @@ -3574,6 +3766,9 @@ func (*IPTableAddDelReply) GetCrcString() string { return "e8d4e804" } func (*IPTableAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPTableAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPTableAddDelReply) Size() (size int) { if m == nil { @@ -3607,6 +3802,9 @@ func (*IPTableAllocate) GetCrcString() string { return "b9d2e09e" } func (*IPTableAllocate) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPTableAllocate) GetRetVal() error { + return nil +} func (m *IPTableAllocate) Size() (size int) { if m == nil { @@ -3647,6 +3845,9 @@ func (*IPTableAllocateReply) GetCrcString() string { return "1728303a" } func (*IPTableAllocateReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPTableAllocateReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPTableAllocateReply) Size() (size int) { if m == nil { @@ -3689,6 +3890,9 @@ func (*IPTableDetails) GetCrcString() string { return "c79fca0f" } func (*IPTableDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPTableDetails) GetRetVal() error { + return nil +} func (m *IPTableDetails) Size() (size int) { if m == nil { @@ -3726,6 +3930,9 @@ func (*IPTableDump) GetCrcString() string { return "51077d14" } func (*IPTableDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPTableDump) GetRetVal() error { + return nil +} func (m *IPTableDump) Size() (size int) { if m == nil { @@ -3755,6 +3962,9 @@ func (*IPTableFlush) GetCrcString() string { return "b9d2e09e" } func (*IPTableFlush) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPTableFlush) GetRetVal() error { + return nil +} func (m *IPTableFlush) Size() (size int) { if m == nil { @@ -3794,6 +4004,9 @@ func (*IPTableFlushReply) GetCrcString() string { return "e8d4e804" } func (*IPTableFlushReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPTableFlushReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPTableFlushReply) Size() (size int) { if m == nil { @@ -3827,6 +4040,9 @@ func (*IPTableReplaceBegin) GetCrcString() string { return "b9d2e09e" } func (*IPTableReplaceBegin) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPTableReplaceBegin) GetRetVal() error { + return nil +} func (m *IPTableReplaceBegin) Size() (size int) { if m == nil { @@ -3866,6 +4082,9 @@ func (*IPTableReplaceBeginReply) GetCrcString() string { return "e8d4e804" } func (*IPTableReplaceBeginReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPTableReplaceBeginReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPTableReplaceBeginReply) Size() (size int) { if m == nil { @@ -3899,6 +4118,9 @@ func (*IPTableReplaceEnd) GetCrcString() string { return "b9d2e09e" } func (*IPTableReplaceEnd) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPTableReplaceEnd) GetRetVal() error { + return nil +} func (m *IPTableReplaceEnd) Size() (size int) { if m == nil { @@ -3938,6 +4160,9 @@ func (*IPTableReplaceEndReply) GetCrcString() string { return "e8d4e804" } func (*IPTableReplaceEndReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPTableReplaceEndReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPTableReplaceEndReply) Size() (size int) { if m == nil { @@ -3972,6 +4197,9 @@ func (*IPUnnumberedDetails) GetCrcString() string { return "cc59bd42" } func (*IPUnnumberedDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPUnnumberedDetails) GetRetVal() error { + return nil +} func (m *IPUnnumberedDetails) Size() (size int) { if m == nil { @@ -4008,6 +4236,9 @@ func (*IPUnnumberedDump) GetCrcString() string { return "f9e6675e" } func (*IPUnnumberedDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPUnnumberedDump) GetRetVal() error { + return nil +} func (m *IPUnnumberedDump) Size() (size int) { if m == nil { @@ -4045,6 +4276,9 @@ func (*MfibSignalDetails) GetCrcString() string { return "6f4a4cfb" } func (*MfibSignalDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *MfibSignalDetails) GetRetVal() error { + return nil +} func (m *MfibSignalDetails) Size() (size int) { if m == nil { @@ -4098,6 +4332,9 @@ func (*MfibSignalDump) GetCrcString() string { return "51077d14" } func (*MfibSignalDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *MfibSignalDump) GetRetVal() error { + return nil +} func (m *MfibSignalDump) Size() (size int) { if m == nil { @@ -4136,6 +4373,9 @@ func (*SetIPFlowHash) GetCrcString() string { return "084ee09e" } func (*SetIPFlowHash) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SetIPFlowHash) GetRetVal() error { + return nil +} func (m *SetIPFlowHash) Size() (size int) { if m == nil { @@ -4194,6 +4434,9 @@ func (*SetIPFlowHashReply) GetCrcString() string { return "e8d4e804" } func (*SetIPFlowHashReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SetIPFlowHashReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SetIPFlowHashReply) Size() (size int) { if m == nil { @@ -4227,6 +4470,9 @@ func (*SetIPFlowHashRouterID) GetCrcString() string { return "03e4f48e" } func (*SetIPFlowHashRouterID) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SetIPFlowHashRouterID) GetRetVal() error { + return nil +} func (m *SetIPFlowHashRouterID) Size() (size int) { if m == nil { @@ -4260,6 +4506,9 @@ func (*SetIPFlowHashRouterIDReply) GetCrcString() string { return "e8d4e804" } func (*SetIPFlowHashRouterIDReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SetIPFlowHashRouterIDReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SetIPFlowHashRouterIDReply) Size() (size int) { if m == nil { @@ -4295,6 +4544,9 @@ func (*SetIPFlowHashV2) GetCrcString() string { return "6d132100" } func (*SetIPFlowHashV2) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SetIPFlowHashV2) GetRetVal() error { + return nil +} func (m *SetIPFlowHashV2) Size() (size int) { if m == nil { @@ -4334,6 +4586,9 @@ func (*SetIPFlowHashV2Reply) GetCrcString() string { return "e8d4e804" } func (*SetIPFlowHashV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SetIPFlowHashV2Reply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SetIPFlowHashV2Reply) Size() (size int) { if m == nil { @@ -4368,6 +4623,9 @@ func (*SwInterfaceIP6EnableDisable) GetCrcString() string { return "ae6cfcfb" func (*SwInterfaceIP6EnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceIP6EnableDisable) GetRetVal() error { + return nil +} func (m *SwInterfaceIP6EnableDisable) Size() (size int) { if m == nil { @@ -4406,6 +4664,9 @@ func (*SwInterfaceIP6EnableDisableReply) GetCrcString() string { return "e8d4e80 func (*SwInterfaceIP6EnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceIP6EnableDisableReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceIP6EnableDisableReply) Size() (size int) { if m == nil { @@ -4441,6 +4702,9 @@ func (*SwInterfaceIP6GetLinkLocalAddress) GetCrcString() string { return "f9e667 func (*SwInterfaceIP6GetLinkLocalAddress) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceIP6GetLinkLocalAddress) GetRetVal() error { + return nil +} func (m *SwInterfaceIP6GetLinkLocalAddress) Size() (size int) { if m == nil { @@ -4479,6 +4743,9 @@ func (*SwInterfaceIP6GetLinkLocalAddressReply) GetCrcString() string { return "d func (*SwInterfaceIP6GetLinkLocalAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceIP6GetLinkLocalAddressReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceIP6GetLinkLocalAddressReply) Size() (size int) { if m == nil { @@ -4518,6 +4785,9 @@ func (*SwInterfaceIP6SetLinkLocalAddress) GetCrcString() string { return "1c10f1 func (*SwInterfaceIP6SetLinkLocalAddress) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceIP6SetLinkLocalAddress) GetRetVal() error { + return nil +} func (m *SwInterfaceIP6SetLinkLocalAddress) Size() (size int) { if m == nil { @@ -4558,6 +4828,9 @@ func (*SwInterfaceIP6SetLinkLocalAddressReply) GetCrcString() string { return "e func (*SwInterfaceIP6SetLinkLocalAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceIP6SetLinkLocalAddressReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceIP6SetLinkLocalAddressReply) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/ip6_nd/ip6_nd.ba.go b/vpplink/binapi/vppapi/ip6_nd/ip6_nd.ba.go index 5774fefe..0e56ee06 100644 --- a/vpplink/binapi/vppapi/ip6_nd/ip6_nd.ba.go +++ b/vpplink/binapi/vppapi/ip6_nd/ip6_nd.ba.go @@ -55,6 +55,9 @@ func (*IP6RaEvent) GetCrcString() string { return "0364c1c5" } func (*IP6RaEvent) GetMessageType() api.MessageType { return api.EventMessage } +func (m *IP6RaEvent) GetRetVal() error { + return nil +} func (m *IP6RaEvent) Size() (size int) { if m == nil { @@ -148,6 +151,9 @@ func (*IP6ndProxyAddDel) GetCrcString() string { return "c2e4a686" } func (*IP6ndProxyAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IP6ndProxyAddDel) GetRetVal() error { + return nil +} func (m *IP6ndProxyAddDel) Size() (size int) { if m == nil { @@ -187,6 +193,9 @@ func (*IP6ndProxyAddDelReply) GetCrcString() string { return "e8d4e804" } func (*IP6ndProxyAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IP6ndProxyAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IP6ndProxyAddDelReply) Size() (size int) { if m == nil { @@ -221,6 +230,9 @@ func (*IP6ndProxyDetails) GetCrcString() string { return "30b9ff4a" } func (*IP6ndProxyDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IP6ndProxyDetails) GetRetVal() error { + return nil +} func (m *IP6ndProxyDetails) Size() (size int) { if m == nil { @@ -255,6 +267,9 @@ func (*IP6ndProxyDump) GetCrcString() string { return "51077d14" } func (*IP6ndProxyDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IP6ndProxyDump) GetRetVal() error { + return nil +} func (m *IP6ndProxyDump) Size() (size int) { if m == nil { @@ -285,6 +300,9 @@ func (*IP6ndProxyEnableDisable) GetCrcString() string { return "7daa1e3a" } func (*IP6ndProxyEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IP6ndProxyEnableDisable) GetRetVal() error { + return nil +} func (m *IP6ndProxyEnableDisable) Size() (size int) { if m == nil { @@ -323,6 +341,9 @@ func (*IP6ndProxyEnableDisableReply) GetCrcString() string { return "e8d4e804" } func (*IP6ndProxyEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IP6ndProxyEnableDisableReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IP6ndProxyEnableDisableReply) Size() (size int) { if m == nil { @@ -361,6 +382,9 @@ func (*IP6ndSendRouterSolicitation) GetCrcString() string { return "e5de609c" func (*IP6ndSendRouterSolicitation) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IP6ndSendRouterSolicitation) GetRetVal() error { + return nil +} func (m *IP6ndSendRouterSolicitation) Size() (size int) { if m == nil { @@ -411,6 +435,9 @@ func (*IP6ndSendRouterSolicitationReply) GetCrcString() string { return "e8d4e80 func (*IP6ndSendRouterSolicitationReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IP6ndSendRouterSolicitationReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IP6ndSendRouterSolicitationReply) Size() (size int) { if m == nil { @@ -457,6 +484,9 @@ func (*SwInterfaceIP6ndRaConfig) GetCrcString() string { return "3eb00b1c" } func (*SwInterfaceIP6ndRaConfig) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceIP6ndRaConfig) GetRetVal() error { + return nil +} func (m *SwInterfaceIP6ndRaConfig) Size() (size int) { if m == nil { @@ -531,6 +561,9 @@ func (*SwInterfaceIP6ndRaConfigReply) GetCrcString() string { return "e8d4e804" func (*SwInterfaceIP6ndRaConfigReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceIP6ndRaConfigReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceIP6ndRaConfigReply) Size() (size int) { if m == nil { @@ -573,6 +606,9 @@ func (*SwInterfaceIP6ndRaPrefix) GetCrcString() string { return "82cc1b28" } func (*SwInterfaceIP6ndRaPrefix) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceIP6ndRaPrefix) GetRetVal() error { + return nil +} func (m *SwInterfaceIP6ndRaPrefix) Size() (size int) { if m == nil { @@ -641,6 +677,9 @@ func (*SwInterfaceIP6ndRaPrefixReply) GetCrcString() string { return "e8d4e804" func (*SwInterfaceIP6ndRaPrefixReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceIP6ndRaPrefixReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceIP6ndRaPrefixReply) Size() (size int) { if m == nil { @@ -675,6 +714,9 @@ func (*WantIP6RaEvents) GetCrcString() string { return "3ec6d6c2" } func (*WantIP6RaEvents) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *WantIP6RaEvents) GetRetVal() error { + return nil +} func (m *WantIP6RaEvents) Size() (size int) { if m == nil { @@ -711,6 +753,9 @@ func (*WantIP6RaEventsReply) GetCrcString() string { return "e8d4e804" } func (*WantIP6RaEventsReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *WantIP6RaEventsReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *WantIP6RaEventsReply) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/ip_neighbor/ip_neighbor.ba.go b/vpplink/binapi/vppapi/ip_neighbor/ip_neighbor.ba.go index 7c659115..6e01faca 100644 --- a/vpplink/binapi/vppapi/ip_neighbor/ip_neighbor.ba.go +++ b/vpplink/binapi/vppapi/ip_neighbor/ip_neighbor.ba.go @@ -146,6 +146,9 @@ func (*IPNeighborAddDel) GetCrcString() string { return "0607c257" } func (*IPNeighborAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPNeighborAddDel) GetRetVal() error { + return nil +} func (m *IPNeighborAddDel) Size() (size int) { if m == nil { @@ -195,6 +198,9 @@ func (*IPNeighborAddDelReply) GetCrcString() string { return "1992deab" } func (*IPNeighborAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPNeighborAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPNeighborAddDelReply) Size() (size int) { if m == nil { @@ -234,6 +240,9 @@ func (*IPNeighborConfig) GetCrcString() string { return "f4a5cf44" } func (*IPNeighborConfig) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPNeighborConfig) GetRetVal() error { + return nil +} func (m *IPNeighborConfig) Size() (size int) { if m == nil { @@ -276,6 +285,9 @@ func (*IPNeighborConfigReply) GetCrcString() string { return "e8d4e804" } func (*IPNeighborConfigReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPNeighborConfigReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPNeighborConfigReply) Size() (size int) { if m == nil { @@ -310,6 +322,9 @@ func (*IPNeighborDetails) GetCrcString() string { return "e29d79f0" } func (*IPNeighborDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPNeighborDetails) GetRetVal() error { + return nil +} func (m *IPNeighborDetails) Size() (size int) { if m == nil { @@ -359,6 +374,9 @@ func (*IPNeighborDump) GetCrcString() string { return "d817a484" } func (*IPNeighborDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPNeighborDump) GetRetVal() error { + return nil +} func (m *IPNeighborDump) Size() (size int) { if m == nil { @@ -397,6 +415,9 @@ func (*IPNeighborEvent) GetCrcString() string { return "bdb092b2" } func (*IPNeighborEvent) GetMessageType() api.MessageType { return api.EventMessage } +func (m *IPNeighborEvent) GetRetVal() error { + return nil +} func (m *IPNeighborEvent) Size() (size int) { if m == nil { @@ -447,6 +468,9 @@ func (*IPNeighborEventV2) GetCrcString() string { return "c1d53dc0" } func (*IPNeighborEventV2) GetMessageType() api.MessageType { return api.EventMessage } +func (m *IPNeighborEventV2) GetRetVal() error { + return nil +} func (m *IPNeighborEventV2) Size() (size int) { if m == nil { @@ -499,6 +523,9 @@ func (*IPNeighborFlush) GetCrcString() string { return "16aa35d2" } func (*IPNeighborFlush) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPNeighborFlush) GetRetVal() error { + return nil +} func (m *IPNeighborFlush) Size() (size int) { if m == nil { @@ -535,6 +562,9 @@ func (*IPNeighborFlushReply) GetCrcString() string { return "e8d4e804" } func (*IPNeighborFlushReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPNeighborFlushReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPNeighborFlushReply) Size() (size int) { if m == nil { @@ -566,6 +596,9 @@ func (*IPNeighborReplaceBegin) GetCrcString() string { return "51077d14" } func (*IPNeighborReplaceBegin) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPNeighborReplaceBegin) GetRetVal() error { + return nil +} func (m *IPNeighborReplaceBegin) Size() (size int) { if m == nil { @@ -595,6 +628,9 @@ func (*IPNeighborReplaceBeginReply) GetCrcString() string { return "e8d4e804" func (*IPNeighborReplaceBeginReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPNeighborReplaceBeginReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPNeighborReplaceBeginReply) Size() (size int) { if m == nil { @@ -626,6 +662,9 @@ func (*IPNeighborReplaceEnd) GetCrcString() string { return "51077d14" } func (*IPNeighborReplaceEnd) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IPNeighborReplaceEnd) GetRetVal() error { + return nil +} func (m *IPNeighborReplaceEnd) Size() (size int) { if m == nil { @@ -655,6 +694,9 @@ func (*IPNeighborReplaceEndReply) GetCrcString() string { return "e8d4e804" } func (*IPNeighborReplaceEndReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IPNeighborReplaceEndReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IPNeighborReplaceEndReply) Size() (size int) { if m == nil { @@ -692,6 +734,9 @@ func (*WantIPNeighborEvents) GetCrcString() string { return "73e70a86" } func (*WantIPNeighborEvents) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *WantIPNeighborEvents) GetRetVal() error { + return nil +} func (m *WantIPNeighborEvents) Size() (size int) { if m == nil { @@ -738,6 +783,9 @@ func (*WantIPNeighborEventsReply) GetCrcString() string { return "e8d4e804" } func (*WantIPNeighborEventsReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *WantIPNeighborEventsReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *WantIPNeighborEventsReply) Size() (size int) { if m == nil { @@ -774,6 +822,9 @@ func (*WantIPNeighborEventsV2) GetCrcString() string { return "73e70a86" } func (*WantIPNeighborEventsV2) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *WantIPNeighborEventsV2) GetRetVal() error { + return nil +} func (m *WantIPNeighborEventsV2) Size() (size int) { if m == nil { @@ -821,6 +872,9 @@ func (*WantIPNeighborEventsV2Reply) GetCrcString() string { return "e8d4e804" } func (*WantIPNeighborEventsV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *WantIPNeighborEventsV2Reply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *WantIPNeighborEventsV2Reply) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/ip_types/ip_types.ba.go b/vpplink/binapi/vppapi/ip_types/ip_types.ba.go index c53785d7..48aa5309 100644 --- a/vpplink/binapi/vppapi/ip_types/ip_types.ba.go +++ b/vpplink/binapi/vppapi/ip_types/ip_types.ba.go @@ -276,12 +276,15 @@ func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) { } return AddressWithPrefix(prefix), nil } + func (x AddressWithPrefix) String() string { return Prefix(x).String() } + func (x *AddressWithPrefix) MarshalText() ([]byte, error) { return []byte(x.String()), nil } + func (x *AddressWithPrefix) UnmarshalText(text []byte) error { prefix, err := ParseAddressWithPrefix(string(text)) if err != nil { @@ -307,12 +310,15 @@ func ParseIP4Address(s string) (IP4Address, error) { func (x IP4Address) ToIP() net.IP { return net.IP(x[:]).To4() } + func (x IP4Address) String() string { return x.ToIP().String() } + func (x *IP4Address) MarshalText() ([]byte, error) { return []byte(x.String()), nil } + func (x *IP4Address) UnmarshalText(text []byte) error { ipaddr, err := ParseIP4Address(string(text)) if err != nil { @@ -341,12 +347,15 @@ func ParseIP6Address(s string) (IP6Address, error) { func (x IP6Address) ToIP() net.IP { return net.IP(x[:]).To16() } + func (x IP6Address) String() string { return x.ToIP().String() } + func (x *IP6Address) MarshalText() ([]byte, error) { return []byte(x.String()), nil } + func (x *IP6Address) UnmarshalText(text []byte) error { ipaddr, err := ParseIP6Address(string(text)) if err != nil { @@ -370,6 +379,10 @@ func ParseAddress(s string) (Address, error) { if ip == nil { return Address{}, fmt.Errorf("invalid address: %s", s) } + return AddressFromIP(ip), nil +} + +func AddressFromIP(ip net.IP) Address { var addr Address if ip.To4() == nil { addr.Af = ADDRESS_IP6 @@ -382,8 +395,9 @@ func ParseAddress(s string) (Address, error) { copy(ip4[:], ip.To4()) addr.Un.SetIP4(ip4) } - return addr, nil + return addr } + func (x Address) ToIP() net.IP { if x.Af == ADDRESS_IP6 { ip6 := x.Un.GetIP6() @@ -393,12 +407,15 @@ func (x Address) ToIP() net.IP { return net.IP(ip4[:]).To4() } } + func (x Address) String() string { return x.ToIP().String() } + func (x *Address) MarshalText() ([]byte, error) { return []byte(x.String()), nil } + func (x *Address) UnmarshalText(text []byte) error { addr, err := ParseAddress(string(text)) if err != nil { @@ -447,18 +464,22 @@ func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) { } return prefix, nil } + func (x IP4Prefix) ToIPNet() *net.IPNet { mask := net.CIDRMask(int(x.Len), 32) ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask} return ipnet } + func (x IP4Prefix) String() string { ip := x.Address.String() return ip + "/" + strconv.Itoa(int(x.Len)) } + func (x *IP4Prefix) MarshalText() ([]byte, error) { return []byte(x.String()), nil } + func (x *IP4Prefix) UnmarshalText(text []byte) error { prefix, err := ParseIP4Prefix(string(text)) if err != nil { @@ -507,18 +528,22 @@ func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) { } return prefix, nil } + func (x IP6Prefix) ToIPNet() *net.IPNet { mask := net.CIDRMask(int(x.Len), 128) ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask} return ipnet } + func (x IP6Prefix) String() string { ip := x.Address.String() return ip + "/" + strconv.Itoa(int(x.Len)) } + func (x *IP6Prefix) MarshalText() ([]byte, error) { return []byte(x.String()), nil } + func (x *IP6Prefix) UnmarshalText(text []byte) error { prefix, err := ParseIP6Prefix(string(text)) if err != nil { @@ -569,6 +594,7 @@ func ParsePrefix(ip string) (prefix Prefix, err error) { } return prefix, nil } + func (x Prefix) ToIPNet() *net.IPNet { var mask net.IPMask if x.Address.Af == ADDRESS_IP4 { @@ -579,13 +605,16 @@ func (x Prefix) ToIPNet() *net.IPNet { ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask} return ipnet } + func (x Prefix) String() string { ip := x.Address.String() return ip + "/" + strconv.Itoa(int(x.Len)) } + func (x *Prefix) MarshalText() ([]byte, error) { return []byte(x.String()), nil } + func (x *Prefix) UnmarshalText(text []byte) error { prefix, err := ParsePrefix(string(text)) if err != nil { diff --git a/vpplink/ipip.go b/vpplink/binapi/vppapi/ipip.go similarity index 58% rename from vpplink/ipip.go rename to vpplink/binapi/vppapi/ipip.go index 2acdd9eb..24b786eb 100644 --- a/vpplink/ipip.go +++ b/vpplink/binapi/vppapi/ipip.go @@ -13,26 +13,25 @@ // See the License for the specific language governing permissions and // limitations under the License. -package vpplink +package vppapi import ( - "fmt" - + types "git.fd.io/govpp.git/api/v0" "github.com/pkg/errors" "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/interface_types" + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/ip_types" "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/ipip" - "github.com/projectcalico/vpp-dataplane/vpplink/types" ) -func (v *VppLink) ListIPIPTunnels() ([]*types.IPIPTunnel, error) { - v.lock.Lock() - defer v.lock.Unlock() +func (v *Vpp) ListIPIPTunnels() ([]*types.IPIPTunnel, error) { + v.Lock() + defer v.Unlock() tunnels := make([]*types.IPIPTunnel, 0) request := &ipip.IpipTunnelDump{ - SwIfIndex: types.InvalidInterface, + SwIfIndex: interface_types.InterfaceIndex(types.InvalidInterface), } - stream := v.ch.SendMultiRequest(request) + stream := v.GetChannel().SendMultiRequest(request) for { response := &ipip.IpipTunnelDetails{} stop, err := stream.ReceiveReply(response) @@ -43,8 +42,8 @@ func (v *VppLink) ListIPIPTunnels() ([]*types.IPIPTunnel, error) { break } tunnels = append(tunnels, &types.IPIPTunnel{ - Src: types.FromVppAddress(response.Tunnel.Src), - Dst: types.FromVppAddress(response.Tunnel.Dst), + Src: response.Tunnel.Src.ToIP(), + Dst: response.Tunnel.Dst.ToIP(), TableID: response.Tunnel.TableID, SwIfIndex: uint32(response.Tunnel.SwIfIndex), }) @@ -52,42 +51,32 @@ func (v *VppLink) ListIPIPTunnels() ([]*types.IPIPTunnel, error) { return tunnels, nil } -func (v *VppLink) AddIPIPTunnel(tunnel *types.IPIPTunnel) (uint32, error) { - v.lock.Lock() - defer v.lock.Unlock() - +func (v *Vpp) AddIPIPTunnel(tunnel *types.IPIPTunnel) (uint32, error) { response := &ipip.IpipAddTunnelReply{} request := &ipip.IpipAddTunnel{ Tunnel: ipip.IpipTunnel{ Instance: ^uint32(0), - Src: types.ToVppAddress(tunnel.Src), - Dst: types.ToVppAddress(tunnel.Dst), + Src: ip_types.AddressFromIP(tunnel.Src), + Dst: ip_types.AddressFromIP(tunnel.Dst), TableID: tunnel.TableID, }, } - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.SendRequestAwaitReply(request, response) if err != nil { - return ^uint32(1), errors.Wrap(err, "Add IPIP Tunnel failed") - } else if response.Retval != 0 { - return ^uint32(1), fmt.Errorf("Add IPIP Tunnel failed with retval %d", response.Retval) + return InvalidSwIfIndex, err } tunnel.SwIfIndex = uint32(response.SwIfIndex) return uint32(response.SwIfIndex), nil } -func (v *VppLink) DelIPIPTunnel(tunnel *types.IPIPTunnel) (err error) { - v.lock.Lock() - defer v.lock.Unlock() - +func (v *Vpp) DelIPIPTunnel(tunnel *types.IPIPTunnel) (err error) { response := &ipip.IpipDelTunnelReply{} request := &ipip.IpipDelTunnel{ SwIfIndex: interface_types.InterfaceIndex(tunnel.SwIfIndex), } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.SendRequestAwaitReply(request, response) if err != nil { - return errors.Wrapf(err, "Del IPIP Tunnel %s failed", tunnel.String()) - } else if response.Retval != 0 { - return fmt.Errorf("Del IPIP Tunnel %s failed with retval %d", tunnel.String(), response.Retval) + return err } return nil } diff --git a/vpplink/binapi/vppapi/ipip/ipip.ba.go b/vpplink/binapi/vppapi/ipip/ipip.ba.go index b693d208..44b86bb5 100644 --- a/vpplink/binapi/vppapi/ipip/ipip.ba.go +++ b/vpplink/binapi/vppapi/ipip/ipip.ba.go @@ -57,6 +57,9 @@ func (*Ipip6rdAddTunnel) GetCrcString() string { return "b9ec1863" } func (*Ipip6rdAddTunnel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ipip6rdAddTunnel) GetRetVal() error { + return nil +} func (m *Ipip6rdAddTunnel) Size() (size int) { if m == nil { @@ -115,6 +118,9 @@ func (*Ipip6rdAddTunnelReply) GetCrcString() string { return "5383d31f" } func (*Ipip6rdAddTunnelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ipip6rdAddTunnelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ipip6rdAddTunnelReply) Size() (size int) { if m == nil { @@ -151,6 +157,9 @@ func (*Ipip6rdDelTunnel) GetCrcString() string { return "f9e6675e" } func (*Ipip6rdDelTunnel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Ipip6rdDelTunnel) GetRetVal() error { + return nil +} func (m *Ipip6rdDelTunnel) Size() (size int) { if m == nil { @@ -184,6 +193,9 @@ func (*Ipip6rdDelTunnelReply) GetCrcString() string { return "e8d4e804" } func (*Ipip6rdDelTunnelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Ipip6rdDelTunnelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Ipip6rdDelTunnelReply) Size() (size int) { if m == nil { @@ -217,6 +229,9 @@ func (*IpipAddTunnel) GetCrcString() string { return "2ac399f5" } func (*IpipAddTunnel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpipAddTunnel) GetRetVal() error { + return nil +} func (m *IpipAddTunnel) Size() (size int) { if m == nil { @@ -278,6 +293,9 @@ func (*IpipAddTunnelReply) GetCrcString() string { return "5383d31f" } func (*IpipAddTunnelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpipAddTunnelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IpipAddTunnelReply) Size() (size int) { if m == nil { @@ -314,6 +332,9 @@ func (*IpipDelTunnel) GetCrcString() string { return "f9e6675e" } func (*IpipDelTunnel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpipDelTunnel) GetRetVal() error { + return nil +} func (m *IpipDelTunnel) Size() (size int) { if m == nil { @@ -347,6 +368,9 @@ func (*IpipDelTunnelReply) GetCrcString() string { return "e8d4e804" } func (*IpipDelTunnelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpipDelTunnelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IpipDelTunnelReply) Size() (size int) { if m == nil { @@ -380,6 +404,9 @@ func (*IpipTunnelDetails) GetCrcString() string { return "d31cb34e" } func (*IpipTunnelDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpipTunnelDetails) GetRetVal() error { + return nil +} func (m *IpipTunnelDetails) Size() (size int) { if m == nil { @@ -440,6 +467,9 @@ func (*IpipTunnelDump) GetCrcString() string { return "f9e6675e" } func (*IpipTunnelDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpipTunnelDump) GetRetVal() error { + return nil +} func (m *IpipTunnelDump) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/ipsec/ipsec.ba.go b/vpplink/binapi/vppapi/ipsec/ipsec.ba.go index d596d7e0..a6604806 100644 --- a/vpplink/binapi/vppapi/ipsec/ipsec.ba.go +++ b/vpplink/binapi/vppapi/ipsec/ipsec.ba.go @@ -113,6 +113,9 @@ func (*IpsecBackendDetails) GetCrcString() string { return "ee601c29" } func (*IpsecBackendDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpsecBackendDetails) GetRetVal() error { + return nil +} func (m *IpsecBackendDetails) Size() (size int) { if m == nil { @@ -153,6 +156,9 @@ func (*IpsecBackendDump) GetCrcString() string { return "51077d14" } func (*IpsecBackendDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpsecBackendDump) GetRetVal() error { + return nil +} func (m *IpsecBackendDump) Size() (size int) { if m == nil { @@ -184,6 +190,9 @@ func (*IpsecInterfaceAddDelSpd) GetCrcString() string { return "80f80cbb" } func (*IpsecInterfaceAddDelSpd) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpsecInterfaceAddDelSpd) GetRetVal() error { + return nil +} func (m *IpsecInterfaceAddDelSpd) Size() (size int) { if m == nil { @@ -225,6 +234,9 @@ func (*IpsecInterfaceAddDelSpdReply) GetCrcString() string { return "e8d4e804" } func (*IpsecInterfaceAddDelSpdReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpsecInterfaceAddDelSpdReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IpsecInterfaceAddDelSpdReply) Size() (size int) { if m == nil { @@ -258,6 +270,9 @@ func (*IpsecItfCreate) GetCrcString() string { return "6f50b3bc" } func (*IpsecItfCreate) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpsecItfCreate) GetRetVal() error { + return nil +} func (m *IpsecItfCreate) Size() (size int) { if m == nil { @@ -298,6 +313,9 @@ func (*IpsecItfCreateReply) GetCrcString() string { return "5383d31f" } func (*IpsecItfCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpsecItfCreateReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IpsecItfCreateReply) Size() (size int) { if m == nil { @@ -334,6 +352,9 @@ func (*IpsecItfDelete) GetCrcString() string { return "f9e6675e" } func (*IpsecItfDelete) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpsecItfDelete) GetRetVal() error { + return nil +} func (m *IpsecItfDelete) Size() (size int) { if m == nil { @@ -367,6 +388,9 @@ func (*IpsecItfDeleteReply) GetCrcString() string { return "e8d4e804" } func (*IpsecItfDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpsecItfDeleteReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IpsecItfDeleteReply) Size() (size int) { if m == nil { @@ -400,6 +424,9 @@ func (*IpsecItfDetails) GetCrcString() string { return "548a73b8" } func (*IpsecItfDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpsecItfDetails) GetRetVal() error { + return nil +} func (m *IpsecItfDetails) Size() (size int) { if m == nil { @@ -439,6 +466,9 @@ func (*IpsecItfDump) GetCrcString() string { return "f9e6675e" } func (*IpsecItfDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpsecItfDump) GetRetVal() error { + return nil +} func (m *IpsecItfDump) Size() (size int) { if m == nil { @@ -479,6 +509,9 @@ func (*IpsecSaDetails) GetCrcString() string { return "345d14a7" } func (*IpsecSaDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpsecSaDetails) GetRetVal() error { + return nil +} func (m *IpsecSaDetails) Size() (size int) { if m == nil { @@ -584,6 +617,9 @@ func (*IpsecSaDump) GetCrcString() string { return "2076c2f4" } func (*IpsecSaDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpsecSaDump) GetRetVal() error { + return nil +} func (m *IpsecSaDump) Size() (size int) { if m == nil { @@ -623,6 +659,9 @@ func (*IpsecSaV2Details) GetCrcString() string { return "e2130051" } func (*IpsecSaV2Details) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpsecSaV2Details) GetRetVal() error { + return nil +} func (m *IpsecSaV2Details) Size() (size int) { if m == nil { @@ -733,6 +772,9 @@ func (*IpsecSaV2Dump) GetCrcString() string { return "2076c2f4" } func (*IpsecSaV2Dump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpsecSaV2Dump) GetRetVal() error { + return nil +} func (m *IpsecSaV2Dump) Size() (size int) { if m == nil { @@ -771,6 +813,9 @@ func (*IpsecSaV3Details) GetCrcString() string { return "2fc991ee" } func (*IpsecSaV3Details) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpsecSaV3Details) GetRetVal() error { + return nil +} func (m *IpsecSaV3Details) Size() (size int) { if m == nil { @@ -893,6 +938,9 @@ func (*IpsecSaV3Dump) GetCrcString() string { return "2076c2f4" } func (*IpsecSaV3Dump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpsecSaV3Dump) GetRetVal() error { + return nil +} func (m *IpsecSaV3Dump) Size() (size int) { if m == nil { @@ -926,6 +974,9 @@ func (*IpsecSadEntryAdd) GetCrcString() string { return "50229353" } func (*IpsecSadEntryAdd) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpsecSadEntryAdd) GetRetVal() error { + return nil +} func (m *IpsecSadEntryAdd) Size() (size int) { if m == nil { @@ -1035,6 +1086,9 @@ func (*IpsecSadEntryAddDel) GetCrcString() string { return "ab64b5c6" } func (*IpsecSadEntryAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpsecSadEntryAddDel) GetRetVal() error { + return nil +} func (m *IpsecSadEntryAddDel) Size() (size int) { if m == nil { @@ -1126,6 +1180,9 @@ func (*IpsecSadEntryAddDelReply) GetCrcString() string { return "9ffac24b" } func (*IpsecSadEntryAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpsecSadEntryAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IpsecSadEntryAddDelReply) Size() (size int) { if m == nil { @@ -1163,6 +1220,9 @@ func (*IpsecSadEntryAddDelV2) GetCrcString() string { return "aca78b27" } func (*IpsecSadEntryAddDelV2) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpsecSadEntryAddDelV2) GetRetVal() error { + return nil +} func (m *IpsecSadEntryAddDelV2) Size() (size int) { if m == nil { @@ -1259,6 +1319,9 @@ func (*IpsecSadEntryAddDelV2Reply) GetCrcString() string { return "9ffac24b" } func (*IpsecSadEntryAddDelV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpsecSadEntryAddDelV2Reply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IpsecSadEntryAddDelV2Reply) Size() (size int) { if m == nil { @@ -1296,6 +1359,9 @@ func (*IpsecSadEntryAddDelV3) GetCrcString() string { return "c77ebd92" } func (*IpsecSadEntryAddDelV3) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpsecSadEntryAddDelV3) GetRetVal() error { + return nil +} func (m *IpsecSadEntryAddDelV3) Size() (size int) { if m == nil { @@ -1407,6 +1473,9 @@ func (*IpsecSadEntryAddDelV3Reply) GetCrcString() string { return "9ffac24b" } func (*IpsecSadEntryAddDelV3Reply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpsecSadEntryAddDelV3Reply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IpsecSadEntryAddDelV3Reply) Size() (size int) { if m == nil { @@ -1444,6 +1513,9 @@ func (*IpsecSadEntryAddReply) GetCrcString() string { return "9ffac24b" } func (*IpsecSadEntryAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpsecSadEntryAddReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IpsecSadEntryAddReply) Size() (size int) { if m == nil { @@ -1480,6 +1552,9 @@ func (*IpsecSadEntryDel) GetCrcString() string { return "3a91bde5" } func (*IpsecSadEntryDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpsecSadEntryDel) GetRetVal() error { + return nil +} func (m *IpsecSadEntryDel) Size() (size int) { if m == nil { @@ -1513,6 +1588,9 @@ func (*IpsecSadEntryDelReply) GetCrcString() string { return "e8d4e804" } func (*IpsecSadEntryDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpsecSadEntryDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IpsecSadEntryDelReply) Size() (size int) { if m == nil { @@ -1547,6 +1625,9 @@ func (*IpsecSelectBackend) GetCrcString() string { return "5bcfd3b7" } func (*IpsecSelectBackend) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpsecSelectBackend) GetRetVal() error { + return nil +} func (m *IpsecSelectBackend) Size() (size int) { if m == nil { @@ -1583,6 +1664,9 @@ func (*IpsecSelectBackendReply) GetCrcString() string { return "e8d4e804" } func (*IpsecSelectBackendReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpsecSelectBackendReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IpsecSelectBackendReply) Size() (size int) { if m == nil { @@ -1616,6 +1700,9 @@ func (*IpsecSetAsyncMode) GetCrcString() string { return "a6465f7c" } func (*IpsecSetAsyncMode) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpsecSetAsyncMode) GetRetVal() error { + return nil +} func (m *IpsecSetAsyncMode) Size() (size int) { if m == nil { @@ -1649,6 +1736,9 @@ func (*IpsecSetAsyncModeReply) GetCrcString() string { return "e8d4e804" } func (*IpsecSetAsyncModeReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpsecSetAsyncModeReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IpsecSetAsyncModeReply) Size() (size int) { if m == nil { @@ -1683,6 +1773,9 @@ func (*IpsecSpdAddDel) GetCrcString() string { return "20e89a95" } func (*IpsecSpdAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpsecSpdAddDel) GetRetVal() error { + return nil +} func (m *IpsecSpdAddDel) Size() (size int) { if m == nil { @@ -1719,6 +1812,9 @@ func (*IpsecSpdAddDelReply) GetCrcString() string { return "e8d4e804" } func (*IpsecSpdAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpsecSpdAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IpsecSpdAddDelReply) Size() (size int) { if m == nil { @@ -1752,6 +1848,9 @@ func (*IpsecSpdDetails) GetCrcString() string { return "5813d7a2" } func (*IpsecSpdDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpsecSpdDetails) GetRetVal() error { + return nil +} func (m *IpsecSpdDetails) Size() (size int) { if m == nil { @@ -1837,6 +1936,9 @@ func (*IpsecSpdDump) GetCrcString() string { return "afefbf7d" } func (*IpsecSpdDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpsecSpdDump) GetRetVal() error { + return nil +} func (m *IpsecSpdDump) Size() (size int) { if m == nil { @@ -1874,6 +1976,9 @@ func (*IpsecSpdEntryAddDel) GetCrcString() string { return "338b7411" } func (*IpsecSpdEntryAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpsecSpdEntryAddDel) GetRetVal() error { + return nil +} func (m *IpsecSpdEntryAddDel) Size() (size int) { if m == nil { @@ -1962,6 +2067,9 @@ func (*IpsecSpdEntryAddDelReply) GetCrcString() string { return "9ffac24b" } func (*IpsecSpdEntryAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpsecSpdEntryAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IpsecSpdEntryAddDelReply) Size() (size int) { if m == nil { @@ -1999,6 +2107,9 @@ func (*IpsecSpdInterfaceDetails) GetCrcString() string { return "7a0bcf3e" } func (*IpsecSpdInterfaceDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpsecSpdInterfaceDetails) GetRetVal() error { + return nil +} func (m *IpsecSpdInterfaceDetails) Size() (size int) { if m == nil { @@ -2036,6 +2147,9 @@ func (*IpsecSpdInterfaceDump) GetCrcString() string { return "8971de19" } func (*IpsecSpdInterfaceDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpsecSpdInterfaceDump) GetRetVal() error { + return nil +} func (m *IpsecSpdInterfaceDump) Size() (size int) { if m == nil { @@ -2073,6 +2187,9 @@ func (*IpsecSpdsDetails) GetCrcString() string { return "a04bb254" } func (*IpsecSpdsDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpsecSpdsDetails) GetRetVal() error { + return nil +} func (m *IpsecSpdsDetails) Size() (size int) { if m == nil { @@ -2107,6 +2224,9 @@ func (*IpsecSpdsDump) GetCrcString() string { return "51077d14" } func (*IpsecSpdsDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpsecSpdsDump) GetRetVal() error { + return nil +} func (m *IpsecSpdsDump) Size() (size int) { if m == nil { @@ -2137,6 +2257,9 @@ func (*IpsecTunnelProtectDel) GetCrcString() string { return "cd239930" } func (*IpsecTunnelProtectDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpsecTunnelProtectDel) GetRetVal() error { + return nil +} func (m *IpsecTunnelProtectDel) Size() (size int) { if m == nil { @@ -2176,6 +2299,9 @@ func (*IpsecTunnelProtectDelReply) GetCrcString() string { return "e8d4e804" } func (*IpsecTunnelProtectDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpsecTunnelProtectDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IpsecTunnelProtectDelReply) Size() (size int) { if m == nil { @@ -2209,6 +2335,9 @@ func (*IpsecTunnelProtectDetails) GetCrcString() string { return "21663a50" } func (*IpsecTunnelProtectDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpsecTunnelProtectDetails) GetRetVal() error { + return nil +} func (m *IpsecTunnelProtectDetails) Size() (size int) { if m == nil { @@ -2266,6 +2395,9 @@ func (*IpsecTunnelProtectDump) GetCrcString() string { return "f9e6675e" } func (*IpsecTunnelProtectDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpsecTunnelProtectDump) GetRetVal() error { + return nil +} func (m *IpsecTunnelProtectDump) Size() (size int) { if m == nil { @@ -2299,6 +2431,9 @@ func (*IpsecTunnelProtectUpdate) GetCrcString() string { return "30d5f133" } func (*IpsecTunnelProtectUpdate) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *IpsecTunnelProtectUpdate) GetRetVal() error { + return nil +} func (m *IpsecTunnelProtectUpdate) Size() (size int) { if m == nil { @@ -2358,6 +2493,9 @@ func (*IpsecTunnelProtectUpdateReply) GetCrcString() string { return "e8d4e804" func (*IpsecTunnelProtectUpdateReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *IpsecTunnelProtectUpdateReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *IpsecTunnelProtectUpdateReply) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/memclnt/memclnt.ba.go b/vpplink/binapi/vppapi/memclnt/memclnt.ba.go index 94638bfb..21ce8358 100644 --- a/vpplink/binapi/vppapi/memclnt/memclnt.ba.go +++ b/vpplink/binapi/vppapi/memclnt/memclnt.ba.go @@ -48,6 +48,9 @@ func (*APIVersions) GetCrcString() string { return "51077d14" } func (*APIVersions) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *APIVersions) GetRetVal() error { + return nil +} func (m *APIVersions) Size() (size int) { if m == nil { @@ -79,6 +82,9 @@ func (*APIVersionsReply) GetCrcString() string { return "5f0d99d6" } func (*APIVersionsReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *APIVersionsReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *APIVersionsReply) Size() (size int) { if m == nil { @@ -141,6 +147,9 @@ func (*ControlPing) GetCrcString() string { return "51077d14" } func (*ControlPing) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ControlPing) GetRetVal() error { + return nil +} func (m *ControlPing) Size() (size int) { if m == nil { @@ -172,6 +181,9 @@ func (*ControlPingReply) GetCrcString() string { return "f6b0b8ca" } func (*ControlPingReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ControlPingReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *ControlPingReply) Size() (size int) { if m == nil { @@ -211,6 +223,9 @@ func (*GetFirstMsgID) GetCrcString() string { return "ebf79a66" } func (*GetFirstMsgID) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *GetFirstMsgID) GetRetVal() error { + return nil +} func (m *GetFirstMsgID) Size() (size int) { if m == nil { @@ -245,6 +260,9 @@ func (*GetFirstMsgIDReply) GetCrcString() string { return "7d337472" } func (*GetFirstMsgIDReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *GetFirstMsgIDReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *GetFirstMsgIDReply) Size() (size int) { if m == nil { @@ -284,6 +302,9 @@ func (*MemclntCreate) GetCrcString() string { return "9c5e1c2f" } func (*MemclntCreate) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *MemclntCreate) GetRetVal() error { + return nil +} func (m *MemclntCreate) Size() (size int) { if m == nil { @@ -338,6 +359,9 @@ func (*MemclntCreateReply) GetCrcString() string { return "42ec4560" } func (*MemclntCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *MemclntCreateReply) GetRetVal() error { + return nil +} func (m *MemclntCreateReply) Size() (size int) { if m == nil { @@ -382,6 +406,9 @@ func (*MemclntDelete) GetCrcString() string { return "7e1c04e3" } func (*MemclntDelete) GetMessageType() api.MessageType { return api.OtherMessage } +func (m *MemclntDelete) GetRetVal() error { + return nil +} func (m *MemclntDelete) Size() (size int) { if m == nil { @@ -422,6 +449,9 @@ func (*MemclntDeleteReply) GetCrcString() string { return "3d3b6312" } func (*MemclntDeleteReply) GetMessageType() api.MessageType { return api.OtherMessage } +func (m *MemclntDeleteReply) GetRetVal() error { + return nil +} func (m *MemclntDeleteReply) Size() (size int) { if m == nil { @@ -456,6 +486,9 @@ func (*MemclntKeepalive) GetCrcString() string { return "51077d14" } func (*MemclntKeepalive) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *MemclntKeepalive) GetRetVal() error { + return nil +} func (m *MemclntKeepalive) Size() (size int) { if m == nil { @@ -485,6 +518,9 @@ func (*MemclntKeepaliveReply) GetCrcString() string { return "e8d4e804" } func (*MemclntKeepaliveReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *MemclntKeepaliveReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *MemclntKeepaliveReply) Size() (size int) { if m == nil { @@ -518,6 +554,9 @@ func (*MemclntReadTimeout) GetCrcString() string { return "c3a3a452" } func (*MemclntReadTimeout) GetMessageType() api.MessageType { return api.OtherMessage } +func (m *MemclntReadTimeout) GetRetVal() error { + return nil +} func (m *MemclntReadTimeout) Size() (size int) { if m == nil { @@ -551,6 +590,9 @@ func (*MemclntRxThreadSuspend) GetCrcString() string { return "c3a3a452" } func (*MemclntRxThreadSuspend) GetMessageType() api.MessageType { return api.OtherMessage } +func (m *MemclntRxThreadSuspend) GetRetVal() error { + return nil +} func (m *MemclntRxThreadSuspend) Size() (size int) { if m == nil { @@ -589,6 +631,9 @@ func (*RPCCall) GetCrcString() string { return "7e8a2c95" } func (*RPCCall) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *RPCCall) GetRetVal() error { + return nil +} func (m *RPCCall) Size() (size int) { if m == nil { @@ -638,6 +683,9 @@ func (*RPCCallReply) GetCrcString() string { return "e8d4e804" } func (*RPCCallReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *RPCCallReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *RPCCallReply) Size() (size int) { if m == nil { @@ -671,6 +719,9 @@ func (*RxThreadExit) GetCrcString() string { return "c3a3a452" } func (*RxThreadExit) GetMessageType() api.MessageType { return api.OtherMessage } +func (m *RxThreadExit) GetRetVal() error { + return nil +} func (m *RxThreadExit) Size() (size int) { if m == nil { @@ -706,6 +757,9 @@ func (*SockInitShm) GetCrcString() string { return "51646d92" } func (*SockInitShm) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SockInitShm) GetRetVal() error { + return nil +} func (m *SockInitShm) Size() (size int) { if m == nil { @@ -754,6 +808,9 @@ func (*SockInitShmReply) GetCrcString() string { return "e8d4e804" } func (*SockInitShmReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SockInitShmReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SockInitShmReply) Size() (size int) { if m == nil { @@ -787,6 +844,9 @@ func (*SockclntCreate) GetCrcString() string { return "455fb9c4" } func (*SockclntCreate) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SockclntCreate) GetRetVal() error { + return nil +} func (m *SockclntCreate) Size() (size int) { if m == nil { @@ -823,6 +883,9 @@ func (*SockclntCreateReply) GetCrcString() string { return "35166268" } func (*SockclntCreateReply) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SockclntCreateReply) GetRetVal() error { + return nil +} func (m *SockclntCreateReply) Size() (size int) { if m == nil { @@ -884,6 +947,9 @@ func (*SockclntDelete) GetCrcString() string { return "8ac76db6" } func (*SockclntDelete) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SockclntDelete) GetRetVal() error { + return nil +} func (m *SockclntDelete) Size() (size int) { if m == nil { @@ -917,6 +983,9 @@ func (*SockclntDeleteReply) GetCrcString() string { return "8f38b1ee" } func (*SockclntDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SockclntDeleteReply) GetRetVal() error { + return nil +} func (m *SockclntDeleteReply) Size() (size int) { if m == nil { @@ -952,6 +1021,9 @@ func (*TracePluginMsgIds) GetCrcString() string { return "f476d3ce" } func (*TracePluginMsgIds) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *TracePluginMsgIds) GetRetVal() error { + return nil +} func (m *TracePluginMsgIds) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/memif/memif.ba.go b/vpplink/binapi/vppapi/memif/memif.ba.go index 5af63194..6df262a2 100644 --- a/vpplink/binapi/vppapi/memif/memif.ba.go +++ b/vpplink/binapi/vppapi/memif/memif.ba.go @@ -107,6 +107,9 @@ func (*MemifCreate) GetCrcString() string { return "b1b25061" } func (*MemifCreate) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *MemifCreate) GetRetVal() error { + return nil +} func (m *MemifCreate) Size() (size int) { if m == nil { @@ -171,6 +174,9 @@ func (*MemifCreateReply) GetCrcString() string { return "5383d31f" } func (*MemifCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *MemifCreateReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *MemifCreateReply) Size() (size int) { if m == nil { @@ -207,6 +213,9 @@ func (*MemifDelete) GetCrcString() string { return "f9e6675e" } func (*MemifDelete) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *MemifDelete) GetRetVal() error { + return nil +} func (m *MemifDelete) Size() (size int) { if m == nil { @@ -240,6 +249,9 @@ func (*MemifDeleteReply) GetCrcString() string { return "e8d4e804" } func (*MemifDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *MemifDeleteReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *MemifDeleteReply) Size() (size int) { if m == nil { @@ -283,6 +295,9 @@ func (*MemifDetails) GetCrcString() string { return "da34feb9" } func (*MemifDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *MemifDetails) GetRetVal() error { + return nil +} func (m *MemifDetails) Size() (size int) { if m == nil { @@ -344,6 +359,9 @@ func (*MemifDump) GetCrcString() string { return "51077d14" } func (*MemifDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *MemifDump) GetRetVal() error { + return nil +} func (m *MemifDump) Size() (size int) { if m == nil { @@ -375,6 +393,9 @@ func (*MemifSocketFilenameAddDel) GetCrcString() string { return "a2ce1a10" } func (*MemifSocketFilenameAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *MemifSocketFilenameAddDel) GetRetVal() error { + return nil +} func (m *MemifSocketFilenameAddDel) Size() (size int) { if m == nil { @@ -416,6 +437,9 @@ func (*MemifSocketFilenameAddDelReply) GetCrcString() string { return "e8d4e804" func (*MemifSocketFilenameAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *MemifSocketFilenameAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *MemifSocketFilenameAddDelReply) Size() (size int) { if m == nil { @@ -453,6 +477,9 @@ func (*MemifSocketFilenameAddDelV2) GetCrcString() string { return "34223bdf" } func (*MemifSocketFilenameAddDelV2) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *MemifSocketFilenameAddDelV2) GetRetVal() error { + return nil +} func (m *MemifSocketFilenameAddDelV2) Size() (size int) { if m == nil { @@ -495,6 +522,9 @@ func (*MemifSocketFilenameAddDelV2Reply) GetCrcString() string { return "9f29bdb func (*MemifSocketFilenameAddDelV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *MemifSocketFilenameAddDelV2Reply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *MemifSocketFilenameAddDelV2Reply) Size() (size int) { if m == nil { @@ -532,6 +562,9 @@ func (*MemifSocketFilenameDetails) GetCrcString() string { return "7ff326f7" } func (*MemifSocketFilenameDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *MemifSocketFilenameDetails) GetRetVal() error { + return nil +} func (m *MemifSocketFilenameDetails) Size() (size int) { if m == nil { @@ -566,6 +599,9 @@ func (*MemifSocketFilenameDump) GetCrcString() string { return "51077d14" } func (*MemifSocketFilenameDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *MemifSocketFilenameDump) GetRetVal() error { + return nil +} func (m *MemifSocketFilenameDump) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/nat44_ed/nat44_ed.ba.go b/vpplink/binapi/vppapi/nat44_ed/nat44_ed.ba.go index 3801e017..6f30a0e1 100644 --- a/vpplink/binapi/vppapi/nat44_ed/nat44_ed.ba.go +++ b/vpplink/binapi/vppapi/nat44_ed/nat44_ed.ba.go @@ -109,6 +109,9 @@ func (*Nat44AddDelAddressRange) GetCrcString() string { return "6f2b8055" } func (*Nat44AddDelAddressRange) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44AddDelAddressRange) GetRetVal() error { + return nil +} func (m *Nat44AddDelAddressRange) Size() (size int) { if m == nil { @@ -156,6 +159,9 @@ func (*Nat44AddDelAddressRangeReply) GetCrcString() string { return "e8d4e804" } func (*Nat44AddDelAddressRangeReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44AddDelAddressRangeReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Nat44AddDelAddressRangeReply) Size() (size int) { if m == nil { @@ -196,6 +202,9 @@ func (*Nat44AddDelIdentityMapping) GetCrcString() string { return "02faaa22" } func (*Nat44AddDelIdentityMapping) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44AddDelIdentityMapping) GetRetVal() error { + return nil +} func (m *Nat44AddDelIdentityMapping) Size() (size int) { if m == nil { @@ -252,6 +261,9 @@ func (*Nat44AddDelIdentityMappingReply) GetCrcString() string { return "e8d4e804 func (*Nat44AddDelIdentityMappingReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44AddDelIdentityMappingReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Nat44AddDelIdentityMappingReply) Size() (size int) { if m == nil { @@ -287,6 +299,9 @@ func (*Nat44AddDelInterfaceAddr) GetCrcString() string { return "4aed50c0" } func (*Nat44AddDelInterfaceAddr) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44AddDelInterfaceAddr) GetRetVal() error { + return nil +} func (m *Nat44AddDelInterfaceAddr) Size() (size int) { if m == nil { @@ -328,6 +343,9 @@ func (*Nat44AddDelInterfaceAddrReply) GetCrcString() string { return "e8d4e804" func (*Nat44AddDelInterfaceAddrReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44AddDelInterfaceAddrReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Nat44AddDelInterfaceAddrReply) Size() (size int) { if m == nil { @@ -369,6 +387,9 @@ func (*Nat44AddDelLbStaticMapping) GetCrcString() string { return "4f68ee9d" } func (*Nat44AddDelLbStaticMapping) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44AddDelLbStaticMapping) GetRetVal() error { + return nil +} func (m *Nat44AddDelLbStaticMapping) Size() (size int) { if m == nil { @@ -453,6 +474,9 @@ func (*Nat44AddDelLbStaticMappingReply) GetCrcString() string { return "e8d4e804 func (*Nat44AddDelLbStaticMappingReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44AddDelLbStaticMappingReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Nat44AddDelLbStaticMappingReply) Size() (size int) { if m == nil { @@ -495,6 +519,9 @@ func (*Nat44AddDelStaticMapping) GetCrcString() string { return "5ae5f03e" } func (*Nat44AddDelStaticMapping) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44AddDelStaticMapping) GetRetVal() error { + return nil +} func (m *Nat44AddDelStaticMapping) Size() (size int) { if m == nil { @@ -557,6 +584,9 @@ func (*Nat44AddDelStaticMappingReply) GetCrcString() string { return "e8d4e804" func (*Nat44AddDelStaticMappingReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44AddDelStaticMappingReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Nat44AddDelStaticMappingReply) Size() (size int) { if m == nil { @@ -602,6 +632,9 @@ func (*Nat44AddDelStaticMappingV2) GetCrcString() string { return "5e205f1a" } func (*Nat44AddDelStaticMappingV2) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44AddDelStaticMappingV2) GetRetVal() error { + return nil +} func (m *Nat44AddDelStaticMappingV2) Size() (size int) { if m == nil { @@ -671,6 +704,9 @@ func (*Nat44AddDelStaticMappingV2Reply) GetCrcString() string { return "e8d4e804 func (*Nat44AddDelStaticMappingV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44AddDelStaticMappingV2Reply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Nat44AddDelStaticMappingV2Reply) Size() (size int) { if m == nil { @@ -706,6 +742,9 @@ func (*Nat44AddressDetails) GetCrcString() string { return "0d1beac1" } func (*Nat44AddressDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44AddressDetails) GetRetVal() error { + return nil +} func (m *Nat44AddressDetails) Size() (size int) { if m == nil { @@ -743,6 +782,9 @@ func (*Nat44AddressDump) GetCrcString() string { return "51077d14" } func (*Nat44AddressDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44AddressDump) GetRetVal() error { + return nil +} func (m *Nat44AddressDump) Size() (size int) { if m == nil { @@ -778,6 +820,9 @@ func (*Nat44DelSession) GetCrcString() string { return "15a5bf8c" } func (*Nat44DelSession) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44DelSession) GetRetVal() error { + return nil +} func (m *Nat44DelSession) Size() (size int) { if m == nil { @@ -829,6 +874,9 @@ func (*Nat44DelSessionReply) GetCrcString() string { return "e8d4e804" } func (*Nat44DelSessionReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44DelSessionReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Nat44DelSessionReply) Size() (size int) { if m == nil { @@ -863,6 +911,9 @@ func (*Nat44DelUser) GetCrcString() string { return "99a9f998" } func (*Nat44DelUser) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44DelUser) GetRetVal() error { + return nil +} func (m *Nat44DelUser) Size() (size int) { if m == nil { @@ -899,6 +950,9 @@ func (*Nat44DelUserReply) GetCrcString() string { return "e8d4e804" } func (*Nat44DelUserReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44DelUserReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Nat44DelUserReply) Size() (size int) { if m == nil { @@ -935,6 +989,9 @@ func (*Nat44EdAddDelOutputInterface) GetCrcString() string { return "47d6e753" } func (*Nat44EdAddDelOutputInterface) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44EdAddDelOutputInterface) GetRetVal() error { + return nil +} func (m *Nat44EdAddDelOutputInterface) Size() (size int) { if m == nil { @@ -973,6 +1030,9 @@ func (*Nat44EdAddDelOutputInterfaceReply) GetCrcString() string { return "e8d4e8 func (*Nat44EdAddDelOutputInterfaceReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44EdAddDelOutputInterfaceReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Nat44EdAddDelOutputInterfaceReply) Size() (size int) { if m == nil { @@ -1008,6 +1068,9 @@ func (*Nat44EdOutputInterfaceDetails) GetCrcString() string { return "0b45011c" func (*Nat44EdOutputInterfaceDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44EdOutputInterfaceDetails) GetRetVal() error { + return nil +} func (m *Nat44EdOutputInterfaceDetails) Size() (size int) { if m == nil { @@ -1041,6 +1104,9 @@ func (*Nat44EdOutputInterfaceGet) GetCrcString() string { return "f75ba505" } func (*Nat44EdOutputInterfaceGet) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44EdOutputInterfaceGet) GetRetVal() error { + return nil +} func (m *Nat44EdOutputInterfaceGet) Size() (size int) { if m == nil { @@ -1077,6 +1143,9 @@ func (*Nat44EdOutputInterfaceGetReply) GetCrcString() string { return "53b48f5d" func (*Nat44EdOutputInterfaceGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44EdOutputInterfaceGetReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Nat44EdOutputInterfaceGetReply) Size() (size int) { if m == nil { @@ -1119,6 +1188,9 @@ func (*Nat44EdPluginEnableDisable) GetCrcString() string { return "be17f8dd" } func (*Nat44EdPluginEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44EdPluginEnableDisable) GetRetVal() error { + return nil +} func (m *Nat44EdPluginEnableDisable) Size() (size int) { if m == nil { @@ -1170,6 +1242,9 @@ func (*Nat44EdPluginEnableDisableReply) GetCrcString() string { return "e8d4e804 func (*Nat44EdPluginEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44EdPluginEnableDisableReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Nat44EdPluginEnableDisableReply) Size() (size int) { if m == nil { @@ -1204,6 +1279,9 @@ func (*Nat44EdSetFqOptions) GetCrcString() string { return "2399bd71" } func (*Nat44EdSetFqOptions) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44EdSetFqOptions) GetRetVal() error { + return nil +} func (m *Nat44EdSetFqOptions) Size() (size int) { if m == nil { @@ -1238,6 +1316,9 @@ func (*Nat44EdSetFqOptionsReply) GetCrcString() string { return "e8d4e804" } func (*Nat44EdSetFqOptionsReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44EdSetFqOptionsReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Nat44EdSetFqOptionsReply) Size() (size int) { if m == nil { @@ -1270,6 +1351,9 @@ func (*Nat44EdShowFqOptions) GetCrcString() string { return "51077d14" } func (*Nat44EdShowFqOptions) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44EdShowFqOptions) GetRetVal() error { + return nil +} func (m *Nat44EdShowFqOptions) Size() (size int) { if m == nil { @@ -1301,6 +1385,9 @@ func (*Nat44EdShowFqOptionsReply) GetCrcString() string { return "7213b545" } func (*Nat44EdShowFqOptionsReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44EdShowFqOptionsReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Nat44EdShowFqOptionsReply) Size() (size int) { if m == nil { @@ -1340,6 +1427,9 @@ func (*Nat44ForwardingEnableDisable) GetCrcString() string { return "b3e225d2" } func (*Nat44ForwardingEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44ForwardingEnableDisable) GetRetVal() error { + return nil +} func (m *Nat44ForwardingEnableDisable) Size() (size int) { if m == nil { @@ -1376,6 +1466,9 @@ func (*Nat44ForwardingEnableDisableReply) GetCrcString() string { return "e8d4e8 func (*Nat44ForwardingEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44ForwardingEnableDisableReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Nat44ForwardingEnableDisableReply) Size() (size int) { if m == nil { @@ -1408,6 +1501,9 @@ func (*Nat44ForwardingIsEnabled) GetCrcString() string { return "51077d14" } func (*Nat44ForwardingIsEnabled) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44ForwardingIsEnabled) GetRetVal() error { + return nil +} func (m *Nat44ForwardingIsEnabled) Size() (size int) { if m == nil { @@ -1440,6 +1536,9 @@ func (*Nat44ForwardingIsEnabledReply) GetCrcString() string { return "46924a06" func (*Nat44ForwardingIsEnabledReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44ForwardingIsEnabledReply) GetRetVal() error { + return nil +} func (m *Nat44ForwardingIsEnabledReply) Size() (size int) { if m == nil { @@ -1479,6 +1578,9 @@ func (*Nat44IdentityMappingDetails) GetCrcString() string { return "2a52a030" func (*Nat44IdentityMappingDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44IdentityMappingDetails) GetRetVal() error { + return nil +} func (m *Nat44IdentityMappingDetails) Size() (size int) { if m == nil { @@ -1528,6 +1630,9 @@ func (*Nat44IdentityMappingDump) GetCrcString() string { return "51077d14" } func (*Nat44IdentityMappingDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44IdentityMappingDump) GetRetVal() error { + return nil +} func (m *Nat44IdentityMappingDump) Size() (size int) { if m == nil { @@ -1559,6 +1664,9 @@ func (*Nat44InterfaceAddDelFeature) GetCrcString() string { return "f3699b83" func (*Nat44InterfaceAddDelFeature) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44InterfaceAddDelFeature) GetRetVal() error { + return nil +} func (m *Nat44InterfaceAddDelFeature) Size() (size int) { if m == nil { @@ -1600,6 +1708,9 @@ func (*Nat44InterfaceAddDelFeatureReply) GetCrcString() string { return "e8d4e80 func (*Nat44InterfaceAddDelFeatureReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44InterfaceAddDelFeatureReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Nat44InterfaceAddDelFeatureReply) Size() (size int) { if m == nil { @@ -1638,6 +1749,9 @@ func (*Nat44InterfaceAddDelOutputFeature) GetCrcString() string { return "f3699b func (*Nat44InterfaceAddDelOutputFeature) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44InterfaceAddDelOutputFeature) GetRetVal() error { + return nil +} func (m *Nat44InterfaceAddDelOutputFeature) Size() (size int) { if m == nil { @@ -1682,6 +1796,9 @@ func (*Nat44InterfaceAddDelOutputFeatureReply) GetCrcString() string { return "e func (*Nat44InterfaceAddDelOutputFeatureReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44InterfaceAddDelOutputFeatureReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Nat44InterfaceAddDelOutputFeatureReply) Size() (size int) { if m == nil { @@ -1716,6 +1833,9 @@ func (*Nat44InterfaceAddrDetails) GetCrcString() string { return "e4aca9ca" } func (*Nat44InterfaceAddrDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44InterfaceAddrDetails) GetRetVal() error { + return nil +} func (m *Nat44InterfaceAddrDetails) Size() (size int) { if m == nil { @@ -1750,6 +1870,9 @@ func (*Nat44InterfaceAddrDump) GetCrcString() string { return "51077d14" } func (*Nat44InterfaceAddrDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44InterfaceAddrDump) GetRetVal() error { + return nil +} func (m *Nat44InterfaceAddrDump) Size() (size int) { if m == nil { @@ -1780,6 +1903,9 @@ func (*Nat44InterfaceDetails) GetCrcString() string { return "5d286289" } func (*Nat44InterfaceDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44InterfaceDetails) GetRetVal() error { + return nil +} func (m *Nat44InterfaceDetails) Size() (size int) { if m == nil { @@ -1814,6 +1940,9 @@ func (*Nat44InterfaceDump) GetCrcString() string { return "51077d14" } func (*Nat44InterfaceDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44InterfaceDump) GetRetVal() error { + return nil +} func (m *Nat44InterfaceDump) Size() (size int) { if m == nil { @@ -1847,6 +1976,9 @@ func (*Nat44InterfaceOutputFeatureDetails) GetCrcString() string { return "5d286 func (*Nat44InterfaceOutputFeatureDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44InterfaceOutputFeatureDetails) GetRetVal() error { + return nil +} func (m *Nat44InterfaceOutputFeatureDetails) Size() (size int) { if m == nil { @@ -1884,6 +2016,9 @@ func (*Nat44InterfaceOutputFeatureDump) GetCrcString() string { return "51077d14 func (*Nat44InterfaceOutputFeatureDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44InterfaceOutputFeatureDump) GetRetVal() error { + return nil +} func (m *Nat44InterfaceOutputFeatureDump) Size() (size int) { if m == nil { @@ -1919,6 +2054,9 @@ func (*Nat44LbStaticMappingAddDelLocal) GetCrcString() string { return "7ca47547 func (*Nat44LbStaticMappingAddDelLocal) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44LbStaticMappingAddDelLocal) GetRetVal() error { + return nil +} func (m *Nat44LbStaticMappingAddDelLocal) Size() (size int) { if m == nil { @@ -1975,6 +2113,9 @@ func (*Nat44LbStaticMappingAddDelLocalReply) GetCrcString() string { return "e8d func (*Nat44LbStaticMappingAddDelLocalReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44LbStaticMappingAddDelLocalReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Nat44LbStaticMappingAddDelLocalReply) Size() (size int) { if m == nil { @@ -2015,6 +2156,9 @@ func (*Nat44LbStaticMappingDetails) GetCrcString() string { return "ed5ce876" func (*Nat44LbStaticMappingDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44LbStaticMappingDetails) GetRetVal() error { + return nil +} func (m *Nat44LbStaticMappingDetails) Size() (size int) { if m == nil { @@ -2092,6 +2236,9 @@ func (*Nat44LbStaticMappingDump) GetCrcString() string { return "51077d14" } func (*Nat44LbStaticMappingDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44LbStaticMappingDump) GetRetVal() error { + return nil +} func (m *Nat44LbStaticMappingDump) Size() (size int) { if m == nil { @@ -2130,6 +2277,9 @@ func (*Nat44PluginEnableDisable) GetCrcString() string { return "dea0d501" } func (*Nat44PluginEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44PluginEnableDisable) GetRetVal() error { + return nil +} func (m *Nat44PluginEnableDisable) Size() (size int) { if m == nil { @@ -2190,6 +2340,9 @@ func (*Nat44PluginEnableDisableReply) GetCrcString() string { return "e8d4e804" func (*Nat44PluginEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44PluginEnableDisableReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Nat44PluginEnableDisableReply) Size() (size int) { if m == nil { @@ -2222,6 +2375,9 @@ func (*Nat44SessionCleanup) GetCrcString() string { return "51077d14" } func (*Nat44SessionCleanup) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44SessionCleanup) GetRetVal() error { + return nil +} func (m *Nat44SessionCleanup) Size() (size int) { if m == nil { @@ -2252,6 +2408,9 @@ func (*Nat44SessionCleanupReply) GetCrcString() string { return "e8d4e804" } func (*Nat44SessionCleanupReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44SessionCleanupReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Nat44SessionCleanupReply) Size() (size int) { if m == nil { @@ -2286,6 +2445,9 @@ func (*Nat44SetSessionLimit) GetCrcString() string { return "8899bbb1" } func (*Nat44SetSessionLimit) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44SetSessionLimit) GetRetVal() error { + return nil +} func (m *Nat44SetSessionLimit) Size() (size int) { if m == nil { @@ -2322,6 +2484,9 @@ func (*Nat44SetSessionLimitReply) GetCrcString() string { return "e8d4e804" } func (*Nat44SetSessionLimitReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44SetSessionLimitReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Nat44SetSessionLimitReply) Size() (size int) { if m == nil { @@ -2354,6 +2519,9 @@ func (*Nat44ShowRunningConfig) GetCrcString() string { return "51077d14" } func (*Nat44ShowRunningConfig) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44ShowRunningConfig) GetRetVal() error { + return nil +} func (m *Nat44ShowRunningConfig) Size() (size int) { if m == nil { @@ -2396,6 +2564,9 @@ func (*Nat44ShowRunningConfigReply) GetCrcString() string { return "93d8e267" func (*Nat44ShowRunningConfigReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44ShowRunningConfigReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Nat44ShowRunningConfigReply) Size() (size int) { if m == nil { @@ -2482,6 +2653,9 @@ func (*Nat44StaticMappingDetails) GetCrcString() string { return "06cb40b2" } func (*Nat44StaticMappingDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44StaticMappingDetails) GetRetVal() error { + return nil +} func (m *Nat44StaticMappingDetails) Size() (size int) { if m == nil { @@ -2537,6 +2711,9 @@ func (*Nat44StaticMappingDump) GetCrcString() string { return "51077d14" } func (*Nat44StaticMappingDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44StaticMappingDump) GetRetVal() error { + return nil +} func (m *Nat44StaticMappingDump) Size() (size int) { if m == nil { @@ -2569,6 +2746,9 @@ func (*Nat44UserDetails) GetCrcString() string { return "355896c2" } func (*Nat44UserDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44UserDetails) GetRetVal() error { + return nil +} func (m *Nat44UserDetails) Size() (size int) { if m == nil { @@ -2609,6 +2789,9 @@ func (*Nat44UserDump) GetCrcString() string { return "51077d14" } func (*Nat44UserDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44UserDump) GetRetVal() error { + return nil +} func (m *Nat44UserDump) Size() (size int) { if m == nil { @@ -2650,6 +2833,9 @@ func (*Nat44UserSessionDetails) GetCrcString() string { return "2cf6e16d" } func (*Nat44UserSessionDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44UserSessionDetails) GetRetVal() error { + return nil +} func (m *Nat44UserSessionDetails) Size() (size int) { if m == nil { @@ -2720,6 +2906,9 @@ func (*Nat44UserSessionDump) GetCrcString() string { return "e1899c98" } func (*Nat44UserSessionDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44UserSessionDump) GetRetVal() error { + return nil +} func (m *Nat44UserSessionDump) Size() (size int) { if m == nil { @@ -2770,6 +2959,9 @@ func (*Nat44UserSessionV2Details) GetCrcString() string { return "fd42b729" } func (*Nat44UserSessionV2Details) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Nat44UserSessionV2Details) GetRetVal() error { + return nil +} func (m *Nat44UserSessionV2Details) Size() (size int) { if m == nil { @@ -2844,6 +3036,9 @@ func (*Nat44UserSessionV2Dump) GetCrcString() string { return "e1899c98" } func (*Nat44UserSessionV2Dump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Nat44UserSessionV2Dump) GetRetVal() error { + return nil +} func (m *Nat44UserSessionV2Dump) Size() (size int) { if m == nil { @@ -2879,6 +3074,9 @@ func (*NatControlPing) GetCrcString() string { return "51077d14" } func (*NatControlPing) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *NatControlPing) GetRetVal() error { + return nil +} func (m *NatControlPing) Size() (size int) { if m == nil { @@ -2911,6 +3109,9 @@ func (*NatControlPingReply) GetCrcString() string { return "f6b0b8ca" } func (*NatControlPingReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *NatControlPingReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *NatControlPingReply) Size() (size int) { if m == nil { @@ -2948,6 +3149,9 @@ func (*NatGetAddrAndPortAllocAlg) GetCrcString() string { return "51077d14" } func (*NatGetAddrAndPortAllocAlg) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *NatGetAddrAndPortAllocAlg) GetRetVal() error { + return nil +} func (m *NatGetAddrAndPortAllocAlg) Size() (size int) { if m == nil { @@ -2985,6 +3189,9 @@ func (*NatGetAddrAndPortAllocAlgReply) GetCrcString() string { return "3607a7d0" func (*NatGetAddrAndPortAllocAlgReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *NatGetAddrAndPortAllocAlgReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *NatGetAddrAndPortAllocAlgReply) Size() (size int) { if m == nil { @@ -3034,6 +3241,9 @@ func (*NatGetMssClamping) GetCrcString() string { return "51077d14" } func (*NatGetMssClamping) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *NatGetMssClamping) GetRetVal() error { + return nil +} func (m *NatGetMssClamping) Size() (size int) { if m == nil { @@ -3065,6 +3275,9 @@ func (*NatGetMssClampingReply) GetCrcString() string { return "1c0b2a78" } func (*NatGetMssClampingReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *NatGetMssClampingReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *NatGetMssClampingReply) Size() (size int) { if m == nil { @@ -3103,6 +3316,9 @@ func (*NatGetTimeouts) GetCrcString() string { return "51077d14" } func (*NatGetTimeouts) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *NatGetTimeouts) GetRetVal() error { + return nil +} func (m *NatGetTimeouts) Size() (size int) { if m == nil { @@ -3137,6 +3353,9 @@ func (*NatGetTimeoutsReply) GetCrcString() string { return "3c4df4e1" } func (*NatGetTimeoutsReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *NatGetTimeoutsReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *NatGetTimeoutsReply) Size() (size int) { if m == nil { @@ -3180,6 +3399,9 @@ func (*NatHaFlush) GetCrcString() string { return "51077d14" } func (*NatHaFlush) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *NatHaFlush) GetRetVal() error { + return nil +} func (m *NatHaFlush) Size() (size int) { if m == nil { @@ -3209,6 +3431,9 @@ func (*NatHaFlushReply) GetCrcString() string { return "e8d4e804" } func (*NatHaFlushReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *NatHaFlushReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *NatHaFlushReply) Size() (size int) { if m == nil { @@ -3240,6 +3465,9 @@ func (*NatHaGetFailover) GetCrcString() string { return "51077d14" } func (*NatHaGetFailover) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *NatHaGetFailover) GetRetVal() error { + return nil +} func (m *NatHaGetFailover) Size() (size int) { if m == nil { @@ -3272,6 +3500,9 @@ func (*NatHaGetFailoverReply) GetCrcString() string { return "a67d8752" } func (*NatHaGetFailoverReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *NatHaGetFailoverReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *NatHaGetFailoverReply) Size() (size int) { if m == nil { @@ -3312,6 +3543,9 @@ func (*NatHaGetListener) GetCrcString() string { return "51077d14" } func (*NatHaGetListener) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *NatHaGetListener) GetRetVal() error { + return nil +} func (m *NatHaGetListener) Size() (size int) { if m == nil { @@ -3344,6 +3578,9 @@ func (*NatHaGetListenerReply) GetCrcString() string { return "123ea41f" } func (*NatHaGetListenerReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *NatHaGetListenerReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *NatHaGetListenerReply) Size() (size int) { if m == nil { @@ -3387,6 +3624,9 @@ func (*NatHaResync) GetCrcString() string { return "c8ab9e03" } func (*NatHaResync) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *NatHaResync) GetRetVal() error { + return nil +} func (m *NatHaResync) Size() (size int) { if m == nil { @@ -3424,6 +3664,9 @@ func (*NatHaResyncCompletedEvent) GetCrcString() string { return "fdc598fb" } func (*NatHaResyncCompletedEvent) GetMessageType() api.MessageType { return api.EventMessage } +func (m *NatHaResyncCompletedEvent) GetRetVal() error { + return nil +} func (m *NatHaResyncCompletedEvent) Size() (size int) { if m == nil { @@ -3460,6 +3703,9 @@ func (*NatHaResyncReply) GetCrcString() string { return "e8d4e804" } func (*NatHaResyncReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *NatHaResyncReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *NatHaResyncReply) Size() (size int) { if m == nil { @@ -3495,6 +3741,9 @@ func (*NatHaSetFailover) GetCrcString() string { return "718246af" } func (*NatHaSetFailover) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *NatHaSetFailover) GetRetVal() error { + return nil +} func (m *NatHaSetFailover) Size() (size int) { if m == nil { @@ -3534,6 +3783,9 @@ func (*NatHaSetFailoverReply) GetCrcString() string { return "e8d4e804" } func (*NatHaSetFailoverReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *NatHaSetFailoverReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *NatHaSetFailoverReply) Size() (size int) { if m == nil { @@ -3569,6 +3821,9 @@ func (*NatHaSetListener) GetCrcString() string { return "e4a8cb4e" } func (*NatHaSetListener) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *NatHaSetListener) GetRetVal() error { + return nil +} func (m *NatHaSetListener) Size() (size int) { if m == nil { @@ -3608,6 +3863,9 @@ func (*NatHaSetListenerReply) GetCrcString() string { return "e8d4e804" } func (*NatHaSetListenerReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *NatHaSetListenerReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *NatHaSetListenerReply) Size() (size int) { if m == nil { @@ -3644,6 +3902,9 @@ func (*NatIpfixEnableDisable) GetCrcString() string { return "9af4a2d2" } func (*NatIpfixEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *NatIpfixEnableDisable) GetRetVal() error { + return nil +} func (m *NatIpfixEnableDisable) Size() (size int) { if m == nil { @@ -3684,6 +3945,9 @@ func (*NatIpfixEnableDisableReply) GetCrcString() string { return "e8d4e804" } func (*NatIpfixEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *NatIpfixEnableDisableReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *NatIpfixEnableDisableReply) Size() (size int) { if m == nil { @@ -3722,6 +3986,9 @@ func (*NatSetAddrAndPortAllocAlg) GetCrcString() string { return "deeb746f" } func (*NatSetAddrAndPortAllocAlg) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *NatSetAddrAndPortAllocAlg) GetRetVal() error { + return nil +} func (m *NatSetAddrAndPortAllocAlg) Size() (size int) { if m == nil { @@ -3772,6 +4039,9 @@ func (*NatSetAddrAndPortAllocAlgReply) GetCrcString() string { return "e8d4e804" func (*NatSetAddrAndPortAllocAlgReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *NatSetAddrAndPortAllocAlgReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *NatSetAddrAndPortAllocAlgReply) Size() (size int) { if m == nil { @@ -3806,6 +4076,9 @@ func (*NatSetLogLevel) GetCrcString() string { return "70076bfe" } func (*NatSetLogLevel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *NatSetLogLevel) GetRetVal() error { + return nil +} func (m *NatSetLogLevel) Size() (size int) { if m == nil { @@ -3840,6 +4113,9 @@ func (*NatSetLogLevelReply) GetCrcString() string { return "e8d4e804" } func (*NatSetLogLevelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *NatSetLogLevelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *NatSetLogLevelReply) Size() (size int) { if m == nil { @@ -3874,6 +4150,9 @@ func (*NatSetMssClamping) GetCrcString() string { return "25e90abb" } func (*NatSetMssClamping) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *NatSetMssClamping) GetRetVal() error { + return nil +} func (m *NatSetMssClamping) Size() (size int) { if m == nil { @@ -3910,6 +4189,9 @@ func (*NatSetMssClampingReply) GetCrcString() string { return "e8d4e804" } func (*NatSetMssClampingReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *NatSetMssClampingReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *NatSetMssClampingReply) Size() (size int) { if m == nil { @@ -3947,6 +4229,9 @@ func (*NatSetTimeouts) GetCrcString() string { return "d4746b16" } func (*NatSetTimeouts) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *NatSetTimeouts) GetRetVal() error { + return nil +} func (m *NatSetTimeouts) Size() (size int) { if m == nil { @@ -3990,6 +4275,9 @@ func (*NatSetTimeoutsReply) GetCrcString() string { return "e8d4e804" } func (*NatSetTimeoutsReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *NatSetTimeoutsReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *NatSetTimeoutsReply) Size() (size int) { if m == nil { @@ -4023,6 +4311,9 @@ func (*NatSetWorkers) GetCrcString() string { return "da926638" } func (*NatSetWorkers) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *NatSetWorkers) GetRetVal() error { + return nil +} func (m *NatSetWorkers) Size() (size int) { if m == nil { @@ -4056,6 +4347,9 @@ func (*NatSetWorkersReply) GetCrcString() string { return "e8d4e804" } func (*NatSetWorkersReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *NatSetWorkersReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *NatSetWorkersReply) Size() (size int) { if m == nil { @@ -4088,6 +4382,9 @@ func (*NatShowConfig) GetCrcString() string { return "51077d14" } func (*NatShowConfig) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *NatShowConfig) GetRetVal() error { + return nil +} func (m *NatShowConfig) Size() (size int) { if m == nil { @@ -4116,6 +4413,9 @@ func (*NatShowConfig2) GetCrcString() string { return "51077d14" } func (*NatShowConfig2) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *NatShowConfig2) GetRetVal() error { + return nil +} func (m *NatShowConfig2) Size() (size int) { if m == nil { @@ -4165,6 +4465,9 @@ func (*NatShowConfig2Reply) GetCrcString() string { return "0404a5b4" } func (*NatShowConfig2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *NatShowConfig2Reply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *NatShowConfig2Reply) Size() (size int) { if m == nil { @@ -4273,6 +4576,9 @@ func (*NatShowConfigReply) GetCrcString() string { return "7903ef06" } func (*NatShowConfigReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *NatShowConfigReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *NatShowConfigReply) Size() (size int) { if m == nil { @@ -4359,6 +4665,9 @@ func (*NatWorkerDetails) GetCrcString() string { return "84bf06fc" } func (*NatWorkerDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *NatWorkerDetails) GetRetVal() error { + return nil +} func (m *NatWorkerDetails) Size() (size int) { if m == nil { @@ -4396,6 +4705,9 @@ func (*NatWorkerDump) GetCrcString() string { return "51077d14" } func (*NatWorkerDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *NatWorkerDump) GetRetVal() error { + return nil +} func (m *NatWorkerDump) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/pbl/pbl.ba.go b/vpplink/binapi/vppapi/pbl/pbl.ba.go index 34739753..357d66c9 100644 --- a/vpplink/binapi/vppapi/pbl/pbl.ba.go +++ b/vpplink/binapi/vppapi/pbl/pbl.ba.go @@ -104,6 +104,9 @@ func (*PblClientDel) GetCrcString() string { return "3a91bde5" } func (*PblClientDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *PblClientDel) GetRetVal() error { + return nil +} func (m *PblClientDel) Size() (size int) { if m == nil { @@ -138,6 +141,9 @@ func (*PblClientDelReply) GetCrcString() string { return "e8d4e804" } func (*PblClientDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *PblClientDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *PblClientDelReply) Size() (size int) { if m == nil { @@ -172,6 +178,9 @@ func (*PblClientDetails) GetCrcString() string { return "14278144" } func (*PblClientDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *PblClientDetails) GetRetVal() error { + return nil +} func (m *PblClientDetails) Size() (size int) { if m == nil { @@ -301,6 +310,9 @@ func (*PblClientDump) GetCrcString() string { return "51077d14" } func (*PblClientDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *PblClientDump) GetRetVal() error { + return nil +} func (m *PblClientDump) Size() (size int) { if m == nil { @@ -331,6 +343,9 @@ func (*PblClientUpdate) GetCrcString() string { return "d83d6e65" } func (*PblClientUpdate) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *PblClientUpdate) GetRetVal() error { + return nil +} func (m *PblClientUpdate) Size() (size int) { if m == nil { @@ -463,6 +478,9 @@ func (*PblClientUpdateReply) GetCrcString() string { return "e2fc8294" } func (*PblClientUpdateReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *PblClientUpdateReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *PblClientUpdateReply) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/punt/punt.ba.go b/vpplink/binapi/vppapi/punt/punt.ba.go index 4de0ef82..d7c95361 100644 --- a/vpplink/binapi/vppapi/punt/punt.ba.go +++ b/vpplink/binapi/vppapi/punt/punt.ba.go @@ -158,6 +158,9 @@ func (*PuntReasonDetails) GetCrcString() string { return "2c9d4a40" } func (*PuntReasonDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *PuntReasonDetails) GetRetVal() error { + return nil +} func (m *PuntReasonDetails) Size() (size int) { if m == nil { @@ -194,6 +197,9 @@ func (*PuntReasonDump) GetCrcString() string { return "5c0dd4fe" } func (*PuntReasonDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *PuntReasonDump) GetRetVal() error { + return nil +} func (m *PuntReasonDump) Size() (size int) { if m == nil { @@ -230,6 +236,9 @@ func (*PuntSocketDeregister) GetCrcString() string { return "98fc9102" } func (*PuntSocketDeregister) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *PuntSocketDeregister) GetRetVal() error { + return nil +} func (m *PuntSocketDeregister) Size() (size int) { if m == nil { @@ -266,6 +275,9 @@ func (*PuntSocketDeregisterReply) GetCrcString() string { return "e8d4e804" } func (*PuntSocketDeregisterReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *PuntSocketDeregisterReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *PuntSocketDeregisterReply) Size() (size int) { if m == nil { @@ -300,6 +312,9 @@ func (*PuntSocketDetails) GetCrcString() string { return "de575080" } func (*PuntSocketDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *PuntSocketDetails) GetRetVal() error { + return nil +} func (m *PuntSocketDetails) Size() (size int) { if m == nil { @@ -339,6 +354,9 @@ func (*PuntSocketDump) GetCrcString() string { return "52974935" } func (*PuntSocketDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *PuntSocketDump) GetRetVal() error { + return nil +} func (m *PuntSocketDump) Size() (size int) { if m == nil { @@ -374,6 +392,9 @@ func (*PuntSocketRegister) GetCrcString() string { return "95268cbf" } func (*PuntSocketRegister) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *PuntSocketRegister) GetRetVal() error { + return nil +} func (m *PuntSocketRegister) Size() (size int) { if m == nil { @@ -417,6 +438,9 @@ func (*PuntSocketRegisterReply) GetCrcString() string { return "bd30ae90" } func (*PuntSocketRegisterReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *PuntSocketRegisterReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *PuntSocketRegisterReply) Size() (size int) { if m == nil { @@ -454,6 +478,9 @@ func (*SetPunt) GetCrcString() string { return "aa83d523" } func (*SetPunt) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SetPunt) GetRetVal() error { + return nil +} func (m *SetPunt) Size() (size int) { if m == nil { @@ -493,6 +520,9 @@ func (*SetPuntReply) GetCrcString() string { return "e8d4e804" } func (*SetPuntReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SetPuntReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SetPuntReply) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/rdma/rdma.ba.go b/vpplink/binapi/vppapi/rdma/rdma.ba.go index 38f4f344..b70adbec 100644 --- a/vpplink/binapi/vppapi/rdma/rdma.ba.go +++ b/vpplink/binapi/vppapi/rdma/rdma.ba.go @@ -141,6 +141,9 @@ func (*RdmaCreate) GetCrcString() string { return "076fe418" } func (*RdmaCreate) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *RdmaCreate) GetRetVal() error { + return nil +} func (m *RdmaCreate) Size() (size int) { if m == nil { @@ -190,6 +193,9 @@ func (*RdmaCreateReply) GetCrcString() string { return "5383d31f" } func (*RdmaCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *RdmaCreateReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *RdmaCreateReply) Size() (size int) { if m == nil { @@ -234,6 +240,9 @@ func (*RdmaCreateV2) GetCrcString() string { return "5826a4f3" } func (*RdmaCreateV2) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *RdmaCreateV2) GetRetVal() error { + return nil +} func (m *RdmaCreateV2) Size() (size int) { if m == nil { @@ -289,6 +298,9 @@ func (*RdmaCreateV2Reply) GetCrcString() string { return "5383d31f" } func (*RdmaCreateV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *RdmaCreateV2Reply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *RdmaCreateV2Reply) Size() (size int) { if m == nil { @@ -334,6 +346,9 @@ func (*RdmaCreateV3) GetCrcString() string { return "c6287ea8" } func (*RdmaCreateV3) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *RdmaCreateV3) GetRetVal() error { + return nil +} func (m *RdmaCreateV3) Size() (size int) { if m == nil { @@ -395,6 +410,9 @@ func (*RdmaCreateV3Reply) GetCrcString() string { return "5383d31f" } func (*RdmaCreateV3Reply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *RdmaCreateV3Reply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *RdmaCreateV3Reply) Size() (size int) { if m == nil { @@ -431,6 +449,9 @@ func (*RdmaDelete) GetCrcString() string { return "f9e6675e" } func (*RdmaDelete) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *RdmaDelete) GetRetVal() error { + return nil +} func (m *RdmaDelete) Size() (size int) { if m == nil { @@ -464,6 +485,9 @@ func (*RdmaDeleteReply) GetCrcString() string { return "e8d4e804" } func (*RdmaDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *RdmaDeleteReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *RdmaDeleteReply) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/session/session.ba.go b/vpplink/binapi/vppapi/session/session.ba.go index 7e395216..c7cfc218 100644 --- a/vpplink/binapi/vppapi/session/session.ba.go +++ b/vpplink/binapi/vppapi/session/session.ba.go @@ -108,6 +108,9 @@ func (*AppAddCertKeyPair) GetCrcString() string { return "02eb8016" } func (*AppAddCertKeyPair) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AppAddCertKeyPair) GetRetVal() error { + return nil +} func (m *AppAddCertKeyPair) Size() (size int) { if m == nil { @@ -149,6 +152,9 @@ func (*AppAddCertKeyPairReply) GetCrcString() string { return "b42958d0" } func (*AppAddCertKeyPairReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AppAddCertKeyPairReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *AppAddCertKeyPairReply) Size() (size int) { if m == nil { @@ -186,6 +192,9 @@ func (*AppAttach) GetCrcString() string { return "5f4a260d" } func (*AppAttach) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AppAttach) GetRetVal() error { + return nil +} func (m *AppAttach) Size() (size int) { if m == nil { @@ -240,6 +249,9 @@ func (*AppAttachReply) GetCrcString() string { return "5c89c3b0" } func (*AppAttachReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AppAttachReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *AppAttachReply) Size() (size int) { if m == nil { @@ -300,6 +312,9 @@ func (*AppDelCertKeyPair) GetCrcString() string { return "8ac76db6" } func (*AppDelCertKeyPair) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AppDelCertKeyPair) GetRetVal() error { + return nil +} func (m *AppDelCertKeyPair) Size() (size int) { if m == nil { @@ -333,6 +348,9 @@ func (*AppDelCertKeyPairReply) GetCrcString() string { return "e8d4e804" } func (*AppDelCertKeyPairReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AppDelCertKeyPairReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *AppDelCertKeyPairReply) Size() (size int) { if m == nil { @@ -371,6 +389,9 @@ func (*AppNamespaceAddDel) GetCrcString() string { return "6306aecb" } func (*AppNamespaceAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AppNamespaceAddDel) GetRetVal() error { + return nil +} func (m *AppNamespaceAddDel) Size() (size int) { if m == nil { @@ -418,6 +439,9 @@ func (*AppNamespaceAddDelReply) GetCrcString() string { return "85137120" } func (*AppNamespaceAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AppNamespaceAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *AppNamespaceAddDelReply) Size() (size int) { if m == nil { @@ -459,6 +483,9 @@ func (*AppNamespaceAddDelV2) GetCrcString() string { return "ee0755cf" } func (*AppNamespaceAddDelV2) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AppNamespaceAddDelV2) GetRetVal() error { + return nil +} func (m *AppNamespaceAddDelV2) Size() (size int) { if m == nil { @@ -508,6 +535,9 @@ func (*AppNamespaceAddDelV2Reply) GetCrcString() string { return "85137120" } func (*AppNamespaceAddDelV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AppNamespaceAddDelV2Reply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *AppNamespaceAddDelV2Reply) Size() (size int) { if m == nil { @@ -551,6 +581,9 @@ func (*AppNamespaceAddDelV3) GetCrcString() string { return "8a7e40a1" } func (*AppNamespaceAddDelV3) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AppNamespaceAddDelV3) GetRetVal() error { + return nil +} func (m *AppNamespaceAddDelV3) Size() (size int) { if m == nil { @@ -606,6 +639,9 @@ func (*AppNamespaceAddDelV3Reply) GetCrcString() string { return "85137120" } func (*AppNamespaceAddDelV3Reply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AppNamespaceAddDelV3Reply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *AppNamespaceAddDelV3Reply) Size() (size int) { if m == nil { @@ -644,6 +680,9 @@ func (*AppWorkerAddDel) GetCrcString() string { return "753253dc" } func (*AppWorkerAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AppWorkerAddDel) GetRetVal() error { + return nil +} func (m *AppWorkerAddDel) Size() (size int) { if m == nil { @@ -690,6 +729,9 @@ func (*AppWorkerAddDelReply) GetCrcString() string { return "5735ffe7" } func (*AppWorkerAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AppWorkerAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *AppWorkerAddDelReply) Size() (size int) { if m == nil { @@ -742,6 +784,9 @@ func (*ApplicationDetach) GetCrcString() string { return "51077d14" } func (*ApplicationDetach) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ApplicationDetach) GetRetVal() error { + return nil +} func (m *ApplicationDetach) Size() (size int) { if m == nil { @@ -771,6 +816,9 @@ func (*ApplicationDetachReply) GetCrcString() string { return "e8d4e804" } func (*ApplicationDetachReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ApplicationDetachReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *ApplicationDetachReply) Size() (size int) { if m == nil { @@ -807,6 +855,9 @@ func (*ApplicationTLSCertAdd) GetCrcString() string { return "3f5cfe45" } func (*ApplicationTLSCertAdd) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ApplicationTLSCertAdd) GetRetVal() error { + return nil +} func (m *ApplicationTLSCertAdd) Size() (size int) { if m == nil { @@ -848,6 +899,9 @@ func (*ApplicationTLSCertAddReply) GetCrcString() string { return "e8d4e804" } func (*ApplicationTLSCertAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ApplicationTLSCertAddReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *ApplicationTLSCertAddReply) Size() (size int) { if m == nil { @@ -884,6 +938,9 @@ func (*ApplicationTLSKeyAdd) GetCrcString() string { return "5eaf70cd" } func (*ApplicationTLSKeyAdd) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ApplicationTLSKeyAdd) GetRetVal() error { + return nil +} func (m *ApplicationTLSKeyAdd) Size() (size int) { if m == nil { @@ -925,6 +982,9 @@ func (*ApplicationTLSKeyAddReply) GetCrcString() string { return "e8d4e804" } func (*ApplicationTLSKeyAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ApplicationTLSKeyAddReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *ApplicationTLSKeyAddReply) Size() (size int) { if m == nil { @@ -958,6 +1018,9 @@ func (*SessionEnableDisable) GetCrcString() string { return "c264d7bf" } func (*SessionEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SessionEnableDisable) GetRetVal() error { + return nil +} func (m *SessionEnableDisable) Size() (size int) { if m == nil { @@ -991,6 +1054,9 @@ func (*SessionEnableDisableReply) GetCrcString() string { return "e8d4e804" } func (*SessionEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SessionEnableDisableReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SessionEnableDisableReply) Size() (size int) { if m == nil { @@ -1033,6 +1099,9 @@ func (*SessionRuleAddDel) GetCrcString() string { return "e4895422" } func (*SessionRuleAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SessionRuleAddDel) GetRetVal() error { + return nil +} func (m *SessionRuleAddDel) Size() (size int) { if m == nil { @@ -1105,6 +1174,9 @@ func (*SessionRuleAddDelReply) GetCrcString() string { return "e8d4e804" } func (*SessionRuleAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SessionRuleAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SessionRuleAddDelReply) Size() (size int) { if m == nil { @@ -1146,6 +1218,9 @@ func (*SessionRulesDetails) GetCrcString() string { return "28d71830" } func (*SessionRulesDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SessionRulesDetails) GetRetVal() error { + return nil +} func (m *SessionRulesDetails) Size() (size int) { if m == nil { @@ -1213,6 +1288,9 @@ func (*SessionRulesDump) GetCrcString() string { return "51077d14" } func (*SessionRulesDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SessionRulesDump) GetRetVal() error { + return nil +} func (m *SessionRulesDump) Size() (size int) { if m == nil { @@ -1242,6 +1320,9 @@ func (*SessionSapiEnableDisable) GetCrcString() string { return "c264d7bf" } func (*SessionSapiEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SessionSapiEnableDisable) GetRetVal() error { + return nil +} func (m *SessionSapiEnableDisable) Size() (size int) { if m == nil { @@ -1277,6 +1358,9 @@ func (*SessionSapiEnableDisableReply) GetCrcString() string { return "e8d4e804" func (*SessionSapiEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SessionSapiEnableDisableReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SessionSapiEnableDisableReply) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/sr/sr.ba.go b/vpplink/binapi/vppapi/sr/sr.ba.go index d9d307fc..f5b07bee 100644 --- a/vpplink/binapi/vppapi/sr/sr.ba.go +++ b/vpplink/binapi/vppapi/sr/sr.ba.go @@ -61,6 +61,9 @@ func (*SrLocalsidAddDel) GetCrcString() string { return "5a36c324" } func (*SrLocalsidAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SrLocalsidAddDel) GetRetVal() error { + return nil +} func (m *SrLocalsidAddDel) Size() (size int) { if m == nil { @@ -118,6 +121,9 @@ func (*SrLocalsidAddDelReply) GetCrcString() string { return "e8d4e804" } func (*SrLocalsidAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SrLocalsidAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SrLocalsidAddDelReply) Size() (size int) { if m == nil { @@ -157,6 +163,9 @@ func (*SrLocalsidsDetails) GetCrcString() string { return "2e9221b9" } func (*SrLocalsidsDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SrLocalsidsDetails) GetRetVal() error { + return nil +} func (m *SrLocalsidsDetails) Size() (size int) { if m == nil { @@ -209,6 +218,9 @@ func (*SrLocalsidsDump) GetCrcString() string { return "51077d14" } func (*SrLocalsidsDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SrLocalsidsDump) GetRetVal() error { + return nil +} func (m *SrLocalsidsDump) Size() (size int) { if m == nil { @@ -243,6 +255,9 @@ func (*SrPoliciesDetails) GetCrcString() string { return "db6ff2a1" } func (*SrPoliciesDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SrPoliciesDetails) GetRetVal() error { + return nil +} func (m *SrPoliciesDetails) Size() (size int) { if m == nil { @@ -317,6 +332,9 @@ func (*SrPoliciesDump) GetCrcString() string { return "51077d14" } func (*SrPoliciesDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SrPoliciesDump) GetRetVal() error { + return nil +} func (m *SrPoliciesDump) Size() (size int) { if m == nil { @@ -354,6 +372,9 @@ func (*SrPoliciesWithSlIndexDetails) GetCrcString() string { return "ca2e9bc8" } func (*SrPoliciesWithSlIndexDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SrPoliciesWithSlIndexDetails) GetRetVal() error { + return nil +} func (m *SrPoliciesWithSlIndexDetails) Size() (size int) { if m == nil { @@ -432,6 +453,9 @@ func (*SrPoliciesWithSlIndexDump) GetCrcString() string { return "51077d14" } func (*SrPoliciesWithSlIndexDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SrPoliciesWithSlIndexDump) GetRetVal() error { + return nil +} func (m *SrPoliciesWithSlIndexDump) Size() (size int) { if m == nil { @@ -466,6 +490,9 @@ func (*SrPolicyAdd) GetCrcString() string { return "44ac92e8" } func (*SrPolicyAdd) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SrPolicyAdd) GetRetVal() error { + return nil +} func (m *SrPolicyAdd) Size() (size int) { if m == nil { @@ -526,6 +553,9 @@ func (*SrPolicyAddReply) GetCrcString() string { return "e8d4e804" } func (*SrPolicyAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SrPolicyAddReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SrPolicyAddReply) Size() (size int) { if m == nil { @@ -560,6 +590,9 @@ func (*SrPolicyDel) GetCrcString() string { return "cb4d48d5" } func (*SrPolicyDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SrPolicyDel) GetRetVal() error { + return nil +} func (m *SrPolicyDel) Size() (size int) { if m == nil { @@ -596,6 +629,9 @@ func (*SrPolicyDelReply) GetCrcString() string { return "e8d4e804" } func (*SrPolicyDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SrPolicyDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SrPolicyDelReply) Size() (size int) { if m == nil { @@ -635,6 +671,9 @@ func (*SrPolicyMod) GetCrcString() string { return "b97bb56e" } func (*SrPolicyMod) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SrPolicyMod) GetRetVal() error { + return nil +} func (m *SrPolicyMod) Size() (size int) { if m == nil { @@ -698,6 +737,9 @@ func (*SrPolicyModReply) GetCrcString() string { return "e8d4e804" } func (*SrPolicyModReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SrPolicyModReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SrPolicyModReply) Size() (size int) { if m == nil { @@ -731,6 +773,9 @@ func (*SrSetEncapHopLimit) GetCrcString() string { return "aa75d7d0" } func (*SrSetEncapHopLimit) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SrSetEncapHopLimit) GetRetVal() error { + return nil +} func (m *SrSetEncapHopLimit) Size() (size int) { if m == nil { @@ -764,6 +809,9 @@ func (*SrSetEncapHopLimitReply) GetCrcString() string { return "e8d4e804" } func (*SrSetEncapHopLimitReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SrSetEncapHopLimitReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SrSetEncapHopLimitReply) Size() (size int) { if m == nil { @@ -797,6 +845,9 @@ func (*SrSetEncapSource) GetCrcString() string { return "d3bad5e1" } func (*SrSetEncapSource) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SrSetEncapSource) GetRetVal() error { + return nil +} func (m *SrSetEncapSource) Size() (size int) { if m == nil { @@ -830,6 +881,9 @@ func (*SrSetEncapSourceReply) GetCrcString() string { return "e8d4e804" } func (*SrSetEncapSourceReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SrSetEncapSourceReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SrSetEncapSourceReply) Size() (size int) { if m == nil { @@ -869,6 +923,9 @@ func (*SrSteeringAddDel) GetCrcString() string { return "e46b0a0f" } func (*SrSteeringAddDel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SrSteeringAddDel) GetRetVal() error { + return nil +} func (m *SrSteeringAddDel) Size() (size int) { if m == nil { @@ -926,6 +983,9 @@ func (*SrSteeringAddDelReply) GetCrcString() string { return "e8d4e804" } func (*SrSteeringAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SrSteeringAddDelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SrSteeringAddDelReply) Size() (size int) { if m == nil { @@ -963,6 +1023,9 @@ func (*SrSteeringPolDetails) GetCrcString() string { return "d41258c9" } func (*SrSteeringPolDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SrSteeringPolDetails) GetRetVal() error { + return nil +} func (m *SrSteeringPolDetails) Size() (size int) { if m == nil { @@ -1012,6 +1075,9 @@ func (*SrSteeringPolDump) GetCrcString() string { return "51077d14" } func (*SrSteeringPolDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SrSteeringPolDump) GetRetVal() error { + return nil +} func (m *SrSteeringPolDump) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/tapv2/tapv2.ba.go b/vpplink/binapi/vppapi/tapv2/tapv2.ba.go index b69f15d8..10fb3ebd 100644 --- a/vpplink/binapi/vppapi/tapv2/tapv2.ba.go +++ b/vpplink/binapi/vppapi/tapv2/tapv2.ba.go @@ -117,6 +117,9 @@ func (*SwInterfaceTapV2Details) GetCrcString() string { return "1e2b2a47" } func (*SwInterfaceTapV2Details) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceTapV2Details) GetRetVal() error { + return nil +} func (m *SwInterfaceTapV2Details) Size() (size int) { if m == nil { @@ -192,6 +195,9 @@ func (*SwInterfaceTapV2Dump) GetCrcString() string { return "f9e6675e" } func (*SwInterfaceTapV2Dump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceTapV2Dump) GetRetVal() error { + return nil +} func (m *SwInterfaceTapV2Dump) Size() (size int) { if m == nil { @@ -250,6 +256,9 @@ func (*TapCreateV2) GetCrcString() string { return "2d0d6570" } func (*TapCreateV2) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *TapCreateV2) GetRetVal() error { + return nil +} func (m *TapCreateV2) Size() (size int) { if m == nil { @@ -365,6 +374,9 @@ func (*TapCreateV2Reply) GetCrcString() string { return "5383d31f" } func (*TapCreateV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *TapCreateV2Reply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *TapCreateV2Reply) Size() (size int) { if m == nil { @@ -427,6 +439,9 @@ func (*TapCreateV3) GetCrcString() string { return "3f3fd1df" } func (*TapCreateV3) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *TapCreateV3) GetRetVal() error { + return nil +} func (m *TapCreateV3) Size() (size int) { if m == nil { @@ -545,6 +560,9 @@ func (*TapCreateV3Reply) GetCrcString() string { return "5383d31f" } func (*TapCreateV3Reply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *TapCreateV3Reply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *TapCreateV3Reply) Size() (size int) { if m == nil { @@ -581,6 +599,9 @@ func (*TapDeleteV2) GetCrcString() string { return "f9e6675e" } func (*TapDeleteV2) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *TapDeleteV2) GetRetVal() error { + return nil +} func (m *TapDeleteV2) Size() (size int) { if m == nil { @@ -614,6 +635,9 @@ func (*TapDeleteV2Reply) GetCrcString() string { return "e8d4e804" } func (*TapDeleteV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *TapDeleteV2Reply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *TapDeleteV2Reply) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/virtio/virtio.ba.go b/vpplink/binapi/vppapi/virtio/virtio.ba.go index 9cd45ef0..1f17eef3 100644 --- a/vpplink/binapi/vppapi/virtio/virtio.ba.go +++ b/vpplink/binapi/vppapi/virtio/virtio.ba.go @@ -104,6 +104,9 @@ func (*SwInterfaceVirtioPciDetails) GetCrcString() string { return "6ca9c167" func (*SwInterfaceVirtioPciDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceVirtioPciDetails) GetRetVal() error { + return nil +} func (m *SwInterfaceVirtioPciDetails) Size() (size int) { if m == nil { @@ -159,6 +162,9 @@ func (*SwInterfaceVirtioPciDump) GetCrcString() string { return "51077d14" } func (*SwInterfaceVirtioPciDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceVirtioPciDump) GetRetVal() error { + return nil +} func (m *SwInterfaceVirtioPciDump) Size() (size int) { if m == nil { @@ -194,6 +200,9 @@ func (*VirtioPciCreate) GetCrcString() string { return "1944f8db" } func (*VirtioPciCreate) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *VirtioPciCreate) GetRetVal() error { + return nil +} func (m *VirtioPciCreate) Size() (size int) { if m == nil { @@ -253,6 +262,9 @@ func (*VirtioPciCreateReply) GetCrcString() string { return "5383d31f" } func (*VirtioPciCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *VirtioPciCreateReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *VirtioPciCreateReply) Size() (size int) { if m == nil { @@ -293,6 +305,9 @@ func (*VirtioPciCreateV2) GetCrcString() string { return "5d096e1a" } func (*VirtioPciCreateV2) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *VirtioPciCreateV2) GetRetVal() error { + return nil +} func (m *VirtioPciCreateV2) Size() (size int) { if m == nil { @@ -348,6 +363,9 @@ func (*VirtioPciCreateV2Reply) GetCrcString() string { return "5383d31f" } func (*VirtioPciCreateV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *VirtioPciCreateV2Reply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *VirtioPciCreateV2Reply) Size() (size int) { if m == nil { @@ -384,6 +402,9 @@ func (*VirtioPciDelete) GetCrcString() string { return "f9e6675e" } func (*VirtioPciDelete) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *VirtioPciDelete) GetRetVal() error { + return nil +} func (m *VirtioPciDelete) Size() (size int) { if m == nil { @@ -417,6 +438,9 @@ func (*VirtioPciDeleteReply) GetCrcString() string { return "e8d4e804" } func (*VirtioPciDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *VirtioPciDeleteReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *VirtioPciDeleteReply) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/vlib/vlib.ba.go b/vpplink/binapi/vppapi/vlib/vlib.ba.go index 32181c4d..f90829bb 100644 --- a/vpplink/binapi/vppapi/vlib/vlib.ba.go +++ b/vpplink/binapi/vppapi/vlib/vlib.ba.go @@ -48,6 +48,9 @@ func (*AddNodeNext) GetCrcString() string { return "2457116d" } func (*AddNodeNext) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *AddNodeNext) GetRetVal() error { + return nil +} func (m *AddNodeNext) Size() (size int) { if m == nil { @@ -85,6 +88,9 @@ func (*AddNodeNextReply) GetCrcString() string { return "2ed75f32" } func (*AddNodeNextReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *AddNodeNextReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *AddNodeNextReply) Size() (size int) { if m == nil { @@ -121,6 +127,9 @@ func (*Cli) GetCrcString() string { return "23bfbfff" } func (*Cli) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Cli) GetRetVal() error { + return nil +} func (m *Cli) Size() (size int) { if m == nil { @@ -154,6 +163,9 @@ func (*CliInband) GetCrcString() string { return "f8377302" } func (*CliInband) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *CliInband) GetRetVal() error { + return nil +} func (m *CliInband) Size() (size int) { if m == nil { @@ -188,6 +200,9 @@ func (*CliInbandReply) GetCrcString() string { return "05879051" } func (*CliInbandReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CliInbandReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CliInbandReply) Size() (size int) { if m == nil { @@ -225,6 +240,9 @@ func (*CliReply) GetCrcString() string { return "06d68297" } func (*CliReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *CliReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *CliReply) Size() (size int) { if m == nil { @@ -261,6 +279,9 @@ func (*GetF64EndianValue) GetCrcString() string { return "809fcd44" } func (*GetF64EndianValue) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *GetF64EndianValue) GetRetVal() error { + return nil +} func (m *GetF64EndianValue) Size() (size int) { if m == nil { @@ -295,6 +316,9 @@ func (*GetF64EndianValueReply) GetCrcString() string { return "7e02e404" } func (*GetF64EndianValueReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *GetF64EndianValueReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *GetF64EndianValueReply) Size() (size int) { if m == nil { @@ -331,6 +355,9 @@ func (*GetF64IncrementByOne) GetCrcString() string { return "b64f027e" } func (*GetF64IncrementByOne) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *GetF64IncrementByOne) GetRetVal() error { + return nil +} func (m *GetF64IncrementByOne) Size() (size int) { if m == nil { @@ -365,6 +392,9 @@ func (*GetF64IncrementByOneReply) GetCrcString() string { return "d25dbaa3" } func (*GetF64IncrementByOneReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *GetF64IncrementByOneReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *GetF64IncrementByOneReply) Size() (size int) { if m == nil { @@ -402,6 +432,9 @@ func (*GetNextIndex) GetCrcString() string { return "2457116d" } func (*GetNextIndex) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *GetNextIndex) GetRetVal() error { + return nil +} func (m *GetNextIndex) Size() (size int) { if m == nil { @@ -439,6 +472,9 @@ func (*GetNextIndexReply) GetCrcString() string { return "2ed75f32" } func (*GetNextIndexReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *GetNextIndexReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *GetNextIndexReply) Size() (size int) { if m == nil { @@ -473,6 +509,9 @@ func (*GetNodeGraph) GetCrcString() string { return "51077d14" } func (*GetNodeGraph) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *GetNodeGraph) GetRetVal() error { + return nil +} func (m *GetNodeGraph) Size() (size int) { if m == nil { @@ -503,6 +542,9 @@ func (*GetNodeGraphReply) GetCrcString() string { return "06d68297" } func (*GetNodeGraphReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *GetNodeGraphReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *GetNodeGraphReply) Size() (size int) { if m == nil { @@ -539,6 +581,9 @@ func (*GetNodeIndex) GetCrcString() string { return "f1984c64" } func (*GetNodeIndex) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *GetNodeIndex) GetRetVal() error { + return nil +} func (m *GetNodeIndex) Size() (size int) { if m == nil { @@ -573,6 +618,9 @@ func (*GetNodeIndexReply) GetCrcString() string { return "a8600b89" } func (*GetNodeIndexReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *GetNodeIndexReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *GetNodeIndexReply) Size() (size int) { if m == nil { @@ -607,6 +655,9 @@ func (*ShowThreads) GetCrcString() string { return "51077d14" } func (*ShowThreads) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ShowThreads) GetRetVal() error { + return nil +} func (m *ShowThreads) Size() (size int) { if m == nil { @@ -638,6 +689,9 @@ func (*ShowThreadsReply) GetCrcString() string { return "efd78e83" } func (*ShowThreadsReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ShowThreadsReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *ShowThreadsReply) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/vmxnet3/vmxnet3.ba.go b/vpplink/binapi/vppapi/vmxnet3/vmxnet3.ba.go index 56e1fa02..c5a01bd8 100644 --- a/vpplink/binapi/vppapi/vmxnet3/vmxnet3.ba.go +++ b/vpplink/binapi/vppapi/vmxnet3/vmxnet3.ba.go @@ -64,6 +64,9 @@ func (*SwVmxnet3InterfaceDetails) GetCrcString() string { return "6a1a5498" } func (*SwVmxnet3InterfaceDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwVmxnet3InterfaceDetails) GetRetVal() error { + return nil +} func (m *SwVmxnet3InterfaceDetails) Size() (size int) { if m == nil { @@ -184,6 +187,9 @@ func (*SwVmxnet3InterfaceDump) GetCrcString() string { return "f9e6675e" } func (*SwVmxnet3InterfaceDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwVmxnet3InterfaceDump) GetRetVal() error { + return nil +} func (m *SwVmxnet3InterfaceDump) Size() (size int) { if m == nil { @@ -224,6 +230,9 @@ func (*Vmxnet3Create) GetCrcString() string { return "71a07314" } func (*Vmxnet3Create) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Vmxnet3Create) GetRetVal() error { + return nil +} func (m *Vmxnet3Create) Size() (size int) { if m == nil { @@ -279,6 +288,9 @@ func (*Vmxnet3CreateReply) GetCrcString() string { return "5383d31f" } func (*Vmxnet3CreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Vmxnet3CreateReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Vmxnet3CreateReply) Size() (size int) { if m == nil { @@ -315,6 +327,9 @@ func (*Vmxnet3Delete) GetCrcString() string { return "f9e6675e" } func (*Vmxnet3Delete) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Vmxnet3Delete) GetRetVal() error { + return nil +} func (m *Vmxnet3Delete) Size() (size int) { if m == nil { @@ -348,6 +363,9 @@ func (*Vmxnet3DeleteReply) GetCrcString() string { return "e8d4e804" } func (*Vmxnet3DeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Vmxnet3DeleteReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *Vmxnet3DeleteReply) Size() (size int) { if m == nil { @@ -390,6 +408,9 @@ func (*Vmxnet3Details) GetCrcString() string { return "6a1a5498" } func (*Vmxnet3Details) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *Vmxnet3Details) GetRetVal() error { + return nil +} func (m *Vmxnet3Details) Size() (size int) { if m == nil { @@ -509,6 +530,9 @@ func (*Vmxnet3Dump) GetCrcString() string { return "51077d14" } func (*Vmxnet3Dump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *Vmxnet3Dump) GetRetVal() error { + return nil +} func (m *Vmxnet3Dump) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/vpe/vpe.ba.go b/vpplink/binapi/vppapi/vpe/vpe.ba.go index 46766c2e..b60501b1 100644 --- a/vpplink/binapi/vppapi/vpe/vpe.ba.go +++ b/vpplink/binapi/vppapi/vpe/vpe.ba.go @@ -39,6 +39,9 @@ func (*LogDetails) GetCrcString() string { return "03d61cc0" } func (*LogDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *LogDetails) GetRetVal() error { + return nil +} func (m *LogDetails) Size() (size int) { if m == nil { @@ -81,6 +84,9 @@ func (*LogDump) GetCrcString() string { return "6ab31753" } func (*LogDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *LogDump) GetRetVal() error { + return nil +} func (m *LogDump) Size() (size int) { if m == nil { @@ -112,6 +118,9 @@ func (*ShowVersion) GetCrcString() string { return "51077d14" } func (*ShowVersion) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ShowVersion) GetRetVal() error { + return nil +} func (m *ShowVersion) Size() (size int) { if m == nil { @@ -145,6 +154,9 @@ func (*ShowVersionReply) GetCrcString() string { return "c919bde1" } func (*ShowVersionReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ShowVersionReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *ShowVersionReply) Size() (size int) { if m == nil { @@ -188,6 +200,9 @@ func (*ShowVpeSystemTime) GetCrcString() string { return "51077d14" } func (*ShowVpeSystemTime) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *ShowVpeSystemTime) GetRetVal() error { + return nil +} func (m *ShowVpeSystemTime) Size() (size int) { if m == nil { @@ -218,6 +233,9 @@ func (*ShowVpeSystemTimeReply) GetCrcString() string { return "7ffd8193" } func (*ShowVpeSystemTimeReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *ShowVpeSystemTimeReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *ShowVpeSystemTimeReply) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/vpe_types/vpe_types.ba.go b/vpplink/binapi/vppapi/vpe_types/vpe_types.ba.go index 02686780..271b8377 100644 --- a/vpplink/binapi/vppapi/vpe_types/vpe_types.ba.go +++ b/vpplink/binapi/vppapi/vpe_types/vpe_types.ba.go @@ -82,18 +82,22 @@ func NewTimestamp(t time.Time) Timestamp { ns := float64(sec) + float64(nsec/1e9) return Timestamp(ns) } + func (x Timestamp) ToTime() time.Time { ns := int64(x * 1e9) sec := ns / 1e9 nsec := ns % 1e9 return time.Unix(sec, nsec) } + func (x Timestamp) String() string { return x.ToTime().String() } + func (x *Timestamp) MarshalText() ([]byte, error) { return []byte(x.ToTime().Format(time.RFC3339Nano)), nil } + func (x *Timestamp) UnmarshalText(text []byte) error { t, err := time.Parse(time.RFC3339Nano, string(text)) if err != nil { diff --git a/vpplink/binapi/vppapi/vpp.go b/vpplink/binapi/vppapi/vpp.go new file mode 100644 index 00000000..ba98f840 --- /dev/null +++ b/vpplink/binapi/vppapi/vpp.go @@ -0,0 +1,122 @@ +// Copyright (C) 2021 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 vppapi + +import ( + "sync" + "time" + + govpp "git.fd.io/govpp.git" + vppapi "git.fd.io/govpp.git/api" + vppcore "git.fd.io/govpp.git/core" + "github.com/pkg/errors" + "github.com/sirupsen/logrus" +) + +const ( + DefaultReplyTimeout = 1 * time.Second + InvalidSwIfIndex = ^uint32(1) +) + +// Vpp is the base struct that exposes all the methods defined +// by the various wrappers. +// Depending on the available APIs, this struct will implement +// the various interfaces defined in git.fd.io/govpp.git/api/v1 +type Vpp struct { + lock sync.Mutex + conn *vppcore.Connection + ch vppapi.Channel + socket string + log *logrus.Entry +} + +func (v *Vpp) GetLog() *logrus.Entry { + return v.log +} + +func (v *Vpp) GetChannel() vppapi.Channel { + return v.ch +} + +func (v *Vpp) Lock() { + v.lock.Lock() +} + +func (v *Vpp) Unlock() { + v.lock.Unlock() +} + +func (v *Vpp) MakeNewChannel() (vppapi.Channel, error) { + return v.conn.NewAPIChannel() +} + +func NewVpp(socket string, logger *logrus.Entry) (*Vpp, error) { + conn, err := govpp.Connect(socket) + if err != nil { + return nil, errors.Wrapf(err, "cannot connect to VPP on socket %s", socket) + } + + ch, err := conn.NewAPIChannel() + if err != nil { + return nil, errors.Wrap(err, "channel creation failed") + } + + return &Vpp{ + conn: conn, + ch: ch, + socket: socket, + log: logger, + }, nil +} + +func (v *Vpp) Reconnect() (err error) { + v.conn, err = govpp.Connect(v.socket) + if err != nil { + return errors.Wrapf(err, "cannot re-connect to VPP on socket %s", v.socket) + } + v.ch, err = v.conn.NewAPIChannel() + if err != nil { + return errors.Wrap(err, "channel re-creation failed") + } + return nil +} + +func (v *Vpp) Close() error { + if v == nil { + return nil + } + if v.ch != nil { + v.ch.Close() + } + if v.conn != nil { + v.conn.Disconnect() + } + return nil +} + +func (v *Vpp) SendRequestAwaitReply(request, response vppapi.Message) error { + v.Lock() + defer v.Unlock() + + err := v.GetChannel().SendRequest(request).ReceiveReply(response) + if err != nil { + return errors.Wrapf(err, "API internal error, msg=%s", request.GetMessageName()) + } else if response.GetRetVal() != nil { + return response.GetRetVal() + } + + return nil +} diff --git a/vpplink/binapi/vppapi/vxlan/vxlan.ba.go b/vpplink/binapi/vppapi/vxlan/vxlan.ba.go index 78b7b50e..feae805e 100644 --- a/vpplink/binapi/vppapi/vxlan/vxlan.ba.go +++ b/vpplink/binapi/vppapi/vxlan/vxlan.ba.go @@ -39,6 +39,9 @@ func (*SwInterfaceSetVxlanBypass) GetCrcString() string { return "65247409" } func (*SwInterfaceSetVxlanBypass) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *SwInterfaceSetVxlanBypass) GetRetVal() error { + return nil +} func (m *SwInterfaceSetVxlanBypass) Size() (size int) { if m == nil { @@ -80,6 +83,9 @@ func (*SwInterfaceSetVxlanBypassReply) GetCrcString() string { return "e8d4e804" func (*SwInterfaceSetVxlanBypassReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *SwInterfaceSetVxlanBypassReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *SwInterfaceSetVxlanBypassReply) Size() (size int) { if m == nil { @@ -120,6 +126,9 @@ func (*VxlanAddDelTunnel) GetCrcString() string { return "0c09dc80" } func (*VxlanAddDelTunnel) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *VxlanAddDelTunnel) GetRetVal() error { + return nil +} func (m *VxlanAddDelTunnel) Size() (size int) { if m == nil { @@ -181,6 +190,9 @@ func (*VxlanAddDelTunnelReply) GetCrcString() string { return "5383d31f" } func (*VxlanAddDelTunnelReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *VxlanAddDelTunnelReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *VxlanAddDelTunnelReply) Size() (size int) { if m == nil { @@ -226,6 +238,9 @@ func (*VxlanAddDelTunnelV2) GetCrcString() string { return "4f223f40" } func (*VxlanAddDelTunnelV2) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *VxlanAddDelTunnelV2) GetRetVal() error { + return nil +} func (m *VxlanAddDelTunnelV2) Size() (size int) { if m == nil { @@ -293,6 +308,9 @@ func (*VxlanAddDelTunnelV2Reply) GetCrcString() string { return "5383d31f" } func (*VxlanAddDelTunnelV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *VxlanAddDelTunnelV2Reply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *VxlanAddDelTunnelV2Reply) Size() (size int) { if m == nil { @@ -339,6 +357,9 @@ func (*VxlanAddDelTunnelV3) GetCrcString() string { return "0072b037" } func (*VxlanAddDelTunnelV3) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *VxlanAddDelTunnelV3) GetRetVal() error { + return nil +} func (m *VxlanAddDelTunnelV3) Size() (size int) { if m == nil { @@ -409,6 +430,9 @@ func (*VxlanAddDelTunnelV3Reply) GetCrcString() string { return "5383d31f" } func (*VxlanAddDelTunnelV3Reply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *VxlanAddDelTunnelV3Reply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *VxlanAddDelTunnelV3Reply) Size() (size int) { if m == nil { @@ -447,6 +471,9 @@ func (*VxlanOffloadRx) GetCrcString() string { return "9cc95087" } func (*VxlanOffloadRx) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *VxlanOffloadRx) GetRetVal() error { + return nil +} func (m *VxlanOffloadRx) Size() (size int) { if m == nil { @@ -486,6 +513,9 @@ func (*VxlanOffloadRxReply) GetCrcString() string { return "e8d4e804" } func (*VxlanOffloadRxReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *VxlanOffloadRxReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *VxlanOffloadRxReply) Size() (size int) { if m == nil { @@ -526,6 +556,9 @@ func (*VxlanTunnelDetails) GetCrcString() string { return "c3916cb1" } func (*VxlanTunnelDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *VxlanTunnelDetails) GetRetVal() error { + return nil +} func (m *VxlanTunnelDetails) Size() (size int) { if m == nil { @@ -586,6 +619,9 @@ func (*VxlanTunnelDump) GetCrcString() string { return "f9e6675e" } func (*VxlanTunnelDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *VxlanTunnelDump) GetRetVal() error { + return nil +} func (m *VxlanTunnelDump) Size() (size int) { if m == nil { @@ -628,6 +664,9 @@ func (*VxlanTunnelV2Details) GetCrcString() string { return "d3bdd4d9" } func (*VxlanTunnelV2Details) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *VxlanTunnelV2Details) GetRetVal() error { + return nil +} func (m *VxlanTunnelV2Details) Size() (size int) { if m == nil { @@ -694,6 +733,9 @@ func (*VxlanTunnelV2Dump) GetCrcString() string { return "f9e6675e" } func (*VxlanTunnelV2Dump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *VxlanTunnelV2Dump) GetRetVal() error { + return nil +} func (m *VxlanTunnelV2Dump) Size() (size int) { if m == nil { diff --git a/vpplink/binapi/vppapi/wireguard/wireguard.ba.go b/vpplink/binapi/vppapi/wireguard/wireguard.ba.go index 7315811d..7f078d52 100644 --- a/vpplink/binapi/vppapi/wireguard/wireguard.ba.go +++ b/vpplink/binapi/vppapi/wireguard/wireguard.ba.go @@ -114,6 +114,9 @@ func (*WantWireguardPeerEvents) GetCrcString() string { return "3bc666c8" } func (*WantWireguardPeerEvents) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *WantWireguardPeerEvents) GetRetVal() error { + return nil +} func (m *WantWireguardPeerEvents) Size() (size int) { if m == nil { @@ -159,6 +162,9 @@ func (*WantWireguardPeerEventsReply) GetCrcString() string { return "e8d4e804" } func (*WantWireguardPeerEventsReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *WantWireguardPeerEventsReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *WantWireguardPeerEventsReply) Size() (size int) { if m == nil { @@ -193,6 +199,9 @@ func (*WgSetAsyncMode) GetCrcString() string { return "a6465f7c" } func (*WgSetAsyncMode) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *WgSetAsyncMode) GetRetVal() error { + return nil +} func (m *WgSetAsyncMode) Size() (size int) { if m == nil { @@ -227,6 +236,9 @@ func (*WgSetAsyncModeReply) GetCrcString() string { return "e8d4e804" } func (*WgSetAsyncModeReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *WgSetAsyncModeReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *WgSetAsyncModeReply) Size() (size int) { if m == nil { @@ -262,6 +274,9 @@ func (*WireguardInterfaceCreate) GetCrcString() string { return "a530137e" } func (*WireguardInterfaceCreate) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *WireguardInterfaceCreate) GetRetVal() error { + return nil +} func (m *WireguardInterfaceCreate) Size() (size int) { if m == nil { @@ -322,6 +337,9 @@ func (*WireguardInterfaceCreateReply) GetCrcString() string { return "5383d31f" func (*WireguardInterfaceCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *WireguardInterfaceCreateReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *WireguardInterfaceCreateReply) Size() (size int) { if m == nil { @@ -359,6 +377,9 @@ func (*WireguardInterfaceDelete) GetCrcString() string { return "f9e6675e" } func (*WireguardInterfaceDelete) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *WireguardInterfaceDelete) GetRetVal() error { + return nil +} func (m *WireguardInterfaceDelete) Size() (size int) { if m == nil { @@ -395,6 +416,9 @@ func (*WireguardInterfaceDeleteReply) GetCrcString() string { return "e8d4e804" func (*WireguardInterfaceDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *WireguardInterfaceDeleteReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *WireguardInterfaceDeleteReply) Size() (size int) { if m == nil { @@ -429,6 +453,9 @@ func (*WireguardInterfaceDetails) GetCrcString() string { return "0dd4865d" } func (*WireguardInterfaceDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *WireguardInterfaceDetails) GetRetVal() error { + return nil +} func (m *WireguardInterfaceDetails) Size() (size int) { if m == nil { @@ -484,6 +511,9 @@ func (*WireguardInterfaceDump) GetCrcString() string { return "2c954158" } func (*WireguardInterfaceDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *WireguardInterfaceDump) GetRetVal() error { + return nil +} func (m *WireguardInterfaceDump) Size() (size int) { if m == nil { @@ -521,6 +551,9 @@ func (*WireguardPeerAdd) GetCrcString() string { return "aedf8d59" } func (*WireguardPeerAdd) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *WireguardPeerAdd) GetRetVal() error { + return nil +} func (m *WireguardPeerAdd) Size() (size int) { if m == nil { @@ -606,6 +639,9 @@ func (*WireguardPeerAddReply) GetCrcString() string { return "084a0cd3" } func (*WireguardPeerAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *WireguardPeerAddReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *WireguardPeerAddReply) Size() (size int) { if m == nil { @@ -645,6 +681,9 @@ func (*WireguardPeerEvent) GetCrcString() string { return "4e1b5d67" } func (*WireguardPeerEvent) GetMessageType() api.MessageType { return api.EventMessage } +func (m *WireguardPeerEvent) GetRetVal() error { + return nil +} func (m *WireguardPeerEvent) Size() (size int) { if m == nil { @@ -685,6 +724,9 @@ func (*WireguardPeerRemove) GetCrcString() string { return "3b74607a" } func (*WireguardPeerRemove) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *WireguardPeerRemove) GetRetVal() error { + return nil +} func (m *WireguardPeerRemove) Size() (size int) { if m == nil { @@ -719,6 +761,9 @@ func (*WireguardPeerRemoveReply) GetCrcString() string { return "e8d4e804" } func (*WireguardPeerRemoveReply) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *WireguardPeerRemoveReply) GetRetVal() error { + return api.RetvalToVPPApiError(m.Retval) +} func (m *WireguardPeerRemoveReply) Size() (size int) { if m == nil { @@ -753,6 +798,9 @@ func (*WireguardPeersDetails) GetCrcString() string { return "29269d0e" } func (*WireguardPeersDetails) GetMessageType() api.MessageType { return api.ReplyMessage } +func (m *WireguardPeersDetails) GetRetVal() error { + return nil +} func (m *WireguardPeersDetails) Size() (size int) { if m == nil { @@ -837,6 +885,9 @@ func (*WireguardPeersDump) GetCrcString() string { return "3b74607a" } func (*WireguardPeersDump) GetMessageType() api.MessageType { return api.RequestMessage } +func (m *WireguardPeersDump) GetRetVal() error { + return nil +} func (m *WireguardPeersDump) Size() (size int) { if m == nil { diff --git a/vpplink/capo.go b/vpplink/capo.go index a8db2fa5..57085c94 100644 --- a/vpplink/capo.go +++ b/vpplink/capo.go @@ -25,13 +25,13 @@ import ( ) func (v *VppLink) IpsetCreate(ipsetType types.IpsetType) (setId uint32, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &capo.CapoIpsetCreateReply{} request := &capo.CapoIpsetCreate{ Type: capo.CapoIpsetType(ipsetType), } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return types.InvalidID, errors.Wrapf(err, "CapoIpsetCreate failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { @@ -41,13 +41,13 @@ func (v *VppLink) IpsetCreate(ipsetType types.IpsetType) (setId uint32, err erro } func (v *VppLink) IpsetDelete(ipsetID uint32) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &capo.CapoIpsetDeleteReply{} request := &capo.CapoIpsetDelete{ SetID: ipsetID, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "CapoIpsetDelete failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { @@ -57,8 +57,8 @@ func (v *VppLink) IpsetDelete(ipsetID uint32) (err error) { } func (v *VppLink) addDelIpsetMembers(ipsetID uint32, isAdd bool, members []capo.CapoIpsetMember) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &capo.CapoIpsetAddDelMembersReply{} request := &capo.CapoIpsetAddDelMembers{ SetID: ipsetID, @@ -66,7 +66,7 @@ func (v *VppLink) addDelIpsetMembers(ipsetID uint32, isAdd bool, members []capo. Len: uint32(len(members)), Members: members, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "CapoIpsetAddDelMembers failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { @@ -128,13 +128,13 @@ func (v *VppLink) DelIpsetIPPortMembers(ipsetID uint32, members []types.IPPort) } func (v *VppLink) RuleCreate(rule *types.Rule) (ruleId uint32, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &capo.CapoRuleCreateReply{} request := &capo.CapoRuleCreate{ Rule: types.ToCapoRule(rule), } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return types.InvalidID, errors.Wrapf(err, "CapoRuleCreate failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { @@ -144,14 +144,14 @@ func (v *VppLink) RuleCreate(rule *types.Rule) (ruleId uint32, err error) { } func (v *VppLink) RuleUpdate(ruleId uint32, rule *types.Rule) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &capo.CapoRuleUpdateReply{} request := &capo.CapoRuleUpdate{ RuleID: ruleId, Rule: types.ToCapoRule(rule), } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "CapoRuleUpdate failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { @@ -161,13 +161,13 @@ func (v *VppLink) RuleUpdate(ruleId uint32, rule *types.Rule) (err error) { } func (v *VppLink) RuleDelete(ruleId uint32) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &capo.CapoRuleDeleteReply{} request := &capo.CapoRuleDelete{ RuleID: ruleId, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "CapoRuleDelete failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { @@ -177,13 +177,13 @@ func (v *VppLink) RuleDelete(ruleId uint32) (err error) { } func (v *VppLink) PolicyCreate(policy *types.Policy) (policyId uint32, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &capo.CapoPolicyCreateReply{} request := &capo.CapoPolicyCreate{ Rules: types.ToCapoPolicy(policy), } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return types.InvalidID, errors.Wrapf(err, "CapoPolicyCreate failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { @@ -193,14 +193,14 @@ func (v *VppLink) PolicyCreate(policy *types.Policy) (policyId uint32, err error } func (v *VppLink) PolicyUpdate(policyId uint32, policy *types.Policy) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &capo.CapoPolicyUpdateReply{} request := &capo.CapoPolicyUpdate{ PolicyID: policyId, Rules: types.ToCapoPolicy(policy), } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "CapoPolicyUpdate failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { @@ -210,13 +210,13 @@ func (v *VppLink) PolicyUpdate(policyId uint32, policy *types.Policy) (err error } func (v *VppLink) PolicyDelete(policyId uint32) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &capo.CapoPolicyDeleteReply{} request := &capo.CapoPolicyDelete{ PolicyID: policyId, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "CapoPolicyDelete failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { @@ -226,8 +226,8 @@ func (v *VppLink) PolicyDelete(policyId uint32) (err error) { } func (v *VppLink) ConfigurePolicies(swIfIndex uint32, conf *types.InterfaceConfig) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() ids := append(conf.IngressPolicyIDs, conf.EgressPolicyIDs...) ids = append(ids, conf.ProfileIDs...) response := &capo.CapoConfigurePoliciesReply{} @@ -238,7 +238,7 @@ func (v *VppLink) ConfigurePolicies(swIfIndex uint32, conf *types.InterfaceConfi TotalIds: uint32(len(conf.IngressPolicyIDs) + len(conf.EgressPolicyIDs) + len(conf.ProfileIDs)), PolicyIds: ids, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "CapoConfigurePolicies failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { diff --git a/vpplink/cnat.go b/vpplink/cnat.go index ead47237..7608db9c 100644 --- a/vpplink/cnat.go +++ b/vpplink/cnat.go @@ -34,12 +34,12 @@ const ( const InvalidID = ^uint32(0) func (v *VppLink) CnatPurge() error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &cnat.CnatSessionPurge{} response := &cnat.CnatSessionPurgeReply{} - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrap(err, "CNat purge failed") } else if response.Retval != 0 { @@ -49,8 +49,8 @@ func (v *VppLink) CnatPurge() error { } func (v *VppLink) CnatTranslateAdd(tr *types.CnatTranslateEntry) (id uint32, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() if len(tr.Backends) == 0 { return InvalidID, nil } @@ -75,7 +75,7 @@ func (v *VppLink) CnatTranslateAdd(tr *types.CnatTranslateEntry) (id uint32, err LbType: cnat.CnatLbType(tr.LbType), }, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return InvalidID, errors.Wrap(err, "Add/Upd CnatTranslate failed") } else if response.Retval != 0 { @@ -85,8 +85,8 @@ func (v *VppLink) CnatTranslateAdd(tr *types.CnatTranslateEntry) (id uint32, err } func (v *VppLink) CnatTranslateDel(id uint32) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() // corresponds to adding tr.Backends == [] if id == InvalidID { return nil @@ -94,7 +94,7 @@ func (v *VppLink) CnatTranslateDel(id uint32) (err error) { response := &cnat.CnatTranslationDelReply{} request := &cnat.CnatTranslationDel{ID: id} - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrap(err, "Deleting CnatTranslate failed") } else if response.Retval != 0 { @@ -104,8 +104,8 @@ func (v *VppLink) CnatTranslateDel(id uint32) (err error) { } func (v *VppLink) CnatSetSnatAddresses(v4, v6 net.IP) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &cnat.CnatSetSnatAddresses{ SnatIP4: types.ToVppIP4Address(v4), @@ -113,7 +113,7 @@ func (v *VppLink) CnatSetSnatAddresses(v4, v6 net.IP) (err error) { SwIfIndex: types.InvalidInterface, } response := &cnat.CnatSetSnatAddressesReply{} - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrap(err, "Setting SNAT addresses failed") } else if response.Retval != 0 { @@ -123,15 +123,15 @@ func (v *VppLink) CnatSetSnatAddresses(v4, v6 net.IP) (err error) { } func (v *VppLink) CnatAddDelSnatPrefix(prefix *net.IPNet, isAdd bool) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &cnat.CnatSnatPolicyAddDelExcludePfx{ IsAdd: BoolToU8(isAdd), Prefix: types.ToVppPrefix(prefix), } response := &cnat.CnatSnatPolicyAddDelExcludePfxReply{} - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "%s SNAT prefix failed", IsAddToStr(isAdd)) } else if response.Retval != 0 { @@ -161,15 +161,15 @@ func (v *VppLink) CnatEnableFeatures(swIfIndex uint32) (err error) { } func (v *VppLink) cnatSnatPolicyAddDelPodInterface(swIfIndex uint32, isAdd bool, table cnat.CnatSnatPolicyTable) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &cnat.CnatSnatPolicyAddDelIfReply{} request := &cnat.CnatSnatPolicyAddDelIf{ SwIfIndex: interface_types.InterfaceIndex(swIfIndex), IsAdd: BoolToU8(isAdd), Table: table, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "CnatSnatPolicyAddDelIf failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { @@ -201,13 +201,13 @@ func (v *VppLink) DisableCnatSNAT(swIfIndex uint32, isIp6 bool) (err error) { } func (v *VppLink) cnatSetSnatPolicy(pol cnat.CnatSnatPolicies) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &cnat.CnatSetSnatPolicyReply{} request := &cnat.CnatSetSnatPolicy{ Policy: pol, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "CnatSetSnatPolicy failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { diff --git a/vpplink/crypto_sw_scheduler.go b/vpplink/crypto_sw_scheduler.go index 9813c179..acc919b9 100644 --- a/vpplink/crypto_sw_scheduler.go +++ b/vpplink/crypto_sw_scheduler.go @@ -23,8 +23,8 @@ import ( ) func (v *VppLink) SetCryptoWorker(workerIndex uint32, enable bool) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &crypto_sw_scheduler.CryptoSwSchedulerSetWorkerReply{} request := &crypto_sw_scheduler.CryptoSwSchedulerSetWorker{ @@ -32,7 +32,7 @@ func (v *VppLink) SetCryptoWorker(workerIndex uint32, enable bool) error { CryptoEnable: enable, } - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrap(err, "crypto_sw_scheduler setWorker enable failed") } else if response.Retval != 0 { diff --git a/vpplink/feature.go b/vpplink/feature.go index 3023c106..338511ef 100644 --- a/vpplink/feature.go +++ b/vpplink/feature.go @@ -25,8 +25,8 @@ import ( ) func (v *VppLink) featureEnableDisable(swIfIndex uint32, isEnable bool, arcName, featureName string) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &feature.FeatureEnableDisableReply{} request := &feature.FeatureEnableDisable{ SwIfIndex: interface_types.InterfaceIndex(swIfIndex), @@ -34,7 +34,7 @@ func (v *VppLink) featureEnableDisable(swIfIndex uint32, isEnable bool, arcName, ArcName: arcName, FeatureName: featureName, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "FeatureEnableDisable failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { diff --git a/vpplink/ikev2.go b/vpplink/ikev2.go index 7ffb1145..8dfbc833 100644 --- a/vpplink/ikev2.go +++ b/vpplink/ikev2.go @@ -118,8 +118,8 @@ func (v *VppLink) DelIKEv2Profile(name string) error { } func (v *VppLink) addDelIKEv2Profile(name string, isAdd bool) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() if len(name) >= 64 { return errors.New("IKEv2 profile name too long (max 64)") @@ -129,23 +129,23 @@ func (v *VppLink) addDelIKEv2Profile(name string, isAdd bool) (err error) { IsAdd: isAdd, } response := &ikev2.Ikev2ProfileAddDelReply{} - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "failed to create IKEv2 profile %s", name) } else if response.Retval != 0 { return fmt.Errorf("failed to create IKEv2 profile %s (retval %d)", name, response.Retval) } - v.log.Debugf("created ikev2 profile %s", name) + v.GetLog().Debugf("created ikev2 profile %s", name) return nil } func (v *VppLink) ListIKEv2Profiles() ([]string, error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() profiles := make([]string, 0) request := &ikev2.Ikev2ProfileDump{} - stream := v.ch.SendMultiRequest(request) + stream := v.GetChannel().SendMultiRequest(request) for { response := &ikev2.Ikev2ProfileDetails{} stop, err := stream.ReceiveReply(response) @@ -161,8 +161,8 @@ func (v *VppLink) ListIKEv2Profiles() ([]string, error) { } func (v *VppLink) setIKEv2Auth(profile string, authMethod IKEv2AuthMethod, authData []byte) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() if len(profile) >= 64 { return errors.New("IKEv2 profile name too long (max 64)") @@ -174,13 +174,13 @@ func (v *VppLink) setIKEv2Auth(profile string, authMethod IKEv2AuthMethod, authD Data: authData, } response := &ikev2.Ikev2ProfileSetAuthReply{} - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "failed to set IKEv2 auth for profile %s", profile) } else if response.Retval != 0 { return fmt.Errorf("failed to set IKEv2 auth for profile %s (retval %d)", profile, response.Retval) } - v.log.Debugf("set auth method for profile %s to %d", profile, authMethod) + v.GetLog().Debugf("set auth method for profile %s to %d", profile, authMethod) return nil } @@ -189,8 +189,8 @@ func (v *VppLink) SetIKEv2PSKAuth(profile, psk string) (err error) { } func (v *VppLink) setIKEv2ID(profile string, isLocal bool, idType IKEv2IDType, id []byte) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() if len(profile) >= 64 { return errors.New("IKEv2 profile name too long (max 64)") @@ -202,13 +202,13 @@ func (v *VppLink) setIKEv2ID(profile string, isLocal bool, idType IKEv2IDType, i Data: id, } response := &ikev2.Ikev2ProfileSetIDReply{} - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "failed to set IKEv2 ID %t for profile %s", isLocal, profile) } else if response.Retval != 0 { return fmt.Errorf("failed to set IKEv2 ID %t for profile %s (retval %d)", isLocal, profile, response.Retval) } - v.log.Debugf("set IKEv2 ID %t for profile %s", isLocal, profile) + v.GetLog().Debugf("set IKEv2 ID %t for profile %s", isLocal, profile) return nil } @@ -235,8 +235,8 @@ func (v *VppLink) SetIKEv2TrafficSelector( startAddr net.IP, endAddr net.IP, ) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() if len(profile) >= 64 { return errors.New("IKEv2 profile name too long (max 64)") @@ -256,13 +256,13 @@ func (v *VppLink) SetIKEv2TrafficSelector( }, } response := &ikev2.Ikev2ProfileSetTsReply{} - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "failed to set IKEv2 traffic selector for profile %s", profile) } else if response.Retval != 0 { return fmt.Errorf("failed to set IKEv2 traffic selector for profile %s (retval %d)", profile, response.Retval) } - v.log.Debugf("set traffic selector for profile %s", profile) + v.GetLog().Debugf("set traffic selector for profile %s", profile) return nil } @@ -280,8 +280,8 @@ func (v *VppLink) SetIKEv2ESPTransforms( cryptoKeySize uint32, integAlg IKEv2IntegrityAlgorithm, ) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() if len(profile) >= 64 { return errors.New("IKEv2 profile name too long (max 64)") @@ -295,13 +295,13 @@ func (v *VppLink) SetIKEv2ESPTransforms( }, } response := &ikev2.Ikev2SetEspTransformsReply{} - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "failed to set ESP transforms for profile %s", profile) } else if response.Retval != 0 { return fmt.Errorf("failed to set ESP transforms for profile %s (retval %d)", profile, response.Retval) } - v.log.Debugf("set ESP transforms for profile %s", profile) + v.GetLog().Debugf("set ESP transforms for profile %s", profile) return nil } @@ -312,8 +312,8 @@ func (v *VppLink) SetIKEv2IKETransforms( integAlg IKEv2IntegrityAlgorithm, dhGroup IKEv2DHGroup, ) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() if len(profile) >= 64 { return errors.New("IKEv2 profile name too long (max 64)") @@ -328,13 +328,13 @@ func (v *VppLink) SetIKEv2IKETransforms( }, } response := &ikev2.Ikev2SetIkeTransformsReply{} - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "failed to set IKE transforms for profile %s", profile) } else if response.Retval != 0 { return fmt.Errorf("failed to set IKE transforms for profile %s (retval %d)", profile, response.Retval) } - v.log.Debugf("set IKE transforms for profile %s", profile) + v.GetLog().Debugf("set IKE transforms for profile %s", profile) return nil } @@ -358,8 +358,8 @@ func (v *VppLink) SetIKEv2DefaultTransforms(profile string) (err error) { } func (v *VppLink) SetIKEv2Responder(profile string, swIfIndex uint32, address net.IP) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() if len(profile) >= 64 { return errors.New("IKEv2 profile name too long (max 64)") @@ -376,19 +376,19 @@ func (v *VppLink) SetIKEv2Responder(profile string, swIfIndex uint32, address ne }, } response := &ikev2.Ikev2SetResponderReply{} - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "failed to set IKE responder for profile %s", profile) } else if response.Retval != 0 { return fmt.Errorf("failed to set IKE responder for profile %s (retval %d)", profile, response.Retval) } - v.log.Debugf("set IKE responder for profile %s, interface %d addr %v", profile, swIfIndex, vppAddr) + v.GetLog().Debugf("set IKE responder for profile %s, interface %d addr %v", profile, swIfIndex, vppAddr) return nil } func (v *VppLink) SetIKEv2TunnelInterface(profile string, swIfIndex uint32) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() if len(profile) >= 64 { return errors.New("IKEv2 profile name too long (max 64)") @@ -398,19 +398,19 @@ func (v *VppLink) SetIKEv2TunnelInterface(profile string, swIfIndex uint32) (err SwIfIndex: interface_types.InterfaceIndex(swIfIndex), } response := &ikev2.Ikev2SetTunnelInterfaceReply{} - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "failed to set IKE tunnel interface for profile %s", profile) } else if response.Retval != 0 { return fmt.Errorf("failed to set IKE tunnel interface for profile %s (retval %d)", profile, response.Retval) } - v.log.Debugf("set IKE tunnel interface for profile %s", profile) + v.GetLog().Debugf("set IKE tunnel interface for profile %s", profile) return nil } func (v *VppLink) IKEv2Initiate(profile string) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() if len(profile) >= 64 { return errors.New("IKEv2 profile name too long (max 64)") @@ -419,12 +419,12 @@ func (v *VppLink) IKEv2Initiate(profile string) (err error) { Name: profile, } response := &ikev2.Ikev2InitiateSaInitReply{} - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "failed to initiate IKE for profile %s", profile) } else if response.Retval != 0 { return fmt.Errorf("failed to initiate IKE for profile %s (retval %d)", profile, response.Retval) } - v.log.Debugf("initiated IKE for profile %s", profile) + v.GetLog().Debugf("initiated IKE for profile %s", profile) return nil } diff --git a/vpplink/interfaces.go b/vpplink/interfaces.go index ba0a511c..d0207426 100644 --- a/vpplink/interfaces.go +++ b/vpplink/interfaces.go @@ -42,8 +42,8 @@ const ( type NamespaceNotFound error func (v *VppLink) SetInterfaceMtu(swIfIndex uint32, mtu int) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() mtus := make([]uint32, 4) mtus[interface_types.MTU_PROTO_API_L3] = uint32(mtu) response := &interfaces.SwInterfaceSetMtuReply{} @@ -51,7 +51,7 @@ func (v *VppLink) SetInterfaceMtu(swIfIndex uint32, mtu int) error { SwIfIndex: interface_types.InterfaceIndex(swIfIndex), Mtu: mtus, } - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "SwInterfaceSetMtu failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { @@ -61,8 +61,8 @@ func (v *VppLink) SetInterfaceMtu(swIfIndex uint32, mtu int) error { } func (v *VppLink) SetInterfaceRxMode(swIfIndex uint32, queueID uint32, mode types.RxMode) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &interfaces.SwInterfaceSetRxModeReply{} request := &interfaces.SwInterfaceSetRxMode{ SwIfIndex: interface_types.InterfaceIndex(swIfIndex), @@ -70,7 +70,7 @@ func (v *VppLink) SetInterfaceRxMode(swIfIndex uint32, queueID uint32, mode type QueueID: queueID, Mode: interface_types.RxMode(mode), } - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "SetInterfaceRxMode failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { @@ -80,14 +80,14 @@ func (v *VppLink) SetInterfaceRxMode(swIfIndex uint32, queueID uint32, mode type } func (v *VppLink) SetInterfaceMacAddress(swIfIndex uint32, mac *net.HardwareAddr) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &interfaces.SwInterfaceSetMacAddressReply{} request := &interfaces.SwInterfaceSetMacAddress{ SwIfIndex: interface_types.InterfaceIndex(swIfIndex), MacAddress: types.ToVppMacAddress(mac), } - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "SwInterfaceSetMacAddress failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { @@ -97,15 +97,15 @@ func (v *VppLink) SetInterfaceMacAddress(swIfIndex uint32, mac *net.HardwareAddr } func (v *VppLink) SetInterfaceVRF(swIfIndex, vrfIndex uint32, isIP6 bool) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &interfaces.SwInterfaceSetTableReply{} request := &interfaces.SwInterfaceSetTable{ SwIfIndex: interface_types.InterfaceIndex(swIfIndex), IsIPv6: isIP6, VrfID: vrfIndex, } - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "SwInterfaceSetTable failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { @@ -165,9 +165,9 @@ func (v *VppLink) CreateTapV2(tap *types.TapV2) (swIfIndex uint32, err error) { request.HostMacAddr = types.ToVppMacAddress(&tap.HostMacAddress) request.HostMacAddrSet = true } - v.lock.Lock() - err = v.ch.SendRequest(request).ReceiveReply(response) - v.lock.Unlock() + v.Lock() + err = v.GetChannel().SendRequest(request).ReceiveReply(response) + v.Unlock() if err != nil { return INVALID_SW_IF_INDEX, errors.Wrap(err, "Tap creation request failed") @@ -191,8 +191,8 @@ func (v *VppLink) CreateOrAttachTapV2(tap *types.TapV2) (swIfIndex uint32, err e } func (v *VppLink) addDelInterfaceAddress(swIfIndex uint32, addr *net.IPNet, isAdd bool) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() if IsIP6(addr.IP) && addr.IP.IsLinkLocalUnicast() { _, bits := addr.Mask.Size() if bits != 128 { @@ -205,7 +205,7 @@ func (v *VppLink) addDelInterfaceAddress(swIfIndex uint32, addr *net.IPNet, isAd Prefix: types.ToVppAddressWithPrefix(addr), } response := &interfaces.SwInterfaceAddDelAddressReply{} - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "Adding IP address failed: req %+v reply %+v", request, response) } @@ -221,8 +221,8 @@ func (v *VppLink) AddInterfaceAddress(swIfIndex uint32, addr *net.IPNet) error { } func (v *VppLink) setUnsetInterfaceTag(swIfIndex uint32, tag string, isAdd bool) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &interfaces.SwInterfaceTagAddDel{ IsAdd: isAdd, @@ -230,7 +230,7 @@ func (v *VppLink) setUnsetInterfaceTag(swIfIndex uint32, tag string, isAdd bool) Tag: tag, } response := &interfaces.SwInterfaceTagAddDelReply{} - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil || response.Retval != 0 { return fmt.Errorf("cannot add interface tag: %v %d", err, response.Retval) } @@ -246,14 +246,14 @@ func (v *VppLink) UnsetInterfaceTag(swIfIndex uint32, tag string) error { } func (v *VppLink) enableDisableInterfaceIP(swIfIndex uint32, isIP6 bool, isEnable bool) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &vppip.SwInterfaceIP6EnableDisableReply{} request := &vppip.SwInterfaceIP6EnableDisable{ Enable: isEnable, SwIfIndex: interface_types.InterfaceIndex(swIfIndex), } - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "SwInterfaceIP6EnableDisable failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { @@ -313,25 +313,25 @@ func (v *VppLink) SearchInterfacesWithTagPrefix(tag string) (map[string]uint32, } func (v *VppLink) searchInterfaceWithTagOrTagPrefix(tag string, prefix bool) (err error, swIfIndex uint32, swIfIndexes map[string]uint32) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() swIfIndex = INVALID_SW_IF_INDEX swIfIndexes = make(map[string]uint32) request := &interfaces.SwInterfaceDump{} - stream := v.ch.SendMultiRequest(request) + stream := v.GetChannel().SendMultiRequest(request) for { response := &interfaces.SwInterfaceDetails{} stop, err := stream.ReceiveReply(response) if err != nil { - v.log.Errorf("error listing VPP interfaces: %v", err) + v.GetLog().Errorf("error listing VPP interfaces: %v", err) return err, INVALID_SW_IF_INDEX, swIfIndexes } if stop { break } intfTag := string(bytes.Trim([]byte(response.Tag), "\x00")) - v.log.Debugf("found interface %d, tag: %s (len %d)", response.SwIfIndex, intfTag, len(intfTag)) + v.GetLog().Debugf("found interface %d, tag: %s (len %d)", response.SwIfIndex, intfTag, len(intfTag)) if intfTag == tag && !prefix { swIfIndex = uint32(response.SwIfIndex) } @@ -347,62 +347,62 @@ func (v *VppLink) searchInterfaceWithTagOrTagPrefix(tag string, prefix bool) (er } func (v *VppLink) SearchInterfaceWithName(name string) (err error, swIfIndex uint32) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() swIfIndex = INVALID_SW_IF_INDEX request := &interfaces.SwInterfaceDump{ SwIfIndex: interface_types.InterfaceIndex(INVALID_SW_IF_INDEX), // TODO: filter by name with NameFilter } - reqCtx := v.ch.SendMultiRequest(request) + reqCtx := v.GetChannel().SendMultiRequest(request) for { response := &interfaces.SwInterfaceDetails{} stop, err := reqCtx.ReceiveReply(response) if err != nil { - v.log.Errorf("SwInterfaceDump failed: %v", err) + v.GetLog().Errorf("SwInterfaceDump failed: %v", err) return err, INVALID_SW_IF_INDEX } if stop { break } interfaceName := string(bytes.Trim([]byte(response.InterfaceName), "\x00")) - v.log.Debugf("Found interface: %s", interfaceName) + v.GetLog().Debugf("Found interface: %s", interfaceName) if interfaceName == name { swIfIndex = uint32(response.SwIfIndex) } } if swIfIndex == INVALID_SW_IF_INDEX { - v.log.Errorf("Interface %s not found", name) + v.GetLog().Errorf("Interface %s not found", name) return errors.New("Interface not found"), INVALID_SW_IF_INDEX } return nil, swIfIndex } func (v *VppLink) GetInterfaceDetails(swIfIndex uint32) (i *types.VppInterfaceDetails, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &interfaces.SwInterfaceDump{ SwIfIndex: interface_types.InterfaceIndex(swIfIndex), } - stream := v.ch.SendMultiRequest(request) + stream := v.GetChannel().SendMultiRequest(request) for { response := &interfaces.SwInterfaceDetails{} stop, err := stream.ReceiveReply(response) if err != nil { - v.log.Errorf("error listing VPP interfaces: %v", err) + v.GetLog().Errorf("error listing VPP interfaces: %v", err) return nil, err } if stop { break } if uint32(response.SwIfIndex) != swIfIndex { - v.log.Debugf("Got interface that doesn't match filter, fix vpp") + v.GetLog().Debugf("Got interface that doesn't match filter, fix vpp") continue } - v.log.Debugf("found interface %d", response.SwIfIndex) + v.GetLog().Debugf("found interface %d", response.SwIfIndex) i = &types.VppInterfaceDetails{ SwIfIndex: uint32(response.SwIfIndex), IsUp: response.Flags&interface_types.IF_STATUS_API_FLAG_ADMIN_UP > 0, @@ -418,8 +418,8 @@ func (v *VppLink) GetInterfaceDetails(swIfIndex uint32) (i *types.VppInterfaceDe } func (v *VppLink) interfaceAdminUpDown(swIfIndex uint32, up bool) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() var f interface_types.IfStatusFlags = 0 if up { @@ -431,7 +431,7 @@ func (v *VppLink) interfaceAdminUpDown(swIfIndex uint32, up bool) error { Flags: f, } response := &interfaces.SwInterfaceSetFlagsReply{} - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "setting interface up/down failed") } @@ -447,8 +447,8 @@ func (v *VppLink) InterfaceAdminUp(swIfIndex uint32) error { } func (v *VppLink) GetInterfaceNeighbors(swIfIndex uint32, isIPv6 bool) (err error, neighbors []types.Neighbor) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &ip_neighbor.IPNeighborDump{ SwIfIndex: interface_types.InterfaceIndex(swIfIndex), @@ -458,11 +458,11 @@ func (v *VppLink) GetInterfaceNeighbors(swIfIndex uint32, isIPv6 bool) (err erro request.Af = ip_types.ADDRESS_IP6 } response := &ip_neighbor.IPNeighborDetails{} - stream := v.ch.SendMultiRequest(request) + stream := v.GetChannel().SendMultiRequest(request) for { stop, err := stream.ReceiveReply(response) if err != nil { - v.log.Errorf("error listing VPP neighbors: %v", err) + v.GetLog().Errorf("error listing VPP neighbors: %v", err) return err, nil } if stop { @@ -479,14 +479,14 @@ func (v *VppLink) GetInterfaceNeighbors(swIfIndex uint32, isIPv6 bool) (err erro } func (v *VppLink) DelTap(swIfIndex uint32) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &tapv2.TapDeleteV2{ SwIfIndex: interface_types.InterfaceIndex(swIfIndex), } response := &tapv2.TapDeleteV2Reply{} - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrap(err, "failed to delete tap from VPP") } @@ -494,8 +494,8 @@ func (v *VppLink) DelTap(swIfIndex uint32) error { } func (v *VppLink) interfaceSetUnnumbered(unnumberedSwIfIndex uint32, swIfIndex uint32, isAdd bool) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &interfaces.SwInterfaceSetUnnumbered{ SwIfIndex: interface_types.InterfaceIndex(swIfIndex), @@ -503,7 +503,7 @@ func (v *VppLink) interfaceSetUnnumbered(unnumberedSwIfIndex uint32, swIfIndex u IsAdd: isAdd, } response := &interfaces.SwInterfaceSetUnnumberedReply{} - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "setting interface unnumbered failed %d -> %d", unnumberedSwIfIndex, swIfIndex) } @@ -511,14 +511,14 @@ func (v *VppLink) interfaceSetUnnumbered(unnumberedSwIfIndex uint32, swIfIndex u } func (v *VppLink) AddrList(swIfIndex uint32, isv6 bool) (addresses []types.IfAddress, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &vppip.IPAddressDump{ SwIfIndex: interface_types.InterfaceIndex(swIfIndex), IsIPv6: isv6, } - stream := v.ch.SendMultiRequest(request) + stream := v.GetChannel().SendMultiRequest(request) for { response := &vppip.IPAddressDetails{} stop, err := stream.ReceiveReply(response) @@ -546,14 +546,14 @@ func (v *VppLink) InterfaceUnsetUnnumbered(unnumberedSwIfIndex uint32, swIfIndex } func (v *VppLink) enableDisableGso(swIfIndex uint32, enable bool) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &gso.FeatureGsoEnableDisable{ SwIfIndex: interface_types.InterfaceIndex(swIfIndex), EnableDisable: enable, } response := &gso.FeatureGsoEnableDisableReply{} - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil || response.Retval != 0 { return fmt.Errorf("cannot configure gso: %v %d", err, response.Retval) } @@ -561,14 +561,14 @@ func (v *VppLink) enableDisableGso(swIfIndex uint32, enable bool) error { } func (v *VppLink) setInterfacePromiscuous(swIfIndex uint32, promiscOn bool) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &interfaces.SwInterfaceSetPromisc{ SwIfIndex: interface_types.InterfaceIndex(swIfIndex), PromiscOn: promiscOn, } response := &interfaces.SwInterfaceSetPromiscReply{} - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil || response.Retval != 0 { return fmt.Errorf("cannot configure gso: %v %d", err, response.Retval) } @@ -592,8 +592,8 @@ func (v *VppLink) DisableGSOFeature(swIfIndex uint32) error { } func (v *VppLink) SetInterfaceTxPlacement(swIfIndex uint32, queue int, worker int) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &interfaces.SwInterfaceSetTxPlacement{ SwIfIndex: interface_types.InterfaceIndex(swIfIndex), @@ -602,7 +602,7 @@ func (v *VppLink) SetInterfaceTxPlacement(swIfIndex uint32, queue int, worker in Threads: []uint32{uint32(worker)}, } response := &interfaces.SwInterfaceSetTxPlacementReply{} - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil || response.Retval != 0 { return fmt.Errorf("cannot set interface tx placement: %v %d", err, response.Retval) } @@ -610,8 +610,8 @@ func (v *VppLink) SetInterfaceTxPlacement(swIfIndex uint32, queue int, worker in } func (v *VppLink) SetInterfaceRxPlacement(swIfIndex uint32, queue int, worker int, main bool) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &interfaces.SwInterfaceSetRxPlacement{ SwIfIndex: interface_types.InterfaceIndex(swIfIndex), @@ -620,7 +620,7 @@ func (v *VppLink) SetInterfaceRxPlacement(swIfIndex uint32, queue int, worker in IsMain: main, } response := &interfaces.SwInterfaceSetRxPlacementReply{} - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil || response.Retval != 0 { return fmt.Errorf("cannot set interface rx placement: %v %d", err, response.Retval) } @@ -628,13 +628,13 @@ func (v *VppLink) SetInterfaceRxPlacement(swIfIndex uint32, queue int, worker in } func (v *VppLink) CreateLoopback(hwAddr *net.HardwareAddr) (swIfIndex uint32, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &interfaces.CreateLoopback{ MacAddress: types.ToVppMacAddress(hwAddr), } response := &interfaces.CreateLoopbackReply{} - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil || response.Retval != 0 { return 0, errors.Wrapf(err, "Error adding loopback: req %+v reply %+v", request, response) } @@ -642,13 +642,13 @@ func (v *VppLink) CreateLoopback(hwAddr *net.HardwareAddr) (swIfIndex uint32, er } func (v *VppLink) DeleteLoopback(swIfIndex uint32) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &interfaces.DeleteLoopback{ SwIfIndex: interface_types.InterfaceIndex(swIfIndex), } response := &interfaces.DeleteLoopbackReply{} - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil || response.Retval != 0 { return errors.Wrapf(err, "Error deleting loopback: req %+v reply %+v", request, response) } diff --git a/vpplink/ip.go b/vpplink/ip.go index 94a16a90..a9413847 100644 --- a/vpplink/ip.go +++ b/vpplink/ip.go @@ -28,12 +28,12 @@ import ( ) func (v *VppLink) ListVRFs() (vrfs []types.VRF, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() vrfs = make([]types.VRF, 0) request := &vppip.IPTableDump{} - stream := v.ch.SendMultiRequest(request) + stream := v.GetChannel().SendMultiRequest(request) for { response := &vppip.IPTableDetails{} stop, err := stream.ReceiveReply(response) @@ -53,8 +53,8 @@ func (v *VppLink) ListVRFs() (vrfs []types.VRF, err error) { } func (v *VppLink) addDelVRF(index uint32, name string, isIP6 bool, isAdd bool) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &ip.IPTableAddDelReply{} request := &ip.IPTableAddDel{ IsAdd: isAdd, @@ -64,7 +64,7 @@ func (v *VppLink) addDelVRF(index uint32, name string, isIP6 bool, isAdd bool) e Name: name, }, } - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "IPTableAddDel failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { @@ -82,8 +82,8 @@ func (v *VppLink) DelVRF(index uint32, isIP6 bool) error { } func (v *VppLink) AllocateVRF(isIP6 bool, name string) (uint32, error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &ip.IPTableAllocateReply{} request := &ip.IPTableAllocate{ Table: ip.IPTable{ @@ -92,7 +92,7 @@ func (v *VppLink) AllocateVRF(isIP6 bool, name string) (uint32, error) { Name: name, }, } - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return types.InvalidID, errors.Wrapf(err, "IPTableAllocate failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { @@ -102,8 +102,8 @@ func (v *VppLink) AllocateVRF(isIP6 bool, name string) (uint32, error) { } func (v *VppLink) PuntRedirect(punt types.IpPuntRedirect, isIP6 bool) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &vppip.AddDelIPPuntRedirectV2{ Punt: vppip.PuntRedirectV2{ @@ -114,7 +114,7 @@ func (v *VppLink) PuntRedirect(punt types.IpPuntRedirect, isIP6 bool) error { IsAdd: true, } response := &vppip.AddDelIPPuntRedirectV2Reply{} - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil || response.Retval != 0 { return fmt.Errorf("cannot set punt in VPP: %v %d", err, response.Retval) } @@ -122,14 +122,14 @@ func (v *VppLink) PuntRedirect(punt types.IpPuntRedirect, isIP6 bool) error { } func (v *VppLink) PuntRedirectList(swIfIndex uint32, isIP6 bool) (punts []types.IpPuntRedirect, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &ip.IPPuntRedirectV2Dump{ SwIfIndex: interface_types.InterfaceIndex(swIfIndex), Af: types.GetBoolIPFamily(isIP6), } - stream := v.ch.SendMultiRequest(request) + stream := v.GetChannel().SendMultiRequest(request) punts = make([]types.IpPuntRedirect, 0) for { response := &ip.IPPuntRedirectV2Details{} @@ -151,8 +151,8 @@ func (v *VppLink) PuntRedirectList(swIfIndex uint32, isIP6 bool) (punts []types. // PuntL4 configures L4 punt for a given address family and protocol. port = ~0 means all ports func (v *VppLink) PuntL4(proto types.IPProto, port uint16, isIPv6 bool) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &punt.SetPunt{ Punt: punt.Punt{ Type: punt.PUNT_API_TYPE_L4, @@ -165,7 +165,7 @@ func (v *VppLink) PuntL4(proto types.IPProto, port uint16, isIPv6 bool) error { IsAdd: true, } response := &punt.SetPuntReply{} - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil || response.Retval != 0 { return fmt.Errorf("cannot set punt in VPP: %v %d", err, response.Retval) } diff --git a/vpplink/ip6_nd.go b/vpplink/ip6_nd.go index bb954a8b..9119a641 100644 --- a/vpplink/ip6_nd.go +++ b/vpplink/ip6_nd.go @@ -26,15 +26,15 @@ import ( ) func (v *VppLink) DisableIP6RouterAdvertisements(swIfIndex uint32) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &ip6_nd.SwInterfaceIP6ndRaConfigReply{} request := &ip6_nd.SwInterfaceIP6ndRaConfig{ SwIfIndex: interface_types.InterfaceIndex(swIfIndex), Suppress: 1, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "Disabling RA for swif %d failed", swIfIndex) } else if response.Retval != 0 { @@ -44,8 +44,8 @@ func (v *VppLink) DisableIP6RouterAdvertisements(swIfIndex uint32) (err error) { } func (v *VppLink) EnableIP6NdProxy(swIfIndex uint32, address net.IP) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &ip6_nd.IP6ndProxyAddDelReply{} request := &ip6_nd.IP6ndProxyAddDel{ @@ -53,7 +53,7 @@ func (v *VppLink) EnableIP6NdProxy(swIfIndex uint32, address net.IP) (err error) IP: types.ToVppIP6Address(address), SwIfIndex: interface_types.InterfaceIndex(swIfIndex), } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "Enabling IP6 ND Proxy swif %d failed", swIfIndex) } else if response.Retval != 0 { @@ -66,7 +66,7 @@ func (v *VppLink) EnableIP6NdProxy(swIfIndex uint32, address net.IP) (err error) SwIfIndex: interface_types.InterfaceIndex(swIfIndex), IsEnable: true, } - err = v.ch.SendRequest(req).ReceiveReply(resp) + err = v.GetChannel().SendRequest(req).ReceiveReply(resp) if err != nil { return errors.Wrapf(err, "Enabling nd swif %d failed", swIfIndex) } else if response.Retval != 0 { diff --git a/vpplink/ipsec.go b/vpplink/ipsec.go index 8f576fa6..1ed2b147 100644 --- a/vpplink/ipsec.go +++ b/vpplink/ipsec.go @@ -25,14 +25,14 @@ import ( ) func (v *VppLink) GetIPsecTunnelProtection(tunnelInterface uint32) (protections []types.IPsecTunnelProtection, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &ipsec.IpsecTunnelProtectDump{ SwIfIndex: interface_types.InterfaceIndex(tunnelInterface), } response := &ipsec.IpsecTunnelProtectDetails{} - stream := v.ch.SendMultiRequest(request) + stream := v.GetChannel().SendMultiRequest(request) for { stop, err := stream.ReceiveReply(response) if err != nil { @@ -52,15 +52,15 @@ func (v *VppLink) GetIPsecTunnelProtection(tunnelInterface uint32) (protections } func (v *VppLink) SetIPsecAsyncMode(enable bool) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &ipsec.IpsecSetAsyncModeReply{} request := &ipsec.IpsecSetAsyncMode{ AsyncEnable: enable, } - var err = v.ch.SendRequest(request).ReceiveReply(response) + var err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrap(err, "IPsec async mode enable failed") } else if response.Retval != 0 { diff --git a/vpplink/memif.go b/vpplink/memif.go index be124bde..708a5295 100644 --- a/vpplink/memif.go +++ b/vpplink/memif.go @@ -25,15 +25,15 @@ import ( ) func (v *VppLink) addDelMemifSocketFileName(socketFileName string, socketId uint32, isAdd bool) (uint32, error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &memif.MemifSocketFilenameAddDelV2Reply{} request := &memif.MemifSocketFilenameAddDelV2{ IsAdd: isAdd, SocketFilename: socketFileName, SocketID: socketId, } - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return 0, errors.Wrapf(err, "MemifSocketFilenameAddDel failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { @@ -53,13 +53,13 @@ func (v *VppLink) DelMemifSocketFileName(socketId uint32) error { } func (v *VppLink) DeleteMemif(swIfIndex uint32) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &memif.MemifDeleteReply{} request := &memif.MemifDelete{ SwIfIndex: interface_types.InterfaceIndex(swIfIndex), } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { err = errors.Wrapf(err, "DeleteMemif failed: req %+v reply %+v (%s)", request, response) } else if response.Retval != 0 { @@ -69,8 +69,8 @@ func (v *VppLink) DeleteMemif(swIfIndex uint32) (err error) { } func (v *VppLink) CreateMemif(mif *types.Memif) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &memif.MemifCreateReply{} request := &memif.MemifCreate{ Role: memif.MemifRole(mif.Role), @@ -83,7 +83,7 @@ func (v *VppLink) CreateMemif(mif *types.Memif) error { if mif.MacAddress != nil { request.HwAddr = types.ToVppMacAddress(&mif.MacAddress) } - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "MemifCreate failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { @@ -94,12 +94,12 @@ func (v *VppLink) CreateMemif(mif *types.Memif) error { } func (v *VppLink) ListMemifInterfaces() ([]*types.Memif, error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() memifs := make([]*types.Memif, 0) request := &memif.MemifDump{} - stream := v.ch.SendMultiRequest(request) + stream := v.GetChannel().SendMultiRequest(request) for { response := &memif.MemifDetails{} stop, err := stream.ReceiveReply(response) diff --git a/vpplink/nat44.go b/vpplink/nat44.go index f1d64182..807a5102 100644 --- a/vpplink/nat44.go +++ b/vpplink/nat44.go @@ -27,15 +27,15 @@ import ( ) func (v *VppLink) EnableNatForwarding() (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &nat.Nat44ForwardingEnableDisableReply{} request := &nat.Nat44ForwardingEnableDisable{ Enable: true, } - v.log.Debug("Enabling NAT44 forwarding") - err = v.ch.SendRequest(request).ReceiveReply(response) + v.GetLog().Debug("Enabling NAT44 forwarding") + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrap(err, "NAT44 forwarding enable failed") } else if response.Retval != 0 { @@ -45,8 +45,8 @@ func (v *VppLink) EnableNatForwarding() (err error) { } func (v *VppLink) addDelNat44Address(isAdd bool, address net.IP) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &nat.Nat44AddDelAddressRangeReply{} request := &nat.Nat44AddDelAddressRange{ @@ -56,7 +56,7 @@ func (v *VppLink) addDelNat44Address(isAdd bool, address net.IP) (err error) { IsAdd: isAdd, Flags: nat_types.NAT_IS_NONE, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrap(err, "Nat44 address add failed") } else if response.Retval != 0 { @@ -74,8 +74,8 @@ func (v *VppLink) DelNat44InterfaceAddress(swIfIndex uint32, flags types.NatFlag } func (v *VppLink) addDelNat44InterfaceAddress(isAdd bool, swIfIndex uint32, flags types.NatFlags) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &nat.Nat44AddDelInterfaceAddrReply{} request := &nat.Nat44AddDelInterfaceAddr{ @@ -83,7 +83,7 @@ func (v *VppLink) addDelNat44InterfaceAddress(isAdd bool, swIfIndex uint32, flag SwIfIndex: interface_types.InterfaceIndex(swIfIndex), Flags: types.ToVppNatConfigFlags(flags), } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrap(err, "Nat44 addDel interface address failed") } else if response.Retval != 0 { @@ -101,8 +101,8 @@ func (v *VppLink) DelNat44Address(address net.IP) error { } func (v *VppLink) addDelNat44Interface(isAdd bool, flags types.NatFlags, swIfIndex uint32) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &nat.Nat44InterfaceAddDelFeatureReply{} request := &nat.Nat44InterfaceAddDelFeature{ @@ -110,7 +110,7 @@ func (v *VppLink) addDelNat44Interface(isAdd bool, flags types.NatFlags, swIfInd Flags: types.ToVppNatConfigFlags(flags), SwIfIndex: interface_types.InterfaceIndex(swIfIndex), } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrap(err, "Nat44 addDel interface failed") } else if response.Retval != 0 { @@ -137,7 +137,7 @@ func (v *VppLink) DelNat44OutsideInterface(swIfIndex uint32) error { func (v *VppLink) getLBLocals(entry *types.Nat44Entry) (locals []nat.Nat44LbAddrPort) { for _, ip := range entry.BackendIPs { - v.log.Debugf("Adding local %s:%d", ip, entry.BackendPort) + v.GetLog().Debugf("Adding local %s:%d", ip, entry.BackendPort) locals = append(locals, nat.Nat44LbAddrPort{ Addr: types.ToVppIP4Address(ip), Port: uint16(entry.BackendPort), @@ -148,8 +148,8 @@ func (v *VppLink) getLBLocals(entry *types.Nat44Entry) (locals []nat.Nat44LbAddr } func (v *VppLink) addDelNat44LBStaticMapping(isAdd bool, entry *types.Nat44Entry) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() locals := v.getLBLocals(entry) response := &nat.Nat44AddDelLbStaticMappingReply{} @@ -161,7 +161,7 @@ func (v *VppLink) addDelNat44LBStaticMapping(isAdd bool, entry *types.Nat44Entry Protocol: uint8(types.ToVppIPProto(entry.Protocol)), Locals: locals, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrap(err, "Nat44 add LB static failed") } else if response.Retval != 0 { @@ -179,8 +179,8 @@ func (v *VppLink) DelNat44LBStaticMapping(entry *types.Nat44Entry) error { } func (v *VppLink) addDelNat44StaticMapping(isAdd bool, entry *types.Nat44Entry) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &nat.Nat44AddDelStaticMappingReply{} request := &nat.Nat44AddDelStaticMapping{ @@ -193,7 +193,7 @@ func (v *VppLink) addDelNat44StaticMapping(isAdd bool, entry *types.Nat44Entry) ExternalPort: uint16(entry.ServicePort), ExternalSwIfIndex: 0xffffffff, } - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrap(err, "Nat44 static mapping failed") } else if response.Retval != 0 { diff --git a/vpplink/pbl.go b/vpplink/pbl.go index 4e4f9b8a..93dc84a7 100644 --- a/vpplink/pbl.go +++ b/vpplink/pbl.go @@ -24,8 +24,8 @@ import ( ) func (v *VppLink) AddPblClient(client *types.PblClient) (id uint32, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() portRanges := make([]pbl.PblPortRange, len(client.PortRanges)) for _, r := range client.PortRanges { @@ -47,7 +47,7 @@ func (v *VppLink) AddPblClient(client *types.PblClient) (id uint32, err error) { PortRanges: portRanges, }, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return 0, errors.Wrapf(err, "Pbl Client Update failed") } else if response.Retval != 0 { @@ -58,14 +58,14 @@ func (v *VppLink) AddPblClient(client *types.PblClient) (id uint32, err error) { } func (v *VppLink) DelPblClient(id uint32) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &pbl.PblClientDelReply{} request := &pbl.PblClientDel{ ID: id, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "Pbl Client Delete failed") } else if response.Retval != 0 { diff --git a/vpplink/rdma.go b/vpplink/rdma.go index 005f8a18..c63b1679 100644 --- a/vpplink/rdma.go +++ b/vpplink/rdma.go @@ -24,8 +24,8 @@ import ( ) func (v *VppLink) CreateRDMA(intf *types.RDMAInterface) (swIfIndex uint32, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &rdma.RdmaCreateV2Reply{} request := &rdma.RdmaCreateV2{ HostIf: intf.HostInterfaceName, @@ -33,7 +33,7 @@ func (v *VppLink) CreateRDMA(intf *types.RDMAInterface) (swIfIndex uint32, err e RxqSize: uint16(intf.RxQueueSize), TxqSize: uint16(intf.TxQueueSize), } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return ^uint32(0), errors.Wrapf(err, "CreateRDMA failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { diff --git a/vpplink/routes.go b/vpplink/routes.go index 73fe0c5c..8e779065 100644 --- a/vpplink/routes.go +++ b/vpplink/routes.go @@ -33,8 +33,8 @@ const ( ) func (v *VppLink) GetRoutes(tableID uint32, isIPv6 bool) (routes []types.Route, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &vppip.IPRouteDump{ Table: vppip.IPTable{ @@ -43,8 +43,8 @@ func (v *VppLink) GetRoutes(tableID uint32, isIPv6 bool) (routes []types.Route, }, } response := &vppip.IPRouteDetails{} - v.log.Debug("Listing VPP routes") - stream := v.ch.SendMultiRequest(request) + v.GetLog().Debug("Listing VPP routes") + stream := v.GetChannel().SendMultiRequest(request) for { stop, err := stream.ReceiveReply(response) if err != nil { @@ -79,8 +79,8 @@ func isAddStr(isAdd bool) string { } func (v *VppLink) addDelNeighbor(neighbor *types.Neighbor, isAdd bool) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &ip_neighbor.IPNeighborAddDel{ IsAdd: isAdd, @@ -92,13 +92,13 @@ func (v *VppLink) addDelNeighbor(neighbor *types.Neighbor, isAdd bool) error { }, } response := &ip_neighbor.IPNeighborAddDelReply{} - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "failed to %s neighbor from VPP", isAddStr(isAdd)) } else if response.Retval != 0 { return fmt.Errorf("failed to %s neighbor from VPP (retval %d)", isAddStr(isAdd), response.Retval) } - v.log.Debugf("%sed neighbor %+v", isAddStr(isAdd), neighbor) + v.GetLog().Debugf("%sed neighbor %+v", isAddStr(isAdd), neighbor) return nil } @@ -126,8 +126,8 @@ func (v *VppLink) RouteDel(route *types.Route) error { } func (v *VppLink) addDelIPRoute(route *types.Route, isAdd bool) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() isIP6 := route.IsIP6() prefix := ip_types.Prefix{} @@ -156,13 +156,13 @@ func (v *VppLink) addDelIPRoute(route *types.Route, isAdd bool) error { } response := &vppip.IPRouteAddDelReply{} - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "failed to %s route from VPP", IsAddToStr(isAdd)) } else if response.Retval != 0 { return fmt.Errorf("failed to %s route from VPP (retval %d)", IsAddToStr(isAdd), response.Retval) } - v.log.Debugf("%sed route %+v", IsAddToStr(isAdd), route) + v.GetLog().Debugf("%sed route %+v", IsAddToStr(isAdd), route) return nil } @@ -190,8 +190,8 @@ func (v *VppLink) DelDefaultRouteViaTable(sourceTable, dstTable uint32, isIP6 bo } func (v *VppLink) SetIPFlowHash(ipFlowHash types.IPFlowHash, vrfID uint32, isIPv6 bool) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &vppip.SetIPFlowHashV2{ TableID: vrfID, @@ -200,12 +200,12 @@ func (v *VppLink) SetIPFlowHash(ipFlowHash types.IPFlowHash, vrfID uint32, isIPv } response := &vppip.SetIPFlowHashV2Reply{} - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "failed to update flow hash algo for vrf %d", vrfID) } else if response.Retval != 0 { return fmt.Errorf("failed to update flow hash algo for vrf %d (retval %d)", vrfID, response.Retval) } - v.log.Debugf("updated flow hash algo for vrf %d", vrfID) + v.GetLog().Debugf("updated flow hash algo for vrf %d", vrfID) return nil } diff --git a/vpplink/session.go b/vpplink/session.go index f57b46e2..4493e9a3 100644 --- a/vpplink/session.go +++ b/vpplink/session.go @@ -25,14 +25,14 @@ import ( ) func (v *VppLink) enableDisableSessionLayer(isEnable bool) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &session.SessionEnableDisableReply{} request := &session.SessionEnableDisable{ IsEnable: isEnable, } - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "Enable/Disable session failed") } else if response.Retval != 0 { @@ -50,14 +50,14 @@ func (v *VppLink) DisableSessionLayer() error { } func (v *VppLink) enableDisableSessionSAPILayer(isEnable bool) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &session.SessionSapiEnableDisableReply{} request := &session.SessionSapiEnableDisable{ IsEnable: isEnable, } - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "Enable/Disable session SAPI failed") } else if response.Retval != 0 { @@ -75,8 +75,8 @@ func (v *VppLink) DisableSessionSAPI() error { } func (v *VppLink) addDelSessionAppNamespace(namespace *types.SessionAppNamespace, isAdd bool) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &session.AppNamespaceAddDelV3Reply{} request := &session.AppNamespaceAddDelV3{ @@ -87,7 +87,7 @@ func (v *VppLink) addDelSessionAppNamespace(namespace *types.SessionAppNamespace SwIfIndex: interface_types.InterfaceIndex(namespace.SwIfIndex), IsAdd: isAdd, } - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "error %sing session namespace", IsAddToStr(isAdd)) } else if response.Retval != 0 { diff --git a/vpplink/srv6.go b/vpplink/srv6.go index b41210af..56eee252 100644 --- a/vpplink/srv6.go +++ b/vpplink/srv6.go @@ -11,14 +11,14 @@ import ( ) func (v *VppLink) SetEncapSource(addr net.IP) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &sr.SrSetEncapSource{ EncapsSource: types.ToVppIP6Address(addr), } response := &sr.SrSetEncapSourceReply{} - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrap(err, "SetEncapSource failed") } else if response.Retval != 0 { @@ -28,11 +28,11 @@ func (v *VppLink) SetEncapSource(addr net.IP) (err error) { } func (v *VppLink) ListSRv6Policies() (list []*types.SrPolicy, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &sr.SrPoliciesDump{} - stream := v.ch.SendMultiRequest(request) + stream := v.GetChannel().SendMultiRequest(request) for { response := &sr.SrPoliciesDetails{} stop, err := stream.ReceiveReply(response) @@ -76,8 +76,8 @@ func (v *VppLink) AddModSRv6Policy(policy *types.SrPolicy) (err error) { } func (v *VppLink) AddSRv6Policy(policy *types.SrPolicy) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &sr.SrPolicyAddReply{} sidlist := policy.SidLists[0] @@ -92,7 +92,7 @@ func (v *VppLink) AddSRv6Policy(policy *types.SrPolicy) (err error) { Sids: sidlist.Sids, }, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrap(err, "Add SRv6Policy failed") } else if response.Retval != 0 { @@ -102,14 +102,14 @@ func (v *VppLink) AddSRv6Policy(policy *types.SrPolicy) (err error) { } func (v *VppLink) DelSRv6Policy(policy *types.SrPolicy) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &sr.SrPolicyDelReply{} request := &sr.SrPolicyDel{ BsidAddr: policy.Bsid, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrap(err, "Del SRv6Policy failed") } else if response.Retval != 0 { @@ -120,11 +120,11 @@ func (v *VppLink) DelSRv6Policy(policy *types.SrPolicy) (err error) { } func (v *VppLink) ListSRv6Localsid() (list []*types.SrLocalsid, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &sr.SrLocalsidsDump{} - stream := v.ch.SendMultiRequest(request) + stream := v.GetChannel().SendMultiRequest(request) for { response := &sr.SrLocalsidsDetails{} stop, err := stream.ReceiveReply(response) @@ -149,8 +149,8 @@ func (v *VppLink) ListSRv6Localsid() (list []*types.SrLocalsid, err error) { } func (v *VppLink) AddSRv6Localsid(localSid *types.SrLocalsid) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &sr.SrLocalsidAddDelReply{} request := &sr.SrLocalsidAddDel{ @@ -163,7 +163,7 @@ func (v *VppLink) AddSRv6Localsid(localSid *types.SrLocalsid) (err error) { FibTable: localSid.FibTable, NhAddr: localSid.NhAddr, } - err_send := v.ch.SendRequest(request).ReceiveReply(response) + err_send := v.GetChannel().SendRequest(request).ReceiveReply(response) if err_send != nil { return errors.Wrap(err_send, "Add SRv6Localsid failed") } else if response.Retval != 0 { @@ -174,8 +174,8 @@ func (v *VppLink) AddSRv6Localsid(localSid *types.SrLocalsid) (err error) { } func (v *VppLink) DelSRv6Localsid(localSid *types.SrLocalsid) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &sr.SrLocalsidAddDelReply{} request := &sr.SrLocalsidAddDel{ @@ -188,7 +188,7 @@ func (v *VppLink) DelSRv6Localsid(localSid *types.SrLocalsid) (err error) { FibTable: localSid.FibTable, NhAddr: localSid.NhAddr, } - err_send := v.ch.SendRequest(request).ReceiveReply(response) + err_send := v.GetChannel().SendRequest(request).ReceiveReply(response) if err_send != nil { return errors.Wrap(err_send, "Delete SRv6Localsid failed") } else if response.Retval != 0 { @@ -198,8 +198,8 @@ func (v *VppLink) DelSRv6Localsid(localSid *types.SrLocalsid) (err error) { } func (v *VppLink) DelSRv6Steering(steer *types.SrSteer) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &sr.SrSteeringAddDelReply{} request := &sr.SrSteeringAddDel{ @@ -210,7 +210,7 @@ func (v *VppLink) DelSRv6Steering(steer *types.SrSteer) (err error) { SwIfIndex: interface_types.InterfaceIndex(steer.SwIfIndex), TrafficType: types.ToVppSrSteerTrafficType(steer.TrafficType), } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrap(err, "Add DelSRv6Steering failed") } else if response.Retval != 0 { @@ -220,8 +220,8 @@ func (v *VppLink) DelSRv6Steering(steer *types.SrSteer) (err error) { } func (v *VppLink) AddSRv6Steering(steer *types.SrSteer) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &sr.SrSteeringAddDelReply{} request := &sr.SrSteeringAddDel{ IsDel: false, @@ -231,7 +231,7 @@ func (v *VppLink) AddSRv6Steering(steer *types.SrSteer) (err error) { SwIfIndex: interface_types.InterfaceIndex(steer.SwIfIndex), TrafficType: types.ToVppSrSteerTrafficType(steer.TrafficType), } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrap(err, "Add AddSRv6Steering failed") } else if response.Retval != 0 { @@ -241,11 +241,11 @@ func (v *VppLink) AddSRv6Steering(steer *types.SrSteer) (err error) { } func (v *VppLink) ListSRv6Steering() (list []*types.SrSteer, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() request := &sr.SrSteeringPolDump{} - stream := v.ch.SendMultiRequest(request) + stream := v.GetChannel().SendMultiRequest(request) for { response := &sr.SrSteeringPolDetails{} stop, err := stream.ReceiveReply(response) diff --git a/vpplink/stats.go b/vpplink/stats.go index d7945921..84064c99 100644 --- a/vpplink/stats.go +++ b/vpplink/stats.go @@ -43,11 +43,11 @@ func GetInterfaceStats(sc *statsclient.StatsClient) (ifNames adapter.NameStat, d } func (v *VppLink) GetBufferStats() (uint32, uint32, uint32, error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &interfaces.GetBuffersStatsReply{} request := &interfaces.GetBuffersStats{BufferIndex: 0} - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return 0, 0, 0, errors.Wrapf(err, "update buffer stats failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { diff --git a/vpplink/types/ipip.go b/vpplink/types/ipip.go deleted file mode 100644 index 1bbcf8f0..00000000 --- a/vpplink/types/ipip.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (C) 2020 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" - "net" -) - -type IPIPTunnel struct { - Src net.IP - Dst net.IP - TableID uint32 - SwIfIndex uint32 -} - -func (t *IPIPTunnel) String() string { - if t.TableID != 0 { - return fmt.Sprintf("[swif=%d %s->%s tbl=%d]", t.SwIfIndex, t.Src.String(), t.Dst.String(), t.TableID) - } - return fmt.Sprintf("[swif=%d %s->%s]", t.SwIfIndex, t.Src.String(), t.Dst.String()) -} diff --git a/vpplink/virtio.go b/vpplink/virtio.go index a25ea810..b071e2ff 100644 --- a/vpplink/virtio.go +++ b/vpplink/virtio.go @@ -59,8 +59,8 @@ func (v *VppLink) CreateVirtio(intf *types.VirtioInterface) (swIfIndex uint32, e if err != nil { return ^uint32(0), errors.Wrap(err, "CreateVirtio failed") } - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &virtio.VirtioPciCreateV2Reply{} request := &virtio.VirtioPciCreateV2{ PciAddr: *addr, @@ -71,7 +71,7 @@ func (v *VppLink) CreateVirtio(intf *types.VirtioInterface) (swIfIndex uint32, e request.MacAddress = types.ToVppMacAddress(intf.HardwareAddr) } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return ^uint32(0), errors.Wrapf(err, "CreateVirtio failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { @@ -82,13 +82,13 @@ func (v *VppLink) CreateVirtio(intf *types.VirtioInterface) (swIfIndex uint32, e } func (v *VppLink) DeleteVirtio(swIfIndex uint32) error { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &virtio.VirtioPciDeleteReply{} request := &virtio.VirtioPciDelete{ SwIfIndex: interface_types.InterfaceIndex(swIfIndex), } - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "DeleteVirtio failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { diff --git a/vpplink/vlib.go b/vpplink/vlib.go index 674d42de..8ca8e7f1 100644 --- a/vpplink/vlib.go +++ b/vpplink/vlib.go @@ -23,14 +23,14 @@ import ( ) func (v *VppLink) GetNodeIndex(name string) (nodeIndex uint32, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &vlib.GetNodeIndexReply{} request := &vlib.GetNodeIndex{ NodeName: name, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return ^uint32(1), errors.Wrap(err, "GetNodeIndex failed") } else if response.Retval != 0 { @@ -40,15 +40,15 @@ func (v *VppLink) GetNodeIndex(name string) (nodeIndex uint32, err error) { } func (v *VppLink) AddNodeNext(name, next string) (nodeIndex uint32, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &vlib.AddNodeNextReply{} request := &vlib.AddNodeNext{ NodeName: name, NextName: next, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return ^uint32(1), errors.Wrap(err, "AddNodeNext failed") } else if response.Retval != 0 { @@ -59,12 +59,12 @@ func (v *VppLink) AddNodeNext(name, next string) (nodeIndex uint32, err error) { /* Gets the number of workers WITHOUT the main thread */ func (v *VppLink) GetNumVPPWorkers() (numVPPWorkers int, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &vlib.ShowThreadsReply{} request := &vlib.ShowThreads{} - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return -1, errors.Wrap(err, "GetNumVPPWorkers failed") } else if response.Retval != 0 { diff --git a/vpplink/vmxnet3.go b/vpplink/vmxnet3.go index 5ce0e3ee..5da642bb 100644 --- a/vpplink/vmxnet3.go +++ b/vpplink/vmxnet3.go @@ -24,8 +24,8 @@ import ( ) func (v *VppLink) CreateVmxnet3(intf *types.Vmxnet3Interface) (swIfIndex uint32, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &vmxnet3.Vmxnet3CreateReply{} pci, err := types.GetPciIdInt(intf.PciId) if err != nil { @@ -39,7 +39,7 @@ func (v *VppLink) CreateVmxnet3(intf *types.Vmxnet3Interface) (swIfIndex uint32, TxqNum: uint16(intf.NumTxQueues), EnableGso: intf.EnableGso, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return ^uint32(0), errors.Wrapf(err, "CreateVmxnet3 failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { diff --git a/vpplink/vpe.go b/vpplink/vpe.go index ff047e38..5ba49274 100644 --- a/vpplink/vpe.go +++ b/vpplink/vpe.go @@ -23,13 +23,13 @@ import ( ) func (v *VppLink) GetVPPVersion() (version string, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &vpe.ShowVersionReply{} request := &vpe.ShowVersion{} - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return "", errors.Wrapf(err, "ShowVersion failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { diff --git a/vpplink/vpplink.go b/vpplink/vpplink.go index d6392358..beb953b4 100644 --- a/vpplink/vpplink.go +++ b/vpplink/vpplink.go @@ -16,14 +16,11 @@ package vpplink import ( - "sync" "time" - govpp "git.fd.io/govpp.git" - vppapi "git.fd.io/govpp.git/api" - vppcore "git.fd.io/govpp.git/core" - "github.com/pkg/errors" "github.com/sirupsen/logrus" + + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi" ) const ( @@ -31,56 +28,10 @@ const ( ) type VppLink struct { - lock sync.Mutex - conn *vppcore.Connection - ch vppapi.Channel - socket string - log *logrus.Entry -} - -func (v *VppLink) GetChannel() (vppapi.Channel, error) { - return v.conn.NewAPIChannel() + *vppapi.Vpp } func NewVppLink(socket string, logger *logrus.Entry) (*VppLink, error) { - conn, err := govpp.Connect(socket) - if err != nil { - return nil, errors.Wrapf(err, "cannot connect to VPP on socket %s", socket) - } - - ch, err := conn.NewAPIChannel() - if err != nil { - return nil, errors.Wrap(err, "channel creation failed") - } - - return &VppLink{ - conn: conn, - ch: ch, - socket: socket, - log: logger, - }, nil -} - -func (v *VppLink) Reconnect() (err error) { - v.conn, err = govpp.Connect(v.socket) - if err != nil { - return errors.Wrapf(err, "cannot re-connect to VPP on socket %s", v.socket) - } - v.ch, err = v.conn.NewAPIChannel() - if err != nil { - return errors.Wrap(err, "channel re-creation failed") - } - return nil -} - -func (v *VppLink) Close() { - if v == nil { - return - } - if v.ch != nil { - v.ch.Close() - } - if v.conn != nil { - v.conn.Disconnect() - } + vpp, err := vppapi.NewVpp(socket, logger) + return &VppLink{vpp}, err } diff --git a/vpplink/vxlan.go b/vpplink/vxlan.go index 50658f7e..37dcf512 100644 --- a/vpplink/vxlan.go +++ b/vpplink/vxlan.go @@ -24,14 +24,14 @@ import ( ) func (v *VppLink) ListVXLanTunnels() ([]types.VXLanTunnel, error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() tunnels := make([]types.VXLanTunnel, 0) request := &vxlan.VxlanTunnelV2Dump{ SwIfIndex: types.InvalidInterface, } - stream := v.ch.SendMultiRequest(request) + stream := v.GetChannel().SendMultiRequest(request) for { response := &vxlan.VxlanTunnelV2Details{} stop, err := stream.ReceiveReply(response) @@ -54,8 +54,8 @@ func (v *VppLink) ListVXLanTunnels() ([]types.VXLanTunnel, error) { return tunnels, nil } func (v *VppLink) addDelVXLanTunnel(tunnel *types.VXLanTunnel, isAdd bool) (swIfIndex uint32, err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &vxlan.VxlanAddDelTunnelV3Reply{} request := &vxlan.VxlanAddDelTunnelV3{ @@ -69,7 +69,7 @@ func (v *VppLink) addDelVXLanTunnel(tunnel *types.VXLanTunnel, isAdd bool) (swIf DecapNextIndex: tunnel.DecapNextIndex, IsL3: true, } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) opStr := "Del" if isAdd { opStr = "Add" diff --git a/vpplink/wireguard.go b/vpplink/wireguard.go index 29411bb3..b7dbfad3 100644 --- a/vpplink/wireguard.go +++ b/vpplink/wireguard.go @@ -43,15 +43,15 @@ func (v *VppLink) GetWireguardTunnel(swIfIndex uint32) (*types.WireguardTunnel, } func (v *VppLink) listWireguardTunnels(swIfIndex interface_types.InterfaceIndex) ([]*types.WireguardTunnel, error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() tunnels := make([]*types.WireguardTunnel, 0) request := &wireguard.WireguardInterfaceDump{ ShowPrivateKey: false, SwIfIndex: swIfIndex, } - stream := v.ch.SendMultiRequest(request) + stream := v.GetChannel().SendMultiRequest(request) for { response := &wireguard.WireguardInterfaceDetails{} stop, err := stream.ReceiveReply(response) @@ -72,8 +72,8 @@ func (v *VppLink) listWireguardTunnels(swIfIndex interface_types.InterfaceIndex) } func (v *VppLink) AddWireguardTunnel(tunnel *types.WireguardTunnel) (uint32, error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &wireguard.WireguardInterfaceCreateReply{} request := &wireguard.WireguardInterfaceCreate{ @@ -87,7 +87,7 @@ func (v *VppLink) AddWireguardTunnel(tunnel *types.WireguardTunnel) (uint32, err PublicKey: tunnel.PublicKey, }, } - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return ^uint32(1), errors.Wrap(err, "Add Wireguard Tunnel failed") } else if response.Retval != 0 { @@ -98,14 +98,14 @@ func (v *VppLink) AddWireguardTunnel(tunnel *types.WireguardTunnel) (uint32, err } func (v *VppLink) DelWireguardTunnel(tunnel *types.WireguardTunnel) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &wireguard.WireguardInterfaceDeleteReply{} request := &wireguard.WireguardInterfaceDelete{ SwIfIndex: interface_types.InterfaceIndex(tunnel.SwIfIndex), } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "Del Wireguard Tunnel %s failed", tunnel.String()) } else if response.Retval != 0 { @@ -115,12 +115,12 @@ func (v *VppLink) DelWireguardTunnel(tunnel *types.WireguardTunnel) (err error) } func (v *VppLink) ListWireguardPeers() ([]*types.WireguardPeer, error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() tunnels := make([]*types.WireguardPeer, 0) request := &wireguard.WireguardPeersDump{} - stream := v.ch.SendMultiRequest(request) + stream := v.GetChannel().SendMultiRequest(request) for { response := &wireguard.WireguardPeersDetails{} stop, err := stream.ReceiveReply(response) @@ -148,8 +148,8 @@ func (v *VppLink) ListWireguardPeers() ([]*types.WireguardPeer, error) { } func (v *VppLink) AddWireguardPeer(peer *types.WireguardPeer) (uint32, error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() allowedIps := make([]ip_types.Prefix, 0) for _, aip := range peer.AllowedIps { @@ -172,7 +172,7 @@ func (v *VppLink) AddWireguardPeer(peer *types.WireguardPeer) (uint32, error) { AllowedIps: allowedIps, }, } - err := v.ch.SendRequest(request).ReceiveReply(response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return ^uint32(1), errors.Wrap(err, "Add Wireguard Peer failed") } else if response.Retval != 0 { @@ -183,14 +183,14 @@ func (v *VppLink) AddWireguardPeer(peer *types.WireguardPeer) (uint32, error) { } func (v *VppLink) DelWireguardPeer(peer *types.WireguardPeer) (err error) { - v.lock.Lock() - defer v.lock.Unlock() + v.Lock() + defer v.Unlock() response := &wireguard.WireguardPeerRemoveReply{} request := &wireguard.WireguardPeerRemove{ PeerIndex: uint32(peer.Index), } - err = v.ch.SendRequest(request).ReceiveReply(response) + err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { return errors.Wrapf(err, "Del Wireguard Peer Tunnel %s failed", peer.String()) } else if response.Retval != 0 { From e58b1e408351feb7e0e35f0df73326cc47248150 Mon Sep 17 00:00:00 2001 From: Filip Varga Date: Mon, 13 Jun 2022 20:51:15 +0200 Subject: [PATCH 2/2] wrapper: updated calls for govpp generated code Signed-off-by: Filip Varga --- .gitignore | 2 + .idea/modules.xml | 11 + .idea/vpp-dataplane.iml | 16 + calico-vpp-agent/cni/cni_server.go | 5 +- calico-vpp-agent/cni/pod_interface/common.go | 29 +- .../cni/pod_interface/loopback.go | 13 +- calico-vpp-agent/cni/pod_interface/memif.go | 9 +- calico-vpp-agent/cni/pod_interface/tuntap.go | 14 +- calico-vpp-agent/cni/pod_interface/vcl.go | 6 +- calico-vpp-agent/config/config.go | 11 +- calico-vpp-agent/connectivity/ipip.go | 20 +- calico-vpp-agent/connectivity/ipsec.go | 24 +- calico-vpp-agent/connectivity/vxlan.go | 21 +- calico-vpp-agent/connectivity/wireguard.go | 23 +- calico-vpp-agent/policy/policy_server.go | 11 +- go.mod | 7 +- go.sum | 41 +- vpp-manager/config/config.go | 20 +- vpp-manager/startup/startup.go | 16 +- vpp-manager/uplink/af_xdp.go | 6 +- vpp-manager/uplink/avf.go | 14 +- vpp-manager/uplink/common.go | 5 +- vpp-manager/vpp_runner.go | 60 +- vpplink/af_packet.go | 5 +- vpplink/avf.go | 7 +- vpplink/binapi/vppapi/abf/abf.ba.go | 4 +- vpplink/binapi/vppapi/acl/acl.ba.go | 24 +- .../binapi/vppapi/acl_types/acl_types.ba.go | 6 + .../binapi/vppapi/af_packet/af_packet.ba.go | 8 +- vpplink/binapi/vppapi/af_xdp/af_xdp.ba.go | 6 +- vpplink/binapi/vppapi/arp/arp.ba.go | 4 +- vpplink/binapi/vppapi/avf/avf.ba.go | 4 +- vpplink/binapi/vppapi/capo/capo.ba.go | 22 +- vpplink/binapi/vppapi/cnat/cnat.ba.go | 16 +- .../crypto_sw_scheduler.ba.go | 2 +- .../ethernet_types/ethernet_types.ba.go | 6 + vpplink/binapi/vppapi/feature/feature.ba.go | 2 +- .../binapi/vppapi/fib_types/fib_types.ba.go | 6 + vpplink/binapi/vppapi/generate.log | 2 +- vpplink/binapi/vppapi/gso/gso.ba.go | 2 +- vpplink/binapi/vppapi/ikev2/ikev2.ba.go | 46 +- .../vppapi/ikev2_types/ikev2_types.ba.go | 6 + .../binapi/vppapi/interface/interface.ba.go | 62 +- .../interface_types/interface_types.ba.go | 6 + vpplink/{ => binapi/vppapi}/interfaces.go | 786 +++++++++--------- vpplink/binapi/vppapi/ip/ip.ba.go | 66 +- vpplink/binapi/vppapi/ip6_nd/ip6_nd.ba.go | 12 +- vpplink/binapi/vppapi/ip_helpers.go | 183 ++++ .../vppapi/ip_neighbor/ip_neighbor.ba.go | 14 +- vpplink/binapi/vppapi/ip_types/ip_types.ba.go | 6 + vpplink/binapi/vppapi/ipip.go | 2 +- vpplink/binapi/vppapi/ipip/ipip.ba.go | 8 +- vpplink/binapi/vppapi/ipsec.go | 140 ++++ vpplink/binapi/vppapi/ipsec/ipsec.ba.go | 28 +- vpplink/binapi/vppapi/ipsec_helpers.go | 79 ++ .../vppapi/ipsec_types/ipsec_types.ba.go | 6 + vpplink/binapi/vppapi/memclnt/memclnt.ba.go | 12 +- vpplink/binapi/vppapi/memif/memif.ba.go | 8 +- .../binapi/vppapi/mfib_types/mfib_types.ba.go | 6 + vpplink/binapi/vppapi/nat44_ed/nat44_ed.ba.go | 78 +- .../binapi/vppapi/nat_types/nat_types.ba.go | 6 + vpplink/binapi/vppapi/pbl/pbl.ba.go | 4 +- .../binapi/vppapi/pci_types/pci_types.ba.go | 6 + vpplink/binapi/vppapi/punt/punt.ba.go | 6 +- vpplink/binapi/vppapi/rdma/rdma.ba.go | 8 +- vpplink/binapi/vppapi/session/session.ba.go | 26 +- vpplink/binapi/vppapi/sr/sr.ba.go | 14 +- vpplink/binapi/vppapi/sr_types/sr_types.ba.go | 6 + vpplink/binapi/vppapi/tapv2/tapv2.ba.go | 6 +- .../vppapi/tunnel_types/tunnel_types.ba.go | 6 + vpplink/binapi/vppapi/virtio/virtio.ba.go | 6 +- vpplink/binapi/vppapi/vlib/vlib.ba.go | 18 +- vpplink/binapi/vppapi/vmxnet3/vmxnet3.ba.go | 4 +- vpplink/binapi/vppapi/vpe/vpe.ba.go | 4 +- .../binapi/vppapi/vpe_types/vpe_types.ba.go | 6 + vpplink/binapi/vppapi/vxlan.go | 95 +++ vpplink/binapi/vppapi/vxlan/vxlan.ba.go | 10 +- vpplink/binapi/vppapi/wireguard.go | 200 +++++ .../binapi/vppapi/wireguard/wireguard.ba.go | 12 +- vpplink/cnat.go | 3 +- vpplink/helpers.go | 16 +- vpplink/types/cnat.go | 3 +- vpplink/types/vpp_interface.go | 72 -- vpplink/vmxnet3.go | 3 +- vpplink/vxlan.go | 3 +- vpplink/wireguard.go | 5 +- 86 files changed, 1730 insertions(+), 882 deletions(-) create mode 100644 .idea/modules.xml create mode 100644 .idea/vpp-dataplane.iml rename vpplink/{ => binapi/vppapi}/interfaces.go (59%) create mode 100644 vpplink/binapi/vppapi/ip_helpers.go create mode 100644 vpplink/binapi/vppapi/ipsec.go create mode 100644 vpplink/binapi/vppapi/ipsec_helpers.go create mode 100644 vpplink/binapi/vppapi/vxlan.go create mode 100644 vpplink/binapi/vppapi/wireguard.go diff --git a/.gitignore b/.gitignore index 4f160957..2571abf9 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,5 @@ vpplink/binapi/.cherries-cache calico-vpp-agent/version vpp-manager/images/ubuntu/version test/scripts/.buildlogs + +.idea/* diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..4181ebfb --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vpp-dataplane.iml b/.idea/vpp-dataplane.iml new file mode 100644 index 00000000..ab0d5977 --- /dev/null +++ b/.idea/vpp-dataplane.iml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/calico-vpp-agent/cni/cni_server.go b/calico-vpp-agent/cni/cni_server.go index 77c553d5..8c043d3e 100644 --- a/calico-vpp-agent/cni/cni_server.go +++ b/calico-vpp-agent/cni/cni_server.go @@ -18,6 +18,7 @@ package cni import ( "context" "fmt" + types2 "git.fd.io/govpp.git/api/v0" "net" "os" "sync" @@ -229,8 +230,8 @@ func (s *Server) fetchBufferConfig() { numRxQueues := config.TapNumRxQueues numTxQueues := config.TapNumTxQueues - rxQueueSize := vpplink.DefaultIntTo(config.TapRxQueueSize, vpplink.DEFAULT_QUEUE_SIZE) - txQueueSize := vpplink.DefaultIntTo(config.TapTxQueueSize, vpplink.DEFAULT_QUEUE_SIZE) + rxQueueSize := vpplink.DefaultIntTo(config.TapRxQueueSize, types2.DefaultQueueSize) + txQueueSize := vpplink.DefaultIntTo(config.TapTxQueueSize, types2.DefaultQueueSize) s.buffersNeededPerTap = uint64(rxQueueSize*numRxQueues + txQueueSize*numTxQueues) } diff --git a/calico-vpp-agent/cni/pod_interface/common.go b/calico-vpp-agent/cni/pod_interface/common.go index ae132892..45ef4ec7 100644 --- a/calico-vpp-agent/cni/pod_interface/common.go +++ b/calico-vpp-agent/cni/pod_interface/common.go @@ -20,8 +20,9 @@ import ( "github.com/projectcalico/vpp-dataplane/calico-vpp-agent/cni/storage" "github.com/projectcalico/vpp-dataplane/calico-vpp-agent/config" "github.com/projectcalico/vpp-dataplane/vpplink" - "github.com/projectcalico/vpp-dataplane/vpplink/types" "github.com/sirupsen/logrus" + + types2 "git.fd.io/govpp.git/api/v0" ) type PodInterfaceDriverData struct { @@ -32,15 +33,17 @@ type PodInterfaceDriverData struct { } func (i *PodInterfaceDriverData) SpreadTxQueuesOnWorkers(swIfIndex uint32, numTxQueues int) (err error) { + iface := types2.Interface{SwIfIndex: swIfIndex} + // set first tx queue for main worker - err = i.vpp.SetInterfaceTxPlacement(swIfIndex, 0 /* queue */, 0 /* worker */) + err = i.vpp.SetInterfaceTxPlacement(&iface, 0 /* queue */, 0 /* worker */) if err != nil { return err } // share tx queues between the rest of workers if i.NDataThreads > 0 { for txq := 1; txq < numTxQueues; txq++ { - err = i.vpp.SetInterfaceTxPlacement(swIfIndex, txq, (txq-1)%(i.NDataThreads)+1) + err = i.vpp.SetInterfaceTxPlacement(&iface, txq, (txq-1)%(i.NDataThreads)+1) if err != nil { return err } @@ -50,10 +53,11 @@ func (i *PodInterfaceDriverData) SpreadTxQueuesOnWorkers(swIfIndex uint32, numTx } func (i *PodInterfaceDriverData) SpreadRxQueuesOnWorkers(swIfIndex uint32) { + iface := types2.Interface{SwIfIndex: swIfIndex} if i.NDataThreads > 0 { for queue := 0; queue < config.TapNumRxQueues; queue++ { worker := (int(swIfIndex)*config.TapNumRxQueues + queue) % i.NDataThreads - err := i.vpp.SetInterfaceRxPlacement(swIfIndex, queue, worker, false /* main */) + err := i.vpp.SetInterfaceRxPlacement(&iface, queue, worker, false /* main */) if err != nil { i.log.Warnf("failed to set if[%d] queue%d worker%d (tot workers %d): %v", swIfIndex, queue, worker, i.NDataThreads, err) } @@ -105,18 +109,20 @@ func (i *PodInterfaceDriverData) DoPodIfNatConfiguration(podSpec *storage.LocalP } func (i *PodInterfaceDriverData) UndoPodInterfaceConfiguration(swIfIndex uint32) { - err := i.vpp.InterfaceAdminDown(swIfIndex) + iface := types2.Interface{SwIfIndex: swIfIndex} + err := i.vpp.InterfaceAdminDown(&iface) if err != nil { i.log.Errorf("InterfaceAdminDown errored %s", err) } } func (i *PodInterfaceDriverData) DoPodInterfaceConfiguration(podSpec *storage.LocalPodSpec, stack *vpplink.CleanupStack, swIfIndex uint32, isL3 bool) (err error) { - i.SpreadRxQueuesOnWorkers(swIfIndex) + iface := types2.Interface{SwIfIndex: swIfIndex} + i.SpreadRxQueuesOnWorkers(iface.SwIfIndex) for _, ipFamily := range vpplink.IpFamilies { vrfId := podSpec.GetVrfId(ipFamily) - err = i.vpp.SetInterfaceVRF(swIfIndex, vrfId, ipFamily.IsIp6) + err = i.vpp.SetInterfaceVRF(&iface, vrfId, ipFamily.IsIp6) if err != nil { return errors.Wrapf(err, "error setting vpp if[%d] in pod vrf", swIfIndex) } @@ -124,23 +130,24 @@ func (i *PodInterfaceDriverData) DoPodInterfaceConfiguration(podSpec *storage.Lo if !isL3 { /* L2 */ - err = i.vpp.SetPromiscOn(swIfIndex) + err = i.vpp.SetPromiscOn(&iface) if err != nil { return errors.Wrapf(err, "Error setting memif promisc") } } - err = i.vpp.SetInterfaceMtu(swIfIndex, vpplink.MAX_MTU) + err = i.vpp.SetInterfaceMtu(&iface, types2.MaxMtu) if err != nil { return errors.Wrapf(err, "Error setting MTU on pod interface") } - err = i.vpp.InterfaceAdminUp(swIfIndex) + err = i.vpp.InterfaceAdminUp(&iface) if err != nil { return errors.Wrapf(err, "error setting new pod if up") } - err = i.vpp.SetInterfaceRxMode(swIfIndex, types.AllQueues, config.TapRxMode) + // TODO: is this configurable variable or not ? + err = i.vpp.SetInterfaceRxMode(&iface, types2.AllQueues, config.TapRxMode) if err != nil { return errors.Wrapf(err, "error SetInterfaceRxMode on pod if interface") } diff --git a/calico-vpp-agent/cni/pod_interface/loopback.go b/calico-vpp-agent/cni/pod_interface/loopback.go index 212c4cb5..18deedf2 100644 --- a/calico-vpp-agent/cni/pod_interface/loopback.go +++ b/calico-vpp-agent/cni/pod_interface/loopback.go @@ -22,6 +22,8 @@ import ( "github.com/projectcalico/vpp-dataplane/calico-vpp-agent/common" "github.com/projectcalico/vpp-dataplane/vpplink" "github.com/sirupsen/logrus" + + types2 "git.fd.io/govpp.git/api/v0" ) type LoopbackPodInterfaceDriver struct { @@ -43,11 +45,12 @@ func (i *LoopbackPodInterfaceDriver) CreateInterface(podSpec *storage.LocalPodSp } else { stack.Push(i.vpp.DeleteLoopback, swIfIndex) } - podSpec.LoopbackSwIfIndex = swIfIndex + iface := types2.Interface{SwIfIndex: swIfIndex} + podSpec.LoopbackSwIfIndex = iface.SwIfIndex for _, ipFamily := range vpplink.IpFamilies { vrfId := podSpec.GetVrfId(ipFamily) - err = i.vpp.SetInterfaceVRF(swIfIndex, vrfId, ipFamily.IsIp6) + err = i.vpp.SetInterfaceVRF(&iface, vrfId, ipFamily.IsIp6) if err != nil { return errors.Wrapf(err, "Error setting loopback %d in per pod vrf", swIfIndex) } @@ -59,7 +62,7 @@ func (i *LoopbackPodInterfaceDriver) CreateInterface(podSpec *storage.LocalPodSp } for _, containerIP := range podSpec.GetContainerIps() { - err = i.vpp.AddInterfaceAddress(swIfIndex, containerIP) + err = i.vpp.AddInterfaceAddress(&iface, containerIP) if err != nil { return errors.Wrapf(err, "Error adding address %s to pod loopback interface", containerIP) } @@ -71,7 +74,9 @@ func (i *LoopbackPodInterfaceDriver) CreateInterface(podSpec *storage.LocalPodSp func (i *LoopbackPodInterfaceDriver) DeleteInterface(podSpec *storage.LocalPodSpec) { i.UndoPodIfNatConfiguration(podSpec.LoopbackSwIfIndex) - err := i.vpp.DeleteLoopback(podSpec.LoopbackSwIfIndex) + iface := types2.Interface{SwIfIndex: podSpec.LoopbackSwIfIndex} + + err := i.vpp.DeleteLoopback(&iface) if err != nil { i.log.Errorf("Error deleting Loopback %s", err) } diff --git a/calico-vpp-agent/cni/pod_interface/memif.go b/calico-vpp-agent/cni/pod_interface/memif.go index daf1358c..9363a657 100644 --- a/calico-vpp-agent/cni/pod_interface/memif.go +++ b/calico-vpp-agent/cni/pod_interface/memif.go @@ -23,6 +23,8 @@ import ( "github.com/projectcalico/vpp-dataplane/vpplink" "github.com/projectcalico/vpp-dataplane/vpplink/types" "github.com/sirupsen/logrus" + + types2 "git.fd.io/govpp.git/api/v0" ) type MemifPodInterfaceDriver struct { @@ -65,15 +67,16 @@ func (i *MemifPodInterfaceDriver) CreateInterface(podSpec *storage.LocalPodSpec, } else { stack.Push(i.vpp.DeleteMemif, memif.SwIfIndex) } - podSpec.MemifSwIfIndex = memif.SwIfIndex + iface := types2.Interface{SwIfIndex: memif.SwIfIndex} + podSpec.MemifSwIfIndex = iface.SwIfIndex - err = i.vpp.SetInterfaceTag(memif.SwIfIndex, podSpec.GetInterfaceTag(i.name)) + err = i.vpp.SetInterfaceTag(&iface, podSpec.GetInterfaceTag(i.name)) if err != nil { return err } if config.PodGSOEnabled { - err = i.vpp.EnableGSOFeature(memif.SwIfIndex) + err = i.vpp.EnableGSOFeature(&iface) if err != nil { return errors.Wrap(err, "Error enabling GSO on memif") } diff --git a/calico-vpp-agent/cni/pod_interface/tuntap.go b/calico-vpp-agent/cni/pod_interface/tuntap.go index b12ad96e..084a2223 100644 --- a/calico-vpp-agent/cni/pod_interface/tuntap.go +++ b/calico-vpp-agent/cni/pod_interface/tuntap.go @@ -17,6 +17,7 @@ package pod_interface import ( "fmt" + types2 "git.fd.io/govpp.git/api/v0" "io" "net" "os" @@ -31,7 +32,6 @@ import ( "github.com/projectcalico/vpp-dataplane/calico-vpp-agent/cni/storage" "github.com/projectcalico/vpp-dataplane/calico-vpp-agent/config" "github.com/projectcalico/vpp-dataplane/vpplink" - "github.com/projectcalico/vpp-dataplane/vpplink/types" ) type TunTapPodInterfaceDriver struct { @@ -85,8 +85,8 @@ func (i *TunTapPodInterfaceDriver) CreateInterface(podSpec *storage.LocalPodSpec } i.log.Debugf("Determined pod MTU: %d", podMtu) - tun := &types.TapV2{ - GenericVppInterface: types.GenericVppInterface{ + tun := &types2.TapInterface{ + Interface: types2.Interface{ NumRxQueues: config.TapNumRxQueues, NumTxQueues: config.TapNumTxQueues, RxQueueSize: config.TapRxQueueSize, @@ -99,11 +99,11 @@ func (i *TunTapPodInterfaceDriver) CreateInterface(podSpec *storage.LocalPodSpec } if podSpec.TunTapIsL3 { - tun.Flags |= types.TapFlagTun + tun.Flags |= types2.TapFlagTun } if config.PodGSOEnabled { - tun.Flags |= types.TapFlagGSO | types.TapGROCoalesce + tun.Flags |= types2.TapFlagGSO | types2.TapGROCoalesce } i.log.Debugf("Add request pod MTU: %d, computed %d", podSpec.Mtu, tun.HostMtu) @@ -149,7 +149,9 @@ func (i *TunTapPodInterfaceDriver) DeleteInterface(podSpec *storage.LocalPodSpec i.UndoPodInterfaceConfiguration(podSpec.TunTapSwIfIndex) i.UndoPodIfNatConfiguration(podSpec.TunTapSwIfIndex) - err := i.vpp.DelTap(podSpec.TunTapSwIfIndex) + iface := types2.Interface{SwIfIndex: podSpec.TunTapSwIfIndex} + + err := i.vpp.DelTap(&iface) if err != nil { i.log.Warnf("Error deleting tun[%d] %s", podSpec.TunTapSwIfIndex, err) } diff --git a/calico-vpp-agent/cni/pod_interface/vcl.go b/calico-vpp-agent/cni/pod_interface/vcl.go index 1ac22eda..179e499a 100644 --- a/calico-vpp-agent/cni/pod_interface/vcl.go +++ b/calico-vpp-agent/cni/pod_interface/vcl.go @@ -22,6 +22,8 @@ import ( "github.com/projectcalico/vpp-dataplane/vpplink" "github.com/projectcalico/vpp-dataplane/vpplink/types" "github.com/sirupsen/logrus" + + types2 "git.fd.io/govpp.git/api/v0" ) const ( @@ -75,7 +77,9 @@ func (i *VclPodInterfaceDriver) CreateInterface(podSpec *storage.LocalPodSpec, s stack.Push(i.vpp.DelSessionAppNamespace, appNamespace) } - err = i.vpp.InterfaceAdminUp(podSpec.LoopbackSwIfIndex) + iface := types2.Interface{SwIfIndex: podSpec.LoopbackSwIfIndex} + + err = i.vpp.InterfaceAdminUp(&iface) if err != nil { return err } diff --git a/calico-vpp-agent/config/config.go b/calico-vpp-agent/config/config.go index 5239150e..b08733d7 100644 --- a/calico-vpp-agent/config/config.go +++ b/calico-vpp-agent/config/config.go @@ -17,6 +17,7 @@ package config import ( "fmt" + types2 "git.fd.io/govpp.git/api/v0" "io/ioutil" "net" "os" @@ -25,7 +26,6 @@ import ( "time" "github.com/pkg/errors" - "github.com/projectcalico/vpp-dataplane/vpplink/types" "github.com/sirupsen/logrus" ) @@ -67,7 +67,7 @@ const ( DefaultVXLANPort = 4789 DefaultWireguardPort = 51820 - defaultRxMode = types.Adaptative + defaultRxMode = types2.Adaptative ) var ( @@ -315,13 +315,14 @@ func LoadConfig(log *logrus.Logger) (err error) { ServiceCIDRs = append(ServiceCIDRs, serviceCIDR) } + // TODO: To/From String these are duplicates again switch getEnvValue(TapRxModeEnvVar) { case "interrupt": - TapRxMode = types.Interrupt + TapRxMode = types2.Interrupt case "polling": - TapRxMode = types.Polling + TapRxMode = types2.Polling case "adaptive": - TapRxMode = types.Adaptative + TapRxMode = types2.Adaptative default: TapRxMode = defaultRxMode } diff --git a/calico-vpp-agent/connectivity/ipip.go b/calico-vpp-agent/connectivity/ipip.go index 1ac6358f..e1e66537 100644 --- a/calico-vpp-agent/connectivity/ipip.go +++ b/calico-vpp-agent/connectivity/ipip.go @@ -25,6 +25,8 @@ import ( "github.com/projectcalico/vpp-dataplane/calico-vpp-agent/config" "github.com/projectcalico/vpp-dataplane/vpplink" "github.com/projectcalico/vpp-dataplane/vpplink/types" + + types2 "git.fd.io/govpp.git/api/v0" ) type IpipProvider struct { @@ -114,49 +116,51 @@ func (p *IpipProvider) AddConnectivity(cn *common.NodeConnectivity) error { return errors.Wrapf(err, "Error adding ipip tunnel %s", tunnel.String()) } - err = p.vpp.InterfaceSetUnnumbered(swIfIndex, config.DataInterfaceSwIfIndex) + iface := types2.Interface{SwIfIndex: swIfIndex} + + err = p.vpp.InterfaceSetUnnumbered(iface.SwIfIndex, config.DataInterfaceSwIfIndex) if err != nil { p.errorCleanup(tunnel) return errors.Wrapf(err, "Error setting ipip tunnel unnumbered") } // Always enable GSO feature on IPIP tunnel, only a tiny negative effect on perf if GSO is not enabled on the taps - err = p.vpp.EnableGSOFeature(swIfIndex) + err = p.vpp.EnableGSOFeature(&iface) if err != nil { p.errorCleanup(tunnel) return errors.Wrapf(err, "Error enabling gso for ipip interface") } - err = p.vpp.CnatEnableFeatures(swIfIndex) + err = p.vpp.CnatEnableFeatures(iface.SwIfIndex) if err != nil { p.errorCleanup(tunnel) return errors.Wrapf(err, "Error enabling nat for ipip interface") } - err = p.vpp.InterfaceAdminUp(swIfIndex) + err = p.vpp.InterfaceAdminUp(&iface) if err != nil { p.errorCleanup(tunnel) return errors.Wrapf(err, "Error setting ipip interface up") } - p.log.Debugf("Routing pod->node %s traffic into tunnel (swIfIndex %d)", cn.NextHop.String(), swIfIndex) + p.log.Debugf("Routing pod->node %s traffic into tunnel (swIfIndex %d)", cn.NextHop.String(), iface.SwIfIndex) err = p.vpp.RouteAdd(&types.Route{ Dst: common.ToMaxLenCIDR(cn.NextHop), Paths: []types.RoutePath{{ - SwIfIndex: swIfIndex, + SwIfIndex: iface.SwIfIndex, Gw: nil, }}, Table: common.PodVRFIndex, }) if err != nil { p.errorCleanup(tunnel) - return errors.Wrapf(err, "Error adding route to %s in ipip tunnel %d for pods", cn.NextHop.String(), swIfIndex) + return errors.Wrapf(err, "Error adding route to %s in ipip tunnel %d for pods", cn.NextHop.String(), iface.SwIfIndex) } p.ipipIfs[cn.NextHop.String()] = tunnel common.SendEvent(common.CalicoVppEvent{ Type: common.TunnelAdded, - New: swIfIndex, + New: iface.SwIfIndex, }) } p.log.Infof("connectivity(add) using IPIP tunnel=%s", tunnel.String()) diff --git a/calico-vpp-agent/connectivity/ipsec.go b/calico-vpp-agent/connectivity/ipsec.go index a246e9c2..9920c7c1 100644 --- a/calico-vpp-agent/connectivity/ipsec.go +++ b/calico-vpp-agent/connectivity/ipsec.go @@ -28,6 +28,8 @@ import ( "github.com/projectcalico/vpp-dataplane/calico-vpp-agent/config" "github.com/projectcalico/vpp-dataplane/vpplink" "github.com/projectcalico/vpp-dataplane/vpplink/types" + + types2 "git.fd.io/govpp.git/api/v0" ) type IpsecTunnel struct { @@ -174,43 +176,45 @@ func (p *IpsecProvider) createIPSECTunnel(tunnel *IpsecTunnel, psk string, stack stack.Push(p.vpp.DelIPIPTunnel, tunnel) } + iface := types2.Interface{SwIfIndex: swIfIndex} + common.SendEvent(common.CalicoVppEvent{ Type: common.TunnelAdded, - New: swIfIndex, + New: iface.SwIfIndex, }) stack.Push(common.SendEvent, common.CalicoVppEvent{ Type: common.TunnelDeleted, - Old: swIfIndex, + Old: iface.SwIfIndex, }) - err = p.vpp.InterfaceSetUnnumbered(swIfIndex, config.DataInterfaceSwIfIndex) + err = p.vpp.InterfaceSetUnnumbered(iface.SwIfIndex, config.DataInterfaceSwIfIndex) if err != nil { return errors.Wrapf(err, "Error setting ipip tunnel %s unnumbered: %s", tunnel.String()) } // Always enable GSO feature on IPIP tunnel, only a tiny negative effect on perf if GSO is not enabled on the taps - err = p.vpp.EnableGSOFeature(swIfIndex) + err = p.vpp.EnableGSOFeature(&iface) if err != nil { return errors.Wrapf(err, "Error enabling gso for ipip interface") } - err = p.vpp.CnatEnableFeatures(swIfIndex) + err = p.vpp.CnatEnableFeatures(iface.SwIfIndex) if err != nil { return errors.Wrapf(err, "Error enabling nat for ipip interface") } - p.log.Debugf("Routing pod->node %s traffic into tunnel (swIfIndex %d)", tunnel.Dst.String(), swIfIndex) + p.log.Debugf("Routing pod->node %s traffic into tunnel (swIfIndex %d)", tunnel.Dst.String(), iface.SwIfIndex) route := &types.Route{ Dst: common.ToMaxLenCIDR(tunnel.Dst), Paths: []types.RoutePath{{ - SwIfIndex: swIfIndex, + SwIfIndex: iface.SwIfIndex, Gw: nil, }}, Table: common.PodVRFIndex, } err = p.vpp.RouteAdd(route) if err != nil { - return errors.Wrapf(err, "Error adding route to %s in ipip tunnel %d for pods", tunnel.Dst.String(), swIfIndex) + return errors.Wrapf(err, "Error adding route to %s in ipip tunnel %d for pods", tunnel.Dst.String(), iface.SwIfIndex) } else { stack.Push(p.vpp.RouteDel, route) } @@ -224,7 +228,7 @@ func (p *IpsecProvider) createIPSECTunnel(tunnel *IpsecTunnel, psk string, stack } p.log.Infof("connectivity(add) IKE Profile=%s swIfIndex=%d", tunnel.Profile(), tunnel.SwIfIndex) - err = p.vpp.SetIKEv2TunnelInterface(tunnel.Profile(), swIfIndex) + err = p.vpp.SetIKEv2TunnelInterface(tunnel.Profile(), iface.SwIfIndex) if err != nil { return errors.Wrapf(err, "error configuring IPsec tunnel %s", tunnel.String()) } @@ -287,7 +291,7 @@ func (p *IpsecProvider) waitForIPsecSA(tunnel IpsecTunnel) func() { p.log.Infof("connectivity(del) canceling Profile=%s", tunnel.Profile()) return case <-ticker.C: - iface, err := p.vpp.GetInterfaceDetails(tunnel.SwIfIndex) + iface, err := p.vpp.GetInterfaceDetails(&types2.Interface{SwIfIndex: tunnel.SwIfIndex}) if err != nil { p.log.WithError(err).Errorf("Cannot get IPIP tunnel %s status", tunnel.String()) return diff --git a/calico-vpp-agent/connectivity/vxlan.go b/calico-vpp-agent/connectivity/vxlan.go index c43402de..2f443818 100644 --- a/calico-vpp-agent/connectivity/vxlan.go +++ b/calico-vpp-agent/connectivity/vxlan.go @@ -25,6 +25,8 @@ import ( "github.com/projectcalico/vpp-dataplane/calico-vpp-agent/config" "github.com/projectcalico/vpp-dataplane/vpplink" "github.com/projectcalico/vpp-dataplane/vpplink/types" + + types2 "git.fd.io/govpp.git/api/v0" ) type VXLanProvider struct { @@ -153,50 +155,53 @@ func (p *VXLanProvider) AddConnectivity(cn *common.NodeConnectivity) error { if err != nil { return errors.Wrapf(err, "Error adding vxlan tunnel %s -> %s", nodeIP.String(), cn.NextHop.String()) } - err = p.vpp.InterfaceSetUnnumbered(swIfIndex, config.DataInterfaceSwIfIndex) + + iface := types2.Interface{SwIfIndex: swIfIndex} + + err = p.vpp.InterfaceSetUnnumbered(iface.SwIfIndex, config.DataInterfaceSwIfIndex) if err != nil { // TODO : delete tunnel return errors.Wrapf(err, "Error setting vxlan tunnel unnumbered") } // Always enable GSO feature on VXLan tunnel, only a tiny negative effect on perf if GSO is not enabled on the taps - err = p.vpp.EnableGSOFeature(swIfIndex) + err = p.vpp.EnableGSOFeature(&iface) if err != nil { // TODO : delete tunnel return errors.Wrapf(err, "Error enabling gso for vxlan interface") } - err = p.vpp.CnatEnableFeatures(swIfIndex) + err = p.vpp.CnatEnableFeatures(iface.SwIfIndex) if err != nil { // TODO : delete tunnel return errors.Wrapf(err, "Error enabling nat for vxlan interface") } - err = p.vpp.InterfaceAdminUp(swIfIndex) + err = p.vpp.InterfaceAdminUp(&iface) if err != nil { // TODO : delete tunnel return errors.Wrapf(err, "Error setting vxlan interface up") } - p.log.Debugf("Routing pod->node %s traffic into tunnel (swIfIndex %d)", cn.NextHop.String(), swIfIndex) + p.log.Debugf("Routing pod->node %s traffic into tunnel (swIfIndex %d)", cn.NextHop.String(), iface.SwIfIndex) err = p.vpp.RouteAdd(&types.Route{ Dst: common.ToMaxLenCIDR(cn.NextHop), Paths: []types.RoutePath{{ - SwIfIndex: swIfIndex, + SwIfIndex: iface.SwIfIndex, Gw: nil, }}, Table: common.PodVRFIndex, }) if err != nil { // TODO : delete tunnel - return errors.Wrapf(err, "Error adding route to %s in ipip tunnel %d for pods", cn.NextHop.String(), swIfIndex) + return errors.Wrapf(err, "Error adding route to %s in ipip tunnel %d for pods", cn.NextHop.String(), iface.SwIfIndex) } p.vxlanIfs[cn.NextHop.String()] = *tunnel p.log.Infof("connectivity(add) VXLan Added tunnel=%s", tunnel) common.SendEvent(common.CalicoVppEvent{ Type: common.TunnelAdded, - New: swIfIndex, + New: iface.SwIfIndex, }) } diff --git a/calico-vpp-agent/connectivity/wireguard.go b/calico-vpp-agent/connectivity/wireguard.go index c301b5d4..a8d383ff 100644 --- a/calico-vpp-agent/connectivity/wireguard.go +++ b/calico-vpp-agent/connectivity/wireguard.go @@ -27,18 +27,20 @@ import ( "github.com/projectcalico/vpp-dataplane/calico-vpp-agent/common" "github.com/projectcalico/vpp-dataplane/calico-vpp-agent/config" "github.com/projectcalico/vpp-dataplane/vpplink/types" + + types2 "git.fd.io/govpp.git/api/v0" ) type WireguardProvider struct { *ConnectivityProviderData wireguardTunnel *types.WireguardTunnel - wireguardPeers map[string]types.WireguardPeer + wireguardPeers map[string]types.WireguardPeer } func NewWireguardProvider(d *ConnectivityProviderData) *WireguardProvider { return &WireguardProvider{ ConnectivityProviderData: d, - wireguardTunnel: nil, + wireguardTunnel: nil, wireguardPeers: make(map[string]types.WireguardPeer), } } @@ -128,7 +130,7 @@ func (p *WireguardProvider) errorCleanup(tunnel *types.WireguardTunnel) { } } -func (p *WireguardProvider) EnableDisable(isEnable bool) () { +func (p *WireguardProvider) EnableDisable(isEnable bool) { if isEnable { if p.wireguardTunnel == nil { err := p.createWireguardTunnel(false /* isv6 */) @@ -174,33 +176,36 @@ func (p *WireguardProvider) createWireguardTunnel(isIP6 bool) error { p.errorCleanup(tunnel) return errors.Wrapf(err, "Error creating wireguard tunnel") } + + iface := types2.Interface{SwIfIndex: swIfIndex} + // fetch public key of created tunnel - createdTunnel, err := p.vpp.GetWireguardTunnel(swIfIndex) + createdTunnel, err := p.vpp.GetWireguardTunnel(iface.SwIfIndex) if err != nil { p.errorCleanup(tunnel) return errors.Wrapf(err, "Error fetching wireguard tunnel after creation") } tunnel.PublicKey = createdTunnel.PublicKey - err = p.vpp.InterfaceSetUnnumbered(swIfIndex, config.DataInterfaceSwIfIndex) + err = p.vpp.InterfaceSetUnnumbered(iface.SwIfIndex, config.DataInterfaceSwIfIndex) if err != nil { p.errorCleanup(tunnel) return errors.Wrapf(err, "Error setting wireguard tunnel unnumbered") } - err = p.vpp.EnableGSOFeature(swIfIndex) + err = p.vpp.EnableGSOFeature(&iface) if err != nil { p.errorCleanup(tunnel) return errors.Wrapf(err, "Error enabling gso for wireguard interface") } - err = p.vpp.CnatEnableFeatures(swIfIndex) + err = p.vpp.CnatEnableFeatures(iface.SwIfIndex) if err != nil { p.errorCleanup(tunnel) return errors.Wrapf(err, "Error enabling nat for wireguard interface") } - err = p.vpp.InterfaceAdminUp(swIfIndex) + err = p.vpp.InterfaceAdminUp(&iface) if err != nil { p.errorCleanup(tunnel) return errors.Wrapf(err, "Error setting wireguard interface up") @@ -208,7 +213,7 @@ func (p *WireguardProvider) createWireguardTunnel(isIP6 bool) error { common.SendEvent(common.CalicoVppEvent{ Type: common.TunnelAdded, - New: swIfIndex, + New: iface.SwIfIndex, }) p.wireguardTunnel = tunnel diff --git a/calico-vpp-agent/policy/policy_server.go b/calico-vpp-agent/policy/policy_server.go index 91d7b2f7..c4f5dd62 100644 --- a/calico-vpp-agent/policy/policy_server.go +++ b/calico-vpp-agent/policy/policy_server.go @@ -39,6 +39,8 @@ import ( "github.com/projectcalico/vpp-dataplane/calico-vpp-agent/proto" "github.com/projectcalico/vpp-dataplane/vpplink" "github.com/projectcalico/vpp-dataplane/vpplink/types" + + types2 "git.fd.io/govpp.git/api/v0" ) const ( @@ -168,13 +170,14 @@ func (s *Server) mapTagToInterfaceDetails() (tagIfDetails map[string]interfaceDe return nil, err } for intf, uplink := range uplinkSwifindexes { + iface := types2.Interface{SwIfIndex: uplink} tap, found := tapSwifindexes["host-"+intf[5:]] if found { - ip4adds, err := s.vpp.AddrList(uplink, false) + ip4adds, err := s.vpp.GetInterfaceAddressesIP4(&iface) if err != nil { return nil, err } - ip6adds, err := s.vpp.AddrList(uplink, true) + ip6adds, err := s.vpp.GetInterfaceAddressesIP6(&iface) if err != nil { return nil, err } @@ -183,9 +186,9 @@ func (s *Server) mapTagToInterfaceDetails() (tagIfDetails map[string]interfaceDe for _, add := range adds { addresses = append(addresses, add.IPNet.IP.String()) } - tagIfDetails[intf[5:]] = interfaceDetails{tap, uplink, addresses} + tagIfDetails[intf[5:]] = interfaceDetails{tap, iface.SwIfIndex, addresses} } else { - return nil, errors.Errorf("uplink interface %s not corresponding to a tap interface", uplink) + return nil, errors.Errorf("uplink interface %s not corresponding to a tap interface", iface.SwIfIndex) } } return tagIfDetails, nil diff --git a/go.mod b/go.mod index 535a8169..f1010ff6 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,6 @@ require ( github.com/containernetworking/plugins v0.8.5 github.com/gogo/protobuf v1.3.2 github.com/golang/protobuf v1.5.2 - github.com/hashicorp/go-version v1.4.0 // indirect github.com/lunixbochs/struc v0.0.0-20200707160740-784aaebc1d40 github.com/orijtech/prometheus-go-metrics-exporter v0.0.6 github.com/osrg/gobgp v0.0.0-20210801043420-9e48a36ed97c @@ -20,8 +19,8 @@ require ( github.com/stretchr/testify v1.7.0 github.com/vishvananda/netlink v1.1.1-0.20210703095558-21f2c55a7727 github.com/yookoala/realpath v1.0.0 - golang.org/x/net v0.0.0-20211216030914-fe4d6282115f - golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71 + golang.org/x/net v0.0.0-20220225172249-27dd8689420f + golang.org/x/sys v0.0.0-20220731174439-a90be440212d google.golang.org/grpc v1.31.0 google.golang.org/protobuf v1.26.0 gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637 @@ -32,7 +31,7 @@ require ( ) replace ( - git.fd.io/govpp.git v0.3.6-0.20210927044411-385ccc0d8ba9 => /Users/nskrzypc/wrk/calico/govpp + git.fd.io/govpp.git v0.3.6-0.20210927044411-385ccc0d8ba9 => /data/work/cisco/git/govpp github.com/projectcalico/api => github.com/projectcalico/api v0.0.0-20220129171738-695e97a25204 // v3.22.0 diff --git a/go.sum b/go.sum index 1552e8e9..0bf8f928 100644 --- a/go.sum +++ b/go.sum @@ -35,8 +35,6 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= dmitri.shuralyov.com/gpu/mtl v0.0.0-20201218220906-28db891af037/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -git.fd.io/govpp.git v0.3.6-0.20210927044411-385ccc0d8ba9 h1:QFHVGWCWf6e226vMy1zU614eC3glrfJO2CwREUk8D6s= -git.fd.io/govpp.git v0.3.6-0.20210927044411-385ccc0d8ba9/go.mod h1:OCVd4W8SH+666KRQoMj6PM+oipLDZAHhqMz9B1TGbgI= github.com/Azure/azure-sdk-for-go v43.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= @@ -326,6 +324,7 @@ 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/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-test/deep v1.0.6 h1:UHSEyLZUwX9Qoi99vVwvewiMC8mM2bf7XEM2nqvzEn8= github.com/go-test/deep v1.0.6/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8= github.com/gobuffalo/here v0.6.0/go.mod h1:wAG085dHOYqUpf+Ap+WOdrPTp5IYcDAs/x7PLa8Y5fM= @@ -406,6 +405,7 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -448,9 +448,7 @@ github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerX github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.3.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.4.0 h1:aAQzgqIrRKRa7w75CKpbBxYsmUoPjzVm1W59ca1L0J4= -github.com/hashicorp/go-version v1.4.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.5.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -469,10 +467,10 @@ github.com/heketi/tests v0.0.0-20151005000721-f3775cbcefd6/go.mod h1:xGMAM8JLi7U github.com/howeyc/fsnotify v0.9.0/go.mod h1:41HzSPxBGeFRQKEEwgh49TRw/nKBsYZ2cF1OzPjSJsA= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= -github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/ishidawataru/sctp v0.0.0-20190723014705-7c296d48a2b5/go.mod h1:DM4VvS+hD/kDi1U1QsX2fnZowwBhqD0Dk3bRPKF/Oc8= github.com/ishidawataru/sctp v0.0.0-20191218070446-00ab2ac2db07/go.mod h1:co9pwDoBCm1kGxawmb4sPq0cSIOOWNPT4KnHotMP1Zg= @@ -627,8 +625,9 @@ github.com/natefinch/atomic v0.0.0-20150920032501-a62ce929ffcc/go.mod h1:1rLVY/D github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nmrshll/go-cp v0.0.0-20180115193924-61436d3b7cfa/go.mod h1:/Uh/WFiWYXoTKVsM302U10XnogAldY7up/xErXmt1FA= -github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.4/go.mod h1:zq6QwlOf5SlnkVbMSr5EoBv3636FWnp+qbPhuoO21uA= @@ -638,16 +637,19 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= -github.com/onsi/ginkgo v1.14.1 h1:jMU0WaQrP0a/YAEq8eJmJKjBoMs+pClEr1vDMlM/Do4= github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v0.0.0-20151007035656-2152b45fa28a/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.1.0/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= -github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= @@ -769,7 +771,6 @@ github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkU github.com/spf13/cobra v0.0.0-20170731170427-b26b538f6930/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v1.0.0/go.mod h1:/6GTrnGXV9HjY+aR4k0oJ5tcvakLuG6EuKReYlHNrgE= -github.com/spf13/cobra v1.1.1 h1:KfztREH0tPxJJ+geloSLaAkaPkr4ki2Er5quFV1TDo4= github.com/spf13/cobra v1.1.1/go.mod h1:WnodtKOvamDL/PwE2M4iKs8aMDBZ5Q5klgD3qfVJQMI= github.com/spf13/jwalterweatherman v0.0.0-20170523133247-0efa5202c046/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= @@ -979,9 +980,11 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20211209124913-491a49abca63/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211216030914-fe4d6282115f h1:hEYJvxw1lSnWIl8X9ofsYMklzaDs90JI2az5YMd4fPM= golang.org/x/net v0.0.0-20211216030914-fe4d6282115f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= 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= @@ -1056,7 +1059,6 @@ golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200610111108-226ff32320da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1065,26 +1067,32 @@ golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200916030750-2334cc1a136f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210426230700-d19ff857e887/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71 h1:ikCpsnYR+Ew0vu99XlDp55lGgDJdIMx3f4a18jfse/s= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210816074244-15123e1e1f71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220731174439-a90be440212d h1:Sv5ogFZatcgIMMtBSTTAgMYsicp25MXBubjXNDKwm80= +golang.org/x/sys v0.0.0-20220731174439-a90be440212d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d h1:SZxvLBoTP5yHO3Frd4z4vrF+DBX9vMVanchswa69toE= golang.org/x/term v0.0.0-20210220032956-6a3ed077a48d/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= 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= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= 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 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 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= @@ -1148,6 +1156,7 @@ golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20201022035929-9cf592e881e9/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.2 h1:kRBLX7v7Af8W7Gdbbc908OJcdgtK8bOz9Uaj8/F1ACA= diff --git a/vpp-manager/config/config.go b/vpp-manager/config/config.go index 2696611a..9765b70a 100644 --- a/vpp-manager/config/config.go +++ b/vpp-manager/config/config.go @@ -17,12 +17,12 @@ package config import ( "fmt" + types2 "git.fd.io/govpp.git/api/v0" "net" "sort" "strconv" "strings" - "github.com/projectcalico/vpp-dataplane/vpplink/types" "github.com/vishvananda/netlink" ) @@ -63,14 +63,16 @@ type InterfaceSpec struct { } type VppManagerParams struct { - VppStartupSleepSeconds int - InterfacesSpecs []InterfaceSpec - ConfigExecTemplate string - ConfigTemplate string - NodeName string - CorePattern string - RxMode types.RxMode - TapRxMode types.RxMode + VppStartupSleepSeconds int + InterfacesSpecs []InterfaceSpec + ConfigExecTemplate string + ConfigTemplate string + NodeName string + CorePattern string + + RxMode types2.RxMode + TapRxMode types2.RxMode + ServiceCIDRs []net.IPNet ExtraAddrCount int TapRxQueueSize int diff --git a/vpp-manager/startup/startup.go b/vpp-manager/startup/startup.go index 0bd81eff..6a71986a 100644 --- a/vpp-manager/startup/startup.go +++ b/vpp-manager/startup/startup.go @@ -18,6 +18,7 @@ package startup import ( "encoding/json" "fmt" + types2 "git.fd.io/govpp.git/api/v0" "net" "os" "os/exec" @@ -31,7 +32,6 @@ import ( "github.com/projectcalico/vpp-dataplane/vpp-manager/config" "github.com/projectcalico/vpp-dataplane/vpp-manager/hooks" "github.com/projectcalico/vpp-dataplane/vpp-manager/utils" - "github.com/projectcalico/vpp-dataplane/vpplink/types" log "github.com/sirupsen/logrus" ) @@ -103,7 +103,7 @@ const ( DefaultPhyQueueSize = 1024 DefaultNumRxQueues = 1 DefaultNumTxQueues = 1 - defaultRxMode = types.Adaptative + defaultRxMode = types2.Adaptative /* Allow a maximum number of corefiles, delete older ones */ maxCoreFiles = 2 ) @@ -287,12 +287,12 @@ func parseEnvVariables(params *config.VppManagerParams, mainInterfaceSpec config params.InterfacesSpecs = []config.InterfaceSpec{mainInterfaceSpec} params.InterfacesSpecs = append(params.InterfacesSpecs, extraInterfacesSpecs...) - params.RxMode = types.UnformatRxMode(getEnvValue(RxModeEnvVar)) - if params.RxMode == types.UnknownRxMode { + params.RxMode = types2.UnformatRxMode(getEnvValue(RxModeEnvVar)) + if params.RxMode == types2.UnknownRxMode { params.RxMode = defaultRxMode } - params.TapRxMode = types.UnformatRxMode(getEnvValue(TapRxModeEnvVar)) - if params.TapRxMode == types.UnknownRxMode { + params.TapRxMode = types2.UnformatRxMode(getEnvValue(TapRxModeEnvVar)) + if params.TapRxMode == types2.UnknownRxMode { params.TapRxMode = defaultRxMode } @@ -389,8 +389,8 @@ func PrintVppManagerConfig(params *config.VppManagerParams, confs []*config.Linu log.Infof("-- Environment --") log.Infof("CorePattern: %s", params.CorePattern) log.Infof("ExtraAddrCount: %d", params.ExtraAddrCount) - log.Infof("RxMode: %s", types.FormatRxMode(params.RxMode)) - log.Infof("TapRxMode: %s", types.FormatRxMode(params.TapRxMode)) + log.Infof("RxMode: %s", params.RxMode) + log.Infof("TapRxMode: %s", params.TapRxMode) log.Infof("Tap MTU override: %d", params.UserSpecifiedMtu) log.Infof("Service CIDRs: [%s]", utils.FormatIPNetSlice(params.ServiceCIDRs)) log.Infof("Tap Queue Size: rx:%d tx:%d", params.TapRxQueueSize, params.TapTxQueueSize) diff --git a/vpp-manager/uplink/af_xdp.go b/vpp-manager/uplink/af_xdp.go index bcc9f421..6a39e9a0 100644 --- a/vpp-manager/uplink/af_xdp.go +++ b/vpp-manager/uplink/af_xdp.go @@ -25,6 +25,8 @@ import ( "github.com/projectcalico/vpp-dataplane/vpplink/types" log "github.com/sirupsen/logrus" "github.com/vishvananda/netlink" + + types2 "git.fd.io/govpp.git/api/v0" ) const ( @@ -150,7 +152,9 @@ func (d *AFXDPDriver) CreateMainVppInterface(vpp *vpplink.VppLink, vppPid int) ( return fmt.Errorf("Created AF_XDP interface has wrong swIfIndex %d!", intf.SwIfIndex) } - err = vpp.SetInterfaceMacAddress(intf.SwIfIndex, &d.conf.HardwareAddr) + iface := types2.Interface{SwIfIndex: intf.SwIfIndex} + + err = vpp.SetInterfaceMacAddress(&iface, &d.conf.HardwareAddr) if err != nil { return errors.Wrap(err, "could not set af_xdp interface mac address in vpp") } diff --git a/vpp-manager/uplink/avf.go b/vpp-manager/uplink/avf.go index a48e98ac..57358099 100644 --- a/vpp-manager/uplink/avf.go +++ b/vpp-manager/uplink/avf.go @@ -25,6 +25,8 @@ import ( "github.com/projectcalico/vpp-dataplane/vpplink/types" log "github.com/sirupsen/logrus" "github.com/vishvananda/netlink" + + types2 "git.fd.io/govpp.git/api/v0" ) type AVFDriver struct { @@ -158,16 +160,18 @@ func (d *AVFDriver) CreateMainVppInterface(vpp *vpplink.VppLink, vppPid int) (er } log.Infof("Created AVF interface %d", swIfIndex) - err = vpp.SetPromiscOn(swIfIndex) + iface := types2.Interface{SwIfIndex: swIfIndex} + + err = vpp.SetPromiscOn(&iface) if err != nil { return errors.Wrapf(err, "Error setting AVF promisc on") } - if d.spec.IsMain && swIfIndex != config.DataInterfaceSwIfIndex { - return fmt.Errorf("Created AVF interface has wrong swIfIndex %d!", swIfIndex) + if d.spec.IsMain && iface.SwIfIndex != config.DataInterfaceSwIfIndex { + return fmt.Errorf("Created AVF interface has wrong swIfIndex %d!", iface.SwIfIndex) } - d.spec.SwIfIndex = swIfIndex - err = d.TagMainInterface(vpp, swIfIndex, d.spec.InterfaceName) + d.spec.SwIfIndex = iface.SwIfIndex + err = d.TagMainInterface(vpp, iface.SwIfIndex, d.spec.InterfaceName) if err != nil { return err } diff --git a/vpp-manager/uplink/common.go b/vpp-manager/uplink/common.go index 6bf72f42..1a08ee3e 100644 --- a/vpp-manager/uplink/common.go +++ b/vpp-manager/uplink/common.go @@ -27,6 +27,8 @@ import ( "github.com/projectcalico/vpp-dataplane/vpplink/types" log "github.com/sirupsen/logrus" "github.com/vishvananda/netlink" + + types2 "git.fd.io/govpp.git/api/v0" ) const ( @@ -62,7 +64,8 @@ func (d *UplinkDriverData) GetName() string { func (d *UplinkDriverData) TagMainInterface(vpp *vpplink.VppLink, swIfIndex uint32, name string) (err error) { log.Infof("tagging interface [%d] with: %s", swIfIndex, "main-"+name) - err = vpp.SetInterfaceTag(swIfIndex, "main-"+name) + iface := types2.Interface{SwIfIndex: swIfIndex} + err = vpp.SetInterfaceTag(&iface, "main-"+name) if err != nil { return err } diff --git a/vpp-manager/vpp_runner.go b/vpp-manager/vpp_runner.go index a01acd49..915591b2 100644 --- a/vpp-manager/vpp_runner.go +++ b/vpp-manager/vpp_runner.go @@ -42,6 +42,8 @@ import ( log "github.com/sirupsen/logrus" "github.com/vishvananda/netlink" tomb "gopkg.in/tomb.v2" + + types2 "git.fd.io/govpp.git/api/v0" ) var ( @@ -306,6 +308,8 @@ func (v *VppRunner) configureLinuxTap(link netlink.Link, ifState config.LinuxInt } func (v *VppRunner) addExtraAddresses(addrList []netlink.Addr, extraAddrCount int, vppIfSwIfIndex uint32) (err error) { + iface := types2.Interface{SwIfIndex: vppIfSwIfIndex} + ipFlowHash := types.FlowHashSrcIP | types.FlowHashDstIP | types.FlowHashSrcPort | @@ -336,7 +340,7 @@ func (v *VppRunner) addExtraAddresses(addrList []netlink.Addr, extraAddrCount in Mask: addr.Mask, } a.IP[2] += byte(i) - err = v.vpp.AddInterfaceAddress(vppIfSwIfIndex, a) + err = v.vpp.AddInterfaceAddress(&iface, a) if err != nil { log.Errorf("Error adding address to data interface: %v", err) } @@ -366,6 +370,7 @@ func (v *VppRunner) allocateStaticVRFs() error { // Configure specific VRFs for a given tap to the host to handle broadcast / multicast trafic sent by the host func (v *VppRunner) setupTapVRF(ifSpec *config.InterfaceSpec, ifState *config.LinuxInterfaceState, tapSwIfIndex uint32) (vrfs []uint32, err error) { + iface := types2.Interface{SwIfIndex: tapSwIfIndex} for _, ipFamily := range vpplink.IpFamilies { vrfId, err := v.vpp.AllocateVRF(ipFamily.IsIp6, fmt.Sprintf("host-tap-%s-%s", ifSpec.InterfaceName, ipFamily.Str)) if err != nil { @@ -397,7 +402,7 @@ func (v *VppRunner) setupTapVRF(ifSpec *config.InterfaceSpec, ifState *config.Li return []uint32{}, errors.Wrapf(err, "error adding VRF %d default route via VRF %d", vrfId, common.PodVRFIndex) } // Set tap in this table - err = v.vpp.SetInterfaceVRF(tapSwIfIndex, vrfId, ipFamily.IsIp6) + err = v.vpp.SetInterfaceVRF(&iface, vrfId, ipFamily.IsIp6) if err != nil { return []uint32{}, errors.Wrapf(err, "error setting vpp tap in vrf %d", vrfId) } @@ -412,7 +417,7 @@ func (v *VppRunner) setupTapVRF(ifSpec *config.InterfaceSpec, ifState *config.Li // note that the role of these addresses is just to tell vpp to accept ip4 / ip6 packets on the tap // we use these addresses as the safest option, because as they are configured on linux, linux // will never send us packets with these addresses as destination - err = v.vpp.AddInterfaceAddress(tapSwIfIndex, common.ToMaxLenCIDR(addr.IPNet.IP)) + err = v.vpp.AddInterfaceAddress(&iface, common.ToMaxLenCIDR(addr.IPNet.IP)) if err != nil { log.Errorf("Error adding address to tap interface: %v", err) } @@ -423,25 +428,26 @@ func (v *VppRunner) setupTapVRF(ifSpec *config.InterfaceSpec, ifState *config.Li func (v *VppRunner) configureVpp(ifState *config.LinuxInterfaceState, ifSpec config.InterfaceSpec) (err error) { // Always enable GSO feature on data interface, only a tiny negative effect on perf if GSO is not // enabled on the taps or already done before an encap + iface := types2.Interface{SwIfIndex: ifSpec.SwIfIndex} if v.params.EnableGSO { - err = v.vpp.EnableGSOFeature(ifSpec.SwIfIndex) + err = v.vpp.EnableGSOFeature(&iface) if err != nil { return errors.Wrap(err, "Error enabling GSO on data interface") } } uplinkMtu := config.GetUplinkMtu(v.params, ifState, false /* includeEncap */) - err = v.vpp.SetInterfaceMtu(ifSpec.SwIfIndex, uplinkMtu) + err = v.vpp.SetInterfaceMtu(&iface, uplinkMtu) if err != nil { return errors.Wrapf(err, "Error setting %d MTU on data interface", uplinkMtu) } - err = v.vpp.SetInterfaceRxMode(ifSpec.SwIfIndex, types.AllQueues, v.params.RxMode) + err = v.vpp.SetInterfaceRxMode(&iface, types2.AllQueues, v.params.RxMode) if err != nil { log.Warnf("%v", err) } - err = v.vpp.EnableInterfaceIP6(ifSpec.SwIfIndex) + err = v.vpp.EnableInterfaceIP6(&iface) if err != nil { return errors.Wrap(err, "Error enabling ip6 on if") } @@ -453,7 +459,7 @@ func (v *VppRunner) configureVpp(ifState *config.LinuxInterfaceState, ifSpec con for _, addr := range ifState.Addresses { log.Infof("Adding address %s to data interface", addr.String()) - err = v.vpp.AddInterfaceAddress(ifSpec.SwIfIndex, addr.IPNet) + err = v.vpp.AddInterfaceAddress(&iface, addr.IPNet) if err != nil { log.Errorf("Error adding address to data interface: %v", err) } @@ -493,13 +499,13 @@ func (v *VppRunner) configureVpp(ifState *config.LinuxInterfaceState, ifSpec con } log.Infof("Creating Linux side interface") - vpptap0Flags := types.TapFlagNone + vpptap0Flags := types2.TapFlagNone if v.params.EnableGSO { - vpptap0Flags = vpptap0Flags | types.TapFlagGSO | types.TapGROCoalesce + vpptap0Flags = vpptap0Flags | types2.TapFlagGSO | types2.TapGROCoalesce } - tapSwIfIndex, err := v.vpp.CreateTapV2(&types.TapV2{ - GenericVppInterface: types.GenericVppInterface{ + tapSwIfIndex, err := v.vpp.CreateTapV2(&types2.TapInterface{ + Interface: types2.Interface{ HostInterfaceName: ifSpec.InterfaceName, RxQueueSize: v.params.TapRxQueueSize, TxQueueSize: v.params.TapTxQueueSize, @@ -515,23 +521,25 @@ func (v *VppRunner) configureVpp(ifState *config.LinuxInterfaceState, ifSpec con return errors.Wrap(err, "Error creating tap") } - vrfs, err := v.setupTapVRF(&ifSpec, ifState, tapSwIfIndex) + tapIface := types2.Interface{SwIfIndex: tapSwIfIndex} + + vrfs, err := v.setupTapVRF(&ifSpec, ifState, tapIface.SwIfIndex) if err != nil { return errors.Wrap(err, "error configuring VRF for tap") } // Always set this tap on worker 0 - err = v.vpp.SetInterfaceRxPlacement(tapSwIfIndex, 0 /*queue*/, 0 /*worker*/, false /*main*/) + err = v.vpp.SetInterfaceRxPlacement(&tapIface, 0 /*queue*/, 0 /*worker*/, false /*main*/) if err != nil { return errors.Wrap(err, "Error setting tap rx placement") } - err = v.vpp.SetInterfaceMtu(uint32(tapSwIfIndex), vpplink.MAX_MTU) + err = v.vpp.SetInterfaceMtu(&tapIface, types2.MaxMtu) if err != nil { - return errors.Wrapf(err, "Error setting %d MTU on tap interface", vpplink.MAX_MTU) + return errors.Wrapf(err, "Error setting %d MTU on tap interface", types2.MaxMtu) } - err = utils.WriteFile(strconv.FormatInt(int64(tapSwIfIndex), 10), config.VppManagerTapIdxFile) + err = utils.WriteFile(strconv.FormatInt(int64(tapIface.SwIfIndex), 10), config.VppManagerTapIdxFile) if err != nil { return errors.Wrap(err, "Error writing linux mtu") } @@ -542,18 +550,18 @@ func (v *VppRunner) configureVpp(ifState *config.LinuxInterfaceState, ifSpec con } if ifState.Hasv6 { - err = v.vpp.DisableIP6RouterAdvertisements(tapSwIfIndex) + err = v.vpp.DisableIP6RouterAdvertisements(tapIface.SwIfIndex) if err != nil { return errors.Wrap(err, "Error disabling ip6 RA on vpptap0") } } - err = v.configurePunt(tapSwIfIndex, *ifState) + err = v.configurePunt(tapIface.SwIfIndex, *ifState) if err != nil { return errors.Wrap(err, "Error adding redirect to tap") } - err = v.vpp.EnableArpProxy(tapSwIfIndex, vrfs[0 /* ip4 */]) + err = v.vpp.EnableArpProxy(tapIface.SwIfIndex, vrfs[0 /* ip4 */]) if err != nil { return errors.Wrap(err, "Error enabling ARP proxy") } @@ -561,7 +569,7 @@ func (v *VppRunner) configureVpp(ifState *config.LinuxInterfaceState, ifSpec con for _, addr := range ifState.Addresses { if addr.IPNet.IP.To4() == nil { log.Infof("Adding ND proxy for address %s", addr.IPNet.IP) - err = v.vpp.EnableIP6NdProxy(tapSwIfIndex, addr.IPNet.IP) + err = v.vpp.EnableIP6NdProxy(tapIface.SwIfIndex, addr.IPNet.IP) if err != nil { log.Errorf("Error configuring nd proxy for address %s: %v", addr.IPNet.IP.String(), err) } @@ -569,23 +577,23 @@ func (v *VppRunner) configureVpp(ifState *config.LinuxInterfaceState, ifSpec con } if v.params.EnableGSO { - err = v.vpp.EnableGSOFeature(tapSwIfIndex) + err = v.vpp.EnableGSOFeature(&tapIface) if err != nil { return errors.Wrap(err, "Error enabling GSO on vpptap0") } } - err = v.vpp.SetInterfaceRxMode(tapSwIfIndex, types.AllQueues, v.params.TapRxMode) + err = v.vpp.SetInterfaceRxMode(&tapIface, types2.AllQueues, v.params.TapRxMode) if err != nil { log.Errorf("Error SetInterfaceRxMode on vpptap0 %v", err) } - err = v.vpp.CnatEnableFeatures(tapSwIfIndex) + err = v.vpp.CnatEnableFeatures(tapIface.SwIfIndex) if err != nil { return errors.Wrap(err, "Error configuring NAT on vpptap0") } - err = v.vpp.RegisterPodInterface(tapSwIfIndex) + err = v.vpp.RegisterPodInterface(tapIface.SwIfIndex) if err != nil { return errors.Wrap(err, "error configuring vpptap0 as pod intf") } @@ -606,7 +614,7 @@ func (v *VppRunner) configureVpp(ifState *config.LinuxInterfaceState, ifSpec con return errors.Wrap(err, "Error configuring tap on linux side") } - err = v.vpp.InterfaceAdminUp(tapSwIfIndex) + err = v.vpp.InterfaceAdminUp(&tapIface) if err != nil { return errors.Wrap(err, "Error setting tap up") } diff --git a/vpplink/af_packet.go b/vpplink/af_packet.go index 0d4f2c17..9b608ac7 100644 --- a/vpplink/af_packet.go +++ b/vpplink/af_packet.go @@ -17,6 +17,7 @@ package vpplink import ( "fmt" + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi" "github.com/pkg/errors" "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/af_packet" @@ -40,9 +41,9 @@ func (v *VppLink) CreateAfPacket(intf *types.AfPacketInterface) (swIfIndex uint3 } err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { - return INVALID_SW_IF_INDEX, errors.Wrapf(err, "AfPacketCreate failed: req %+v reply %+v", request, response) + return vppapi.InvalidSwIfIndex, errors.Wrapf(err, "AfPacketCreate failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { - return INVALID_SW_IF_INDEX, fmt.Errorf("AfPacketCreate failed: req %+v reply %+v", request, response) + return vppapi.InvalidSwIfIndex, fmt.Errorf("AfPacketCreate failed: req %+v reply %+v", request, response) } intf.SwIfIndex = uint32(response.SwIfIndex) return uint32(response.SwIfIndex), nil diff --git a/vpplink/avf.go b/vpplink/avf.go index c1a1903b..b46a358a 100644 --- a/vpplink/avf.go +++ b/vpplink/avf.go @@ -17,6 +17,7 @@ package vpplink import ( "fmt" + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi" "time" "github.com/pkg/errors" @@ -34,7 +35,7 @@ func (v *VppLink) CreateAVF(intf *types.AVFInterface) (swIfIndex uint32, err err defer v.Unlock() addr, err := types.GetPciIdInt(intf.PciId) if err != nil { - return INVALID_SW_IF_INDEX, errors.Wrapf(err, "CreateAVF error parsing PCI id") + return vppapi.InvalidSwIfIndex, errors.Wrapf(err, "CreateAVF error parsing PCI id") } response := &avf.AvfCreateReply{} request := &avf.AvfCreate{ @@ -47,9 +48,9 @@ func (v *VppLink) CreateAVF(intf *types.AVFInterface) (swIfIndex uint32, err err v.GetChannel().SetReplyTimeout(AvfReplyTimeout) err = v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { - return INVALID_SW_IF_INDEX, errors.Wrapf(err, "CreateAVF failed: req %+v reply %+v", request, response) + return vppapi.InvalidSwIfIndex, errors.Wrapf(err, "CreateAVF failed: req %+v reply %+v", request, response) } else if response.Retval != 0 { - return INVALID_SW_IF_INDEX, fmt.Errorf("CreateAVF failed: req %+v reply %+v", request, response) + return vppapi.InvalidSwIfIndex, fmt.Errorf("CreateAVF failed: req %+v reply %+v", request, response) } return uint32(response.SwIfIndex), nil } diff --git a/vpplink/binapi/vppapi/abf/abf.ba.go b/vpplink/binapi/vppapi/abf/abf.ba.go index d8e42607..ff611eb7 100644 --- a/vpplink/binapi/vppapi/abf/abf.ba.go +++ b/vpplink/binapi/vppapi/abf/abf.ba.go @@ -107,7 +107,7 @@ func (*AbfItfAttachAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *AbfItfAttachAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *AbfItfAttachAddDelReply) Size() (size int) { @@ -413,7 +413,7 @@ func (*AbfPolicyAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *AbfPolicyAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *AbfPolicyAddDelReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/acl/acl.ba.go b/vpplink/binapi/vppapi/acl/acl.ba.go index 189c143b..8d886cf1 100644 --- a/vpplink/binapi/vppapi/acl/acl.ba.go +++ b/vpplink/binapi/vppapi/acl/acl.ba.go @@ -144,7 +144,7 @@ func (*ACLAddReplaceReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *ACLAddReplaceReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *ACLAddReplaceReply) Size() (size int) { @@ -219,7 +219,7 @@ func (*ACLDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *ACLDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *ACLDelReply) Size() (size int) { @@ -442,7 +442,7 @@ func (*ACLInterfaceAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *ACLInterfaceAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *ACLInterfaceAddDelReply) Size() (size int) { @@ -727,7 +727,7 @@ func (*ACLInterfaceSetACLListReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *ACLInterfaceSetACLListReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *ACLInterfaceSetACLListReply) Size() (size int) { @@ -824,7 +824,7 @@ func (*ACLInterfaceSetEtypeWhitelistReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *ACLInterfaceSetEtypeWhitelistReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *ACLInterfaceSetEtypeWhitelistReply) Size() (size int) { @@ -892,7 +892,7 @@ func (*ACLPluginControlPingReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *ACLPluginControlPingReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *ACLPluginControlPingReply) Size() (size int) { @@ -1184,7 +1184,7 @@ func (*ACLPluginUseHashLookupSetReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *ACLPluginUseHashLookupSetReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *ACLPluginUseHashLookupSetReply) Size() (size int) { @@ -1258,7 +1258,7 @@ func (*ACLStatsIntfCountersEnableReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *ACLStatsIntfCountersEnableReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *ACLStatsIntfCountersEnableReply) Size() (size int) { @@ -1449,7 +1449,7 @@ func (*MacipACLAddReplaceReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *MacipACLAddReplaceReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *MacipACLAddReplaceReply) Size() (size int) { @@ -1489,7 +1489,7 @@ func (*MacipACLAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *MacipACLAddReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *MacipACLAddReply) Size() (size int) { @@ -1564,7 +1564,7 @@ func (*MacipACLDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *MacipACLDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *MacipACLDelReply) Size() (size int) { @@ -1761,7 +1761,7 @@ func (*MacipACLInterfaceAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *MacipACLInterfaceAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *MacipACLInterfaceAddDelReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/acl_types/acl_types.ba.go b/vpplink/binapi/vppapi/acl_types/acl_types.ba.go index 7c788725..dc78aaca 100644 --- a/vpplink/binapi/vppapi/acl_types/acl_types.ba.go +++ b/vpplink/binapi/vppapi/acl_types/acl_types.ba.go @@ -22,6 +22,12 @@ import ( // GoVPP api package needs to be updated. const _ = api.GoVppAPIPackageIsVersion2 +const ( + APIFile = "acl_types" + APIVersion = "1.0.0" + VersionCrc = 0x878da4fa +) + // ACLAction defines enum 'acl_action'. type ACLAction uint8 diff --git a/vpplink/binapi/vppapi/af_packet/af_packet.ba.go b/vpplink/binapi/vppapi/af_packet/af_packet.ba.go index 013c8825..9b43feda 100644 --- a/vpplink/binapi/vppapi/af_packet/af_packet.ba.go +++ b/vpplink/binapi/vppapi/af_packet/af_packet.ba.go @@ -83,7 +83,7 @@ func (*AfPacketCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *AfPacketCreateReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *AfPacketCreateReply) Size() (size int) { @@ -191,7 +191,7 @@ func (*AfPacketCreateV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *AfPacketCreateV2Reply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *AfPacketCreateV2Reply) Size() (size int) { @@ -266,7 +266,7 @@ func (*AfPacketDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *AfPacketDeleteReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *AfPacketDeleteReply) Size() (size int) { @@ -414,7 +414,7 @@ func (*AfPacketSetL4CksumOffloadReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *AfPacketSetL4CksumOffloadReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *AfPacketSetL4CksumOffloadReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/af_xdp/af_xdp.ba.go b/vpplink/binapi/vppapi/af_xdp/af_xdp.ba.go index d394cae3..a8594773 100644 --- a/vpplink/binapi/vppapi/af_xdp/af_xdp.ba.go +++ b/vpplink/binapi/vppapi/af_xdp/af_xdp.ba.go @@ -178,7 +178,7 @@ func (*AfXdpCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *AfXdpCreateReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *AfXdpCreateReply) Size() (size int) { @@ -286,7 +286,7 @@ func (*AfXdpCreateV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *AfXdpCreateV2Reply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *AfXdpCreateV2Reply) Size() (size int) { @@ -361,7 +361,7 @@ func (*AfXdpDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *AfXdpDeleteReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *AfXdpDeleteReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/arp/arp.ba.go b/vpplink/binapi/vppapi/arp/arp.ba.go index 4054b81e..0a0ed6d7 100644 --- a/vpplink/binapi/vppapi/arp/arp.ba.go +++ b/vpplink/binapi/vppapi/arp/arp.ba.go @@ -93,7 +93,7 @@ func (*ProxyArpAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *ProxyArpAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *ProxyArpAddDelReply) Size() (size int) { @@ -309,7 +309,7 @@ func (*ProxyArpIntfcEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *ProxyArpIntfcEnableDisableReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *ProxyArpIntfcEnableDisableReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/avf/avf.ba.go b/vpplink/binapi/vppapi/avf/avf.ba.go index 6cd79cf3..2f5fe21e 100644 --- a/vpplink/binapi/vppapi/avf/avf.ba.go +++ b/vpplink/binapi/vppapi/avf/avf.ba.go @@ -90,7 +90,7 @@ func (*AvfCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *AvfCreateReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *AvfCreateReply) Size() (size int) { @@ -165,7 +165,7 @@ func (*AvfDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *AvfDeleteReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *AvfDeleteReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/capo/capo.ba.go b/vpplink/binapi/vppapi/capo/capo.ba.go index d64dea9e..f763f4e1 100644 --- a/vpplink/binapi/vppapi/capo/capo.ba.go +++ b/vpplink/binapi/vppapi/capo/capo.ba.go @@ -408,7 +408,7 @@ func (*CapoConfigurePoliciesReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CapoConfigurePoliciesReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CapoConfigurePoliciesReply) Size() (size int) { @@ -478,7 +478,7 @@ func (*CapoControlPingReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CapoControlPingReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CapoControlPingReply) Size() (size int) { @@ -660,7 +660,7 @@ func (*CapoIpsetAddDelMembersReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CapoIpsetAddDelMembersReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CapoIpsetAddDelMembersReply) Size() (size int) { @@ -735,7 +735,7 @@ func (*CapoIpsetCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CapoIpsetCreateReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CapoIpsetCreateReply) Size() (size int) { @@ -812,7 +812,7 @@ func (*CapoIpsetDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CapoIpsetDeleteReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CapoIpsetDeleteReply) Size() (size int) { @@ -910,7 +910,7 @@ func (*CapoPolicyCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CapoPolicyCreateReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CapoPolicyCreateReply) Size() (size int) { @@ -987,7 +987,7 @@ func (*CapoPolicyDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CapoPolicyDeleteReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CapoPolicyDeleteReply) Size() (size int) { @@ -1088,7 +1088,7 @@ func (*CapoPolicyUpdateReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CapoPolicyUpdateReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CapoPolicyUpdateReply) Size() (size int) { @@ -1212,7 +1212,7 @@ func (*CapoRuleCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CapoRuleCreateReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CapoRuleCreateReply) Size() (size int) { @@ -1289,7 +1289,7 @@ func (*CapoRuleDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CapoRuleDeleteReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CapoRuleDeleteReply) Size() (size int) { @@ -1416,7 +1416,7 @@ func (*CapoRuleUpdateReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CapoRuleUpdateReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CapoRuleUpdateReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/cnat/cnat.ba.go b/vpplink/binapi/vppapi/cnat/cnat.ba.go index a883bbb9..3ed0fe0d 100644 --- a/vpplink/binapi/vppapi/cnat/cnat.ba.go +++ b/vpplink/binapi/vppapi/cnat/cnat.ba.go @@ -289,7 +289,7 @@ func (*CnatGetSnatAddressesReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CnatGetSnatAddressesReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CnatGetSnatAddressesReply) Size() (size int) { @@ -488,7 +488,7 @@ func (*CnatSessionPurgeReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CnatSessionPurgeReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CnatSessionPurgeReply) Size() (size int) { @@ -570,7 +570,7 @@ func (*CnatSetSnatAddressesReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CnatSetSnatAddressesReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CnatSetSnatAddressesReply) Size() (size int) { @@ -644,7 +644,7 @@ func (*CnatSetSnatPolicyReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CnatSetSnatPolicyReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CnatSetSnatPolicyReply) Size() (size int) { @@ -732,7 +732,7 @@ func (*CnatSnatPolicyAddDelExcludePfxReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CnatSnatPolicyAddDelExcludePfxReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CnatSnatPolicyAddDelExcludePfxReply) Size() (size int) { @@ -816,7 +816,7 @@ func (*CnatSnatPolicyAddDelIfReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CnatSnatPolicyAddDelIfReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CnatSnatPolicyAddDelIfReply) Size() (size int) { @@ -890,7 +890,7 @@ func (*CnatTranslationDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CnatTranslationDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CnatTranslationDelReply) Size() (size int) { @@ -1191,7 +1191,7 @@ func (*CnatTranslationUpdateReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CnatTranslationUpdateReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CnatTranslationUpdateReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/crypto_sw_scheduler/crypto_sw_scheduler.ba.go b/vpplink/binapi/vppapi/crypto_sw_scheduler/crypto_sw_scheduler.ba.go index 0fca0c7b..dc2eed8a 100644 --- a/vpplink/binapi/vppapi/crypto_sw_scheduler/crypto_sw_scheduler.ba.go +++ b/vpplink/binapi/vppapi/crypto_sw_scheduler/crypto_sw_scheduler.ba.go @@ -80,7 +80,7 @@ func (*CryptoSwSchedulerSetWorkerReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CryptoSwSchedulerSetWorkerReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CryptoSwSchedulerSetWorkerReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/ethernet_types/ethernet_types.ba.go b/vpplink/binapi/vppapi/ethernet_types/ethernet_types.ba.go index e31ef8d3..29d6e090 100644 --- a/vpplink/binapi/vppapi/ethernet_types/ethernet_types.ba.go +++ b/vpplink/binapi/vppapi/ethernet_types/ethernet_types.ba.go @@ -19,6 +19,12 @@ import ( // GoVPP api package needs to be updated. const _ = api.GoVppAPIPackageIsVersion2 +const ( + APIFile = "ethernet_types" + APIVersion = "1.0.0" + VersionCrc = 0xf24103d6 +) + // MacAddress defines alias 'mac_address'. type MacAddress [6]uint8 diff --git a/vpplink/binapi/vppapi/feature/feature.ba.go b/vpplink/binapi/vppapi/feature/feature.ba.go index 5e576266..99323369 100644 --- a/vpplink/binapi/vppapi/feature/feature.ba.go +++ b/vpplink/binapi/vppapi/feature/feature.ba.go @@ -85,7 +85,7 @@ func (*FeatureEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *FeatureEnableDisableReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *FeatureEnableDisableReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/fib_types/fib_types.ba.go b/vpplink/binapi/vppapi/fib_types/fib_types.ba.go index 1a796a5a..3eca5d83 100644 --- a/vpplink/binapi/vppapi/fib_types/fib_types.ba.go +++ b/vpplink/binapi/vppapi/fib_types/fib_types.ba.go @@ -21,6 +21,12 @@ import ( // GoVPP api package needs to be updated. const _ = api.GoVppAPIPackageIsVersion2 +const ( + APIFile = "fib_types" + APIVersion = "2.0.1" + VersionCrc = 0x21fd785b +) + // FibPathFlags defines enum 'fib_path_flags'. type FibPathFlags uint32 diff --git a/vpplink/binapi/vppapi/generate.log b/vpplink/binapi/vppapi/generate.log index 7f69f84b..f5ca53c1 100644 --- a/vpplink/binapi/vppapi/generate.log +++ b/vpplink/binapi/vppapi/generate.log @@ -1,4 +1,4 @@ -VPP Version : 22.06-rc0~149-g70a9a1d9f +VPP Version : 22.06-rc0~148-g7f6735793 Binapi-generator version : govpp v0.5.0-dev VPP Base commit : 45207e0fb wireguard: fix dereferences null pointer ------------------ Cherry picked commits -------------------- diff --git a/vpplink/binapi/vppapi/gso/gso.ba.go b/vpplink/binapi/vppapi/gso/gso.ba.go index 45abbd67..628fe4a0 100644 --- a/vpplink/binapi/vppapi/gso/gso.ba.go +++ b/vpplink/binapi/vppapi/gso/gso.ba.go @@ -79,7 +79,7 @@ func (*FeatureGsoEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *FeatureGsoEnableDisableReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *FeatureGsoEnableDisableReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/ikev2/ikev2.ba.go b/vpplink/binapi/vppapi/ikev2/ikev2.ba.go index 173178e8..8860897a 100644 --- a/vpplink/binapi/vppapi/ikev2/ikev2.ba.go +++ b/vpplink/binapi/vppapi/ikev2/ikev2.ba.go @@ -41,7 +41,7 @@ func (*Ikev2ChildSaDetails) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ikev2ChildSaDetails) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ikev2ChildSaDetails) Size() (size int) { @@ -269,7 +269,7 @@ func (*Ikev2InitiateDelChildSaReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ikev2InitiateDelChildSaReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ikev2InitiateDelChildSaReply) Size() (size int) { @@ -343,7 +343,7 @@ func (*Ikev2InitiateDelIkeSaReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ikev2InitiateDelIkeSaReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ikev2InitiateDelIkeSaReply) Size() (size int) { @@ -419,7 +419,7 @@ func (*Ikev2InitiateRekeyChildSaReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ikev2InitiateRekeyChildSaReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ikev2InitiateRekeyChildSaReply) Size() (size int) { @@ -493,7 +493,7 @@ func (*Ikev2InitiateSaInitReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ikev2InitiateSaInitReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ikev2InitiateSaInitReply) Size() (size int) { @@ -573,7 +573,7 @@ func (*Ikev2NonceGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ikev2NonceGetReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ikev2NonceGetReply) Size() (size int) { @@ -728,7 +728,7 @@ func (*Ikev2ProfileAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ikev2ProfileAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ikev2ProfileAddDelReply) Size() (size int) { @@ -986,7 +986,7 @@ func (*Ikev2ProfileDisableNattReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ikev2ProfileDisableNattReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ikev2ProfileDisableNattReply) Size() (size int) { @@ -1108,7 +1108,7 @@ func (*Ikev2ProfileSetAuthReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ikev2ProfileSetAuthReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ikev2ProfileSetAuthReply) Size() (size int) { @@ -1199,7 +1199,7 @@ func (*Ikev2ProfileSetIDReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ikev2ProfileSetIDReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ikev2ProfileSetIDReply) Size() (size int) { @@ -1285,7 +1285,7 @@ func (*Ikev2ProfileSetIpsecUDPPortReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ikev2ProfileSetIpsecUDPPortReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ikev2ProfileSetIpsecUDPPortReply) Size() (size int) { @@ -1365,7 +1365,7 @@ func (*Ikev2ProfileSetLivenessReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ikev2ProfileSetLivenessReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ikev2ProfileSetLivenessReply) Size() (size int) { @@ -1470,7 +1470,7 @@ func (*Ikev2ProfileSetTsReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ikev2ProfileSetTsReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ikev2ProfileSetTsReply) Size() (size int) { @@ -1546,7 +1546,7 @@ func (*Ikev2ProfileSetUDPEncapReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ikev2ProfileSetUDPEncapReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ikev2ProfileSetUDPEncapReply) Size() (size int) { @@ -1584,7 +1584,7 @@ func (*Ikev2SaDetails) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ikev2SaDetails) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ikev2SaDetails) Size() (size int) { @@ -1880,7 +1880,7 @@ func (*Ikev2SetEspTransformsReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ikev2SetEspTransformsReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ikev2SetEspTransformsReply) Size() (size int) { @@ -1967,7 +1967,7 @@ func (*Ikev2SetIkeTransformsReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ikev2SetIkeTransformsReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ikev2SetIkeTransformsReply) Size() (size int) { @@ -2041,7 +2041,7 @@ func (*Ikev2SetLocalKeyReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ikev2SetLocalKeyReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ikev2SetLocalKeyReply) Size() (size int) { @@ -2172,7 +2172,7 @@ func (*Ikev2SetResponderHostnameReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ikev2SetResponderHostnameReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ikev2SetResponderHostnameReply) Size() (size int) { @@ -2209,7 +2209,7 @@ func (*Ikev2SetResponderReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ikev2SetResponderReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ikev2SetResponderReply) Size() (size int) { @@ -2299,7 +2299,7 @@ func (*Ikev2SetSaLifetimeReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ikev2SetSaLifetimeReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ikev2SetSaLifetimeReply) Size() (size int) { @@ -2379,7 +2379,7 @@ func (*Ikev2SetTunnelInterfaceReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ikev2SetTunnelInterfaceReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ikev2SetTunnelInterfaceReply) Size() (size int) { @@ -2417,7 +2417,7 @@ func (*Ikev2TrafficSelectorDetails) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ikev2TrafficSelectorDetails) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ikev2TrafficSelectorDetails) Size() (size int) { diff --git a/vpplink/binapi/vppapi/ikev2_types/ikev2_types.ba.go b/vpplink/binapi/vppapi/ikev2_types/ikev2_types.ba.go index d959d8e9..ee165be6 100644 --- a/vpplink/binapi/vppapi/ikev2_types/ikev2_types.ba.go +++ b/vpplink/binapi/vppapi/ikev2_types/ikev2_types.ba.go @@ -19,6 +19,12 @@ import ( // GoVPP api package needs to be updated. const _ = api.GoVppAPIPackageIsVersion2 +const ( + APIFile = "ikev2_types" + APIVersion = "1.0.0" + VersionCrc = 0xe7510e +) + // Ikev2Auth defines type 'ikev2_auth'. type Ikev2Auth struct { Method uint8 `binapi:"u8,name=method" json:"method,omitempty"` diff --git a/vpplink/binapi/vppapi/interface/interface.ba.go b/vpplink/binapi/vppapi/interface/interface.ba.go index dd801ac5..abbf2328 100644 --- a/vpplink/binapi/vppapi/interface/interface.ba.go +++ b/vpplink/binapi/vppapi/interface/interface.ba.go @@ -83,7 +83,7 @@ func (*CollectDetailedInterfaceStatsReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CollectDetailedInterfaceStatsReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CollectDetailedInterfaceStatsReply) Size() (size int) { @@ -200,7 +200,7 @@ func (*CreateLoopbackInstanceReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CreateLoopbackInstanceReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CreateLoopbackInstanceReply) Size() (size int) { @@ -240,7 +240,7 @@ func (*CreateLoopbackReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CreateLoopbackReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CreateLoopbackReply) Size() (size int) { @@ -332,7 +332,7 @@ func (*CreateSubifReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CreateSubifReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CreateSubifReply) Size() (size int) { @@ -412,7 +412,7 @@ func (*CreateVlanSubifReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CreateVlanSubifReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CreateVlanSubifReply) Size() (size int) { @@ -487,7 +487,7 @@ func (*DeleteLoopbackReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *DeleteLoopbackReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *DeleteLoopbackReply) Size() (size int) { @@ -559,7 +559,7 @@ func (*DeleteSubifReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *DeleteSubifReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *DeleteSubifReply) Size() (size int) { @@ -634,7 +634,7 @@ func (*GetBuffersStatsReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *GetBuffersStatsReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *GetBuffersStatsReply) Size() (size int) { @@ -719,7 +719,7 @@ func (*HwInterfaceSetMtuReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *HwInterfaceSetMtuReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *HwInterfaceSetMtuReply) Size() (size int) { @@ -795,7 +795,7 @@ func (*InterfaceNameRenumberReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *InterfaceNameRenumberReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *InterfaceNameRenumberReply) Size() (size int) { @@ -887,7 +887,7 @@ func (*SwInterfaceAddDelAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SwInterfaceAddDelAddressReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceAddDelAddressReply) Size() (size int) { @@ -971,7 +971,7 @@ func (*SwInterfaceAddDelMacAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SwInterfaceAddDelMacAddressReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceAddDelMacAddressReply) Size() (size int) { @@ -1041,7 +1041,7 @@ func (*SwInterfaceAddressReplaceBeginReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SwInterfaceAddressReplaceBeginReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceAddressReplaceBeginReply) Size() (size int) { @@ -1111,7 +1111,7 @@ func (*SwInterfaceAddressReplaceEndReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SwInterfaceAddressReplaceEndReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceAddressReplaceEndReply) Size() (size int) { @@ -1183,7 +1183,7 @@ func (*SwInterfaceClearStatsReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SwInterfaceClearStatsReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceClearStatsReply) Size() (size int) { @@ -1495,7 +1495,7 @@ func (*SwInterfaceGetMacAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SwInterfaceGetMacAddressReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceGetMacAddressReply) Size() (size int) { @@ -1575,7 +1575,7 @@ func (*SwInterfaceGetTableReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SwInterfaceGetTableReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceGetTableReply) Size() (size int) { @@ -1740,7 +1740,7 @@ func (*SwInterfaceSetFlagsReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SwInterfaceSetFlagsReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceSetFlagsReply) Size() (size int) { @@ -1818,7 +1818,7 @@ func (*SwInterfaceSetInterfaceNameReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SwInterfaceSetInterfaceNameReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceSetInterfaceNameReply) Size() (size int) { @@ -1900,7 +1900,7 @@ func (*SwInterfaceSetIPDirectedBroadcastReply) GetMessageType() api.MessageType return api.ReplyMessage } func (m *SwInterfaceSetIPDirectedBroadcastReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceSetIPDirectedBroadcastReply) Size() (size int) { @@ -1978,7 +1978,7 @@ func (*SwInterfaceSetMacAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SwInterfaceSetMacAddressReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceSetMacAddressReply) Size() (size int) { @@ -2063,7 +2063,7 @@ func (*SwInterfaceSetMtuReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SwInterfaceSetMtuReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceSetMtuReply) Size() (size int) { @@ -2139,7 +2139,7 @@ func (*SwInterfaceSetPromiscReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SwInterfaceSetPromiscReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceSetPromiscReply) Size() (size int) { @@ -2223,7 +2223,7 @@ func (*SwInterfaceSetRxModeReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SwInterfaceSetRxModeReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceSetRxModeReply) Size() (size int) { @@ -2309,7 +2309,7 @@ func (*SwInterfaceSetRxPlacementReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SwInterfaceSetRxPlacementReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceSetRxPlacementReply) Size() (size int) { @@ -2389,7 +2389,7 @@ func (*SwInterfaceSetTableReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SwInterfaceSetTableReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceSetTableReply) Size() (size int) { @@ -2484,7 +2484,7 @@ func (*SwInterfaceSetTxPlacementReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SwInterfaceSetTxPlacementReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceSetTxPlacementReply) Size() (size int) { @@ -2566,7 +2566,7 @@ func (*SwInterfaceSetUnnumberedReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SwInterfaceSetUnnumberedReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceSetUnnumberedReply) Size() (size int) { @@ -2646,7 +2646,7 @@ func (*SwInterfaceTagAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SwInterfaceTagAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceTagAddDelReply) Size() (size int) { @@ -2788,7 +2788,7 @@ func (*SwInterfaceTxPlacementGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SwInterfaceTxPlacementGetReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceTxPlacementGetReply) Size() (size int) { @@ -2867,7 +2867,7 @@ func (*WantInterfaceEventsReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *WantInterfaceEventsReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *WantInterfaceEventsReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/interface_types/interface_types.ba.go b/vpplink/binapi/vppapi/interface_types/interface_types.ba.go index a908f4d3..63f19a3c 100644 --- a/vpplink/binapi/vppapi/interface_types/interface_types.ba.go +++ b/vpplink/binapi/vppapi/interface_types/interface_types.ba.go @@ -20,6 +20,12 @@ import ( // GoVPP api package needs to be updated. const _ = api.GoVppAPIPackageIsVersion2 +const ( + APIFile = "interface_types" + APIVersion = "1.0.0" + VersionCrc = 0x7f2ba79a +) + // Direction defines enum 'direction'. type Direction uint8 diff --git a/vpplink/interfaces.go b/vpplink/binapi/vppapi/interfaces.go similarity index 59% rename from vpplink/interfaces.go rename to vpplink/binapi/vppapi/interfaces.go index d0207426..4011a509 100644 --- a/vpplink/interfaces.go +++ b/vpplink/binapi/vppapi/interfaces.go @@ -13,130 +13,78 @@ // See the License for the specific language governing permissions and // limitations under the License. -package vpplink +package vppapi import ( - "bytes" - "fmt" + "bytes" + "fmt" + "github.com/pkg/errors" "net" "strings" - "github.com/pkg/errors" + types2 "git.fd.io/govpp.git/api/v0" - "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/gso" interfaces "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/interface" - "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/interface_types" vppip "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/ip" + + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/gso" + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/interface_types" "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/ip_neighbor" "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/ip_types" "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/tapv2" - "github.com/projectcalico/vpp-dataplane/vpplink/types" -) - -const ( - INVALID_SW_IF_INDEX = ^uint32(0) - MAX_MTU = 9216 - DEFAULT_QUEUE_SIZE = 1024 ) -type NamespaceNotFound error - -func (v *VppLink) SetInterfaceMtu(swIfIndex uint32, mtu int) error { - v.Lock() - defer v.Unlock() - mtus := make([]uint32, 4) - mtus[interface_types.MTU_PROTO_API_L3] = uint32(mtu) - response := &interfaces.SwInterfaceSetMtuReply{} - request := &interfaces.SwInterfaceSetMtu{ - SwIfIndex: interface_types.InterfaceIndex(swIfIndex), - Mtu: mtus, - } - err := v.GetChannel().SendRequest(request).ReceiveReply(response) - if err != nil { - return errors.Wrapf(err, "SwInterfaceSetMtu failed: req %+v reply %+v", request, response) - } else if response.Retval != 0 { - return fmt.Errorf("SwInterfaceSetMtu failed (retval %d). Request: %+v", response.Retval, request) - } - return nil -} - -func (v *VppLink) SetInterfaceRxMode(swIfIndex uint32, queueID uint32, mode types.RxMode) error { - v.Lock() - defer v.Unlock() - response := &interfaces.SwInterfaceSetRxModeReply{} - request := &interfaces.SwInterfaceSetRxMode{ - SwIfIndex: interface_types.InterfaceIndex(swIfIndex), - QueueIDValid: queueID != types.AllQueues, - QueueID: queueID, - Mode: interface_types.RxMode(mode), - } - err := v.GetChannel().SendRequest(request).ReceiveReply(response) - if err != nil { - return errors.Wrapf(err, "SetInterfaceRxMode failed: req %+v reply %+v", request, response) - } else if response.Retval != 0 { - return fmt.Errorf("SetInterfaceRxMode failed (retval %d). Request: %+v", response.Retval, request) +func defaultIntTo(value, defaultValue int) int { + if value == 0 { + return defaultValue + } else { + return value } - return nil } -func (v *VppLink) SetInterfaceMacAddress(swIfIndex uint32, mac *net.HardwareAddr) error { +func (v *Vpp) CreateLoopback(hwAddr *net.HardwareAddr) (swIfIndex uint32, err error) { v.Lock() defer v.Unlock() - response := &interfaces.SwInterfaceSetMacAddressReply{} - request := &interfaces.SwInterfaceSetMacAddress{ - SwIfIndex: interface_types.InterfaceIndex(swIfIndex), - MacAddress: types.ToVppMacAddress(mac), + request := &interfaces.CreateLoopback{ + MacAddress: ToVppMacAddress(hwAddr), } - err := v.GetChannel().SendRequest(request).ReceiveReply(response) - if err != nil { - return errors.Wrapf(err, "SwInterfaceSetMacAddress failed: req %+v reply %+v", request, response) - } else if response.Retval != 0 { - return fmt.Errorf("SwInterfaceSetMacAddress failed (retval %d). Request: %+v", response.Retval, request) + response := &interfaces.CreateLoopbackReply{} + err = v.GetChannel().SendRequest(request).ReceiveReply(response) + if err != nil || response.Retval != 0 { + return 0, errors.Wrapf(err, "Error adding loopback: req %+v reply %+v", request, response) } - return nil + return uint32(response.SwIfIndex), nil } -func (v *VppLink) SetInterfaceVRF(swIfIndex, vrfIndex uint32, isIP6 bool) error { +func (v *Vpp) DeleteLoopback(iface *types2.Interface) (err error) { v.Lock() defer v.Unlock() - response := &interfaces.SwInterfaceSetTableReply{} - request := &interfaces.SwInterfaceSetTable{ - SwIfIndex: interface_types.InterfaceIndex(swIfIndex), - IsIPv6: isIP6, - VrfID: vrfIndex, + request := &interfaces.DeleteLoopback{ + SwIfIndex: interface_types.InterfaceIndex(iface.SwIfIndex), } - err := v.GetChannel().SendRequest(request).ReceiveReply(response) - if err != nil { - return errors.Wrapf(err, "SwInterfaceSetTable failed: req %+v reply %+v", request, response) - } else if response.Retval != 0 { - return fmt.Errorf("SwInterfaceSetTable failed (retval %d). Request: %+v", response.Retval, request) + response := &interfaces.DeleteLoopbackReply{} + err = v.GetChannel().SendRequest(request).ReceiveReply(response) + if err != nil || response.Retval != 0 { + return errors.Wrapf(err, "Error deleting loopback: req %+v reply %+v", request, response) } return nil } -func DefaultIntTo(value, defaultValue int) int { - if value == 0 { - return defaultValue - } else { - return value - } -} - -func (v *VppLink) CreateTapV2(tap *types.TapV2) (swIfIndex uint32, err error) { +func (v *Vpp) CreateTapV2(tap *types2.TapInterface) (swIfIndex uint32, err error) { response := &tapv2.TapCreateV3Reply{} request := &tapv2.TapCreateV3{ ID: ^uint32(0), Tag: tap.Tag, TapFlags: tapv2.TapFlags(tap.Flags), - NumRxQueues: uint16(DefaultIntTo(tap.NumRxQueues, 1)), - NumTxQueues: uint16(DefaultIntTo(tap.NumTxQueues, 1)), - TxRingSz: uint16(DefaultIntTo(tap.TxQueueSize, DEFAULT_QUEUE_SIZE)), - RxRingSz: uint16(DefaultIntTo(tap.RxQueueSize, DEFAULT_QUEUE_SIZE)), + NumRxQueues: uint16(defaultIntTo(tap.NumRxQueues, 1)), + NumTxQueues: uint16(defaultIntTo(tap.NumTxQueues, 1)), + TxRingSz: uint16(defaultIntTo(tap.TxQueueSize, types2.DefaultQueueSize)), + RxRingSz: uint16(defaultIntTo(tap.RxQueueSize, types2.DefaultQueueSize)), HostMtuSize: uint32(tap.HostMtu), - HostMtuSet: bool(tap.HostMtu != 0), + HostMtuSet: tap.HostMtu != 0, } if tap.HardwareAddr != nil { - request.MacAddress = types.ToVppMacAddress(tap.HardwareAddr) + request.MacAddress = ToVppMacAddress(tap.HardwareAddr) } else { request.UseRandomMac = true } @@ -148,21 +96,21 @@ func (v *VppLink) CreateTapV2(tap *types.TapV2) (swIfIndex uint32, err error) { request.RxRingSz = uint16(tap.RxQueueSize) } if len(tap.HostNamespace) > 64 { - return INVALID_SW_IF_INDEX, fmt.Errorf("HostNamespace should be less than 64 characters") + return InvalidSwIfIndex, fmt.Errorf("HostNamespace should be less than 64 characters") } if tap.HostNamespace != "" { request.HostNamespaceSet = true request.HostNamespace = tap.HostNamespace } if len(tap.HostInterfaceName) > 64 { - return INVALID_SW_IF_INDEX, fmt.Errorf("HostInterfaceName should be less than 64 characters") + return InvalidSwIfIndex, fmt.Errorf("HostInterfaceName should be less than 64 characters") } if tap.HostInterfaceName != "" { request.HostIfName = tap.HostInterfaceName request.HostIfNameSet = true } if tap.HostMacAddress != nil { - request.HostMacAddr = types.ToVppMacAddress(&tap.HostMacAddress) + request.HostMacAddr = ToVppMacAddress(&tap.HostMacAddress) request.HostMacAddrSet = true } v.Lock() @@ -170,153 +118,83 @@ func (v *VppLink) CreateTapV2(tap *types.TapV2) (swIfIndex uint32, err error) { v.Unlock() if err != nil { - return INVALID_SW_IF_INDEX, errors.Wrap(err, "Tap creation request failed") + return InvalidSwIfIndex, errors.Wrap(err, "Tap creation request failed") } else if response.Retval == -12 { - return INVALID_SW_IF_INDEX, nil + return InvalidSwIfIndex, nil } else if response.Retval != 0 { - return INVALID_SW_IF_INDEX, fmt.Errorf("Tap creation failed (retval %d). Request: %+v", response.Retval, request) + return InvalidSwIfIndex, fmt.Errorf("tap creation failed (retval %d). Request: %+v", response.Retval, request) } return uint32(response.SwIfIndex), err } -func (v *VppLink) CreateOrAttachTapV2(tap *types.TapV2) (swIfIndex uint32, err error) { - tap.Flags |= types.TapFlagPersist | types.TapFlagAttach +func (v *Vpp) CreateOrAttachTapV2(tap *types2.TapInterface) (swIfIndex uint32, err error) { + tap.Flags |= types2.TapFlagPersist | types2.TapFlagAttach swIfIndex, err = v.CreateTapV2(tap) - if err == nil && swIfIndex == INVALID_SW_IF_INDEX { - tap.Flags &= ^types.TapFlagAttach + if err == nil && swIfIndex == InvalidSwIfIndex { + tap.Flags &= ^types2.TapFlagAttach return v.CreateTapV2(tap) } return swIfIndex, err } -func (v *VppLink) addDelInterfaceAddress(swIfIndex uint32, addr *net.IPNet, isAdd bool) error { - v.Lock() - defer v.Unlock() - if IsIP6(addr.IP) && addr.IP.IsLinkLocalUnicast() { - _, bits := addr.Mask.Size() - if bits != 128 { - return nil - } - } - request := &interfaces.SwInterfaceAddDelAddress{ - SwIfIndex: interface_types.InterfaceIndex(swIfIndex), - IsAdd: isAdd, - Prefix: types.ToVppAddressWithPrefix(addr), - } - response := &interfaces.SwInterfaceAddDelAddressReply{} - err := v.GetChannel().SendRequest(request).ReceiveReply(response) - if err != nil { - return errors.Wrapf(err, "Adding IP address failed: req %+v reply %+v", request, response) - } - return nil -} - -func (v *VppLink) DelInterfaceAddress(swIfIndex uint32, addr *net.IPNet) error { - return v.addDelInterfaceAddress(swIfIndex, addr, false) -} - -func (v *VppLink) AddInterfaceAddress(swIfIndex uint32, addr *net.IPNet) error { - return v.addDelInterfaceAddress(swIfIndex, addr, true) -} - -func (v *VppLink) setUnsetInterfaceTag(swIfIndex uint32, tag string, isAdd bool) error { +func (v *Vpp) DelTap(iface *types2.Interface) error { v.Lock() defer v.Unlock() - request := &interfaces.SwInterfaceTagAddDel{ - IsAdd: isAdd, - SwIfIndex: interface_types.InterfaceIndex(swIfIndex), - Tag: tag, + request := &tapv2.TapDeleteV2{ + SwIfIndex: interface_types.InterfaceIndex(iface.SwIfIndex), } - response := &interfaces.SwInterfaceTagAddDelReply{} + response := &tapv2.TapDeleteV2Reply{} err := v.GetChannel().SendRequest(request).ReceiveReply(response) - if err != nil || response.Retval != 0 { - return fmt.Errorf("cannot add interface tag: %v %d", err, response.Retval) + if err != nil { + return errors.Wrap(err, "failed to delete tap from VPP") } return nil } -func (v *VppLink) SetInterfaceTag(swIfIndex uint32, tag string) error { - return v.setUnsetInterfaceTag(swIfIndex, tag, true /* isAdd */) -} - -func (v *VppLink) UnsetInterfaceTag(swIfIndex uint32, tag string) error { - return v.setUnsetInterfaceTag(swIfIndex, tag, false /* isAdd */) -} - -func (v *VppLink) enableDisableInterfaceIP(swIfIndex uint32, isIP6 bool, isEnable bool) error { +func (v *Vpp) SearchInterfaceWithName(name string) (err error, swIfIndex uint32) { v.Lock() defer v.Unlock() - response := &vppip.SwInterfaceIP6EnableDisableReply{} - request := &vppip.SwInterfaceIP6EnableDisable{ - Enable: isEnable, - SwIfIndex: interface_types.InterfaceIndex(swIfIndex), - } - err := v.GetChannel().SendRequest(request).ReceiveReply(response) - if err != nil { - return errors.Wrapf(err, "SwInterfaceIP6EnableDisable failed: req %+v reply %+v", request, response) - } else if response.Retval != 0 { - return fmt.Errorf("SwInterfaceIP6EnableDisable failed (retval %d). Request: %+v", response.Retval, request) - } - return nil -} -func (v *VppLink) EnableInterfaceIP46(swIfIndex uint32) (err error) { - err = v.enableDisableInterfaceIP(swIfIndex, false /*isIP6*/, true /*isEnable*/) - if err != nil { - return err - } - err = v.enableDisableInterfaceIP(swIfIndex, true /*isIP6*/, true /*isEnable*/) - if err != nil { - return err + swIfIndex = InvalidSwIfIndex + request := &interfaces.SwInterfaceDump{ + SwIfIndex: interface_types.InterfaceIndex(InvalidSwIfIndex), + /* TODO: filter by name with NameFilter + NameFilter: name, + NameFilterValid: true, + */ } - return nil -} + reqCtx := v.GetChannel().SendMultiRequest(request) + for { + response := &interfaces.SwInterfaceDetails{} + stop, err := reqCtx.ReceiveReply(response) + if err != nil { + v.GetLog().Errorf("SwInterfaceDump failed: %v", err) + return err, InvalidSwIfIndex + } + if stop { + break + } + interfaceName := string(bytes.Trim([]byte(response.InterfaceName), "\x00")) + v.GetLog().Debugf("Found interface: %s", interfaceName) + if interfaceName == name { + swIfIndex = uint32(response.SwIfIndex) + } -func (v *VppLink) DisableInterfaceIP46(swIfIndex uint32) (err error) { - err = v.enableDisableInterfaceIP(swIfIndex, false /*isIP6*/, false /*isEnable*/) - if err != nil { - return err } - err = v.enableDisableInterfaceIP(swIfIndex, true /*isIP6*/, false /*isEnable*/) - if err != nil { - return err + if swIfIndex == InvalidSwIfIndex { + v.GetLog().Errorf("Interface %s not found", name) + return errors.New("Interface not found"), InvalidSwIfIndex } - return nil -} - -func (v *VppLink) DisableInterfaceIP6(swIfIndex uint32) error { - return v.enableDisableInterfaceIP(swIfIndex, true /*isIP6*/, false /*isEnable*/) -} - -func (v *VppLink) EnableInterfaceIP6(swIfIndex uint32) error { - return v.enableDisableInterfaceIP(swIfIndex, true /*isIP6*/, true /*isEnable*/) -} - -func (v *VppLink) DisableInterfaceIP4(swIfIndex uint32) error { - return v.enableDisableInterfaceIP(swIfIndex, false /*isIP6*/, false /*isEnable*/) -} - -func (v *VppLink) EnableInterfaceIP4(swIfIndex uint32) error { - return v.enableDisableInterfaceIP(swIfIndex, false /*isIP6*/, true /*isEnable*/) -} - -func (v *VppLink) SearchInterfaceWithTag(tag string) (uint32, error) { - err, sw, _ := v.searchInterfaceWithTagOrTagPrefix(tag, false) - return sw, err -} - -func (v *VppLink) SearchInterfacesWithTagPrefix(tag string) (map[string]uint32, error) { - err, _, sws := v.searchInterfaceWithTagOrTagPrefix(tag, true) - return sws, err + return nil, swIfIndex } -func (v *VppLink) searchInterfaceWithTagOrTagPrefix(tag string, prefix bool) (err error, swIfIndex uint32, swIfIndexes map[string]uint32) { +func (v *Vpp) searchInterfaceWithTagOrTagPrefix(tag string, prefix bool) (err error, swIfIndex uint32, swIfIndexes map[string]uint32) { v.Lock() defer v.Unlock() - swIfIndex = INVALID_SW_IF_INDEX + swIfIndex = InvalidSwIfIndex swIfIndexes = make(map[string]uint32) request := &interfaces.SwInterfaceDump{} stream := v.GetChannel().SendMultiRequest(request) @@ -325,7 +203,7 @@ func (v *VppLink) searchInterfaceWithTagOrTagPrefix(tag string, prefix bool) (er stop, err := stream.ReceiveReply(response) if err != nil { v.GetLog().Errorf("error listing VPP interfaces: %v", err) - return err, INVALID_SW_IF_INDEX, swIfIndexes + return err, InvalidSwIfIndex, swIfIndexes } if stop { break @@ -346,210 +224,163 @@ func (v *VppLink) searchInterfaceWithTagOrTagPrefix(tag string, prefix bool) (er } } -func (v *VppLink) SearchInterfaceWithName(name string) (err error, swIfIndex uint32) { +func (v *Vpp) getInterfaceAddresses(iface *types2.Interface, isv6 bool) (addresses []types2.IfAddress, err error) { v.Lock() defer v.Unlock() - swIfIndex = INVALID_SW_IF_INDEX - request := &interfaces.SwInterfaceDump{ - SwIfIndex: interface_types.InterfaceIndex(INVALID_SW_IF_INDEX), - // TODO: filter by name with NameFilter + request := &vppip.IPAddressDump{ + SwIfIndex: interface_types.InterfaceIndex(iface.SwIfIndex), + IsIPv6: isv6, } - reqCtx := v.GetChannel().SendMultiRequest(request) + stream := v.GetChannel().SendMultiRequest(request) for { - response := &interfaces.SwInterfaceDetails{} - stop, err := reqCtx.ReceiveReply(response) + response := &vppip.IPAddressDetails{} + stop, err := stream.ReceiveReply(response) if err != nil { - v.GetLog().Errorf("SwInterfaceDump failed: %v", err) - return err, INVALID_SW_IF_INDEX + return nil, errors.Wrapf(err, "error getting VPP interface addresses") } if stop { break } - interfaceName := string(bytes.Trim([]byte(response.InterfaceName), "\x00")) - v.GetLog().Debugf("Found interface: %s", interfaceName) - if interfaceName == name { - swIfIndex = uint32(response.SwIfIndex) + address := types2.IfAddress{ + SwIfIndex: uint32(response.SwIfIndex), + IPNet: *FromVppAddressWithPrefix(response.Prefix), } - - } - if swIfIndex == INVALID_SW_IF_INDEX { - v.GetLog().Errorf("Interface %s not found", name) - return errors.New("Interface not found"), INVALID_SW_IF_INDEX + addresses = append(addresses, address) } - return nil, swIfIndex + return addresses, err } -func (v *VppLink) GetInterfaceDetails(swIfIndex uint32) (i *types.VppInterfaceDetails, err error) { +func (v *Vpp) SetInterfaceMtu(iface *types2.Interface, mtu int) error { v.Lock() defer v.Unlock() - request := &interfaces.SwInterfaceDump{ - SwIfIndex: interface_types.InterfaceIndex(swIfIndex), - } - stream := v.GetChannel().SendMultiRequest(request) - for { - response := &interfaces.SwInterfaceDetails{} - stop, err := stream.ReceiveReply(response) - if err != nil { - v.GetLog().Errorf("error listing VPP interfaces: %v", err) - return nil, err - } - if stop { - break - } - if uint32(response.SwIfIndex) != swIfIndex { - v.GetLog().Debugf("Got interface that doesn't match filter, fix vpp") - continue - } - v.GetLog().Debugf("found interface %d", response.SwIfIndex) - i = &types.VppInterfaceDetails{ - SwIfIndex: uint32(response.SwIfIndex), - IsUp: response.Flags&interface_types.IF_STATUS_API_FLAG_ADMIN_UP > 0, - Name: response.InterfaceName, - Tag: response.Tag, - Type: response.InterfaceDevType, - } + mtus := make([]uint32, 4) + mtus[interface_types.MTU_PROTO_API_L3] = uint32(mtu) + + response := &interfaces.SwInterfaceSetMtuReply{} + request := &interfaces.SwInterfaceSetMtu{ + SwIfIndex: interface_types.InterfaceIndex(iface.SwIfIndex), + Mtu: mtus, } - if i == nil { - return nil, errors.New("Interface not found") + + err := v.GetChannel().SendRequest(request).ReceiveReply(response) + if err != nil { + return errors.Wrapf(err, "SwInterfaceSetMtu failed: req %+v reply %+v", request, response) + } else if response.Retval != 0 { + return fmt.Errorf("SwInterfaceSetMtu failed (retval %d). Request: %+v", response.Retval, request) } - return i, nil + iface.Mtu = mtu + return nil } -func (v *VppLink) interfaceAdminUpDown(swIfIndex uint32, up bool) error { +func (v *Vpp) SetInterfaceRxMode(iface *types2.Interface, queueID uint32, mode types2.RxMode) error { v.Lock() defer v.Unlock() - var f interface_types.IfStatusFlags = 0 - if up { - f |= interface_types.IF_STATUS_API_FLAG_ADMIN_UP - } - // Set interface down - request := &interfaces.SwInterfaceSetFlags{ - SwIfIndex: interface_types.InterfaceIndex(swIfIndex), - Flags: f, + response := &interfaces.SwInterfaceSetRxModeReply{} + request := &interfaces.SwInterfaceSetRxMode{ + SwIfIndex: interface_types.InterfaceIndex(iface.SwIfIndex), + QueueIDValid: queueID != types2.AllQueues, + QueueID: queueID, + Mode: interface_types.RxMode(mode), } - response := &interfaces.SwInterfaceSetFlagsReply{} err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { - return errors.Wrapf(err, "setting interface up/down failed") + return errors.Wrapf(err, "SetInterfaceRxMode failed: req %+v reply %+v", request, response) + } else if response.Retval != 0 { + return fmt.Errorf("SetInterfaceRxMode failed (retval %d). Request: %+v", response.Retval, request) } return nil } -func (v *VppLink) InterfaceAdminDown(swIfIndex uint32) error { - return v.interfaceAdminUpDown(swIfIndex, false) -} - -func (v *VppLink) InterfaceAdminUp(swIfIndex uint32) error { - return v.interfaceAdminUpDown(swIfIndex, true) -} - -func (v *VppLink) GetInterfaceNeighbors(swIfIndex uint32, isIPv6 bool) (err error, neighbors []types.Neighbor) { +func (v *Vpp) SetInterfaceMacAddress(iface *types2.Interface, mac *net.HardwareAddr) error { v.Lock() defer v.Unlock() - request := &ip_neighbor.IPNeighborDump{ - SwIfIndex: interface_types.InterfaceIndex(swIfIndex), - Af: ip_types.ADDRESS_IP4, + response := &interfaces.SwInterfaceSetMacAddressReply{} + request := &interfaces.SwInterfaceSetMacAddress{ + SwIfIndex: interface_types.InterfaceIndex(iface.SwIfIndex), + MacAddress: ToVppMacAddress(mac), } - if isIPv6 { - request.Af = ip_types.ADDRESS_IP6 - } - response := &ip_neighbor.IPNeighborDetails{} - stream := v.GetChannel().SendMultiRequest(request) - for { - stop, err := stream.ReceiveReply(response) - if err != nil { - v.GetLog().Errorf("error listing VPP neighbors: %v", err) - return err, nil - } - if stop { - return nil, neighbors - } - vppNeighbor := response.Neighbor - neighbors = append(neighbors, types.Neighbor{ - SwIfIndex: uint32(vppNeighbor.SwIfIndex), - Flags: types.FromVppNeighborFlags(vppNeighbor.Flags), - IP: types.FromVppAddress(vppNeighbor.IPAddress), - HardwareAddr: types.FromVppMacAddress(vppNeighbor.MacAddress), - }) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) + if err != nil { + return errors.Wrapf(err, "SwInterfaceSetMacAddress failed: req %+v reply %+v", request, response) + } else if response.Retval != 0 { + return fmt.Errorf("SwInterfaceSetMacAddress failed (retval %d). Request: %+v", response.Retval, request) } + iface.HardwareAddr = mac + return nil } -func (v *VppLink) DelTap(swIfIndex uint32) error { +func (v *Vpp) SetInterfaceVRF(iface *types2.Interface, vrfIndex uint32, isIP6 bool) error { v.Lock() defer v.Unlock() - - request := &tapv2.TapDeleteV2{ - SwIfIndex: interface_types.InterfaceIndex(swIfIndex), + response := &interfaces.SwInterfaceSetTableReply{} + request := &interfaces.SwInterfaceSetTable{ + SwIfIndex: interface_types.InterfaceIndex(iface.SwIfIndex), + IsIPv6: isIP6, + VrfID: vrfIndex, } - response := &tapv2.TapDeleteV2Reply{} err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { - return errors.Wrap(err, "failed to delete tap from VPP") + return errors.Wrapf(err, "SwInterfaceSetTable failed: req %+v reply %+v", request, response) + } else if response.Retval != 0 { + return fmt.Errorf("SwInterfaceSetTable failed (retval %d). Request: %+v", response.Retval, request) } return nil } -func (v *VppLink) interfaceSetUnnumbered(unnumberedSwIfIndex uint32, swIfIndex uint32, isAdd bool) error { +func (v *Vpp) addDelInterfaceAddress(iface *types2.Interface, addr *net.IPNet, isAdd bool) error { v.Lock() defer v.Unlock() - - request := &interfaces.SwInterfaceSetUnnumbered{ - SwIfIndex: interface_types.InterfaceIndex(swIfIndex), - UnnumberedSwIfIndex: interface_types.InterfaceIndex(unnumberedSwIfIndex), - IsAdd: isAdd, + if IsIP6(addr.IP) && addr.IP.IsLinkLocalUnicast() { + _, bits := addr.Mask.Size() + if bits != 128 { + return nil + } } - response := &interfaces.SwInterfaceSetUnnumberedReply{} + request := &interfaces.SwInterfaceAddDelAddress{ + SwIfIndex: interface_types.InterfaceIndex(iface.SwIfIndex), + IsAdd: isAdd, + Prefix: ToVppAddressWithPrefix(addr), + } + response := &interfaces.SwInterfaceAddDelAddressReply{} err := v.GetChannel().SendRequest(request).ReceiveReply(response) if err != nil { - return errors.Wrapf(err, "setting interface unnumbered failed %d -> %d", unnumberedSwIfIndex, swIfIndex) + return errors.Wrapf(err, "Adding IP address failed: req %+v reply %+v", request, response) } return nil } -func (v *VppLink) AddrList(swIfIndex uint32, isv6 bool) (addresses []types.IfAddress, err error) { +func (v *Vpp) setUnsetInterfaceTag(iface *types2.Interface, tag string, isAdd bool) error { v.Lock() defer v.Unlock() - request := &vppip.IPAddressDump{ - SwIfIndex: interface_types.InterfaceIndex(swIfIndex), - IsIPv6: isv6, + request := &interfaces.SwInterfaceTagAddDel{ + IsAdd: isAdd, + SwIfIndex: interface_types.InterfaceIndex(iface.SwIfIndex), + Tag: tag, } - stream := v.GetChannel().SendMultiRequest(request) - for { - response := &vppip.IPAddressDetails{} - stop, err := stream.ReceiveReply(response) - if err != nil { - return addresses, errors.Wrapf(err, "error listing VPP interfaces addresses") - } - if stop { - break - } - address := types.IfAddress{ - SwIfIndex: uint32(response.SwIfIndex), - IPNet: *types.FromVppAddressWithPrefix(response.Prefix), - } - addresses = append(addresses, address) + response := &interfaces.SwInterfaceTagAddDelReply{} + err := v.GetChannel().SendRequest(request).ReceiveReply(response) + if err != nil || response.Retval != 0 { + return fmt.Errorf("cannot add interface tag: %v %d", err, response.Retval) } - return addresses, nil -} - -func (v *VppLink) InterfaceSetUnnumbered(unnumberedSwIfIndex uint32, swIfIndex uint32) error { - return v.interfaceSetUnnumbered(unnumberedSwIfIndex, swIfIndex, true) -} - -func (v *VppLink) InterfaceUnsetUnnumbered(unnumberedSwIfIndex uint32, swIfIndex uint32) error { - return v.interfaceSetUnnumbered(unnumberedSwIfIndex, swIfIndex, false) + if isAdd { + iface.Tag = tag + } else { + iface.Tag = "" + } + return nil } -func (v *VppLink) enableDisableGso(swIfIndex uint32, enable bool) error { +func (v *Vpp) enableDisableGso(iface *types2.Interface, enable bool) error { v.Lock() defer v.Unlock() + request := &gso.FeatureGsoEnableDisable{ - SwIfIndex: interface_types.InterfaceIndex(swIfIndex), + SwIfIndex: interface_types.InterfaceIndex(iface.SwIfIndex), EnableDisable: enable, } response := &gso.FeatureGsoEnableDisableReply{} @@ -557,14 +388,16 @@ func (v *VppLink) enableDisableGso(swIfIndex uint32, enable bool) error { if err != nil || response.Retval != 0 { return fmt.Errorf("cannot configure gso: %v %d", err, response.Retval) } + iface.Gso = enable return nil } -func (v *VppLink) setInterfacePromiscuous(swIfIndex uint32, promiscOn bool) error { +func (v *Vpp) setInterfacePromiscuous(iface *types2.Interface, promiscOn bool) error { v.Lock() defer v.Unlock() + request := &interfaces.SwInterfaceSetPromisc{ - SwIfIndex: interface_types.InterfaceIndex(swIfIndex), + SwIfIndex: interface_types.InterfaceIndex(iface.SwIfIndex), PromiscOn: promiscOn, } response := &interfaces.SwInterfaceSetPromiscReply{} @@ -572,31 +405,16 @@ func (v *VppLink) setInterfacePromiscuous(swIfIndex uint32, promiscOn bool) erro if err != nil || response.Retval != 0 { return fmt.Errorf("cannot configure gso: %v %d", err, response.Retval) } + iface.PromiscOn = promiscOn return nil } -func (v *VppLink) SetPromiscOn(swIfIndex uint32) error { - return v.setInterfacePromiscuous(swIfIndex, true) -} - -func (v *VppLink) SetPromiscOff(swIfIndex uint32) error { - return v.setInterfacePromiscuous(swIfIndex, false) -} - -func (v *VppLink) EnableGSOFeature(swIfIndex uint32) error { - return v.enableDisableGso(swIfIndex, true) -} - -func (v *VppLink) DisableGSOFeature(swIfIndex uint32) error { - return v.enableDisableGso(swIfIndex, false) -} - -func (v *VppLink) SetInterfaceTxPlacement(swIfIndex uint32, queue int, worker int) error { +func (v *Vpp) SetInterfaceTxPlacement(iface *types2.Interface, queue int, worker int) error { v.Lock() defer v.Unlock() request := &interfaces.SwInterfaceSetTxPlacement{ - SwIfIndex: interface_types.InterfaceIndex(swIfIndex), + SwIfIndex: interface_types.InterfaceIndex(iface.SwIfIndex), QueueID: uint32(queue), ArraySize: uint32(1), Threads: []uint32{uint32(worker)}, @@ -609,12 +427,12 @@ func (v *VppLink) SetInterfaceTxPlacement(swIfIndex uint32, queue int, worker in return nil } -func (v *VppLink) SetInterfaceRxPlacement(swIfIndex uint32, queue int, worker int, main bool) error { +func (v *Vpp) SetInterfaceRxPlacement(iface *types2.Interface, queue int, worker int, main bool) error { v.Lock() defer v.Unlock() request := &interfaces.SwInterfaceSetRxPlacement{ - SwIfIndex: interface_types.InterfaceIndex(swIfIndex), + SwIfIndex: interface_types.InterfaceIndex(iface.SwIfIndex), QueueID: uint32(queue), WorkerID: uint32(worker), IsMain: main, @@ -627,30 +445,240 @@ func (v *VppLink) SetInterfaceRxPlacement(swIfIndex uint32, queue int, worker in return nil } -func (v *VppLink) CreateLoopback(hwAddr *net.HardwareAddr) (swIfIndex uint32, err error) { +func (v *Vpp) interfaceAdminUpDown(iface *types2.Interface, up bool) error { v.Lock() defer v.Unlock() - request := &interfaces.CreateLoopback{ - MacAddress: types.ToVppMacAddress(hwAddr), + + var f interface_types.IfStatusFlags = 0 + if up { + f |= interface_types.IF_STATUS_API_FLAG_ADMIN_UP } - response := &interfaces.CreateLoopbackReply{} - err = v.GetChannel().SendRequest(request).ReceiveReply(response) - if err != nil || response.Retval != 0 { - return 0, errors.Wrapf(err, "Error adding loopback: req %+v reply %+v", request, response) + // Set interface down + request := &interfaces.SwInterfaceSetFlags{ + SwIfIndex: interface_types.InterfaceIndex(iface.SwIfIndex), + Flags: f, } - return uint32(response.SwIfIndex), nil + response := &interfaces.SwInterfaceSetFlagsReply{} + err := v.GetChannel().SendRequest(request).ReceiveReply(response) + if err != nil { + return errors.Wrapf(err, "setting interface up/down failed") + } + return nil } -func (v *VppLink) DeleteLoopback(swIfIndex uint32) (err error) { +func (v *Vpp) enableDisableInterfaceIP(iface *types2.Interface, isIP6 bool, isEnable bool) error { v.Lock() defer v.Unlock() - request := &interfaces.DeleteLoopback{ - SwIfIndex: interface_types.InterfaceIndex(swIfIndex), + response := &vppip.SwInterfaceIP6EnableDisableReply{} + request := &vppip.SwInterfaceIP6EnableDisable{ + Enable: isEnable, + SwIfIndex: interface_types.InterfaceIndex(iface.SwIfIndex), } - response := &interfaces.DeleteLoopbackReply{} - err = v.GetChannel().SendRequest(request).ReceiveReply(response) - if err != nil || response.Retval != 0 { - return errors.Wrapf(err, "Error deleting loopback: req %+v reply %+v", request, response) + err := v.GetChannel().SendRequest(request).ReceiveReply(response) + if err != nil { + return errors.Wrapf(err, "SwInterfaceIP6EnableDisable failed: req %+v reply %+v", request, response) + } else if response.Retval != 0 { + return fmt.Errorf("SwInterfaceIP6EnableDisable failed (retval %d). Request: %+v", response.Retval, request) } return nil } + +func (v *Vpp) interfaceSetUnnumbered(unnumberedSwIfIndex uint32, swIfIndex uint32, isAdd bool) error { + v.Lock() + defer v.Unlock() + + request := &interfaces.SwInterfaceSetUnnumbered{ + SwIfIndex: interface_types.InterfaceIndex(swIfIndex), + UnnumberedSwIfIndex: interface_types.InterfaceIndex(unnumberedSwIfIndex), + IsAdd: isAdd, + } + response := &interfaces.SwInterfaceSetUnnumberedReply{} + err := v.GetChannel().SendRequest(request).ReceiveReply(response) + if err != nil { + return errors.Wrapf(err, "setting interface unnumbered failed %d -> %d", unnumberedSwIfIndex, swIfIndex) + } + return nil +} + +func (v *Vpp) GetInterfaceDetails(iface *types2.Interface) (i *types2.InterfaceDetails, err error) { + v.Lock() + defer v.Unlock() + + request := &interfaces.SwInterfaceDump{ + SwIfIndex: interface_types.InterfaceIndex(iface.SwIfIndex), + } + stream := v.GetChannel().SendMultiRequest(request) + for { + response := &interfaces.SwInterfaceDetails{} + stop, err := stream.ReceiveReply(response) + if err != nil { + v.GetLog().Errorf("error listing VPP interfaces: %v", err) + return nil, err + } + if stop { + break + } + if uint32(response.SwIfIndex) != iface.SwIfIndex { + v.GetLog().Debugf("Got interface that doesn't match filter, fix vpp") + continue + } + v.GetLog().Debugf("found interface %d", response.SwIfIndex) + i = &types2.InterfaceDetails{ + SwIfIndex: uint32(response.SwIfIndex), + IsUp: response.Flags&interface_types.IF_STATUS_API_FLAG_ADMIN_UP > 0, + Name: response.InterfaceName, + Tag: response.Tag, + Type: response.InterfaceDevType, + } + } + if i == nil { + return nil, errors.New("Interface not found") + } + return i, nil +} + +func (v *Vpp) GetInterfaceNeighbors(iface *types2.Interface, isIPv6 bool) (err error, neighbors []types2.Neighbor) { + v.Lock() + defer v.Unlock() + + request := &ip_neighbor.IPNeighborDump{ + SwIfIndex: interface_types.InterfaceIndex(iface.SwIfIndex), + Af: ip_types.ADDRESS_IP4, + } + if isIPv6 { + request.Af = ip_types.ADDRESS_IP6 + } + response := &ip_neighbor.IPNeighborDetails{} + stream := v.GetChannel().SendMultiRequest(request) + for { + stop, err := stream.ReceiveReply(response) + if err != nil { + v.GetLog().Errorf("error listing VPP neighbors: %v", err) + return err, nil + } + if stop { + break + } + vppNeighbor := response.Neighbor + neighbors = append(neighbors, types2.Neighbor{ + SwIfIndex: uint32(vppNeighbor.SwIfIndex), + Flags: FromVppNeighborFlags(vppNeighbor.Flags), + IP: FromVppAddress(vppNeighbor.IPAddress), + HardwareAddr: FromVppMacAddress(vppNeighbor.MacAddress), + }) + } + return nil, neighbors +} + +func (v *Vpp) EnableInterfaceIP46(iface *types2.Interface) (err error) { + err = v.enableDisableInterfaceIP(iface, false /*isIP6*/, true /*isEnable*/) + if err != nil { + return err + } + err = v.enableDisableInterfaceIP(iface, true /*isIP6*/, true /*isEnable*/) + if err != nil { + return err + } + return nil +} + +func (v *Vpp) DisableInterfaceIP46(iface *types2.Interface) (err error) { + err = v.enableDisableInterfaceIP(iface, false /*isIP6*/, false /*isEnable*/) + if err != nil { + return err + } + err = v.enableDisableInterfaceIP(iface, true /*isIP6*/, false /*isEnable*/) + if err != nil { + return err + } + return nil +} + +func (v *Vpp) DisableInterfaceIP4(iface *types2.Interface) error { + return v.enableDisableInterfaceIP(iface, false /*isIP6*/, false /*isEnable*/) +} + +func (v *Vpp) EnableInterfaceIP4(iface *types2.Interface) error { + return v.enableDisableInterfaceIP(iface, false /*isIP6*/, true /*isEnable*/) +} + +func (v *Vpp) DisableInterfaceIP6(iface *types2.Interface) error { + return v.enableDisableInterfaceIP(iface, true /*isIP6*/, false /*isEnable*/) +} + +func (v *Vpp) EnableInterfaceIP6(iface *types2.Interface) error { + return v.enableDisableInterfaceIP(iface, true /*isIP6*/, true /*isEnable*/) +} + +func (v *Vpp) GetInterfaceAddressesIP4(iface *types2.Interface) ([]types2.IfAddress, error) { + return v.getInterfaceAddresses(iface, false /*isIP6*/) +} + +func (v *Vpp) GetInterfaceAddressesIP6(iface *types2.Interface) ([]types2.IfAddress, error) { + return v.getInterfaceAddresses(iface, true /*isIP6*/) +} +func (v *Vpp) SetInterfaceVrfIP4(iface *types2.Interface, vrfIndex uint32) error { + return v.SetInterfaceVRF(iface, vrfIndex, false /*isIP6*/) +} + +func (v *Vpp) SetInterfaceVrfIP6(iface *types2.Interface, vrfIndex uint32) error { + return v.SetInterfaceVRF(iface, vrfIndex, true /*isIP6*/) +} + +func (v *Vpp) AddInterfaceAddress(iface *types2.Interface, addr *net.IPNet) error { + return v.addDelInterfaceAddress(iface, addr, true) +} + +func (v *Vpp) DelInterfaceAddress(iface *types2.Interface, addr *net.IPNet) error { + return v.addDelInterfaceAddress(iface, addr, false) +} + +func (v *Vpp) SetInterfaceTag(iface *types2.Interface, tag string) error { + return v.setUnsetInterfaceTag(iface, tag, true /* isAdd */) +} + +func (v *Vpp) UnsetInterfaceTag(iface *types2.Interface, tag string) error { + return v.setUnsetInterfaceTag(iface, tag, false /* isAdd */) +} + +func (v *Vpp) EnableGSOFeature(iface *types2.Interface) error { + return v.enableDisableGso(iface, true) +} + +func (v *Vpp) DisableGSOFeature(iface *types2.Interface) error { + return v.enableDisableGso(iface, false) +} + +func (v *Vpp) SetPromiscOn(iface *types2.Interface) error { + return v.setInterfacePromiscuous(iface, true) +} + +func (v *Vpp) SetPromiscOff(iface *types2.Interface) error { + return v.setInterfacePromiscuous(iface, false) +} + +func (v *Vpp) InterfaceAdminDown(iface *types2.Interface) error { + return v.interfaceAdminUpDown(iface, false) +} + +func (v *Vpp) InterfaceAdminUp(iface *types2.Interface) error { + return v.interfaceAdminUpDown(iface, true) +} + +func (v *Vpp) InterfaceSetUnnumbered(unnumberedSwIfIndex uint32, swIfIndex uint32) error { + return v.interfaceSetUnnumbered(unnumberedSwIfIndex, swIfIndex, true) +} + +func (v *Vpp) InterfaceUnsetUnnumbered(unnumberedSwIfIndex uint32, swIfIndex uint32) error { + return v.interfaceSetUnnumbered(unnumberedSwIfIndex, swIfIndex, false) +} + +func (v *Vpp) SearchInterfaceWithTag(tag string) (uint32, error) { + err, sw, _ := v.searchInterfaceWithTagOrTagPrefix(tag, false) + return sw, err +} + +func (v *Vpp) SearchInterfacesWithTagPrefix(tag string) (map[string]uint32, error) { + err, _, sws := v.searchInterfaceWithTagOrTagPrefix(tag, true) + return sws, err +} diff --git a/vpplink/binapi/vppapi/ip/ip.ba.go b/vpplink/binapi/vppapi/ip/ip.ba.go index 63d8ded3..18d0a3d7 100644 --- a/vpplink/binapi/vppapi/ip/ip.ba.go +++ b/vpplink/binapi/vppapi/ip/ip.ba.go @@ -317,7 +317,7 @@ func (*AddDelIPPuntRedirectV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *AddDelIPPuntRedirectV2Reply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *AddDelIPPuntRedirectV2Reply) Size() (size int) { @@ -389,7 +389,7 @@ func (*IoamDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IoamDisableReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IoamDisableReply) Size() (size int) { @@ -481,7 +481,7 @@ func (*IoamEnableReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IoamEnableReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IoamEnableReply) Size() (size int) { @@ -655,7 +655,7 @@ func (*IPContainerProxyAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPContainerProxyAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPContainerProxyAddDelReply) Size() (size int) { @@ -885,7 +885,7 @@ func (*IPLocalReassEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPLocalReassEnableDisableReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPLocalReassEnableDisableReply) Size() (size int) { @@ -953,7 +953,7 @@ func (*IPLocalReassGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPLocalReassGetReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPLocalReassGetReply) Size() (size int) { @@ -1137,7 +1137,7 @@ func (*IPMrouteAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPMrouteAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPMrouteAddDelReply) Size() (size int) { @@ -1511,7 +1511,7 @@ func (*IPPathMtuGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPPathMtuGetReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPPathMtuGetReply) Size() (size int) { @@ -1580,7 +1580,7 @@ func (*IPPathMtuReplaceBeginReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPPathMtuReplaceBeginReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPPathMtuReplaceBeginReply) Size() (size int) { @@ -1646,7 +1646,7 @@ func (*IPPathMtuReplaceEndReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPPathMtuReplaceEndReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPPathMtuReplaceEndReply) Size() (size int) { @@ -1733,7 +1733,7 @@ func (*IPPathMtuUpdateReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPPathMtuUpdateReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPPathMtuUpdateReply) Size() (size int) { @@ -1813,7 +1813,7 @@ func (*IPPuntPoliceReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPPuntPoliceReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPPuntPoliceReply) Size() (size int) { @@ -1985,7 +1985,7 @@ func (*IPPuntRedirectReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPPuntRedirectReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPPuntRedirectReply) Size() (size int) { @@ -2226,7 +2226,7 @@ func (*IPReassemblyEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPReassemblyEnableDisableReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPReassemblyEnableDisableReply) Size() (size int) { @@ -2307,7 +2307,7 @@ func (*IPReassemblyGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPReassemblyGetReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPReassemblyGetReply) Size() (size int) { @@ -2414,7 +2414,7 @@ func (*IPReassemblySetReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPReassemblySetReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPReassemblySetReply) Size() (size int) { @@ -2583,7 +2583,7 @@ func (*IPRouteAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPRouteAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPRouteAddDelReply) Size() (size int) { @@ -2760,7 +2760,7 @@ func (*IPRouteAddDelV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPRouteAddDelV2Reply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPRouteAddDelV2Reply) Size() (size int) { @@ -3016,7 +3016,7 @@ func (*IPRouteLookupReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPRouteLookupReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPRouteLookupReply) Size() (size int) { @@ -3196,7 +3196,7 @@ func (*IPRouteLookupV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPRouteLookupV2Reply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPRouteLookupV2Reply) Size() (size int) { @@ -3585,7 +3585,7 @@ func (*IPSourceAndPortRangeCheckAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPSourceAndPortRangeCheckAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPSourceAndPortRangeCheckAddDelReply) Size() (size int) { @@ -3685,7 +3685,7 @@ func (*IPSourceAndPortRangeCheckInterfaceAddDelReply) GetMessageType() api.Messa return api.ReplyMessage } func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) Size() (size int) { @@ -3767,7 +3767,7 @@ func (*IPTableAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPTableAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPTableAddDelReply) Size() (size int) { @@ -3846,7 +3846,7 @@ func (*IPTableAllocateReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPTableAllocateReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPTableAllocateReply) Size() (size int) { @@ -4005,7 +4005,7 @@ func (*IPTableFlushReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPTableFlushReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPTableFlushReply) Size() (size int) { @@ -4083,7 +4083,7 @@ func (*IPTableReplaceBeginReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPTableReplaceBeginReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPTableReplaceBeginReply) Size() (size int) { @@ -4161,7 +4161,7 @@ func (*IPTableReplaceEndReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPTableReplaceEndReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPTableReplaceEndReply) Size() (size int) { @@ -4435,7 +4435,7 @@ func (*SetIPFlowHashReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SetIPFlowHashReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SetIPFlowHashReply) Size() (size int) { @@ -4507,7 +4507,7 @@ func (*SetIPFlowHashRouterIDReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SetIPFlowHashRouterIDReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SetIPFlowHashRouterIDReply) Size() (size int) { @@ -4587,7 +4587,7 @@ func (*SetIPFlowHashV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SetIPFlowHashV2Reply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SetIPFlowHashV2Reply) Size() (size int) { @@ -4665,7 +4665,7 @@ func (*SwInterfaceIP6EnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SwInterfaceIP6EnableDisableReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceIP6EnableDisableReply) Size() (size int) { @@ -4744,7 +4744,7 @@ func (*SwInterfaceIP6GetLinkLocalAddressReply) GetMessageType() api.MessageType return api.ReplyMessage } func (m *SwInterfaceIP6GetLinkLocalAddressReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceIP6GetLinkLocalAddressReply) Size() (size int) { @@ -4829,7 +4829,7 @@ func (*SwInterfaceIP6SetLinkLocalAddressReply) GetMessageType() api.MessageType return api.ReplyMessage } func (m *SwInterfaceIP6SetLinkLocalAddressReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceIP6SetLinkLocalAddressReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/ip6_nd/ip6_nd.ba.go b/vpplink/binapi/vppapi/ip6_nd/ip6_nd.ba.go index 0e56ee06..9598f2cd 100644 --- a/vpplink/binapi/vppapi/ip6_nd/ip6_nd.ba.go +++ b/vpplink/binapi/vppapi/ip6_nd/ip6_nd.ba.go @@ -194,7 +194,7 @@ func (*IP6ndProxyAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IP6ndProxyAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IP6ndProxyAddDelReply) Size() (size int) { @@ -342,7 +342,7 @@ func (*IP6ndProxyEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IP6ndProxyEnableDisableReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IP6ndProxyEnableDisableReply) Size() (size int) { @@ -436,7 +436,7 @@ func (*IP6ndSendRouterSolicitationReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IP6ndSendRouterSolicitationReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IP6ndSendRouterSolicitationReply) Size() (size int) { @@ -562,7 +562,7 @@ func (*SwInterfaceIP6ndRaConfigReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SwInterfaceIP6ndRaConfigReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceIP6ndRaConfigReply) Size() (size int) { @@ -678,7 +678,7 @@ func (*SwInterfaceIP6ndRaPrefixReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SwInterfaceIP6ndRaPrefixReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceIP6ndRaPrefixReply) Size() (size int) { @@ -754,7 +754,7 @@ func (*WantIP6RaEventsReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *WantIP6RaEventsReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *WantIP6RaEventsReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/ip_helpers.go b/vpplink/binapi/vppapi/ip_helpers.go new file mode 100644 index 00000000..395d24a5 --- /dev/null +++ b/vpplink/binapi/vppapi/ip_helpers.go @@ -0,0 +1,183 @@ +// Copyright (C) 2019 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 vppapi + +import ( + "net" + + types2 "git.fd.io/govpp.git/api/v0" + + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/ethernet_types" + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/interface_types" + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/ip_neighbor" + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/ip_types" +) + +const ( + IPNeighborNone types2.IPNeighborFlags = types2.IPNeighborFlags(ip_neighbor.IP_API_NEIGHBOR_FLAG_NONE) + IPNeighborStatic types2.IPNeighborFlags = types2.IPNeighborFlags(ip_neighbor.IP_API_NEIGHBOR_FLAG_STATIC) + IPNeighborNoFibEntry types2.IPNeighborFlags = types2.IPNeighborFlags(ip_neighbor.IP_API_NEIGHBOR_FLAG_NO_FIB_ENTRY) +) + +const ( + InvalidInterface = interface_types.InterfaceIndex(^uint32(0)) +) + +func GetIPFamily(ip net.IP) int { + if len(ip) <= net.IPv4len { + return types2.FAMILY_V4 + } + if ip.To4() != nil { + return types2.FAMILY_V4 + } + return types2.FAMILY_V6 +} + +func FromVppNeighborFlags(flags ip_neighbor.IPNeighborFlags) types2.IPNeighborFlags { + return types2.IPNeighborFlags(flags) +} + +func IsIP6(ip net.IP) bool { + return GetIPFamily(ip) == types2.FAMILY_V6 +} + +func toVppIPProto(proto types2.IPProto) ip_types.IPProto { + switch proto { + case types2.UDP: + return ip_types.IP_API_PROTO_UDP + case types2.TCP: + return ip_types.IP_API_PROTO_TCP + case types2.SCTP: + return ip_types.IP_API_PROTO_SCTP + case types2.ICMP: + return ip_types.IP_API_PROTO_ICMP + case types2.ICMP6: + return ip_types.IP_API_PROTO_ICMP6 + } + return ip_types.IP_API_PROTO_RESERVED +} + +func toVppIP4Address(addr net.IP) ip_types.IP4Address { + ip := [4]uint8{} + copy(ip[:], addr.To4()) + return ip +} + +func toVppIP6Address(addr net.IP) ip_types.IP6Address { + ip := [16]uint8{} + copy(ip[:], addr) + return ip +} + +func toVppAddress(addr net.IP) ip_types.Address { + a := ip_types.Address{} + if addr.To4() == nil { + a.Af = ip_types.ADDRESS_IP6 + ip := [16]uint8{} + copy(ip[:], addr) + a.Un = ip_types.AddressUnionIP6(ip) + } else { + a.Af = ip_types.ADDRESS_IP4 + ip := [4]uint8{} + copy(ip[:], addr.To4()) + a.Un = ip_types.AddressUnionIP4(ip) + } + return a +} + +func FromVppIpAddressUnion(Un ip_types.AddressUnion, isv6 bool) net.IP { + if isv6 { + a := Un.GetIP6() + return net.IP(a[:]) + } else { + a := Un.GetIP4() + return net.IP(a[:]) + } +} + +func FromVppAddress(addr ip_types.Address) net.IP { + return FromVppIpAddressUnion( + ip_types.AddressUnion(addr.Un), + addr.Af == ip_types.ADDRESS_IP6, + ) +} + +func ToVppAddressWithPrefix(prefix *net.IPNet) ip_types.AddressWithPrefix { + return ip_types.AddressWithPrefix(toVppPrefix(prefix)) +} + +func toVppPrefix(prefix *net.IPNet) ip_types.Prefix { + l, _ := prefix.Mask.Size() + r := ip_types.Prefix{ + Address: toVppAddress(prefix.IP), + Len: uint8(l), + } + return r +} + +func toVppIp4WithPrefix(prefix *net.IPNet) ip_types.IP4AddressWithPrefix { + return ip_types.IP4AddressWithPrefix(toVppIP4Prefix(prefix)) +} + +func toVppIP4Prefix(prefix *net.IPNet) ip_types.IP4Prefix { + l, _ := prefix.Mask.Size() + r := ip_types.IP4Prefix{ + Address: toVppIP4Address(prefix.IP), + Len: uint8(l), + } + return r +} + +func FromVppAddressWithPrefix(prefix ip_types.AddressWithPrefix) *net.IPNet { + return FromVppPrefix(ip_types.Prefix(prefix)) +} + +func FromVppPrefix(prefix ip_types.Prefix) *net.IPNet { + addressSize := 32 + if prefix.Address.Af == ip_types.ADDRESS_IP6 { + addressSize = 128 + } + return &net.IPNet{ + IP: FromVppAddress(prefix.Address), + Mask: net.CIDRMask(int(prefix.Len), addressSize), + } +} + +func ToVppAddressFamily(isv6 bool) ip_types.AddressFamily { + if isv6 { + return ip_types.ADDRESS_IP6 + } + return ip_types.ADDRESS_IP4 +} + +func ToVppPrefix(prefix *net.IPNet) ip_types.Prefix { + l, _ := prefix.Mask.Size() + r := ip_types.Prefix{ + Address: ip_types.AddressFromIP(prefix.IP), + Len: uint8(l), + } + return r +} + +func ToVppMacAddress(hardwareAddr *net.HardwareAddr) ethernet_types.MacAddress { + hwAddr := [6]uint8{} + copy(hwAddr[:], *hardwareAddr) + return ethernet_types.MacAddress(hwAddr) +} + +func FromVppMacAddress(vppHwAddr ethernet_types.MacAddress) net.HardwareAddr { + return net.HardwareAddr(vppHwAddr[:]) +} diff --git a/vpplink/binapi/vppapi/ip_neighbor/ip_neighbor.ba.go b/vpplink/binapi/vppapi/ip_neighbor/ip_neighbor.ba.go index 6e01faca..22ff3648 100644 --- a/vpplink/binapi/vppapi/ip_neighbor/ip_neighbor.ba.go +++ b/vpplink/binapi/vppapi/ip_neighbor/ip_neighbor.ba.go @@ -199,7 +199,7 @@ func (*IPNeighborAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPNeighborAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPNeighborAddDelReply) Size() (size int) { @@ -286,7 +286,7 @@ func (*IPNeighborConfigReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPNeighborConfigReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPNeighborConfigReply) Size() (size int) { @@ -563,7 +563,7 @@ func (*IPNeighborFlushReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPNeighborFlushReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPNeighborFlushReply) Size() (size int) { @@ -629,7 +629,7 @@ func (*IPNeighborReplaceBeginReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPNeighborReplaceBeginReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPNeighborReplaceBeginReply) Size() (size int) { @@ -695,7 +695,7 @@ func (*IPNeighborReplaceEndReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IPNeighborReplaceEndReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IPNeighborReplaceEndReply) Size() (size int) { @@ -784,7 +784,7 @@ func (*WantIPNeighborEventsReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *WantIPNeighborEventsReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *WantIPNeighborEventsReply) Size() (size int) { @@ -873,7 +873,7 @@ func (*WantIPNeighborEventsV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *WantIPNeighborEventsV2Reply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *WantIPNeighborEventsV2Reply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/ip_types/ip_types.ba.go b/vpplink/binapi/vppapi/ip_types/ip_types.ba.go index 48aa5309..7a87bb3f 100644 --- a/vpplink/binapi/vppapi/ip_types/ip_types.ba.go +++ b/vpplink/binapi/vppapi/ip_types/ip_types.ba.go @@ -26,6 +26,12 @@ import ( // GoVPP api package needs to be updated. const _ = api.GoVppAPIPackageIsVersion2 +const ( + APIFile = "ip_types" + APIVersion = "3.0.0" + VersionCrc = 0xfee023ed +) + // AddressFamily defines enum 'address_family'. type AddressFamily uint8 diff --git a/vpplink/binapi/vppapi/ipip.go b/vpplink/binapi/vppapi/ipip.go index 24b786eb..95704306 100644 --- a/vpplink/binapi/vppapi/ipip.go +++ b/vpplink/binapi/vppapi/ipip.go @@ -29,7 +29,7 @@ func (v *Vpp) ListIPIPTunnels() ([]*types.IPIPTunnel, error) { tunnels := make([]*types.IPIPTunnel, 0) request := &ipip.IpipTunnelDump{ - SwIfIndex: interface_types.InterfaceIndex(types.InvalidInterface), + SwIfIndex: interface_types.InterfaceIndex(InvalidInterface), } stream := v.GetChannel().SendMultiRequest(request) for { diff --git a/vpplink/binapi/vppapi/ipip/ipip.ba.go b/vpplink/binapi/vppapi/ipip/ipip.ba.go index 44b86bb5..646ca6c7 100644 --- a/vpplink/binapi/vppapi/ipip/ipip.ba.go +++ b/vpplink/binapi/vppapi/ipip/ipip.ba.go @@ -119,7 +119,7 @@ func (*Ipip6rdAddTunnelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ipip6rdAddTunnelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ipip6rdAddTunnelReply) Size() (size int) { @@ -194,7 +194,7 @@ func (*Ipip6rdDelTunnelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Ipip6rdDelTunnelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Ipip6rdDelTunnelReply) Size() (size int) { @@ -294,7 +294,7 @@ func (*IpipAddTunnelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpipAddTunnelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IpipAddTunnelReply) Size() (size int) { @@ -369,7 +369,7 @@ func (*IpipDelTunnelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpipDelTunnelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IpipDelTunnelReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/ipsec.go b/vpplink/binapi/vppapi/ipsec.go new file mode 100644 index 00000000..bd9c0623 --- /dev/null +++ b/vpplink/binapi/vppapi/ipsec.go @@ -0,0 +1,140 @@ +// Copyright (C) 2019 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 vppapi + +import ( + "github.com/pkg/errors" + + types "git.fd.io/govpp.git/api/v0" + + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/interface_types" + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/ipsec" + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/ipsec_types" +) + +func (v *Vpp) GetIPsecTunnelProtection(tunnelInterface uint32) (protections []types.IPsecTunnelProtection, err error) { + v.lock.Lock() + defer v.lock.Unlock() + + request := &ipsec.IpsecTunnelProtectDump{ + SwIfIndex: interface_types.InterfaceIndex(tunnelInterface), + } + stream := v.GetChannel().SendMultiRequest(request) + for { + response := &ipsec.IpsecTunnelProtectDetails{} + stop, err := stream.ReceiveReply(response) + if err != nil { + return nil, errors.Wrapf(err, "error listing tunnel interface %u protections", tunnelInterface) + } + if stop { + return protections, nil + } + protections = append(protections, types.IPsecTunnelProtection{ + SwIfIndex: uint32(response.Tun.SwIfIndex), + NextHop: FromVppAddress(response.Tun.Nh), + OutSAIndex: response.Tun.SaOut, + InSAIndices: response.Tun.SaIn, + }) + } +} + +func (v *Vpp) addDelIpsecSA(sa *types.IPSecSA, isAdd bool) error { + v.lock.Lock() + defer v.lock.Unlock() + response := &ipsec.IpsecSadEntryAddDelV3Reply{} + request := &ipsec.IpsecSadEntryAddDelV3{ + IsAdd: isAdd, + Entry: ipsec_types.IpsecSadEntryV3{ + SadID: sa.SAId, + Spi: sa.Spi, + Protocol: ipsec_types.IPSEC_API_PROTO_ESP, + CryptoAlgorithm: ipsec_types.IPSEC_API_CRYPTO_ALG_AES_CTR_128, + CryptoKey: getVPPKey(sa.CryptoKey), + Salt: sa.Salt, + IntegrityKey: getVPPKey(sa.IntegrityKey), + IntegrityAlgorithm: ipsec_types.IPSEC_API_INTEG_ALG_SHA1_96, + Flags: toVppSaFlags(sa.Flags), + UDPSrcPort: uint16(sa.SrcPort), + UDPDstPort: uint16(sa.DstPort), + }, + } + if sa.Tunnel != nil { + request.Entry.Tunnel = toVppTunnel(*sa.Tunnel) + } + return v.SendRequestAwaitReply(request, response) +} + +func (v *Vpp) AddIpsecSA(sa *types.IPSecSA) error { + return v.addDelIpsecSA(sa, true /* isAdd */) +} + +func (v *Vpp) DelIpsecSA(sa *types.IPSecSA) error { + return v.addDelIpsecSA(sa, false /* isAdd */) +} + +func (v *Vpp) AddIpsecSAProtect(swIfIndex, saIn, saOut uint32) error { + v.lock.Lock() + defer v.lock.Unlock() + + response := &ipsec.IpsecTunnelProtectUpdateReply{} + request := &ipsec.IpsecTunnelProtectUpdate{ + Tunnel: ipsec.IpsecTunnelProtect{ + SwIfIndex: interface_types.InterfaceIndex(swIfIndex), + SaOut: saOut, + SaIn: []uint32{saIn}, + }, + } + return v.SendRequestAwaitReply(request, response) +} + +func (v *Vpp) DelIpsecSAProtect(swIfIndex uint32) error { + v.lock.Lock() + defer v.lock.Unlock() + + response := &ipsec.IpsecTunnelProtectDelReply{} + request := &ipsec.IpsecTunnelProtectDel{ + SwIfIndex: interface_types.InterfaceIndex(swIfIndex), + } + return v.SendRequestAwaitReply(request, response) +} + +func (v *Vpp) AddIpsecInterface() (uint32, error) { + v.lock.Lock() + defer v.lock.Unlock() + + response := &ipsec.IpsecItfCreateReply{} + request := &ipsec.IpsecItfCreate{ + Itf: ipsec.IpsecItf{ + UserInstance: ^uint32(0), + }, + } + err := v.SendRequestAwaitReply(request, response) + if err != nil { + return InvalidSwIfIndex, err + } + return uint32(response.SwIfIndex), nil +} + +func (v *Vpp) DelIpsecInterface(swIfIndex uint32) error { + v.lock.Lock() + defer v.lock.Unlock() + + response := &ipsec.IpsecItfDeleteReply{} + request := &ipsec.IpsecItfDelete{ + SwIfIndex: interface_types.InterfaceIndex(swIfIndex), + } + return v.SendRequestAwaitReply(request, response) +} diff --git a/vpplink/binapi/vppapi/ipsec/ipsec.ba.go b/vpplink/binapi/vppapi/ipsec/ipsec.ba.go index a6604806..a933e9e6 100644 --- a/vpplink/binapi/vppapi/ipsec/ipsec.ba.go +++ b/vpplink/binapi/vppapi/ipsec/ipsec.ba.go @@ -235,7 +235,7 @@ func (*IpsecInterfaceAddDelSpdReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecInterfaceAddDelSpdReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IpsecInterfaceAddDelSpdReply) Size() (size int) { @@ -314,7 +314,7 @@ func (*IpsecItfCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecItfCreateReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IpsecItfCreateReply) Size() (size int) { @@ -389,7 +389,7 @@ func (*IpsecItfDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecItfDeleteReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IpsecItfDeleteReply) Size() (size int) { @@ -1181,7 +1181,7 @@ func (*IpsecSadEntryAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecSadEntryAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IpsecSadEntryAddDelReply) Size() (size int) { @@ -1320,7 +1320,7 @@ func (*IpsecSadEntryAddDelV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecSadEntryAddDelV2Reply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IpsecSadEntryAddDelV2Reply) Size() (size int) { @@ -1474,7 +1474,7 @@ func (*IpsecSadEntryAddDelV3Reply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecSadEntryAddDelV3Reply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IpsecSadEntryAddDelV3Reply) Size() (size int) { @@ -1514,7 +1514,7 @@ func (*IpsecSadEntryAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecSadEntryAddReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IpsecSadEntryAddReply) Size() (size int) { @@ -1589,7 +1589,7 @@ func (*IpsecSadEntryDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecSadEntryDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IpsecSadEntryDelReply) Size() (size int) { @@ -1665,7 +1665,7 @@ func (*IpsecSelectBackendReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecSelectBackendReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IpsecSelectBackendReply) Size() (size int) { @@ -1737,7 +1737,7 @@ func (*IpsecSetAsyncModeReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecSetAsyncModeReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IpsecSetAsyncModeReply) Size() (size int) { @@ -1813,7 +1813,7 @@ func (*IpsecSpdAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecSpdAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IpsecSpdAddDelReply) Size() (size int) { @@ -2068,7 +2068,7 @@ func (*IpsecSpdEntryAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecSpdEntryAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IpsecSpdEntryAddDelReply) Size() (size int) { @@ -2300,7 +2300,7 @@ func (*IpsecTunnelProtectDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecTunnelProtectDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IpsecTunnelProtectDelReply) Size() (size int) { @@ -2494,7 +2494,7 @@ func (*IpsecTunnelProtectUpdateReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecTunnelProtectUpdateReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *IpsecTunnelProtectUpdateReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/ipsec_helpers.go b/vpplink/binapi/vppapi/ipsec_helpers.go new file mode 100644 index 00000000..85acf4d2 --- /dev/null +++ b/vpplink/binapi/vppapi/ipsec_helpers.go @@ -0,0 +1,79 @@ +// Copyright (C) 2019 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 vppapi + +import ( + types "git.fd.io/govpp.git/api/v0" + + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/ipsec_types" + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/tunnel_types" +) + +func fromVppSaFlags(vppFlags ipsec_types.IpsecSadFlags) types.SaFlags { + return types.SaFlags(vppFlags) +} + +func toVppSaFlags(flags types.SaFlags) ipsec_types.IpsecSadFlags { + return ipsec_types.IpsecSadFlags(flags) +} + +func getVPPKey(in []byte) ipsec_types.Key { + return ipsec_types.Key{ + Length: uint8(len(in)), + Data: in, + } +} + +func toVppTunnel(tunnel types.Tunnel) tunnel_types.Tunnel { + return tunnel_types.Tunnel{ + Src: toVppAddress(tunnel.Src), + Dst: toVppAddress(tunnel.Dst), + TableID: tunnel.TableID, + } +} + +func fromVppTunnel(tunnel tunnel_types.Tunnel) types.Tunnel { + return types.Tunnel{ + Src: FromVppAddress(tunnel.Src), + Dst: FromVppAddress(tunnel.Dst), + TableID: tunnel.TableID, + } +} + +func GetSaFlagNone() types.SaFlags { + return types.SaFlags(ipsec_types.IPSEC_API_SAD_FLAG_NONE) +} +func GetSaFlagUseEsn() types.SaFlags { + return types.SaFlags(ipsec_types.IPSEC_API_SAD_FLAG_USE_ESN) +} +func GetSaFlagAntiReplay() types.SaFlags { + return types.SaFlags(ipsec_types.IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY) +} +func GetSaFlagIsTunnel() types.SaFlags { + return types.SaFlags(ipsec_types.IPSEC_API_SAD_FLAG_IS_TUNNEL) +} +func GetSaFlagIsTunnelV6() types.SaFlags { + return types.SaFlags(ipsec_types.IPSEC_API_SAD_FLAG_IS_TUNNEL_V6) +} +func GetSaFlagUdpEncap() types.SaFlags { + return types.SaFlags(ipsec_types.IPSEC_API_SAD_FLAG_UDP_ENCAP) +} +func GetSaFlagIsInbound() types.SaFlags { + return types.SaFlags(ipsec_types.IPSEC_API_SAD_FLAG_IS_INBOUND) +} +func GetSaFlagAsync() types.SaFlags { + return types.SaFlags(ipsec_types.IPSEC_API_SAD_FLAG_ASYNC) +} \ No newline at end of file diff --git a/vpplink/binapi/vppapi/ipsec_types/ipsec_types.ba.go b/vpplink/binapi/vppapi/ipsec_types/ipsec_types.ba.go index a22efc02..3e4d65e7 100644 --- a/vpplink/binapi/vppapi/ipsec_types/ipsec_types.ba.go +++ b/vpplink/binapi/vppapi/ipsec_types/ipsec_types.ba.go @@ -23,6 +23,12 @@ import ( // GoVPP api package needs to be updated. const _ = api.GoVppAPIPackageIsVersion2 +const ( + APIFile = "ipsec_types" + APIVersion = "3.0.1" + VersionCrc = 0x48f74470 +) + // IpsecCryptoAlg defines enum 'ipsec_crypto_alg'. type IpsecCryptoAlg uint32 diff --git a/vpplink/binapi/vppapi/memclnt/memclnt.ba.go b/vpplink/binapi/vppapi/memclnt/memclnt.ba.go index 21ce8358..3767057f 100644 --- a/vpplink/binapi/vppapi/memclnt/memclnt.ba.go +++ b/vpplink/binapi/vppapi/memclnt/memclnt.ba.go @@ -83,7 +83,7 @@ func (*APIVersionsReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *APIVersionsReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *APIVersionsReply) Size() (size int) { @@ -182,7 +182,7 @@ func (*ControlPingReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *ControlPingReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *ControlPingReply) Size() (size int) { @@ -261,7 +261,7 @@ func (*GetFirstMsgIDReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *GetFirstMsgIDReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *GetFirstMsgIDReply) Size() (size int) { @@ -519,7 +519,7 @@ func (*MemclntKeepaliveReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *MemclntKeepaliveReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *MemclntKeepaliveReply) Size() (size int) { @@ -684,7 +684,7 @@ func (*RPCCallReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *RPCCallReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *RPCCallReply) Size() (size int) { @@ -809,7 +809,7 @@ func (*SockInitShmReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SockInitShmReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SockInitShmReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/memif/memif.ba.go b/vpplink/binapi/vppapi/memif/memif.ba.go index 6df262a2..a0fa1343 100644 --- a/vpplink/binapi/vppapi/memif/memif.ba.go +++ b/vpplink/binapi/vppapi/memif/memif.ba.go @@ -175,7 +175,7 @@ func (*MemifCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *MemifCreateReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *MemifCreateReply) Size() (size int) { @@ -250,7 +250,7 @@ func (*MemifDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *MemifDeleteReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *MemifDeleteReply) Size() (size int) { @@ -438,7 +438,7 @@ func (*MemifSocketFilenameAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *MemifSocketFilenameAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *MemifSocketFilenameAddDelReply) Size() (size int) { @@ -523,7 +523,7 @@ func (*MemifSocketFilenameAddDelV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *MemifSocketFilenameAddDelV2Reply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *MemifSocketFilenameAddDelV2Reply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/mfib_types/mfib_types.ba.go b/vpplink/binapi/vppapi/mfib_types/mfib_types.ba.go index a3b21aad..bf4aa685 100644 --- a/vpplink/binapi/vppapi/mfib_types/mfib_types.ba.go +++ b/vpplink/binapi/vppapi/mfib_types/mfib_types.ba.go @@ -22,6 +22,12 @@ import ( // GoVPP api package needs to be updated. const _ = api.GoVppAPIPackageIsVersion2 +const ( + APIFile = "mfib_types" + APIVersion = "1.0.0" + VersionCrc = 0xd2b57aaf +) + // MfibEntryFlags defines enum 'mfib_entry_flags'. type MfibEntryFlags uint32 diff --git a/vpplink/binapi/vppapi/nat44_ed/nat44_ed.ba.go b/vpplink/binapi/vppapi/nat44_ed/nat44_ed.ba.go index 6f30a0e1..522bff26 100644 --- a/vpplink/binapi/vppapi/nat44_ed/nat44_ed.ba.go +++ b/vpplink/binapi/vppapi/nat44_ed/nat44_ed.ba.go @@ -160,7 +160,7 @@ func (*Nat44AddDelAddressRangeReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Nat44AddDelAddressRangeReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Nat44AddDelAddressRangeReply) Size() (size int) { @@ -262,7 +262,7 @@ func (*Nat44AddDelIdentityMappingReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Nat44AddDelIdentityMappingReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Nat44AddDelIdentityMappingReply) Size() (size int) { @@ -344,7 +344,7 @@ func (*Nat44AddDelInterfaceAddrReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Nat44AddDelInterfaceAddrReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Nat44AddDelInterfaceAddrReply) Size() (size int) { @@ -475,7 +475,7 @@ func (*Nat44AddDelLbStaticMappingReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Nat44AddDelLbStaticMappingReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Nat44AddDelLbStaticMappingReply) Size() (size int) { @@ -585,7 +585,7 @@ func (*Nat44AddDelStaticMappingReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Nat44AddDelStaticMappingReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Nat44AddDelStaticMappingReply) Size() (size int) { @@ -705,7 +705,7 @@ func (*Nat44AddDelStaticMappingV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Nat44AddDelStaticMappingV2Reply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Nat44AddDelStaticMappingV2Reply) Size() (size int) { @@ -875,7 +875,7 @@ func (*Nat44DelSessionReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Nat44DelSessionReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Nat44DelSessionReply) Size() (size int) { @@ -951,7 +951,7 @@ func (*Nat44DelUserReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Nat44DelUserReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Nat44DelUserReply) Size() (size int) { @@ -1031,7 +1031,7 @@ func (*Nat44EdAddDelOutputInterfaceReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Nat44EdAddDelOutputInterfaceReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Nat44EdAddDelOutputInterfaceReply) Size() (size int) { @@ -1144,7 +1144,7 @@ func (*Nat44EdOutputInterfaceGetReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Nat44EdOutputInterfaceGetReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Nat44EdOutputInterfaceGetReply) Size() (size int) { @@ -1243,7 +1243,7 @@ func (*Nat44EdPluginEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Nat44EdPluginEnableDisableReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Nat44EdPluginEnableDisableReply) Size() (size int) { @@ -1317,7 +1317,7 @@ func (*Nat44EdSetFqOptionsReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Nat44EdSetFqOptionsReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Nat44EdSetFqOptionsReply) Size() (size int) { @@ -1386,7 +1386,7 @@ func (*Nat44EdShowFqOptionsReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Nat44EdShowFqOptionsReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Nat44EdShowFqOptionsReply) Size() (size int) { @@ -1467,7 +1467,7 @@ func (*Nat44ForwardingEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Nat44ForwardingEnableDisableReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Nat44ForwardingEnableDisableReply) Size() (size int) { @@ -1709,7 +1709,7 @@ func (*Nat44InterfaceAddDelFeatureReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Nat44InterfaceAddDelFeatureReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Nat44InterfaceAddDelFeatureReply) Size() (size int) { @@ -1797,7 +1797,7 @@ func (*Nat44InterfaceAddDelOutputFeatureReply) GetMessageType() api.MessageType return api.ReplyMessage } func (m *Nat44InterfaceAddDelOutputFeatureReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Nat44InterfaceAddDelOutputFeatureReply) Size() (size int) { @@ -2114,7 +2114,7 @@ func (*Nat44LbStaticMappingAddDelLocalReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Nat44LbStaticMappingAddDelLocalReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Nat44LbStaticMappingAddDelLocalReply) Size() (size int) { @@ -2341,7 +2341,7 @@ func (*Nat44PluginEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Nat44PluginEnableDisableReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Nat44PluginEnableDisableReply) Size() (size int) { @@ -2409,7 +2409,7 @@ func (*Nat44SessionCleanupReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Nat44SessionCleanupReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Nat44SessionCleanupReply) Size() (size int) { @@ -2485,7 +2485,7 @@ func (*Nat44SetSessionLimitReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Nat44SetSessionLimitReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Nat44SetSessionLimitReply) Size() (size int) { @@ -2565,7 +2565,7 @@ func (*Nat44ShowRunningConfigReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Nat44ShowRunningConfigReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Nat44ShowRunningConfigReply) Size() (size int) { @@ -3110,7 +3110,7 @@ func (*NatControlPingReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *NatControlPingReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *NatControlPingReply) Size() (size int) { @@ -3190,7 +3190,7 @@ func (*NatGetAddrAndPortAllocAlgReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *NatGetAddrAndPortAllocAlgReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *NatGetAddrAndPortAllocAlgReply) Size() (size int) { @@ -3276,7 +3276,7 @@ func (*NatGetMssClampingReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *NatGetMssClampingReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *NatGetMssClampingReply) Size() (size int) { @@ -3354,7 +3354,7 @@ func (*NatGetTimeoutsReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *NatGetTimeoutsReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *NatGetTimeoutsReply) Size() (size int) { @@ -3432,7 +3432,7 @@ func (*NatHaFlushReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *NatHaFlushReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *NatHaFlushReply) Size() (size int) { @@ -3501,7 +3501,7 @@ func (*NatHaGetFailoverReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *NatHaGetFailoverReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *NatHaGetFailoverReply) Size() (size int) { @@ -3579,7 +3579,7 @@ func (*NatHaGetListenerReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *NatHaGetListenerReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *NatHaGetListenerReply) Size() (size int) { @@ -3704,7 +3704,7 @@ func (*NatHaResyncReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *NatHaResyncReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *NatHaResyncReply) Size() (size int) { @@ -3784,7 +3784,7 @@ func (*NatHaSetFailoverReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *NatHaSetFailoverReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *NatHaSetFailoverReply) Size() (size int) { @@ -3864,7 +3864,7 @@ func (*NatHaSetListenerReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *NatHaSetListenerReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *NatHaSetListenerReply) Size() (size int) { @@ -3946,7 +3946,7 @@ func (*NatIpfixEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *NatIpfixEnableDisableReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *NatIpfixEnableDisableReply) Size() (size int) { @@ -4040,7 +4040,7 @@ func (*NatSetAddrAndPortAllocAlgReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *NatSetAddrAndPortAllocAlgReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *NatSetAddrAndPortAllocAlgReply) Size() (size int) { @@ -4114,7 +4114,7 @@ func (*NatSetLogLevelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *NatSetLogLevelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *NatSetLogLevelReply) Size() (size int) { @@ -4190,7 +4190,7 @@ func (*NatSetMssClampingReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *NatSetMssClampingReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *NatSetMssClampingReply) Size() (size int) { @@ -4276,7 +4276,7 @@ func (*NatSetTimeoutsReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *NatSetTimeoutsReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *NatSetTimeoutsReply) Size() (size int) { @@ -4348,7 +4348,7 @@ func (*NatSetWorkersReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *NatSetWorkersReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *NatSetWorkersReply) Size() (size int) { @@ -4466,7 +4466,7 @@ func (*NatShowConfig2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *NatShowConfig2Reply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *NatShowConfig2Reply) Size() (size int) { @@ -4577,7 +4577,7 @@ func (*NatShowConfigReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *NatShowConfigReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *NatShowConfigReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/nat_types/nat_types.ba.go b/vpplink/binapi/vppapi/nat_types/nat_types.ba.go index 7bb2d600..04e36310 100644 --- a/vpplink/binapi/vppapi/nat_types/nat_types.ba.go +++ b/vpplink/binapi/vppapi/nat_types/nat_types.ba.go @@ -20,6 +20,12 @@ import ( // GoVPP api package needs to be updated. const _ = api.GoVppAPIPackageIsVersion2 +const ( + APIFile = "nat_types" + APIVersion = "0.0.1" + VersionCrc = 0x2ca9110f +) + // NatConfigFlags defines enum 'nat_config_flags'. type NatConfigFlags uint8 diff --git a/vpplink/binapi/vppapi/pbl/pbl.ba.go b/vpplink/binapi/vppapi/pbl/pbl.ba.go index 357d66c9..a80f0806 100644 --- a/vpplink/binapi/vppapi/pbl/pbl.ba.go +++ b/vpplink/binapi/vppapi/pbl/pbl.ba.go @@ -142,7 +142,7 @@ func (*PblClientDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *PblClientDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *PblClientDelReply) Size() (size int) { @@ -479,7 +479,7 @@ func (*PblClientUpdateReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *PblClientUpdateReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *PblClientUpdateReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/pci_types/pci_types.ba.go b/vpplink/binapi/vppapi/pci_types/pci_types.ba.go index e8e47fb4..091b3672 100644 --- a/vpplink/binapi/vppapi/pci_types/pci_types.ba.go +++ b/vpplink/binapi/vppapi/pci_types/pci_types.ba.go @@ -17,6 +17,12 @@ import ( // GoVPP api package needs to be updated. const _ = api.GoVppAPIPackageIsVersion2 +const ( + APIFile = "pci_types" + APIVersion = "1.0.0" + VersionCrc = 0x5d418665 +) + // PciAddress defines type 'pci_address'. type PciAddress struct { Domain uint16 `binapi:"u16,name=domain" json:"domain,omitempty"` diff --git a/vpplink/binapi/vppapi/punt/punt.ba.go b/vpplink/binapi/vppapi/punt/punt.ba.go index d7c95361..51493604 100644 --- a/vpplink/binapi/vppapi/punt/punt.ba.go +++ b/vpplink/binapi/vppapi/punt/punt.ba.go @@ -276,7 +276,7 @@ func (*PuntSocketDeregisterReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *PuntSocketDeregisterReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *PuntSocketDeregisterReply) Size() (size int) { @@ -439,7 +439,7 @@ func (*PuntSocketRegisterReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *PuntSocketRegisterReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *PuntSocketRegisterReply) Size() (size int) { @@ -521,7 +521,7 @@ func (*SetPuntReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SetPuntReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SetPuntReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/rdma/rdma.ba.go b/vpplink/binapi/vppapi/rdma/rdma.ba.go index b70adbec..a2b034a1 100644 --- a/vpplink/binapi/vppapi/rdma/rdma.ba.go +++ b/vpplink/binapi/vppapi/rdma/rdma.ba.go @@ -194,7 +194,7 @@ func (*RdmaCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *RdmaCreateReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *RdmaCreateReply) Size() (size int) { @@ -299,7 +299,7 @@ func (*RdmaCreateV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *RdmaCreateV2Reply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *RdmaCreateV2Reply) Size() (size int) { @@ -411,7 +411,7 @@ func (*RdmaCreateV3Reply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *RdmaCreateV3Reply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *RdmaCreateV3Reply) Size() (size int) { @@ -486,7 +486,7 @@ func (*RdmaDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *RdmaDeleteReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *RdmaDeleteReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/session/session.ba.go b/vpplink/binapi/vppapi/session/session.ba.go index c7cfc218..2dac217b 100644 --- a/vpplink/binapi/vppapi/session/session.ba.go +++ b/vpplink/binapi/vppapi/session/session.ba.go @@ -153,7 +153,7 @@ func (*AppAddCertKeyPairReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *AppAddCertKeyPairReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *AppAddCertKeyPairReply) Size() (size int) { @@ -250,7 +250,7 @@ func (*AppAttachReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *AppAttachReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *AppAttachReply) Size() (size int) { @@ -349,7 +349,7 @@ func (*AppDelCertKeyPairReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *AppDelCertKeyPairReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *AppDelCertKeyPairReply) Size() (size int) { @@ -440,7 +440,7 @@ func (*AppNamespaceAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *AppNamespaceAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *AppNamespaceAddDelReply) Size() (size int) { @@ -536,7 +536,7 @@ func (*AppNamespaceAddDelV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *AppNamespaceAddDelV2Reply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *AppNamespaceAddDelV2Reply) Size() (size int) { @@ -640,7 +640,7 @@ func (*AppNamespaceAddDelV3Reply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *AppNamespaceAddDelV3Reply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *AppNamespaceAddDelV3Reply) Size() (size int) { @@ -730,7 +730,7 @@ func (*AppWorkerAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *AppWorkerAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *AppWorkerAddDelReply) Size() (size int) { @@ -817,7 +817,7 @@ func (*ApplicationDetachReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *ApplicationDetachReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *ApplicationDetachReply) Size() (size int) { @@ -900,7 +900,7 @@ func (*ApplicationTLSCertAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *ApplicationTLSCertAddReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *ApplicationTLSCertAddReply) Size() (size int) { @@ -983,7 +983,7 @@ func (*ApplicationTLSKeyAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *ApplicationTLSKeyAddReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *ApplicationTLSKeyAddReply) Size() (size int) { @@ -1055,7 +1055,7 @@ func (*SessionEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SessionEnableDisableReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SessionEnableDisableReply) Size() (size int) { @@ -1175,7 +1175,7 @@ func (*SessionRuleAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SessionRuleAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SessionRuleAddDelReply) Size() (size int) { @@ -1359,7 +1359,7 @@ func (*SessionSapiEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SessionSapiEnableDisableReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SessionSapiEnableDisableReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/sr/sr.ba.go b/vpplink/binapi/vppapi/sr/sr.ba.go index f5b07bee..d28061e5 100644 --- a/vpplink/binapi/vppapi/sr/sr.ba.go +++ b/vpplink/binapi/vppapi/sr/sr.ba.go @@ -122,7 +122,7 @@ func (*SrLocalsidAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SrLocalsidAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SrLocalsidAddDelReply) Size() (size int) { @@ -554,7 +554,7 @@ func (*SrPolicyAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SrPolicyAddReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SrPolicyAddReply) Size() (size int) { @@ -630,7 +630,7 @@ func (*SrPolicyDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SrPolicyDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SrPolicyDelReply) Size() (size int) { @@ -738,7 +738,7 @@ func (*SrPolicyModReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SrPolicyModReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SrPolicyModReply) Size() (size int) { @@ -810,7 +810,7 @@ func (*SrSetEncapHopLimitReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SrSetEncapHopLimitReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SrSetEncapHopLimitReply) Size() (size int) { @@ -882,7 +882,7 @@ func (*SrSetEncapSourceReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SrSetEncapSourceReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SrSetEncapSourceReply) Size() (size int) { @@ -984,7 +984,7 @@ func (*SrSteeringAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SrSteeringAddDelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SrSteeringAddDelReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/sr_types/sr_types.ba.go b/vpplink/binapi/vppapi/sr_types/sr_types.ba.go index 0f0c4506..e63dd700 100644 --- a/vpplink/binapi/vppapi/sr_types/sr_types.ba.go +++ b/vpplink/binapi/vppapi/sr_types/sr_types.ba.go @@ -19,6 +19,12 @@ import ( // GoVPP api package needs to be updated. const _ = api.GoVppAPIPackageIsVersion2 +const ( + APIFile = "sr_types" + APIVersion = "1.0.0" + VersionCrc = 0x7955bd50 +) + // SrBehavior defines enum 'sr_behavior'. type SrBehavior uint8 diff --git a/vpplink/binapi/vppapi/tapv2/tapv2.ba.go b/vpplink/binapi/vppapi/tapv2/tapv2.ba.go index 10fb3ebd..31c59ae2 100644 --- a/vpplink/binapi/vppapi/tapv2/tapv2.ba.go +++ b/vpplink/binapi/vppapi/tapv2/tapv2.ba.go @@ -375,7 +375,7 @@ func (*TapCreateV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *TapCreateV2Reply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *TapCreateV2Reply) Size() (size int) { @@ -561,7 +561,7 @@ func (*TapCreateV3Reply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *TapCreateV3Reply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *TapCreateV3Reply) Size() (size int) { @@ -636,7 +636,7 @@ func (*TapDeleteV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *TapDeleteV2Reply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *TapDeleteV2Reply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/tunnel_types/tunnel_types.ba.go b/vpplink/binapi/vppapi/tunnel_types/tunnel_types.ba.go index 520ed7e2..86c05953 100644 --- a/vpplink/binapi/vppapi/tunnel_types/tunnel_types.ba.go +++ b/vpplink/binapi/vppapi/tunnel_types/tunnel_types.ba.go @@ -22,6 +22,12 @@ import ( // GoVPP api package needs to be updated. const _ = api.GoVppAPIPackageIsVersion2 +const ( + APIFile = "tunnel_types" + APIVersion = "1.0.1" + VersionCrc = 0x882f6758 +) + // TunnelEncapDecapFlags defines enum 'tunnel_encap_decap_flags'. type TunnelEncapDecapFlags uint8 diff --git a/vpplink/binapi/vppapi/virtio/virtio.ba.go b/vpplink/binapi/vppapi/virtio/virtio.ba.go index 1f17eef3..a692f63a 100644 --- a/vpplink/binapi/vppapi/virtio/virtio.ba.go +++ b/vpplink/binapi/vppapi/virtio/virtio.ba.go @@ -263,7 +263,7 @@ func (*VirtioPciCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *VirtioPciCreateReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *VirtioPciCreateReply) Size() (size int) { @@ -364,7 +364,7 @@ func (*VirtioPciCreateV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *VirtioPciCreateV2Reply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *VirtioPciCreateV2Reply) Size() (size int) { @@ -439,7 +439,7 @@ func (*VirtioPciDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *VirtioPciDeleteReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *VirtioPciDeleteReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/vlib/vlib.ba.go b/vpplink/binapi/vppapi/vlib/vlib.ba.go index f90829bb..bb4eb39a 100644 --- a/vpplink/binapi/vppapi/vlib/vlib.ba.go +++ b/vpplink/binapi/vppapi/vlib/vlib.ba.go @@ -89,7 +89,7 @@ func (*AddNodeNextReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *AddNodeNextReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *AddNodeNextReply) Size() (size int) { @@ -201,7 +201,7 @@ func (*CliInbandReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CliInbandReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CliInbandReply) Size() (size int) { @@ -241,7 +241,7 @@ func (*CliReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *CliReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *CliReply) Size() (size int) { @@ -317,7 +317,7 @@ func (*GetF64EndianValueReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *GetF64EndianValueReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *GetF64EndianValueReply) Size() (size int) { @@ -393,7 +393,7 @@ func (*GetF64IncrementByOneReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *GetF64IncrementByOneReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *GetF64IncrementByOneReply) Size() (size int) { @@ -473,7 +473,7 @@ func (*GetNextIndexReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *GetNextIndexReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *GetNextIndexReply) Size() (size int) { @@ -543,7 +543,7 @@ func (*GetNodeGraphReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *GetNodeGraphReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *GetNodeGraphReply) Size() (size int) { @@ -619,7 +619,7 @@ func (*GetNodeIndexReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *GetNodeIndexReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *GetNodeIndexReply) Size() (size int) { @@ -690,7 +690,7 @@ func (*ShowThreadsReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *ShowThreadsReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *ShowThreadsReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/vmxnet3/vmxnet3.ba.go b/vpplink/binapi/vppapi/vmxnet3/vmxnet3.ba.go index c5a01bd8..2c23baea 100644 --- a/vpplink/binapi/vppapi/vmxnet3/vmxnet3.ba.go +++ b/vpplink/binapi/vppapi/vmxnet3/vmxnet3.ba.go @@ -289,7 +289,7 @@ func (*Vmxnet3CreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Vmxnet3CreateReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Vmxnet3CreateReply) Size() (size int) { @@ -364,7 +364,7 @@ func (*Vmxnet3DeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *Vmxnet3DeleteReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *Vmxnet3DeleteReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/vpe/vpe.ba.go b/vpplink/binapi/vppapi/vpe/vpe.ba.go index b60501b1..c679e498 100644 --- a/vpplink/binapi/vppapi/vpe/vpe.ba.go +++ b/vpplink/binapi/vppapi/vpe/vpe.ba.go @@ -155,7 +155,7 @@ func (*ShowVersionReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *ShowVersionReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *ShowVersionReply) Size() (size int) { @@ -234,7 +234,7 @@ func (*ShowVpeSystemTimeReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *ShowVpeSystemTimeReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *ShowVpeSystemTimeReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/vpe_types/vpe_types.ba.go b/vpplink/binapi/vppapi/vpe_types/vpe_types.ba.go index 271b8377..048a8abf 100644 --- a/vpplink/binapi/vppapi/vpe_types/vpe_types.ba.go +++ b/vpplink/binapi/vppapi/vpe_types/vpe_types.ba.go @@ -22,6 +22,12 @@ import ( // GoVPP api package needs to be updated. const _ = api.GoVppAPIPackageIsVersion2 +const ( + APIFile = "vpe_types" + APIVersion = "1.0.0" + VersionCrc = 0x5f754a1c +) + // LogLevel defines enum 'log_level'. type LogLevel uint32 diff --git a/vpplink/binapi/vppapi/vxlan.go b/vpplink/binapi/vppapi/vxlan.go new file mode 100644 index 00000000..71568d27 --- /dev/null +++ b/vpplink/binapi/vppapi/vxlan.go @@ -0,0 +1,95 @@ +// Copyright (C) 2020 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 vppapi + +import ( + "fmt" + types "git.fd.io/govpp.git/api/v0" + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/interface_types" + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/ip_types" + "github.com/pkg/errors" + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/vxlan" +) + +func (v *Vpp) ListVXLanTunnels() ([]types.VXLanTunnel, error) { + v.Lock() + defer v.Unlock() + + tunnels := make([]types.VXLanTunnel, 0) + request := &vxlan.VxlanTunnelV2Dump{ + SwIfIndex: interface_types.InterfaceIndex(InvalidInterface), + } + stream := v.GetChannel().SendMultiRequest(request) + for { + response := &vxlan.VxlanTunnelV2Details{} + stop, err := stream.ReceiveReply(response) + if err != nil { + return nil, errors.Wrapf(err, "error listing VXLan tunnels") + } + if stop { + break + } + tunnels = append(tunnels, types.VXLanTunnel{ + SrcAddress: response.SrcAddress.ToIP(), + DstAddress: response.DstAddress.ToIP(), + SrcPort: response.SrcPort, + DstPort: response.DstPort, + Vni: response.Vni, + DecapNextIndex: response.DecapNextIndex, + SwIfIndex: uint32(response.SwIfIndex), + }) + } + return tunnels, nil +} +func (v *Vpp) addDelVXLanTunnel(tunnel *types.VXLanTunnel, isAdd bool) (swIfIndex uint32, err error) { + v.Lock() + defer v.Unlock() + + response := &vxlan.VxlanAddDelTunnelV3Reply{} + request := &vxlan.VxlanAddDelTunnelV3{ + IsAdd: isAdd, + Instance: ^uint32(0), + SrcAddress: ip_types.AddressFromIP(tunnel.SrcAddress), + DstAddress: ip_types.AddressFromIP(tunnel.DstAddress), + SrcPort: tunnel.SrcPort, + DstPort: tunnel.DstPort, + Vni: tunnel.Vni, + DecapNextIndex: tunnel.DecapNextIndex, + IsL3: true, + } + err = v.GetChannel().SendRequest(request).ReceiveReply(response) + opStr := "Del" + if isAdd { + opStr = "Add" + } + if err != nil { + // TODO: return invalid interface here from types + return InvalidSwIfIndex, errors.Wrapf(err, "%s vxlan Tunnel failed", opStr) + } else if response.Retval != 0 { + return InvalidSwIfIndex, fmt.Errorf("%s vxlan Tunnel failed with retval %d", opStr, response.Retval) + } + tunnel.SwIfIndex = uint32(response.SwIfIndex) + return uint32(response.SwIfIndex), nil +} + +func (v *Vpp) AddVXLanTunnel(tunnel *types.VXLanTunnel) (swIfIndex uint32, err error) { + return v.addDelVXLanTunnel(tunnel, true) +} + +func (v *Vpp) DelVXLanTunnel(tunnel *types.VXLanTunnel) (err error) { + _, err = v.addDelVXLanTunnel(tunnel, false) + return err +} diff --git a/vpplink/binapi/vppapi/vxlan/vxlan.ba.go b/vpplink/binapi/vppapi/vxlan/vxlan.ba.go index feae805e..867156b4 100644 --- a/vpplink/binapi/vppapi/vxlan/vxlan.ba.go +++ b/vpplink/binapi/vppapi/vxlan/vxlan.ba.go @@ -84,7 +84,7 @@ func (*SwInterfaceSetVxlanBypassReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *SwInterfaceSetVxlanBypassReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *SwInterfaceSetVxlanBypassReply) Size() (size int) { @@ -191,7 +191,7 @@ func (*VxlanAddDelTunnelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *VxlanAddDelTunnelReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *VxlanAddDelTunnelReply) Size() (size int) { @@ -309,7 +309,7 @@ func (*VxlanAddDelTunnelV2Reply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *VxlanAddDelTunnelV2Reply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *VxlanAddDelTunnelV2Reply) Size() (size int) { @@ -431,7 +431,7 @@ func (*VxlanAddDelTunnelV3Reply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *VxlanAddDelTunnelV3Reply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *VxlanAddDelTunnelV3Reply) Size() (size int) { @@ -514,7 +514,7 @@ func (*VxlanOffloadRxReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *VxlanOffloadRxReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *VxlanOffloadRxReply) Size() (size int) { diff --git a/vpplink/binapi/vppapi/wireguard.go b/vpplink/binapi/vppapi/wireguard.go new file mode 100644 index 00000000..d552d144 --- /dev/null +++ b/vpplink/binapi/vppapi/wireguard.go @@ -0,0 +1,200 @@ +// Copyright (C) 2020 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 vppapi + +import ( + "fmt" + "net" + + "github.com/pkg/errors" + types "git.fd.io/govpp.git/api/v0" + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/interface_types" + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/ip_types" + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/wireguard" +) + +func (v *Vpp) ListWireguardTunnels() ([]*types.WireguardTunnel, error) { + tunnels, err := v.listWireguardTunnels(interface_types.InterfaceIndex(InvalidInterface)) + return tunnels, err +} + +func (v *Vpp) GetWireguardTunnel(swIfIndex uint32) (*types.WireguardTunnel, error) { + tunnels, err := v.listWireguardTunnels(interface_types.InterfaceIndex(swIfIndex)) + if err != nil { + return nil, err + } + if len(tunnels) != 1 { + return nil, errors.Errorf("Found %d Wireguard tunnels for swIfIndex %d", len(tunnels), swIfIndex) + } + return tunnels[0], nil +} + +func (v *Vpp) listWireguardTunnels(swIfIndex interface_types.InterfaceIndex) ([]*types.WireguardTunnel, error) { + v.Lock() + defer v.Unlock() + + tunnels := make([]*types.WireguardTunnel, 0) + request := &wireguard.WireguardInterfaceDump{ + ShowPrivateKey: false, + SwIfIndex: swIfIndex, + } + stream := v.GetChannel().SendMultiRequest(request) + for { + response := &wireguard.WireguardInterfaceDetails{} + stop, err := stream.ReceiveReply(response) + if err != nil { + return nil, errors.Wrapf(err, "error listing Wireguard tunnels") + } + if stop { + break + } + tunnels = append(tunnels, &types.WireguardTunnel{ + Port: response.Interface.Port, + Addr: response.Interface.SrcIP.ToIP(), + SwIfIndex: uint32(response.Interface.SwIfIndex), + PublicKey: response.Interface.PublicKey, + }) + } + return tunnels, nil +} + +func (v *Vpp) AddWireguardTunnel(tunnel *types.WireguardTunnel) (uint32, error) { + v.Lock() + defer v.Unlock() + + response := &wireguard.WireguardInterfaceCreateReply{} + request := &wireguard.WireguardInterfaceCreate{ + GenerateKey: true, + Interface: wireguard.WireguardInterface{ + UserInstance: ^uint32(0), + SwIfIndex: interface_types.InterfaceIndex(InvalidInterface), + Port: tunnel.Port, + SrcIP: ip_types.AddressFromIP(tunnel.Addr), + PrivateKey: tunnel.PrivateKey, + PublicKey: tunnel.PublicKey, + }, + } + err := v.GetChannel().SendRequest(request).ReceiveReply(response) + if err != nil { + return ^uint32(1), errors.Wrap(err, "Add Wireguard Tunnel failed") + } else if response.Retval != 0 { + return ^uint32(1), fmt.Errorf("Add Wireguard Tunnel failed with retval %d", response.Retval) + } + tunnel.SwIfIndex = uint32(response.SwIfIndex) + return uint32(response.SwIfIndex), nil +} + +func (v *Vpp) DelWireguardTunnel(tunnel *types.WireguardTunnel) (err error) { + v.Lock() + defer v.Unlock() + + response := &wireguard.WireguardInterfaceDeleteReply{} + request := &wireguard.WireguardInterfaceDelete{ + SwIfIndex: interface_types.InterfaceIndex(tunnel.SwIfIndex), + } + err = v.GetChannel().SendRequest(request).ReceiveReply(response) + if err != nil { + return errors.Wrapf(err, "Del Wireguard Tunnel %s failed", tunnel.String()) + } else if response.Retval != 0 { + return fmt.Errorf("Del Wireguard Tunnel %s failed with retval %d", tunnel.String(), response.Retval) + } + return nil +} + +func (v *Vpp) ListWireguardPeers() ([]*types.WireguardPeer, error) { + v.Lock() + defer v.Unlock() + + tunnels := make([]*types.WireguardPeer, 0) + request := &wireguard.WireguardPeersDump{} + stream := v.GetChannel().SendMultiRequest(request) + for { + response := &wireguard.WireguardPeersDetails{} + stop, err := stream.ReceiveReply(response) + if err != nil { + return nil, errors.Wrapf(err, "error listing Wireguard peers") + } + if stop { + break + } + allowedIps := make([]net.IPNet, 0) + for _, aip := range response.Peer.AllowedIps { + allowedIps = append(allowedIps, *FromVppPrefix(aip)) + } + tunnels = append(tunnels, &types.WireguardPeer{ + Port: response.Peer.Port, + PersistentKeepalive: int(response.Peer.PersistentKeepalive), + TableID: response.Peer.TableID, + Addr: response.Peer.Endpoint.ToIP(), + SwIfIndex: uint32(response.Peer.SwIfIndex), + PublicKey: response.Peer.PublicKey, + AllowedIps: allowedIps, + }) + } + return tunnels, nil +} + +func (v *Vpp) AddWireguardPeer(peer *types.WireguardPeer) (uint32, error) { + v.Lock() + defer v.Unlock() + + allowedIps := make([]ip_types.Prefix, 0) + for _, aip := range peer.AllowedIps { + allowedIps = append(allowedIps, ToVppPrefix(&aip)) + } + ka := uint16(peer.PersistentKeepalive) + if ka == 0 { + ka = 1 /* default to 1 */ + } + + response := &wireguard.WireguardPeerAddReply{} + request := &wireguard.WireguardPeerAdd{ + Peer: wireguard.WireguardPeer{ + PublicKey: peer.PublicKey, + Port: peer.Port, + PersistentKeepalive: ka, + TableID: peer.TableID, + Endpoint: ip_types.AddressFromIP(peer.Addr), + SwIfIndex: interface_types.InterfaceIndex(peer.SwIfIndex), + AllowedIps: allowedIps, + }, + } + err := v.GetChannel().SendRequest(request).ReceiveReply(response) + if err != nil { + return ^uint32(1), errors.Wrap(err, "Add Wireguard Peer failed") + } else if response.Retval != 0 { + return ^uint32(1), fmt.Errorf("Add Wireguard Peer failed with retval %d", response.Retval) + } + peer.Index = uint32(response.PeerIndex) + return uint32(response.PeerIndex), nil +} + +func (v *Vpp) DelWireguardPeer(peer *types.WireguardPeer) (err error) { + v.Lock() + defer v.Unlock() + + response := &wireguard.WireguardPeerRemoveReply{} + request := &wireguard.WireguardPeerRemove{ + PeerIndex: uint32(peer.Index), + } + err = v.GetChannel().SendRequest(request).ReceiveReply(response) + if err != nil { + return errors.Wrapf(err, "Del Wireguard Peer Tunnel %s failed", peer.String()) + } else if response.Retval != 0 { + return fmt.Errorf("Del Wireguard Peer Tunnel %s failed with retval %d", peer.String(), response.Retval) + } + return nil +} diff --git a/vpplink/binapi/vppapi/wireguard/wireguard.ba.go b/vpplink/binapi/vppapi/wireguard/wireguard.ba.go index 7f078d52..f76f0a21 100644 --- a/vpplink/binapi/vppapi/wireguard/wireguard.ba.go +++ b/vpplink/binapi/vppapi/wireguard/wireguard.ba.go @@ -163,7 +163,7 @@ func (*WantWireguardPeerEventsReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *WantWireguardPeerEventsReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *WantWireguardPeerEventsReply) Size() (size int) { @@ -237,7 +237,7 @@ func (*WgSetAsyncModeReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *WgSetAsyncModeReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *WgSetAsyncModeReply) Size() (size int) { @@ -338,7 +338,7 @@ func (*WireguardInterfaceCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *WireguardInterfaceCreateReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *WireguardInterfaceCreateReply) Size() (size int) { @@ -417,7 +417,7 @@ func (*WireguardInterfaceDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *WireguardInterfaceDeleteReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *WireguardInterfaceDeleteReply) Size() (size int) { @@ -640,7 +640,7 @@ func (*WireguardPeerAddReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *WireguardPeerAddReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *WireguardPeerAddReply) Size() (size int) { @@ -762,7 +762,7 @@ func (*WireguardPeerRemoveReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *WireguardPeerRemoveReply) GetRetVal() error { - return api.RetvalToVPPApiError(m.Retval) + return api.RetvalToVPPApiError(int32(m.Retval)) } func (m *WireguardPeerRemoveReply) Size() (size int) { diff --git a/vpplink/cnat.go b/vpplink/cnat.go index 7608db9c..3fb19971 100644 --- a/vpplink/cnat.go +++ b/vpplink/cnat.go @@ -17,6 +17,7 @@ package vpplink import ( "fmt" + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi" "net" "github.com/pkg/errors" @@ -110,7 +111,7 @@ func (v *VppLink) CnatSetSnatAddresses(v4, v6 net.IP) (err error) { request := &cnat.CnatSetSnatAddresses{ SnatIP4: types.ToVppIP4Address(v4), SnatIP6: types.ToVppIP6Address(v6), - SwIfIndex: types.InvalidInterface, + SwIfIndex: vppapi.InvalidInterface, } response := &cnat.CnatSetSnatAddressesReply{} err = v.GetChannel().SendRequest(request).ReceiveReply(response) diff --git a/vpplink/helpers.go b/vpplink/helpers.go index 4ec05f7c..805e32d6 100644 --- a/vpplink/helpers.go +++ b/vpplink/helpers.go @@ -17,8 +17,8 @@ package vpplink import ( "net" - "time" "reflect" + "time" "github.com/pkg/errors" @@ -26,10 +26,10 @@ import ( ) type IpFamily struct { - Str string + Str string ShortStr string - IsIp6 bool - IsIp4 bool + IsIp6 bool + IsIp4 bool } var ( @@ -125,3 +125,11 @@ func IsAddToStr(isAdd bool) string { return "delete" } } + +func DefaultIntTo(value, defaultValue int) int { + if value == 0 { + return defaultValue + } else { + return value + } +} diff --git a/vpplink/types/cnat.go b/vpplink/types/cnat.go index 4cbb92d9..e8f442d1 100644 --- a/vpplink/types/cnat.go +++ b/vpplink/types/cnat.go @@ -17,6 +17,7 @@ package types import ( "fmt" + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi" "net" "strings" @@ -140,7 +141,7 @@ func ToCnatEndpoint(ep CnatEndpoint) cnat.CnatEndpoint { return cnat.CnatEndpoint{ Port: ep.Port, Addr: ToVppAddress(ep.IP), - SwIfIndex: InvalidInterface, + SwIfIndex: vppapi.InvalidInterface, } } diff --git a/vpplink/types/vpp_interface.go b/vpplink/types/vpp_interface.go index cf555215..d004f3dc 100644 --- a/vpplink/types/vpp_interface.go +++ b/vpplink/types/vpp_interface.go @@ -22,23 +22,6 @@ import ( "strconv" "github.com/pkg/errors" - "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/interface_types" -) - -type RxMode uint32 - -const ( - InvalidInterface = interface_types.InterfaceIndex(^uint32(0)) -) - -const ( - UnknownRxMode RxMode = 0 - Polling RxMode = 1 - Interrupt RxMode = 2 - Adaptative RxMode = 3 - DefaultRxMode RxMode = 4 - - AllQueues = ^uint32(0) ) type GenericVppInterface struct { @@ -53,26 +36,6 @@ type GenericVppInterface struct { SwIfIndex uint32 } -type VppInterfaceDetails struct { - SwIfIndex uint32 - IsUp bool - Name string - Tag string - Type string -} - -type TapFlags uint32 - -const ( - TapFlagNone TapFlags = 0 - TapFlagGSO TapFlags = 1 - TapFlagCsumOffload TapFlags = 2 - TapFlagPersist TapFlags = 4 - TapFlagAttach TapFlags = 8 - TapFlagTun TapFlags = 16 - TapGROCoalesce TapFlags = 32 -) - type VppXDPInterface struct { GenericVppInterface } @@ -101,15 +64,6 @@ type RDMAInterface struct { GenericVppInterface } -type TapV2 struct { - GenericVppInterface - HostNamespace string - Tag string - HostMacAddress net.HardwareAddr - Flags TapFlags - HostMtu int -} - func GetPciIdInt(PciIdStr string) (id uint32, err error) { /* 0000:d8:00.1 */ re := regexp.MustCompile("([0-9a-f]{4}):([0-9a-f]{2}):([0-9a-f]{2}).([0-9a-f])") @@ -144,29 +98,3 @@ func GetPciIdInt(PciIdStr string) (id uint32, err error) { id = binary.LittleEndian.Uint32(b) return id, nil } - -func UnformatRxMode(str string) RxMode { - switch str { - case "interrupt": - return Interrupt - case "polling": - return Polling - case "adaptive": - return Adaptative - default: - return UnknownRxMode - } -} - -func FormatRxMode(rxMode RxMode) string { - switch rxMode { - case Interrupt: - return "interrupt" - case Polling: - return "polling" - case Adaptative: - return "adaptive" - default: - return "default" - } -} diff --git a/vpplink/vmxnet3.go b/vpplink/vmxnet3.go index 5da642bb..4d9802f5 100644 --- a/vpplink/vmxnet3.go +++ b/vpplink/vmxnet3.go @@ -17,6 +17,7 @@ package vpplink import ( "fmt" + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi" "github.com/pkg/errors" "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/vmxnet3" @@ -29,7 +30,7 @@ func (v *VppLink) CreateVmxnet3(intf *types.Vmxnet3Interface) (swIfIndex uint32, response := &vmxnet3.Vmxnet3CreateReply{} pci, err := types.GetPciIdInt(intf.PciId) if err != nil { - return INVALID_SW_IF_INDEX, errors.Wrapf(err, "CreateVmxnet3 error parsing PCI id") + return vppapi.InvalidSwIfIndex, errors.Wrapf(err, "CreateVmxnet3 error parsing PCI id") } request := &vmxnet3.Vmxnet3Create{ PciAddr: pci, diff --git a/vpplink/vxlan.go b/vpplink/vxlan.go index 37dcf512..a8c417fe 100644 --- a/vpplink/vxlan.go +++ b/vpplink/vxlan.go @@ -17,6 +17,7 @@ package vpplink import ( "fmt" + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi" "github.com/pkg/errors" "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi/vxlan" @@ -29,7 +30,7 @@ func (v *VppLink) ListVXLanTunnels() ([]types.VXLanTunnel, error) { tunnels := make([]types.VXLanTunnel, 0) request := &vxlan.VxlanTunnelV2Dump{ - SwIfIndex: types.InvalidInterface, + SwIfIndex: vppapi.InvalidInterface, } stream := v.GetChannel().SendMultiRequest(request) for { diff --git a/vpplink/wireguard.go b/vpplink/wireguard.go index b7dbfad3..00819cf1 100644 --- a/vpplink/wireguard.go +++ b/vpplink/wireguard.go @@ -17,6 +17,7 @@ package vpplink import ( "fmt" + "github.com/projectcalico/vpp-dataplane/vpplink/binapi/vppapi" "net" "github.com/pkg/errors" @@ -27,7 +28,7 @@ import ( ) func (v *VppLink) ListWireguardTunnels() ([]*types.WireguardTunnel, error) { - tunnels, err := v.listWireguardTunnels(types.InvalidInterface) + tunnels, err := v.listWireguardTunnels(vppapi.InvalidInterface) return tunnels, err } @@ -80,7 +81,7 @@ func (v *VppLink) AddWireguardTunnel(tunnel *types.WireguardTunnel) (uint32, err GenerateKey: true, Interface: wireguard.WireguardInterface{ UserInstance: ^uint32(0), - SwIfIndex: types.InvalidInterface, + SwIfIndex: vppapi.InvalidInterface, Port: tunnel.Port, SrcIP: types.ToVppAddress(tunnel.Addr), PrivateKey: tunnel.PrivateKey,