summaryrefslogtreecommitdiffstats
path: root/internal/testbinapi/binapi2001/interface
diff options
context:
space:
mode:
Diffstat (limited to 'internal/testbinapi/binapi2001/interface')
-rw-r--r--internal/testbinapi/binapi2001/interface/interface.ba.go47
-rw-r--r--internal/testbinapi/binapi2001/interface/interface_rpc.ba.go61
2 files changed, 76 insertions, 32 deletions
diff --git a/internal/testbinapi/binapi2001/interface/interface.ba.go b/internal/testbinapi/binapi2001/interface/interface.ba.go
index 94a33b8..a28c261 100644
--- a/internal/testbinapi/binapi2001/interface/interface.ba.go
+++ b/internal/testbinapi/binapi2001/interface/interface.ba.go
@@ -1,6 +1,6 @@
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
-// binapi-generator: v0.4.0-dev
+// binapi-generator: v0.5.0-dev
// VPP: 20.01
// source: .vppapi/core/interface.api.json
@@ -17,11 +17,12 @@ package interfaces
import (
"fmt"
- api "git.fd.io/govpp.git/api"
- codec "git.fd.io/govpp.git/codec"
"net"
"strconv"
"strings"
+
+ api "git.fd.io/govpp.git/api"
+ codec "git.fd.io/govpp.git/codec"
)
// This is a compile-time assertion to ensure that this generated file
@@ -498,12 +499,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 {
@@ -532,12 +536,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 {
@@ -566,12 +573,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 {
@@ -596,15 +606,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 {
@@ -625,6 +639,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
@@ -637,8 +655,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()
@@ -648,12 +667,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 {
@@ -696,18 +718,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 {
@@ -750,18 +776,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 {
@@ -812,6 +842,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 {
@@ -822,13 +853,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 {
@@ -846,8 +880,9 @@ type PrefixMatcher struct {
// AddressUnion defines union 'address_union'.
type AddressUnion struct {
- // IP4 *IP4Address
- // IP6 *IP6Address
+ // AddressUnion can be one of:
+ // - IP4 *IP4Address
+ // - IP6 *IP6Address
XXX_UnionData [16]byte
}
diff --git a/internal/testbinapi/binapi2001/interface/interface_rpc.ba.go b/internal/testbinapi/binapi2001/interface/interface_rpc.ba.go
index f12e6eb..d7ae7c5 100644
--- a/internal/testbinapi/binapi2001/interface/interface_rpc.ba.go
+++ b/internal/testbinapi/binapi2001/interface/interface_rpc.ba.go
@@ -5,12 +5,13 @@ package interfaces
import (
"context"
"fmt"
+ "io"
+
api "git.fd.io/govpp.git/api"
vpe "git.fd.io/govpp.git/internal/testbinapi/binapi2001/vpe"
- "io"
)
-// RPCService defines RPC service interface.
+// RPCService defines RPC service interface.
type RPCService interface {
CollectDetailedInterfaceStats(ctx context.Context, in *CollectDetailedInterfaceStats) (*CollectDetailedInterfaceStatsReply, error)
CreateLoopback(ctx context.Context, in *CreateLoopback) (*CreateLoopbackReply, error)
@@ -54,7 +55,7 @@ func (c *serviceClient) CollectDetailedInterfaceStats(ctx context.Context, in *C
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) CreateLoopback(ctx context.Context, in *CreateLoopback) (*CreateLoopbackReply, error) {
@@ -63,7 +64,7 @@ func (c *serviceClient) CreateLoopback(ctx context.Context, in *CreateLoopback)
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) CreateLoopbackInstance(ctx context.Context, in *CreateLoopbackInstance) (*CreateLoopbackInstanceReply, error) {
@@ -72,7 +73,7 @@ func (c *serviceClient) CreateLoopbackInstance(ctx context.Context, in *CreateLo
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) CreateSubif(ctx context.Context, in *CreateSubif) (*CreateSubifReply, error) {
@@ -81,7 +82,7 @@ func (c *serviceClient) CreateSubif(ctx context.Context, in *CreateSubif) (*Crea
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) CreateVlanSubif(ctx context.Context, in *CreateVlanSubif) (*CreateVlanSubifReply, error) {
@@ -90,7 +91,7 @@ func (c *serviceClient) CreateVlanSubif(ctx context.Context, in *CreateVlanSubif
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) DeleteLoopback(ctx context.Context, in *DeleteLoopback) (*DeleteLoopbackReply, error) {
@@ -99,7 +100,7 @@ func (c *serviceClient) DeleteLoopback(ctx context.Context, in *DeleteLoopback)
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) DeleteSubif(ctx context.Context, in *DeleteSubif) (*DeleteSubifReply, error) {
@@ -108,7 +109,7 @@ func (c *serviceClient) DeleteSubif(ctx context.Context, in *DeleteSubif) (*Dele
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) HwInterfaceSetMtu(ctx context.Context, in *HwInterfaceSetMtu) (*HwInterfaceSetMtuReply, error) {
@@ -117,7 +118,7 @@ func (c *serviceClient) HwInterfaceSetMtu(ctx context.Context, in *HwInterfaceSe
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) InterfaceNameRenumber(ctx context.Context, in *InterfaceNameRenumber) (*InterfaceNameRenumberReply, error) {
@@ -126,7 +127,7 @@ func (c *serviceClient) InterfaceNameRenumber(ctx context.Context, in *Interface
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) SwInterfaceAddDelAddress(ctx context.Context, in *SwInterfaceAddDelAddress) (*SwInterfaceAddDelAddressReply, error) {
@@ -135,7 +136,7 @@ func (c *serviceClient) SwInterfaceAddDelAddress(ctx context.Context, in *SwInte
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) SwInterfaceAddDelMacAddress(ctx context.Context, in *SwInterfaceAddDelMacAddress) (*SwInterfaceAddDelMacAddressReply, error) {
@@ -144,7 +145,7 @@ func (c *serviceClient) SwInterfaceAddDelMacAddress(ctx context.Context, in *SwI
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) SwInterfaceClearStats(ctx context.Context, in *SwInterfaceClearStats) (*SwInterfaceClearStatsReply, error) {
@@ -153,7 +154,7 @@ func (c *serviceClient) SwInterfaceClearStats(ctx context.Context, in *SwInterfa
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) SwInterfaceDump(ctx context.Context, in *SwInterfaceDump) (RPCService_SwInterfaceDumpClient, error) {
@@ -189,6 +190,10 @@ func (c *serviceClient_SwInterfaceDumpClient) Recv() (*SwInterfaceDetails, error
case *SwInterfaceDetails:
return m, nil
case *vpe.ControlPingReply:
+ err = c.Stream.Close()
+ if err != nil {
+ return nil, err
+ }
return nil, io.EOF
default:
return nil, fmt.Errorf("unexpected message: %T %v", m, m)
@@ -201,7 +206,7 @@ func (c *serviceClient) SwInterfaceGetMacAddress(ctx context.Context, in *SwInte
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) SwInterfaceGetTable(ctx context.Context, in *SwInterfaceGetTable) (*SwInterfaceGetTableReply, error) {
@@ -210,7 +215,7 @@ func (c *serviceClient) SwInterfaceGetTable(ctx context.Context, in *SwInterface
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) SwInterfaceRxPlacementDump(ctx context.Context, in *SwInterfaceRxPlacementDump) (RPCService_SwInterfaceRxPlacementDumpClient, error) {
@@ -246,6 +251,10 @@ func (c *serviceClient_SwInterfaceRxPlacementDumpClient) Recv() (*SwInterfaceRxP
case *SwInterfaceRxPlacementDetails:
return m, nil
case *vpe.ControlPingReply:
+ err = c.Stream.Close()
+ if err != nil {
+ return nil, err
+ }
return nil, io.EOF
default:
return nil, fmt.Errorf("unexpected message: %T %v", m, m)
@@ -258,7 +267,7 @@ func (c *serviceClient) SwInterfaceSetFlags(ctx context.Context, in *SwInterface
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) SwInterfaceSetIPDirectedBroadcast(ctx context.Context, in *SwInterfaceSetIPDirectedBroadcast) (*SwInterfaceSetIPDirectedBroadcastReply, error) {
@@ -267,7 +276,7 @@ func (c *serviceClient) SwInterfaceSetIPDirectedBroadcast(ctx context.Context, i
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) SwInterfaceSetMacAddress(ctx context.Context, in *SwInterfaceSetMacAddress) (*SwInterfaceSetMacAddressReply, error) {
@@ -276,7 +285,7 @@ func (c *serviceClient) SwInterfaceSetMacAddress(ctx context.Context, in *SwInte
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) SwInterfaceSetMtu(ctx context.Context, in *SwInterfaceSetMtu) (*SwInterfaceSetMtuReply, error) {
@@ -285,7 +294,7 @@ func (c *serviceClient) SwInterfaceSetMtu(ctx context.Context, in *SwInterfaceSe
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) SwInterfaceSetRxMode(ctx context.Context, in *SwInterfaceSetRxMode) (*SwInterfaceSetRxModeReply, error) {
@@ -294,7 +303,7 @@ func (c *serviceClient) SwInterfaceSetRxMode(ctx context.Context, in *SwInterfac
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) SwInterfaceSetRxPlacement(ctx context.Context, in *SwInterfaceSetRxPlacement) (*SwInterfaceSetRxPlacementReply, error) {
@@ -303,7 +312,7 @@ func (c *serviceClient) SwInterfaceSetRxPlacement(ctx context.Context, in *SwInt
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) SwInterfaceSetTable(ctx context.Context, in *SwInterfaceSetTable) (*SwInterfaceSetTableReply, error) {
@@ -312,7 +321,7 @@ func (c *serviceClient) SwInterfaceSetTable(ctx context.Context, in *SwInterface
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) SwInterfaceSetUnnumbered(ctx context.Context, in *SwInterfaceSetUnnumbered) (*SwInterfaceSetUnnumberedReply, error) {
@@ -321,7 +330,7 @@ func (c *serviceClient) SwInterfaceSetUnnumbered(ctx context.Context, in *SwInte
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) SwInterfaceTagAddDel(ctx context.Context, in *SwInterfaceTagAddDel) (*SwInterfaceTagAddDelReply, error) {
@@ -330,7 +339,7 @@ func (c *serviceClient) SwInterfaceTagAddDel(ctx context.Context, in *SwInterfac
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}
func (c *serviceClient) WantInterfaceEvents(ctx context.Context, in *WantInterfaceEvents) (*WantInterfaceEventsReply, error) {
@@ -339,5 +348,5 @@ func (c *serviceClient) WantInterfaceEvents(ctx context.Context, in *WantInterfa
if err != nil {
return nil, err
}
- return out, nil
+ return out, api.RetvalToVPPApiError(out.Retval)
}