summaryrefslogtreecommitdiffstats
path: root/internal/testbinapi/binapi2001/ip/ip.ba.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/testbinapi/binapi2001/ip/ip.ba.go')
-rw-r--r--internal/testbinapi/binapi2001/ip/ip.ba.go5951
1 files changed, 2126 insertions, 3825 deletions
diff --git a/internal/testbinapi/binapi2001/ip/ip.ba.go b/internal/testbinapi/binapi2001/ip/ip.ba.go
index ca717ca..1b0b6b2 100644
--- a/internal/testbinapi/binapi2001/ip/ip.ba.go
+++ b/internal/testbinapi/binapi2001/ip/ip.ba.go
@@ -1,50 +1,42 @@
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
// binapi-generator: v0.4.0-dev
-// VPP: 20.01-45~g7a071e370~b63
-// source: /usr/share/vpp/api/core/ip.api.json
-
-/*
-Package ip contains generated code for VPP binary API defined by ip.api (version 3.0.1).
-
-It consists of:
- 7 aliases
- 15 enums
- 60 messages
- 14 types
- 1 union
-*/
+// VPP: 20.01
+// source: .vppapi/core/ip.api.json
+
+// Package ip contains generated bindings for API file ip.api.
+//
+// Contents:
+// 7 aliases
+// 15 enums
+// 14 structs
+// 1 union
+// 60 messages
+//
package ip
import (
- "bytes"
- "context"
- "encoding/binary"
- "io"
- "math"
- "strconv"
-
+ "fmt"
api "git.fd.io/govpp.git/api"
codec "git.fd.io/govpp.git/codec"
- struc "github.com/lunixbochs/struc"
+ "net"
+ "strconv"
+ "strings"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the GoVPP api package it is being compiled against.
// A compilation error at this line likely means your copy of the
// GoVPP api package needs to be updated.
-const _ = api.GoVppAPIPackageIsVersion2 // please upgrade the GoVPP api package
+const _ = api.GoVppAPIPackageIsVersion2
const (
- // ModuleName is the name of this module.
- ModuleName = "ip"
- // APIVersion is the API version of this module.
+ APIFile = "ip"
APIVersion = "3.0.1"
- // VersionCrc is the CRC of this module.
VersionCrc = 0xfc3fea46
)
-// AddressFamily represents VPP binary API enum 'address_family'.
+// AddressFamily defines enum 'address_family'.
type AddressFamily uint32
const (
@@ -71,7 +63,7 @@ func (x AddressFamily) String() string {
return "AddressFamily(" + strconv.Itoa(int(x)) + ")"
}
-// FibPathFlags represents VPP binary API enum 'fib_path_flags'.
+// FibPathFlags defines enum 'fib_path_flags'.
type FibPathFlags uint32
const (
@@ -101,10 +93,29 @@ func (x FibPathFlags) String() string {
if ok {
return s
}
- return "FibPathFlags(" + strconv.Itoa(int(x)) + ")"
+ str := func(n uint32) string {
+ s, ok := FibPathFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "FibPathFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
}
-// FibPathNhProto represents VPP binary API enum 'fib_path_nh_proto'.
+// FibPathNhProto defines enum 'fib_path_nh_proto'.
type FibPathNhProto uint32
const (
@@ -140,7 +151,7 @@ func (x FibPathNhProto) String() string {
return "FibPathNhProto(" + strconv.Itoa(int(x)) + ")"
}
-// FibPathType represents VPP binary API enum 'fib_path_type'.
+// FibPathType defines enum 'fib_path_type'.
type FibPathType uint32
const (
@@ -194,7 +205,7 @@ func (x FibPathType) String() string {
return "FibPathType(" + strconv.Itoa(int(x)) + ")"
}
-// IfStatusFlags represents VPP binary API enum 'if_status_flags'.
+// IfStatusFlags defines enum 'if_status_flags'.
type IfStatusFlags uint32
const (
@@ -218,10 +229,29 @@ func (x IfStatusFlags) String() string {
if ok {
return s
}
- return "IfStatusFlags(" + strconv.Itoa(int(x)) + ")"
+ str := func(n uint32) string {
+ s, ok := IfStatusFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
}
-// IfType represents VPP binary API enum 'if_type'.
+// IfType defines enum 'if_type'.
type IfType uint32
const (
@@ -254,7 +284,7 @@ func (x IfType) String() string {
return "IfType(" + strconv.Itoa(int(x)) + ")"
}
-// IPDscp represents VPP binary API enum 'ip_dscp'.
+// IPDscp defines enum 'ip_dscp'.
type IPDscp uint8
const (
@@ -338,7 +368,7 @@ func (x IPDscp) String() string {
return "IPDscp(" + strconv.Itoa(int(x)) + ")"
}
-// IPEcn represents VPP binary API enum 'ip_ecn'.
+// IPEcn defines enum 'ip_ecn'.
type IPEcn uint8
const (
@@ -371,7 +401,7 @@ func (x IPEcn) String() string {
return "IPEcn(" + strconv.Itoa(int(x)) + ")"
}
-// IPProto represents VPP binary API enum 'ip_proto'.
+// IPProto defines enum 'ip_proto'.
type IPProto uint32
const (
@@ -428,7 +458,7 @@ func (x IPProto) String() string {
return "IPProto(" + strconv.Itoa(int(x)) + ")"
}
-// IPReassType represents VPP binary API enum 'ip_reass_type'.
+// IPReassType defines enum 'ip_reass_type'.
type IPReassType uint32
const (
@@ -455,7 +485,7 @@ func (x IPReassType) String() string {
return "IPReassType(" + strconv.Itoa(int(x)) + ")"
}
-// LinkDuplex represents VPP binary API enum 'link_duplex'.
+// LinkDuplex defines enum 'link_duplex'.
type LinkDuplex uint32
const (
@@ -485,7 +515,7 @@ func (x LinkDuplex) String() string {
return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
}
-// MfibItfFlags represents VPP binary API enum 'mfib_itf_flags'.
+// MfibItfFlags defines enum 'mfib_itf_flags'.
type MfibItfFlags uint32
const (
@@ -521,10 +551,29 @@ func (x MfibItfFlags) String() string {
if ok {
return s
}
- return "MfibItfFlags(" + strconv.Itoa(int(x)) + ")"
+ str := func(n uint32) string {
+ s, ok := MfibItfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "MfibItfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
}
-// MtuProto represents VPP binary API enum 'mtu_proto'.
+// MtuProto defines enum 'mtu_proto'.
type MtuProto uint32
const (
@@ -560,7 +609,7 @@ func (x MtuProto) String() string {
return "MtuProto(" + strconv.Itoa(int(x)) + ")"
}
-// RxMode represents VPP binary API enum 'rx_mode'.
+// RxMode defines enum 'rx_mode'.
type RxMode uint32
const (
@@ -596,7 +645,7 @@ func (x RxMode) String() string {
return "RxMode(" + strconv.Itoa(int(x)) + ")"
}
-// SubIfFlags represents VPP binary API enum 'sub_if_flags'.
+// SubIfFlags defines enum 'sub_if_flags'.
type SubIfFlags uint32
const (
@@ -644,39 +693,204 @@ func (x SubIfFlags) String() string {
if ok {
return s
}
- return "SubIfFlags(" + strconv.Itoa(int(x)) + ")"
+ str := func(n uint32) string {
+ s, ok := SubIfFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
}
-// AddressWithPrefix represents VPP binary API alias 'address_with_prefix'.
+// AddressWithPrefix defines alias 'address_with_prefix'.
type AddressWithPrefix Prefix
-// InterfaceIndex represents VPP binary API alias 'interface_index'.
+func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
+ prefix, err := ParsePrefix(s)
+ if err != nil {
+ return AddressWithPrefix{}, err
+ }
+ 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 {
+ return err
+ }
+ *x = prefix
+ return nil
+}
+
+// InterfaceIndex defines alias 'interface_index'.
type InterfaceIndex uint32
-// IP4Address represents VPP binary API alias 'ip4_address'.
+// IP4Address defines alias 'ip4_address'.
type IP4Address [4]uint8
-// IP4AddressWithPrefix represents VPP binary API alias 'ip4_address_with_prefix'.
+func ParseIP4Address(s string) (IP4Address, error) {
+ ip := net.ParseIP(s).To4()
+ if ip == nil {
+ return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP4Address
+ copy(ipaddr[:], ip.To4())
+ return ipaddr, nil
+}
+
+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 {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
type IP4AddressWithPrefix IP4Prefix
-// IP6Address represents VPP binary API alias 'ip6_address'.
+// IP6Address defines alias 'ip6_address'.
type IP6Address [16]uint8
-// IP6AddressWithPrefix represents VPP binary API alias 'ip6_address_with_prefix'.
+func ParseIP6Address(s string) (IP6Address, error) {
+ ip := net.ParseIP(s).To16()
+ if ip == nil {
+ return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
+ }
+ var ipaddr IP6Address
+ copy(ipaddr[:], ip.To16())
+ return ipaddr, nil
+}
+
+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 {
+ return err
+ }
+ *x = ipaddr
+ return nil
+}
+
+// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
type IP6AddressWithPrefix IP6Prefix
-// MacAddress represents VPP binary API alias 'mac_address'.
+// MacAddress defines alias 'mac_address'.
type MacAddress [6]uint8
-// Address represents VPP binary API type 'address'.
+func ParseMacAddress(s string) (MacAddress, error) {
+ var macaddr MacAddress
+ mac, err := net.ParseMAC(s)
+ if err != nil {
+ return macaddr, err
+ }
+ 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 {
+ return err
+ }
+ *x = mac
+ return nil
+}
+
+// Address defines type 'address'.
type Address struct {
Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
}
-func (*Address) GetTypeName() string { return "address" }
+func ParseAddress(s string) (Address, error) {
+ ip := net.ParseIP(s)
+ if ip == nil {
+ return Address{}, fmt.Errorf("invalid address: %s", s)
+ }
+ var addr Address
+ if ip.To4() == nil {
+ addr.Af = ADDRESS_IP6
+ var ip6 IP6Address
+ copy(ip6[:], ip.To16())
+ addr.Un.SetIP6(ip6)
+ } else {
+ addr.Af = ADDRESS_IP4
+ var ip4 IP4Address
+ copy(ip4[:], ip.To4())
+ addr.Un.SetIP4(ip4)
+ }
+ return addr, nil
+}
+func (x Address) ToIP() net.IP {
+ if x.Af == ADDRESS_IP6 {
+ ip6 := x.Un.GetIP6()
+ return net.IP(ip6[:]).To16()
+ } else {
+ ip4 := x.Un.GetIP4()
+ 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 {
+ return err
+ }
+ *x = addr
+ return nil
+}
-// FibMplsLabel represents VPP binary API type 'fib_mpls_label'.
+// FibMplsLabel defines type 'fib_mpls_label'.
type FibMplsLabel struct {
IsUniform uint8 `binapi:"u8,name=is_uniform" json:"is_uniform,omitempty"`
Label uint32 `binapi:"u32,name=label" json:"label,omitempty"`
@@ -684,9 +898,7 @@ type FibMplsLabel struct {
Exp uint8 `binapi:"u8,name=exp" json:"exp,omitempty"`
}
-func (*FibMplsLabel) GetTypeName() string { return "fib_mpls_label" }
-
-// FibPath represents VPP binary API type 'fib_path'.
+// FibPath defines type 'fib_path'.
type FibPath struct {
SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
@@ -698,12 +910,10 @@ type FibPath struct {
Proto FibPathNhProto `binapi:"fib_path_nh_proto,name=proto" json:"proto,omitempty"`
Nh FibPathNh `binapi:"fib_path_nh,name=nh" json:"nh,omitempty"`
NLabels uint8 `binapi:"u8,name=n_labels" json:"n_labels,omitempty"`
- LabelStack [16]FibMplsLabel `binapi:"fib_mpls_label[16],name=label_stack" json:"label_stack,omitempty" struc:"[16]FibMplsLabel"`
+ LabelStack [16]FibMplsLabel `binapi:"fib_mpls_label[16],name=label_stack" json:"label_stack,omitempty"`
}
-func (*FibPath) GetTypeName() string { return "fib_path" }
-
-// FibPathNh represents VPP binary API type 'fib_path_nh'.
+// FibPathNh defines type 'fib_path_nh'.
type FibPathNh struct {
Address AddressUnion `binapi:"address_union,name=address" json:"address,omitempty"`
ViaLabel uint32 `binapi:"u32,name=via_label" json:"via_label,omitempty"`
@@ -711,65 +921,147 @@ type FibPathNh struct {
ClassifyTableIndex uint32 `binapi:"u32,name=classify_table_index" json:"classify_table_index,omitempty"`
}
-func (*FibPathNh) GetTypeName() string { return "fib_path_nh" }
-
-// IP4Prefix represents VPP binary API type 'ip4_prefix'.
+// IP4Prefix defines type 'ip4_prefix'.
type IP4Prefix struct {
Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
}
-func (*IP4Prefix) GetTypeName() string { return "ip4_prefix" }
+func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP4Address(ip.String())
+ if err != nil {
+ return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ 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 {
+ return err
+ }
+ *x = prefix
+ return nil
+}
-// IP6Prefix represents VPP binary API type 'ip6_prefix'.
+// IP6Prefix defines type 'ip6_prefix'.
type IP6Prefix struct {
Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
}
-func (*IP6Prefix) GetTypeName() string { return "ip6_prefix" }
+func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
+ hasPrefix := strings.Contains(s, "/")
+ if hasPrefix {
+ ip, network, err := net.ParseCIDR(s)
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ } else {
+ ip := net.ParseIP(s)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if ip.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseIP6Address(ip.String())
+ if err != nil {
+ return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
+ }
+ }
+ 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 {
+ return err
+ }
+ *x = prefix
+ return nil
+}
-// IPMroute represents VPP binary API type 'ip_mroute'.
+// IPMroute defines type 'ip_mroute'.
type IPMroute struct {
TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
EntryFlags uint32 `binapi:"u32,name=entry_flags" json:"entry_flags,omitempty"`
RpfID uint32 `binapi:"u32,name=rpf_id" json:"rpf_id,omitempty"`
Prefix Mprefix `binapi:"mprefix,name=prefix" json:"prefix,omitempty"`
- NPaths uint8 `binapi:"u8,name=n_paths" json:"n_paths,omitempty" struc:"sizeof=Paths"`
+ NPaths uint8 `binapi:"u8,name=n_paths" json:"-"`
Paths []MfibPath `binapi:"mfib_path[n_paths],name=paths" json:"paths,omitempty"`
}
-func (*IPMroute) GetTypeName() string { return "ip_mroute" }
-
-// IPRoute represents VPP binary API type 'ip_route'.
+// IPRoute defines type 'ip_route'.
type IPRoute struct {
TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"`
Prefix Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
- NPaths uint8 `binapi:"u8,name=n_paths" json:"n_paths,omitempty" struc:"sizeof=Paths"`
+ NPaths uint8 `binapi:"u8,name=n_paths" json:"-"`
Paths []FibPath `binapi:"fib_path[n_paths],name=paths" json:"paths,omitempty"`
}
-func (*IPRoute) GetTypeName() string { return "ip_route" }
-
-// IPTable represents VPP binary API type 'ip_table'.
+// IPTable defines type 'ip_table'.
type IPTable struct {
TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"`
- Name string `binapi:"string[64],name=name" json:"name,omitempty" struc:"[64]byte"`
+ Name string `binapi:"string[64],name=name" json:"name,omitempty"`
}
-func (*IPTable) GetTypeName() string { return "ip_table" }
-
-// MfibPath represents VPP binary API type 'mfib_path'.
+// MfibPath defines type 'mfib_path'.
type MfibPath struct {
ItfFlags MfibItfFlags `binapi:"mfib_itf_flags,name=itf_flags" json:"itf_flags,omitempty"`
Path FibPath `binapi:"fib_path,name=path" json:"path,omitempty"`
}
-func (*MfibPath) GetTypeName() string { return "mfib_path" }
-
-// Mprefix represents VPP binary API type 'mprefix'.
+// Mprefix defines type 'mprefix'.
type Mprefix struct {
Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
@@ -777,54 +1069,96 @@ type Mprefix struct {
SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
}
-func (*Mprefix) GetTypeName() string { return "mprefix" }
-
-// Prefix represents VPP binary API type 'prefix'.
+// Prefix defines type 'prefix'.
type Prefix struct {
Address Address `binapi:"address,name=address" json:"address,omitempty"`
Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
}
-func (*Prefix) GetTypeName() string { return "prefix" }
+func ParsePrefix(ip string) (prefix Prefix, err error) {
+ hasPrefix := strings.Contains(ip, "/")
+ if hasPrefix {
+ netIP, network, err := net.ParseCIDR(ip)
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ maskSize, _ := network.Mask.Size()
+ prefix.Len = byte(maskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ } else {
+ netIP := net.ParseIP(ip)
+ defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
+ if netIP.To4() == nil {
+ defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
+ }
+ prefix.Len = byte(defaultMaskSize)
+ prefix.Address, err = ParseAddress(netIP.String())
+ if err != nil {
+ return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
+ }
+ }
+ return prefix, nil
+}
+func (x Prefix) ToIPNet() *net.IPNet {
+ var mask net.IPMask
+ if x.Address.Af == ADDRESS_IP4 {
+ mask = net.CIDRMask(int(x.Len), 32)
+ } else {
+ mask = net.CIDRMask(int(x.Len), 128)
+ }
+ 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 {
+ return err
+ }
+ *x = prefix
+ return nil
+}
-// PrefixMatcher represents VPP binary API type 'prefix_matcher'.
+// PrefixMatcher defines type 'prefix_matcher'.
type PrefixMatcher struct {
Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
}
-func (*PrefixMatcher) GetTypeName() string { return "prefix_matcher" }
-
-// PuntRedirect represents VPP binary API type 'punt_redirect'.
+// PuntRedirect defines type 'punt_redirect'.
type PuntRedirect struct {
RxSwIfIndex InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
TxSwIfIndex InterfaceIndex `binapi:"interface_index,name=tx_sw_if_index" json:"tx_sw_if_index,omitempty"`
Nh Address `binapi:"address,name=nh" json:"nh,omitempty"`
}
-func (*PuntRedirect) GetTypeName() string { return "punt_redirect" }
-
-// AddressUnion represents VPP binary API union 'address_union'.
+// AddressUnion defines union 'address_union'.
type AddressUnion struct {
+ // IP4 *IP4Address
+ // IP6 *IP6Address
XXX_UnionData [16]byte
}
-func (*AddressUnion) GetTypeName() string { return "address_union" }
-
func AddressUnionIP4(a IP4Address) (u AddressUnion) {
u.SetIP4(a)
return
}
func (u *AddressUnion) SetIP4(a IP4Address) {
- var b = new(bytes.Buffer)
- if err := struc.Pack(b, &a); err != nil {
- return
- }
- copy(u.XXX_UnionData[:], b.Bytes())
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 4)
}
func (u *AddressUnion) GetIP4() (a IP4Address) {
- var b = bytes.NewReader(u.XXX_UnionData[:])
- struc.Unpack(b, &a)
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(4))
return
}
@@ -833,111 +1167,82 @@ func AddressUnionIP6(a IP6Address) (u AddressUnion) {
return
}
func (u *AddressUnion) SetIP6(a IP6Address) {
- var b = new(bytes.Buffer)
- if err := struc.Pack(b, &a); err != nil {
- return
- }
- copy(u.XXX_UnionData[:], b.Bytes())
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ buf.EncodeBytes(a[:], 16)
}
func (u *AddressUnion) GetIP6() (a IP6Address) {
- var b = bytes.NewReader(u.XXX_UnionData[:])
- struc.Unpack(b, &a)
+ buf := codec.NewBuffer(u.XXX_UnionData[:])
+ copy(a[:], buf.DecodeBytes(16))
return
}
-// IoamDisable represents VPP binary API message 'ioam_disable'.
+// IoamDisable defines message 'ioam_disable'.
type IoamDisable struct {
ID uint16 `binapi:"u16,name=id" json:"id,omitempty"`
}
-func (m *IoamDisable) Reset() { *m = IoamDisable{} }
-func (*IoamDisable) GetMessageName() string { return "ioam_disable" }
-func (*IoamDisable) GetCrcString() string { return "6b16a45e" }
-func (*IoamDisable) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IoamDisable) Reset() { *m = IoamDisable{} }
+func (*IoamDisable) GetMessageName() string { return "ioam_disable" }
+func (*IoamDisable) GetCrcString() string { return "6b16a45e" }
+func (*IoamDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IoamDisable) Size() int {
+func (m *IoamDisable) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.ID
- size += 2
+ size += 2 // m.ID
return size
}
func (m *IoamDisable) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.ID
- o.PutUint16(buf[pos:pos+2], uint16(m.ID))
- pos += 2
- return buf, nil
-}
-func (m *IoamDisable) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ID
- m.ID = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint16(m.ID)
+ return buf.Bytes(), nil
+}
+func (m *IoamDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ID = buf.DecodeUint16()
return nil
}
-// IoamDisableReply represents VPP binary API message 'ioam_disable_reply'.
+// IoamDisableReply defines message 'ioam_disable_reply'.
type IoamDisableReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *IoamDisableReply) Reset() { *m = IoamDisableReply{} }
-func (*IoamDisableReply) GetMessageName() string { return "ioam_disable_reply" }
-func (*IoamDisableReply) GetCrcString() string { return "e8d4e804" }
-func (*IoamDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IoamDisableReply) Reset() { *m = IoamDisableReply{} }
+func (*IoamDisableReply) GetMessageName() string { return "ioam_disable_reply" }
+func (*IoamDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*IoamDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IoamDisableReply) Size() int {
+func (m *IoamDisableReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IoamDisableReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IoamDisableReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *IoamDisableReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
return nil
}
-// IoamEnable represents VPP binary API message 'ioam_enable'.
+// IoamEnable defines message 'ioam_enable'.
type IoamEnable struct {
ID uint16 `binapi:"u16,name=id" json:"id,omitempty"`
Seqno bool `binapi:"bool,name=seqno" json:"seqno,omitempty"`
@@ -947,364 +1252,210 @@ type IoamEnable struct {
NodeID uint32 `binapi:"u32,name=node_id" json:"node_id,omitempty"`
}
-func (m *IoamEnable) Reset() { *m = IoamEnable{} }
-func (*IoamEnable) GetMessageName() string { return "ioam_enable" }
-func (*IoamEnable) GetCrcString() string { return "51ccd868" }
-func (*IoamEnable) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IoamEnable) Reset() { *m = IoamEnable{} }
+func (*IoamEnable) GetMessageName() string { return "ioam_enable" }
+func (*IoamEnable) GetCrcString() string { return "51ccd868" }
+func (*IoamEnable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IoamEnable) Size() int {
+func (m *IoamEnable) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.ID
- size += 2
- // field[1] m.Seqno
- size += 1
- // field[1] m.Analyse
- size += 1
- // field[1] m.PotEnable
- size += 1
- // field[1] m.TraceEnable
- size += 1
- // field[1] m.NodeID
- size += 4
+ size += 2 // m.ID
+ size += 1 // m.Seqno
+ size += 1 // m.Analyse
+ size += 1 // m.PotEnable
+ size += 1 // m.TraceEnable
+ size += 4 // m.NodeID
return size
}
func (m *IoamEnable) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.ID
- o.PutUint16(buf[pos:pos+2], uint16(m.ID))
- pos += 2
- // field[1] m.Seqno
- if m.Seqno {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Analyse
- if m.Analyse {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.PotEnable
- if m.PotEnable {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.TraceEnable
- if m.TraceEnable {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.NodeID
- o.PutUint32(buf[pos:pos+4], uint32(m.NodeID))
- pos += 4
- return buf, nil
-}
-func (m *IoamEnable) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ID
- m.ID = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[1] m.Seqno
- m.Seqno = tmp[pos] != 0
- pos += 1
- // field[1] m.Analyse
- m.Analyse = tmp[pos] != 0
- pos += 1
- // field[1] m.PotEnable
- m.PotEnable = tmp[pos] != 0
- pos += 1
- // field[1] m.TraceEnable
- m.TraceEnable = tmp[pos] != 0
- pos += 1
- // field[1] m.NodeID
- m.NodeID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint16(m.ID)
+ buf.EncodeBool(m.Seqno)
+ buf.EncodeBool(m.Analyse)
+ buf.EncodeBool(m.PotEnable)
+ buf.EncodeBool(m.TraceEnable)
+ buf.EncodeUint32(m.NodeID)
+ return buf.Bytes(), nil
+}
+func (m *IoamEnable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.ID = buf.DecodeUint16()
+ m.Seqno = buf.DecodeBool()
+ m.Analyse = buf.DecodeBool()
+ m.PotEnable = buf.DecodeBool()
+ m.TraceEnable = buf.DecodeBool()
+ m.NodeID = buf.DecodeUint32()
return nil
}
-// IoamEnableReply represents VPP binary API message 'ioam_enable_reply'.
+// IoamEnableReply defines message 'ioam_enable_reply'.
type IoamEnableReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *IoamEnableReply) Reset() { *m = IoamEnableReply{} }
-func (*IoamEnableReply) GetMessageName() string { return "ioam_enable_reply" }
-func (*IoamEnableReply) GetCrcString() string { return "e8d4e804" }
-func (*IoamEnableReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IoamEnableReply) Reset() { *m = IoamEnableReply{} }
+func (*IoamEnableReply) GetMessageName() string { return "ioam_enable_reply" }
+func (*IoamEnableReply) GetCrcString() string { return "e8d4e804" }
+func (*IoamEnableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IoamEnableReply) Size() int {
+func (m *IoamEnableReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IoamEnableReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IoamEnableReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *IoamEnableReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
return nil
}
-// IPAddressDetails represents VPP binary API message 'ip_address_details'.
+// IPAddressDetails defines message 'ip_address_details'.
type IPAddressDetails struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
Prefix AddressWithPrefix `binapi:"address_with_prefix,name=prefix" json:"prefix,omitempty"`
}
-func (m *IPAddressDetails) Reset() { *m = IPAddressDetails{} }
-func (*IPAddressDetails) GetMessageName() string { return "ip_address_details" }
-func (*IPAddressDetails) GetCrcString() string { return "b1199745" }
-func (*IPAddressDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPAddressDetails) Reset() { *m = IPAddressDetails{} }
+func (*IPAddressDetails) GetMessageName() string { return "ip_address_details" }
+func (*IPAddressDetails) GetCrcString() string { return "b1199745" }
+func (*IPAddressDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IPAddressDetails) Size() int {
+func (m *IPAddressDetails) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- size += 4
- // field[3] m.Prefix.Address.Un
- size += 16
- // field[2] m.Prefix.Len
- size += 1
+ size += 4 // m.SwIfIndex
+ size += 4 // m.Prefix.Address.Af
+ size += 1 * 16 // m.Prefix.Address.Un
+ size += 1 // m.Prefix.Len
return size
}
func (m *IPAddressDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- o.PutUint32(buf[pos:pos+4], uint32(m.Prefix.Address.Af))
- pos += 4
- // field[3] m.Prefix.Address.Un
- copy(buf[pos:pos+16], m.Prefix.Address.Un.XXX_UnionData[:])
- pos += 16
- // field[2] m.Prefix.Len
- buf[pos] = uint8(m.Prefix.Len)
- pos += 1
- return buf, nil
-}
-func (m *IPAddressDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- m.Prefix.Address.Af = AddressFamily(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Prefix.Address.Un
- copy(m.Prefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[2] m.Prefix.Len
- m.Prefix.Len = uint8(tmp[pos])
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.Prefix.Address.Af))
+ buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint8(m.Prefix.Len)
+ return buf.Bytes(), nil
+}
+func (m *IPAddressDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Prefix.Len = buf.DecodeUint8()
return nil
}
-// IPAddressDump represents VPP binary API message 'ip_address_dump'.
+// IPAddressDump defines message 'ip_address_dump'.
type IPAddressDump struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
}
-func (m *IPAddressDump) Reset() { *m = IPAddressDump{} }
-func (*IPAddressDump) GetMessageName() string { return "ip_address_dump" }
-func (*IPAddressDump) GetCrcString() string { return "2d033de4" }
-func (*IPAddressDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPAddressDump) Reset() { *m = IPAddressDump{} }
+func (*IPAddressDump) GetMessageName() string { return "ip_address_dump" }
+func (*IPAddressDump) GetCrcString() string { return "2d033de4" }
+func (*IPAddressDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPAddressDump) Size() int {
+func (m *IPAddressDump) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.IsIPv6
- size += 1
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsIPv6
return size
}
func (m *IPAddressDump) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.IsIPv6
- if m.IsIPv6 {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *IPAddressDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsIPv6
- m.IsIPv6 = tmp[pos] != 0
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.IsIPv6)
+ return buf.Bytes(), nil
+}
+func (m *IPAddressDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IsIPv6 = buf.DecodeBool()
return nil
}
-// IPContainerProxyAddDel represents VPP binary API message 'ip_container_proxy_add_del'.
+// IPContainerProxyAddDel defines message 'ip_container_proxy_add_del'.
type IPContainerProxyAddDel struct {
Pfx Prefix `binapi:"prefix,name=pfx" json:"pfx,omitempty"`
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
}
-func (m *IPContainerProxyAddDel) Reset() { *m = IPContainerProxyAddDel{} }
-func (*IPContainerProxyAddDel) GetMessageName() string { return "ip_container_proxy_add_del" }
-func (*IPContainerProxyAddDel) GetCrcString() string { return "91189f40" }
-func (*IPContainerProxyAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPContainerProxyAddDel) Reset() { *m = IPContainerProxyAddDel{} }
+func (*IPContainerProxyAddDel) GetMessageName() string { return "ip_container_proxy_add_del" }
+func (*IPContainerProxyAddDel) GetCrcString() string { return "91189f40" }
+func (*IPContainerProxyAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPContainerProxyAddDel) Size() int {
+func (m *IPContainerProxyAddDel) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Pfx
- // field[2] m.Pfx.Address
- // field[3] m.Pfx.Address.Af
- size += 4
- // field[3] m.Pfx.Address.Un
- size += 16
- // field[2] m.Pfx.Len
- size += 1
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.IsAdd
- size += 1
+ size += 4 // m.Pfx.Address.Af
+ size += 1 * 16 // m.Pfx.Address.Un
+ size += 1 // m.Pfx.Len
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsAdd
return size
}
func (m *IPContainerProxyAddDel) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Pfx
- // field[2] m.Pfx.Address
- // field[3] m.Pfx.Address.Af
- o.PutUint32(buf[pos:pos+4], uint32(m.Pfx.Address.Af))
- pos += 4
- // field[3] m.Pfx.Address.Un
- copy(buf[pos:pos+16], m.Pfx.Address.Un.XXX_UnionData[:])
- pos += 16
- // field[2] m.Pfx.Len
- buf[pos] = uint8(m.Pfx.Len)
- pos += 1
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *IPContainerProxyAddDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Pfx
- // field[2] m.Pfx.Address
- // field[3] m.Pfx.Address.Af
- m.Pfx.Address.Af = AddressFamily(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Pfx.Address.Un
- copy(m.Pfx.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[2] m.Pfx.Len
- m.Pfx.Len = uint8(tmp[pos])
- pos += 1
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Pfx.Address.Af))
+ buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint8(m.Pfx.Len)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *IPContainerProxyAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Pfx.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Pfx.Len = buf.DecodeUint8()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IsAdd = buf.DecodeBool()
return nil
}
-// IPContainerProxyAddDelReply represents VPP binary API message 'ip_container_proxy_add_del_reply'.
+// IPContainerProxyAddDelReply defines message 'ip_container_proxy_add_del_reply'.
type IPContainerProxyAddDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
@@ -1313,1487 +1464,815 @@ func (m *IPContainerProxyAddDelReply) Reset() { *m = IPContainerProxyAddDelReply
func (*IPContainerProxyAddDelReply) GetMessageName() string {
return "ip_container_proxy_add_del_reply"
}
-func (*IPContainerProxyAddDelReply) GetCrcString() string { return "e8d4e804" }
-func (*IPContainerProxyAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (*IPContainerProxyAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*IPContainerProxyAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IPContainerProxyAddDelReply) Size() int {
+func (m *IPContainerProxyAddDelReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPContainerProxyAddDelReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPContainerProxyAddDelReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *IPContainerProxyAddDelReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
return nil
}
-// IPContainerProxyDetails represents VPP binary API message 'ip_container_proxy_details'.
+// IPContainerProxyDetails defines message 'ip_container_proxy_details'.
type IPContainerProxyDetails struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
Prefix Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
}
-func (m *IPContainerProxyDetails) Reset() { *m = IPContainerProxyDetails{} }
-func (*IPContainerProxyDetails) GetMessageName() string { return "ip_container_proxy_details" }
-func (*IPContainerProxyDetails) GetCrcString() string { return "0ee460e8" }
-func (*IPContainerProxyDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPContainerProxyDetails) Reset() { *m = IPContainerProxyDetails{} }
+func (*IPContainerProxyDetails) GetMessageName() string { return "ip_container_proxy_details" }
+func (*IPContainerProxyDetails) GetCrcString() string { return "0ee460e8" }
+func (*IPContainerProxyDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IPContainerProxyDetails) Size() int {
+func (m *IPContainerProxyDetails) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- size += 4
- // field[3] m.Prefix.Address.Un
- size += 16
- // field[2] m.Prefix.Len
- size += 1
+ size += 4 // m.SwIfIndex
+ size += 4 // m.Prefix.Address.Af
+ size += 1 * 16 // m.Prefix.Address.Un
+ size += 1 // m.Prefix.Len
return size
}
func (m *IPContainerProxyDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- o.PutUint32(buf[pos:pos+4], uint32(m.Prefix.Address.Af))
- pos += 4
- // field[3] m.Prefix.Address.Un
- copy(buf[pos:pos+16], m.Prefix.Address.Un.XXX_UnionData[:])
- pos += 16
- // field[2] m.Prefix.Len
- buf[pos] = uint8(m.Prefix.Len)
- pos += 1
- return buf, nil
-}
-func (m *IPContainerProxyDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- m.Prefix.Address.Af = AddressFamily(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Prefix.Address.Un
- copy(m.Prefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[2] m.Prefix.Len
- m.Prefix.Len = uint8(tmp[pos])
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.Prefix.Address.Af))
+ buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint8(m.Prefix.Len)
+ return buf.Bytes(), nil
+}
+func (m *IPContainerProxyDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Prefix.Len = buf.DecodeUint8()
return nil
}
-// IPContainerProxyDump represents VPP binary API message 'ip_container_proxy_dump'.
+// IPContainerProxyDump defines message 'ip_container_proxy_dump'.
type IPContainerProxyDump struct{}
-func (m *IPContainerProxyDump) Reset() { *m = IPContainerProxyDump{} }
-func (*IPContainerProxyDump) GetMessageName() string { return "ip_container_proxy_dump" }
-func (*IPContainerProxyDump) GetCrcString() string { return "51077d14" }
-func (*IPContainerProxyDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPContainerProxyDump) Reset() { *m = IPContainerProxyDump{} }
+func (*IPContainerProxyDump) GetMessageName() string { return "ip_container_proxy_dump" }
+func (*IPContainerProxyDump) GetCrcString() string { return "51077d14" }
+func (*IPContainerProxyDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPContainerProxyDump) Size() int {
+func (m *IPContainerProxyDump) Size() (size int) {
if m == nil {
return 0
}
- var size int
return size
}
func (m *IPContainerProxyDump) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *IPContainerProxyDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *IPContainerProxyDump) Unmarshal(b []byte) error {
return nil
}
-// IPDetails represents VPP binary API message 'ip_details'.
+// IPDetails defines message 'ip_details'.
type IPDetails struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
}
-func (m *IPDetails) Reset() { *m = IPDetails{} }
-func (*IPDetails) GetMessageName() string { return "ip_details" }
-func (*IPDetails) GetCrcString() string { return "eb152d07" }
-func (*IPDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPDetails) Reset() { *m = IPDetails{} }
+func (*IPDetails) GetMessageName() string { return "ip_details" }
+func (*IPDetails) GetCrcString() string { return "eb152d07" }
+func (*IPDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IPDetails) Size() int {
+func (m *IPDetails) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.IsIPv6
- size += 1
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsIPv6
return size
}
func (m *IPDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.IsIPv6
- if m.IsIPv6 {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *IPDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsIPv6
- m.IsIPv6 = tmp[pos] != 0
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.IsIPv6)
+ return buf.Bytes(), nil
+}
+func (m *IPDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IsIPv6 = buf.DecodeBool()
return nil
}
-// IPDump represents VPP binary API message 'ip_dump'.
+// IPDump defines message 'ip_dump'.
type IPDump struct {
IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
}
-func (m *IPDump) Reset() { *m = IPDump{} }
-func (*IPDump) GetMessageName() string { return "ip_dump" }
-func (*IPDump) GetCrcString() string { return "98d231ca" }
-func (*IPDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPDump) Reset() { *m = IPDump{} }
+func (*IPDump) GetMessageName() string { return "ip_dump" }
+func (*IPDump) GetCrcString() string { return "98d231ca" }
+func (*IPDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPDump) Size() int {
+func (m *IPDump) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.IsIPv6
- size += 1
+ size += 1 // m.IsIPv6
return size
}
func (m *IPDump) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.IsIPv6
- if m.IsIPv6 {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *IPDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsIPv6
- m.IsIPv6 = tmp[pos] != 0
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsIPv6)
+ return buf.Bytes(), nil
+}
+func (m *IPDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsIPv6 = buf.DecodeBool()
return nil
}
-// IPMrouteAddDel represents VPP binary API message 'ip_mroute_add_del'.
+// IPMrouteAddDel defines message 'ip_mroute_add_del'.
type IPMrouteAddDel struct {
IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
IsMultipath bool `binapi:"bool,name=is_multipath" json:"is_multipath,omitempty"`
Route IPMroute `binapi:"ip_mroute,name=route" json:"route,omitempty"`
}
-func (m *IPMrouteAddDel) Reset() { *m = IPMrouteAddDel{} }
-func (*IPMrouteAddDel) GetMessageName() string { return "ip_mroute_add_del" }
-func (*IPMrouteAddDel) GetCrcString() string { return "f6627d17" }
-func (*IPMrouteAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPMrouteAddDel) Reset() { *m = IPMrouteAddDel{} }
+func (*IPMrouteAddDel) GetMessageName() string { return "ip_mroute_add_del" }
+func (*IPMrouteAddDel) GetCrcString() string { return "f6627d17" }
+func (*IPMrouteAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPMrouteAddDel) Size() int {
+func (m *IPMrouteAddDel) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.IsAdd
- size += 1
- // field[1] m.IsMultipath
- size += 1
- // field[1] m.Route
- // field[2] m.Route.TableID
- size += 4
- // field[2] m.Route.EntryFlags
- size += 4
- // field[2] m.Route.RpfID
- size += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Af
- size += 4
- // field[3] m.Route.Prefix.GrpAddressLength
- size += 2
- // field[3] m.Route.Prefix.GrpAddress
- size += 16
- // field[3] m.Route.Prefix.SrcAddress
- size += 16
- // field[2] m.Route.NPaths
- size += 1
- // field[2] m.Route.Paths
+ size += 1 // m.IsAdd
+ size += 1 // m.IsMultipath
+ size += 4 // m.Route.TableID
+ size += 4 // m.Route.EntryFlags
+ size += 4 // m.Route.RpfID
+ size += 4 // m.Route.Prefix.Af
+ size += 2 // m.Route.Prefix.GrpAddressLength
+ size += 1 * 16 // m.Route.Prefix.GrpAddress
+ size += 1 * 16 // m.Route.Prefix.SrcAddress
+ size += 1 // m.Route.NPaths
for j2 := 0; j2 < len(m.Route.Paths); j2++ {
var s2 MfibPath
_ = s2
if j2 < len(m.Route.Paths) {
s2 = m.Route.Paths[j2]
}
- // field[3] s2.ItfFlags
- size += 4
- // field[3] s2.Path
- // field[4] s2.Path.SwIfIndex
- size += 4
- // field[4] s2.Path.TableID
- size += 4
- // field[4] s2.Path.RpfID
- size += 4
- // field[4] s2.Path.Weight
- size += 1
- // field[4] s2.Path.Preference
- size += 1
- // field[4] s2.Path.Type
- size += 4
- // field[4] s2.Path.Flags
- size += 4
- // field[4] s2.Path.Proto
- size += 4
- // field[4] s2.Path.Nh
- // field[5] s2.Path.Nh.Address
- size += 16
- // field[5] s2.Path.Nh.ViaLabel
- size += 4
- // field[5] s2.Path.Nh.ObjID
- size += 4
- // field[5] s2.Path.Nh.ClassifyTableIndex
- size += 4
- // field[4] s2.Path.NLabels
- size += 1
- // field[4] s2.Path.LabelStack
+ size += 4 // s2.ItfFlags
+ size += 4 // s2.Path.SwIfIndex
+ size += 4 // s2.Path.TableID
+ size += 4 // s2.Path.RpfID
+ size += 1 // s2.Path.Weight
+ size += 1 // s2.Path.Preference
+ size += 4 // s2.Path.Type
+ size += 4 // s2.Path.Flags
+ size += 4 // s2.Path.Proto
+ size += 1 * 16 // s2.Path.Nh.Address
+ size += 4 // s2.Path.Nh.ViaLabel
+ size += 4 // s2.Path.Nh.ObjID
+ size += 4 // s2.Path.Nh.ClassifyTableIndex
+ size += 1 // s2.Path.NLabels
for j4 := 0; j4 < 16; j4++ {
- var s4 FibMplsLabel
- _ = s4
- if j4 < len(s2.Path.LabelStack) {
- s4 = s2.Path.LabelStack[j4]
- }
- // field[5] s4.IsUniform
- size += 1
- // field[5] s4.Label
- size += 4
- // field[5] s4.TTL
- size += 1
- // field[5] s4.Exp
- size += 1
+ size += 1 // s2.Path.LabelStack[j4].IsUniform
+ size += 4 // s2.Path.LabelStack[j4].Label
+ size += 1 // s2.Path.LabelStack[j4].TTL
+ size += 1 // s2.Path.LabelStack[j4].Exp
}
}
return size
}
func (m *IPMrouteAddDel) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.IsMultipath
- if m.IsMultipath {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Route
- // field[2] m.Route.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.TableID))
- pos += 4
- // field[2] m.Route.EntryFlags
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.EntryFlags))
- pos += 4
- // field[2] m.Route.RpfID
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.RpfID))
- pos += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Af
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.Prefix.Af))
- pos += 4
- // field[3] m.Route.Prefix.GrpAddressLength
- o.PutUint16(buf[pos:pos+2], uint16(m.Route.Prefix.GrpAddressLength))
- pos += 2
- // field[3] m.Route.Prefix.GrpAddress
- copy(buf[pos:pos+16], m.Route.Prefix.GrpAddress.XXX_UnionData[:])
- pos += 16
- // field[3] m.Route.Prefix.SrcAddress
- copy(buf[pos:pos+16], m.Route.Prefix.SrcAddress.XXX_UnionData[:])
- pos += 16
- // field[2] m.Route.NPaths
- buf[pos] = uint8(len(m.Route.Paths))
- pos += 1
- // field[2] m.Route.Paths
- for j2 := 0; j2 < len(m.Route.Paths); j2++ {
- var v2 MfibPath
- if j2 < len(m.Route.Paths) {
- v2 = m.Route.Paths[j2]
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeBool(m.IsMultipath)
+ buf.EncodeUint32(m.Route.TableID)
+ buf.EncodeUint32(m.Route.EntryFlags)
+ buf.EncodeUint32(m.Route.RpfID)
+ buf.EncodeUint32(uint32(m.Route.Prefix.Af))
+ buf.EncodeUint16(m.Route.Prefix.GrpAddressLength)
+ buf.EncodeBytes(m.Route.Prefix.GrpAddress.XXX_UnionData[:], 16)
+ buf.EncodeBytes(m.Route.Prefix.SrcAddress.XXX_UnionData[:], 16)
+ buf.EncodeUint8(uint8(len(m.Route.Paths)))
+ for j1 := 0; j1 < len(m.Route.Paths); j1++ {
+ var v1 MfibPath // Paths
+ if j1 < len(m.Route.Paths) {
+ v1 = m.Route.Paths[j1]
}
- // field[3] v2.ItfFlags
- o.PutUint32(buf[pos:pos+4], uint32(v2.ItfFlags))
- pos += 4
- // field[3] v2.Path
- // field[4] v2.Path.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.SwIfIndex))
- pos += 4
- // field[4] v2.Path.TableID
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.TableID))
- pos += 4
- // field[4] v2.Path.RpfID
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.RpfID))
- pos += 4
- // field[4] v2.Path.Weight
- buf[pos] = uint8(v2.Path.Weight)
- pos += 1
- // field[4] v2.Path.Preference
- buf[pos] = uint8(v2.Path.Preference)
- pos += 1
- // field[4] v2.Path.Type
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Type))
- pos += 4
- // field[4] v2.Path.Flags
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Flags))
- pos += 4
- // field[4] v2.Path.Proto
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Proto))
- pos += 4
- // field[4] v2.Path.Nh
- // field[5] v2.Path.Nh.Address
- copy(buf[pos:pos+16], v2.Path.Nh.Address.XXX_UnionData[:])
- pos += 16
- // field[5] v2.Path.Nh.ViaLabel
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Nh.ViaLabel))
- pos += 4
- // field[5] v2.Path.Nh.ObjID
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Nh.ObjID))
- pos += 4
- // field[5] v2.Path.Nh.ClassifyTableIndex
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Nh.ClassifyTableIndex))
- pos += 4
- // field[4] v2.Path.NLabels
- buf[pos] = uint8(v2.Path.NLabels)
- pos += 1
- // field[4] v2.Path.LabelStack
- for j4 := 0; j4 < 16; j4++ {
- var v4 FibMplsLabel
- if j4 < len(v2.Path.LabelStack) {
- v4 = v2.Path.LabelStack[j4]
- }
- // field[5] v4.IsUniform
- buf[pos] = uint8(v4.IsUniform)
- pos += 1
- // field[5] v4.Label
- o.PutUint32(buf[pos:pos+4], uint32(v4.Label))
- pos += 4
- // field[5] v4.TTL
- buf[pos] = uint8(v4.TTL)
- pos += 1
- // field[5] v4.Exp
- buf[pos] = uint8(v4.Exp)
- pos += 1
+ buf.EncodeUint32(uint32(v1.ItfFlags))
+ buf.EncodeUint32(v1.Path.SwIfIndex)
+ buf.EncodeUint32(v1.Path.TableID)
+ buf.EncodeUint32(v1.Path.RpfID)
+ buf.EncodeUint8(v1.Path.Weight)
+ buf.EncodeUint8(v1.Path.Preference)
+ buf.EncodeUint32(uint32(v1.Path.Type))
+ buf.EncodeUint32(uint32(v1.Path.Flags))
+ buf.EncodeUint32(uint32(v1.Path.Proto))
+ buf.EncodeBytes(v1.Path.Nh.Address.XXX_UnionData[:], 16)
+ buf.EncodeUint32(v1.Path.Nh.ViaLabel)
+ buf.EncodeUint32(v1.Path.Nh.ObjID)
+ buf.EncodeUint32(v1.Path.Nh.ClassifyTableIndex)
+ buf.EncodeUint8(v1.Path.NLabels)
+ for j3 := 0; j3 < 16; j3++ {
+ buf.EncodeUint8(v1.Path.LabelStack[j3].IsUniform)
+ buf.EncodeUint32(v1.Path.LabelStack[j3].Label)
+ buf.EncodeUint8(v1.Path.LabelStack[j3].TTL)
+ buf.EncodeUint8(v1.Path.LabelStack[j3].Exp)
}
}
- return buf, nil
-}
-func (m *IPMrouteAddDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
- // field[1] m.IsMultipath
- m.IsMultipath = tmp[pos] != 0
- pos += 1
- // field[1] m.Route
- // field[2] m.Route.TableID
- m.Route.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Route.EntryFlags
- m.Route.EntryFlags = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Route.RpfID
- m.Route.RpfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Af
- m.Route.Prefix.Af = AddressFamily(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Prefix.GrpAddressLength
- m.Route.Prefix.GrpAddressLength = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[3] m.Route.Prefix.GrpAddress
- copy(m.Route.Prefix.GrpAddress.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[3] m.Route.Prefix.SrcAddress
- copy(m.Route.Prefix.SrcAddress.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[2] m.Route.NPaths
- m.Route.NPaths = uint8(tmp[pos])
- pos += 1
- // field[2] m.Route.Paths
- m.Route.Paths = make([]MfibPath, int(m.Route.NPaths))
- for j2 := 0; j2 < int(m.Route.NPaths); j2++ {
- // field[3] m.Route.Paths[j2].ItfFlags
- m.Route.Paths[j2].ItfFlags = MfibItfFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Path
- // field[4] m.Route.Paths[j2].Path.SwIfIndex
- m.Route.Paths[j2].Path.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.TableID
- m.Route.Paths[j2].Path.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.RpfID
- m.Route.Paths[j2].Path.RpfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.Weight
- m.Route.Paths[j2].Path.Weight = uint8(tmp[pos])
- pos += 1
- // field[4] m.Route.Paths[j2].Path.Preference
- m.Route.Paths[j2].Path.Preference = uint8(tmp[pos])
- pos += 1
- // field[4] m.Route.Paths[j2].Path.Type
- m.Route.Paths[j2].Path.Type = FibPathType(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.Flags
- m.Route.Paths[j2].Path.Flags = FibPathFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.Proto
- m.Route.Paths[j2].Path.Proto = FibPathNhProto(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.Nh
- // field[5] m.Route.Paths[j2].Path.Nh.Address
- copy(m.Route.Paths[j2].Path.Nh.Address.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[5] m.Route.Paths[j2].Path.Nh.ViaLabel
- m.Route.Paths[j2].Path.Nh.ViaLabel = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[5] m.Route.Paths[j2].Path.Nh.ObjID
- m.Route.Paths[j2].Path.Nh.ObjID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[5] m.Route.Paths[j2].Path.Nh.ClassifyTableIndex
- m.Route.Paths[j2].Path.Nh.ClassifyTableIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.NLabels
- m.Route.Paths[j2].Path.NLabels = uint8(tmp[pos])
- pos += 1
- // field[4] m.Route.Paths[j2].Path.LabelStack
- for j4 := 0; j4 < 16; j4++ {
- // field[5] m.Route.Paths[j2].Path.LabelStack[j4].IsUniform
- m.Route.Paths[j2].Path.LabelStack[j4].IsUniform = uint8(tmp[pos])
- pos += 1
- // field[5] m.Route.Paths[j2].Path.LabelStack[j4].Label
- m.Route.Paths[j2].Path.LabelStack[j4].Label = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[5] m.Route.Paths[j2].Path.LabelStack[j4].TTL
- m.Route.Paths[j2].Path.LabelStack[j4].TTL = uint8(tmp[pos])
- pos += 1
- // field[5] m.Route.Paths[j2].Path.LabelStack[j4].Exp
- m.Route.Paths[j2].Path.LabelStack[j4].Exp = uint8(tmp[pos])
- pos += 1
+ return buf.Bytes(), nil
+}
+func (m *IPMrouteAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.IsMultipath = buf.DecodeBool()
+ m.Route.TableID = buf.DecodeUint32()
+ m.Route.EntryFlags = buf.DecodeUint32()
+ m.Route.RpfID = buf.DecodeUint32()
+ m.Route.Prefix.Af = AddressFamily(buf.DecodeUint32())
+ m.Route.Prefix.GrpAddressLength = buf.DecodeUint16()
+ copy(m.Route.Prefix.GrpAddress.XXX_UnionData[:], buf.DecodeBytes(16))
+ copy(m.Route.Prefix.SrcAddress.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Route.NPaths = buf.DecodeUint8()
+ m.Route.Paths = make([]MfibPath, m.Route.NPaths)
+ for j1 := 0; j1 < len(m.Route.Paths); j1++ {
+ m.Route.Paths[j1].ItfFlags = MfibItfFlags(buf.DecodeUint32())
+ m.Route.Paths[j1].Path.SwIfIndex = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.TableID = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.RpfID = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.Weight = buf.DecodeUint8()
+ m.Route.Paths[j1].Path.Preference = buf.DecodeUint8()
+ m.Route.Paths[j1].Path.Type = FibPathType(buf.DecodeUint32())
+ m.Route.Paths[j1].Path.Flags = FibPathFlags(buf.DecodeUint32())
+ m.Route.Paths[j1].Path.Proto = FibPathNhProto(buf.DecodeUint32())
+ copy(m.Route.Paths[j1].Path.Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Route.Paths[j1].Path.Nh.ViaLabel = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.Nh.ObjID = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.Nh.ClassifyTableIndex = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.NLabels = buf.DecodeUint8()
+ for j3 := 0; j3 < 16; j3++ {
+ m.Route.Paths[j1].Path.LabelStack[j3].IsUniform = buf.DecodeUint8()
+ m.Route.Paths[j1].Path.LabelStack[j3].Label = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.LabelStack[j3].TTL = buf.DecodeUint8()
+ m.Route.Paths[j1].Path.LabelStack[j3].Exp = buf.DecodeUint8()
}
}
return nil
}
-// IPMrouteAddDelReply represents VPP binary API message 'ip_mroute_add_del_reply'.
+// IPMrouteAddDelReply defines message 'ip_mroute_add_del_reply'.
type IPMrouteAddDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"`
}
-func (m *IPMrouteAddDelReply) Reset() { *m = IPMrouteAddDelReply{} }
-func (*IPMrouteAddDelReply) GetMessageName() string { return "ip_mroute_add_del_reply" }
-func (*IPMrouteAddDelReply) GetCrcString() string { return "1992deab" }
-func (*IPMrouteAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPMrouteAddDelReply) Reset() { *m = IPMrouteAddDelReply{} }
+func (*IPMrouteAddDelReply) GetMessageName() string { return "ip_mroute_add_del_reply" }
+func (*IPMrouteAddDelReply) GetCrcString() string { return "1992deab" }
+func (*IPMrouteAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IPMrouteAddDelReply) Size() int {
+func (m *IPMrouteAddDelReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.StatsIndex
- size += 4
+ size += 4 // m.Retval
+ size += 4 // m.StatsIndex
return size
}
func (m *IPMrouteAddDelReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.StatsIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.StatsIndex))
- pos += 4
- return buf, nil
-}
-func (m *IPMrouteAddDelReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.StatsIndex
- m.StatsIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint32(m.StatsIndex)
+ return buf.Bytes(), nil
+}
+func (m *IPMrouteAddDelReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.StatsIndex = buf.DecodeUint32()
return nil
}
-// IPMrouteDetails represents VPP binary API message 'ip_mroute_details'.
+// IPMrouteDetails defines message 'ip_mroute_details'.
type IPMrouteDetails struct {
Route IPMroute `binapi:"ip_mroute,name=route" json:"route,omitempty"`
}
-func (m *IPMrouteDetails) Reset() { *m = IPMrouteDetails{} }
-func (*IPMrouteDetails) GetMessageName() string { return "ip_mroute_details" }
-func (*IPMrouteDetails) GetCrcString() string { return "c1cb4b44" }
-func (*IPMrouteDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPMrouteDetails) Reset() { *m = IPMrouteDetails{} }
+func (*IPMrouteDetails) GetMessageName() string { return "ip_mroute_details" }
+func (*IPMrouteDetails) GetCrcString() string { return "c1cb4b44" }
+func (*IPMrouteDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IPMrouteDetails) Size() int {
+func (m *IPMrouteDetails) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Route
- // field[2] m.Route.TableID
- size += 4
- // field[2] m.Route.EntryFlags
- size += 4
- // field[2] m.Route.RpfID
- size += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Af
- size += 4
- // field[3] m.Route.Prefix.GrpAddressLength
- size += 2
- // field[3] m.Route.Prefix.GrpAddress
- size += 16
- // field[3] m.Route.Prefix.SrcAddress
- size += 16
- // field[2] m.Route.NPaths
- size += 1
- // field[2] m.Route.Paths
+ size += 4 // m.Route.TableID
+ size += 4 // m.Route.EntryFlags
+ size += 4 // m.Route.RpfID
+ size += 4 // m.Route.Prefix.Af
+ size += 2 // m.Route.Prefix.GrpAddressLength
+ size += 1 * 16 // m.Route.Prefix.GrpAddress
+ size += 1 * 16 // m.Route.Prefix.SrcAddress
+ size += 1 // m.Route.NPaths
for j2 := 0; j2 < len(m.Route.Paths); j2++ {
var s2 MfibPath
_ = s2
if j2 < len(m.Route.Paths) {
s2 = m.Route.Paths[j2]
}
- // field[3] s2.ItfFlags
- size += 4
- // field[3] s2.Path
- // field[4] s2.Path.SwIfIndex
- size += 4
- // field[4] s2.Path.TableID
- size += 4
- // field[4] s2.Path.RpfID
- size += 4
- // field[4] s2.Path.Weight
- size += 1
- // field[4] s2.Path.Preference
- size += 1
- // field[4] s2.Path.Type
- size += 4
- // field[4] s2.Path.Flags
- size += 4
- // field[4] s2.Path.Proto
- size += 4
- // field[4] s2.Path.Nh
- // field[5] s2.Path.Nh.Address
- size += 16
- // field[5] s2.Path.Nh.ViaLabel
- size += 4
- // field[5] s2.Path.Nh.ObjID
- size += 4
- // field[5] s2.Path.Nh.ClassifyTableIndex
- size += 4
- // field[4] s2.Path.NLabels
- size += 1
- // field[4] s2.Path.LabelStack
+ size += 4 // s2.ItfFlags
+ size += 4 // s2.Path.SwIfIndex
+ size += 4 // s2.Path.TableID
+ size += 4 // s2.Path.RpfID
+ size += 1 // s2.Path.Weight
+ size += 1 // s2.Path.Preference
+ size += 4 // s2.Path.Type
+ size += 4 // s2.Path.Flags
+ size += 4 // s2.Path.Proto
+ size += 1 * 16 // s2.Path.Nh.Address
+ size += 4 // s2.Path.Nh.ViaLabel
+ size += 4 // s2.Path.Nh.ObjID
+ size += 4 // s2.Path.Nh.ClassifyTableIndex
+ size += 1 // s2.Path.NLabels
for j4 := 0; j4 < 16; j4++ {
- var s4 FibMplsLabel
- _ = s4
- if j4 < len(s2.Path.LabelStack) {
- s4 = s2.Path.LabelStack[j4]
- }
- // field[5] s4.IsUniform
- size += 1
- // field[5] s4.Label
- size += 4
- // field[5] s4.TTL
- size += 1
- // field[5] s4.Exp
- size += 1
+ size += 1 // s2.Path.LabelStack[j4].IsUniform
+ size += 4 // s2.Path.LabelStack[j4].Label
+ size += 1 // s2.Path.LabelStack[j4].TTL
+ size += 1 // s2.Path.LabelStack[j4].Exp
}
}
return size
}
func (m *IPMrouteDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Route
- // field[2] m.Route.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.TableID))
- pos += 4
- // field[2] m.Route.EntryFlags
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.EntryFlags))
- pos += 4
- // field[2] m.Route.RpfID
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.RpfID))
- pos += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Af
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.Prefix.Af))
- pos += 4
- // field[3] m.Route.Prefix.GrpAddressLength
- o.PutUint16(buf[pos:pos+2], uint16(m.Route.Prefix.GrpAddressLength))
- pos += 2
- // field[3] m.Route.Prefix.GrpAddress
- copy(buf[pos:pos+16], m.Route.Prefix.GrpAddress.XXX_UnionData[:])
- pos += 16
- // field[3] m.Route.Prefix.SrcAddress
- copy(buf[pos:pos+16], m.Route.Prefix.SrcAddress.XXX_UnionData[:])
- pos += 16
- // field[2] m.Route.NPaths
- buf[pos] = uint8(len(m.Route.Paths))
- pos += 1
- // field[2] m.Route.Paths
- for j2 := 0; j2 < len(m.Route.Paths); j2++ {
- var v2 MfibPath
- if j2 < len(m.Route.Paths) {
- v2 = m.Route.Paths[j2]
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Route.TableID)
+ buf.EncodeUint32(m.Route.EntryFlags)
+ buf.EncodeUint32(m.Route.RpfID)
+ buf.EncodeUint32(uint32(m.Route.Prefix.Af))
+ buf.EncodeUint16(m.Route.Prefix.GrpAddressLength)
+ buf.EncodeBytes(m.Route.Prefix.GrpAddress.XXX_UnionData[:], 16)
+ buf.EncodeBytes(m.Route.Prefix.SrcAddress.XXX_UnionData[:], 16)
+ buf.EncodeUint8(uint8(len(m.Route.Paths)))
+ for j1 := 0; j1 < len(m.Route.Paths); j1++ {
+ var v1 MfibPath // Paths
+ if j1 < len(m.Route.Paths) {
+ v1 = m.Route.Paths[j1]
}
- // field[3] v2.ItfFlags
- o.PutUint32(buf[pos:pos+4], uint32(v2.ItfFlags))
- pos += 4
- // field[3] v2.Path
- // field[4] v2.Path.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.SwIfIndex))
- pos += 4
- // field[4] v2.Path.TableID
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.TableID))
- pos += 4
- // field[4] v2.Path.RpfID
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.RpfID))
- pos += 4
- // field[4] v2.Path.Weight
- buf[pos] = uint8(v2.Path.Weight)
- pos += 1
- // field[4] v2.Path.Preference
- buf[pos] = uint8(v2.Path.Preference)
- pos += 1
- // field[4] v2.Path.Type
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Type))
- pos += 4
- // field[4] v2.Path.Flags
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Flags))
- pos += 4
- // field[4] v2.Path.Proto
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Proto))
- pos += 4
- // field[4] v2.Path.Nh
- // field[5] v2.Path.Nh.Address
- copy(buf[pos:pos+16], v2.Path.Nh.Address.XXX_UnionData[:])
- pos += 16
- // field[5] v2.Path.Nh.ViaLabel
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Nh.ViaLabel))
- pos += 4
- // field[5] v2.Path.Nh.ObjID
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Nh.ObjID))
- pos += 4
- // field[5] v2.Path.Nh.ClassifyTableIndex
- o.PutUint32(buf[pos:pos+4], uint32(v2.Path.Nh.ClassifyTableIndex))
- pos += 4
- // field[4] v2.Path.NLabels
- buf[pos] = uint8(v2.Path.NLabels)
- pos += 1
- // field[4] v2.Path.LabelStack
- for j4 := 0; j4 < 16; j4++ {
- var v4 FibMplsLabel
- if j4 < len(v2.Path.LabelStack) {
- v4 = v2.Path.LabelStack[j4]
- }
- // field[5] v4.IsUniform
- buf[pos] = uint8(v4.IsUniform)
- pos += 1
- // field[5] v4.Label
- o.PutUint32(buf[pos:pos+4], uint32(v4.Label))
- pos += 4
- // field[5] v4.TTL
- buf[pos] = uint8(v4.TTL)
- pos += 1
- // field[5] v4.Exp
- buf[pos] = uint8(v4.Exp)
- pos += 1
+ buf.EncodeUint32(uint32(v1.ItfFlags))
+ buf.EncodeUint32(v1.Path.SwIfIndex)
+ buf.EncodeUint32(v1.Path.TableID)
+ buf.EncodeUint32(v1.Path.RpfID)
+ buf.EncodeUint8(v1.Path.Weight)
+ buf.EncodeUint8(v1.Path.Preference)
+ buf.EncodeUint32(uint32(v1.Path.Type))
+ buf.EncodeUint32(uint32(v1.Path.Flags))
+ buf.EncodeUint32(uint32(v1.Path.Proto))
+ buf.EncodeBytes(v1.Path.Nh.Address.XXX_UnionData[:], 16)
+ buf.EncodeUint32(v1.Path.Nh.ViaLabel)
+ buf.EncodeUint32(v1.Path.Nh.ObjID)
+ buf.EncodeUint32(v1.Path.Nh.ClassifyTableIndex)
+ buf.EncodeUint8(v1.Path.NLabels)
+ for j3 := 0; j3 < 16; j3++ {
+ buf.EncodeUint8(v1.Path.LabelStack[j3].IsUniform)
+ buf.EncodeUint32(v1.Path.LabelStack[j3].Label)
+ buf.EncodeUint8(v1.Path.LabelStack[j3].TTL)
+ buf.EncodeUint8(v1.Path.LabelStack[j3].Exp)
}
}
- return buf, nil
-}
-func (m *IPMrouteDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Route
- // field[2] m.Route.TableID
- m.Route.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Route.EntryFlags
- m.Route.EntryFlags = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Route.RpfID
- m.Route.RpfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Af
- m.Route.Prefix.Af = AddressFamily(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Prefix.GrpAddressLength
- m.Route.Prefix.GrpAddressLength = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[3] m.Route.Prefix.GrpAddress
- copy(m.Route.Prefix.GrpAddress.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[3] m.Route.Prefix.SrcAddress
- copy(m.Route.Prefix.SrcAddress.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[2] m.Route.NPaths
- m.Route.NPaths = uint8(tmp[pos])
- pos += 1
- // field[2] m.Route.Paths
- m.Route.Paths = make([]MfibPath, int(m.Route.NPaths))
- for j2 := 0; j2 < int(m.Route.NPaths); j2++ {
- // field[3] m.Route.Paths[j2].ItfFlags
- m.Route.Paths[j2].ItfFlags = MfibItfFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Path
- // field[4] m.Route.Paths[j2].Path.SwIfIndex
- m.Route.Paths[j2].Path.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.TableID
- m.Route.Paths[j2].Path.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.RpfID
- m.Route.Paths[j2].Path.RpfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.Weight
- m.Route.Paths[j2].Path.Weight = uint8(tmp[pos])
- pos += 1
- // field[4] m.Route.Paths[j2].Path.Preference
- m.Route.Paths[j2].Path.Preference = uint8(tmp[pos])
- pos += 1
- // field[4] m.Route.Paths[j2].Path.Type
- m.Route.Paths[j2].Path.Type = FibPathType(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.Flags
- m.Route.Paths[j2].Path.Flags = FibPathFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.Proto
- m.Route.Paths[j2].Path.Proto = FibPathNhProto(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.Nh
- // field[5] m.Route.Paths[j2].Path.Nh.Address
- copy(m.Route.Paths[j2].Path.Nh.Address.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[5] m.Route.Paths[j2].Path.Nh.ViaLabel
- m.Route.Paths[j2].Path.Nh.ViaLabel = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[5] m.Route.Paths[j2].Path.Nh.ObjID
- m.Route.Paths[j2].Path.Nh.ObjID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[5] m.Route.Paths[j2].Path.Nh.ClassifyTableIndex
- m.Route.Paths[j2].Path.Nh.ClassifyTableIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.NLabels
- m.Route.Paths[j2].Path.NLabels = uint8(tmp[pos])
- pos += 1
- // field[4] m.Route.Paths[j2].Path.LabelStack
- for j4 := 0; j4 < 16; j4++ {
- // field[5] m.Route.Paths[j2].Path.LabelStack[j4].IsUniform
- m.Route.Paths[j2].Path.LabelStack[j4].IsUniform = uint8(tmp[pos])
- pos += 1
- // field[5] m.Route.Paths[j2].Path.LabelStack[j4].Label
- m.Route.Paths[j2].Path.LabelStack[j4].Label = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[5] m.Route.Paths[j2].Path.LabelStack[j4].TTL
- m.Route.Paths[j2].Path.LabelStack[j4].TTL = uint8(tmp[pos])
- pos += 1
- // field[5] m.Route.Paths[j2].Path.LabelStack[j4].Exp
- m.Route.Paths[j2].Path.LabelStack[j4].Exp = uint8(tmp[pos])
- pos += 1
+ return buf.Bytes(), nil
+}
+func (m *IPMrouteDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Route.TableID = buf.DecodeUint32()
+ m.Route.EntryFlags = buf.DecodeUint32()
+ m.Route.RpfID = buf.DecodeUint32()
+ m.Route.Prefix.Af = AddressFamily(buf.DecodeUint32())
+ m.Route.Prefix.GrpAddressLength = buf.DecodeUint16()
+ copy(m.Route.Prefix.GrpAddress.XXX_UnionData[:], buf.DecodeBytes(16))
+ copy(m.Route.Prefix.SrcAddress.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Route.NPaths = buf.DecodeUint8()
+ m.Route.Paths = make([]MfibPath, m.Route.NPaths)
+ for j1 := 0; j1 < len(m.Route.Paths); j1++ {
+ m.Route.Paths[j1].ItfFlags = MfibItfFlags(buf.DecodeUint32())
+ m.Route.Paths[j1].Path.SwIfIndex = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.TableID = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.RpfID = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.Weight = buf.DecodeUint8()
+ m.Route.Paths[j1].Path.Preference = buf.DecodeUint8()
+ m.Route.Paths[j1].Path.Type = FibPathType(buf.DecodeUint32())
+ m.Route.Paths[j1].Path.Flags = FibPathFlags(buf.DecodeUint32())
+ m.Route.Paths[j1].Path.Proto = FibPathNhProto(buf.DecodeUint32())
+ copy(m.Route.Paths[j1].Path.Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Route.Paths[j1].Path.Nh.ViaLabel = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.Nh.ObjID = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.Nh.ClassifyTableIndex = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.NLabels = buf.DecodeUint8()
+ for j3 := 0; j3 < 16; j3++ {
+ m.Route.Paths[j1].Path.LabelStack[j3].IsUniform = buf.DecodeUint8()
+ m.Route.Paths[j1].Path.LabelStack[j3].Label = buf.DecodeUint32()
+ m.Route.Paths[j1].Path.LabelStack[j3].TTL = buf.DecodeUint8()
+ m.Route.Paths[j1].Path.LabelStack[j3].Exp = buf.DecodeUint8()
}
}
return nil
}
-// IPMrouteDump represents VPP binary API message 'ip_mroute_dump'.
+// IPMrouteDump defines message 'ip_mroute_dump'.
type IPMrouteDump struct {
Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
}
-func (m *IPMrouteDump) Reset() { *m = IPMrouteDump{} }
-func (*IPMrouteDump) GetMessageName() string { return "ip_mroute_dump" }
-func (*IPMrouteDump) GetCrcString() string { return "b9d2e09e" }
-func (*IPMrouteDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPMrouteDump) Reset() { *m = IPMrouteDump{} }
+func (*IPMrouteDump) GetMessageName() string { return "ip_mroute_dump" }
+func (*IPMrouteDump) GetCrcString() string { return "b9d2e09e" }
+func (*IPMrouteDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPMrouteDump) Size() int {
+func (m *IPMrouteDump) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Table
- // field[2] m.Table.TableID
- size += 4
- // field[2] m.Table.IsIP6
- size += 1
- // field[2] m.Table.Name
- size += 64
+ size += 4 // m.Table.TableID
+ size += 1 // m.Table.IsIP6
+ size += 64 // m.Table.Name
return size
}
func (m *IPMrouteDump) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Table
- // field[2] m.Table.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Table.TableID))
- pos += 4
- // field[2] m.Table.IsIP6
- if m.Table.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- // field[2] m.Table.Name
- copy(buf[pos:pos+64], m.Table.Name)
- pos += 64
- return buf, nil
-}
-func (m *IPMrouteDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Table
- // field[2] m.Table.TableID
- m.Table.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Table.IsIP6
- m.Table.IsIP6 = tmp[pos] != 0
- pos += 1
- // field[2] m.Table.Name
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Table.Name = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Table.TableID)
+ buf.EncodeBool(m.Table.IsIP6)
+ buf.EncodeString(m.Table.Name, 64)
+ return buf.Bytes(), nil
+}
+func (m *IPMrouteDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Table.TableID = buf.DecodeUint32()
+ m.Table.IsIP6 = buf.DecodeBool()
+ m.Table.Name = buf.DecodeString(64)
return nil
}
-// IPMtableDetails represents VPP binary API message 'ip_mtable_details'.
+// IPMtableDetails defines message 'ip_mtable_details'.
type IPMtableDetails struct {
Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
}
-func (m *IPMtableDetails) Reset() { *m = IPMtableDetails{} }
-func (*IPMtableDetails) GetMessageName() string { return "ip_mtable_details" }
-func (*IPMtableDetails) GetCrcString() string { return "b9d2e09e" }
-func (*IPMtableDetails) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPMtableDetails) Reset() { *m = IPMtableDetails{} }
+func (*IPMtableDetails) GetMessageName() string { return "ip_mtable_details" }
+func (*IPMtableDetails) GetCrcString() string { return "b9d2e09e" }
+func (*IPMtableDetails) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPMtableDetails) Size() int {
+func (m *IPMtableDetails) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Table
- // field[2] m.Table.TableID
- size += 4
- // field[2] m.Table.IsIP6
- size += 1
- // field[2] m.Table.Name
- size += 64
+ size += 4 // m.Table.TableID
+ size += 1 // m.Table.IsIP6
+ size += 64 // m.Table.Name
return size
}
func (m *IPMtableDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Table
- // field[2] m.Table.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Table.TableID))
- pos += 4
- // field[2] m.Table.IsIP6
- if m.Table.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- // field[2] m.Table.Name
- copy(buf[pos:pos+64], m.Table.Name)
- pos += 64
- return buf, nil
-}
-func (m *IPMtableDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Table
- // field[2] m.Table.TableID
- m.Table.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Table.IsIP6
- m.Table.IsIP6 = tmp[pos] != 0
- pos += 1
- // field[2] m.Table.Name
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Table.Name = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Table.TableID)
+ buf.EncodeBool(m.Table.IsIP6)
+ buf.EncodeString(m.Table.Name, 64)
+ return buf.Bytes(), nil
+}
+func (m *IPMtableDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Table.TableID = buf.DecodeUint32()
+ m.Table.IsIP6 = buf.DecodeBool()
+ m.Table.Name = buf.DecodeString(64)
return nil
}
-// IPMtableDump represents VPP binary API message 'ip_mtable_dump'.
+// IPMtableDump defines message 'ip_mtable_dump'.
type IPMtableDump struct{}
-func (m *IPMtableDump) Reset() { *m = IPMtableDump{} }
-func (*IPMtableDump) GetMessageName() string { return "ip_mtable_dump" }
-func (*IPMtableDump) GetCrcString() string { return "51077d14" }
-func (*IPMtableDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPMtableDump) Reset() { *m = IPMtableDump{} }
+func (*IPMtableDump) GetMessageName() string { return "ip_mtable_dump" }
+func (*IPMtableDump) GetCrcString() string { return "51077d14" }
+func (*IPMtableDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPMtableDump) Size() int {
+func (m *IPMtableDump) Size() (size int) {
if m == nil {
return 0
}
- var size int
return size
}
func (m *IPMtableDump) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *IPMtableDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *IPMtableDump) Unmarshal(b []byte) error {
return nil
}
-// IPPuntPolice represents VPP binary API message 'ip_punt_police'.
+// IPPuntPolice defines message 'ip_punt_police'.
type IPPuntPolice struct {
PolicerIndex uint32 `binapi:"u32,name=policer_index" json:"policer_index,omitempty"`
IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"`
}
-func (m *IPPuntPolice) Reset() { *m = IPPuntPolice{} }
-func (*IPPuntPolice) GetMessageName() string { return "ip_punt_police" }
-func (*IPPuntPolice) GetCrcString() string { return "db867cea" }
-func (*IPPuntPolice) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPPuntPolice) Reset() { *m = IPPuntPolice{} }
+func (*IPPuntPolice) GetMessageName() string { return "ip_punt_police" }
+func (*IPPuntPolice) GetCrcString() string { return "db867cea" }
+func (*IPPuntPolice) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPPuntPolice) Size() int {
+func (m *IPPuntPolice) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.PolicerIndex
- size += 4
- // field[1] m.IsAdd
- size += 1
- // field[1] m.IsIP6
- size += 1
+ size += 4 // m.PolicerIndex
+ size += 1 // m.IsAdd
+ size += 1 // m.IsIP6
return size
}
func (m *IPPuntPolice) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.PolicerIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.PolicerIndex))
- pos += 4
- // field[1] m.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.IsIP6
- if m.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *IPPuntPolice) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.PolicerIndex
- m.PolicerIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
- // field[1] m.IsIP6
- m.IsIP6 = tmp[pos] != 0
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.PolicerIndex)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeBool(m.IsIP6)
+ return buf.Bytes(), nil
+}
+func (m *IPPuntPolice) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.PolicerIndex = buf.DecodeUint32()
+ m.IsAdd = buf.DecodeBool()
+ m.IsIP6 = buf.DecodeBool()
return nil
}
-// IPPuntPoliceReply represents VPP binary API message 'ip_punt_police_reply'.
+// IPPuntPoliceReply defines message 'ip_punt_police_reply'.
type IPPuntPoliceReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *IPPuntPoliceReply) Reset() { *m = IPPuntPoliceReply{} }
-func (*IPPuntPoliceReply) GetMessageName() string { return "ip_punt_police_reply" }
-func (*IPPuntPoliceReply) GetCrcString() string { return "e8d4e804" }
-func (*IPPuntPoliceReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPPuntPoliceReply) Reset() { *m = IPPuntPoliceReply{} }
+func (*IPPuntPoliceReply) GetMessageName() string { return "ip_punt_police_reply" }
+func (*IPPuntPoliceReply) GetCrcString() string { return "e8d4e804" }
+func (*IPPuntPoliceReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IPPuntPoliceReply) Size() int {
+func (m *IPPuntPoliceReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPPuntPoliceReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPPuntPoliceReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *IPPuntPoliceReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
return nil
}
-// IPPuntRedirect represents VPP binary API message 'ip_punt_redirect'.
+// IPPuntRedirect defines message 'ip_punt_redirect'.
type IPPuntRedirect struct {
Punt PuntRedirect `binapi:"punt_redirect,name=punt" json:"punt,omitempty"`
IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
}
-func (m *IPPuntRedirect) Reset() { *m = IPPuntRedirect{} }
-func (*IPPuntRedirect) GetMessageName() string { return "ip_punt_redirect" }
-func (*IPPuntRedirect) GetCrcString() string { return "a9a5592c" }
-func (*IPPuntRedirect) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPPuntRedirect) Reset() { *m = IPPuntRedirect{} }
+func (*IPPuntRedirect) GetMessageName() string { return "ip_punt_redirect" }
+func (*IPPuntRedirect) GetCrcString() string { return "a9a5592c" }
+func (*IPPuntRedirect) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPPuntRedirect) Size() int {
+func (m *IPPuntRedirect) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Punt
- // field[2] m.Punt.RxSwIfIndex
- size += 4
- // field[2] m.Punt.TxSwIfIndex
- size += 4
- // field[2] m.Punt.Nh
- // field[3] m.Punt.Nh.Af
- size += 4
- // field[3] m.Punt.Nh.Un
- size += 16
- // field[1] m.IsAdd
- size += 1
+ size += 4 // m.Punt.RxSwIfIndex
+ size += 4 // m.Punt.TxSwIfIndex
+ size += 4 // m.Punt.Nh.Af
+ size += 1 * 16 // m.Punt.Nh.Un
+ size += 1 // m.IsAdd
return size
}
func (m *IPPuntRedirect) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Punt
- // field[2] m.Punt.RxSwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.Punt.RxSwIfIndex))
- pos += 4
- // field[2] m.Punt.TxSwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.Punt.TxSwIfIndex))
- pos += 4
- // field[2] m.Punt.Nh
- // field[3] m.Punt.Nh.Af
- o.PutUint32(buf[pos:pos+4], uint32(m.Punt.Nh.Af))
- pos += 4
- // field[3] m.Punt.Nh.Un
- copy(buf[pos:pos+16], m.Punt.Nh.Un.XXX_UnionData[:])
- pos += 16
- // field[1] m.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *IPPuntRedirect) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Punt
- // field[2] m.Punt.RxSwIfIndex
- m.Punt.RxSwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Punt.TxSwIfIndex
- m.Punt.TxSwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Punt.Nh
- // field[3] m.Punt.Nh.Af
- m.Punt.Nh.Af = AddressFamily(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Punt.Nh.Un
- copy(m.Punt.Nh.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Punt.RxSwIfIndex))
+ buf.EncodeUint32(uint32(m.Punt.TxSwIfIndex))
+ buf.EncodeUint32(uint32(m.Punt.Nh.Af))
+ buf.EncodeBytes(m.Punt.Nh.Un.XXX_UnionData[:], 16)
+ buf.EncodeBool(m.IsAdd)
+ return buf.Bytes(), nil
+}
+func (m *IPPuntRedirect) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Punt.RxSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Punt.TxSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Punt.Nh.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Punt.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.IsAdd = buf.DecodeBool()
return nil
}
-// IPPuntRedirectDetails represents VPP binary API message 'ip_punt_redirect_details'.
+// IPPuntRedirectDetails defines message 'ip_punt_redirect_details'.
type IPPuntRedirectDetails struct {
Punt PuntRedirect `binapi:"punt_redirect,name=punt" json:"punt,omitempty"`
}
-func (m *IPPuntRedirectDetails) Reset() { *m = IPPuntRedirectDetails{} }
-func (*IPPuntRedirectDetails) GetMessageName() string { return "ip_punt_redirect_details" }
-func (*IPPuntRedirectDetails) GetCrcString() string { return "3924f5d3" }
-func (*IPPuntRedirectDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPPuntRedirectDetails) Reset() { *m = IPPuntRedirectDetails{} }
+func (*IPPuntRedirectDetails) GetMessageName() string { return "ip_punt_redirect_details" }
+func (*IPPuntRedirectDetails) GetCrcString() string { return "3924f5d3" }
+func (*IPPuntRedirectDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IPPuntRedirectDetails) Size() int {
+func (m *IPPuntRedirectDetails) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Punt
- // field[2] m.Punt.RxSwIfIndex
- size += 4
- // field[2] m.Punt.TxSwIfIndex
- size += 4
- // field[2] m.Punt.Nh
- // field[3] m.Punt.Nh.Af
- size += 4
- // field[3] m.Punt.Nh.Un
- size += 16
+ size += 4 // m.Punt.RxSwIfIndex
+ size += 4 // m.Punt.TxSwIfIndex
+ size += 4 // m.Punt.Nh.Af
+ size += 1 * 16 // m.Punt.Nh.Un
return size
}
func (m *IPPuntRedirectDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Punt
- // field[2] m.Punt.RxSwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.Punt.RxSwIfIndex))
- pos += 4
- // field[2] m.Punt.TxSwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.Punt.TxSwIfIndex))
- pos += 4
- // field[2] m.Punt.Nh
- // field[3] m.Punt.Nh.Af
- o.PutUint32(buf[pos:pos+4], uint32(m.Punt.Nh.Af))
- pos += 4
- // field[3] m.Punt.Nh.Un
- copy(buf[pos:pos+16], m.Punt.Nh.Un.XXX_UnionData[:])
- pos += 16
- return buf, nil
-}
-func (m *IPPuntRedirectDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Punt
- // field[2] m.Punt.RxSwIfIndex
- m.Punt.RxSwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Punt.TxSwIfIndex
- m.Punt.TxSwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Punt.Nh
- // field[3] m.Punt.Nh.Af
- m.Punt.Nh.Af = AddressFamily(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Punt.Nh.Un
- copy(m.Punt.Nh.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.Punt.RxSwIfIndex))
+ buf.EncodeUint32(uint32(m.Punt.TxSwIfIndex))
+ buf.EncodeUint32(uint32(m.Punt.Nh.Af))
+ buf.EncodeBytes(m.Punt.Nh.Un.XXX_UnionData[:], 16)
+ return buf.Bytes(), nil
+}
+func (m *IPPuntRedirectDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Punt.RxSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Punt.TxSwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Punt.Nh.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Punt.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16))
return nil
}
-// IPPuntRedirectDump represents VPP binary API message 'ip_punt_redirect_dump'.
+// IPPuntRedirectDump defines message 'ip_punt_redirect_dump'.
type IPPuntRedirectDump struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
}
-func (m *IPPuntRedirectDump) Reset() { *m = IPPuntRedirectDump{} }
-func (*IPPuntRedirectDump) GetMessageName() string { return "ip_punt_redirect_dump" }
-func (*IPPuntRedirectDump) GetCrcString() string { return "2d033de4" }
-func (*IPPuntRedirectDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPPuntRedirectDump) Reset() { *m = IPPuntRedirectDump{} }
+func (*IPPuntRedirectDump) GetMessageName() string { return "ip_punt_redirect_dump" }
+func (*IPPuntRedirectDump) GetCrcString() string { return "2d033de4" }
+func (*IPPuntRedirectDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPPuntRedirectDump) Size() int {
+func (m *IPPuntRedirectDump) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.IsIPv6
- size += 1
+ size += 4 // m.SwIfIndex
+ size += 1 // m.IsIPv6
return size
}
func (m *IPPuntRedirectDump) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.IsIPv6
- if m.IsIPv6 {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *IPPuntRedirectDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsIPv6
- m.IsIPv6 = tmp[pos] != 0
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.IsIPv6)
+ return buf.Bytes(), nil
+}
+func (m *IPPuntRedirectDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IsIPv6 = buf.DecodeBool()
return nil
}
-// IPPuntRedirectReply represents VPP binary API message 'ip_punt_redirect_reply'.
+// IPPuntRedirectReply defines message 'ip_punt_redirect_reply'.
type IPPuntRedirectReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *IPPuntRedirectReply) Reset() { *m = IPPuntRedirectReply{} }
-func (*IPPuntRedirectReply) GetMessageName() string { return "ip_punt_redirect_reply" }
-func (*IPPuntRedirectReply) GetCrcString() string { return "e8d4e804" }
-func (*IPPuntRedirectReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPPuntRedirectReply) Reset() { *m = IPPuntRedirectReply{} }
+func (*IPPuntRedirectReply) GetMessageName() string { return "ip_punt_redirect_reply" }
+func (*IPPuntRedirectReply) GetCrcString() string { return "e8d4e804" }
+func (*IPPuntRedirectReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IPPuntRedirectReply) Size() int {
+func (m *IPPuntRedirectReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPPuntRedirectReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPPuntRedirectReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *IPPuntRedirectReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
return nil
}
-// IPReassemblyEnableDisable represents VPP binary API message 'ip_reassembly_enable_disable'.
+// IPReassemblyEnableDisable defines message 'ip_reassembly_enable_disable'.
type IPReassemblyEnableDisable struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
EnableIP4 bool `binapi:"bool,name=enable_ip4" json:"enable_ip4,omitempty"`
@@ -2801,76 +2280,44 @@ type IPReassemblyEnableDisable struct {
Type IPReassType `binapi:"ip_reass_type,name=type" json:"type,omitempty"`
}
-func (m *IPReassemblyEnableDisable) Reset() { *m = IPReassemblyEnableDisable{} }
-func (*IPReassemblyEnableDisable) GetMessageName() string { return "ip_reassembly_enable_disable" }
-func (*IPReassemblyEnableDisable) GetCrcString() string { return "885c85a6" }
-func (*IPReassemblyEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPReassemblyEnableDisable) Reset() { *m = IPReassemblyEnableDisable{} }
+func (*IPReassemblyEnableDisable) GetMessageName() string { return "ip_reassembly_enable_disable" }
+func (*IPReassemblyEnableDisable) GetCrcString() string { return "885c85a6" }
+func (*IPReassemblyEnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPReassemblyEnableDisable) Size() int {
+func (m *IPReassemblyEnableDisable) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.EnableIP4
- size += 1
- // field[1] m.EnableIP6
- size += 1
- // field[1] m.Type
- size += 4
+ size += 4 // m.SwIfIndex
+ size += 1 // m.EnableIP4
+ size += 1 // m.EnableIP6
+ size += 4 // m.Type
return size
}
func (m *IPReassemblyEnableDisable) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.EnableIP4
- if m.EnableIP4 {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.EnableIP6
- if m.EnableIP6 {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Type
- o.PutUint32(buf[pos:pos+4], uint32(m.Type))
- pos += 4
- return buf, nil
-}
-func (m *IPReassemblyEnableDisable) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.EnableIP4
- m.EnableIP4 = tmp[pos] != 0
- pos += 1
- // field[1] m.EnableIP6
- m.EnableIP6 = tmp[pos] != 0
- pos += 1
- // field[1] m.Type
- m.Type = IPReassType(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.EnableIP4)
+ buf.EncodeBool(m.EnableIP6)
+ buf.EncodeUint32(uint32(m.Type))
+ return buf.Bytes(), nil
+}
+func (m *IPReassemblyEnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.EnableIP4 = buf.DecodeBool()
+ m.EnableIP6 = buf.DecodeBool()
+ m.Type = IPReassType(buf.DecodeUint32())
return nil
}
-// IPReassemblyEnableDisableReply represents VPP binary API message 'ip_reassembly_enable_disable_reply'.
+// IPReassemblyEnableDisableReply defines message 'ip_reassembly_enable_disable_reply'.
type IPReassemblyEnableDisableReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
@@ -2879,103 +2326,70 @@ func (m *IPReassemblyEnableDisableReply) Reset() { *m = IPReassemblyEnableDisabl
func (*IPReassemblyEnableDisableReply) GetMessageName() string {
return "ip_reassembly_enable_disable_reply"
}
-func (*IPReassemblyEnableDisableReply) GetCrcString() string { return "e8d4e804" }
-func (*IPReassemblyEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (*IPReassemblyEnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*IPReassemblyEnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IPReassemblyEnableDisableReply) Size() int {
+func (m *IPReassemblyEnableDisableReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPReassemblyEnableDisableReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPReassemblyEnableDisableReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *IPReassemblyEnableDisableReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
return nil
}
-// IPReassemblyGet represents VPP binary API message 'ip_reassembly_get'.
+// IPReassemblyGet defines message 'ip_reassembly_get'.
type IPReassemblyGet struct {
IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"`
Type IPReassType `binapi:"ip_reass_type,name=type" json:"type,omitempty"`
}
-func (m *IPReassemblyGet) Reset() { *m = IPReassemblyGet{} }
-func (*IPReassemblyGet) GetMessageName() string { return "ip_reassembly_get" }
-func (*IPReassemblyGet) GetCrcString() string { return "ea13ff63" }
-func (*IPReassemblyGet) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPReassemblyGet) Reset() { *m = IPReassemblyGet{} }
+func (*IPReassemblyGet) GetMessageName() string { return "ip_reassembly_get" }
+func (*IPReassemblyGet) GetCrcString() string { return "ea13ff63" }
+func (*IPReassemblyGet) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPReassemblyGet) Size() int {
+func (m *IPReassemblyGet) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.IsIP6
- size += 1
- // field[1] m.Type
- size += 4
+ size += 1 // m.IsIP6
+ size += 4 // m.Type
return size
}
func (m *IPReassemblyGet) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.IsIP6
- if m.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Type
- o.PutUint32(buf[pos:pos+4], uint32(m.Type))
- pos += 4
- return buf, nil
-}
-func (m *IPReassemblyGet) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsIP6
- m.IsIP6 = tmp[pos] != 0
- pos += 1
- // field[1] m.Type
- m.Type = IPReassType(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsIP6)
+ buf.EncodeUint32(uint32(m.Type))
+ return buf.Bytes(), nil
+}
+func (m *IPReassemblyGet) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsIP6 = buf.DecodeBool()
+ m.Type = IPReassType(buf.DecodeUint32())
return nil
}
-// IPReassemblyGetReply represents VPP binary API message 'ip_reassembly_get_reply'.
+// IPReassemblyGetReply defines message 'ip_reassembly_get_reply'.
type IPReassemblyGetReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
TimeoutMs uint32 `binapi:"u32,name=timeout_ms" json:"timeout_ms,omitempty"`
@@ -2985,90 +2399,50 @@ type IPReassemblyGetReply struct {
IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"`
}
-func (m *IPReassemblyGetReply) Reset() { *m = IPReassemblyGetReply{} }
-func (*IPReassemblyGetReply) GetMessageName() string { return "ip_reassembly_get_reply" }
-func (*IPReassemblyGetReply) GetCrcString() string { return "d5eb8d34" }
-func (*IPReassemblyGetReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPReassemblyGetReply) Reset() { *m = IPReassemblyGetReply{} }
+func (*IPReassemblyGetReply) GetMessageName() string { return "ip_reassembly_get_reply" }
+func (*IPReassemblyGetReply) GetCrcString() string { return "d5eb8d34" }
+func (*IPReassemblyGetReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IPReassemblyGetReply) Size() int {
+func (m *IPReassemblyGetReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.TimeoutMs
- size += 4
- // field[1] m.MaxReassemblies
- size += 4
- // field[1] m.MaxReassemblyLength
- size += 4
- // field[1] m.ExpireWalkIntervalMs
- size += 4
- // field[1] m.IsIP6
- size += 1
+ size += 4 // m.Retval
+ size += 4 // m.TimeoutMs
+ size += 4 // m.MaxReassemblies
+ size += 4 // m.MaxReassemblyLength
+ size += 4 // m.ExpireWalkIntervalMs
+ size += 1 // m.IsIP6
return size
}
func (m *IPReassemblyGetReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.TimeoutMs
- o.PutUint32(buf[pos:pos+4], uint32(m.TimeoutMs))
- pos += 4
- // field[1] m.MaxReassemblies
- o.PutUint32(buf[pos:pos+4], uint32(m.MaxReassemblies))
- pos += 4
- // field[1] m.MaxReassemblyLength
- o.PutUint32(buf[pos:pos+4], uint32(m.MaxReassemblyLength))
- pos += 4
- // field[1] m.ExpireWalkIntervalMs
- o.PutUint32(buf[pos:pos+4], uint32(m.ExpireWalkIntervalMs))
- pos += 4
- // field[1] m.IsIP6
- if m.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *IPReassemblyGetReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.TimeoutMs
- m.TimeoutMs = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.MaxReassemblies
- m.MaxReassemblies = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.MaxReassemblyLength
- m.MaxReassemblyLength = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.ExpireWalkIntervalMs
- m.ExpireWalkIntervalMs = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsIP6
- m.IsIP6 = tmp[pos] != 0
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint32(m.TimeoutMs)
+ buf.EncodeUint32(m.MaxReassemblies)
+ buf.EncodeUint32(m.MaxReassemblyLength)
+ buf.EncodeUint32(m.ExpireWalkIntervalMs)
+ buf.EncodeBool(m.IsIP6)
+ return buf.Bytes(), nil
+}
+func (m *IPReassemblyGetReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.TimeoutMs = buf.DecodeUint32()
+ m.MaxReassemblies = buf.DecodeUint32()
+ m.MaxReassemblyLength = buf.DecodeUint32()
+ m.ExpireWalkIntervalMs = buf.DecodeUint32()
+ m.IsIP6 = buf.DecodeBool()
return nil
}
-// IPReassemblySet represents VPP binary API message 'ip_reassembly_set'.
+// IPReassemblySet defines message 'ip_reassembly_set'.
type IPReassemblySet struct {
TimeoutMs uint32 `binapi:"u32,name=timeout_ms" json:"timeout_ms,omitempty"`
MaxReassemblies uint32 `binapi:"u32,name=max_reassemblies" json:"max_reassemblies,omitempty"`
@@ -3078,831 +2452,415 @@ type IPReassemblySet struct {
Type IPReassType `binapi:"ip_reass_type,name=type" json:"type,omitempty"`
}
-func (m *IPReassemblySet) Reset() { *m = IPReassemblySet{} }
-func (*IPReassemblySet) GetMessageName() string { return "ip_reassembly_set" }
-func (*IPReassemblySet) GetCrcString() string { return "16467d25" }
-func (*IPReassemblySet) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPReassemblySet) Reset() { *m = IPReassemblySet{} }
+func (*IPReassemblySet) GetMessageName() string { return "ip_reassembly_set" }
+func (*IPReassemblySet) GetCrcString() string { return "16467d25" }
+func (*IPReassemblySet) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPReassemblySet) Size() int {
+func (m *IPReassemblySet) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.TimeoutMs
- size += 4
- // field[1] m.MaxReassemblies
- size += 4
- // field[1] m.MaxReassemblyLength
- size += 4
- // field[1] m.ExpireWalkIntervalMs
- size += 4
- // field[1] m.IsIP6
- size += 1
- // field[1] m.Type
- size += 4
+ size += 4 // m.TimeoutMs
+ size += 4 // m.MaxReassemblies
+ size += 4 // m.MaxReassemblyLength
+ size += 4 // m.ExpireWalkIntervalMs
+ size += 1 // m.IsIP6
+ size += 4 // m.Type
return size
}
func (m *IPReassemblySet) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.TimeoutMs
- o.PutUint32(buf[pos:pos+4], uint32(m.TimeoutMs))
- pos += 4
- // field[1] m.MaxReassemblies
- o.PutUint32(buf[pos:pos+4], uint32(m.MaxReassemblies))
- pos += 4
- // field[1] m.MaxReassemblyLength
- o.PutUint32(buf[pos:pos+4], uint32(m.MaxReassemblyLength))
- pos += 4
- // field[1] m.ExpireWalkIntervalMs
- o.PutUint32(buf[pos:pos+4], uint32(m.ExpireWalkIntervalMs))
- pos += 4
- // field[1] m.IsIP6
- if m.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Type
- o.PutUint32(buf[pos:pos+4], uint32(m.Type))
- pos += 4
- return buf, nil
-}
-func (m *IPReassemblySet) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.TimeoutMs
- m.TimeoutMs = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.MaxReassemblies
- m.MaxReassemblies = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.MaxReassemblyLength
- m.MaxReassemblyLength = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.ExpireWalkIntervalMs
- m.ExpireWalkIntervalMs = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsIP6
- m.IsIP6 = tmp[pos] != 0
- pos += 1
- // field[1] m.Type
- m.Type = IPReassType(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.TimeoutMs)
+ buf.EncodeUint32(m.MaxReassemblies)
+ buf.EncodeUint32(m.MaxReassemblyLength)
+ buf.EncodeUint32(m.ExpireWalkIntervalMs)
+ buf.EncodeBool(m.IsIP6)
+ buf.EncodeUint32(uint32(m.Type))
+ return buf.Bytes(), nil
+}
+func (m *IPReassemblySet) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.TimeoutMs = buf.DecodeUint32()
+ m.MaxReassemblies = buf.DecodeUint32()
+ m.MaxReassemblyLength = buf.DecodeUint32()
+ m.ExpireWalkIntervalMs = buf.DecodeUint32()
+ m.IsIP6 = buf.DecodeBool()
+ m.Type = IPReassType(buf.DecodeUint32())
return nil
}
-// IPReassemblySetReply represents VPP binary API message 'ip_reassembly_set_reply'.
+// IPReassemblySetReply defines message 'ip_reassembly_set_reply'.
type IPReassemblySetReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *IPReassemblySetReply) Reset() { *m = IPReassemblySetReply{} }
-func (*IPReassemblySetReply) GetMessageName() string { return "ip_reassembly_set_reply" }
-func (*IPReassemblySetReply) GetCrcString() string { return "e8d4e804" }
-func (*IPReassemblySetReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPReassemblySetReply) Reset() { *m = IPReassemblySetReply{} }
+func (*IPReassemblySetReply) GetMessageName() string { return "ip_reassembly_set_reply" }
+func (*IPReassemblySetReply) GetCrcString() string { return "e8d4e804" }
+func (*IPReassemblySetReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IPReassemblySetReply) Size() int {
+func (m *IPReassemblySetReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPReassemblySetReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPReassemblySetReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *IPReassemblySetReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
return nil
}
-// IPRouteAddDel represents VPP binary API message 'ip_route_add_del'.
+// IPRouteAddDel defines message 'ip_route_add_del'.
type IPRouteAddDel struct {
IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
IsMultipath bool `binapi:"bool,name=is_multipath" json:"is_multipath,omitempty"`
Route IPRoute `binapi:"ip_route,name=route" json:"route,omitempty"`
}
-func (m *IPRouteAddDel) Reset() { *m = IPRouteAddDel{} }
-func (*IPRouteAddDel) GetMessageName() string { return "ip_route_add_del" }
-func (*IPRouteAddDel) GetCrcString() string { return "c1ff832d" }
-func (*IPRouteAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPRouteAddDel) Reset() { *m = IPRouteAddDel{} }
+func (*IPRouteAddDel) GetMessageName() string { return "ip_route_add_del" }
+func (*IPRouteAddDel) GetCrcString() string { return "c1ff832d" }
+func (*IPRouteAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPRouteAddDel) Size() int {
+func (m *IPRouteAddDel) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.IsAdd
- size += 1
- // field[1] m.IsMultipath
- size += 1
- // field[1] m.Route
- // field[2] m.Route.TableID
- size += 4
- // field[2] m.Route.StatsIndex
- size += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Address
- // field[4] m.Route.Prefix.Address.Af
- size += 4
- // field[4] m.Route.Prefix.Address.Un
- size += 16
- // field[3] m.Route.Prefix.Len
- size += 1
- // field[2] m.Route.NPaths
- size += 1
- // field[2] m.Route.Paths
+ size += 1 // m.IsAdd
+ size += 1 // m.IsMultipath
+ size += 4 // m.Route.TableID
+ size += 4 // m.Route.StatsIndex
+ size += 4 // m.Route.Prefix.Address.Af
+ size += 1 * 16 // m.Route.Prefix.Address.Un
+ size += 1 // m.Route.Prefix.Len
+ size += 1 // m.Route.NPaths
for j2 := 0; j2 < len(m.Route.Paths); j2++ {
var s2 FibPath
_ = s2
if j2 < len(m.Route.Paths) {
s2 = m.Route.Paths[j2]
}
- // field[3] s2.SwIfIndex
- size += 4
- // field[3] s2.TableID
- size += 4
- // field[3] s2.RpfID
- size += 4
- // field[3] s2.Weight
- size += 1
- // field[3] s2.Preference
- size += 1
- // field[3] s2.Type
- size += 4
- // field[3] s2.Flags
- size += 4
- // field[3] s2.Proto
- size += 4
- // field[3] s2.Nh
- // field[4] s2.Nh.Address
- size += 16
- // field[4] s2.Nh.ViaLabel
- size += 4
- // field[4] s2.Nh.ObjID
- size += 4
- // field[4] s2.Nh.ClassifyTableIndex
- size += 4
- // field[3] s2.NLabels
- size += 1
- // field[3] s2.LabelStack
+ size += 4 // s2.SwIfIndex
+ size += 4 // s2.TableID
+ size += 4 // s2.RpfID
+ size += 1 // s2.Weight
+ size += 1 // s2.Preference
+ size += 4 // s2.Type
+ size += 4 // s2.Flags
+ size += 4 // s2.Proto
+ size += 1 * 16 // s2.Nh.Address
+ size += 4 // s2.Nh.ViaLabel
+ size += 4 // s2.Nh.ObjID
+ size += 4 // s2.Nh.ClassifyTableIndex
+ size += 1 // s2.NLabels
for j3 := 0; j3 < 16; j3++ {
- var s3 FibMplsLabel
- _ = s3
- if j3 < len(s2.LabelStack) {
- s3 = s2.LabelStack[j3]
- }
- // field[4] s3.IsUniform
- size += 1
- // field[4] s3.Label
- size += 4
- // field[4] s3.TTL
- size += 1
- // field[4] s3.Exp
- size += 1
+ size += 1 // s2.LabelStack[j3].IsUniform
+ size += 4 // s2.LabelStack[j3].Label
+ size += 1 // s2.LabelStack[j3].TTL
+ size += 1 // s2.LabelStack[j3].Exp
}
}
return size
}
func (m *IPRouteAddDel) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.IsMultipath
- if m.IsMultipath {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Route
- // field[2] m.Route.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.TableID))
- pos += 4
- // field[2] m.Route.StatsIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.StatsIndex))
- pos += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Address
- // field[4] m.Route.Prefix.Address.Af
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.Prefix.Address.Af))
- pos += 4
- // field[4] m.Route.Prefix.Address.Un
- copy(buf[pos:pos+16], m.Route.Prefix.Address.Un.XXX_UnionData[:])
- pos += 16
- // field[3] m.Route.Prefix.Len
- buf[pos] = uint8(m.Route.Prefix.Len)
- pos += 1
- // field[2] m.Route.NPaths
- buf[pos] = uint8(len(m.Route.Paths))
- pos += 1
- // field[2] m.Route.Paths
- for j2 := 0; j2 < len(m.Route.Paths); j2++ {
- var v2 FibPath
- if j2 < len(m.Route.Paths) {
- v2 = m.Route.Paths[j2]
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeBool(m.IsMultipath)
+ buf.EncodeUint32(m.Route.TableID)
+ buf.EncodeUint32(m.Route.StatsIndex)
+ buf.EncodeUint32(uint32(m.Route.Prefix.Address.Af))
+ buf.EncodeBytes(m.Route.Prefix.Address.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint8(m.Route.Prefix.Len)
+ buf.EncodeUint8(uint8(len(m.Route.Paths)))
+ for j1 := 0; j1 < len(m.Route.Paths); j1++ {
+ var v1 FibPath // Paths
+ if j1 < len(m.Route.Paths) {
+ v1 = m.Route.Paths[j1]
}
- // field[3] v2.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(v2.SwIfIndex))
- pos += 4
- // field[3] v2.TableID
- o.PutUint32(buf[pos:pos+4], uint32(v2.TableID))
- pos += 4
- // field[3] v2.RpfID
- o.PutUint32(buf[pos:pos+4], uint32(v2.RpfID))
- pos += 4
- // field[3] v2.Weight
- buf[pos] = uint8(v2.Weight)
- pos += 1
- // field[3] v2.Preference
- buf[pos] = uint8(v2.Preference)
- pos += 1
- // field[3] v2.Type
- o.PutUint32(buf[pos:pos+4], uint32(v2.Type))
- pos += 4
- // field[3] v2.Flags
- o.PutUint32(buf[pos:pos+4], uint32(v2.Flags))
- pos += 4
- // field[3] v2.Proto
- o.PutUint32(buf[pos:pos+4], uint32(v2.Proto))
- pos += 4
- // field[3] v2.Nh
- // field[4] v2.Nh.Address
- copy(buf[pos:pos+16], v2.Nh.Address.XXX_UnionData[:])
- pos += 16
- // field[4] v2.Nh.ViaLabel
- o.PutUint32(buf[pos:pos+4], uint32(v2.Nh.ViaLabel))
- pos += 4
- // field[4] v2.Nh.ObjID
- o.PutUint32(buf[pos:pos+4], uint32(v2.Nh.ObjID))
- pos += 4
- // field[4] v2.Nh.ClassifyTableIndex
- o.PutUint32(buf[pos:pos+4], uint32(v2.Nh.ClassifyTableIndex))
- pos += 4
- // field[3] v2.NLabels
- buf[pos] = uint8(v2.NLabels)
- pos += 1
- // field[3] v2.LabelStack
- for j3 := 0; j3 < 16; j3++ {
- var v3 FibMplsLabel
- if j3 < len(v2.LabelStack) {
- v3 = v2.LabelStack[j3]
- }
- // field[4] v3.IsUniform
- buf[pos] = uint8(v3.IsUniform)
- pos += 1
- // field[4] v3.Label
- o.PutUint32(buf[pos:pos+4], uint32(v3.Label))
- pos += 4
- // field[4] v3.TTL
- buf[pos] = uint8(v3.TTL)
- pos += 1
- // field[4] v3.Exp
- buf[pos] = uint8(v3.Exp)
- pos += 1
+ buf.EncodeUint32(v1.SwIfIndex)
+ buf.EncodeUint32(v1.TableID)
+ buf.EncodeUint32(v1.RpfID)
+ buf.EncodeUint8(v1.Weight)
+ buf.EncodeUint8(v1.Preference)
+ buf.EncodeUint32(uint32(v1.Type))
+ buf.EncodeUint32(uint32(v1.Flags))
+ buf.EncodeUint32(uint32(v1.Proto))
+ buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16)
+ buf.EncodeUint32(v1.Nh.ViaLabel)
+ buf.EncodeUint32(v1.Nh.ObjID)
+ buf.EncodeUint32(v1.Nh.ClassifyTableIndex)
+ buf.EncodeUint8(v1.NLabels)
+ for j2 := 0; j2 < 16; j2++ {
+ buf.EncodeUint8(v1.LabelStack[j2].IsUniform)
+ buf.EncodeUint32(v1.LabelStack[j2].Label)
+ buf.EncodeUint8(v1.LabelStack[j2].TTL)
+ buf.EncodeUint8(v1.LabelStack[j2].Exp)
}
}
- return buf, nil
-}
-func (m *IPRouteAddDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
- // field[1] m.IsMultipath
- m.IsMultipath = tmp[pos] != 0
- pos += 1
- // field[1] m.Route
- // field[2] m.Route.TableID
- m.Route.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Route.StatsIndex
- m.Route.StatsIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Address
- // field[4] m.Route.Prefix.Address.Af
- m.Route.Prefix.Address.Af = AddressFamily(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Prefix.Address.Un
- copy(m.Route.Prefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[3] m.Route.Prefix.Len
- m.Route.Prefix.Len = uint8(tmp[pos])
- pos += 1
- // field[2] m.Route.NPaths
- m.Route.NPaths = uint8(tmp[pos])
- pos += 1
- // field[2] m.Route.Paths
- m.Route.Paths = make([]FibPath, int(m.Route.NPaths))
- for j2 := 0; j2 < int(m.Route.NPaths); j2++ {
- // field[3] m.Route.Paths[j2].SwIfIndex
- m.Route.Paths[j2].SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].TableID
- m.Route.Paths[j2].TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].RpfID
- m.Route.Paths[j2].RpfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Weight
- m.Route.Paths[j2].Weight = uint8(tmp[pos])
- pos += 1
- // field[3] m.Route.Paths[j2].Preference
- m.Route.Paths[j2].Preference = uint8(tmp[pos])
- pos += 1
- // field[3] m.Route.Paths[j2].Type
- m.Route.Paths[j2].Type = FibPathType(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Flags
- m.Route.Paths[j2].Flags = FibPathFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Proto
- m.Route.Paths[j2].Proto = FibPathNhProto(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Nh
- // field[4] m.Route.Paths[j2].Nh.Address
- copy(m.Route.Paths[j2].Nh.Address.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[4] m.Route.Paths[j2].Nh.ViaLabel
- m.Route.Paths[j2].Nh.ViaLabel = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Nh.ObjID
- m.Route.Paths[j2].Nh.ObjID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Nh.ClassifyTableIndex
- m.Route.Paths[j2].Nh.ClassifyTableIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].NLabels
- m.Route.Paths[j2].NLabels = uint8(tmp[pos])
- pos += 1
- // field[3] m.Route.Paths[j2].LabelStack
- for j3 := 0; j3 < 16; j3++ {
- // field[4] m.Route.Paths[j2].LabelStack[j3].IsUniform
- m.Route.Paths[j2].LabelStack[j3].IsUniform = uint8(tmp[pos])
- pos += 1
- // field[4] m.Route.Paths[j2].LabelStack[j3].Label
- m.Route.Paths[j2].LabelStack[j3].Label = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].LabelStack[j3].TTL
- m.Route.Paths[j2].LabelStack[j3].TTL = uint8(tmp[pos])
- pos += 1
- // field[4] m.Route.Paths[j2].LabelStack[j3].Exp
- m.Route.Paths[j2].LabelStack[j3].Exp = uint8(tmp[pos])
- pos += 1
+ return buf.Bytes(), nil
+}
+func (m *IPRouteAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.IsMultipath = buf.DecodeBool()
+ m.Route.TableID = buf.DecodeUint32()
+ m.Route.StatsIndex = buf.DecodeUint32()
+ m.Route.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Route.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Route.Prefix.Len = buf.DecodeUint8()
+ m.Route.NPaths = buf.DecodeUint8()
+ m.Route.Paths = make([]FibPath, m.Route.NPaths)
+ for j1 := 0; j1 < len(m.Route.Paths); j1++ {
+ m.Route.Paths[j1].SwIfIndex = buf.DecodeUint32()
+ m.Route.Paths[j1].TableID = buf.DecodeUint32()
+ m.Route.Paths[j1].RpfID = buf.DecodeUint32()
+ m.Route.Paths[j1].Weight = buf.DecodeUint8()
+ m.Route.Paths[j1].Preference = buf.DecodeUint8()
+ m.Route.Paths[j1].Type = FibPathType(buf.DecodeUint32())
+ m.Route.Paths[j1].Flags = FibPathFlags(buf.DecodeUint32())
+ m.Route.Paths[j1].Proto = FibPathNhProto(buf.DecodeUint32())
+ copy(m.Route.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Route.Paths[j1].Nh.ViaLabel = buf.DecodeUint32()
+ m.Route.Paths[j1].Nh.ObjID = buf.DecodeUint32()
+ m.Route.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
+ m.Route.Paths[j1].NLabels = buf.DecodeUint8()
+ for j2 := 0; j2 < 16; j2++ {
+ m.Route.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
+ m.Route.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32()
+ m.Route.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
+ m.Route.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
}
}
return nil
}
-// IPRouteAddDelReply represents VPP binary API message 'ip_route_add_del_reply'.
+// IPRouteAddDelReply defines message 'ip_route_add_del_reply'.
type IPRouteAddDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"`
}
-func (m *IPRouteAddDelReply) Reset() { *m = IPRouteAddDelReply{} }
-func (*IPRouteAddDelReply) GetMessageName() string { return "ip_route_add_del_reply" }
-func (*IPRouteAddDelReply) GetCrcString() string { return "1992deab" }
-func (*IPRouteAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPRouteAddDelReply) Reset() { *m = IPRouteAddDelReply{} }
+func (*IPRouteAddDelReply) GetMessageName() string { return "ip_route_add_del_reply" }
+func (*IPRouteAddDelReply) GetCrcString() string { return "1992deab" }
+func (*IPRouteAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IPRouteAddDelReply) Size() int {
+func (m *IPRouteAddDelReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.StatsIndex
- size += 4
+ size += 4 // m.Retval
+ size += 4 // m.StatsIndex
return size
}
func (m *IPRouteAddDelReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- // field[1] m.StatsIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.StatsIndex))
- pos += 4
- return buf, nil
-}
-func (m *IPRouteAddDelReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.StatsIndex
- m.StatsIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint32(m.StatsIndex)
+ return buf.Bytes(), nil
+}
+func (m *IPRouteAddDelReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.StatsIndex = buf.DecodeUint32()
return nil
}
-// IPRouteDetails represents VPP binary API message 'ip_route_details'.
+// IPRouteDetails defines message 'ip_route_details'.
type IPRouteDetails struct {
Route IPRoute `binapi:"ip_route,name=route" json:"route,omitempty"`
}
-func (m *IPRouteDetails) Reset() { *m = IPRouteDetails{} }
-func (*IPRouteDetails) GetMessageName() string { return "ip_route_details" }
-func (*IPRouteDetails) GetCrcString() string { return "d1ffaae1" }
-func (*IPRouteDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPRouteDetails) Reset() { *m = IPRouteDetails{} }
+func (*IPRouteDetails) GetMessageName() string { return "ip_route_details" }
+func (*IPRouteDetails) GetCrcString() string { return "d1ffaae1" }
+func (*IPRouteDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IPRouteDetails) Size() int {
+func (m *IPRouteDetails) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Route
- // field[2] m.Route.TableID
- size += 4
- // field[2] m.Route.StatsIndex
- size += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Address
- // field[4] m.Route.Prefix.Address.Af
- size += 4
- // field[4] m.Route.Prefix.Address.Un
- size += 16
- // field[3] m.Route.Prefix.Len
- size += 1
- // field[2] m.Route.NPaths
- size += 1
- // field[2] m.Route.Paths
+ size += 4 // m.Route.TableID
+ size += 4 // m.Route.StatsIndex
+ size += 4 // m.Route.Prefix.Address.Af
+ size += 1 * 16 // m.Route.Prefix.Address.Un
+ size += 1 // m.Route.Prefix.Len
+ size += 1 // m.Route.NPaths
for j2 := 0; j2 < len(m.Route.Paths); j2++ {
var s2 FibPath
_ = s2
if j2 < len(m.Route.Paths) {
s2 = m.Route.Paths[j2]
}
- // field[3] s2.SwIfIndex
- size += 4
- // field[3] s2.TableID
- size += 4
- // field[3] s2.RpfID
- size += 4
- // field[3] s2.Weight
- size += 1
- // field[3] s2.Preference
- size += 1
- // field[3] s2.Type
- size += 4
- // field[3] s2.Flags
- size += 4
- // field[3] s2.Proto
- size += 4
- // field[3] s2.Nh
- // field[4] s2.Nh.Address
- size += 16
- // field[4] s2.Nh.ViaLabel
- size += 4
- // field[4] s2.Nh.ObjID
- size += 4
- // field[4] s2.Nh.ClassifyTableIndex
- size += 4
- // field[3] s2.NLabels
- size += 1
- // field[3] s2.LabelStack
+ size += 4 // s2.SwIfIndex
+ size += 4 // s2.TableID
+ size += 4 // s2.RpfID
+ size += 1 // s2.Weight
+ size += 1 // s2.Preference
+ size += 4 // s2.Type
+ size += 4 // s2.Flags
+ size += 4 // s2.Proto
+ size += 1 * 16 // s2.Nh.Address
+ size += 4 // s2.Nh.ViaLabel
+ size += 4 // s2.Nh.ObjID
+ size += 4 // s2.Nh.ClassifyTableIndex
+ size += 1 // s2.NLabels
for j3 := 0; j3 < 16; j3++ {
- var s3 FibMplsLabel
- _ = s3
- if j3 < len(s2.LabelStack) {
- s3 = s2.LabelStack[j3]
- }
- // field[4] s3.IsUniform
- size += 1
- // field[4] s3.Label
- size += 4
- // field[4] s3.TTL
- size += 1
- // field[4] s3.Exp
- size += 1
+ size += 1 // s2.LabelStack[j3].IsUniform
+ size += 4 // s2.LabelStack[j3].Label
+ size += 1 // s2.LabelStack[j3].TTL
+ size += 1 // s2.LabelStack[j3].Exp
}
}
return size
}
func (m *IPRouteDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Route
- // field[2] m.Route.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.TableID))
- pos += 4
- // field[2] m.Route.StatsIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.StatsIndex))
- pos += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Address
- // field[4] m.Route.Prefix.Address.Af
- o.PutUint32(buf[pos:pos+4], uint32(m.Route.Prefix.Address.Af))
- pos += 4
- // field[4] m.Route.Prefix.Address.Un
- copy(buf[pos:pos+16], m.Route.Prefix.Address.Un.XXX_UnionData[:])
- pos += 16
- // field[3] m.Route.Prefix.Len
- buf[pos] = uint8(m.Route.Prefix.Len)
- pos += 1
- // field[2] m.Route.NPaths
- buf[pos] = uint8(len(m.Route.Paths))
- pos += 1
- // field[2] m.Route.Paths
- for j2 := 0; j2 < len(m.Route.Paths); j2++ {
- var v2 FibPath
- if j2 < len(m.Route.Paths) {
- v2 = m.Route.Paths[j2]
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Route.TableID)
+ buf.EncodeUint32(m.Route.StatsIndex)
+ buf.EncodeUint32(uint32(m.Route.Prefix.Address.Af))
+ buf.EncodeBytes(m.Route.Prefix.Address.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint8(m.Route.Prefix.Len)
+ buf.EncodeUint8(uint8(len(m.Route.Paths)))
+ for j1 := 0; j1 < len(m.Route.Paths); j1++ {
+ var v1 FibPath // Paths
+ if j1 < len(m.Route.Paths) {
+ v1 = m.Route.Paths[j1]
}
- // field[3] v2.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(v2.SwIfIndex))
- pos += 4
- // field[3] v2.TableID
- o.PutUint32(buf[pos:pos+4], uint32(v2.TableID))
- pos += 4
- // field[3] v2.RpfID
- o.PutUint32(buf[pos:pos+4], uint32(v2.RpfID))
- pos += 4
- // field[3] v2.Weight
- buf[pos] = uint8(v2.Weight)
- pos += 1
- // field[3] v2.Preference
- buf[pos] = uint8(v2.Preference)
- pos += 1
- // field[3] v2.Type
- o.PutUint32(buf[pos:pos+4], uint32(v2.Type))
- pos += 4
- // field[3] v2.Flags
- o.PutUint32(buf[pos:pos+4], uint32(v2.Flags))
- pos += 4
- // field[3] v2.Proto
- o.PutUint32(buf[pos:pos+4], uint32(v2.Proto))
- pos += 4
- // field[3] v2.Nh
- // field[4] v2.Nh.Address
- copy(buf[pos:pos+16], v2.Nh.Address.XXX_UnionData[:])
- pos += 16
- // field[4] v2.Nh.ViaLabel
- o.PutUint32(buf[pos:pos+4], uint32(v2.Nh.ViaLabel))
- pos += 4
- // field[4] v2.Nh.ObjID
- o.PutUint32(buf[pos:pos+4], uint32(v2.Nh.ObjID))
- pos += 4
- // field[4] v2.Nh.ClassifyTableIndex
- o.PutUint32(buf[pos:pos+4], uint32(v2.Nh.ClassifyTableIndex))
- pos += 4
- // field[3] v2.NLabels
- buf[pos] = uint8(v2.NLabels)
- pos += 1
- // field[3] v2.LabelStack
- for j3 := 0; j3 < 16; j3++ {
- var v3 FibMplsLabel
- if j3 < len(v2.LabelStack) {
- v3 = v2.LabelStack[j3]
- }
- // field[4] v3.IsUniform
- buf[pos] = uint8(v3.IsUniform)
- pos += 1
- // field[4] v3.Label
- o.PutUint32(buf[pos:pos+4], uint32(v3.Label))
- pos += 4
- // field[4] v3.TTL
- buf[pos] = uint8(v3.TTL)
- pos += 1
- // field[4] v3.Exp
- buf[pos] = uint8(v3.Exp)
- pos += 1
+ buf.EncodeUint32(v1.SwIfIndex)
+ buf.EncodeUint32(v1.TableID)
+ buf.EncodeUint32(v1.RpfID)
+ buf.EncodeUint8(v1.Weight)
+ buf.EncodeUint8(v1.Preference)
+ buf.EncodeUint32(uint32(v1.Type))
+ buf.EncodeUint32(uint32(v1.Flags))
+ buf.EncodeUint32(uint32(v1.Proto))
+ buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16)
+ buf.EncodeUint32(v1.Nh.ViaLabel)
+ buf.EncodeUint32(v1.Nh.ObjID)
+ buf.EncodeUint32(v1.Nh.ClassifyTableIndex)
+ buf.EncodeUint8(v1.NLabels)
+ for j2 := 0; j2 < 16; j2++ {
+ buf.EncodeUint8(v1.LabelStack[j2].IsUniform)
+ buf.EncodeUint32(v1.LabelStack[j2].Label)
+ buf.EncodeUint8(v1.LabelStack[j2].TTL)
+ buf.EncodeUint8(v1.LabelStack[j2].Exp)
}
}
- return buf, nil
-}
-func (m *IPRouteDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Route
- // field[2] m.Route.TableID
- m.Route.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Route.StatsIndex
- m.Route.StatsIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Route.Prefix
- // field[3] m.Route.Prefix.Address
- // field[4] m.Route.Prefix.Address.Af
- m.Route.Prefix.Address.Af = AddressFamily(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Prefix.Address.Un
- copy(m.Route.Prefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[3] m.Route.Prefix.Len
- m.Route.Prefix.Len = uint8(tmp[pos])
- pos += 1
- // field[2] m.Route.NPaths
- m.Route.NPaths = uint8(tmp[pos])
- pos += 1
- // field[2] m.Route.Paths
- m.Route.Paths = make([]FibPath, int(m.Route.NPaths))
- for j2 := 0; j2 < int(m.Route.NPaths); j2++ {
- // field[3] m.Route.Paths[j2].SwIfIndex
- m.Route.Paths[j2].SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].TableID
- m.Route.Paths[j2].TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].RpfID
- m.Route.Paths[j2].RpfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Weight
- m.Route.Paths[j2].Weight = uint8(tmp[pos])
- pos += 1
- // field[3] m.Route.Paths[j2].Preference
- m.Route.Paths[j2].Preference = uint8(tmp[pos])
- pos += 1
- // field[3] m.Route.Paths[j2].Type
- m.Route.Paths[j2].Type = FibPathType(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Flags
- m.Route.Paths[j2].Flags = FibPathFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Proto
- m.Route.Paths[j2].Proto = FibPathNhProto(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Nh
- // field[4] m.Route.Paths[j2].Nh.Address
- copy(m.Route.Paths[j2].Nh.Address.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[4] m.Route.Paths[j2].Nh.ViaLabel
- m.Route.Paths[j2].Nh.ViaLabel = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Nh.ObjID
- m.Route.Paths[j2].Nh.ObjID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Nh.ClassifyTableIndex
- m.Route.Paths[j2].Nh.ClassifyTableIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].NLabels
- m.Route.Paths[j2].NLabels = uint8(tmp[pos])
- pos += 1
- // field[3] m.Route.Paths[j2].LabelStack
- for j3 := 0; j3 < 16; j3++ {
- // field[4] m.Route.Paths[j2].LabelStack[j3].IsUniform
- m.Route.Paths[j2].LabelStack[j3].IsUniform = uint8(tmp[pos])
- pos += 1
- // field[4] m.Route.Paths[j2].LabelStack[j3].Label
- m.Route.Paths[j2].LabelStack[j3].Label = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].LabelStack[j3].TTL
- m.Route.Paths[j2].LabelStack[j3].TTL = uint8(tmp[pos])
- pos += 1
- // field[4] m.Route.Paths[j2].LabelStack[j3].Exp
- m.Route.Paths[j2].LabelStack[j3].Exp = uint8(tmp[pos])
- pos += 1
+ return buf.Bytes(), nil
+}
+func (m *IPRouteDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Route.TableID = buf.DecodeUint32()
+ m.Route.StatsIndex = buf.DecodeUint32()
+ m.Route.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Route.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Route.Prefix.Len = buf.DecodeUint8()
+ m.Route.NPaths = buf.DecodeUint8()
+ m.Route.Paths = make([]FibPath, m.Route.NPaths)
+ for j1 := 0; j1 < len(m.Route.Paths); j1++ {
+ m.Route.Paths[j1].SwIfIndex = buf.DecodeUint32()
+ m.Route.Paths[j1].TableID = buf.DecodeUint32()
+ m.Route.Paths[j1].RpfID = buf.DecodeUint32()
+ m.Route.Paths[j1].Weight = buf.DecodeUint8()
+ m.Route.Paths[j1].Preference = buf.DecodeUint8()
+ m.Route.Paths[j1].Type = FibPathType(buf.DecodeUint32())
+ m.Route.Paths[j1].Flags = FibPathFlags(buf.DecodeUint32())
+ m.Route.Paths[j1].Proto = FibPathNhProto(buf.DecodeUint32())
+ copy(m.Route.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Route.Paths[j1].Nh.ViaLabel = buf.DecodeUint32()
+ m.Route.Paths[j1].Nh.ObjID = buf.DecodeUint32()
+ m.Route.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
+ m.Route.Paths[j1].NLabels = buf.DecodeUint8()
+ for j2 := 0; j2 < 16; j2++ {
+ m.Route.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
+ m.Route.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32()
+ m.Route.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
+ m.Route.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
}
}
return nil
}
-// IPRouteDump represents VPP binary API message 'ip_route_dump'.
+// IPRouteDump defines message 'ip_route_dump'.
type IPRouteDump struct {
Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
}
-func (m *IPRouteDump) Reset() { *m = IPRouteDump{} }
-func (*IPRouteDump) GetMessageName() string { return "ip_route_dump" }
-func (*IPRouteDump) GetCrcString() string { return "b9d2e09e" }
-func (*IPRouteDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPRouteDump) Reset() { *m = IPRouteDump{} }
+func (*IPRouteDump) GetMessageName() string { return "ip_route_dump" }
+func (*IPRouteDump) GetCrcString() string { return "b9d2e09e" }
+func (*IPRouteDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPRouteDump) Size() int {
+func (m *IPRouteDump) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Table
- // field[2] m.Table.TableID
- size += 4
- // field[2] m.Table.IsIP6
- size += 1
- // field[2] m.Table.Name
- size += 64
+ size += 4 // m.Table.TableID
+ size += 1 // m.Table.IsIP6
+ size += 64 // m.Table.Name
return size
}
func (m *IPRouteDump) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Table
- // field[2] m.Table.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Table.TableID))
- pos += 4
- // field[2] m.Table.IsIP6
- if m.Table.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- // field[2] m.Table.Name
- copy(buf[pos:pos+64], m.Table.Name)
- pos += 64
- return buf, nil
-}
-func (m *IPRouteDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Table
- // field[2] m.Table.TableID
- m.Table.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Table.IsIP6
- m.Table.IsIP6 = tmp[pos] != 0
- pos += 1
- // field[2] m.Table.Name
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Table.Name = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Table.TableID)
+ buf.EncodeBool(m.Table.IsIP6)
+ buf.EncodeString(m.Table.Name, 64)
+ return buf.Bytes(), nil
+}
+func (m *IPRouteDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Table.TableID = buf.DecodeUint32()
+ m.Table.IsIP6 = buf.DecodeBool()
+ m.Table.Name = buf.DecodeString(64)
return nil
}
-// IPSourceAndPortRangeCheckAddDel represents VPP binary API message 'ip_source_and_port_range_check_add_del'.
+// IPSourceAndPortRangeCheckAddDel defines message 'ip_source_and_port_range_check_add_del'.
type IPSourceAndPortRangeCheckAddDel struct {
IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
Prefix Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
NumberOfRanges uint8 `binapi:"u8,name=number_of_ranges" json:"number_of_ranges,omitempty"`
- LowPorts []uint16 `binapi:"u16[32],name=low_ports" json:"low_ports,omitempty" struc:"[32]uint16"`
- HighPorts []uint16 `binapi:"u16[32],name=high_ports" json:"high_ports,omitempty" struc:"[32]uint16"`
+ LowPorts []uint16 `binapi:"u16[32],name=low_ports" json:"low_ports,omitempty"`
+ HighPorts []uint16 `binapi:"u16[32],name=high_ports" json:"high_ports,omitempty"`
VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
}
@@ -3910,128 +2868,72 @@ func (m *IPSourceAndPortRangeCheckAddDel) Reset() { *m = IPSourceAndPortRangeChe
func (*IPSourceAndPortRangeCheckAddDel) GetMessageName() string {
return "ip_source_and_port_range_check_add_del"
}
-func (*IPSourceAndPortRangeCheckAddDel) GetCrcString() string { return "8bfc76f2" }
-func (*IPSourceAndPortRangeCheckAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
+func (*IPSourceAndPortRangeCheckAddDel) GetCrcString() string { return "8bfc76f2" }
+func (*IPSourceAndPortRangeCheckAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPSourceAndPortRangeCheckAddDel) Size() int {
+func (m *IPSourceAndPortRangeCheckAddDel) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.IsAdd
- size += 1
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- size += 4
- // field[3] m.Prefix.Address.Un
- size += 16
- // field[2] m.Prefix.Len
- size += 1
- // field[1] m.NumberOfRanges
- size += 1
- // field[1] m.LowPorts
- size += 64
- // field[1] m.HighPorts
- size += 64
- // field[1] m.VrfID
- size += 4
+ size += 1 // m.IsAdd
+ size += 4 // m.Prefix.Address.Af
+ size += 1 * 16 // m.Prefix.Address.Un
+ size += 1 // m.Prefix.Len
+ size += 1 // m.NumberOfRanges
+ size += 2 * 32 // m.LowPorts
+ size += 2 * 32 // m.HighPorts
+ size += 4 // m.VrfID
return size
}
func (m *IPSourceAndPortRangeCheckAddDel) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- o.PutUint32(buf[pos:pos+4], uint32(m.Prefix.Address.Af))
- pos += 4
- // field[3] m.Prefix.Address.Un
- copy(buf[pos:pos+16], m.Prefix.Address.Un.XXX_UnionData[:])
- pos += 16
- // field[2] m.Prefix.Len
- buf[pos] = uint8(m.Prefix.Len)
- pos += 1
- // field[1] m.NumberOfRanges
- buf[pos] = uint8(m.NumberOfRanges)
- pos += 1
- // field[1] m.LowPorts
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(uint32(m.Prefix.Address.Af))
+ buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16)
+ buf.EncodeUint8(m.Prefix.Len)
+ buf.EncodeUint8(m.NumberOfRanges)
for i := 0; i < 32; i++ {
var x uint16
if i < len(m.LowPorts) {
x = uint16(m.LowPorts[i])
}
- o.PutUint16(buf[pos:pos+2], uint16(x))
- pos += 2
+ buf.EncodeUint16(x)
}
- // field[1] m.HighPorts
for i := 0; i < 32; i++ {
var x uint16
if i < len(m.HighPorts) {
x = uint16(m.HighPorts[i])
}
- o.PutUint16(buf[pos:pos+2], uint16(x))
- pos += 2
- }
- // field[1] m.VrfID
- o.PutUint32(buf[pos:pos+4], uint32(m.VrfID))
- pos += 4
- return buf, nil
-}
-func (m *IPSourceAndPortRangeCheckAddDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- m.Prefix.Address.Af = AddressFamily(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Prefix.Address.Un
- copy(m.Prefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[2] m.Prefix.Len
- m.Prefix.Len = uint8(tmp[pos])
- pos += 1
- // field[1] m.NumberOfRanges
- m.NumberOfRanges = uint8(tmp[pos])
- pos += 1
- // field[1] m.LowPorts
+ buf.EncodeUint16(x)
+ }
+ buf.EncodeUint32(m.VrfID)
+ return buf.Bytes(), nil
+}
+func (m *IPSourceAndPortRangeCheckAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
+ copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.Prefix.Len = buf.DecodeUint8()
+ m.NumberOfRanges = buf.DecodeUint8()
m.LowPorts = make([]uint16, 32)
for i := 0; i < len(m.LowPorts); i++ {
- m.LowPorts[i] = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
+ m.LowPorts[i] = buf.DecodeUint16()
}
- // field[1] m.HighPorts
m.HighPorts = make([]uint16, 32)
for i := 0; i < len(m.HighPorts); i++ {
- m.HighPorts[i] = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
+ m.HighPorts[i] = buf.DecodeUint16()
}
- // field[1] m.VrfID
- m.VrfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ m.VrfID = buf.DecodeUint32()
return nil
}
-// IPSourceAndPortRangeCheckAddDelReply represents VPP binary API message 'ip_source_and_port_range_check_add_del_reply'.
+// IPSourceAndPortRangeCheckAddDelReply defines message 'ip_source_and_port_range_check_add_del_reply'.
type IPSourceAndPortRangeCheckAddDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
@@ -4045,43 +2947,28 @@ func (*IPSourceAndPortRangeCheckAddDelReply) GetMessageType() api.MessageType {
return api.ReplyMessage
}
-func (m *IPSourceAndPortRangeCheckAddDelReply) Size() int {
+func (m *IPSourceAndPortRangeCheckAddDelReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPSourceAndPortRangeCheckAddDelReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPSourceAndPortRangeCheckAddDelReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *IPSourceAndPortRangeCheckAddDelReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
return nil
}
-// IPSourceAndPortRangeCheckInterfaceAddDel represents VPP binary API message 'ip_source_and_port_range_check_interface_add_del'.
+// IPSourceAndPortRangeCheckInterfaceAddDel defines message 'ip_source_and_port_range_check_interface_add_del'.
type IPSourceAndPortRangeCheckInterfaceAddDel struct {
IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
@@ -4102,85 +2989,43 @@ func (*IPSourceAndPortRangeCheckInterfaceAddDel) GetMessageType() api.MessageTyp
return api.RequestMessage
}
-func (m *IPSourceAndPortRangeCheckInterfaceAddDel) Size() int {
+func (m *IPSourceAndPortRangeCheckInterfaceAddDel) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.IsAdd
- size += 1
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.TCPInVrfID
- size += 4
- // field[1] m.TCPOutVrfID
- size += 4
- // field[1] m.UDPInVrfID
- size += 4
- // field[1] m.UDPOutVrfID
- size += 4
+ size += 1 // m.IsAdd
+ size += 4 // m.SwIfIndex
+ size += 4 // m.TCPInVrfID
+ size += 4 // m.TCPOutVrfID
+ size += 4 // m.UDPInVrfID
+ size += 4 // m.UDPOutVrfID
return size
}
func (m *IPSourceAndPortRangeCheckInterfaceAddDel) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.TCPInVrfID
- o.PutUint32(buf[pos:pos+4], uint32(m.TCPInVrfID))
- pos += 4
- // field[1] m.TCPOutVrfID
- o.PutUint32(buf[pos:pos+4], uint32(m.TCPOutVrfID))
- pos += 4
- // field[1] m.UDPInVrfID
- o.PutUint32(buf[pos:pos+4], uint32(m.UDPInVrfID))
- pos += 4
- // field[1] m.UDPOutVrfID
- o.PutUint32(buf[pos:pos+4], uint32(m.UDPOutVrfID))
- pos += 4
- return buf, nil
-}
-func (m *IPSourceAndPortRangeCheckInterfaceAddDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.TCPInVrfID
- m.TCPInVrfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.TCPOutVrfID
- m.TCPOutVrfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.UDPInVrfID
- m.UDPInVrfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.UDPOutVrfID
- m.UDPOutVrfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.TCPInVrfID)
+ buf.EncodeUint32(m.TCPOutVrfID)
+ buf.EncodeUint32(m.UDPInVrfID)
+ buf.EncodeUint32(m.UDPOutVrfID)
+ return buf.Bytes(), nil
+}
+func (m *IPSourceAndPortRangeCheckInterfaceAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.TCPInVrfID = buf.DecodeUint32()
+ m.TCPOutVrfID = buf.DecodeUint32()
+ m.UDPInVrfID = buf.DecodeUint32()
+ m.UDPOutVrfID = buf.DecodeUint32()
return nil
}
-// IPSourceAndPortRangeCheckInterfaceAddDelReply represents VPP binary API message 'ip_source_and_port_range_check_interface_add_del_reply'.
+// IPSourceAndPortRangeCheckInterfaceAddDelReply defines message 'ip_source_and_port_range_check_interface_add_del_reply'.
type IPSourceAndPortRangeCheckInterfaceAddDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
@@ -4196,43 +3041,28 @@ func (*IPSourceAndPortRangeCheckInterfaceAddDelReply) GetMessageType() api.Messa
return api.ReplyMessage
}
-func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) Size() int {
+func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
return nil
}
-// IPSourceCheckInterfaceAddDel represents VPP binary API message 'ip_source_check_interface_add_del'.
+// IPSourceCheckInterfaceAddDel defines message 'ip_source_check_interface_add_del'.
type IPSourceCheckInterfaceAddDel struct {
IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
Loose bool `binapi:"bool,name=loose" json:"loose,omitempty"`
@@ -4243,66 +3073,39 @@ func (m *IPSourceCheckInterfaceAddDel) Reset() { *m = IPSourceCheckInterfaceAddD
func (*IPSourceCheckInterfaceAddDel) GetMessageName() string {
return "ip_source_check_interface_add_del"
}
-func (*IPSourceCheckInterfaceAddDel) GetCrcString() string { return "6612356b" }
-func (*IPSourceCheckInterfaceAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
+func (*IPSourceCheckInterfaceAddDel) GetCrcString() string { return "6612356b" }
+func (*IPSourceCheckInterfaceAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPSourceCheckInterfaceAddDel) Size() int {
+func (m *IPSourceCheckInterfaceAddDel) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.IsAdd
- size += 1
- // field[1] m.Loose
- size += 1
- // field[1] m.SwIfIndex
- size += 4
+ size += 1 // m.IsAdd
+ size += 1 // m.Loose
+ size += 4 // m.SwIfIndex
return size
}
func (m *IPSourceCheckInterfaceAddDel) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Loose
- if m.Loose {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *IPSourceCheckInterfaceAddDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
- // field[1] m.Loose
- m.Loose = tmp[pos] != 0
- pos += 1
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeBool(m.Loose)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *IPSourceCheckInterfaceAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Loose = buf.DecodeBool()
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
return nil
}
-// IPSourceCheckInterfaceAddDelReply represents VPP binary API message 'ip_source_check_interface_add_del_reply'.
+// IPSourceCheckInterfaceAddDelReply defines message 'ip_source_check_interface_add_del_reply'.
type IPSourceCheckInterfaceAddDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
@@ -4311,882 +3114,547 @@ func (m *IPSourceCheckInterfaceAddDelReply) Reset() { *m = IPSourceCheckInterfac
func (*IPSourceCheckInterfaceAddDelReply) GetMessageName() string {
return "ip_source_check_interface_add_del_reply"
}
-func (*IPSourceCheckInterfaceAddDelReply) GetCrcString() string { return "e8d4e804" }
-func (*IPSourceCheckInterfaceAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (*IPSourceCheckInterfaceAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*IPSourceCheckInterfaceAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IPSourceCheckInterfaceAddDelReply) Size() int {
+func (m *IPSourceCheckInterfaceAddDelReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPSourceCheckInterfaceAddDelReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPSourceCheckInterfaceAddDelReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *IPSourceCheckInterfaceAddDelReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
return nil
}
-// IPTableAddDel represents VPP binary API message 'ip_table_add_del'.
+// IPTableAddDel defines message 'ip_table_add_del'.
type IPTableAddDel struct {
IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
}
-func (m *IPTableAddDel) Reset() { *m = IPTableAddDel{} }
-func (*IPTableAddDel) GetMessageName() string { return "ip_table_add_del" }
-func (*IPTableAddDel) GetCrcString() string { return "0ffdaec0" }
-func (*IPTableAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPTableAddDel) Reset() { *m = IPTableAddDel{} }
+func (*IPTableAddDel) GetMessageName() string { return "ip_table_add_del" }
+func (*IPTableAddDel) GetCrcString() string { return "0ffdaec0" }
+func (*IPTableAddDel) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPTableAddDel) Size() int {
+func (m *IPTableAddDel) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.IsAdd
- size += 1
- // field[1] m.Table
- // field[2] m.Table.TableID
- size += 4
- // field[2] m.Table.IsIP6
- size += 1
- // field[2] m.Table.Name
- size += 64
+ size += 1 // m.IsAdd
+ size += 4 // m.Table.TableID
+ size += 1 // m.Table.IsIP6
+ size += 64 // m.Table.Name
return size
}
func (m *IPTableAddDel) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Table
- // field[2] m.Table.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Table.TableID))
- pos += 4
- // field[2] m.Table.IsIP6
- if m.Table.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- // field[2] m.Table.Name
- copy(buf[pos:pos+64], m.Table.Name)
- pos += 64
- return buf, nil
-}
-func (m *IPTableAddDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
- // field[1] m.Table
- // field[2] m.Table.TableID
- m.Table.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Table.IsIP6
- m.Table.IsIP6 = tmp[pos] != 0
- pos += 1
- // field[2] m.Table.Name
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Table.Name = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsAdd)
+ buf.EncodeUint32(m.Table.TableID)
+ buf.EncodeBool(m.Table.IsIP6)
+ buf.EncodeString(m.Table.Name, 64)
+ return buf.Bytes(), nil
+}
+func (m *IPTableAddDel) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsAdd = buf.DecodeBool()
+ m.Table.TableID = buf.DecodeUint32()
+ m.Table.IsIP6 = buf.DecodeBool()
+ m.Table.Name = buf.DecodeString(64)
return nil
}
-// IPTableAddDelReply represents VPP binary API message 'ip_table_add_del_reply'.
+// IPTableAddDelReply defines message 'ip_table_add_del_reply'.
type IPTableAddDelReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *IPTableAddDelReply) Reset() { *m = IPTableAddDelReply{} }
-func (*IPTableAddDelReply) GetMessageName() string { return "ip_table_add_del_reply" }
-func (*IPTableAddDelReply) GetCrcString() string { return "e8d4e804" }
-func (*IPTableAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPTableAddDelReply) Reset() { *m = IPTableAddDelReply{} }
+func (*IPTableAddDelReply) GetMessageName() string { return "ip_table_add_del_reply" }
+func (*IPTableAddDelReply) GetCrcString() string { return "e8d4e804" }
+func (*IPTableAddDelReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IPTableAddDelReply) Size() int {
+func (m *IPTableAddDelReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPTableAddDelReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPTableAddDelReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *IPTableAddDelReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
return nil
}
-// IPTableDetails represents VPP binary API message 'ip_table_details'.
+// IPTableDetails defines message 'ip_table_details'.
type IPTableDetails struct {
Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
}
-func (m *IPTableDetails) Reset() { *m = IPTableDetails{} }
-func (*IPTableDetails) GetMessageName() string { return "ip_table_details" }
-func (*IPTableDetails) GetCrcString() string { return "c79fca0f" }
-func (*IPTableDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPTableDetails) Reset() { *m = IPTableDetails{} }
+func (*IPTableDetails) GetMessageName() string { return "ip_table_details" }
+func (*IPTableDetails) GetCrcString() string { return "c79fca0f" }
+func (*IPTableDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IPTableDetails) Size() int {
+func (m *IPTableDetails) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Table
- // field[2] m.Table.TableID
- size += 4
- // field[2] m.Table.IsIP6
- size += 1
- // field[2] m.Table.Name
- size += 64
+ size += 4 // m.Table.TableID
+ size += 1 // m.Table.IsIP6
+ size += 64 // m.Table.Name
return size
}
func (m *IPTableDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Table
- // field[2] m.Table.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Table.TableID))
- pos += 4
- // field[2] m.Table.IsIP6
- if m.Table.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- // field[2] m.Table.Name
- copy(buf[pos:pos+64], m.Table.Name)
- pos += 64
- return buf, nil
-}
-func (m *IPTableDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Table
- // field[2] m.Table.TableID
- m.Table.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Table.IsIP6
- m.Table.IsIP6 = tmp[pos] != 0
- pos += 1
- // field[2] m.Table.Name
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Table.Name = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Table.TableID)
+ buf.EncodeBool(m.Table.IsIP6)
+ buf.EncodeString(m.Table.Name, 64)
+ return buf.Bytes(), nil
+}
+func (m *IPTableDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Table.TableID = buf.DecodeUint32()
+ m.Table.IsIP6 = buf.DecodeBool()
+ m.Table.Name = buf.DecodeString(64)
return nil
}
-// IPTableDump represents VPP binary API message 'ip_table_dump'.
+// IPTableDump defines message 'ip_table_dump'.
type IPTableDump struct{}
-func (m *IPTableDump) Reset() { *m = IPTableDump{} }
-func (*IPTableDump) GetMessageName() string { return "ip_table_dump" }
-func (*IPTableDump) GetCrcString() string { return "51077d14" }
-func (*IPTableDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPTableDump) Reset() { *m = IPTableDump{} }
+func (*IPTableDump) GetMessageName() string { return "ip_table_dump" }
+func (*IPTableDump) GetCrcString() string { return "51077d14" }
+func (*IPTableDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPTableDump) Size() int {
+func (m *IPTableDump) Size() (size int) {
if m == nil {
return 0
}
- var size int
return size
}
func (m *IPTableDump) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *IPTableDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *IPTableDump) Unmarshal(b []byte) error {
return nil
}
-// IPTableFlush represents VPP binary API message 'ip_table_flush'.
+// IPTableFlush defines message 'ip_table_flush'.
type IPTableFlush struct {
Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
}
-func (m *IPTableFlush) Reset() { *m = IPTableFlush{} }
-func (*IPTableFlush) GetMessageName() string { return "ip_table_flush" }
-func (*IPTableFlush) GetCrcString() string { return "b9d2e09e" }
-func (*IPTableFlush) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPTableFlush) Reset() { *m = IPTableFlush{} }
+func (*IPTableFlush) GetMessageName() string { return "ip_table_flush" }
+func (*IPTableFlush) GetCrcString() string { return "b9d2e09e" }
+func (*IPTableFlush) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPTableFlush) Size() int {
+func (m *IPTableFlush) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Table
- // field[2] m.Table.TableID
- size += 4
- // field[2] m.Table.IsIP6
- size += 1
- // field[2] m.Table.Name
- size += 64
+ size += 4 // m.Table.TableID
+ size += 1 // m.Table.IsIP6
+ size += 64 // m.Table.Name
return size
}
func (m *IPTableFlush) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Table
- // field[2] m.Table.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Table.TableID))
- pos += 4
- // field[2] m.Table.IsIP6
- if m.Table.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- // field[2] m.Table.Name
- copy(buf[pos:pos+64], m.Table.Name)
- pos += 64
- return buf, nil
-}
-func (m *IPTableFlush) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Table
- // field[2] m.Table.TableID
- m.Table.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Table.IsIP6
- m.Table.IsIP6 = tmp[pos] != 0
- pos += 1
- // field[2] m.Table.Name
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Table.Name = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Table.TableID)
+ buf.EncodeBool(m.Table.IsIP6)
+ buf.EncodeString(m.Table.Name, 64)
+ return buf.Bytes(), nil
+}
+func (m *IPTableFlush) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Table.TableID = buf.DecodeUint32()
+ m.Table.IsIP6 = buf.DecodeBool()
+ m.Table.Name = buf.DecodeString(64)
return nil
}
-// IPTableFlushReply represents VPP binary API message 'ip_table_flush_reply'.
+// IPTableFlushReply defines message 'ip_table_flush_reply'.
type IPTableFlushReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *IPTableFlushReply) Reset() { *m = IPTableFlushReply{} }
-func (*IPTableFlushReply) GetMessageName() string { return "ip_table_flush_reply" }
-func (*IPTableFlushReply) GetCrcString() string { return "e8d4e804" }
-func (*IPTableFlushReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPTableFlushReply) Reset() { *m = IPTableFlushReply{} }
+func (*IPTableFlushReply) GetMessageName() string { return "ip_table_flush_reply" }
+func (*IPTableFlushReply) GetCrcString() string { return "e8d4e804" }
+func (*IPTableFlushReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IPTableFlushReply) Size() int {
+func (m *IPTableFlushReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPTableFlushReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPTableFlushReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *IPTableFlushReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
return nil
}
-// IPTableReplaceBegin represents VPP binary API message 'ip_table_replace_begin'.
+// IPTableReplaceBegin defines message 'ip_table_replace_begin'.
type IPTableReplaceBegin struct {
Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
}
-func (m *IPTableReplaceBegin) Reset() { *m = IPTableReplaceBegin{} }
-func (*IPTableReplaceBegin) GetMessageName() string { return "ip_table_replace_begin" }
-func (*IPTableReplaceBegin) GetCrcString() string { return "b9d2e09e" }
-func (*IPTableReplaceBegin) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPTableReplaceBegin) Reset() { *m = IPTableReplaceBegin{} }
+func (*IPTableReplaceBegin) GetMessageName() string { return "ip_table_replace_begin" }
+func (*IPTableReplaceBegin) GetCrcString() string { return "b9d2e09e" }
+func (*IPTableReplaceBegin) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPTableReplaceBegin) Size() int {
+func (m *IPTableReplaceBegin) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Table
- // field[2] m.Table.TableID
- size += 4
- // field[2] m.Table.IsIP6
- size += 1
- // field[2] m.Table.Name
- size += 64
+ size += 4 // m.Table.TableID
+ size += 1 // m.Table.IsIP6
+ size += 64 // m.Table.Name
return size
}
func (m *IPTableReplaceBegin) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Table
- // field[2] m.Table.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Table.TableID))
- pos += 4
- // field[2] m.Table.IsIP6
- if m.Table.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- // field[2] m.Table.Name
- copy(buf[pos:pos+64], m.Table.Name)
- pos += 64
- return buf, nil
-}
-func (m *IPTableReplaceBegin) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Table
- // field[2] m.Table.TableID
- m.Table.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Table.IsIP6
- m.Table.IsIP6 = tmp[pos] != 0
- pos += 1
- // field[2] m.Table.Name
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Table.Name = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Table.TableID)
+ buf.EncodeBool(m.Table.IsIP6)
+ buf.EncodeString(m.Table.Name, 64)
+ return buf.Bytes(), nil
+}
+func (m *IPTableReplaceBegin) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Table.TableID = buf.DecodeUint32()
+ m.Table.IsIP6 = buf.DecodeBool()
+ m.Table.Name = buf.DecodeString(64)
return nil
}
-// IPTableReplaceBeginReply represents VPP binary API message 'ip_table_replace_begin_reply'.
+// IPTableReplaceBeginReply defines message 'ip_table_replace_begin_reply'.
type IPTableReplaceBeginReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *IPTableReplaceBeginReply) Reset() { *m = IPTableReplaceBeginReply{} }
-func (*IPTableReplaceBeginReply) GetMessageName() string { return "ip_table_replace_begin_reply" }
-func (*IPTableReplaceBeginReply) GetCrcString() string { return "e8d4e804" }
-func (*IPTableReplaceBeginReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPTableReplaceBeginReply) Reset() { *m = IPTableReplaceBeginReply{} }
+func (*IPTableReplaceBeginReply) GetMessageName() string { return "ip_table_replace_begin_reply" }
+func (*IPTableReplaceBeginReply) GetCrcString() string { return "e8d4e804" }
+func (*IPTableReplaceBeginReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IPTableReplaceBeginReply) Size() int {
+func (m *IPTableReplaceBeginReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPTableReplaceBeginReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPTableReplaceBeginReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *IPTableReplaceBeginReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
return nil
}
-// IPTableReplaceEnd represents VPP binary API message 'ip_table_replace_end'.
+// IPTableReplaceEnd defines message 'ip_table_replace_end'.
type IPTableReplaceEnd struct {
Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
}
-func (m *IPTableReplaceEnd) Reset() { *m = IPTableReplaceEnd{} }
-func (*IPTableReplaceEnd) GetMessageName() string { return "ip_table_replace_end" }
-func (*IPTableReplaceEnd) GetCrcString() string { return "b9d2e09e" }
-func (*IPTableReplaceEnd) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPTableReplaceEnd) Reset() { *m = IPTableReplaceEnd{} }
+func (*IPTableReplaceEnd) GetMessageName() string { return "ip_table_replace_end" }
+func (*IPTableReplaceEnd) GetCrcString() string { return "b9d2e09e" }
+func (*IPTableReplaceEnd) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPTableReplaceEnd) Size() int {
+func (m *IPTableReplaceEnd) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Table
- // field[2] m.Table.TableID
- size += 4
- // field[2] m.Table.IsIP6
- size += 1
- // field[2] m.Table.Name
- size += 64
+ size += 4 // m.Table.TableID
+ size += 1 // m.Table.IsIP6
+ size += 64 // m.Table.Name
return size
}
func (m *IPTableReplaceEnd) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Table
- // field[2] m.Table.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.Table.TableID))
- pos += 4
- // field[2] m.Table.IsIP6
- if m.Table.IsIP6 {
- buf[pos] = 1
- }
- pos += 1
- // field[2] m.Table.Name
- copy(buf[pos:pos+64], m.Table.Name)
- pos += 64
- return buf, nil
-}
-func (m *IPTableReplaceEnd) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Table
- // field[2] m.Table.TableID
- m.Table.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Table.IsIP6
- m.Table.IsIP6 = tmp[pos] != 0
- pos += 1
- // field[2] m.Table.Name
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Table.Name = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.Table.TableID)
+ buf.EncodeBool(m.Table.IsIP6)
+ buf.EncodeString(m.Table.Name, 64)
+ return buf.Bytes(), nil
+}
+func (m *IPTableReplaceEnd) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Table.TableID = buf.DecodeUint32()
+ m.Table.IsIP6 = buf.DecodeBool()
+ m.Table.Name = buf.DecodeString(64)
return nil
}
-// IPTableReplaceEndReply represents VPP binary API message 'ip_table_replace_end_reply'.
+// IPTableReplaceEndReply defines message 'ip_table_replace_end_reply'.
type IPTableReplaceEndReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *IPTableReplaceEndReply) Reset() { *m = IPTableReplaceEndReply{} }
-func (*IPTableReplaceEndReply) GetMessageName() string { return "ip_table_replace_end_reply" }
-func (*IPTableReplaceEndReply) GetCrcString() string { return "e8d4e804" }
-func (*IPTableReplaceEndReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPTableReplaceEndReply) Reset() { *m = IPTableReplaceEndReply{} }
+func (*IPTableReplaceEndReply) GetMessageName() string { return "ip_table_replace_end_reply" }
+func (*IPTableReplaceEndReply) GetCrcString() string { return "e8d4e804" }
+func (*IPTableReplaceEndReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IPTableReplaceEndReply) Size() int {
+func (m *IPTableReplaceEndReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *IPTableReplaceEndReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *IPTableReplaceEndReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *IPTableReplaceEndReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
return nil
}
-// IPUnnumberedDetails represents VPP binary API message 'ip_unnumbered_details'.
+// IPUnnumberedDetails defines message 'ip_unnumbered_details'.
type IPUnnumberedDetails struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
IPSwIfIndex InterfaceIndex `binapi:"interface_index,name=ip_sw_if_index" json:"ip_sw_if_index,omitempty"`
}
-func (m *IPUnnumberedDetails) Reset() { *m = IPUnnumberedDetails{} }
-func (*IPUnnumberedDetails) GetMessageName() string { return "ip_unnumbered_details" }
-func (*IPUnnumberedDetails) GetCrcString() string { return "aa12a483" }
-func (*IPUnnumberedDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *IPUnnumberedDetails) Reset() { *m = IPUnnumberedDetails{} }
+func (*IPUnnumberedDetails) GetMessageName() string { return "ip_unnumbered_details" }
+func (*IPUnnumberedDetails) GetCrcString() string { return "aa12a483" }
+func (*IPUnnumberedDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *IPUnnumberedDetails) Size() int {
+func (m *IPUnnumberedDetails) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.IPSwIfIndex
- size += 4
+ size += 4 // m.SwIfIndex
+ size += 4 // m.IPSwIfIndex
return size
}
func (m *IPUnnumberedDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.IPSwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.IPSwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *IPUnnumberedDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IPSwIfIndex
- m.IPSwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(uint32(m.IPSwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *IPUnnumberedDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.IPSwIfIndex = InterfaceIndex(buf.DecodeUint32())
return nil
}
-// IPUnnumberedDump represents VPP binary API message 'ip_unnumbered_dump'.
+// IPUnnumberedDump defines message 'ip_unnumbered_dump'.
type IPUnnumberedDump struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
}
-func (m *IPUnnumberedDump) Reset() { *m = IPUnnumberedDump{} }
-func (*IPUnnumberedDump) GetMessageName() string { return "ip_unnumbered_dump" }
-func (*IPUnnumberedDump) GetCrcString() string { return "f9e6675e" }
-func (*IPUnnumberedDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *IPUnnumberedDump) Reset() { *m = IPUnnumberedDump{} }
+func (*IPUnnumberedDump) GetMessageName() string { return "ip_unnumbered_dump" }
+func (*IPUnnumberedDump) GetCrcString() string { return "f9e6675e" }
+func (*IPUnnumberedDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *IPUnnumberedDump) Size() int {
+func (m *IPUnnumberedDump) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.SwIfIndex
- size += 4
+ size += 4 // m.SwIfIndex
return size
}
func (m *IPUnnumberedDump) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *IPUnnumberedDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *IPUnnumberedDump) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
return nil
}
-// MfibSignalDetails represents VPP binary API message 'mfib_signal_details'.
+// MfibSignalDetails defines message 'mfib_signal_details'.
type MfibSignalDetails struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
Prefix Mprefix `binapi:"mprefix,name=prefix" json:"prefix,omitempty"`
IPPacketLen uint16 `binapi:"u16,name=ip_packet_len" json:"ip_packet_len,omitempty"`
- IPPacketData []byte `binapi:"u8[256],name=ip_packet_data" json:"ip_packet_data,omitempty" struc:"[256]byte"`
+ IPPacketData []byte `binapi:"u8[256],name=ip_packet_data" json:"ip_packet_data,omitempty"`
}
-func (m *MfibSignalDetails) Reset() { *m = MfibSignalDetails{} }
-func (*MfibSignalDetails) GetMessageName() string { return "mfib_signal_details" }
-func (*MfibSignalDetails) GetCrcString() string { return "64398a9a" }
-func (*MfibSignalDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *MfibSignalDetails) Reset() { *m = MfibSignalDetails{} }
+func (*MfibSignalDetails) GetMessageName() string { return "mfib_signal_details" }
+func (*MfibSignalDetails) GetCrcString() string { return "64398a9a" }
+func (*MfibSignalDetails) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *MfibSignalDetails) Size() int {
+func (m *MfibSignalDetails) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.TableID
- size += 4
- // field[1] m.Prefix
- // field[2] m.Prefix.Af
- size += 4
- // field[2] m.Prefix.GrpAddressLength
- size += 2
- // field[2] m.Prefix.GrpAddress
- size += 16
- // field[2] m.Prefix.SrcAddress
- size += 16
- // field[1] m.IPPacketLen
- size += 2
- // field[1] m.IPPacketData
- size += 256
+ size += 4 // m.SwIfIndex
+ size += 4 // m.TableID
+ size += 4 // m.Prefix.Af
+ size += 2 // m.Prefix.GrpAddressLength
+ size += 1 * 16 // m.Prefix.GrpAddress
+ size += 1 * 16 // m.Prefix.SrcAddress
+ size += 2 // m.IPPacketLen
+ size += 1 * 256 // m.IPPacketData
return size
}
func (m *MfibSignalDetails) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.TableID))
- pos += 4
- // field[1] m.Prefix
- // field[2] m.Prefix.Af
- o.PutUint32(buf[pos:pos+4], uint32(m.Prefix.Af))
- pos += 4
- // field[2] m.Prefix.GrpAddressLength
- o.PutUint16(buf[pos:pos+2], uint16(m.Prefix.GrpAddressLength))
- pos += 2
- // field[2] m.Prefix.GrpAddress
- copy(buf[pos:pos+16], m.Prefix.GrpAddress.XXX_UnionData[:])
- pos += 16
- // field[2] m.Prefix.SrcAddress
- copy(buf[pos:pos+16], m.Prefix.SrcAddress.XXX_UnionData[:])
- pos += 16
- // field[1] m.IPPacketLen
- o.PutUint16(buf[pos:pos+2], uint16(m.IPPacketLen))
- pos += 2
- // field[1] m.IPPacketData
- for i := 0; i < 256; i++ {
- var x uint8
- if i < len(m.IPPacketData) {
- x = uint8(m.IPPacketData[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- return buf, nil
-}
-func (m *MfibSignalDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.TableID
- m.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Prefix
- // field[2] m.Prefix.Af
- m.Prefix.Af = AddressFamily(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Prefix.GrpAddressLength
- m.Prefix.GrpAddressLength = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[2] m.Prefix.GrpAddress
- copy(m.Prefix.GrpAddress.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[2] m.Prefix.SrcAddress
- copy(m.Prefix.SrcAddress.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[1] m.IPPacketLen
- m.IPPacketLen = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[1] m.IPPacketData
- m.IPPacketData = make([]uint8, 256)
- for i := 0; i < len(m.IPPacketData); i++ {
- m.IPPacketData[i] = uint8(tmp[pos])
- pos += 1
- }
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeUint32(m.TableID)
+ buf.EncodeUint32(uint32(m.Prefix.Af))
+ buf.EncodeUint16(m.Prefix.GrpAddressLength)
+ buf.EncodeBytes(m.Prefix.GrpAddress.XXX_UnionData[:], 16)
+ buf.EncodeBytes(m.Prefix.SrcAddress.XXX_UnionData[:], 16)
+ buf.EncodeUint16(m.IPPacketLen)
+ buf.EncodeBytes(m.IPPacketData, 256)
+ return buf.Bytes(), nil
+}
+func (m *MfibSignalDetails) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.TableID = buf.DecodeUint32()
+ m.Prefix.Af = AddressFamily(buf.DecodeUint32())
+ m.Prefix.GrpAddressLength = buf.DecodeUint16()
+ copy(m.Prefix.GrpAddress.XXX_UnionData[:], buf.DecodeBytes(16))
+ copy(m.Prefix.SrcAddress.XXX_UnionData[:], buf.DecodeBytes(16))
+ m.IPPacketLen = buf.DecodeUint16()
+ m.IPPacketData = make([]byte, 256)
+ copy(m.IPPacketData, buf.DecodeBytes(len(m.IPPacketData)))
return nil
}
-// MfibSignalDump represents VPP binary API message 'mfib_signal_dump'.
+// MfibSignalDump defines message 'mfib_signal_dump'.
type MfibSignalDump struct{}
-func (m *MfibSignalDump) Reset() { *m = MfibSignalDump{} }
-func (*MfibSignalDump) GetMessageName() string { return "mfib_signal_dump" }
-func (*MfibSignalDump) GetCrcString() string { return "51077d14" }
-func (*MfibSignalDump) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *MfibSignalDump) Reset() { *m = MfibSignalDump{} }
+func (*MfibSignalDump) GetMessageName() string { return "mfib_signal_dump" }
+func (*MfibSignalDump) GetCrcString() string { return "51077d14" }
+func (*MfibSignalDump) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *MfibSignalDump) Size() int {
+func (m *MfibSignalDump) Size() (size int) {
if m == nil {
return 0
}
- var size int
return size
}
func (m *MfibSignalDump) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
+ b = make([]byte, m.Size())
}
- return buf, nil
+ buf := codec.NewBuffer(b)
+ return buf.Bytes(), nil
}
-func (m *MfibSignalDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
+func (m *MfibSignalDump) Unmarshal(b []byte) error {
return nil
}
-// SetIPFlowHash represents VPP binary API message 'set_ip_flow_hash'.
+// SetIPFlowHash defines message 'set_ip_flow_hash'.
type SetIPFlowHash struct {
VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
@@ -5199,231 +3667,129 @@ type SetIPFlowHash struct {
Symmetric bool `binapi:"bool,name=symmetric" json:"symmetric,omitempty"`
}
-func (m *SetIPFlowHash) Reset() { *m = SetIPFlowHash{} }
-func (*SetIPFlowHash) GetMessageName() string { return "set_ip_flow_hash" }
-func (*SetIPFlowHash) GetCrcString() string { return "084ee09e" }
-func (*SetIPFlowHash) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *SetIPFlowHash) Reset() { *m = SetIPFlowHash{} }
+func (*SetIPFlowHash) GetMessageName() string { return "set_ip_flow_hash" }
+func (*SetIPFlowHash) GetCrcString() string { return "084ee09e" }
+func (*SetIPFlowHash) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *SetIPFlowHash) Size() int {
+func (m *SetIPFlowHash) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.VrfID
- size += 4
- // field[1] m.IsIPv6
- size += 1
- // field[1] m.Src
- size += 1
- // field[1] m.Dst
- size += 1
- // field[1] m.Sport
- size += 1
- // field[1] m.Dport
- size += 1
- // field[1] m.Proto
- size += 1
- // field[1] m.Reverse
- size += 1
- // field[1] m.Symmetric
- size += 1
+ size += 4 // m.VrfID
+ size += 1 // m.IsIPv6
+ size += 1 // m.Src
+ size += 1 // m.Dst
+ size += 1 // m.Sport
+ size += 1 // m.Dport
+ size += 1 // m.Proto
+ size += 1 // m.Reverse
+ size += 1 // m.Symmetric
return size
}
func (m *SetIPFlowHash) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.VrfID
- o.PutUint32(buf[pos:pos+4], uint32(m.VrfID))
- pos += 4
- // field[1] m.IsIPv6
- if m.IsIPv6 {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Src
- if m.Src {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Dst
- if m.Dst {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Sport
- if m.Sport {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Dport
- if m.Dport {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Proto
- if m.Proto {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Reverse
- if m.Reverse {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Symmetric
- if m.Symmetric {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *SetIPFlowHash) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.VrfID
- m.VrfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsIPv6
- m.IsIPv6 = tmp[pos] != 0
- pos += 1
- // field[1] m.Src
- m.Src = tmp[pos] != 0
- pos += 1
- // field[1] m.Dst
- m.Dst = tmp[pos] != 0
- pos += 1
- // field[1] m.Sport
- m.Sport = tmp[pos] != 0
- pos += 1
- // field[1] m.Dport
- m.Dport = tmp[pos] != 0
- pos += 1
- // field[1] m.Proto
- m.Proto = tmp[pos] != 0
- pos += 1
- // field[1] m.Reverse
- m.Reverse = tmp[pos] != 0
- pos += 1
- // field[1] m.Symmetric
- m.Symmetric = tmp[pos] != 0
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.VrfID)
+ buf.EncodeBool(m.IsIPv6)
+ buf.EncodeBool(m.Src)
+ buf.EncodeBool(m.Dst)
+ buf.EncodeBool(m.Sport)
+ buf.EncodeBool(m.Dport)
+ buf.EncodeBool(m.Proto)
+ buf.EncodeBool(m.Reverse)
+ buf.EncodeBool(m.Symmetric)
+ return buf.Bytes(), nil
+}
+func (m *SetIPFlowHash) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.VrfID = buf.DecodeUint32()
+ m.IsIPv6 = buf.DecodeBool()
+ m.Src = buf.DecodeBool()
+ m.Dst = buf.DecodeBool()
+ m.Sport = buf.DecodeBool()
+ m.Dport = buf.DecodeBool()
+ m.Proto = buf.DecodeBool()
+ m.Reverse = buf.DecodeBool()
+ m.Symmetric = buf.DecodeBool()
return nil
}
-// SetIPFlowHashReply represents VPP binary API message 'set_ip_flow_hash_reply'.
+// SetIPFlowHashReply defines message 'set_ip_flow_hash_reply'.
type SetIPFlowHashReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
-func (m *SetIPFlowHashReply) Reset() { *m = SetIPFlowHashReply{} }
-func (*SetIPFlowHashReply) GetMessageName() string { return "set_ip_flow_hash_reply" }
-func (*SetIPFlowHashReply) GetCrcString() string { return "e8d4e804" }
-func (*SetIPFlowHashReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (m *SetIPFlowHashReply) Reset() { *m = SetIPFlowHashReply{} }
+func (*SetIPFlowHashReply) GetMessageName() string { return "set_ip_flow_hash_reply" }
+func (*SetIPFlowHashReply) GetCrcString() string { return "e8d4e804" }
+func (*SetIPFlowHashReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *SetIPFlowHashReply) Size() int {
+func (m *SetIPFlowHashReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *SetIPFlowHashReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SetIPFlowHashReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *SetIPFlowHashReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
return nil
}
-// SwInterfaceIP6EnableDisable represents VPP binary API message 'sw_interface_ip6_enable_disable'.
+// SwInterfaceIP6EnableDisable defines message 'sw_interface_ip6_enable_disable'.
type SwInterfaceIP6EnableDisable struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
}
-func (m *SwInterfaceIP6EnableDisable) Reset() { *m = SwInterfaceIP6EnableDisable{} }
-func (*SwInterfaceIP6EnableDisable) GetMessageName() string { return "sw_interface_ip6_enable_disable" }
-func (*SwInterfaceIP6EnableDisable) GetCrcString() string { return "ae6cfcfb" }
-func (*SwInterfaceIP6EnableDisable) GetMessageType() api.MessageType { return api.RequestMessage }
+func (m *SwInterfaceIP6EnableDisable) Reset() { *m = SwInterfaceIP6EnableDisable{} }
+func (*SwInterfaceIP6EnableDisable) GetMessageName() string { return "sw_interface_ip6_enable_disable" }
+func (*SwInterfaceIP6EnableDisable) GetCrcString() string { return "ae6cfcfb" }
+func (*SwInterfaceIP6EnableDisable) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *SwInterfaceIP6EnableDisable) Size() int {
+func (m *SwInterfaceIP6EnableDisable) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Enable
- size += 1
+ size += 4 // m.SwIfIndex
+ size += 1 // m.Enable
return size
}
func (m *SwInterfaceIP6EnableDisable) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.Enable
- if m.Enable {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *SwInterfaceIP6EnableDisable) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Enable
- m.Enable = tmp[pos] != 0
- pos += 1
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBool(m.Enable)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceIP6EnableDisable) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ m.Enable = buf.DecodeBool()
return nil
}
-// SwInterfaceIP6EnableDisableReply represents VPP binary API message 'sw_interface_ip6_enable_disable_reply'.
+// SwInterfaceIP6EnableDisableReply defines message 'sw_interface_ip6_enable_disable_reply'.
type SwInterfaceIP6EnableDisableReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
@@ -5432,46 +3798,33 @@ func (m *SwInterfaceIP6EnableDisableReply) Reset() { *m = SwInterfaceIP6EnableDi
func (*SwInterfaceIP6EnableDisableReply) GetMessageName() string {
return "sw_interface_ip6_enable_disable_reply"
}
-func (*SwInterfaceIP6EnableDisableReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceIP6EnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage }
+func (*SwInterfaceIP6EnableDisableReply) GetCrcString() string { return "e8d4e804" }
+func (*SwInterfaceIP6EnableDisableReply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
-func (m *SwInterfaceIP6EnableDisableReply) Size() int {
+func (m *SwInterfaceIP6EnableDisableReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *SwInterfaceIP6EnableDisableReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceIP6EnableDisableReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceIP6EnableDisableReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
return nil
}
-// SwInterfaceIP6SetLinkLocalAddress represents VPP binary API message 'sw_interface_ip6_set_link_local_address'.
+// SwInterfaceIP6SetLinkLocalAddress defines message 'sw_interface_ip6_set_link_local_address'.
type SwInterfaceIP6SetLinkLocalAddress struct {
SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
IP IP6Address `binapi:"ip6_address,name=ip" json:"ip,omitempty"`
@@ -5481,62 +3834,36 @@ func (m *SwInterfaceIP6SetLinkLocalAddress) Reset() { *m = SwInterfaceIP6SetLink
func (*SwInterfaceIP6SetLinkLocalAddress) GetMessageName() string {
return "sw_interface_ip6_set_link_local_address"
}
-func (*SwInterfaceIP6SetLinkLocalAddress) GetCrcString() string { return "2931d9fa" }
-func (*SwInterfaceIP6SetLinkLocalAddress) GetMessageType() api.MessageType { return api.RequestMessage }
+func (*SwInterfaceIP6SetLinkLocalAddress) GetCrcString() string { return "2931d9fa" }
+func (*SwInterfaceIP6SetLinkLocalAddress) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
-func (m *SwInterfaceIP6SetLinkLocalAddress) Size() int {
+func (m *SwInterfaceIP6SetLinkLocalAddress) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.IP
- size += 16
+ size += 4 // m.SwIfIndex
+ size += 1 * 16 // m.IP
return size
}
func (m *SwInterfaceIP6SetLinkLocalAddress) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.IP
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.IP) {
- x = uint8(m.IP[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- return buf, nil
-}
-func (m *SwInterfaceIP6SetLinkLocalAddress) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IP
- for i := 0; i < len(m.IP); i++ {
- m.IP[i] = uint8(tmp[pos])
- pos += 1
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ buf.EncodeBytes(m.IP[:], 16)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceIP6SetLinkLocalAddress) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
+ copy(m.IP[:], buf.DecodeBytes(16))
return nil
}
-// SwInterfaceIP6SetLinkLocalAddressReply represents VPP binary API message 'sw_interface_ip6_set_link_local_address_reply'.
+// SwInterfaceIP6SetLinkLocalAddressReply defines message 'sw_interface_ip6_set_link_local_address_reply'.
type SwInterfaceIP6SetLinkLocalAddressReply struct {
Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
}
@@ -5552,104 +3879,89 @@ func (*SwInterfaceIP6SetLinkLocalAddressReply) GetMessageType() api.MessageType
return api.ReplyMessage
}
-func (m *SwInterfaceIP6SetLinkLocalAddressReply) Size() int {
+func (m *SwInterfaceIP6SetLinkLocalAddressReply) Size() (size int) {
if m == nil {
return 0
}
- var size int
- // field[1] m.Retval
- size += 4
+ size += 4 // m.Retval
return size
}
func (m *SwInterfaceIP6SetLinkLocalAddressReply) Marshal(b []byte) ([]byte, error) {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- var buf []byte
if b == nil {
- buf = make([]byte, m.Size())
- } else {
- buf = b
- }
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceIP6SetLinkLocalAddressReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ return buf.Bytes(), nil
+}
+func (m *SwInterfaceIP6SetLinkLocalAddressReply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
return nil
}
func init() { file_ip_binapi_init() }
func file_ip_binapi_init() {
- api.RegisterMessage((*IoamDisable)(nil), "ip.IoamDisable")
- api.RegisterMessage((*IoamDisableReply)(nil), "ip.IoamDisableReply")
- api.RegisterMessage((*IoamEnable)(nil), "ip.IoamEnable")
- api.RegisterMessage((*IoamEnableReply)(nil), "ip.IoamEnableReply")
- api.RegisterMessage((*IPAddressDetails)(nil), "ip.IPAddressDetails")
- api.RegisterMessage((*IPAddressDump)(nil), "ip.IPAddressDump")
- api.RegisterMessage((*IPContainerProxyAddDel)(nil), "ip.IPContainerProxyAddDel")
- api.RegisterMessage((*IPContainerProxyAddDelReply)(nil), "ip.IPContainerProxyAddDelReply")
- api.RegisterMessage((*IPContainerProxyDetails)(nil), "ip.IPContainerProxyDetails")
- api.RegisterMessage((*IPContainerProxyDump)(nil), "ip.IPContainerProxyDump")
- api.RegisterMessage((*IPDetails)(nil), "ip.IPDetails")
- api.RegisterMessage((*IPDump)(nil), "ip.IPDump")
- api.RegisterMessage((*IPMrouteAddDel)(nil), "ip.IPMrouteAddDel")
- api.RegisterMessage((*IPMrouteAddDelReply)(nil), "ip.IPMrouteAddDelReply")
- api.RegisterMessage((*IPMrouteDetails)(nil), "ip.IPMrouteDetails")
- api.RegisterMessage((*IPMrouteDump)(nil), "ip.IPMrouteDump")
- api.RegisterMessage((*IPMtableDetails)(nil), "ip.IPMtableDetails")
- api.RegisterMessage((*IPMtableDump)(nil), "ip.IPMtableDump")
- api.RegisterMessage((*IPPuntPolice)(nil), "ip.IPPuntPolice")
- api.RegisterMessage((*IPPuntPoliceReply)(nil), "ip.IPPuntPoliceReply")
- api.RegisterMessage((*IPPuntRedirect)(nil), "ip.IPPuntRedirect")
- api.RegisterMessage((*IPPuntRedirectDetails)(nil), "ip.IPPuntRedirectDetails")
- api.RegisterMessage((*IPPuntRedirectDump)(nil), "ip.IPPuntRedirectDump")
- api.RegisterMessage((*IPPuntRedirectReply)(nil), "ip.IPPuntRedirectReply")
- api.RegisterMessage((*IPReassemblyEnableDisable)(nil), "ip.IPReassemblyEnableDisable")
- api.RegisterMessage((*IPReassemblyEnableDisableReply)(nil), "ip.IPReassemblyEnableDisableReply")
- api.RegisterMessage((*IPReassemblyGet)(nil), "ip.IPReassemblyGet")
- api.RegisterMessage((*IPReassemblyGetReply)(nil), "ip.IPReassemblyGetReply")
- api.RegisterMessage((*IPReassemblySet)(nil), "ip.IPReassemblySet")
- api.RegisterMessage((*IPReassemblySetReply)(nil), "ip.IPReassemblySetReply")
- api.RegisterMessage((*IPRouteAddDel)(nil), "ip.IPRouteAddDel")
- api.RegisterMessage((*IPRouteAddDelReply)(nil), "ip.IPRouteAddDelReply")
- api.RegisterMessage((*IPRouteDetails)(nil), "ip.IPRouteDetails")
- api.RegisterMessage((*IPRouteDump)(nil), "ip.IPRouteDump")
- api.RegisterMessage((*IPSourceAndPortRangeCheckAddDel)(nil), "ip.IPSourceAndPortRangeCheckAddDel")
- api.RegisterMessage((*IPSourceAndPortRangeCheckAddDelReply)(nil), "ip.IPSourceAndPortRangeCheckAddDelReply")
- api.RegisterMessage((*IPSourceAndPortRangeCheckInterfaceAddDel)(nil), "ip.IPSourceAndPortRangeCheckInterfaceAddDel")
- api.RegisterMessage((*IPSourceAndPortRangeCheckInterfaceAddDelReply)(nil), "ip.IPSourceAndPortRangeCheckInterfaceAddDelReply")
- api.RegisterMessage((*IPSourceCheckInterfaceAddDel)(nil), "ip.IPSourceCheckInterfaceAddDel")
- api.RegisterMessage((*IPSourceCheckInterfaceAddDelReply)(nil), "ip.IPSourceCheckInterfaceAddDelReply")
- api.RegisterMessage((*IPTableAddDel)(nil), "ip.IPTableAddDel")
- api.RegisterMessage((*IPTableAddDelReply)(nil), "ip.IPTableAddDelReply")
- api.RegisterMessage((*IPTableDetails)(nil), "ip.IPTableDetails")
- api.RegisterMessage((*IPTableDump)(nil), "ip.IPTableDump")
- api.RegisterMessage((*IPTableFlush)(nil), "ip.IPTableFlush")
- api.RegisterMessage((*IPTableFlushReply)(nil), "ip.IPTableFlushReply")
- api.RegisterMessage((*IPTableReplaceBegin)(nil), "ip.IPTableReplaceBegin")
- api.RegisterMessage((*IPTableReplaceBeginReply)(nil), "ip.IPTableReplaceBeginReply")
- api.RegisterMessage((*IPTableReplaceEnd)(nil), "ip.IPTableReplaceEnd")
- api.RegisterMessage((*IPTableReplaceEndReply)(nil), "ip.IPTableReplaceEndReply")
- api.RegisterMessage((*IPUnnumberedDetails)(nil), "ip.IPUnnumberedDetails")
- api.RegisterMessage((*IPUnnumberedDump)(nil), "ip.IPUnnumberedDump")
- api.RegisterMessage((*MfibSignalDetails)(nil), "ip.MfibSignalDetails")
- api.RegisterMessage((*MfibSignalDump)(nil), "ip.MfibSignalDump")
- api.RegisterMessage((*SetIPFlowHash)(nil), "ip.SetIPFlowHash")
- api.RegisterMessage((*SetIPFlowHashReply)(nil), "ip.SetIPFlowHashReply")
- api.RegisterMessage((*SwInterfaceIP6EnableDisable)(nil), "ip.SwInterfaceIP6EnableDisable")
- api.RegisterMessage((*SwInterfaceIP6EnableDisableReply)(nil), "ip.SwInterfaceIP6EnableDisableReply")
- api.RegisterMessage((*SwInterfaceIP6SetLinkLocalAddress)(nil), "ip.SwInterfaceIP6SetLinkLocalAddress")
- api.RegisterMessage((*SwInterfaceIP6SetLinkLocalAddressReply)(nil), "ip.SwInterfaceIP6SetLinkLocalAddressReply")
+ api.RegisterMessage((*IoamDisable)(nil), "ioam_disable_6b16a45e")
+ api.RegisterMessage((*IoamDisableReply)(nil), "ioam_disable_reply_e8d4e804")
+ api.RegisterMessage((*IoamEnable)(nil), "ioam_enable_51ccd868")
+ api.RegisterMessage((*IoamEnableReply)(nil), "ioam_enable_reply_e8d4e804")
+ api.RegisterMessage((*IPAddressDetails)(nil), "ip_address_details_b1199745")
+ api.RegisterMessage((*IPAddressDump)(nil), "ip_address_dump_2d033de4")
+ api.RegisterMessage((*IPContainerProxyAddDel)(nil), "ip_container_proxy_add_del_91189f40")
+ api.RegisterMessage((*IPContainerProxyAddDelReply)(nil), "ip_container_proxy_add_del_reply_e8d4e804")
+ api.RegisterMessage((*IPContainerProxyDetails)(nil), "ip_container_proxy_details_0ee460e8")
+ api.RegisterMessage((*IPContainerProxyDump)(nil), "ip_container_proxy_dump_51077d14")
+ api.RegisterMessage((*IPDetails)(nil), "ip_details_eb152d07")
+ api.RegisterMessage((*IPDump)(nil), "ip_dump_98d231ca")
+ api.RegisterMessage((*IPMrouteAddDel)(nil), "ip_mroute_add_del_f6627d17")
+ api.RegisterMessage((*IPMrouteAddDelReply)(nil), "ip_mroute_add_del_reply_1992deab")
+ api.RegisterMessage((*IPMrouteDetails)(nil), "ip_mroute_details_c1cb4b44")
+ api.RegisterMessage((*IPMrouteDump)(nil), "ip_mroute_dump_b9d2e09e")
+ api.RegisterMessage((*IPMtableDetails)(nil), "ip_mtable_details_b9d2e09e")
+ api.RegisterMessage((*IPMtableDump)(nil), "ip_mtable_dump_51077d14")
+ api.RegisterMessage((*IPPuntPolice)(nil), "ip_punt_police_db867cea")
+ api.RegisterMessage((*IPPuntPoliceReply)(nil), "ip_punt_police_reply_e8d4e804")
+ api.RegisterMessage((*IPPuntRedirect)(nil), "ip_punt_redirect_a9a5592c")
+ api.RegisterMessage((*IPPuntRedirectDetails)(nil), "ip_punt_redirect_details_3924f5d3")
+ api.RegisterMessage((*IPPuntRedirectDump)(nil), "ip_punt_redirect_dump_2d033de4")
+ api.RegisterMessage((*IPPuntRedirectReply)(nil), "ip_punt_redirect_reply_e8d4e804")
+ api.RegisterMessage((*IPReassemblyEnableDisable)(nil), "ip_reassembly_enable_disable_885c85a6")
+ api.RegisterMessage((*IPReassemblyEnableDisableReply)(nil), "ip_reassembly_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*IPReassemblyGet)(nil), "ip_reassembly_get_ea13ff63")
+ api.RegisterMessage((*IPReassemblyGetReply)(nil), "ip_reassembly_get_reply_d5eb8d34")
+ api.RegisterMessage((*IPReassemblySet)(nil), "ip_reassembly_set_16467d25")
+ api.RegisterMessage((*IPReassemblySetReply)(nil), "ip_reassembly_set_reply_e8d4e804")
+ api.RegisterMessage((*IPRouteAddDel)(nil), "ip_route_add_del_c1ff832d")
+ api.RegisterMessage((*IPRouteAddDelReply)(nil), "ip_route_add_del_reply_1992deab")
+ api.RegisterMessage((*IPRouteDetails)(nil), "ip_route_details_d1ffaae1")
+ api.RegisterMessage((*IPRouteDump)(nil), "ip_route_dump_b9d2e09e")
+ api.RegisterMessage((*IPSourceAndPortRangeCheckAddDel)(nil), "ip_source_and_port_range_check_add_del_8bfc76f2")
+ api.RegisterMessage((*IPSourceAndPortRangeCheckAddDelReply)(nil), "ip_source_and_port_range_check_add_del_reply_e8d4e804")
+ api.RegisterMessage((*IPSourceAndPortRangeCheckInterfaceAddDel)(nil), "ip_source_and_port_range_check_interface_add_del_e1ba8987")
+ api.RegisterMessage((*IPSourceAndPortRangeCheckInterfaceAddDelReply)(nil), "ip_source_and_port_range_check_interface_add_del_reply_e8d4e804")
+ api.RegisterMessage((*IPSourceCheckInterfaceAddDel)(nil), "ip_source_check_interface_add_del_6612356b")
+ api.RegisterMessage((*IPSourceCheckInterfaceAddDelReply)(nil), "ip_source_check_interface_add_del_reply_e8d4e804")
+ api.RegisterMessage((*IPTableAddDel)(nil), "ip_table_add_del_0ffdaec0")
+ api.RegisterMessage((*IPTableAddDelReply)(nil), "ip_table_add_del_reply_e8d4e804")
+ api.RegisterMessage((*IPTableDetails)(nil), "ip_table_details_c79fca0f")
+ api.RegisterMessage((*IPTableDump)(nil), "ip_table_dump_51077d14")
+ api.RegisterMessage((*IPTableFlush)(nil), "ip_table_flush_b9d2e09e")
+ api.RegisterMessage((*IPTableFlushReply)(nil), "ip_table_flush_reply_e8d4e804")
+ api.RegisterMessage((*IPTableReplaceBegin)(nil), "ip_table_replace_begin_b9d2e09e")
+ api.RegisterMessage((*IPTableReplaceBeginReply)(nil), "ip_table_replace_begin_reply_e8d4e804")
+ api.RegisterMessage((*IPTableReplaceEnd)(nil), "ip_table_replace_end_b9d2e09e")
+ api.RegisterMessage((*IPTableReplaceEndReply)(nil), "ip_table_replace_end_reply_e8d4e804")
+ api.RegisterMessage((*IPUnnumberedDetails)(nil), "ip_unnumbered_details_aa12a483")
+ api.RegisterMessage((*IPUnnumberedDump)(nil), "ip_unnumbered_dump_f9e6675e")
+ api.RegisterMessage((*MfibSignalDetails)(nil), "mfib_signal_details_64398a9a")
+ api.RegisterMessage((*MfibSignalDump)(nil), "mfib_signal_dump_51077d14")
+ api.RegisterMessage((*SetIPFlowHash)(nil), "set_ip_flow_hash_084ee09e")
+ api.RegisterMessage((*SetIPFlowHashReply)(nil), "set_ip_flow_hash_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceIP6EnableDisable)(nil), "sw_interface_ip6_enable_disable_ae6cfcfb")
+ api.RegisterMessage((*SwInterfaceIP6EnableDisableReply)(nil), "sw_interface_ip6_enable_disable_reply_e8d4e804")
+ api.RegisterMessage((*SwInterfaceIP6SetLinkLocalAddress)(nil), "sw_interface_ip6_set_link_local_address_2931d9fa")
+ api.RegisterMessage((*SwInterfaceIP6SetLinkLocalAddressReply)(nil), "sw_interface_ip6_set_link_local_address_reply_e8d4e804")
}
// Messages returns list of all messages in this module.
@@ -5717,14 +4029,3 @@ func AllMessages() []api.Message {
(*SwInterfaceIP6SetLinkLocalAddressReply)(nil),
}
}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = codec.DecodeString
-var _ = bytes.NewBuffer
-var _ = context.Background
-var _ = io.Copy
-var _ = strconv.Itoa
-var _ = struc.Pack
-var _ = binary.BigEndian
-var _ = math.Float32bits