aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorOndrej Fabry <ofabry@cisco.com>2020-07-17 10:36:28 +0200
committerOndrej Fabry <ofabry@cisco.com>2020-07-17 11:43:41 +0200
commitd1f24d37bd447b64e402298bb8eb2479681facf9 (patch)
treea3fc21ba730a91d8a402c7a5bf9c614e3677c4fc /examples
parent1548c7e12531e3d055567d761c580a1c7ff0ac40 (diff)
Improve binapi generator
- simplified Size/Marshal/Unmarshal methods - replace struc in unions with custom marshal/unmarshal - fix imports in generated files - fix mock adapter - generate rpc service using low-level stream API (dumps generate control ping or stream msg..) - move examples/binapi to binapi and generate all API for latest release - add binapigen.Plugin for developing custom generator plugins - optionally generate HTTP handlers (REST API) for RPC services - add govpp program for browsing VPP API Change-Id: I092e9ed2b0c17972b3476463c3d4b14dd76ed42b Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/binapi-types/binapi_types.go (renamed from examples/union-example/union_example.go)77
-rw-r--r--examples/binapi/acl/acl.ba.go2903
-rw-r--r--examples/binapi/acl/acl_rpc.ba.go302
-rw-r--r--examples/binapi/af_packet/af_packet.ba.go530
-rw-r--r--examples/binapi/af_packet/af_packet_rpc.ba.go84
-rw-r--r--examples/binapi/fib_types/fib_types.ba.go255
-rw-r--r--examples/binapi/gen.go5
-rw-r--r--examples/binapi/interface_types/interface_types.ba.go272
-rw-r--r--examples/binapi/interfaces/interfaces.ba.go3640
-rw-r--r--examples/binapi/interfaces/interfaces_rpc.ba.go341
-rw-r--r--examples/binapi/ip/ip.ba.go5317
-rw-r--r--examples/binapi/ip/ip_rpc.ba.go497
-rw-r--r--examples/binapi/ip_types/ip_types.ba.go436
-rw-r--r--examples/binapi/mactime/mactime.ba.go689
-rw-r--r--examples/binapi/mactime/mactime_rpc.ba.go74
-rw-r--r--examples/binapi/memif/memif.ba.go857
-rw-r--r--examples/binapi/memif/memif_rpc.ba.go111
-rw-r--r--examples/binapi/sr/sr.ba.go1784
-rw-r--r--examples/binapi/sr/sr_rpc.ba.go178
-rw-r--r--examples/binapi/vpe/vpe.ba.go1665
-rw-r--r--examples/binapi/vpe/vpe_rpc.ba.go174
-rw-r--r--examples/multi-vpp/multi_vpp.go18
-rw-r--r--examples/perf-bench/perf-bench.go2
-rw-r--r--examples/rpc-service/rpc_service.go25
-rw-r--r--examples/simple-client/simple_client.go29
25 files changed, 83 insertions, 20182 deletions
diff --git a/examples/union-example/union_example.go b/examples/binapi-types/binapi_types.go
index cdba2fa..849ad1b 100644
--- a/examples/union-example/union_example.go
+++ b/examples/binapi-types/binapi_types.go
@@ -17,12 +17,12 @@ package main
import (
"fmt"
- "git.fd.io/govpp.git/codec"
- "git.fd.io/govpp.git/examples/binapi/interfaces"
- "git.fd.io/govpp.git/examples/binapi/ip"
- "git.fd.io/govpp.git/examples/binapi/ip_types"
"log"
- "reflect"
+
+ "git.fd.io/govpp.git/binapi/ethernet_types"
+ "git.fd.io/govpp.git/binapi/ip"
+ "git.fd.io/govpp.git/binapi/ip_types"
+ "git.fd.io/govpp.git/codec"
)
func init() {
@@ -30,9 +30,8 @@ func init() {
}
func main() {
- constructExample()
-
- encodingExampleIP()
+ addressUnionExample()
+ ipAddressExample()
// convert IP from string form into Address type containing union
convertIP("10.10.1.1")
@@ -48,32 +47,43 @@ func main() {
convertToMacAddress("00:10:ab:4f:00:01")
}
-func constructExample() {
+func addressUnionExample() {
var union ip_types.AddressUnion
- // create AddressUnion with AdressUnionXXX constructors
+ // initialize union using constructors
union = ip_types.AddressUnionIP4(ip_types.IP4Address{192, 168, 1, 10})
union = ip_types.AddressUnionIP6(ip_types.IP6Address{0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x02})
- // set AddressUnion with SetXXX methods
- union.SetIP4(ip_types.IP4Address{192, 168, 1, 10})
- union.SetIP6(ip_types.IP6Address{0xff, 0x02, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x02})
+ // get union value using getters
+ ip4 := union.GetIP4()
+ ip6 := union.GetIP6()
+
+ // set union value using setters
+ union.SetIP4(ip4)
+ union.SetIP6(ip6)
}
-func encodingExampleIP() {
- var c = codec.DefaultCodec
+func ipAddressExample() {
+ // parse string into IP address
+ addrIP4, err := ip_types.ParseAddress("192.168.1.10")
+ if err != nil {
+ panic(err)
+ }
+ /*addrIP6, err := ip_types.ParseAddress("ff:2::2")
+ if err != nil {
+ panic(err)
+ }*/
- // encode this message
var msg = ip.IPPuntRedirect{
+ IsAdd: true,
Punt: ip.PuntRedirect{
- Nh: ip_types.Address{
- Af: ip_types.ADDRESS_IP4,
- Un: ip_types.AddressUnionIP4(ip_types.IP4Address{192, 168, 1, 10}),
- },
+ Nh: addrIP4,
},
- IsAdd: true,
}
- log.Printf("encoding message: %+v", msg)
+
+ log.Printf("encoding message: %#v", msg)
+
+ var c = codec.DefaultCodec
b, err := c.EncodeMsg(&msg, 1)
if err != nil {
@@ -85,10 +95,10 @@ func encodingExampleIP() {
if err := c.DecodeMsg(b, &msg2); err != nil {
log.Fatal(err)
}
- log.Printf("decoded message: %+v", msg2)
+ log.Printf("decoded message: %#v", msg2)
// compare the messages
- if !reflect.DeepEqual(msg, msg2) {
+ if !msg.Punt.Nh.ToIP().Equal(msg2.Punt.Nh.ToIP()) {
log.Fatal("messages are not equal")
}
}
@@ -99,10 +109,9 @@ func convertIP(ip string) {
log.Printf("error converting IP to Address: %v", err)
return
}
- fmt.Printf("converted IP %q to: %+v\n", ip, addr)
+ fmt.Printf("converted IP %q to: %#v\n", ip, addr)
- ipStr := addr.ToString()
- fmt.Printf("Address converted back to string IP %+v to: %q\n", addr, ipStr)
+ fmt.Printf("Address converted back to string IP %#v to: %s\n", addr, addr)
}
func convertIPPrefix(ip string) {
@@ -111,20 +120,18 @@ func convertIPPrefix(ip string) {
log.Printf("error converting prefix to IP4Prefix: %v", err)
return
}
- fmt.Printf("converted prefix %q to: %+v\n", ip, prefix)
+ fmt.Printf("converted prefix %q to: %#v\n", ip, prefix)
- ipStr := prefix.ToString()
- fmt.Printf("IP4Prefix converted back to string prefix %+v to: %q\n", prefix, ipStr)
+ fmt.Printf("IP4Prefix converted back to string prefix %#v to: %s\n", prefix, prefix)
}
func convertToMacAddress(mac string) {
- parsedMac, err := interfaces.ParseMAC(mac)
+ parsedMac, err := ethernet_types.ParseMacAddress(mac)
if err != nil {
log.Printf("error converting MAC to MacAddress: %v", err)
return
}
- fmt.Printf("converted prefix %q to: %+v\n", mac, parsedMac)
+ fmt.Printf("converted mac %q to: %#v\n", mac, parsedMac)
- macStr := parsedMac.ToString()
- fmt.Printf("MacAddress converted back to string %+v to: %q\n", parsedMac, macStr)
-} \ No newline at end of file
+ fmt.Printf("MacAddress converted back to string %#v to: %s\n", parsedMac, parsedMac)
+}
diff --git a/examples/binapi/acl/acl.ba.go b/examples/binapi/acl/acl.ba.go
deleted file mode 100644
index f191c78..0000000
--- a/examples/binapi/acl/acl.ba.go
+++ /dev/null
@@ -1,2903 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-// versions:
-// binapi-generator: v0.4.0-dev
-// VPP: 20.05-release
-// source: /usr/share/vpp/api/plugins/acl.api.json
-
-/*
-Package acl contains generated code for VPP API file acl.api (2.0.0).
-
-It consists of:
- 7 aliases
- 11 enums
- 38 messages
- 8 types
- 1 union
-*/
-package acl
-
-import (
- "bytes"
- "context"
- "encoding/binary"
- "fmt"
- "io"
- "math"
- "net"
- "strconv"
- "strings"
-
- api "git.fd.io/govpp.git/api"
- codec "git.fd.io/govpp.git/codec"
- struc "github.com/lunixbochs/struc"
-
- interface_types "git.fd.io/govpp.git/examples/binapi/interface_types"
- ip_types "git.fd.io/govpp.git/examples/binapi/ip_types"
-)
-
-// 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 (
- // ModuleName is the name of this module.
- ModuleName = "acl"
- // APIVersion is the API version of this module.
- APIVersion = "2.0.0"
- // VersionCrc is the CRC of this module.
- VersionCrc = 0x68c4cb37
-)
-
-// ACLAction represents VPP binary API enum 'acl_action'.
-type ACLAction uint8
-
-const (
- ACL_ACTION_API_DENY ACLAction = 0
- ACL_ACTION_API_PERMIT ACLAction = 1
- ACL_ACTION_API_PERMIT_REFLECT ACLAction = 2
-)
-
-var (
- ACLAction_name = map[uint8]string{
- 0: "ACL_ACTION_API_DENY",
- 1: "ACL_ACTION_API_PERMIT",
- 2: "ACL_ACTION_API_PERMIT_REFLECT",
- }
- ACLAction_value = map[string]uint8{
- "ACL_ACTION_API_DENY": 0,
- "ACL_ACTION_API_PERMIT": 1,
- "ACL_ACTION_API_PERMIT_REFLECT": 2,
- }
-)
-
-func (x ACLAction) String() string {
- s, ok := ACLAction_name[uint8(x)]
- if ok {
- return s
- }
- return "ACLAction(" + strconv.Itoa(int(x)) + ")"
-}
-
-// MacAddress represents VPP binary API alias 'mac_address'.
-type MacAddress [6]uint8
-
-func ParseMAC(mac string) (parsed MacAddress, err error) {
- var hw net.HardwareAddr
- if hw, err = net.ParseMAC(mac); err != nil {
- return
- }
- copy(parsed[:], hw[:])
- return
-}
-
-func (m *MacAddress) ToString() string {
- return net.HardwareAddr(m[:]).String()
-}
-
-// ACLRule represents VPP binary API type 'acl_rule'.
-type ACLRule struct {
- IsPermit ACLAction `binapi:"acl_action,name=is_permit" json:"is_permit,omitempty"`
- SrcPrefix ip_types.Prefix `binapi:"prefix,name=src_prefix" json:"src_prefix,omitempty"`
- DstPrefix ip_types.Prefix `binapi:"prefix,name=dst_prefix" json:"dst_prefix,omitempty"`
- Proto ip_types.IPProto `binapi:"ip_proto,name=proto" json:"proto,omitempty"`
- SrcportOrIcmptypeFirst uint16 `binapi:"u16,name=srcport_or_icmptype_first" json:"srcport_or_icmptype_first,omitempty"`
- SrcportOrIcmptypeLast uint16 `binapi:"u16,name=srcport_or_icmptype_last" json:"srcport_or_icmptype_last,omitempty"`
- DstportOrIcmpcodeFirst uint16 `binapi:"u16,name=dstport_or_icmpcode_first" json:"dstport_or_icmpcode_first,omitempty"`
- DstportOrIcmpcodeLast uint16 `binapi:"u16,name=dstport_or_icmpcode_last" json:"dstport_or_icmpcode_last,omitempty"`
- TCPFlagsMask uint8 `binapi:"u8,name=tcp_flags_mask" json:"tcp_flags_mask,omitempty"`
- TCPFlagsValue uint8 `binapi:"u8,name=tcp_flags_value" json:"tcp_flags_value,omitempty"`
-}
-
-func (*ACLRule) GetTypeName() string { return "acl_rule" }
-
-// MacipACLRule represents VPP binary API type 'macip_acl_rule'.
-type MacipACLRule struct {
- IsPermit ACLAction `binapi:"acl_action,name=is_permit" json:"is_permit,omitempty"`
- SrcMac MacAddress `binapi:"mac_address,name=src_mac" json:"src_mac,omitempty"`
- SrcMacMask MacAddress `binapi:"mac_address,name=src_mac_mask" json:"src_mac_mask,omitempty"`
- SrcPrefix ip_types.Prefix `binapi:"prefix,name=src_prefix" json:"src_prefix,omitempty"`
-}
-
-func (*MacipACLRule) GetTypeName() string { return "macip_acl_rule" }
-
-// ACLAddReplace represents VPP binary API message 'acl_add_replace'.
-type ACLAddReplace struct {
- ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
- Tag string `binapi:"string[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
- Count uint32 `binapi:"u32,name=count" json:"count,omitempty" struc:"sizeof=R"`
- R []ACLRule `binapi:"acl_rule[count],name=r" json:"r,omitempty"`
-}
-
-func (m *ACLAddReplace) Reset() { *m = ACLAddReplace{} }
-func (*ACLAddReplace) GetMessageName() string { return "acl_add_replace" }
-func (*ACLAddReplace) GetCrcString() string { return "1cabdeab" }
-func (*ACLAddReplace) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *ACLAddReplace) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.ACLIndex
- size += 4
- // field[1] m.Tag
- size += 64
- // field[1] m.Count
- size += 4
- // field[1] m.R
- for j1 := 0; j1 < len(m.R); j1++ {
- var s1 ACLRule
- _ = s1
- if j1 < len(m.R) {
- s1 = m.R[j1]
- }
- // field[2] s1.IsPermit
- size += 1
- // field[2] s1.SrcPrefix
- // field[3] s1.SrcPrefix.Address
- // field[4] s1.SrcPrefix.Address.Af
- size += 1
- // field[4] s1.SrcPrefix.Address.Un
- size += 16
- // field[3] s1.SrcPrefix.Len
- size += 1
- // field[2] s1.DstPrefix
- // field[3] s1.DstPrefix.Address
- // field[4] s1.DstPrefix.Address.Af
- size += 1
- // field[4] s1.DstPrefix.Address.Un
- size += 16
- // field[3] s1.DstPrefix.Len
- size += 1
- // field[2] s1.Proto
- size += 1
- // field[2] s1.SrcportOrIcmptypeFirst
- size += 2
- // field[2] s1.SrcportOrIcmptypeLast
- size += 2
- // field[2] s1.DstportOrIcmpcodeFirst
- size += 2
- // field[2] s1.DstportOrIcmpcodeLast
- size += 2
- // field[2] s1.TCPFlagsMask
- size += 1
- // field[2] s1.TCPFlagsValue
- size += 1
- }
- return size
-}
-func (m *ACLAddReplace) 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.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- // field[1] m.Tag
- copy(buf[pos:pos+64], m.Tag)
- pos += 64
- // field[1] m.Count
- o.PutUint32(buf[pos:pos+4], uint32(len(m.R)))
- pos += 4
- // field[1] m.R
- for j1 := 0; j1 < len(m.R); j1++ {
- var v1 ACLRule
- if j1 < len(m.R) {
- v1 = m.R[j1]
- }
- // field[2] v1.IsPermit
- buf[pos] = uint8(v1.IsPermit)
- pos += 1
- // field[2] v1.SrcPrefix
- // field[3] v1.SrcPrefix.Address
- // field[4] v1.SrcPrefix.Address.Af
- buf[pos] = uint8(v1.SrcPrefix.Address.Af)
- pos += 1
- // field[4] v1.SrcPrefix.Address.Un
- copy(buf[pos:pos+16], v1.SrcPrefix.Address.Un.XXX_UnionData[:])
- pos += 16
- // field[3] v1.SrcPrefix.Len
- buf[pos] = uint8(v1.SrcPrefix.Len)
- pos += 1
- // field[2] v1.DstPrefix
- // field[3] v1.DstPrefix.Address
- // field[4] v1.DstPrefix.Address.Af
- buf[pos] = uint8(v1.DstPrefix.Address.Af)
- pos += 1
- // field[4] v1.DstPrefix.Address.Un
- copy(buf[pos:pos+16], v1.DstPrefix.Address.Un.XXX_UnionData[:])
- pos += 16
- // field[3] v1.DstPrefix.Len
- buf[pos] = uint8(v1.DstPrefix.Len)
- pos += 1
- // field[2] v1.Proto
- buf[pos] = uint8(v1.Proto)
- pos += 1
- // field[2] v1.SrcportOrIcmptypeFirst
- o.PutUint16(buf[pos:pos+2], uint16(v1.SrcportOrIcmptypeFirst))
- pos += 2
- // field[2] v1.SrcportOrIcmptypeLast
- o.PutUint16(buf[pos:pos+2], uint16(v1.SrcportOrIcmptypeLast))
- pos += 2
- // field[2] v1.DstportOrIcmpcodeFirst
- o.PutUint16(buf[pos:pos+2], uint16(v1.DstportOrIcmpcodeFirst))
- pos += 2
- // field[2] v1.DstportOrIcmpcodeLast
- o.PutUint16(buf[pos:pos+2], uint16(v1.DstportOrIcmpcodeLast))
- pos += 2
- // field[2] v1.TCPFlagsMask
- buf[pos] = uint8(v1.TCPFlagsMask)
- pos += 1
- // field[2] v1.TCPFlagsValue
- buf[pos] = uint8(v1.TCPFlagsValue)
- pos += 1
- }
- return buf, nil
-}
-func (m *ACLAddReplace) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Tag
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Tag = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- // field[1] m.Count
- m.Count = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.R
- m.R = make([]ACLRule, int(m.Count))
- for j1 := 0; j1 < int(m.Count); j1++ {
- // field[2] m.R[j1].IsPermit
- m.R[j1].IsPermit = ACLAction(tmp[pos])
- pos += 1
- // field[2] m.R[j1].SrcPrefix
- // field[3] m.R[j1].SrcPrefix.Address
- // field[4] m.R[j1].SrcPrefix.Address.Af
- m.R[j1].SrcPrefix.Address.Af = ip_types.AddressFamily(tmp[pos])
- pos += 1
- // field[4] m.R[j1].SrcPrefix.Address.Un
- copy(m.R[j1].SrcPrefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[3] m.R[j1].SrcPrefix.Len
- m.R[j1].SrcPrefix.Len = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].DstPrefix
- // field[3] m.R[j1].DstPrefix.Address
- // field[4] m.R[j1].DstPrefix.Address.Af
- m.R[j1].DstPrefix.Address.Af = ip_types.AddressFamily(tmp[pos])
- pos += 1
- // field[4] m.R[j1].DstPrefix.Address.Un
- copy(m.R[j1].DstPrefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[3] m.R[j1].DstPrefix.Len
- m.R[j1].DstPrefix.Len = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].Proto
- m.R[j1].Proto = ip_types.IPProto(tmp[pos])
- pos += 1
- // field[2] m.R[j1].SrcportOrIcmptypeFirst
- m.R[j1].SrcportOrIcmptypeFirst = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[2] m.R[j1].SrcportOrIcmptypeLast
- m.R[j1].SrcportOrIcmptypeLast = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[2] m.R[j1].DstportOrIcmpcodeFirst
- m.R[j1].DstportOrIcmpcodeFirst = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[2] m.R[j1].DstportOrIcmpcodeLast
- m.R[j1].DstportOrIcmpcodeLast = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[2] m.R[j1].TCPFlagsMask
- m.R[j1].TCPFlagsMask = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].TCPFlagsValue
- m.R[j1].TCPFlagsValue = uint8(tmp[pos])
- pos += 1
- }
- return nil
-}
-
-// ACLAddReplaceReply represents VPP binary API message 'acl_add_replace_reply'.
-type ACLAddReplaceReply struct {
- ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *ACLAddReplaceReply) Reset() { *m = ACLAddReplaceReply{} }
-func (*ACLAddReplaceReply) GetMessageName() string { return "acl_add_replace_reply" }
-func (*ACLAddReplaceReply) GetCrcString() string { return "ac407b0c" }
-func (*ACLAddReplaceReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *ACLAddReplaceReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.ACLIndex
- size += 4
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *ACLAddReplaceReply) 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.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *ACLAddReplaceReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// ACLDel represents VPP binary API message 'acl_del'.
-type ACLDel struct {
- ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
-}
-
-func (m *ACLDel) Reset() { *m = ACLDel{} }
-func (*ACLDel) GetMessageName() string { return "acl_del" }
-func (*ACLDel) GetCrcString() string { return "ef34fea4" }
-func (*ACLDel) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *ACLDel) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.ACLIndex
- size += 4
- return size
-}
-func (m *ACLDel) 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.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- return buf, nil
-}
-func (m *ACLDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// ACLDelReply represents VPP binary API message 'acl_del_reply'.
-type ACLDelReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *ACLDelReply) Reset() { *m = ACLDelReply{} }
-func (*ACLDelReply) GetMessageName() string { return "acl_del_reply" }
-func (*ACLDelReply) GetCrcString() string { return "e8d4e804" }
-func (*ACLDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *ACLDelReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *ACLDelReply) 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 *ACLDelReply) 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
- return nil
-}
-
-// ACLDetails represents VPP binary API message 'acl_details'.
-type ACLDetails struct {
- ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
- Tag string `binapi:"string[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
- Count uint32 `binapi:"u32,name=count" json:"count,omitempty" struc:"sizeof=R"`
- R []ACLRule `binapi:"acl_rule[count],name=r" json:"r,omitempty"`
-}
-
-func (m *ACLDetails) Reset() { *m = ACLDetails{} }
-func (*ACLDetails) GetMessageName() string { return "acl_details" }
-func (*ACLDetails) GetCrcString() string { return "7a97f21c" }
-func (*ACLDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *ACLDetails) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.ACLIndex
- size += 4
- // field[1] m.Tag
- size += 64
- // field[1] m.Count
- size += 4
- // field[1] m.R
- for j1 := 0; j1 < len(m.R); j1++ {
- var s1 ACLRule
- _ = s1
- if j1 < len(m.R) {
- s1 = m.R[j1]
- }
- // field[2] s1.IsPermit
- size += 1
- // field[2] s1.SrcPrefix
- // field[3] s1.SrcPrefix.Address
- // field[4] s1.SrcPrefix.Address.Af
- size += 1
- // field[4] s1.SrcPrefix.Address.Un
- size += 16
- // field[3] s1.SrcPrefix.Len
- size += 1
- // field[2] s1.DstPrefix
- // field[3] s1.DstPrefix.Address
- // field[4] s1.DstPrefix.Address.Af
- size += 1
- // field[4] s1.DstPrefix.Address.Un
- size += 16
- // field[3] s1.DstPrefix.Len
- size += 1
- // field[2] s1.Proto
- size += 1
- // field[2] s1.SrcportOrIcmptypeFirst
- size += 2
- // field[2] s1.SrcportOrIcmptypeLast
- size += 2
- // field[2] s1.DstportOrIcmpcodeFirst
- size += 2
- // field[2] s1.DstportOrIcmpcodeLast
- size += 2
- // field[2] s1.TCPFlagsMask
- size += 1
- // field[2] s1.TCPFlagsValue
- size += 1
- }
- return size
-}
-func (m *ACLDetails) 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.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- // field[1] m.Tag
- copy(buf[pos:pos+64], m.Tag)
- pos += 64
- // field[1] m.Count
- o.PutUint32(buf[pos:pos+4], uint32(len(m.R)))
- pos += 4
- // field[1] m.R
- for j1 := 0; j1 < len(m.R); j1++ {
- var v1 ACLRule
- if j1 < len(m.R) {
- v1 = m.R[j1]
- }
- // field[2] v1.IsPermit
- buf[pos] = uint8(v1.IsPermit)
- pos += 1
- // field[2] v1.SrcPrefix
- // field[3] v1.SrcPrefix.Address
- // field[4] v1.SrcPrefix.Address.Af
- buf[pos] = uint8(v1.SrcPrefix.Address.Af)
- pos += 1
- // field[4] v1.SrcPrefix.Address.Un
- copy(buf[pos:pos+16], v1.SrcPrefix.Address.Un.XXX_UnionData[:])
- pos += 16
- // field[3] v1.SrcPrefix.Len
- buf[pos] = uint8(v1.SrcPrefix.Len)
- pos += 1
- // field[2] v1.DstPrefix
- // field[3] v1.DstPrefix.Address
- // field[4] v1.DstPrefix.Address.Af
- buf[pos] = uint8(v1.DstPrefix.Address.Af)
- pos += 1
- // field[4] v1.DstPrefix.Address.Un
- copy(buf[pos:pos+16], v1.DstPrefix.Address.Un.XXX_UnionData[:])
- pos += 16
- // field[3] v1.DstPrefix.Len
- buf[pos] = uint8(v1.DstPrefix.Len)
- pos += 1
- // field[2] v1.Proto
- buf[pos] = uint8(v1.Proto)
- pos += 1
- // field[2] v1.SrcportOrIcmptypeFirst
- o.PutUint16(buf[pos:pos+2], uint16(v1.SrcportOrIcmptypeFirst))
- pos += 2
- // field[2] v1.SrcportOrIcmptypeLast
- o.PutUint16(buf[pos:pos+2], uint16(v1.SrcportOrIcmptypeLast))
- pos += 2
- // field[2] v1.DstportOrIcmpcodeFirst
- o.PutUint16(buf[pos:pos+2], uint16(v1.DstportOrIcmpcodeFirst))
- pos += 2
- // field[2] v1.DstportOrIcmpcodeLast
- o.PutUint16(buf[pos:pos+2], uint16(v1.DstportOrIcmpcodeLast))
- pos += 2
- // field[2] v1.TCPFlagsMask
- buf[pos] = uint8(v1.TCPFlagsMask)
- pos += 1
- // field[2] v1.TCPFlagsValue
- buf[pos] = uint8(v1.TCPFlagsValue)
- pos += 1
- }
- return buf, nil
-}
-func (m *ACLDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Tag
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Tag = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- // field[1] m.Count
- m.Count = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.R
- m.R = make([]ACLRule, int(m.Count))
- for j1 := 0; j1 < int(m.Count); j1++ {
- // field[2] m.R[j1].IsPermit
- m.R[j1].IsPermit = ACLAction(tmp[pos])
- pos += 1
- // field[2] m.R[j1].SrcPrefix
- // field[3] m.R[j1].SrcPrefix.Address
- // field[4] m.R[j1].SrcPrefix.Address.Af
- m.R[j1].SrcPrefix.Address.Af = ip_types.AddressFamily(tmp[pos])
- pos += 1
- // field[4] m.R[j1].SrcPrefix.Address.Un
- copy(m.R[j1].SrcPrefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[3] m.R[j1].SrcPrefix.Len
- m.R[j1].SrcPrefix.Len = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].DstPrefix
- // field[3] m.R[j1].DstPrefix.Address
- // field[4] m.R[j1].DstPrefix.Address.Af
- m.R[j1].DstPrefix.Address.Af = ip_types.AddressFamily(tmp[pos])
- pos += 1
- // field[4] m.R[j1].DstPrefix.Address.Un
- copy(m.R[j1].DstPrefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[3] m.R[j1].DstPrefix.Len
- m.R[j1].DstPrefix.Len = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].Proto
- m.R[j1].Proto = ip_types.IPProto(tmp[pos])
- pos += 1
- // field[2] m.R[j1].SrcportOrIcmptypeFirst
- m.R[j1].SrcportOrIcmptypeFirst = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[2] m.R[j1].SrcportOrIcmptypeLast
- m.R[j1].SrcportOrIcmptypeLast = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[2] m.R[j1].DstportOrIcmpcodeFirst
- m.R[j1].DstportOrIcmpcodeFirst = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[2] m.R[j1].DstportOrIcmpcodeLast
- m.R[j1].DstportOrIcmpcodeLast = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[2] m.R[j1].TCPFlagsMask
- m.R[j1].TCPFlagsMask = uint8(tmp[pos])
- pos += 1
- // field[2] m.R[j1].TCPFlagsValue
- m.R[j1].TCPFlagsValue = uint8(tmp[pos])
- pos += 1
- }
- return nil
-}
-
-// ACLDump represents VPP binary API message 'acl_dump'.
-type ACLDump struct {
- ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
-}
-
-func (m *ACLDump) Reset() { *m = ACLDump{} }
-func (*ACLDump) GetMessageName() string { return "acl_dump" }
-func (*ACLDump) GetCrcString() string { return "ef34fea4" }
-func (*ACLDump) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *ACLDump) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.ACLIndex
- size += 4
- return size
-}
-func (m *ACLDump) 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.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- return buf, nil
-}
-func (m *ACLDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// ACLInterfaceAddDel represents VPP binary API message 'acl_interface_add_del'.
-type ACLInterfaceAddDel struct {
- IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
- IsInput bool `binapi:"bool,name=is_input" json:"is_input,omitempty"`
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
-}
-
-func (m *ACLInterfaceAddDel) Reset() { *m = ACLInterfaceAddDel{} }
-func (*ACLInterfaceAddDel) GetMessageName() string { return "acl_interface_add_del" }
-func (*ACLInterfaceAddDel) GetCrcString() string { return "4b54bebd" }
-func (*ACLInterfaceAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *ACLInterfaceAddDel) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.IsAdd
- size += 1
- // field[1] m.IsInput
- size += 1
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.ACLIndex
- size += 4
- return size
-}
-func (m *ACLInterfaceAddDel) 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.IsInput
- if m.IsInput {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- return buf, nil
-}
-func (m *ACLInterfaceAddDel) 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.IsInput
- m.IsInput = tmp[pos] != 0
- pos += 1
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// ACLInterfaceAddDelReply represents VPP binary API message 'acl_interface_add_del_reply'.
-type ACLInterfaceAddDelReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *ACLInterfaceAddDelReply) Reset() { *m = ACLInterfaceAddDelReply{} }
-func (*ACLInterfaceAddDelReply) GetMessageName() string { return "acl_interface_add_del_reply" }
-func (*ACLInterfaceAddDelReply) GetCrcString() string { return "e8d4e804" }
-func (*ACLInterfaceAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *ACLInterfaceAddDelReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *ACLInterfaceAddDelReply) 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 *ACLInterfaceAddDelReply) 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
- return nil
-}
-
-// ACLInterfaceEtypeWhitelistDetails represents VPP binary API message 'acl_interface_etype_whitelist_details'.
-type ACLInterfaceEtypeWhitelistDetails struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- Count uint8 `binapi:"u8,name=count" json:"count,omitempty" struc:"sizeof=Whitelist"`
- NInput uint8 `binapi:"u8,name=n_input" json:"n_input,omitempty"`
- Whitelist []uint16 `binapi:"u16[count],name=whitelist" json:"whitelist,omitempty"`
-}
-
-func (m *ACLInterfaceEtypeWhitelistDetails) Reset() { *m = ACLInterfaceEtypeWhitelistDetails{} }
-func (*ACLInterfaceEtypeWhitelistDetails) GetMessageName() string {
- return "acl_interface_etype_whitelist_details"
-}
-func (*ACLInterfaceEtypeWhitelistDetails) GetCrcString() string { return "cc2bfded" }
-func (*ACLInterfaceEtypeWhitelistDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *ACLInterfaceEtypeWhitelistDetails) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Count
- size += 1
- // field[1] m.NInput
- size += 1
- // field[1] m.Whitelist
- size += 2 * len(m.Whitelist)
- return size
-}
-func (m *ACLInterfaceEtypeWhitelistDetails) 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.Count
- buf[pos] = uint8(len(m.Whitelist))
- pos += 1
- // field[1] m.NInput
- buf[pos] = uint8(m.NInput)
- pos += 1
- // field[1] m.Whitelist
- for i := 0; i < len(m.Whitelist); i++ {
- var x uint16
- if i < len(m.Whitelist) {
- x = uint16(m.Whitelist[i])
- }
- o.PutUint16(buf[pos:pos+2], uint16(x))
- pos += 2
- }
- return buf, nil
-}
-func (m *ACLInterfaceEtypeWhitelistDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Count
- m.Count = uint8(tmp[pos])
- pos += 1
- // field[1] m.NInput
- m.NInput = uint8(tmp[pos])
- pos += 1
- // field[1] m.Whitelist
- m.Whitelist = make([]uint16, m.Count)
- for i := 0; i < len(m.Whitelist); i++ {
- m.Whitelist[i] = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- }
- return nil
-}
-
-// ACLInterfaceEtypeWhitelistDump represents VPP binary API message 'acl_interface_etype_whitelist_dump'.
-type ACLInterfaceEtypeWhitelistDump struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *ACLInterfaceEtypeWhitelistDump) Reset() { *m = ACLInterfaceEtypeWhitelistDump{} }
-func (*ACLInterfaceEtypeWhitelistDump) GetMessageName() string {
- return "acl_interface_etype_whitelist_dump"
-}
-func (*ACLInterfaceEtypeWhitelistDump) GetCrcString() string { return "f9e6675e" }
-func (*ACLInterfaceEtypeWhitelistDump) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *ACLInterfaceEtypeWhitelistDump) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *ACLInterfaceEtypeWhitelistDump) 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 *ACLInterfaceEtypeWhitelistDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// ACLInterfaceListDetails represents VPP binary API message 'acl_interface_list_details'.
-type ACLInterfaceListDetails struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- Count uint8 `binapi:"u8,name=count" json:"count,omitempty" struc:"sizeof=Acls"`
- NInput uint8 `binapi:"u8,name=n_input" json:"n_input,omitempty"`
- Acls []uint32 `binapi:"u32[count],name=acls" json:"acls,omitempty"`
-}
-
-func (m *ACLInterfaceListDetails) Reset() { *m = ACLInterfaceListDetails{} }
-func (*ACLInterfaceListDetails) GetMessageName() string { return "acl_interface_list_details" }
-func (*ACLInterfaceListDetails) GetCrcString() string { return "e695d256" }
-func (*ACLInterfaceListDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *ACLInterfaceListDetails) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Count
- size += 1
- // field[1] m.NInput
- size += 1
- // field[1] m.Acls
- size += 4 * len(m.Acls)
- return size
-}
-func (m *ACLInterfaceListDetails) 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.Count
- buf[pos] = uint8(len(m.Acls))
- pos += 1
- // field[1] m.NInput
- buf[pos] = uint8(m.NInput)
- pos += 1
- // field[1] m.Acls
- for i := 0; i < len(m.Acls); i++ {
- var x uint32
- if i < len(m.Acls) {
- x = uint32(m.Acls[i])
- }
- o.PutUint32(buf[pos:pos+4], uint32(x))
- pos += 4
- }
- return buf, nil
-}
-func (m *ACLInterfaceListDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Count
- m.Count = uint8(tmp[pos])
- pos += 1
- // field[1] m.NInput
- m.NInput = uint8(tmp[pos])
- pos += 1
- // field[1] m.Acls
- m.Acls = make([]uint32, m.Count)
- for i := 0; i < len(m.Acls); i++ {
- m.Acls[i] = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- }
- return nil
-}
-
-// ACLInterfaceListDump represents VPP binary API message 'acl_interface_list_dump'.
-type ACLInterfaceListDump struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4.294967295e+09" json:"sw_if_index,omitempty"`
-}
-
-func (m *ACLInterfaceListDump) Reset() { *m = ACLInterfaceListDump{} }
-func (*ACLInterfaceListDump) GetMessageName() string { return "acl_interface_list_dump" }
-func (*ACLInterfaceListDump) GetCrcString() string { return "f9e6675e" }
-func (*ACLInterfaceListDump) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *ACLInterfaceListDump) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *ACLInterfaceListDump) 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 *ACLInterfaceListDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// ACLInterfaceSetACLList represents VPP binary API message 'acl_interface_set_acl_list'.
-type ACLInterfaceSetACLList struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- Count uint8 `binapi:"u8,name=count" json:"count,omitempty" struc:"sizeof=Acls"`
- NInput uint8 `binapi:"u8,name=n_input" json:"n_input,omitempty"`
- Acls []uint32 `binapi:"u32[count],name=acls" json:"acls,omitempty"`
-}
-
-func (m *ACLInterfaceSetACLList) Reset() { *m = ACLInterfaceSetACLList{} }
-func (*ACLInterfaceSetACLList) GetMessageName() string { return "acl_interface_set_acl_list" }
-func (*ACLInterfaceSetACLList) GetCrcString() string { return "473982bd" }
-func (*ACLInterfaceSetACLList) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *ACLInterfaceSetACLList) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Count
- size += 1
- // field[1] m.NInput
- size += 1
- // field[1] m.Acls
- size += 4 * len(m.Acls)
- return size
-}
-func (m *ACLInterfaceSetACLList) 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.Count
- buf[pos] = uint8(len(m.Acls))
- pos += 1
- // field[1] m.NInput
- buf[pos] = uint8(m.NInput)
- pos += 1
- // field[1] m.Acls
- for i := 0; i < len(m.Acls); i++ {
- var x uint32
- if i < len(m.Acls) {
- x = uint32(m.Acls[i])
- }
- o.PutUint32(buf[pos:pos+4], uint32(x))
- pos += 4
- }
- return buf, nil
-}
-func (m *ACLInterfaceSetACLList) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Count
- m.Count = uint8(tmp[pos])
- pos += 1
- // field[1] m.NInput
- m.NInput = uint8(tmp[pos])
- pos += 1
- // field[1] m.Acls
- m.Acls = make([]uint32, m.Count)
- for i := 0; i < len(m.Acls); i++ {
- m.Acls[i] = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- }
- return nil
-}
-
-// ACLInterfaceSetACLListReply represents VPP binary API message 'acl_interface_set_acl_list_reply'.
-type ACLInterfaceSetACLListReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *ACLInterfaceSetACLListReply) Reset() { *m = ACLInterfaceSetACLListReply{} }
-func (*ACLInterfaceSetACLListReply) GetMessageName() string {
- return "acl_interface_set_acl_list_reply"
-}
-func (*ACLInterfaceSetACLListReply) GetCrcString() string { return "e8d4e804" }
-func (*ACLInterfaceSetACLListReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *ACLInterfaceSetACLListReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *ACLInterfaceSetACLListReply) 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 *ACLInterfaceSetACLListReply) 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
- return nil
-}
-
-// ACLInterfaceSetEtypeWhitelist represents VPP binary API message 'acl_interface_set_etype_whitelist'.
-type ACLInterfaceSetEtypeWhitelist struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- Count uint8 `binapi:"u8,name=count" json:"count,omitempty" struc:"sizeof=Whitelist"`
- NInput uint8 `binapi:"u8,name=n_input" json:"n_input,omitempty"`
- Whitelist []uint16 `binapi:"u16[count],name=whitelist" json:"whitelist,omitempty"`
-}
-
-func (m *ACLInterfaceSetEtypeWhitelist) Reset() { *m = ACLInterfaceSetEtypeWhitelist{} }
-func (*ACLInterfaceSetEtypeWhitelist) GetMessageName() string {
- return "acl_interface_set_etype_whitelist"
-}
-func (*ACLInterfaceSetEtypeWhitelist) GetCrcString() string { return "3f5c2d2d" }
-func (*ACLInterfaceSetEtypeWhitelist) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *ACLInterfaceSetEtypeWhitelist) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Count
- size += 1
- // field[1] m.NInput
- size += 1
- // field[1] m.Whitelist
- size += 2 * len(m.Whitelist)
- return size
-}
-func (m *ACLInterfaceSetEtypeWhitelist) 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.Count
- buf[pos] = uint8(len(m.Whitelist))
- pos += 1
- // field[1] m.NInput
- buf[pos] = uint8(m.NInput)
- pos += 1
- // field[1] m.Whitelist
- for i := 0; i < len(m.Whitelist); i++ {
- var x uint16
- if i < len(m.Whitelist) {
- x = uint16(m.Whitelist[i])
- }
- o.PutUint16(buf[pos:pos+2], uint16(x))
- pos += 2
- }
- return buf, nil
-}
-func (m *ACLInterfaceSetEtypeWhitelist) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Count
- m.Count = uint8(tmp[pos])
- pos += 1
- // field[1] m.NInput
- m.NInput = uint8(tmp[pos])
- pos += 1
- // field[1] m.Whitelist
- m.Whitelist = make([]uint16, m.Count)
- for i := 0; i < len(m.Whitelist); i++ {
- m.Whitelist[i] = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- }
- return nil
-}
-
-// ACLInterfaceSetEtypeWhitelistReply represents VPP binary API message 'acl_interface_set_etype_whitelist_reply'.
-type ACLInterfaceSetEtypeWhitelistReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *ACLInterfaceSetEtypeWhitelistReply) Reset() { *m = ACLInterfaceSetEtypeWhitelistReply{} }
-func (*ACLInterfaceSetEtypeWhitelistReply) GetMessageName() string {
- return "acl_interface_set_etype_whitelist_reply"
-}
-func (*ACLInterfaceSetEtypeWhitelistReply) GetCrcString() string { return "e8d4e804" }
-func (*ACLInterfaceSetEtypeWhitelistReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *ACLInterfaceSetEtypeWhitelistReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *ACLInterfaceSetEtypeWhitelistReply) 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 *ACLInterfaceSetEtypeWhitelistReply) 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
- return nil
-}
-
-// ACLPluginControlPing represents VPP binary API message 'acl_plugin_control_ping'.
-type ACLPluginControlPing struct{}
-
-func (m *ACLPluginControlPing) Reset() { *m = ACLPluginControlPing{} }
-func (*ACLPluginControlPing) GetMessageName() string { return "acl_plugin_control_ping" }
-func (*ACLPluginControlPing) GetCrcString() string { return "51077d14" }
-func (*ACLPluginControlPing) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *ACLPluginControlPing) Size() int {
- if m == nil {
- return 0
- }
- var size int
- return size
-}
-func (m *ACLPluginControlPing) 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
- }
- return buf, nil
-}
-func (m *ACLPluginControlPing) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- return nil
-}
-
-// ACLPluginControlPingReply represents VPP binary API message 'acl_plugin_control_ping_reply'.
-type ACLPluginControlPingReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- ClientIndex uint32 `binapi:"u32,name=client_index" json:"client_index,omitempty"`
- VpePID uint32 `binapi:"u32,name=vpe_pid" json:"vpe_pid,omitempty"`
-}
-
-func (m *ACLPluginControlPingReply) Reset() { *m = ACLPluginControlPingReply{} }
-func (*ACLPluginControlPingReply) GetMessageName() string { return "acl_plugin_control_ping_reply" }
-func (*ACLPluginControlPingReply) GetCrcString() string { return "f6b0b8ca" }
-func (*ACLPluginControlPingReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *ACLPluginControlPingReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.ClientIndex
- size += 4
- // field[1] m.VpePID
- size += 4
- return size
-}
-func (m *ACLPluginControlPingReply) 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.ClientIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ClientIndex))
- pos += 4
- // field[1] m.VpePID
- o.PutUint32(buf[pos:pos+4], uint32(m.VpePID))
- pos += 4
- return buf, nil
-}
-func (m *ACLPluginControlPingReply) 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.ClientIndex
- m.ClientIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.VpePID
- m.VpePID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// ACLPluginGetConnTableMaxEntries represents VPP binary API message 'acl_plugin_get_conn_table_max_entries'.
-type ACLPluginGetConnTableMaxEntries struct{}
-
-func (m *ACLPluginGetConnTableMaxEntries) Reset() { *m = ACLPluginGetConnTableMaxEntries{} }
-func (*ACLPluginGetConnTableMaxEntries) GetMessageName() string {
- return "acl_plugin_get_conn_table_max_entries"
-}
-func (*ACLPluginGetConnTableMaxEntries) GetCrcString() string { return "51077d14" }
-func (*ACLPluginGetConnTableMaxEntries) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *ACLPluginGetConnTableMaxEntries) Size() int {
- if m == nil {
- return 0
- }
- var size int
- return size
-}
-func (m *ACLPluginGetConnTableMaxEntries) 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
- }
- return buf, nil
-}
-func (m *ACLPluginGetConnTableMaxEntries) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- return nil
-}
-
-// ACLPluginGetConnTableMaxEntriesReply represents VPP binary API message 'acl_plugin_get_conn_table_max_entries_reply'.
-type ACLPluginGetConnTableMaxEntriesReply struct {
- ConnTableMaxEntries uint64 `binapi:"u64,name=conn_table_max_entries" json:"conn_table_max_entries,omitempty"`
-}
-
-func (m *ACLPluginGetConnTableMaxEntriesReply) Reset() { *m = ACLPluginGetConnTableMaxEntriesReply{} }
-func (*ACLPluginGetConnTableMaxEntriesReply) GetMessageName() string {
- return "acl_plugin_get_conn_table_max_entries_reply"
-}
-func (*ACLPluginGetConnTableMaxEntriesReply) GetCrcString() string { return "7a096d3d" }
-func (*ACLPluginGetConnTableMaxEntriesReply) GetMessageType() api.MessageType {
- return api.ReplyMessage
-}
-
-func (m *ACLPluginGetConnTableMaxEntriesReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.ConnTableMaxEntries
- size += 8
- return size
-}
-func (m *ACLPluginGetConnTableMaxEntriesReply) 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.ConnTableMaxEntries
- o.PutUint64(buf[pos:pos+8], uint64(m.ConnTableMaxEntries))
- pos += 8
- return buf, nil
-}
-func (m *ACLPluginGetConnTableMaxEntriesReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ConnTableMaxEntries
- m.ConnTableMaxEntries = uint64(o.Uint64(tmp[pos : pos+8]))
- pos += 8
- return nil
-}
-
-// ACLPluginGetVersion represents VPP binary API message 'acl_plugin_get_version'.
-type ACLPluginGetVersion struct{}
-
-func (m *ACLPluginGetVersion) Reset() { *m = ACLPluginGetVersion{} }
-func (*ACLPluginGetVersion) GetMessageName() string { return "acl_plugin_get_version" }
-func (*ACLPluginGetVersion) GetCrcString() string { return "51077d14" }
-func (*ACLPluginGetVersion) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *ACLPluginGetVersion) Size() int {
- if m == nil {
- return 0
- }
- var size int
- return size
-}
-func (m *ACLPluginGetVersion) 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
- }
- return buf, nil
-}
-func (m *ACLPluginGetVersion) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- return nil
-}
-
-// ACLPluginGetVersionReply represents VPP binary API message 'acl_plugin_get_version_reply'.
-type ACLPluginGetVersionReply struct {
- Major uint32 `binapi:"u32,name=major" json:"major,omitempty"`
- Minor uint32 `binapi:"u32,name=minor" json:"minor,omitempty"`
-}
-
-func (m *ACLPluginGetVersionReply) Reset() { *m = ACLPluginGetVersionReply{} }
-func (*ACLPluginGetVersionReply) GetMessageName() string { return "acl_plugin_get_version_reply" }
-func (*ACLPluginGetVersionReply) GetCrcString() string { return "9b32cf86" }
-func (*ACLPluginGetVersionReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *ACLPluginGetVersionReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Major
- size += 4
- // field[1] m.Minor
- size += 4
- return size
-}
-func (m *ACLPluginGetVersionReply) 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.Major
- o.PutUint32(buf[pos:pos+4], uint32(m.Major))
- pos += 4
- // field[1] m.Minor
- o.PutUint32(buf[pos:pos+4], uint32(m.Minor))
- pos += 4
- return buf, nil
-}
-func (m *ACLPluginGetVersionReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Major
- m.Major = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Minor
- m.Minor = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// ACLStatsIntfCountersEnable represents VPP binary API message 'acl_stats_intf_counters_enable'.
-type ACLStatsIntfCountersEnable struct {
- Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
-}
-
-func (m *ACLStatsIntfCountersEnable) Reset() { *m = ACLStatsIntfCountersEnable{} }
-func (*ACLStatsIntfCountersEnable) GetMessageName() string { return "acl_stats_intf_counters_enable" }
-func (*ACLStatsIntfCountersEnable) GetCrcString() string { return "b3e225d2" }
-func (*ACLStatsIntfCountersEnable) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *ACLStatsIntfCountersEnable) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Enable
- size += 1
- return size
-}
-func (m *ACLStatsIntfCountersEnable) 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.Enable
- if m.Enable {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *ACLStatsIntfCountersEnable) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Enable
- m.Enable = tmp[pos] != 0
- pos += 1
- return nil
-}
-
-// ACLStatsIntfCountersEnableReply represents VPP binary API message 'acl_stats_intf_counters_enable_reply'.
-type ACLStatsIntfCountersEnableReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *ACLStatsIntfCountersEnableReply) Reset() { *m = ACLStatsIntfCountersEnableReply{} }
-func (*ACLStatsIntfCountersEnableReply) GetMessageName() string {
- return "acl_stats_intf_counters_enable_reply"
-}
-func (*ACLStatsIntfCountersEnableReply) GetCrcString() string { return "e8d4e804" }
-func (*ACLStatsIntfCountersEnableReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *ACLStatsIntfCountersEnableReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *ACLStatsIntfCountersEnableReply) 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 *ACLStatsIntfCountersEnableReply) 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
- return nil
-}
-
-// MacipACLAdd represents VPP binary API message 'macip_acl_add'.
-type MacipACLAdd struct {
- Tag string `binapi:"string[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
- Count uint32 `binapi:"u32,name=count" json:"count,omitempty" struc:"sizeof=R"`
- R []MacipACLRule `binapi:"macip_acl_rule[count],name=r" json:"r,omitempty"`
-}
-
-func (m *MacipACLAdd) Reset() { *m = MacipACLAdd{} }
-func (*MacipACLAdd) GetMessageName() string { return "macip_acl_add" }
-func (*MacipACLAdd) GetCrcString() string { return "d648fd0a" }
-func (*MacipACLAdd) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *MacipACLAdd) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Tag
- size += 64
- // field[1] m.Count
- size += 4
- // field[1] m.R
- for j1 := 0; j1 < len(m.R); j1++ {
- var s1 MacipACLRule
- _ = s1
- if j1 < len(m.R) {
- s1 = m.R[j1]
- }
- // field[2] s1.IsPermit
- size += 1
- // field[2] s1.SrcMac
- size += 6
- // field[2] s1.SrcMacMask
- size += 6
- // field[2] s1.SrcPrefix
- // field[3] s1.SrcPrefix.Address
- // field[4] s1.SrcPrefix.Address.Af
- size += 1
- // field[4] s1.SrcPrefix.Address.Un
- size += 16
- // field[3] s1.SrcPrefix.Len
- size += 1
- }
- return size
-}
-func (m *MacipACLAdd) 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.Tag
- copy(buf[pos:pos+64], m.Tag)
- pos += 64
- // field[1] m.Count
- o.PutUint32(buf[pos:pos+4], uint32(len(m.R)))
- pos += 4
- // field[1] m.R
- for j1 := 0; j1 < len(m.R); j1++ {
- var v1 MacipACLRule
- if j1 < len(m.R) {
- v1 = m.R[j1]
- }
- // field[2] v1.IsPermit
- buf[pos] = uint8(v1.IsPermit)
- pos += 1
- // field[2] v1.SrcMac
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(v1.SrcMac) {
- x = uint8(v1.SrcMac[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.SrcMacMask
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(v1.SrcMacMask) {
- x = uint8(v1.SrcMacMask[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.SrcPrefix
- // field[3] v1.SrcPrefix.Address
- // field[4] v1.SrcPrefix.Address.Af
- buf[pos] = uint8(v1.SrcPrefix.Address.Af)
- pos += 1
- // field[4] v1.SrcPrefix.Address.Un
- copy(buf[pos:pos+16], v1.SrcPrefix.Address.Un.XXX_UnionData[:])
- pos += 16
- // field[3] v1.SrcPrefix.Len
- buf[pos] = uint8(v1.SrcPrefix.Len)
- pos += 1
- }
- return buf, nil
-}
-func (m *MacipACLAdd) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Tag
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Tag = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- // field[1] m.Count
- m.Count = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.R
- m.R = make([]MacipACLRule, int(m.Count))
- for j1 := 0; j1 < int(m.Count); j1++ {
- // field[2] m.R[j1].IsPermit
- m.R[j1].IsPermit = ACLAction(tmp[pos])
- pos += 1
- // field[2] m.R[j1].SrcMac
- for i := 0; i < len(m.R[j1].SrcMac); i++ {
- m.R[j1].SrcMac[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].SrcMacMask
- for i := 0; i < len(m.R[j1].SrcMacMask); i++ {
- m.R[j1].SrcMacMask[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].SrcPrefix
- // field[3] m.R[j1].SrcPrefix.Address
- // field[4] m.R[j1].SrcPrefix.Address.Af
- m.R[j1].SrcPrefix.Address.Af = ip_types.AddressFamily(tmp[pos])
- pos += 1
- // field[4] m.R[j1].SrcPrefix.Address.Un
- copy(m.R[j1].SrcPrefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[3] m.R[j1].SrcPrefix.Len
- m.R[j1].SrcPrefix.Len = uint8(tmp[pos])
- pos += 1
- }
- return nil
-}
-
-// MacipACLAddReplace represents VPP binary API message 'macip_acl_add_replace'.
-type MacipACLAddReplace struct {
- ACLIndex uint32 `binapi:"u32,name=acl_index,default=4.294967295e+09" json:"acl_index,omitempty"`
- Tag string `binapi:"string[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
- Count uint32 `binapi:"u32,name=count" json:"count,omitempty" struc:"sizeof=R"`
- R []MacipACLRule `binapi:"macip_acl_rule[count],name=r" json:"r,omitempty"`
-}
-
-func (m *MacipACLAddReplace) Reset() { *m = MacipACLAddReplace{} }
-func (*MacipACLAddReplace) GetMessageName() string { return "macip_acl_add_replace" }
-func (*MacipACLAddReplace) GetCrcString() string { return "e34402a7" }
-func (*MacipACLAddReplace) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *MacipACLAddReplace) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.ACLIndex
- size += 4
- // field[1] m.Tag
- size += 64
- // field[1] m.Count
- size += 4
- // field[1] m.R
- for j1 := 0; j1 < len(m.R); j1++ {
- var s1 MacipACLRule
- _ = s1
- if j1 < len(m.R) {
- s1 = m.R[j1]
- }
- // field[2] s1.IsPermit
- size += 1
- // field[2] s1.SrcMac
- size += 6
- // field[2] s1.SrcMacMask
- size += 6
- // field[2] s1.SrcPrefix
- // field[3] s1.SrcPrefix.Address
- // field[4] s1.SrcPrefix.Address.Af
- size += 1
- // field[4] s1.SrcPrefix.Address.Un
- size += 16
- // field[3] s1.SrcPrefix.Len
- size += 1
- }
- return size
-}
-func (m *MacipACLAddReplace) 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.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- // field[1] m.Tag
- copy(buf[pos:pos+64], m.Tag)
- pos += 64
- // field[1] m.Count
- o.PutUint32(buf[pos:pos+4], uint32(len(m.R)))
- pos += 4
- // field[1] m.R
- for j1 := 0; j1 < len(m.R); j1++ {
- var v1 MacipACLRule
- if j1 < len(m.R) {
- v1 = m.R[j1]
- }
- // field[2] v1.IsPermit
- buf[pos] = uint8(v1.IsPermit)
- pos += 1
- // field[2] v1.SrcMac
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(v1.SrcMac) {
- x = uint8(v1.SrcMac[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.SrcMacMask
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(v1.SrcMacMask) {
- x = uint8(v1.SrcMacMask[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.SrcPrefix
- // field[3] v1.SrcPrefix.Address
- // field[4] v1.SrcPrefix.Address.Af
- buf[pos] = uint8(v1.SrcPrefix.Address.Af)
- pos += 1
- // field[4] v1.SrcPrefix.Address.Un
- copy(buf[pos:pos+16], v1.SrcPrefix.Address.Un.XXX_UnionData[:])
- pos += 16
- // field[3] v1.SrcPrefix.Len
- buf[pos] = uint8(v1.SrcPrefix.Len)
- pos += 1
- }
- return buf, nil
-}
-func (m *MacipACLAddReplace) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Tag
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Tag = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- // field[1] m.Count
- m.Count = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.R
- m.R = make([]MacipACLRule, int(m.Count))
- for j1 := 0; j1 < int(m.Count); j1++ {
- // field[2] m.R[j1].IsPermit
- m.R[j1].IsPermit = ACLAction(tmp[pos])
- pos += 1
- // field[2] m.R[j1].SrcMac
- for i := 0; i < len(m.R[j1].SrcMac); i++ {
- m.R[j1].SrcMac[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].SrcMacMask
- for i := 0; i < len(m.R[j1].SrcMacMask); i++ {
- m.R[j1].SrcMacMask[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].SrcPrefix
- // field[3] m.R[j1].SrcPrefix.Address
- // field[4] m.R[j1].SrcPrefix.Address.Af
- m.R[j1].SrcPrefix.Address.Af = ip_types.AddressFamily(tmp[pos])
- pos += 1
- // field[4] m.R[j1].SrcPrefix.Address.Un
- copy(m.R[j1].SrcPrefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[3] m.R[j1].SrcPrefix.Len
- m.R[j1].SrcPrefix.Len = uint8(tmp[pos])
- pos += 1
- }
- return nil
-}
-
-// MacipACLAddReplaceReply represents VPP binary API message 'macip_acl_add_replace_reply'.
-type MacipACLAddReplaceReply struct {
- ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *MacipACLAddReplaceReply) Reset() { *m = MacipACLAddReplaceReply{} }
-func (*MacipACLAddReplaceReply) GetMessageName() string { return "macip_acl_add_replace_reply" }
-func (*MacipACLAddReplaceReply) GetCrcString() string { return "ac407b0c" }
-func (*MacipACLAddReplaceReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *MacipACLAddReplaceReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.ACLIndex
- size += 4
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *MacipACLAddReplaceReply) 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.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *MacipACLAddReplaceReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// MacipACLAddReply represents VPP binary API message 'macip_acl_add_reply'.
-type MacipACLAddReply struct {
- ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *MacipACLAddReply) Reset() { *m = MacipACLAddReply{} }
-func (*MacipACLAddReply) GetMessageName() string { return "macip_acl_add_reply" }
-func (*MacipACLAddReply) GetCrcString() string { return "ac407b0c" }
-func (*MacipACLAddReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *MacipACLAddReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.ACLIndex
- size += 4
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *MacipACLAddReply) 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.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- // field[1] m.Retval
- o.PutUint32(buf[pos:pos+4], uint32(m.Retval))
- pos += 4
- return buf, nil
-}
-func (m *MacipACLAddReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Retval
- m.Retval = int32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// MacipACLDel represents VPP binary API message 'macip_acl_del'.
-type MacipACLDel struct {
- ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
-}
-
-func (m *MacipACLDel) Reset() { *m = MacipACLDel{} }
-func (*MacipACLDel) GetMessageName() string { return "macip_acl_del" }
-func (*MacipACLDel) GetCrcString() string { return "ef34fea4" }
-func (*MacipACLDel) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *MacipACLDel) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.ACLIndex
- size += 4
- return size
-}
-func (m *MacipACLDel) 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.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- return buf, nil
-}
-func (m *MacipACLDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// MacipACLDelReply represents VPP binary API message 'macip_acl_del_reply'.
-type MacipACLDelReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *MacipACLDelReply) Reset() { *m = MacipACLDelReply{} }
-func (*MacipACLDelReply) GetMessageName() string { return "macip_acl_del_reply" }
-func (*MacipACLDelReply) GetCrcString() string { return "e8d4e804" }
-func (*MacipACLDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *MacipACLDelReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *MacipACLDelReply) 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 *MacipACLDelReply) 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
- return nil
-}
-
-// MacipACLDetails represents VPP binary API message 'macip_acl_details'.
-type MacipACLDetails struct {
- ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
- Tag string `binapi:"string[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
- Count uint32 `binapi:"u32,name=count" json:"count,omitempty" struc:"sizeof=R"`
- R []MacipACLRule `binapi:"macip_acl_rule[count],name=r" json:"r,omitempty"`
-}
-
-func (m *MacipACLDetails) Reset() { *m = MacipACLDetails{} }
-func (*MacipACLDetails) GetMessageName() string { return "macip_acl_details" }
-func (*MacipACLDetails) GetCrcString() string { return "57c7482f" }
-func (*MacipACLDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *MacipACLDetails) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.ACLIndex
- size += 4
- // field[1] m.Tag
- size += 64
- // field[1] m.Count
- size += 4
- // field[1] m.R
- for j1 := 0; j1 < len(m.R); j1++ {
- var s1 MacipACLRule
- _ = s1
- if j1 < len(m.R) {
- s1 = m.R[j1]
- }
- // field[2] s1.IsPermit
- size += 1
- // field[2] s1.SrcMac
- size += 6
- // field[2] s1.SrcMacMask
- size += 6
- // field[2] s1.SrcPrefix
- // field[3] s1.SrcPrefix.Address
- // field[4] s1.SrcPrefix.Address.Af
- size += 1
- // field[4] s1.SrcPrefix.Address.Un
- size += 16
- // field[3] s1.SrcPrefix.Len
- size += 1
- }
- return size
-}
-func (m *MacipACLDetails) 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.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- // field[1] m.Tag
- copy(buf[pos:pos+64], m.Tag)
- pos += 64
- // field[1] m.Count
- o.PutUint32(buf[pos:pos+4], uint32(len(m.R)))
- pos += 4
- // field[1] m.R
- for j1 := 0; j1 < len(m.R); j1++ {
- var v1 MacipACLRule
- if j1 < len(m.R) {
- v1 = m.R[j1]
- }
- // field[2] v1.IsPermit
- buf[pos] = uint8(v1.IsPermit)
- pos += 1
- // field[2] v1.SrcMac
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(v1.SrcMac) {
- x = uint8(v1.SrcMac[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.SrcMacMask
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(v1.SrcMacMask) {
- x = uint8(v1.SrcMacMask[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[2] v1.SrcPrefix
- // field[3] v1.SrcPrefix.Address
- // field[4] v1.SrcPrefix.Address.Af
- buf[pos] = uint8(v1.SrcPrefix.Address.Af)
- pos += 1
- // field[4] v1.SrcPrefix.Address.Un
- copy(buf[pos:pos+16], v1.SrcPrefix.Address.Un.XXX_UnionData[:])
- pos += 16
- // field[3] v1.SrcPrefix.Len
- buf[pos] = uint8(v1.SrcPrefix.Len)
- pos += 1
- }
- return buf, nil
-}
-func (m *MacipACLDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Tag
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Tag = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- // field[1] m.Count
- m.Count = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.R
- m.R = make([]MacipACLRule, int(m.Count))
- for j1 := 0; j1 < int(m.Count); j1++ {
- // field[2] m.R[j1].IsPermit
- m.R[j1].IsPermit = ACLAction(tmp[pos])
- pos += 1
- // field[2] m.R[j1].SrcMac
- for i := 0; i < len(m.R[j1].SrcMac); i++ {
- m.R[j1].SrcMac[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].SrcMacMask
- for i := 0; i < len(m.R[j1].SrcMacMask); i++ {
- m.R[j1].SrcMacMask[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[2] m.R[j1].SrcPrefix
- // field[3] m.R[j1].SrcPrefix.Address
- // field[4] m.R[j1].SrcPrefix.Address.Af
- m.R[j1].SrcPrefix.Address.Af = ip_types.AddressFamily(tmp[pos])
- pos += 1
- // field[4] m.R[j1].SrcPrefix.Address.Un
- copy(m.R[j1].SrcPrefix.Address.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[3] m.R[j1].SrcPrefix.Len
- m.R[j1].SrcPrefix.Len = uint8(tmp[pos])
- pos += 1
- }
- return nil
-}
-
-// MacipACLDump represents VPP binary API message 'macip_acl_dump'.
-type MacipACLDump struct {
- ACLIndex uint32 `binapi:"u32,name=acl_index,default=4.294967295e+09" json:"acl_index,omitempty"`
-}
-
-func (m *MacipACLDump) Reset() { *m = MacipACLDump{} }
-func (*MacipACLDump) GetMessageName() string { return "macip_acl_dump" }
-func (*MacipACLDump) GetCrcString() string { return "ef34fea4" }
-func (*MacipACLDump) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *MacipACLDump) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.ACLIndex
- size += 4
- return size
-}
-func (m *MacipACLDump) 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.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- return buf, nil
-}
-func (m *MacipACLDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// MacipACLInterfaceAddDel represents VPP binary API message 'macip_acl_interface_add_del'.
-type MacipACLInterfaceAddDel struct {
- IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
-}
-
-func (m *MacipACLInterfaceAddDel) Reset() { *m = MacipACLInterfaceAddDel{} }
-func (*MacipACLInterfaceAddDel) GetMessageName() string { return "macip_acl_interface_add_del" }
-func (*MacipACLInterfaceAddDel) GetCrcString() string { return "4b8690b1" }
-func (*MacipACLInterfaceAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *MacipACLInterfaceAddDel) 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.ACLIndex
- size += 4
- return size
-}
-func (m *MacipACLInterfaceAddDel) 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.ACLIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ACLIndex))
- pos += 4
- return buf, nil
-}
-func (m *MacipACLInterfaceAddDel) 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 = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.ACLIndex
- m.ACLIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// MacipACLInterfaceAddDelReply represents VPP binary API message 'macip_acl_interface_add_del_reply'.
-type MacipACLInterfaceAddDelReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *MacipACLInterfaceAddDelReply) Reset() { *m = MacipACLInterfaceAddDelReply{} }
-func (*MacipACLInterfaceAddDelReply) GetMessageName() string {
- return "macip_acl_interface_add_del_reply"
-}
-func (*MacipACLInterfaceAddDelReply) GetCrcString() string { return "e8d4e804" }
-func (*MacipACLInterfaceAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *MacipACLInterfaceAddDelReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *MacipACLInterfaceAddDelReply) 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 *MacipACLInterfaceAddDelReply) 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
- return nil
-}
-
-// MacipACLInterfaceGet represents VPP binary API message 'macip_acl_interface_get'.
-type MacipACLInterfaceGet struct{}
-
-func (m *MacipACLInterfaceGet) Reset() { *m = MacipACLInterfaceGet{} }
-func (*MacipACLInterfaceGet) GetMessageName() string { return "macip_acl_interface_get" }
-func (*MacipACLInterfaceGet) GetCrcString() string { return "51077d14" }
-func (*MacipACLInterfaceGet) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *MacipACLInterfaceGet) Size() int {
- if m == nil {
- return 0
- }
- var size int
- return size
-}
-func (m *MacipACLInterfaceGet) 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
- }
- return buf, nil
-}
-func (m *MacipACLInterfaceGet) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- return nil
-}
-
-// MacipACLInterfaceGetReply represents VPP binary API message 'macip_acl_interface_get_reply'.
-type MacipACLInterfaceGetReply struct {
- Count uint32 `binapi:"u32,name=count" json:"count,omitempty" struc:"sizeof=Acls"`
- Acls []uint32 `binapi:"u32[count],name=acls" json:"acls,omitempty"`
-}
-
-func (m *MacipACLInterfaceGetReply) Reset() { *m = MacipACLInterfaceGetReply{} }
-func (*MacipACLInterfaceGetReply) GetMessageName() string { return "macip_acl_interface_get_reply" }
-func (*MacipACLInterfaceGetReply) GetCrcString() string { return "accf9b05" }
-func (*MacipACLInterfaceGetReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *MacipACLInterfaceGetReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Count
- size += 4
- // field[1] m.Acls
- size += 4 * len(m.Acls)
- return size
-}
-func (m *MacipACLInterfaceGetReply) 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.Count
- o.PutUint32(buf[pos:pos+4], uint32(len(m.Acls)))
- pos += 4
- // field[1] m.Acls
- for i := 0; i < len(m.Acls); i++ {
- var x uint32
- if i < len(m.Acls) {
- x = uint32(m.Acls[i])
- }
- o.PutUint32(buf[pos:pos+4], uint32(x))
- pos += 4
- }
- return buf, nil
-}
-func (m *MacipACLInterfaceGetReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Count
- m.Count = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Acls
- m.Acls = make([]uint32, m.Count)
- for i := 0; i < len(m.Acls); i++ {
- m.Acls[i] = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- }
- return nil
-}
-
-// MacipACLInterfaceListDetails represents VPP binary API message 'macip_acl_interface_list_details'.
-type MacipACLInterfaceListDetails struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- Count uint8 `binapi:"u8,name=count" json:"count,omitempty" struc:"sizeof=Acls"`
- Acls []uint32 `binapi:"u32[count],name=acls" json:"acls,omitempty"`
-}
-
-func (m *MacipACLInterfaceListDetails) Reset() { *m = MacipACLInterfaceListDetails{} }
-func (*MacipACLInterfaceListDetails) GetMessageName() string {
- return "macip_acl_interface_list_details"
-}
-func (*MacipACLInterfaceListDetails) GetCrcString() string { return "a0c5d56d" }
-func (*MacipACLInterfaceListDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *MacipACLInterfaceListDetails) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Count
- size += 1
- // field[1] m.Acls
- size += 4 * len(m.Acls)
- return size
-}
-func (m *MacipACLInterfaceListDetails) 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.Count
- buf[pos] = uint8(len(m.Acls))
- pos += 1
- // field[1] m.Acls
- for i := 0; i < len(m.Acls); i++ {
- var x uint32
- if i < len(m.Acls) {
- x = uint32(m.Acls[i])
- }
- o.PutUint32(buf[pos:pos+4], uint32(x))
- pos += 4
- }
- return buf, nil
-}
-func (m *MacipACLInterfaceListDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Count
- m.Count = uint8(tmp[pos])
- pos += 1
- // field[1] m.Acls
- m.Acls = make([]uint32, m.Count)
- for i := 0; i < len(m.Acls); i++ {
- m.Acls[i] = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- }
- return nil
-}
-
-// MacipACLInterfaceListDump represents VPP binary API message 'macip_acl_interface_list_dump'.
-type MacipACLInterfaceListDump struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *MacipACLInterfaceListDump) Reset() { *m = MacipACLInterfaceListDump{} }
-func (*MacipACLInterfaceListDump) GetMessageName() string { return "macip_acl_interface_list_dump" }
-func (*MacipACLInterfaceListDump) GetCrcString() string { return "f9e6675e" }
-func (*MacipACLInterfaceListDump) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *MacipACLInterfaceListDump) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *MacipACLInterfaceListDump) 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 *MacipACLInterfaceListDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-func init() { file_acl_binapi_init() }
-func file_acl_binapi_init() {
- api.RegisterMessage((*ACLAddReplace)(nil), "acl.ACLAddReplace")
- api.RegisterMessage((*ACLAddReplaceReply)(nil), "acl.ACLAddReplaceReply")
- api.RegisterMessage((*ACLDel)(nil), "acl.ACLDel")
- api.RegisterMessage((*ACLDelReply)(nil), "acl.ACLDelReply")
- api.RegisterMessage((*ACLDetails)(nil), "acl.ACLDetails")
- api.RegisterMessage((*ACLDump)(nil), "acl.ACLDump")
- api.RegisterMessage((*ACLInterfaceAddDel)(nil), "acl.ACLInterfaceAddDel")
- api.RegisterMessage((*ACLInterfaceAddDelReply)(nil), "acl.ACLInterfaceAddDelReply")
- api.RegisterMessage((*ACLInterfaceEtypeWhitelistDetails)(nil), "acl.ACLInterfaceEtypeWhitelistDetails")
- api.RegisterMessage((*ACLInterfaceEtypeWhitelistDump)(nil), "acl.ACLInterfaceEtypeWhitelistDump")
- api.RegisterMessage((*ACLInterfaceListDetails)(nil), "acl.ACLInterfaceListDetails")
- api.RegisterMessage((*ACLInterfaceListDump)(nil), "acl.ACLInterfaceListDump")
- api.RegisterMessage((*ACLInterfaceSetACLList)(nil), "acl.ACLInterfaceSetACLList")
- api.RegisterMessage((*ACLInterfaceSetACLListReply)(nil), "acl.ACLInterfaceSetACLListReply")
- api.RegisterMessage((*ACLInterfaceSetEtypeWhitelist)(nil), "acl.ACLInterfaceSetEtypeWhitelist")
- api.RegisterMessage((*ACLInterfaceSetEtypeWhitelistReply)(nil), "acl.ACLInterfaceSetEtypeWhitelistReply")
- api.RegisterMessage((*ACLPluginControlPing)(nil), "acl.ACLPluginControlPing")
- api.RegisterMessage((*ACLPluginControlPingReply)(nil), "acl.ACLPluginControlPingReply")
- api.RegisterMessage((*ACLPluginGetConnTableMaxEntries)(nil), "acl.ACLPluginGetConnTableMaxEntries")
- api.RegisterMessage((*ACLPluginGetConnTableMaxEntriesReply)(nil), "acl.ACLPluginGetConnTableMaxEntriesReply")
- api.RegisterMessage((*ACLPluginGetVersion)(nil), "acl.ACLPluginGetVersion")
- api.RegisterMessage((*ACLPluginGetVersionReply)(nil), "acl.ACLPluginGetVersionReply")
- api.RegisterMessage((*ACLStatsIntfCountersEnable)(nil), "acl.ACLStatsIntfCountersEnable")
- api.RegisterMessage((*ACLStatsIntfCountersEnableReply)(nil), "acl.ACLStatsIntfCountersEnableReply")
- api.RegisterMessage((*MacipACLAdd)(nil), "acl.MacipACLAdd")
- api.RegisterMessage((*MacipACLAddReplace)(nil), "acl.MacipACLAddReplace")
- api.RegisterMessage((*MacipACLAddReplaceReply)(nil), "acl.MacipACLAddReplaceReply")
- api.RegisterMessage((*MacipACLAddReply)(nil), "acl.MacipACLAddReply")
- api.RegisterMessage((*MacipACLDel)(nil), "acl.MacipACLDel")
- api.RegisterMessage((*MacipACLDelReply)(nil), "acl.MacipACLDelReply")
- api.RegisterMessage((*MacipACLDetails)(nil), "acl.MacipACLDetails")
- api.RegisterMessage((*MacipACLDump)(nil), "acl.MacipACLDump")
- api.RegisterMessage((*MacipACLInterfaceAddDel)(nil), "acl.MacipACLInterfaceAddDel")
- api.RegisterMessage((*MacipACLInterfaceAddDelReply)(nil), "acl.MacipACLInterfaceAddDelReply")
- api.RegisterMessage((*MacipACLInterfaceGet)(nil), "acl.MacipACLInterfaceGet")
- api.RegisterMessage((*MacipACLInterfaceGetReply)(nil), "acl.MacipACLInterfaceGetReply")
- api.RegisterMessage((*MacipACLInterfaceListDetails)(nil), "acl.MacipACLInterfaceListDetails")
- api.RegisterMessage((*MacipACLInterfaceListDump)(nil), "acl.MacipACLInterfaceListDump")
-}
-
-// Messages returns list of all messages in this module.
-func AllMessages() []api.Message {
- return []api.Message{
- (*ACLAddReplace)(nil),
- (*ACLAddReplaceReply)(nil),
- (*ACLDel)(nil),
- (*ACLDelReply)(nil),
- (*ACLDetails)(nil),
- (*ACLDump)(nil),
- (*ACLInterfaceAddDel)(nil),
- (*ACLInterfaceAddDelReply)(nil),
- (*ACLInterfaceEtypeWhitelistDetails)(nil),
- (*ACLInterfaceEtypeWhitelistDump)(nil),
- (*ACLInterfaceListDetails)(nil),
- (*ACLInterfaceListDump)(nil),
- (*ACLInterfaceSetACLList)(nil),
- (*ACLInterfaceSetACLListReply)(nil),
- (*ACLInterfaceSetEtypeWhitelist)(nil),
- (*ACLInterfaceSetEtypeWhitelistReply)(nil),
- (*ACLPluginControlPing)(nil),
- (*ACLPluginControlPingReply)(nil),
- (*ACLPluginGetConnTableMaxEntries)(nil),
- (*ACLPluginGetConnTableMaxEntriesReply)(nil),
- (*ACLPluginGetVersion)(nil),
- (*ACLPluginGetVersionReply)(nil),
- (*ACLStatsIntfCountersEnable)(nil),
- (*ACLStatsIntfCountersEnableReply)(nil),
- (*MacipACLAdd)(nil),
- (*MacipACLAddReplace)(nil),
- (*MacipACLAddReplaceReply)(nil),
- (*MacipACLAddReply)(nil),
- (*MacipACLDel)(nil),
- (*MacipACLDelReply)(nil),
- (*MacipACLDetails)(nil),
- (*MacipACLDump)(nil),
- (*MacipACLInterfaceAddDel)(nil),
- (*MacipACLInterfaceAddDelReply)(nil),
- (*MacipACLInterfaceGet)(nil),
- (*MacipACLInterfaceGetReply)(nil),
- (*MacipACLInterfaceListDetails)(nil),
- (*MacipACLInterfaceListDump)(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 _ = strings.Contains
-var _ = struc.Pack
-var _ = binary.BigEndian
-var _ = math.Float32bits
-var _ = net.ParseIP
-var _ = fmt.Errorf
diff --git a/examples/binapi/acl/acl_rpc.ba.go b/examples/binapi/acl/acl_rpc.ba.go
deleted file mode 100644
index 62b10c3..0000000
--- a/examples/binapi/acl/acl_rpc.ba.go
+++ /dev/null
@@ -1,302 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-
-package acl
-
-import (
- "context"
- "io"
-
- api "git.fd.io/govpp.git/api"
-)
-
-// RPCService represents RPC service API for acl module.
-type RPCService interface {
- DumpACL(ctx context.Context, in *ACLDump) (RPCService_DumpACLClient, error)
- DumpACLInterfaceEtypeWhitelist(ctx context.Context, in *ACLInterfaceEtypeWhitelistDump) (RPCService_DumpACLInterfaceEtypeWhitelistClient, error)
- DumpACLInterfaceList(ctx context.Context, in *ACLInterfaceListDump) (RPCService_DumpACLInterfaceListClient, error)
- DumpMacipACL(ctx context.Context, in *MacipACLDump) (RPCService_DumpMacipACLClient, error)
- DumpMacipACLInterfaceList(ctx context.Context, in *MacipACLInterfaceListDump) (RPCService_DumpMacipACLInterfaceListClient, error)
- ACLAddReplace(ctx context.Context, in *ACLAddReplace) (*ACLAddReplaceReply, error)
- ACLDel(ctx context.Context, in *ACLDel) (*ACLDelReply, error)
- ACLInterfaceAddDel(ctx context.Context, in *ACLInterfaceAddDel) (*ACLInterfaceAddDelReply, error)
- ACLInterfaceSetACLList(ctx context.Context, in *ACLInterfaceSetACLList) (*ACLInterfaceSetACLListReply, error)
- ACLInterfaceSetEtypeWhitelist(ctx context.Context, in *ACLInterfaceSetEtypeWhitelist) (*ACLInterfaceSetEtypeWhitelistReply, error)
- ACLPluginControlPing(ctx context.Context, in *ACLPluginControlPing) (*ACLPluginControlPingReply, error)
- ACLPluginGetConnTableMaxEntries(ctx context.Context, in *ACLPluginGetConnTableMaxEntries) (*ACLPluginGetConnTableMaxEntriesReply, error)
- ACLPluginGetVersion(ctx context.Context, in *ACLPluginGetVersion) (*ACLPluginGetVersionReply, error)
- ACLStatsIntfCountersEnable(ctx context.Context, in *ACLStatsIntfCountersEnable) (*ACLStatsIntfCountersEnableReply, error)
- MacipACLAdd(ctx context.Context, in *MacipACLAdd) (*MacipACLAddReply, error)
- MacipACLAddReplace(ctx context.Context, in *MacipACLAddReplace) (*MacipACLAddReplaceReply, error)
- MacipACLDel(ctx context.Context, in *MacipACLDel) (*MacipACLDelReply, error)
- MacipACLInterfaceAddDel(ctx context.Context, in *MacipACLInterfaceAddDel) (*MacipACLInterfaceAddDelReply, error)
- MacipACLInterfaceGet(ctx context.Context, in *MacipACLInterfaceGet) (*MacipACLInterfaceGetReply, error)
-}
-
-type serviceClient struct {
- ch api.Channel
-}
-
-func NewServiceClient(ch api.Channel) RPCService {
- return &serviceClient{ch}
-}
-
-func (c *serviceClient) DumpACL(ctx context.Context, in *ACLDump) (RPCService_DumpACLClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpACLClient{stream}
- return x, nil
-}
-
-type RPCService_DumpACLClient interface {
- Recv() (*ACLDetails, error)
-}
-
-type serviceClient_DumpACLClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpACLClient) Recv() (*ACLDetails, error) {
- m := new(ACLDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) DumpACLInterfaceEtypeWhitelist(ctx context.Context, in *ACLInterfaceEtypeWhitelistDump) (RPCService_DumpACLInterfaceEtypeWhitelistClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpACLInterfaceEtypeWhitelistClient{stream}
- return x, nil
-}
-
-type RPCService_DumpACLInterfaceEtypeWhitelistClient interface {
- Recv() (*ACLInterfaceEtypeWhitelistDetails, error)
-}
-
-type serviceClient_DumpACLInterfaceEtypeWhitelistClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpACLInterfaceEtypeWhitelistClient) Recv() (*ACLInterfaceEtypeWhitelistDetails, error) {
- m := new(ACLInterfaceEtypeWhitelistDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) DumpACLInterfaceList(ctx context.Context, in *ACLInterfaceListDump) (RPCService_DumpACLInterfaceListClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpACLInterfaceListClient{stream}
- return x, nil
-}
-
-type RPCService_DumpACLInterfaceListClient interface {
- Recv() (*ACLInterfaceListDetails, error)
-}
-
-type serviceClient_DumpACLInterfaceListClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpACLInterfaceListClient) Recv() (*ACLInterfaceListDetails, error) {
- m := new(ACLInterfaceListDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) DumpMacipACL(ctx context.Context, in *MacipACLDump) (RPCService_DumpMacipACLClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpMacipACLClient{stream}
- return x, nil
-}
-
-type RPCService_DumpMacipACLClient interface {
- Recv() (*MacipACLDetails, error)
-}
-
-type serviceClient_DumpMacipACLClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpMacipACLClient) Recv() (*MacipACLDetails, error) {
- m := new(MacipACLDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) DumpMacipACLInterfaceList(ctx context.Context, in *MacipACLInterfaceListDump) (RPCService_DumpMacipACLInterfaceListClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpMacipACLInterfaceListClient{stream}
- return x, nil
-}
-
-type RPCService_DumpMacipACLInterfaceListClient interface {
- Recv() (*MacipACLInterfaceListDetails, error)
-}
-
-type serviceClient_DumpMacipACLInterfaceListClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpMacipACLInterfaceListClient) Recv() (*MacipACLInterfaceListDetails, error) {
- m := new(MacipACLInterfaceListDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) ACLAddReplace(ctx context.Context, in *ACLAddReplace) (*ACLAddReplaceReply, error) {
- out := new(ACLAddReplaceReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) ACLDel(ctx context.Context, in *ACLDel) (*ACLDelReply, error) {
- out := new(ACLDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) ACLInterfaceAddDel(ctx context.Context, in *ACLInterfaceAddDel) (*ACLInterfaceAddDelReply, error) {
- out := new(ACLInterfaceAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) ACLInterfaceSetACLList(ctx context.Context, in *ACLInterfaceSetACLList) (*ACLInterfaceSetACLListReply, error) {
- out := new(ACLInterfaceSetACLListReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) ACLInterfaceSetEtypeWhitelist(ctx context.Context, in *ACLInterfaceSetEtypeWhitelist) (*ACLInterfaceSetEtypeWhitelistReply, error) {
- out := new(ACLInterfaceSetEtypeWhitelistReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) ACLPluginControlPing(ctx context.Context, in *ACLPluginControlPing) (*ACLPluginControlPingReply, error) {
- out := new(ACLPluginControlPingReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) ACLPluginGetConnTableMaxEntries(ctx context.Context, in *ACLPluginGetConnTableMaxEntries) (*ACLPluginGetConnTableMaxEntriesReply, error) {
- out := new(ACLPluginGetConnTableMaxEntriesReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) ACLPluginGetVersion(ctx context.Context, in *ACLPluginGetVersion) (*ACLPluginGetVersionReply, error) {
- out := new(ACLPluginGetVersionReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) ACLStatsIntfCountersEnable(ctx context.Context, in *ACLStatsIntfCountersEnable) (*ACLStatsIntfCountersEnableReply, error) {
- out := new(ACLStatsIntfCountersEnableReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) MacipACLAdd(ctx context.Context, in *MacipACLAdd) (*MacipACLAddReply, error) {
- out := new(MacipACLAddReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) MacipACLAddReplace(ctx context.Context, in *MacipACLAddReplace) (*MacipACLAddReplaceReply, error) {
- out := new(MacipACLAddReplaceReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) MacipACLDel(ctx context.Context, in *MacipACLDel) (*MacipACLDelReply, error) {
- out := new(MacipACLDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) MacipACLInterfaceAddDel(ctx context.Context, in *MacipACLInterfaceAddDel) (*MacipACLInterfaceAddDelReply, error) {
- out := new(MacipACLInterfaceAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) MacipACLInterfaceGet(ctx context.Context, in *MacipACLInterfaceGet) (*MacipACLInterfaceGetReply, error) {
- out := new(MacipACLInterfaceGetReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = context.Background
-var _ = io.Copy
diff --git a/examples/binapi/af_packet/af_packet.ba.go b/examples/binapi/af_packet/af_packet.ba.go
deleted file mode 100644
index 5dc2850..0000000
--- a/examples/binapi/af_packet/af_packet.ba.go
+++ /dev/null
@@ -1,530 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-// versions:
-// binapi-generator: v0.4.0-dev
-// VPP: 20.05-release
-// source: /usr/share/vpp/api/core/af_packet.api.json
-
-/*
-Package af_packet contains generated code for VPP API file af_packet.api (2.0.0).
-
-It consists of:
- 2 aliases
- 6 enums
- 8 messages
-*/
-package af_packet
-
-import (
- "bytes"
- "context"
- "encoding/binary"
- "fmt"
- "io"
- "math"
- "net"
- "strconv"
- "strings"
-
- api "git.fd.io/govpp.git/api"
- codec "git.fd.io/govpp.git/codec"
- struc "github.com/lunixbochs/struc"
-
- interface_types "git.fd.io/govpp.git/examples/binapi/interface_types"
-)
-
-// 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 (
- // ModuleName is the name of this module.
- ModuleName = "af_packet"
- // APIVersion is the API version of this module.
- APIVersion = "2.0.0"
- // VersionCrc is the CRC of this module.
- VersionCrc = 0xe0b6c022
-)
-
-// MacAddress represents VPP binary API alias 'mac_address'.
-type MacAddress [6]uint8
-
-func ParseMAC(mac string) (parsed MacAddress, err error) {
- var hw net.HardwareAddr
- if hw, err = net.ParseMAC(mac); err != nil {
- return
- }
- copy(parsed[:], hw[:])
- return
-}
-
-func (m *MacAddress) ToString() string {
- return net.HardwareAddr(m[:]).String()
-}
-
-// AfPacketCreate represents VPP binary API message 'af_packet_create'.
-type AfPacketCreate struct {
- HwAddr MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"`
- UseRandomHwAddr bool `binapi:"bool,name=use_random_hw_addr" json:"use_random_hw_addr,omitempty"`
- HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty" struc:"[64]byte"`
-}
-
-func (m *AfPacketCreate) Reset() { *m = AfPacketCreate{} }
-func (*AfPacketCreate) GetMessageName() string { return "af_packet_create" }
-func (*AfPacketCreate) GetCrcString() string { return "a190415f" }
-func (*AfPacketCreate) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *AfPacketCreate) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.HwAddr
- size += 6
- // field[1] m.UseRandomHwAddr
- size += 1
- // field[1] m.HostIfName
- size += 64
- return size
-}
-func (m *AfPacketCreate) 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.HwAddr
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.HwAddr) {
- x = uint8(m.HwAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.UseRandomHwAddr
- if m.UseRandomHwAddr {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.HostIfName
- copy(buf[pos:pos+64], m.HostIfName)
- pos += 64
- return buf, nil
-}
-func (m *AfPacketCreate) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.HwAddr
- for i := 0; i < len(m.HwAddr); i++ {
- m.HwAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.UseRandomHwAddr
- m.UseRandomHwAddr = tmp[pos] != 0
- pos += 1
- // field[1] m.HostIfName
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.HostIfName = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- return nil
-}
-
-// AfPacketCreateReply represents VPP binary API message 'af_packet_create_reply'.
-type AfPacketCreateReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *AfPacketCreateReply) Reset() { *m = AfPacketCreateReply{} }
-func (*AfPacketCreateReply) GetMessageName() string { return "af_packet_create_reply" }
-func (*AfPacketCreateReply) GetCrcString() string { return "5383d31f" }
-func (*AfPacketCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *AfPacketCreateReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *AfPacketCreateReply) 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.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *AfPacketCreateReply) 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.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// AfPacketDelete represents VPP binary API message 'af_packet_delete'.
-type AfPacketDelete struct {
- HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty" struc:"[64]byte"`
-}
-
-func (m *AfPacketDelete) Reset() { *m = AfPacketDelete{} }
-func (*AfPacketDelete) GetMessageName() string { return "af_packet_delete" }
-func (*AfPacketDelete) GetCrcString() string { return "863fa648" }
-func (*AfPacketDelete) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *AfPacketDelete) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.HostIfName
- size += 64
- return size
-}
-func (m *AfPacketDelete) 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.HostIfName
- copy(buf[pos:pos+64], m.HostIfName)
- pos += 64
- return buf, nil
-}
-func (m *AfPacketDelete) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.HostIfName
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.HostIfName = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- return nil
-}
-
-// AfPacketDeleteReply represents VPP binary API message 'af_packet_delete_reply'.
-type AfPacketDeleteReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *AfPacketDeleteReply) Reset() { *m = AfPacketDeleteReply{} }
-func (*AfPacketDeleteReply) GetMessageName() string { return "af_packet_delete_reply" }
-func (*AfPacketDeleteReply) GetCrcString() string { return "e8d4e804" }
-func (*AfPacketDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *AfPacketDeleteReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *AfPacketDeleteReply) 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 *AfPacketDeleteReply) 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
- return nil
-}
-
-// AfPacketDetails represents VPP binary API message 'af_packet_details'.
-type AfPacketDetails struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- HostIfName string `binapi:"string[64],name=host_if_name" json:"host_if_name,omitempty" struc:"[64]byte"`
-}
-
-func (m *AfPacketDetails) Reset() { *m = AfPacketDetails{} }
-func (*AfPacketDetails) GetMessageName() string { return "af_packet_details" }
-func (*AfPacketDetails) GetCrcString() string { return "58c7c042" }
-func (*AfPacketDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *AfPacketDetails) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.HostIfName
- size += 64
- return size
-}
-func (m *AfPacketDetails) 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.HostIfName
- copy(buf[pos:pos+64], m.HostIfName)
- pos += 64
- return buf, nil
-}
-func (m *AfPacketDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.HostIfName
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.HostIfName = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- return nil
-}
-
-// AfPacketDump represents VPP binary API message 'af_packet_dump'.
-type AfPacketDump struct{}
-
-func (m *AfPacketDump) Reset() { *m = AfPacketDump{} }
-func (*AfPacketDump) GetMessageName() string { return "af_packet_dump" }
-func (*AfPacketDump) GetCrcString() string { return "51077d14" }
-func (*AfPacketDump) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *AfPacketDump) Size() int {
- if m == nil {
- return 0
- }
- var size int
- return size
-}
-func (m *AfPacketDump) 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
- }
- return buf, nil
-}
-func (m *AfPacketDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- return nil
-}
-
-// AfPacketSetL4CksumOffload represents VPP binary API message 'af_packet_set_l4_cksum_offload'.
-type AfPacketSetL4CksumOffload struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- Set bool `binapi:"bool,name=set" json:"set,omitempty"`
-}
-
-func (m *AfPacketSetL4CksumOffload) Reset() { *m = AfPacketSetL4CksumOffload{} }
-func (*AfPacketSetL4CksumOffload) GetMessageName() string { return "af_packet_set_l4_cksum_offload" }
-func (*AfPacketSetL4CksumOffload) GetCrcString() string { return "319cd5c8" }
-func (*AfPacketSetL4CksumOffload) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *AfPacketSetL4CksumOffload) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Set
- size += 1
- return size
-}
-func (m *AfPacketSetL4CksumOffload) 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.Set
- if m.Set {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *AfPacketSetL4CksumOffload) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Set
- m.Set = tmp[pos] != 0
- pos += 1
- return nil
-}
-
-// AfPacketSetL4CksumOffloadReply represents VPP binary API message 'af_packet_set_l4_cksum_offload_reply'.
-type AfPacketSetL4CksumOffloadReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *AfPacketSetL4CksumOffloadReply) Reset() { *m = AfPacketSetL4CksumOffloadReply{} }
-func (*AfPacketSetL4CksumOffloadReply) GetMessageName() string {
- return "af_packet_set_l4_cksum_offload_reply"
-}
-func (*AfPacketSetL4CksumOffloadReply) GetCrcString() string { return "e8d4e804" }
-func (*AfPacketSetL4CksumOffloadReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *AfPacketSetL4CksumOffloadReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *AfPacketSetL4CksumOffloadReply) 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 *AfPacketSetL4CksumOffloadReply) 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
- return nil
-}
-
-func init() { file_af_packet_binapi_init() }
-func file_af_packet_binapi_init() {
- api.RegisterMessage((*AfPacketCreate)(nil), "af_packet.AfPacketCreate")
- api.RegisterMessage((*AfPacketCreateReply)(nil), "af_packet.AfPacketCreateReply")
- api.RegisterMessage((*AfPacketDelete)(nil), "af_packet.AfPacketDelete")
- api.RegisterMessage((*AfPacketDeleteReply)(nil), "af_packet.AfPacketDeleteReply")
- api.RegisterMessage((*AfPacketDetails)(nil), "af_packet.AfPacketDetails")
- api.RegisterMessage((*AfPacketDump)(nil), "af_packet.AfPacketDump")
- api.RegisterMessage((*AfPacketSetL4CksumOffload)(nil), "af_packet.AfPacketSetL4CksumOffload")
- api.RegisterMessage((*AfPacketSetL4CksumOffloadReply)(nil), "af_packet.AfPacketSetL4CksumOffloadReply")
-}
-
-// Messages returns list of all messages in this module.
-func AllMessages() []api.Message {
- return []api.Message{
- (*AfPacketCreate)(nil),
- (*AfPacketCreateReply)(nil),
- (*AfPacketDelete)(nil),
- (*AfPacketDeleteReply)(nil),
- (*AfPacketDetails)(nil),
- (*AfPacketDump)(nil),
- (*AfPacketSetL4CksumOffload)(nil),
- (*AfPacketSetL4CksumOffloadReply)(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 _ = strings.Contains
-var _ = struc.Pack
-var _ = binary.BigEndian
-var _ = math.Float32bits
-var _ = net.ParseIP
-var _ = fmt.Errorf
diff --git a/examples/binapi/af_packet/af_packet_rpc.ba.go b/examples/binapi/af_packet/af_packet_rpc.ba.go
deleted file mode 100644
index d2df47a..0000000
--- a/examples/binapi/af_packet/af_packet_rpc.ba.go
+++ /dev/null
@@ -1,84 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-
-package af_packet
-
-import (
- "context"
- "io"
-
- api "git.fd.io/govpp.git/api"
-)
-
-// RPCService represents RPC service API for af_packet module.
-type RPCService interface {
- DumpAfPacket(ctx context.Context, in *AfPacketDump) (RPCService_DumpAfPacketClient, error)
- AfPacketCreate(ctx context.Context, in *AfPacketCreate) (*AfPacketCreateReply, error)
- AfPacketDelete(ctx context.Context, in *AfPacketDelete) (*AfPacketDeleteReply, error)
- AfPacketSetL4CksumOffload(ctx context.Context, in *AfPacketSetL4CksumOffload) (*AfPacketSetL4CksumOffloadReply, error)
-}
-
-type serviceClient struct {
- ch api.Channel
-}
-
-func NewServiceClient(ch api.Channel) RPCService {
- return &serviceClient{ch}
-}
-
-func (c *serviceClient) DumpAfPacket(ctx context.Context, in *AfPacketDump) (RPCService_DumpAfPacketClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpAfPacketClient{stream}
- return x, nil
-}
-
-type RPCService_DumpAfPacketClient interface {
- Recv() (*AfPacketDetails, error)
-}
-
-type serviceClient_DumpAfPacketClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpAfPacketClient) Recv() (*AfPacketDetails, error) {
- m := new(AfPacketDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) AfPacketCreate(ctx context.Context, in *AfPacketCreate) (*AfPacketCreateReply, error) {
- out := new(AfPacketCreateReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) AfPacketDelete(ctx context.Context, in *AfPacketDelete) (*AfPacketDeleteReply, error) {
- out := new(AfPacketDeleteReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) AfPacketSetL4CksumOffload(ctx context.Context, in *AfPacketSetL4CksumOffload) (*AfPacketSetL4CksumOffloadReply, error) {
- out := new(AfPacketSetL4CksumOffloadReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = context.Background
-var _ = io.Copy
diff --git a/examples/binapi/fib_types/fib_types.ba.go b/examples/binapi/fib_types/fib_types.ba.go
deleted file mode 100644
index 9050e85..0000000
--- a/examples/binapi/fib_types/fib_types.ba.go
+++ /dev/null
@@ -1,255 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-// versions:
-// binapi-generator: v0.4.0-dev
-// VPP: 20.05-release
-// source: /usr/share/vpp/api/core/fib_types.api.json
-
-/*
-Package fib_types contains generated code for VPP API file fib_types.api (2.0.0).
-
-It consists of:
- 5 aliases
- 7 enums
- 9 types
- 1 union
-*/
-package fib_types
-
-import (
- "bytes"
- "context"
- "encoding/binary"
- "fmt"
- "io"
- "math"
- "net"
- "strconv"
- "strings"
-
- api "git.fd.io/govpp.git/api"
- codec "git.fd.io/govpp.git/codec"
- struc "github.com/lunixbochs/struc"
-
- ip_types "git.fd.io/govpp.git/examples/binapi/ip_types"
-)
-
-// 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 (
- // ModuleName is the name of this module.
- ModuleName = "fib_types"
- // APIVersion is the API version of this module.
- APIVersion = "2.0.0"
- // VersionCrc is the CRC of this module.
- VersionCrc = 0xd6a5938
-)
-
-type AddressFamily = ip_types.AddressFamily
-
-// FibPathFlags represents VPP binary API enum 'fib_path_flags'.
-type FibPathFlags uint32
-
-const (
- FIB_API_PATH_FLAG_NONE FibPathFlags = 0
- FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED FibPathFlags = 1
- FIB_API_PATH_FLAG_RESOLVE_VIA_HOST FibPathFlags = 2
- FIB_API_PATH_FLAG_POP_PW_CW FibPathFlags = 4
-)
-
-var (
- FibPathFlags_name = map[uint32]string{
- 0: "FIB_API_PATH_FLAG_NONE",
- 1: "FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED",
- 2: "FIB_API_PATH_FLAG_RESOLVE_VIA_HOST",
- 4: "FIB_API_PATH_FLAG_POP_PW_CW",
- }
- FibPathFlags_value = map[string]uint32{
- "FIB_API_PATH_FLAG_NONE": 0,
- "FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED": 1,
- "FIB_API_PATH_FLAG_RESOLVE_VIA_HOST": 2,
- "FIB_API_PATH_FLAG_POP_PW_CW": 4,
- }
-)
-
-func (x FibPathFlags) String() string {
- s, ok := FibPathFlags_name[uint32(x)]
- if ok {
- return s
- }
- return "FibPathFlags(" + strconv.Itoa(int(x)) + ")"
-}
-
-// FibPathNhProto represents VPP binary API enum 'fib_path_nh_proto'.
-type FibPathNhProto uint32
-
-const (
- FIB_API_PATH_NH_PROTO_IP4 FibPathNhProto = 0
- FIB_API_PATH_NH_PROTO_IP6 FibPathNhProto = 1
- FIB_API_PATH_NH_PROTO_MPLS FibPathNhProto = 2
- FIB_API_PATH_NH_PROTO_ETHERNET FibPathNhProto = 3
- FIB_API_PATH_NH_PROTO_BIER FibPathNhProto = 4
-)
-
-var (
- FibPathNhProto_name = map[uint32]string{
- 0: "FIB_API_PATH_NH_PROTO_IP4",
- 1: "FIB_API_PATH_NH_PROTO_IP6",
- 2: "FIB_API_PATH_NH_PROTO_MPLS",
- 3: "FIB_API_PATH_NH_PROTO_ETHERNET",
- 4: "FIB_API_PATH_NH_PROTO_BIER",
- }
- FibPathNhProto_value = map[string]uint32{
- "FIB_API_PATH_NH_PROTO_IP4": 0,
- "FIB_API_PATH_NH_PROTO_IP6": 1,
- "FIB_API_PATH_NH_PROTO_MPLS": 2,
- "FIB_API_PATH_NH_PROTO_ETHERNET": 3,
- "FIB_API_PATH_NH_PROTO_BIER": 4,
- }
-)
-
-func (x FibPathNhProto) String() string {
- s, ok := FibPathNhProto_name[uint32(x)]
- if ok {
- return s
- }
- return "FibPathNhProto(" + strconv.Itoa(int(x)) + ")"
-}
-
-// FibPathType represents VPP binary API enum 'fib_path_type'.
-type FibPathType uint32
-
-const (
- FIB_API_PATH_TYPE_NORMAL FibPathType = 0
- FIB_API_PATH_TYPE_LOCAL FibPathType = 1
- FIB_API_PATH_TYPE_DROP FibPathType = 2
- FIB_API_PATH_TYPE_UDP_ENCAP FibPathType = 3
- FIB_API_PATH_TYPE_BIER_IMP FibPathType = 4
- FIB_API_PATH_TYPE_ICMP_UNREACH FibPathType = 5
- FIB_API_PATH_TYPE_ICMP_PROHIBIT FibPathType = 6
- FIB_API_PATH_TYPE_SOURCE_LOOKUP FibPathType = 7
- FIB_API_PATH_TYPE_DVR FibPathType = 8
- FIB_API_PATH_TYPE_INTERFACE_RX FibPathType = 9
- FIB_API_PATH_TYPE_CLASSIFY FibPathType = 10
-)
-
-var (
- FibPathType_name = map[uint32]string{
- 0: "FIB_API_PATH_TYPE_NORMAL",
- 1: "FIB_API_PATH_TYPE_LOCAL",
- 2: "FIB_API_PATH_TYPE_DROP",
- 3: "FIB_API_PATH_TYPE_UDP_ENCAP",
- 4: "FIB_API_PATH_TYPE_BIER_IMP",
- 5: "FIB_API_PATH_TYPE_ICMP_UNREACH",
- 6: "FIB_API_PATH_TYPE_ICMP_PROHIBIT",
- 7: "FIB_API_PATH_TYPE_SOURCE_LOOKUP",
- 8: "FIB_API_PATH_TYPE_DVR",
- 9: "FIB_API_PATH_TYPE_INTERFACE_RX",
- 10: "FIB_API_PATH_TYPE_CLASSIFY",
- }
- FibPathType_value = map[string]uint32{
- "FIB_API_PATH_TYPE_NORMAL": 0,
- "FIB_API_PATH_TYPE_LOCAL": 1,
- "FIB_API_PATH_TYPE_DROP": 2,
- "FIB_API_PATH_TYPE_UDP_ENCAP": 3,
- "FIB_API_PATH_TYPE_BIER_IMP": 4,
- "FIB_API_PATH_TYPE_ICMP_UNREACH": 5,
- "FIB_API_PATH_TYPE_ICMP_PROHIBIT": 6,
- "FIB_API_PATH_TYPE_SOURCE_LOOKUP": 7,
- "FIB_API_PATH_TYPE_DVR": 8,
- "FIB_API_PATH_TYPE_INTERFACE_RX": 9,
- "FIB_API_PATH_TYPE_CLASSIFY": 10,
- }
-)
-
-func (x FibPathType) String() string {
- s, ok := FibPathType_name[uint32(x)]
- if ok {
- return s
- }
- return "FibPathType(" + strconv.Itoa(int(x)) + ")"
-}
-
-type IPDscp = ip_types.IPDscp
-
-type IPEcn = ip_types.IPEcn
-
-type IPProto = ip_types.IPProto
-
-type AddressWithPrefix = ip_types.AddressWithPrefix
-
-type IP4Address = ip_types.IP4Address
-
-type IP4AddressWithPrefix = ip_types.IP4AddressWithPrefix
-
-type IP6Address = ip_types.IP6Address
-
-type IP6AddressWithPrefix = ip_types.IP6AddressWithPrefix
-
-type Address = ip_types.Address
-
-// FibMplsLabel represents VPP binary API 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"`
- TTL uint8 `binapi:"u8,name=ttl" json:"ttl,omitempty"`
- 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'.
-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"`
- RpfID uint32 `binapi:"u32,name=rpf_id" json:"rpf_id,omitempty"`
- Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
- Preference uint8 `binapi:"u8,name=preference" json:"preference,omitempty"`
- Type FibPathType `binapi:"fib_path_type,name=type" json:"type,omitempty"`
- Flags FibPathFlags `binapi:"fib_path_flags,name=flags" json:"flags,omitempty"`
- 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"`
-}
-
-func (*FibPath) GetTypeName() string { return "fib_path" }
-
-// FibPathNh represents VPP binary API type 'fib_path_nh'.
-type FibPathNh struct {
- Address ip_types.AddressUnion `binapi:"address_union,name=address" json:"address,omitempty"`
- ViaLabel uint32 `binapi:"u32,name=via_label" json:"via_label,omitempty"`
- ObjID uint32 `binapi:"u32,name=obj_id" json:"obj_id,omitempty"`
- ClassifyTableIndex uint32 `binapi:"u32,name=classify_table_index" json:"classify_table_index,omitempty"`
-}
-
-func (*FibPathNh) GetTypeName() string { return "fib_path_nh" }
-
-type IP4Prefix = ip_types.IP4Prefix
-
-type IP6Prefix = ip_types.IP6Prefix
-
-type Mprefix = ip_types.Mprefix
-
-type Prefix = ip_types.Prefix
-
-type PrefixMatcher = ip_types.PrefixMatcher
-
-type AddressUnion = ip_types.AddressUnion
-
-// 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 _ = strings.Contains
-var _ = struc.Pack
-var _ = binary.BigEndian
-var _ = math.Float32bits
-var _ = net.ParseIP
-var _ = fmt.Errorf
diff --git a/examples/binapi/gen.go b/examples/binapi/gen.go
deleted file mode 100644
index fe08d7f..0000000
--- a/examples/binapi/gen.go
+++ /dev/null
@@ -1,5 +0,0 @@
-package binapi
-
-// Generate Go code from the VPP APIs located in the /usr/share/vpp/api directory.
-
-//go:generate binapi-generator --import-types=false mactime af_packet interface interface_types ip vpe sr acl memif ip_types fib_types
diff --git a/examples/binapi/interface_types/interface_types.ba.go b/examples/binapi/interface_types/interface_types.ba.go
deleted file mode 100644
index 1c0a72c..0000000
--- a/examples/binapi/interface_types/interface_types.ba.go
+++ /dev/null
@@ -1,272 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-// versions:
-// binapi-generator: v0.4.0-dev
-// VPP: 20.05-release
-// source: /usr/share/vpp/api/core/interface_types.api.json
-
-/*
-Package interface_types contains generated code for VPP API file interface_types.api ().
-
-It consists of:
- 1 alias
- 6 enums
-*/
-package interface_types
-
-import (
- "bytes"
- "context"
- "encoding/binary"
- "fmt"
- "io"
- "math"
- "net"
- "strconv"
- "strings"
-
- api "git.fd.io/govpp.git/api"
- codec "git.fd.io/govpp.git/codec"
- struc "github.com/lunixbochs/struc"
-)
-
-// 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 (
- // ModuleName is the name of this module.
- ModuleName = "interface_types"
- // APIVersion is the API version of this module.
- APIVersion = ""
- // VersionCrc is the CRC of this module.
- VersionCrc = 0x23822dac
-)
-
-// IfStatusFlags represents VPP binary API enum 'if_status_flags'.
-type IfStatusFlags uint32
-
-const (
- IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
- IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
-)
-
-var (
- IfStatusFlags_name = map[uint32]string{
- 1: "IF_STATUS_API_FLAG_ADMIN_UP",
- 2: "IF_STATUS_API_FLAG_LINK_UP",
- }
- IfStatusFlags_value = map[string]uint32{
- "IF_STATUS_API_FLAG_ADMIN_UP": 1,
- "IF_STATUS_API_FLAG_LINK_UP": 2,
- }
-)
-
-func (x IfStatusFlags) String() string {
- s, ok := IfStatusFlags_name[uint32(x)]
- if ok {
- return s
- }
- return "IfStatusFlags(" + strconv.Itoa(int(x)) + ")"
-}
-
-// IfType represents VPP binary API enum 'if_type'.
-type IfType uint32
-
-const (
- IF_API_TYPE_HARDWARE IfType = 0
- IF_API_TYPE_SUB IfType = 1
- IF_API_TYPE_P2P IfType = 2
- IF_API_TYPE_PIPE IfType = 3
-)
-
-var (
- IfType_name = map[uint32]string{
- 0: "IF_API_TYPE_HARDWARE",
- 1: "IF_API_TYPE_SUB",
- 2: "IF_API_TYPE_P2P",
- 3: "IF_API_TYPE_PIPE",
- }
- IfType_value = map[string]uint32{
- "IF_API_TYPE_HARDWARE": 0,
- "IF_API_TYPE_SUB": 1,
- "IF_API_TYPE_P2P": 2,
- "IF_API_TYPE_PIPE": 3,
- }
-)
-
-func (x IfType) String() string {
- s, ok := IfType_name[uint32(x)]
- if ok {
- return s
- }
- return "IfType(" + strconv.Itoa(int(x)) + ")"
-}
-
-// LinkDuplex represents VPP binary API enum 'link_duplex'.
-type LinkDuplex uint32
-
-const (
- LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
- LINK_DUPLEX_API_HALF LinkDuplex = 1
- LINK_DUPLEX_API_FULL LinkDuplex = 2
-)
-
-var (
- LinkDuplex_name = map[uint32]string{
- 0: "LINK_DUPLEX_API_UNKNOWN",
- 1: "LINK_DUPLEX_API_HALF",
- 2: "LINK_DUPLEX_API_FULL",
- }
- LinkDuplex_value = map[string]uint32{
- "LINK_DUPLEX_API_UNKNOWN": 0,
- "LINK_DUPLEX_API_HALF": 1,
- "LINK_DUPLEX_API_FULL": 2,
- }
-)
-
-func (x LinkDuplex) String() string {
- s, ok := LinkDuplex_name[uint32(x)]
- if ok {
- return s
- }
- return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
-}
-
-// MtuProto represents VPP binary API enum 'mtu_proto'.
-type MtuProto uint32
-
-const (
- MTU_PROTO_API_L3 MtuProto = 0
- MTU_PROTO_API_IP4 MtuProto = 1
- MTU_PROTO_API_IP6 MtuProto = 2
- MTU_PROTO_API_MPLS MtuProto = 3
-)
-
-var (
- MtuProto_name = map[uint32]string{
- 0: "MTU_PROTO_API_L3",
- 1: "MTU_PROTO_API_IP4",
- 2: "MTU_PROTO_API_IP6",
- 3: "MTU_PROTO_API_MPLS",
- }
- MtuProto_value = map[string]uint32{
- "MTU_PROTO_API_L3": 0,
- "MTU_PROTO_API_IP4": 1,
- "MTU_PROTO_API_IP6": 2,
- "MTU_PROTO_API_MPLS": 3,
- }
-)
-
-func (x MtuProto) String() string {
- s, ok := MtuProto_name[uint32(x)]
- if ok {
- return s
- }
- return "MtuProto(" + strconv.Itoa(int(x)) + ")"
-}
-
-// RxMode represents VPP binary API enum 'rx_mode'.
-type RxMode uint32
-
-const (
- RX_MODE_API_UNKNOWN RxMode = 0
- RX_MODE_API_POLLING RxMode = 1
- RX_MODE_API_INTERRUPT RxMode = 2
- RX_MODE_API_ADAPTIVE RxMode = 3
- RX_MODE_API_DEFAULT RxMode = 4
-)
-
-var (
- RxMode_name = map[uint32]string{
- 0: "RX_MODE_API_UNKNOWN",
- 1: "RX_MODE_API_POLLING",
- 2: "RX_MODE_API_INTERRUPT",
- 3: "RX_MODE_API_ADAPTIVE",
- 4: "RX_MODE_API_DEFAULT",
- }
- RxMode_value = map[string]uint32{
- "RX_MODE_API_UNKNOWN": 0,
- "RX_MODE_API_POLLING": 1,
- "RX_MODE_API_INTERRUPT": 2,
- "RX_MODE_API_ADAPTIVE": 3,
- "RX_MODE_API_DEFAULT": 4,
- }
-)
-
-func (x RxMode) String() string {
- s, ok := RxMode_name[uint32(x)]
- if ok {
- return s
- }
- return "RxMode(" + strconv.Itoa(int(x)) + ")"
-}
-
-// SubIfFlags represents VPP binary API enum 'sub_if_flags'.
-type SubIfFlags uint32
-
-const (
- SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
- SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
- SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
- SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
- SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
- SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
- SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
- SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
- SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
- SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
-)
-
-var (
- SubIfFlags_name = map[uint32]string{
- 1: "SUB_IF_API_FLAG_NO_TAGS",
- 2: "SUB_IF_API_FLAG_ONE_TAG",
- 4: "SUB_IF_API_FLAG_TWO_TAGS",
- 8: "SUB_IF_API_FLAG_DOT1AD",
- 16: "SUB_IF_API_FLAG_EXACT_MATCH",
- 32: "SUB_IF_API_FLAG_DEFAULT",
- 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
- 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
- 254: "SUB_IF_API_FLAG_MASK_VNET",
- 256: "SUB_IF_API_FLAG_DOT1AH",
- }
- SubIfFlags_value = map[string]uint32{
- "SUB_IF_API_FLAG_NO_TAGS": 1,
- "SUB_IF_API_FLAG_ONE_TAG": 2,
- "SUB_IF_API_FLAG_TWO_TAGS": 4,
- "SUB_IF_API_FLAG_DOT1AD": 8,
- "SUB_IF_API_FLAG_EXACT_MATCH": 16,
- "SUB_IF_API_FLAG_DEFAULT": 32,
- "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
- "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
- "SUB_IF_API_FLAG_MASK_VNET": 254,
- "SUB_IF_API_FLAG_DOT1AH": 256,
- }
-)
-
-func (x SubIfFlags) String() string {
- s, ok := SubIfFlags_name[uint32(x)]
- if ok {
- return s
- }
- return "SubIfFlags(" + strconv.Itoa(int(x)) + ")"
-}
-
-// InterfaceIndex represents VPP binary API alias 'interface_index'.
-type InterfaceIndex uint32
-
-// 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 _ = strings.Contains
-var _ = struc.Pack
-var _ = binary.BigEndian
-var _ = math.Float32bits
-var _ = net.ParseIP
-var _ = fmt.Errorf
diff --git a/examples/binapi/interfaces/interfaces.ba.go b/examples/binapi/interfaces/interfaces.ba.go
deleted file mode 100644
index 8b9176c..0000000
--- a/examples/binapi/interfaces/interfaces.ba.go
+++ /dev/null
@@ -1,3640 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-// versions:
-// binapi-generator: v0.4.0-dev
-// VPP: 20.05-release
-// source: /usr/share/vpp/api/core/interface.api.json
-
-/*
-Package interfaces contains generated code for VPP API file interface.api (3.2.2).
-
-It consists of:
- 7 aliases
- 10 enums
- 57 messages
- 6 types
- 1 union
-*/
-package interfaces
-
-import (
- "bytes"
- "context"
- "encoding/binary"
- "fmt"
- "io"
- "math"
- "net"
- "strconv"
- "strings"
-
- api "git.fd.io/govpp.git/api"
- codec "git.fd.io/govpp.git/codec"
- struc "github.com/lunixbochs/struc"
-
- interface_types "git.fd.io/govpp.git/examples/binapi/interface_types"
- ip_types "git.fd.io/govpp.git/examples/binapi/ip_types"
-)
-
-// 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 (
- // ModuleName is the name of this module.
- ModuleName = "interface"
- // APIVersion is the API version of this module.
- APIVersion = "3.2.2"
- // VersionCrc is the CRC of this module.
- VersionCrc = 0x58d4cf5a
-)
-
-// MacAddress represents VPP binary API alias 'mac_address'.
-type MacAddress [6]uint8
-
-func ParseMAC(mac string) (parsed MacAddress, err error) {
- var hw net.HardwareAddr
- if hw, err = net.ParseMAC(mac); err != nil {
- return
- }
- copy(parsed[:], hw[:])
- return
-}
-
-func (m *MacAddress) ToString() string {
- return net.HardwareAddr(m[:]).String()
-}
-
-// CollectDetailedInterfaceStats represents VPP binary API message 'collect_detailed_interface_stats'.
-type CollectDetailedInterfaceStats struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
-}
-
-func (m *CollectDetailedInterfaceStats) Reset() { *m = CollectDetailedInterfaceStats{} }
-func (*CollectDetailedInterfaceStats) GetMessageName() string {
- return "collect_detailed_interface_stats"
-}
-func (*CollectDetailedInterfaceStats) GetCrcString() string { return "5501adee" }
-func (*CollectDetailedInterfaceStats) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *CollectDetailedInterfaceStats) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.EnableDisable
- size += 1
- return size
-}
-func (m *CollectDetailedInterfaceStats) 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.EnableDisable
- if m.EnableDisable {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *CollectDetailedInterfaceStats) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.EnableDisable
- m.EnableDisable = tmp[pos] != 0
- pos += 1
- return nil
-}
-
-// CollectDetailedInterfaceStatsReply represents VPP binary API message 'collect_detailed_interface_stats_reply'.
-type CollectDetailedInterfaceStatsReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *CollectDetailedInterfaceStatsReply) Reset() { *m = CollectDetailedInterfaceStatsReply{} }
-func (*CollectDetailedInterfaceStatsReply) GetMessageName() string {
- return "collect_detailed_interface_stats_reply"
-}
-func (*CollectDetailedInterfaceStatsReply) GetCrcString() string { return "e8d4e804" }
-func (*CollectDetailedInterfaceStatsReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *CollectDetailedInterfaceStatsReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *CollectDetailedInterfaceStatsReply) 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 *CollectDetailedInterfaceStatsReply) 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
- return nil
-}
-
-// CreateLoopback represents VPP binary API message 'create_loopback'.
-type CreateLoopback struct {
- MacAddress MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
-}
-
-func (m *CreateLoopback) Reset() { *m = CreateLoopback{} }
-func (*CreateLoopback) GetMessageName() string { return "create_loopback" }
-func (*CreateLoopback) GetCrcString() string { return "42bb5d22" }
-func (*CreateLoopback) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *CreateLoopback) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.MacAddress
- size += 6
- return size
-}
-func (m *CreateLoopback) 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.MacAddress
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.MacAddress) {
- x = uint8(m.MacAddress[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- return buf, nil
-}
-func (m *CreateLoopback) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.MacAddress
- for i := 0; i < len(m.MacAddress); i++ {
- m.MacAddress[i] = uint8(tmp[pos])
- pos += 1
- }
- return nil
-}
-
-// CreateLoopbackInstance represents VPP binary API message 'create_loopback_instance'.
-type CreateLoopbackInstance struct {
- MacAddress MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
- IsSpecified bool `binapi:"bool,name=is_specified" json:"is_specified,omitempty"`
- UserInstance uint32 `binapi:"u32,name=user_instance" json:"user_instance,omitempty"`
-}
-
-func (m *CreateLoopbackInstance) Reset() { *m = CreateLoopbackInstance{} }
-func (*CreateLoopbackInstance) GetMessageName() string { return "create_loopback_instance" }
-func (*CreateLoopbackInstance) GetCrcString() string { return "d36a3ee2" }
-func (*CreateLoopbackInstance) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *CreateLoopbackInstance) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.MacAddress
- size += 6
- // field[1] m.IsSpecified
- size += 1
- // field[1] m.UserInstance
- size += 4
- return size
-}
-func (m *CreateLoopbackInstance) 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.MacAddress
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.MacAddress) {
- x = uint8(m.MacAddress[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.IsSpecified
- if m.IsSpecified {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.UserInstance
- o.PutUint32(buf[pos:pos+4], uint32(m.UserInstance))
- pos += 4
- return buf, nil
-}
-func (m *CreateLoopbackInstance) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.MacAddress
- for i := 0; i < len(m.MacAddress); i++ {
- m.MacAddress[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.IsSpecified
- m.IsSpecified = tmp[pos] != 0
- pos += 1
- // field[1] m.UserInstance
- m.UserInstance = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// CreateLoopbackInstanceReply represents VPP binary API message 'create_loopback_instance_reply'.
-type CreateLoopbackInstanceReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *CreateLoopbackInstanceReply) Reset() { *m = CreateLoopbackInstanceReply{} }
-func (*CreateLoopbackInstanceReply) GetMessageName() string { return "create_loopback_instance_reply" }
-func (*CreateLoopbackInstanceReply) GetCrcString() string { return "5383d31f" }
-func (*CreateLoopbackInstanceReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *CreateLoopbackInstanceReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *CreateLoopbackInstanceReply) 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.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *CreateLoopbackInstanceReply) 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.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// CreateLoopbackReply represents VPP binary API message 'create_loopback_reply'.
-type CreateLoopbackReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *CreateLoopbackReply) Reset() { *m = CreateLoopbackReply{} }
-func (*CreateLoopbackReply) GetMessageName() string { return "create_loopback_reply" }
-func (*CreateLoopbackReply) GetCrcString() string { return "5383d31f" }
-func (*CreateLoopbackReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *CreateLoopbackReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *CreateLoopbackReply) 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.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *CreateLoopbackReply) 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.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// CreateSubif represents VPP binary API message 'create_subif'.
-type CreateSubif struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- SubID uint32 `binapi:"u32,name=sub_id" json:"sub_id,omitempty"`
- SubIfFlags interface_types.SubIfFlags `binapi:"sub_if_flags,name=sub_if_flags" json:"sub_if_flags,omitempty"`
- OuterVlanID uint16 `binapi:"u16,name=outer_vlan_id" json:"outer_vlan_id,omitempty"`
- InnerVlanID uint16 `binapi:"u16,name=inner_vlan_id" json:"inner_vlan_id,omitempty"`
-}
-
-func (m *CreateSubif) Reset() { *m = CreateSubif{} }
-func (*CreateSubif) GetMessageName() string { return "create_subif" }
-func (*CreateSubif) GetCrcString() string { return "cb371063" }
-func (*CreateSubif) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *CreateSubif) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.SubID
- size += 4
- // field[1] m.SubIfFlags
- size += 4
- // field[1] m.OuterVlanID
- size += 2
- // field[1] m.InnerVlanID
- size += 2
- return size
-}
-func (m *CreateSubif) 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.SubID
- o.PutUint32(buf[pos:pos+4], uint32(m.SubID))
- pos += 4
- // field[1] m.SubIfFlags
- o.PutUint32(buf[pos:pos+4], uint32(m.SubIfFlags))
- pos += 4
- // field[1] m.OuterVlanID
- o.PutUint16(buf[pos:pos+2], uint16(m.OuterVlanID))
- pos += 2
- // field[1] m.InnerVlanID
- o.PutUint16(buf[pos:pos+2], uint16(m.InnerVlanID))
- pos += 2
- return buf, nil
-}
-func (m *CreateSubif) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SubID
- m.SubID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SubIfFlags
- m.SubIfFlags = interface_types.SubIfFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.OuterVlanID
- m.OuterVlanID = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[1] m.InnerVlanID
- m.InnerVlanID = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- return nil
-}
-
-// CreateSubifReply represents VPP binary API message 'create_subif_reply'.
-type CreateSubifReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *CreateSubifReply) Reset() { *m = CreateSubifReply{} }
-func (*CreateSubifReply) GetMessageName() string { return "create_subif_reply" }
-func (*CreateSubifReply) GetCrcString() string { return "5383d31f" }
-func (*CreateSubifReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *CreateSubifReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *CreateSubifReply) 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.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *CreateSubifReply) 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.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// CreateVlanSubif represents VPP binary API message 'create_vlan_subif'.
-type CreateVlanSubif struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- VlanID uint32 `binapi:"u32,name=vlan_id" json:"vlan_id,omitempty"`
-}
-
-func (m *CreateVlanSubif) Reset() { *m = CreateVlanSubif{} }
-func (*CreateVlanSubif) GetMessageName() string { return "create_vlan_subif" }
-func (*CreateVlanSubif) GetCrcString() string { return "af34ac8b" }
-func (*CreateVlanSubif) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *CreateVlanSubif) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.VlanID
- size += 4
- return size
-}
-func (m *CreateVlanSubif) 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.VlanID
- o.PutUint32(buf[pos:pos+4], uint32(m.VlanID))
- pos += 4
- return buf, nil
-}
-func (m *CreateVlanSubif) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.VlanID
- m.VlanID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// CreateVlanSubifReply represents VPP binary API message 'create_vlan_subif_reply'.
-type CreateVlanSubifReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *CreateVlanSubifReply) Reset() { *m = CreateVlanSubifReply{} }
-func (*CreateVlanSubifReply) GetMessageName() string { return "create_vlan_subif_reply" }
-func (*CreateVlanSubifReply) GetCrcString() string { return "5383d31f" }
-func (*CreateVlanSubifReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *CreateVlanSubifReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *CreateVlanSubifReply) 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.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *CreateVlanSubifReply) 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.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// DeleteLoopback represents VPP binary API message 'delete_loopback'.
-type DeleteLoopback struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *DeleteLoopback) Reset() { *m = DeleteLoopback{} }
-func (*DeleteLoopback) GetMessageName() string { return "delete_loopback" }
-func (*DeleteLoopback) GetCrcString() string { return "f9e6675e" }
-func (*DeleteLoopback) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *DeleteLoopback) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *DeleteLoopback) 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 *DeleteLoopback) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// DeleteLoopbackReply represents VPP binary API message 'delete_loopback_reply'.
-type DeleteLoopbackReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *DeleteLoopbackReply) Reset() { *m = DeleteLoopbackReply{} }
-func (*DeleteLoopbackReply) GetMessageName() string { return "delete_loopback_reply" }
-func (*DeleteLoopbackReply) GetCrcString() string { return "e8d4e804" }
-func (*DeleteLoopbackReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *DeleteLoopbackReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *DeleteLoopbackReply) 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 *DeleteLoopbackReply) 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
- return nil
-}
-
-// DeleteSubif represents VPP binary API message 'delete_subif'.
-type DeleteSubif struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *DeleteSubif) Reset() { *m = DeleteSubif{} }
-func (*DeleteSubif) GetMessageName() string { return "delete_subif" }
-func (*DeleteSubif) GetCrcString() string { return "f9e6675e" }
-func (*DeleteSubif) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *DeleteSubif) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *DeleteSubif) 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 *DeleteSubif) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// DeleteSubifReply represents VPP binary API message 'delete_subif_reply'.
-type DeleteSubifReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *DeleteSubifReply) Reset() { *m = DeleteSubifReply{} }
-func (*DeleteSubifReply) GetMessageName() string { return "delete_subif_reply" }
-func (*DeleteSubifReply) GetCrcString() string { return "e8d4e804" }
-func (*DeleteSubifReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *DeleteSubifReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *DeleteSubifReply) 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 *DeleteSubifReply) 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
- return nil
-}
-
-// HwInterfaceSetMtu represents VPP binary API message 'hw_interface_set_mtu'.
-type HwInterfaceSetMtu struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- Mtu uint16 `binapi:"u16,name=mtu" json:"mtu,omitempty"`
-}
-
-func (m *HwInterfaceSetMtu) Reset() { *m = HwInterfaceSetMtu{} }
-func (*HwInterfaceSetMtu) GetMessageName() string { return "hw_interface_set_mtu" }
-func (*HwInterfaceSetMtu) GetCrcString() string { return "e6746899" }
-func (*HwInterfaceSetMtu) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *HwInterfaceSetMtu) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Mtu
- size += 2
- return size
-}
-func (m *HwInterfaceSetMtu) 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.Mtu
- o.PutUint16(buf[pos:pos+2], uint16(m.Mtu))
- pos += 2
- return buf, nil
-}
-func (m *HwInterfaceSetMtu) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Mtu
- m.Mtu = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- return nil
-}
-
-// HwInterfaceSetMtuReply represents VPP binary API message 'hw_interface_set_mtu_reply'.
-type HwInterfaceSetMtuReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *HwInterfaceSetMtuReply) Reset() { *m = HwInterfaceSetMtuReply{} }
-func (*HwInterfaceSetMtuReply) GetMessageName() string { return "hw_interface_set_mtu_reply" }
-func (*HwInterfaceSetMtuReply) GetCrcString() string { return "e8d4e804" }
-func (*HwInterfaceSetMtuReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *HwInterfaceSetMtuReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *HwInterfaceSetMtuReply) 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 *HwInterfaceSetMtuReply) 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
- return nil
-}
-
-// InterfaceNameRenumber represents VPP binary API message 'interface_name_renumber'.
-type InterfaceNameRenumber struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- NewShowDevInstance uint32 `binapi:"u32,name=new_show_dev_instance" json:"new_show_dev_instance,omitempty"`
-}
-
-func (m *InterfaceNameRenumber) Reset() { *m = InterfaceNameRenumber{} }
-func (*InterfaceNameRenumber) GetMessageName() string { return "interface_name_renumber" }
-func (*InterfaceNameRenumber) GetCrcString() string { return "2b8858b8" }
-func (*InterfaceNameRenumber) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *InterfaceNameRenumber) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.NewShowDevInstance
- size += 4
- return size
-}
-func (m *InterfaceNameRenumber) 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.NewShowDevInstance
- o.PutUint32(buf[pos:pos+4], uint32(m.NewShowDevInstance))
- pos += 4
- return buf, nil
-}
-func (m *InterfaceNameRenumber) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.NewShowDevInstance
- m.NewShowDevInstance = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// InterfaceNameRenumberReply represents VPP binary API message 'interface_name_renumber_reply'.
-type InterfaceNameRenumberReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *InterfaceNameRenumberReply) Reset() { *m = InterfaceNameRenumberReply{} }
-func (*InterfaceNameRenumberReply) GetMessageName() string { return "interface_name_renumber_reply" }
-func (*InterfaceNameRenumberReply) GetCrcString() string { return "e8d4e804" }
-func (*InterfaceNameRenumberReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *InterfaceNameRenumberReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *InterfaceNameRenumberReply) 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 *InterfaceNameRenumberReply) 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
- return nil
-}
-
-// SwInterfaceAddDelAddress represents VPP binary API message 'sw_interface_add_del_address'.
-type SwInterfaceAddDelAddress struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
- DelAll bool `binapi:"bool,name=del_all" json:"del_all,omitempty"`
- Prefix ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=prefix" json:"prefix,omitempty"`
-}
-
-func (m *SwInterfaceAddDelAddress) Reset() { *m = SwInterfaceAddDelAddress{} }
-func (*SwInterfaceAddDelAddress) GetMessageName() string { return "sw_interface_add_del_address" }
-func (*SwInterfaceAddDelAddress) GetCrcString() string { return "5803d5c4" }
-func (*SwInterfaceAddDelAddress) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceAddDelAddress) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.IsAdd
- size += 1
- // field[1] m.DelAll
- size += 1
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- size += 1
- // field[3] m.Prefix.Address.Un
- size += 16
- // field[2] m.Prefix.Len
- size += 1
- return size
-}
-func (m *SwInterfaceAddDelAddress) 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.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.DelAll
- if m.DelAll {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- buf[pos] = uint8(m.Prefix.Address.Af)
- pos += 1
- // 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 *SwInterfaceAddDelAddress) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
- // field[1] m.DelAll
- m.DelAll = tmp[pos] != 0
- pos += 1
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- m.Prefix.Address.Af = ip_types.AddressFamily(tmp[pos])
- pos += 1
- // 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
- return nil
-}
-
-// SwInterfaceAddDelAddressReply represents VPP binary API message 'sw_interface_add_del_address_reply'.
-type SwInterfaceAddDelAddressReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceAddDelAddressReply) Reset() { *m = SwInterfaceAddDelAddressReply{} }
-func (*SwInterfaceAddDelAddressReply) GetMessageName() string {
- return "sw_interface_add_del_address_reply"
-}
-func (*SwInterfaceAddDelAddressReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceAddDelAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceAddDelAddressReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceAddDelAddressReply) 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 *SwInterfaceAddDelAddressReply) 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
- return nil
-}
-
-// SwInterfaceAddDelMacAddress represents VPP binary API message 'sw_interface_add_del_mac_address'.
-type SwInterfaceAddDelMacAddress struct {
- SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
- Addr MacAddress `binapi:"mac_address,name=addr" json:"addr,omitempty"`
- IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
-}
-
-func (m *SwInterfaceAddDelMacAddress) Reset() { *m = SwInterfaceAddDelMacAddress{} }
-func (*SwInterfaceAddDelMacAddress) GetMessageName() string {
- return "sw_interface_add_del_mac_address"
-}
-func (*SwInterfaceAddDelMacAddress) GetCrcString() string { return "638bb9f4" }
-func (*SwInterfaceAddDelMacAddress) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceAddDelMacAddress) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Addr
- size += 6
- // field[1] m.IsAdd
- size += 1
- return size
-}
-func (m *SwInterfaceAddDelMacAddress) 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.Addr
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.Addr) {
- x = uint8(m.Addr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.IsAdd
- buf[pos] = uint8(m.IsAdd)
- pos += 1
- return buf, nil
-}
-func (m *SwInterfaceAddDelMacAddress) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Addr
- for i := 0; i < len(m.Addr); i++ {
- m.Addr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.IsAdd
- m.IsAdd = uint8(tmp[pos])
- pos += 1
- return nil
-}
-
-// SwInterfaceAddDelMacAddressReply represents VPP binary API message 'sw_interface_add_del_mac_address_reply'.
-type SwInterfaceAddDelMacAddressReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceAddDelMacAddressReply) Reset() { *m = SwInterfaceAddDelMacAddressReply{} }
-func (*SwInterfaceAddDelMacAddressReply) GetMessageName() string {
- return "sw_interface_add_del_mac_address_reply"
-}
-func (*SwInterfaceAddDelMacAddressReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceAddDelMacAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceAddDelMacAddressReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceAddDelMacAddressReply) 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 *SwInterfaceAddDelMacAddressReply) 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
- return nil
-}
-
-// SwInterfaceAddressReplaceBegin represents VPP binary API message 'sw_interface_address_replace_begin'.
-type SwInterfaceAddressReplaceBegin struct{}
-
-func (m *SwInterfaceAddressReplaceBegin) Reset() { *m = SwInterfaceAddressReplaceBegin{} }
-func (*SwInterfaceAddressReplaceBegin) GetMessageName() string {
- return "sw_interface_address_replace_begin"
-}
-func (*SwInterfaceAddressReplaceBegin) GetCrcString() string { return "51077d14" }
-func (*SwInterfaceAddressReplaceBegin) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceAddressReplaceBegin) Size() int {
- if m == nil {
- return 0
- }
- var size int
- return size
-}
-func (m *SwInterfaceAddressReplaceBegin) 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
- }
- return buf, nil
-}
-func (m *SwInterfaceAddressReplaceBegin) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- return nil
-}
-
-// SwInterfaceAddressReplaceBeginReply represents VPP binary API message 'sw_interface_address_replace_begin_reply'.
-type SwInterfaceAddressReplaceBeginReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceAddressReplaceBeginReply) Reset() { *m = SwInterfaceAddressReplaceBeginReply{} }
-func (*SwInterfaceAddressReplaceBeginReply) GetMessageName() string {
- return "sw_interface_address_replace_begin_reply"
-}
-func (*SwInterfaceAddressReplaceBeginReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceAddressReplaceBeginReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceAddressReplaceBeginReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceAddressReplaceBeginReply) 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 *SwInterfaceAddressReplaceBeginReply) 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
- return nil
-}
-
-// SwInterfaceAddressReplaceEnd represents VPP binary API message 'sw_interface_address_replace_end'.
-type SwInterfaceAddressReplaceEnd struct{}
-
-func (m *SwInterfaceAddressReplaceEnd) Reset() { *m = SwInterfaceAddressReplaceEnd{} }
-func (*SwInterfaceAddressReplaceEnd) GetMessageName() string {
- return "sw_interface_address_replace_end"
-}
-func (*SwInterfaceAddressReplaceEnd) GetCrcString() string { return "51077d14" }
-func (*SwInterfaceAddressReplaceEnd) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceAddressReplaceEnd) Size() int {
- if m == nil {
- return 0
- }
- var size int
- return size
-}
-func (m *SwInterfaceAddressReplaceEnd) 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
- }
- return buf, nil
-}
-func (m *SwInterfaceAddressReplaceEnd) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- return nil
-}
-
-// SwInterfaceAddressReplaceEndReply represents VPP binary API message 'sw_interface_address_replace_end_reply'.
-type SwInterfaceAddressReplaceEndReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceAddressReplaceEndReply) Reset() { *m = SwInterfaceAddressReplaceEndReply{} }
-func (*SwInterfaceAddressReplaceEndReply) GetMessageName() string {
- return "sw_interface_address_replace_end_reply"
-}
-func (*SwInterfaceAddressReplaceEndReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceAddressReplaceEndReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceAddressReplaceEndReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceAddressReplaceEndReply) 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 *SwInterfaceAddressReplaceEndReply) 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
- return nil
-}
-
-// SwInterfaceClearStats represents VPP binary API message 'sw_interface_clear_stats'.
-type SwInterfaceClearStats struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *SwInterfaceClearStats) Reset() { *m = SwInterfaceClearStats{} }
-func (*SwInterfaceClearStats) GetMessageName() string { return "sw_interface_clear_stats" }
-func (*SwInterfaceClearStats) GetCrcString() string { return "f9e6675e" }
-func (*SwInterfaceClearStats) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceClearStats) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *SwInterfaceClearStats) 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 *SwInterfaceClearStats) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceClearStatsReply represents VPP binary API message 'sw_interface_clear_stats_reply'.
-type SwInterfaceClearStatsReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceClearStatsReply) Reset() { *m = SwInterfaceClearStatsReply{} }
-func (*SwInterfaceClearStatsReply) GetMessageName() string { return "sw_interface_clear_stats_reply" }
-func (*SwInterfaceClearStatsReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceClearStatsReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceClearStatsReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceClearStatsReply) 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 *SwInterfaceClearStatsReply) 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
- return nil
-}
-
-// SwInterfaceDetails represents VPP binary API message 'sw_interface_details'.
-type SwInterfaceDetails struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- SupSwIfIndex uint32 `binapi:"u32,name=sup_sw_if_index" json:"sup_sw_if_index,omitempty"`
- L2Address MacAddress `binapi:"mac_address,name=l2_address" json:"l2_address,omitempty"`
- Flags interface_types.IfStatusFlags `binapi:"if_status_flags,name=flags" json:"flags,omitempty"`
- Type interface_types.IfType `binapi:"if_type,name=type" json:"type,omitempty"`
- LinkDuplex interface_types.LinkDuplex `binapi:"link_duplex,name=link_duplex" json:"link_duplex,omitempty"`
- LinkSpeed uint32 `binapi:"u32,name=link_speed" json:"link_speed,omitempty"`
- LinkMtu uint16 `binapi:"u16,name=link_mtu" json:"link_mtu,omitempty"`
- Mtu []uint32 `binapi:"u32[4],name=mtu" json:"mtu,omitempty" struc:"[4]uint32"`
- SubID uint32 `binapi:"u32,name=sub_id" json:"sub_id,omitempty"`
- SubNumberOfTags uint8 `binapi:"u8,name=sub_number_of_tags" json:"sub_number_of_tags,omitempty"`
- SubOuterVlanID uint16 `binapi:"u16,name=sub_outer_vlan_id" json:"sub_outer_vlan_id,omitempty"`
- SubInnerVlanID uint16 `binapi:"u16,name=sub_inner_vlan_id" json:"sub_inner_vlan_id,omitempty"`
- SubIfFlags interface_types.SubIfFlags `binapi:"sub_if_flags,name=sub_if_flags" json:"sub_if_flags,omitempty"`
- VtrOp uint32 `binapi:"u32,name=vtr_op" json:"vtr_op,omitempty"`
- VtrPushDot1q uint32 `binapi:"u32,name=vtr_push_dot1q" json:"vtr_push_dot1q,omitempty"`
- VtrTag1 uint32 `binapi:"u32,name=vtr_tag1" json:"vtr_tag1,omitempty"`
- VtrTag2 uint32 `binapi:"u32,name=vtr_tag2" json:"vtr_tag2,omitempty"`
- OuterTag uint16 `binapi:"u16,name=outer_tag" json:"outer_tag,omitempty"`
- BDmac MacAddress `binapi:"mac_address,name=b_dmac" json:"b_dmac,omitempty"`
- BSmac MacAddress `binapi:"mac_address,name=b_smac" json:"b_smac,omitempty"`
- BVlanid uint16 `binapi:"u16,name=b_vlanid" json:"b_vlanid,omitempty"`
- ISid uint32 `binapi:"u32,name=i_sid" json:"i_sid,omitempty"`
- InterfaceName string `binapi:"string[64],name=interface_name" json:"interface_name,omitempty" struc:"[64]byte"`
- InterfaceDevType string `binapi:"string[64],name=interface_dev_type" json:"interface_dev_type,omitempty" struc:"[64]byte"`
- Tag string `binapi:"string[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
-}
-
-func (m *SwInterfaceDetails) Reset() { *m = SwInterfaceDetails{} }
-func (*SwInterfaceDetails) GetMessageName() string { return "sw_interface_details" }
-func (*SwInterfaceDetails) GetCrcString() string { return "17b69fa2" }
-func (*SwInterfaceDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceDetails) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.SupSwIfIndex
- size += 4
- // field[1] m.L2Address
- size += 6
- // field[1] m.Flags
- size += 4
- // field[1] m.Type
- size += 4
- // field[1] m.LinkDuplex
- size += 4
- // field[1] m.LinkSpeed
- size += 4
- // field[1] m.LinkMtu
- size += 2
- // field[1] m.Mtu
- size += 16
- // field[1] m.SubID
- size += 4
- // field[1] m.SubNumberOfTags
- size += 1
- // field[1] m.SubOuterVlanID
- size += 2
- // field[1] m.SubInnerVlanID
- size += 2
- // field[1] m.SubIfFlags
- size += 4
- // field[1] m.VtrOp
- size += 4
- // field[1] m.VtrPushDot1q
- size += 4
- // field[1] m.VtrTag1
- size += 4
- // field[1] m.VtrTag2
- size += 4
- // field[1] m.OuterTag
- size += 2
- // field[1] m.BDmac
- size += 6
- // field[1] m.BSmac
- size += 6
- // field[1] m.BVlanid
- size += 2
- // field[1] m.ISid
- size += 4
- // field[1] m.InterfaceName
- size += 64
- // field[1] m.InterfaceDevType
- size += 64
- // field[1] m.Tag
- size += 64
- return size
-}
-func (m *SwInterfaceDetails) 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.SupSwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SupSwIfIndex))
- pos += 4
- // field[1] m.L2Address
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.L2Address) {
- x = uint8(m.L2Address[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.Flags
- o.PutUint32(buf[pos:pos+4], uint32(m.Flags))
- pos += 4
- // field[1] m.Type
- o.PutUint32(buf[pos:pos+4], uint32(m.Type))
- pos += 4
- // field[1] m.LinkDuplex
- o.PutUint32(buf[pos:pos+4], uint32(m.LinkDuplex))
- pos += 4
- // field[1] m.LinkSpeed
- o.PutUint32(buf[pos:pos+4], uint32(m.LinkSpeed))
- pos += 4
- // field[1] m.LinkMtu
- o.PutUint16(buf[pos:pos+2], uint16(m.LinkMtu))
- pos += 2
- // field[1] m.Mtu
- for i := 0; i < 4; i++ {
- var x uint32
- if i < len(m.Mtu) {
- x = uint32(m.Mtu[i])
- }
- o.PutUint32(buf[pos:pos+4], uint32(x))
- pos += 4
- }
- // field[1] m.SubID
- o.PutUint32(buf[pos:pos+4], uint32(m.SubID))
- pos += 4
- // field[1] m.SubNumberOfTags
- buf[pos] = uint8(m.SubNumberOfTags)
- pos += 1
- // field[1] m.SubOuterVlanID
- o.PutUint16(buf[pos:pos+2], uint16(m.SubOuterVlanID))
- pos += 2
- // field[1] m.SubInnerVlanID
- o.PutUint16(buf[pos:pos+2], uint16(m.SubInnerVlanID))
- pos += 2
- // field[1] m.SubIfFlags
- o.PutUint32(buf[pos:pos+4], uint32(m.SubIfFlags))
- pos += 4
- // field[1] m.VtrOp
- o.PutUint32(buf[pos:pos+4], uint32(m.VtrOp))
- pos += 4
- // field[1] m.VtrPushDot1q
- o.PutUint32(buf[pos:pos+4], uint32(m.VtrPushDot1q))
- pos += 4
- // field[1] m.VtrTag1
- o.PutUint32(buf[pos:pos+4], uint32(m.VtrTag1))
- pos += 4
- // field[1] m.VtrTag2
- o.PutUint32(buf[pos:pos+4], uint32(m.VtrTag2))
- pos += 4
- // field[1] m.OuterTag
- o.PutUint16(buf[pos:pos+2], uint16(m.OuterTag))
- pos += 2
- // field[1] m.BDmac
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.BDmac) {
- x = uint8(m.BDmac[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.BSmac
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.BSmac) {
- x = uint8(m.BSmac[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.BVlanid
- o.PutUint16(buf[pos:pos+2], uint16(m.BVlanid))
- pos += 2
- // field[1] m.ISid
- o.PutUint32(buf[pos:pos+4], uint32(m.ISid))
- pos += 4
- // field[1] m.InterfaceName
- copy(buf[pos:pos+64], m.InterfaceName)
- pos += 64
- // field[1] m.InterfaceDevType
- copy(buf[pos:pos+64], m.InterfaceDevType)
- pos += 64
- // field[1] m.Tag
- copy(buf[pos:pos+64], m.Tag)
- pos += 64
- return buf, nil
-}
-func (m *SwInterfaceDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SupSwIfIndex
- m.SupSwIfIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.L2Address
- for i := 0; i < len(m.L2Address); i++ {
- m.L2Address[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.Flags
- m.Flags = interface_types.IfStatusFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Type
- m.Type = interface_types.IfType(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.LinkDuplex
- m.LinkDuplex = interface_types.LinkDuplex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.LinkSpeed
- m.LinkSpeed = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.LinkMtu
- m.LinkMtu = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[1] m.Mtu
- m.Mtu = make([]uint32, 4)
- for i := 0; i < len(m.Mtu); i++ {
- m.Mtu[i] = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- }
- // field[1] m.SubID
- m.SubID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SubNumberOfTags
- m.SubNumberOfTags = uint8(tmp[pos])
- pos += 1
- // field[1] m.SubOuterVlanID
- m.SubOuterVlanID = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[1] m.SubInnerVlanID
- m.SubInnerVlanID = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[1] m.SubIfFlags
- m.SubIfFlags = interface_types.SubIfFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.VtrOp
- m.VtrOp = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.VtrPushDot1q
- m.VtrPushDot1q = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.VtrTag1
- m.VtrTag1 = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.VtrTag2
- m.VtrTag2 = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.OuterTag
- m.OuterTag = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[1] m.BDmac
- for i := 0; i < len(m.BDmac); i++ {
- m.BDmac[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.BSmac
- for i := 0; i < len(m.BSmac); i++ {
- m.BSmac[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.BVlanid
- m.BVlanid = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[1] m.ISid
- m.ISid = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.InterfaceName
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.InterfaceName = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- // field[1] m.InterfaceDevType
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.InterfaceDevType = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- // field[1] m.Tag
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Tag = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- return nil
-}
-
-// SwInterfaceDump represents VPP binary API message 'sw_interface_dump'.
-type SwInterfaceDump struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4.294967295e+09" json:"sw_if_index,omitempty"`
- NameFilterValid bool `binapi:"bool,name=name_filter_valid" json:"name_filter_valid,omitempty"`
- XXX_NameFilterLen uint32 `struc:"sizeof=NameFilter"`
- NameFilter string `json:"name_filter,omitempty"`
-}
-
-func (m *SwInterfaceDump) Reset() { *m = SwInterfaceDump{} }
-func (*SwInterfaceDump) GetMessageName() string { return "sw_interface_dump" }
-func (*SwInterfaceDump) GetCrcString() string { return "aa610c27" }
-func (*SwInterfaceDump) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceDump) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.NameFilterValid
- size += 1
- // field[1] m.NameFilter
- size += 4 + len(m.NameFilter)
- return size
-}
-func (m *SwInterfaceDump) 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.NameFilterValid
- if m.NameFilterValid {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.NameFilter
- o.PutUint32(buf[pos:pos+4], uint32(len(m.NameFilter)))
- pos += 4
- copy(buf[pos:pos+len(m.NameFilter)], m.NameFilter[:])
- pos += len(m.NameFilter)
- return buf, nil
-}
-func (m *SwInterfaceDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.NameFilterValid
- m.NameFilterValid = tmp[pos] != 0
- pos += 1
- // field[1] m.NameFilter
- {
- siz := o.Uint32(tmp[pos : pos+4])
- pos += 4
- m.NameFilter = codec.DecodeString(tmp[pos : pos+int(siz)])
- pos += len(m.NameFilter)
- }
- return nil
-}
-
-// SwInterfaceEvent represents VPP binary API message 'sw_interface_event'.
-type SwInterfaceEvent struct {
- PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- Flags interface_types.IfStatusFlags `binapi:"if_status_flags,name=flags" json:"flags,omitempty"`
- Deleted bool `binapi:"bool,name=deleted" json:"deleted,omitempty"`
-}
-
-func (m *SwInterfaceEvent) Reset() { *m = SwInterfaceEvent{} }
-func (*SwInterfaceEvent) GetMessageName() string { return "sw_interface_event" }
-func (*SwInterfaceEvent) GetCrcString() string { return "f709f78d" }
-func (*SwInterfaceEvent) GetMessageType() api.MessageType { return api.EventMessage }
-
-func (m *SwInterfaceEvent) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.PID
- size += 4
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Flags
- size += 4
- // field[1] m.Deleted
- size += 1
- return size
-}
-func (m *SwInterfaceEvent) 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.PID
- o.PutUint32(buf[pos:pos+4], uint32(m.PID))
- pos += 4
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.Flags
- o.PutUint32(buf[pos:pos+4], uint32(m.Flags))
- pos += 4
- // field[1] m.Deleted
- if m.Deleted {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *SwInterfaceEvent) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.PID
- m.PID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Flags
- m.Flags = interface_types.IfStatusFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Deleted
- m.Deleted = tmp[pos] != 0
- pos += 1
- return nil
-}
-
-// SwInterfaceGetMacAddress represents VPP binary API message 'sw_interface_get_mac_address'.
-type SwInterfaceGetMacAddress struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *SwInterfaceGetMacAddress) Reset() { *m = SwInterfaceGetMacAddress{} }
-func (*SwInterfaceGetMacAddress) GetMessageName() string { return "sw_interface_get_mac_address" }
-func (*SwInterfaceGetMacAddress) GetCrcString() string { return "f9e6675e" }
-func (*SwInterfaceGetMacAddress) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceGetMacAddress) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *SwInterfaceGetMacAddress) 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 *SwInterfaceGetMacAddress) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceGetMacAddressReply represents VPP binary API message 'sw_interface_get_mac_address_reply'.
-type SwInterfaceGetMacAddressReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- MacAddress MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
-}
-
-func (m *SwInterfaceGetMacAddressReply) Reset() { *m = SwInterfaceGetMacAddressReply{} }
-func (*SwInterfaceGetMacAddressReply) GetMessageName() string {
- return "sw_interface_get_mac_address_reply"
-}
-func (*SwInterfaceGetMacAddressReply) GetCrcString() string { return "40ef2c08" }
-func (*SwInterfaceGetMacAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceGetMacAddressReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.MacAddress
- size += 6
- return size
-}
-func (m *SwInterfaceGetMacAddressReply) 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.MacAddress
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.MacAddress) {
- x = uint8(m.MacAddress[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- return buf, nil
-}
-func (m *SwInterfaceGetMacAddressReply) 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.MacAddress
- for i := 0; i < len(m.MacAddress); i++ {
- m.MacAddress[i] = uint8(tmp[pos])
- pos += 1
- }
- return nil
-}
-
-// SwInterfaceGetTable represents VPP binary API message 'sw_interface_get_table'.
-type SwInterfaceGetTable struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
-}
-
-func (m *SwInterfaceGetTable) Reset() { *m = SwInterfaceGetTable{} }
-func (*SwInterfaceGetTable) GetMessageName() string { return "sw_interface_get_table" }
-func (*SwInterfaceGetTable) GetCrcString() string { return "2d033de4" }
-func (*SwInterfaceGetTable) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceGetTable) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.IsIPv6
- size += 1
- return size
-}
-func (m *SwInterfaceGetTable) 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 *SwInterfaceGetTable) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsIPv6
- m.IsIPv6 = tmp[pos] != 0
- pos += 1
- return nil
-}
-
-// SwInterfaceGetTableReply represents VPP binary API message 'sw_interface_get_table_reply'.
-type SwInterfaceGetTableReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
-}
-
-func (m *SwInterfaceGetTableReply) Reset() { *m = SwInterfaceGetTableReply{} }
-func (*SwInterfaceGetTableReply) GetMessageName() string { return "sw_interface_get_table_reply" }
-func (*SwInterfaceGetTableReply) GetCrcString() string { return "a6eb0109" }
-func (*SwInterfaceGetTableReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceGetTableReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.VrfID
- size += 4
- return size
-}
-func (m *SwInterfaceGetTableReply) 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.VrfID
- o.PutUint32(buf[pos:pos+4], uint32(m.VrfID))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceGetTableReply) 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.VrfID
- m.VrfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceRxPlacementDetails represents VPP binary API message 'sw_interface_rx_placement_details'.
-type SwInterfaceRxPlacementDetails struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- QueueID uint32 `binapi:"u32,name=queue_id" json:"queue_id,omitempty"`
- WorkerID uint32 `binapi:"u32,name=worker_id" json:"worker_id,omitempty"`
- Mode interface_types.RxMode `binapi:"rx_mode,name=mode" json:"mode,omitempty"`
-}
-
-func (m *SwInterfaceRxPlacementDetails) Reset() { *m = SwInterfaceRxPlacementDetails{} }
-func (*SwInterfaceRxPlacementDetails) GetMessageName() string {
- return "sw_interface_rx_placement_details"
-}
-func (*SwInterfaceRxPlacementDetails) GetCrcString() string { return "f6d7d024" }
-func (*SwInterfaceRxPlacementDetails) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceRxPlacementDetails) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.QueueID
- size += 4
- // field[1] m.WorkerID
- size += 4
- // field[1] m.Mode
- size += 4
- return size
-}
-func (m *SwInterfaceRxPlacementDetails) 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.QueueID
- o.PutUint32(buf[pos:pos+4], uint32(m.QueueID))
- pos += 4
- // field[1] m.WorkerID
- o.PutUint32(buf[pos:pos+4], uint32(m.WorkerID))
- pos += 4
- // field[1] m.Mode
- o.PutUint32(buf[pos:pos+4], uint32(m.Mode))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceRxPlacementDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.QueueID
- m.QueueID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.WorkerID
- m.WorkerID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Mode
- m.Mode = interface_types.RxMode(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceRxPlacementDump represents VPP binary API message 'sw_interface_rx_placement_dump'.
-type SwInterfaceRxPlacementDump struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *SwInterfaceRxPlacementDump) Reset() { *m = SwInterfaceRxPlacementDump{} }
-func (*SwInterfaceRxPlacementDump) GetMessageName() string { return "sw_interface_rx_placement_dump" }
-func (*SwInterfaceRxPlacementDump) GetCrcString() string { return "f9e6675e" }
-func (*SwInterfaceRxPlacementDump) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceRxPlacementDump) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *SwInterfaceRxPlacementDump) 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 *SwInterfaceRxPlacementDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceSetFlags represents VPP binary API message 'sw_interface_set_flags'.
-type SwInterfaceSetFlags struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- Flags interface_types.IfStatusFlags `binapi:"if_status_flags,name=flags" json:"flags,omitempty"`
-}
-
-func (m *SwInterfaceSetFlags) Reset() { *m = SwInterfaceSetFlags{} }
-func (*SwInterfaceSetFlags) GetMessageName() string { return "sw_interface_set_flags" }
-func (*SwInterfaceSetFlags) GetCrcString() string { return "6a2b491a" }
-func (*SwInterfaceSetFlags) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceSetFlags) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Flags
- size += 4
- return size
-}
-func (m *SwInterfaceSetFlags) 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.Flags
- o.PutUint32(buf[pos:pos+4], uint32(m.Flags))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceSetFlags) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Flags
- m.Flags = interface_types.IfStatusFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceSetFlagsReply represents VPP binary API message 'sw_interface_set_flags_reply'.
-type SwInterfaceSetFlagsReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceSetFlagsReply) Reset() { *m = SwInterfaceSetFlagsReply{} }
-func (*SwInterfaceSetFlagsReply) GetMessageName() string { return "sw_interface_set_flags_reply" }
-func (*SwInterfaceSetFlagsReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceSetFlagsReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceSetFlagsReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceSetFlagsReply) 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 *SwInterfaceSetFlagsReply) 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
- return nil
-}
-
-// SwInterfaceSetIPDirectedBroadcast represents VPP binary API message 'sw_interface_set_ip_directed_broadcast'.
-type SwInterfaceSetIPDirectedBroadcast struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
-}
-
-func (m *SwInterfaceSetIPDirectedBroadcast) Reset() { *m = SwInterfaceSetIPDirectedBroadcast{} }
-func (*SwInterfaceSetIPDirectedBroadcast) GetMessageName() string {
- return "sw_interface_set_ip_directed_broadcast"
-}
-func (*SwInterfaceSetIPDirectedBroadcast) GetCrcString() string { return "ae6cfcfb" }
-func (*SwInterfaceSetIPDirectedBroadcast) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceSetIPDirectedBroadcast) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Enable
- size += 1
- return size
-}
-func (m *SwInterfaceSetIPDirectedBroadcast) 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 *SwInterfaceSetIPDirectedBroadcast) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Enable
- m.Enable = tmp[pos] != 0
- pos += 1
- return nil
-}
-
-// SwInterfaceSetIPDirectedBroadcastReply represents VPP binary API message 'sw_interface_set_ip_directed_broadcast_reply'.
-type SwInterfaceSetIPDirectedBroadcastReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceSetIPDirectedBroadcastReply) Reset() {
- *m = SwInterfaceSetIPDirectedBroadcastReply{}
-}
-func (*SwInterfaceSetIPDirectedBroadcastReply) GetMessageName() string {
- return "sw_interface_set_ip_directed_broadcast_reply"
-}
-func (*SwInterfaceSetIPDirectedBroadcastReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceSetIPDirectedBroadcastReply) GetMessageType() api.MessageType {
- return api.ReplyMessage
-}
-
-func (m *SwInterfaceSetIPDirectedBroadcastReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceSetIPDirectedBroadcastReply) 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 *SwInterfaceSetIPDirectedBroadcastReply) 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
- return nil
-}
-
-// SwInterfaceSetMacAddress represents VPP binary API message 'sw_interface_set_mac_address'.
-type SwInterfaceSetMacAddress struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- MacAddress MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
-}
-
-func (m *SwInterfaceSetMacAddress) Reset() { *m = SwInterfaceSetMacAddress{} }
-func (*SwInterfaceSetMacAddress) GetMessageName() string { return "sw_interface_set_mac_address" }
-func (*SwInterfaceSetMacAddress) GetCrcString() string { return "6aca746a" }
-func (*SwInterfaceSetMacAddress) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceSetMacAddress) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.MacAddress
- size += 6
- return size
-}
-func (m *SwInterfaceSetMacAddress) 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.MacAddress
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.MacAddress) {
- x = uint8(m.MacAddress[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- return buf, nil
-}
-func (m *SwInterfaceSetMacAddress) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.MacAddress
- for i := 0; i < len(m.MacAddress); i++ {
- m.MacAddress[i] = uint8(tmp[pos])
- pos += 1
- }
- return nil
-}
-
-// SwInterfaceSetMacAddressReply represents VPP binary API message 'sw_interface_set_mac_address_reply'.
-type SwInterfaceSetMacAddressReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceSetMacAddressReply) Reset() { *m = SwInterfaceSetMacAddressReply{} }
-func (*SwInterfaceSetMacAddressReply) GetMessageName() string {
- return "sw_interface_set_mac_address_reply"
-}
-func (*SwInterfaceSetMacAddressReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceSetMacAddressReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceSetMacAddressReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceSetMacAddressReply) 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 *SwInterfaceSetMacAddressReply) 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
- return nil
-}
-
-// SwInterfaceSetMtu represents VPP binary API message 'sw_interface_set_mtu'.
-type SwInterfaceSetMtu struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- Mtu []uint32 `binapi:"u32[4],name=mtu" json:"mtu,omitempty" struc:"[4]uint32"`
-}
-
-func (m *SwInterfaceSetMtu) Reset() { *m = SwInterfaceSetMtu{} }
-func (*SwInterfaceSetMtu) GetMessageName() string { return "sw_interface_set_mtu" }
-func (*SwInterfaceSetMtu) GetCrcString() string { return "5cbe85e5" }
-func (*SwInterfaceSetMtu) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceSetMtu) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Mtu
- size += 16
- return size
-}
-func (m *SwInterfaceSetMtu) 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.Mtu
- for i := 0; i < 4; i++ {
- var x uint32
- if i < len(m.Mtu) {
- x = uint32(m.Mtu[i])
- }
- o.PutUint32(buf[pos:pos+4], uint32(x))
- pos += 4
- }
- return buf, nil
-}
-func (m *SwInterfaceSetMtu) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Mtu
- m.Mtu = make([]uint32, 4)
- for i := 0; i < len(m.Mtu); i++ {
- m.Mtu[i] = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- }
- return nil
-}
-
-// SwInterfaceSetMtuReply represents VPP binary API message 'sw_interface_set_mtu_reply'.
-type SwInterfaceSetMtuReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceSetMtuReply) Reset() { *m = SwInterfaceSetMtuReply{} }
-func (*SwInterfaceSetMtuReply) GetMessageName() string { return "sw_interface_set_mtu_reply" }
-func (*SwInterfaceSetMtuReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceSetMtuReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceSetMtuReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceSetMtuReply) 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 *SwInterfaceSetMtuReply) 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
- return nil
-}
-
-// SwInterfaceSetRxMode represents VPP binary API message 'sw_interface_set_rx_mode'.
-type SwInterfaceSetRxMode struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- QueueIDValid bool `binapi:"bool,name=queue_id_valid" json:"queue_id_valid,omitempty"`
- QueueID uint32 `binapi:"u32,name=queue_id" json:"queue_id,omitempty"`
- Mode interface_types.RxMode `binapi:"rx_mode,name=mode" json:"mode,omitempty"`
-}
-
-func (m *SwInterfaceSetRxMode) Reset() { *m = SwInterfaceSetRxMode{} }
-func (*SwInterfaceSetRxMode) GetMessageName() string { return "sw_interface_set_rx_mode" }
-func (*SwInterfaceSetRxMode) GetCrcString() string { return "780f5cee" }
-func (*SwInterfaceSetRxMode) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceSetRxMode) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.QueueIDValid
- size += 1
- // field[1] m.QueueID
- size += 4
- // field[1] m.Mode
- size += 4
- return size
-}
-func (m *SwInterfaceSetRxMode) 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.QueueIDValid
- if m.QueueIDValid {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.QueueID
- o.PutUint32(buf[pos:pos+4], uint32(m.QueueID))
- pos += 4
- // field[1] m.Mode
- o.PutUint32(buf[pos:pos+4], uint32(m.Mode))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceSetRxMode) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.QueueIDValid
- m.QueueIDValid = tmp[pos] != 0
- pos += 1
- // field[1] m.QueueID
- m.QueueID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Mode
- m.Mode = interface_types.RxMode(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceSetRxModeReply represents VPP binary API message 'sw_interface_set_rx_mode_reply'.
-type SwInterfaceSetRxModeReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceSetRxModeReply) Reset() { *m = SwInterfaceSetRxModeReply{} }
-func (*SwInterfaceSetRxModeReply) GetMessageName() string { return "sw_interface_set_rx_mode_reply" }
-func (*SwInterfaceSetRxModeReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceSetRxModeReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceSetRxModeReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceSetRxModeReply) 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 *SwInterfaceSetRxModeReply) 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
- return nil
-}
-
-// SwInterfaceSetRxPlacement represents VPP binary API message 'sw_interface_set_rx_placement'.
-type SwInterfaceSetRxPlacement struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- QueueID uint32 `binapi:"u32,name=queue_id" json:"queue_id,omitempty"`
- WorkerID uint32 `binapi:"u32,name=worker_id" json:"worker_id,omitempty"`
- IsMain bool `binapi:"bool,name=is_main" json:"is_main,omitempty"`
-}
-
-func (m *SwInterfaceSetRxPlacement) Reset() { *m = SwInterfaceSetRxPlacement{} }
-func (*SwInterfaceSetRxPlacement) GetMessageName() string { return "sw_interface_set_rx_placement" }
-func (*SwInterfaceSetRxPlacement) GetCrcString() string { return "db65f3c9" }
-func (*SwInterfaceSetRxPlacement) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceSetRxPlacement) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.QueueID
- size += 4
- // field[1] m.WorkerID
- size += 4
- // field[1] m.IsMain
- size += 1
- return size
-}
-func (m *SwInterfaceSetRxPlacement) 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.QueueID
- o.PutUint32(buf[pos:pos+4], uint32(m.QueueID))
- pos += 4
- // field[1] m.WorkerID
- o.PutUint32(buf[pos:pos+4], uint32(m.WorkerID))
- pos += 4
- // field[1] m.IsMain
- if m.IsMain {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *SwInterfaceSetRxPlacement) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.QueueID
- m.QueueID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.WorkerID
- m.WorkerID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsMain
- m.IsMain = tmp[pos] != 0
- pos += 1
- return nil
-}
-
-// SwInterfaceSetRxPlacementReply represents VPP binary API message 'sw_interface_set_rx_placement_reply'.
-type SwInterfaceSetRxPlacementReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceSetRxPlacementReply) Reset() { *m = SwInterfaceSetRxPlacementReply{} }
-func (*SwInterfaceSetRxPlacementReply) GetMessageName() string {
- return "sw_interface_set_rx_placement_reply"
-}
-func (*SwInterfaceSetRxPlacementReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceSetRxPlacementReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceSetRxPlacementReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceSetRxPlacementReply) 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 *SwInterfaceSetRxPlacementReply) 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
- return nil
-}
-
-// SwInterfaceSetTable represents VPP binary API message 'sw_interface_set_table'.
-type SwInterfaceSetTable struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
- VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
-}
-
-func (m *SwInterfaceSetTable) Reset() { *m = SwInterfaceSetTable{} }
-func (*SwInterfaceSetTable) GetMessageName() string { return "sw_interface_set_table" }
-func (*SwInterfaceSetTable) GetCrcString() string { return "df42a577" }
-func (*SwInterfaceSetTable) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceSetTable) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.IsIPv6
- size += 1
- // field[1] m.VrfID
- size += 4
- return size
-}
-func (m *SwInterfaceSetTable) 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
- // field[1] m.VrfID
- o.PutUint32(buf[pos:pos+4], uint32(m.VrfID))
- pos += 4
- return buf, nil
-}
-func (m *SwInterfaceSetTable) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsIPv6
- m.IsIPv6 = tmp[pos] != 0
- pos += 1
- // field[1] m.VrfID
- m.VrfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SwInterfaceSetTableReply represents VPP binary API message 'sw_interface_set_table_reply'.
-type SwInterfaceSetTableReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceSetTableReply) Reset() { *m = SwInterfaceSetTableReply{} }
-func (*SwInterfaceSetTableReply) GetMessageName() string { return "sw_interface_set_table_reply" }
-func (*SwInterfaceSetTableReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceSetTableReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceSetTableReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceSetTableReply) 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 *SwInterfaceSetTableReply) 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
- return nil
-}
-
-// SwInterfaceSetUnnumbered represents VPP binary API message 'sw_interface_set_unnumbered'.
-type SwInterfaceSetUnnumbered struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- UnnumberedSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=unnumbered_sw_if_index" json:"unnumbered_sw_if_index,omitempty"`
- IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
-}
-
-func (m *SwInterfaceSetUnnumbered) Reset() { *m = SwInterfaceSetUnnumbered{} }
-func (*SwInterfaceSetUnnumbered) GetMessageName() string { return "sw_interface_set_unnumbered" }
-func (*SwInterfaceSetUnnumbered) GetCrcString() string { return "938ef33b" }
-func (*SwInterfaceSetUnnumbered) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceSetUnnumbered) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.UnnumberedSwIfIndex
- size += 4
- // field[1] m.IsAdd
- size += 1
- return size
-}
-func (m *SwInterfaceSetUnnumbered) 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.UnnumberedSwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.UnnumberedSwIfIndex))
- pos += 4
- // field[1] m.IsAdd
- if m.IsAdd {
- buf[pos] = 1
- }
- pos += 1
- return buf, nil
-}
-func (m *SwInterfaceSetUnnumbered) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.UnnumberedSwIfIndex
- m.UnnumberedSwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
- return nil
-}
-
-// SwInterfaceSetUnnumberedReply represents VPP binary API message 'sw_interface_set_unnumbered_reply'.
-type SwInterfaceSetUnnumberedReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceSetUnnumberedReply) Reset() { *m = SwInterfaceSetUnnumberedReply{} }
-func (*SwInterfaceSetUnnumberedReply) GetMessageName() string {
- return "sw_interface_set_unnumbered_reply"
-}
-func (*SwInterfaceSetUnnumberedReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceSetUnnumberedReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceSetUnnumberedReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceSetUnnumberedReply) 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 *SwInterfaceSetUnnumberedReply) 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
- return nil
-}
-
-// SwInterfaceTagAddDel represents VPP binary API message 'sw_interface_tag_add_del'.
-type SwInterfaceTagAddDel struct {
- IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- Tag string `binapi:"string[64],name=tag" json:"tag,omitempty" struc:"[64]byte"`
-}
-
-func (m *SwInterfaceTagAddDel) Reset() { *m = SwInterfaceTagAddDel{} }
-func (*SwInterfaceTagAddDel) GetMessageName() string { return "sw_interface_tag_add_del" }
-func (*SwInterfaceTagAddDel) GetCrcString() string { return "426f8bc1" }
-func (*SwInterfaceTagAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SwInterfaceTagAddDel) 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.Tag
- size += 64
- return size
-}
-func (m *SwInterfaceTagAddDel) 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.Tag
- copy(buf[pos:pos+64], m.Tag)
- pos += 64
- return buf, nil
-}
-func (m *SwInterfaceTagAddDel) 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 = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Tag
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.Tag = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- return nil
-}
-
-// SwInterfaceTagAddDelReply represents VPP binary API message 'sw_interface_tag_add_del_reply'.
-type SwInterfaceTagAddDelReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceTagAddDelReply) Reset() { *m = SwInterfaceTagAddDelReply{} }
-func (*SwInterfaceTagAddDelReply) GetMessageName() string { return "sw_interface_tag_add_del_reply" }
-func (*SwInterfaceTagAddDelReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceTagAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SwInterfaceTagAddDelReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SwInterfaceTagAddDelReply) 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 *SwInterfaceTagAddDelReply) 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
- return nil
-}
-
-// WantInterfaceEvents represents VPP binary API message 'want_interface_events'.
-type WantInterfaceEvents struct {
- EnableDisable uint32 `binapi:"u32,name=enable_disable" json:"enable_disable,omitempty"`
- PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
-}
-
-func (m *WantInterfaceEvents) Reset() { *m = WantInterfaceEvents{} }
-func (*WantInterfaceEvents) GetMessageName() string { return "want_interface_events" }
-func (*WantInterfaceEvents) GetCrcString() string { return "476f5a08" }
-func (*WantInterfaceEvents) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *WantInterfaceEvents) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.EnableDisable
- size += 4
- // field[1] m.PID
- size += 4
- return size
-}
-func (m *WantInterfaceEvents) 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.EnableDisable
- o.PutUint32(buf[pos:pos+4], uint32(m.EnableDisable))
- pos += 4
- // field[1] m.PID
- o.PutUint32(buf[pos:pos+4], uint32(m.PID))
- pos += 4
- return buf, nil
-}
-func (m *WantInterfaceEvents) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.EnableDisable
- m.EnableDisable = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.PID
- m.PID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// WantInterfaceEventsReply represents VPP binary API message 'want_interface_events_reply'.
-type WantInterfaceEventsReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *WantInterfaceEventsReply) Reset() { *m = WantInterfaceEventsReply{} }
-func (*WantInterfaceEventsReply) GetMessageName() string { return "want_interface_events_reply" }
-func (*WantInterfaceEventsReply) GetCrcString() string { return "e8d4e804" }
-func (*WantInterfaceEventsReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *WantInterfaceEventsReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *WantInterfaceEventsReply) 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 *WantInterfaceEventsReply) 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
- return nil
-}
-
-func init() { file_interfaces_binapi_init() }
-func file_interfaces_binapi_init() {
- api.RegisterMessage((*CollectDetailedInterfaceStats)(nil), "interface.CollectDetailedInterfaceStats")
- api.RegisterMessage((*CollectDetailedInterfaceStatsReply)(nil), "interface.CollectDetailedInterfaceStatsReply")
- api.RegisterMessage((*CreateLoopback)(nil), "interface.CreateLoopback")
- api.RegisterMessage((*CreateLoopbackInstance)(nil), "interface.CreateLoopbackInstance")
- api.RegisterMessage((*CreateLoopbackInstanceReply)(nil), "interface.CreateLoopbackInstanceReply")
- api.RegisterMessage((*CreateLoopbackReply)(nil), "interface.CreateLoopbackReply")
- api.RegisterMessage((*CreateSubif)(nil), "interface.CreateSubif")
- api.RegisterMessage((*CreateSubifReply)(nil), "interface.CreateSubifReply")
- api.RegisterMessage((*CreateVlanSubif)(nil), "interface.CreateVlanSubif")
- api.RegisterMessage((*CreateVlanSubifReply)(nil), "interface.CreateVlanSubifReply")
- api.RegisterMessage((*DeleteLoopback)(nil), "interface.DeleteLoopback")
- api.RegisterMessage((*DeleteLoopbackReply)(nil), "interface.DeleteLoopbackReply")
- api.RegisterMessage((*DeleteSubif)(nil), "interface.DeleteSubif")
- api.RegisterMessage((*DeleteSubifReply)(nil), "interface.DeleteSubifReply")
- api.RegisterMessage((*HwInterfaceSetMtu)(nil), "interface.HwInterfaceSetMtu")
- api.RegisterMessage((*HwInterfaceSetMtuReply)(nil), "interface.HwInterfaceSetMtuReply")
- api.RegisterMessage((*InterfaceNameRenumber)(nil), "interface.InterfaceNameRenumber")
- api.RegisterMessage((*InterfaceNameRenumberReply)(nil), "interface.InterfaceNameRenumberReply")
- api.RegisterMessage((*SwInterfaceAddDelAddress)(nil), "interface.SwInterfaceAddDelAddress")
- api.RegisterMessage((*SwInterfaceAddDelAddressReply)(nil), "interface.SwInterfaceAddDelAddressReply")
- api.RegisterMessage((*SwInterfaceAddDelMacAddress)(nil), "interface.SwInterfaceAddDelMacAddress")
- api.RegisterMessage((*SwInterfaceAddDelMacAddressReply)(nil), "interface.SwInterfaceAddDelMacAddressReply")
- api.RegisterMessage((*SwInterfaceAddressReplaceBegin)(nil), "interface.SwInterfaceAddressReplaceBegin")
- api.RegisterMessage((*SwInterfaceAddressReplaceBeginReply)(nil), "interface.SwInterfaceAddressReplaceBeginReply")
- api.RegisterMessage((*SwInterfaceAddressReplaceEnd)(nil), "interface.SwInterfaceAddressReplaceEnd")
- api.RegisterMessage((*SwInterfaceAddressReplaceEndReply)(nil), "interface.SwInterfaceAddressReplaceEndReply")
- api.RegisterMessage((*SwInterfaceClearStats)(nil), "interface.SwInterfaceClearStats")
- api.RegisterMessage((*SwInterfaceClearStatsReply)(nil), "interface.SwInterfaceClearStatsReply")
- api.RegisterMessage((*SwInterfaceDetails)(nil), "interface.SwInterfaceDetails")
- api.RegisterMessage((*SwInterfaceDump)(nil), "interface.SwInterfaceDump")
- api.RegisterMessage((*SwInterfaceEvent)(nil), "interface.SwInterfaceEvent")
- api.RegisterMessage((*SwInterfaceGetMacAddress)(nil), "interface.SwInterfaceGetMacAddress")
- api.RegisterMessage((*SwInterfaceGetMacAddressReply)(nil), "interface.SwInterfaceGetMacAddressReply")
- api.RegisterMessage((*SwInterfaceGetTable)(nil), "interface.SwInterfaceGetTable")
- api.RegisterMessage((*SwInterfaceGetTableReply)(nil), "interface.SwInterfaceGetTableReply")
- api.RegisterMessage((*SwInterfaceRxPlacementDetails)(nil), "interface.SwInterfaceRxPlacementDetails")
- api.RegisterMessage((*SwInterfaceRxPlacementDump)(nil), "interface.SwInterfaceRxPlacementDump")
- api.RegisterMessage((*SwInterfaceSetFlags)(nil), "interface.SwInterfaceSetFlags")
- api.RegisterMessage((*SwInterfaceSetFlagsReply)(nil), "interface.SwInterfaceSetFlagsReply")
- api.RegisterMessage((*SwInterfaceSetIPDirectedBroadcast)(nil), "interface.SwInterfaceSetIPDirectedBroadcast")
- api.RegisterMessage((*SwInterfaceSetIPDirectedBroadcastReply)(nil), "interface.SwInterfaceSetIPDirectedBroadcastReply")
- api.RegisterMessage((*SwInterfaceSetMacAddress)(nil), "interface.SwInterfaceSetMacAddress")
- api.RegisterMessage((*SwInterfaceSetMacAddressReply)(nil), "interface.SwInterfaceSetMacAddressReply")
- api.RegisterMessage((*SwInterfaceSetMtu)(nil), "interface.SwInterfaceSetMtu")
- api.RegisterMessage((*SwInterfaceSetMtuReply)(nil), "interface.SwInterfaceSetMtuReply")
- api.RegisterMessage((*SwInterfaceSetRxMode)(nil), "interface.SwInterfaceSetRxMode")
- api.RegisterMessage((*SwInterfaceSetRxModeReply)(nil), "interface.SwInterfaceSetRxModeReply")
- api.RegisterMessage((*SwInterfaceSetRxPlacement)(nil), "interface.SwInterfaceSetRxPlacement")
- api.RegisterMessage((*SwInterfaceSetRxPlacementReply)(nil), "interface.SwInterfaceSetRxPlacementReply")
- api.RegisterMessage((*SwInterfaceSetTable)(nil), "interface.SwInterfaceSetTable")
- api.RegisterMessage((*SwInterfaceSetTableReply)(nil), "interface.SwInterfaceSetTableReply")
- api.RegisterMessage((*SwInterfaceSetUnnumbered)(nil), "interface.SwInterfaceSetUnnumbered")
- api.RegisterMessage((*SwInterfaceSetUnnumberedReply)(nil), "interface.SwInterfaceSetUnnumberedReply")
- api.RegisterMessage((*SwInterfaceTagAddDel)(nil), "interface.SwInterfaceTagAddDel")
- api.RegisterMessage((*SwInterfaceTagAddDelReply)(nil), "interface.SwInterfaceTagAddDelReply")
- api.RegisterMessage((*WantInterfaceEvents)(nil), "interface.WantInterfaceEvents")
- api.RegisterMessage((*WantInterfaceEventsReply)(nil), "interface.WantInterfaceEventsReply")
-}
-
-// Messages returns list of all messages in this module.
-func AllMessages() []api.Message {
- return []api.Message{
- (*CollectDetailedInterfaceStats)(nil),
- (*CollectDetailedInterfaceStatsReply)(nil),
- (*CreateLoopback)(nil),
- (*CreateLoopbackInstance)(nil),
- (*CreateLoopbackInstanceReply)(nil),
- (*CreateLoopbackReply)(nil),
- (*CreateSubif)(nil),
- (*CreateSubifReply)(nil),
- (*CreateVlanSubif)(nil),
- (*CreateVlanSubifReply)(nil),
- (*DeleteLoopback)(nil),
- (*DeleteLoopbackReply)(nil),
- (*DeleteSubif)(nil),
- (*DeleteSubifReply)(nil),
- (*HwInterfaceSetMtu)(nil),
- (*HwInterfaceSetMtuReply)(nil),
- (*InterfaceNameRenumber)(nil),
- (*InterfaceNameRenumberReply)(nil),
- (*SwInterfaceAddDelAddress)(nil),
- (*SwInterfaceAddDelAddressReply)(nil),
- (*SwInterfaceAddDelMacAddress)(nil),
- (*SwInterfaceAddDelMacAddressReply)(nil),
- (*SwInterfaceAddressReplaceBegin)(nil),
- (*SwInterfaceAddressReplaceBeginReply)(nil),
- (*SwInterfaceAddressReplaceEnd)(nil),
- (*SwInterfaceAddressReplaceEndReply)(nil),
- (*SwInterfaceClearStats)(nil),
- (*SwInterfaceClearStatsReply)(nil),
- (*SwInterfaceDetails)(nil),
- (*SwInterfaceDump)(nil),
- (*SwInterfaceEvent)(nil),
- (*SwInterfaceGetMacAddress)(nil),
- (*SwInterfaceGetMacAddressReply)(nil),
- (*SwInterfaceGetTable)(nil),
- (*SwInterfaceGetTableReply)(nil),
- (*SwInterfaceRxPlacementDetails)(nil),
- (*SwInterfaceRxPlacementDump)(nil),
- (*SwInterfaceSetFlags)(nil),
- (*SwInterfaceSetFlagsReply)(nil),
- (*SwInterfaceSetIPDirectedBroadcast)(nil),
- (*SwInterfaceSetIPDirectedBroadcastReply)(nil),
- (*SwInterfaceSetMacAddress)(nil),
- (*SwInterfaceSetMacAddressReply)(nil),
- (*SwInterfaceSetMtu)(nil),
- (*SwInterfaceSetMtuReply)(nil),
- (*SwInterfaceSetRxMode)(nil),
- (*SwInterfaceSetRxModeReply)(nil),
- (*SwInterfaceSetRxPlacement)(nil),
- (*SwInterfaceSetRxPlacementReply)(nil),
- (*SwInterfaceSetTable)(nil),
- (*SwInterfaceSetTableReply)(nil),
- (*SwInterfaceSetUnnumbered)(nil),
- (*SwInterfaceSetUnnumberedReply)(nil),
- (*SwInterfaceTagAddDel)(nil),
- (*SwInterfaceTagAddDelReply)(nil),
- (*WantInterfaceEvents)(nil),
- (*WantInterfaceEventsReply)(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 _ = strings.Contains
-var _ = struc.Pack
-var _ = binary.BigEndian
-var _ = math.Float32bits
-var _ = net.ParseIP
-var _ = fmt.Errorf
diff --git a/examples/binapi/interfaces/interfaces_rpc.ba.go b/examples/binapi/interfaces/interfaces_rpc.ba.go
deleted file mode 100644
index a7235a8..0000000
--- a/examples/binapi/interfaces/interfaces_rpc.ba.go
+++ /dev/null
@@ -1,341 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-
-package interfaces
-
-import (
- "context"
- "io"
-
- api "git.fd.io/govpp.git/api"
-)
-
-// RPCService represents RPC service API for interface module.
-type RPCService interface {
- DumpSwInterface(ctx context.Context, in *SwInterfaceDump) (RPCService_DumpSwInterfaceClient, error)
- DumpSwInterfaceRxPlacement(ctx context.Context, in *SwInterfaceRxPlacementDump) (RPCService_DumpSwInterfaceRxPlacementClient, error)
- CollectDetailedInterfaceStats(ctx context.Context, in *CollectDetailedInterfaceStats) (*CollectDetailedInterfaceStatsReply, error)
- CreateLoopback(ctx context.Context, in *CreateLoopback) (*CreateLoopbackReply, error)
- CreateLoopbackInstance(ctx context.Context, in *CreateLoopbackInstance) (*CreateLoopbackInstanceReply, error)
- CreateSubif(ctx context.Context, in *CreateSubif) (*CreateSubifReply, error)
- CreateVlanSubif(ctx context.Context, in *CreateVlanSubif) (*CreateVlanSubifReply, error)
- DeleteLoopback(ctx context.Context, in *DeleteLoopback) (*DeleteLoopbackReply, error)
- DeleteSubif(ctx context.Context, in *DeleteSubif) (*DeleteSubifReply, error)
- HwInterfaceSetMtu(ctx context.Context, in *HwInterfaceSetMtu) (*HwInterfaceSetMtuReply, error)
- InterfaceNameRenumber(ctx context.Context, in *InterfaceNameRenumber) (*InterfaceNameRenumberReply, error)
- SwInterfaceAddDelAddress(ctx context.Context, in *SwInterfaceAddDelAddress) (*SwInterfaceAddDelAddressReply, error)
- SwInterfaceAddDelMacAddress(ctx context.Context, in *SwInterfaceAddDelMacAddress) (*SwInterfaceAddDelMacAddressReply, error)
- SwInterfaceAddressReplaceBegin(ctx context.Context, in *SwInterfaceAddressReplaceBegin) (*SwInterfaceAddressReplaceBeginReply, error)
- SwInterfaceAddressReplaceEnd(ctx context.Context, in *SwInterfaceAddressReplaceEnd) (*SwInterfaceAddressReplaceEndReply, error)
- SwInterfaceClearStats(ctx context.Context, in *SwInterfaceClearStats) (*SwInterfaceClearStatsReply, error)
- SwInterfaceGetMacAddress(ctx context.Context, in *SwInterfaceGetMacAddress) (*SwInterfaceGetMacAddressReply, error)
- SwInterfaceGetTable(ctx context.Context, in *SwInterfaceGetTable) (*SwInterfaceGetTableReply, error)
- SwInterfaceSetFlags(ctx context.Context, in *SwInterfaceSetFlags) (*SwInterfaceSetFlagsReply, error)
- SwInterfaceSetIPDirectedBroadcast(ctx context.Context, in *SwInterfaceSetIPDirectedBroadcast) (*SwInterfaceSetIPDirectedBroadcastReply, error)
- SwInterfaceSetMacAddress(ctx context.Context, in *SwInterfaceSetMacAddress) (*SwInterfaceSetMacAddressReply, error)
- SwInterfaceSetMtu(ctx context.Context, in *SwInterfaceSetMtu) (*SwInterfaceSetMtuReply, error)
- SwInterfaceSetRxMode(ctx context.Context, in *SwInterfaceSetRxMode) (*SwInterfaceSetRxModeReply, error)
- SwInterfaceSetRxPlacement(ctx context.Context, in *SwInterfaceSetRxPlacement) (*SwInterfaceSetRxPlacementReply, error)
- SwInterfaceSetTable(ctx context.Context, in *SwInterfaceSetTable) (*SwInterfaceSetTableReply, error)
- SwInterfaceSetUnnumbered(ctx context.Context, in *SwInterfaceSetUnnumbered) (*SwInterfaceSetUnnumberedReply, error)
- SwInterfaceTagAddDel(ctx context.Context, in *SwInterfaceTagAddDel) (*SwInterfaceTagAddDelReply, error)
- WantInterfaceEvents(ctx context.Context, in *WantInterfaceEvents) (*WantInterfaceEventsReply, error)
-}
-
-type serviceClient struct {
- ch api.Channel
-}
-
-func NewServiceClient(ch api.Channel) RPCService {
- return &serviceClient{ch}
-}
-
-func (c *serviceClient) DumpSwInterface(ctx context.Context, in *SwInterfaceDump) (RPCService_DumpSwInterfaceClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpSwInterfaceClient{stream}
- return x, nil
-}
-
-type RPCService_DumpSwInterfaceClient interface {
- Recv() (*SwInterfaceDetails, error)
-}
-
-type serviceClient_DumpSwInterfaceClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpSwInterfaceClient) Recv() (*SwInterfaceDetails, error) {
- m := new(SwInterfaceDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) DumpSwInterfaceRxPlacement(ctx context.Context, in *SwInterfaceRxPlacementDump) (RPCService_DumpSwInterfaceRxPlacementClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpSwInterfaceRxPlacementClient{stream}
- return x, nil
-}
-
-type RPCService_DumpSwInterfaceRxPlacementClient interface {
- Recv() (*SwInterfaceRxPlacementDetails, error)
-}
-
-type serviceClient_DumpSwInterfaceRxPlacementClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpSwInterfaceRxPlacementClient) Recv() (*SwInterfaceRxPlacementDetails, error) {
- m := new(SwInterfaceRxPlacementDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) CollectDetailedInterfaceStats(ctx context.Context, in *CollectDetailedInterfaceStats) (*CollectDetailedInterfaceStatsReply, error) {
- out := new(CollectDetailedInterfaceStatsReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) CreateLoopback(ctx context.Context, in *CreateLoopback) (*CreateLoopbackReply, error) {
- out := new(CreateLoopbackReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) CreateLoopbackInstance(ctx context.Context, in *CreateLoopbackInstance) (*CreateLoopbackInstanceReply, error) {
- out := new(CreateLoopbackInstanceReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) CreateSubif(ctx context.Context, in *CreateSubif) (*CreateSubifReply, error) {
- out := new(CreateSubifReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) CreateVlanSubif(ctx context.Context, in *CreateVlanSubif) (*CreateVlanSubifReply, error) {
- out := new(CreateVlanSubifReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) DeleteLoopback(ctx context.Context, in *DeleteLoopback) (*DeleteLoopbackReply, error) {
- out := new(DeleteLoopbackReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) DeleteSubif(ctx context.Context, in *DeleteSubif) (*DeleteSubifReply, error) {
- out := new(DeleteSubifReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) HwInterfaceSetMtu(ctx context.Context, in *HwInterfaceSetMtu) (*HwInterfaceSetMtuReply, error) {
- out := new(HwInterfaceSetMtuReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) InterfaceNameRenumber(ctx context.Context, in *InterfaceNameRenumber) (*InterfaceNameRenumberReply, error) {
- out := new(InterfaceNameRenumberReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SwInterfaceAddDelAddress(ctx context.Context, in *SwInterfaceAddDelAddress) (*SwInterfaceAddDelAddressReply, error) {
- out := new(SwInterfaceAddDelAddressReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SwInterfaceAddDelMacAddress(ctx context.Context, in *SwInterfaceAddDelMacAddress) (*SwInterfaceAddDelMacAddressReply, error) {
- out := new(SwInterfaceAddDelMacAddressReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SwInterfaceAddressReplaceBegin(ctx context.Context, in *SwInterfaceAddressReplaceBegin) (*SwInterfaceAddressReplaceBeginReply, error) {
- out := new(SwInterfaceAddressReplaceBeginReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SwInterfaceAddressReplaceEnd(ctx context.Context, in *SwInterfaceAddressReplaceEnd) (*SwInterfaceAddressReplaceEndReply, error) {
- out := new(SwInterfaceAddressReplaceEndReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SwInterfaceClearStats(ctx context.Context, in *SwInterfaceClearStats) (*SwInterfaceClearStatsReply, error) {
- out := new(SwInterfaceClearStatsReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SwInterfaceGetMacAddress(ctx context.Context, in *SwInterfaceGetMacAddress) (*SwInterfaceGetMacAddressReply, error) {
- out := new(SwInterfaceGetMacAddressReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SwInterfaceGetTable(ctx context.Context, in *SwInterfaceGetTable) (*SwInterfaceGetTableReply, error) {
- out := new(SwInterfaceGetTableReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SwInterfaceSetFlags(ctx context.Context, in *SwInterfaceSetFlags) (*SwInterfaceSetFlagsReply, error) {
- out := new(SwInterfaceSetFlagsReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SwInterfaceSetIPDirectedBroadcast(ctx context.Context, in *SwInterfaceSetIPDirectedBroadcast) (*SwInterfaceSetIPDirectedBroadcastReply, error) {
- out := new(SwInterfaceSetIPDirectedBroadcastReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SwInterfaceSetMacAddress(ctx context.Context, in *SwInterfaceSetMacAddress) (*SwInterfaceSetMacAddressReply, error) {
- out := new(SwInterfaceSetMacAddressReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SwInterfaceSetMtu(ctx context.Context, in *SwInterfaceSetMtu) (*SwInterfaceSetMtuReply, error) {
- out := new(SwInterfaceSetMtuReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SwInterfaceSetRxMode(ctx context.Context, in *SwInterfaceSetRxMode) (*SwInterfaceSetRxModeReply, error) {
- out := new(SwInterfaceSetRxModeReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SwInterfaceSetRxPlacement(ctx context.Context, in *SwInterfaceSetRxPlacement) (*SwInterfaceSetRxPlacementReply, error) {
- out := new(SwInterfaceSetRxPlacementReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SwInterfaceSetTable(ctx context.Context, in *SwInterfaceSetTable) (*SwInterfaceSetTableReply, error) {
- out := new(SwInterfaceSetTableReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SwInterfaceSetUnnumbered(ctx context.Context, in *SwInterfaceSetUnnumbered) (*SwInterfaceSetUnnumberedReply, error) {
- out := new(SwInterfaceSetUnnumberedReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SwInterfaceTagAddDel(ctx context.Context, in *SwInterfaceTagAddDel) (*SwInterfaceTagAddDelReply, error) {
- out := new(SwInterfaceTagAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) WantInterfaceEvents(ctx context.Context, in *WantInterfaceEvents) (*WantInterfaceEventsReply, error) {
- out := new(WantInterfaceEventsReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = context.Background
-var _ = io.Copy
diff --git a/examples/binapi/ip/ip.ba.go b/examples/binapi/ip/ip.ba.go
deleted file mode 100644
index ed8640b..0000000
--- a/examples/binapi/ip/ip.ba.go
+++ /dev/null
@@ -1,5317 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-// versions:
-// binapi-generator: v0.4.0-dev
-// VPP: 20.05-release
-// source: /usr/share/vpp/api/core/ip.api.json
-
-/*
-Package ip contains generated code for VPP API file ip.api (3.0.1).
-
-It consists of:
- 7 aliases
- 15 enums
- 60 messages
- 14 types
- 1 union
-*/
-package ip
-
-import (
- "bytes"
- "context"
- "encoding/binary"
- "fmt"
- "io"
- "math"
- "net"
- "strconv"
- "strings"
-
- api "git.fd.io/govpp.git/api"
- codec "git.fd.io/govpp.git/codec"
- struc "github.com/lunixbochs/struc"
-
- fib_types "git.fd.io/govpp.git/examples/binapi/fib_types"
- interface_types "git.fd.io/govpp.git/examples/binapi/interface_types"
-)
-
-// 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 (
- // ModuleName is the name of this module.
- ModuleName = "ip"
- // APIVersion is the API version of this module.
- APIVersion = "3.0.1"
- // VersionCrc is the CRC of this module.
- VersionCrc = 0x765d74b1
-)
-
-// IPReassType represents VPP binary API enum 'ip_reass_type'.
-type IPReassType uint32
-
-const (
- IP_REASS_TYPE_FULL IPReassType = 0
- IP_REASS_TYPE_SHALLOW_VIRTUAL IPReassType = 1
-)
-
-var (
- IPReassType_name = map[uint32]string{
- 0: "IP_REASS_TYPE_FULL",
- 1: "IP_REASS_TYPE_SHALLOW_VIRTUAL",
- }
- IPReassType_value = map[string]uint32{
- "IP_REASS_TYPE_FULL": 0,
- "IP_REASS_TYPE_SHALLOW_VIRTUAL": 1,
- }
-)
-
-func (x IPReassType) String() string {
- s, ok := IPReassType_name[uint32(x)]
- if ok {
- return s
- }
- return "IPReassType(" + strconv.Itoa(int(x)) + ")"
-}
-
-// MfibItfFlags represents VPP binary API enum 'mfib_itf_flags'.
-type MfibItfFlags uint32
-
-const (
- MFIB_API_ITF_FLAG_NONE MfibItfFlags = 0
- MFIB_API_ITF_FLAG_NEGATE_SIGNAL MfibItfFlags = 1
- MFIB_API_ITF_FLAG_ACCEPT MfibItfFlags = 2
- MFIB_API_ITF_FLAG_FORWARD MfibItfFlags = 4
- MFIB_API_ITF_FLAG_SIGNAL_PRESENT MfibItfFlags = 8
- MFIB_API_ITF_FLAG_DONT_PRESERVE MfibItfFlags = 16
-)
-
-var (
- MfibItfFlags_name = map[uint32]string{
- 0: "MFIB_API_ITF_FLAG_NONE",
- 1: "MFIB_API_ITF_FLAG_NEGATE_SIGNAL",
- 2: "MFIB_API_ITF_FLAG_ACCEPT",
- 4: "MFIB_API_ITF_FLAG_FORWARD",
- 8: "MFIB_API_ITF_FLAG_SIGNAL_PRESENT",
- 16: "MFIB_API_ITF_FLAG_DONT_PRESERVE",
- }
- MfibItfFlags_value = map[string]uint32{
- "MFIB_API_ITF_FLAG_NONE": 0,
- "MFIB_API_ITF_FLAG_NEGATE_SIGNAL": 1,
- "MFIB_API_ITF_FLAG_ACCEPT": 2,
- "MFIB_API_ITF_FLAG_FORWARD": 4,
- "MFIB_API_ITF_FLAG_SIGNAL_PRESENT": 8,
- "MFIB_API_ITF_FLAG_DONT_PRESERVE": 16,
- }
-)
-
-func (x MfibItfFlags) String() string {
- s, ok := MfibItfFlags_name[uint32(x)]
- if ok {
- return s
- }
- return "MfibItfFlags(" + strconv.Itoa(int(x)) + ")"
-}
-
-// MacAddress represents VPP binary API alias 'mac_address'.
-type MacAddress [6]uint8
-
-func ParseMAC(mac string) (parsed MacAddress, err error) {
- var hw net.HardwareAddr
- if hw, err = net.ParseMAC(mac); err != nil {
- return
- }
- copy(parsed[:], hw[:])
- return
-}
-
-func (m *MacAddress) ToString() string {
- return net.HardwareAddr(m[:]).String()
-}
-
-// IPMroute represents VPP binary API 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 fib_types.Mprefix `binapi:"mprefix,name=prefix" json:"prefix,omitempty"`
- NPaths uint8 `binapi:"u8,name=n_paths" json:"n_paths,omitempty" struc:"sizeof=Paths"`
- 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'.
-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 fib_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
- NPaths uint8 `binapi:"u8,name=n_paths" json:"n_paths,omitempty" struc:"sizeof=Paths"`
- Paths []fib_types.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'.
-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"`
-}
-
-func (*IPTable) GetTypeName() string { return "ip_table" }
-
-// MfibPath represents VPP binary API type 'mfib_path'.
-type MfibPath struct {
- ItfFlags MfibItfFlags `binapi:"mfib_itf_flags,name=itf_flags" json:"itf_flags,omitempty"`
- Path fib_types.FibPath `binapi:"fib_path,name=path" json:"path,omitempty"`
-}
-
-func (*MfibPath) GetTypeName() string { return "mfib_path" }
-
-// PuntRedirect represents VPP binary API type 'punt_redirect'.
-type PuntRedirect struct {
- RxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
- TxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=tx_sw_if_index" json:"tx_sw_if_index,omitempty"`
- Nh fib_types.Address `binapi:"address,name=nh" json:"nh,omitempty"`
-}
-
-func (*PuntRedirect) GetTypeName() string { return "punt_redirect" }
-
-// IoamDisable represents VPP binary API 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) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.ID
- size += 2
- 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
- return nil
-}
-
-// IoamDisableReply represents VPP binary API 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) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- 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
- return nil
-}
-
-// IoamEnable represents VPP binary API message 'ioam_enable'.
-type IoamEnable struct {
- ID uint16 `binapi:"u16,name=id" json:"id,omitempty"`
- Seqno bool `binapi:"bool,name=seqno" json:"seqno,omitempty"`
- Analyse bool `binapi:"bool,name=analyse" json:"analyse,omitempty"`
- PotEnable bool `binapi:"bool,name=pot_enable" json:"pot_enable,omitempty"`
- TraceEnable bool `binapi:"bool,name=trace_enable" json:"trace_enable,omitempty"`
- 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) 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
- 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
- return nil
-}
-
-// IoamEnableReply represents VPP binary API 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) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- 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
- return nil
-}
-
-// IPAddressDetails represents VPP binary API message 'ip_address_details'.
-type IPAddressDetails struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- Prefix fib_types.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) 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 += 1
- // field[3] m.Prefix.Address.Un
- size += 16
- // field[2] m.Prefix.Len
- size += 1
- 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
- buf[pos] = uint8(m.Prefix.Address.Af)
- pos += 1
- // 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 = interface_types.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 = fib_types.AddressFamily(tmp[pos])
- pos += 1
- // 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
- return nil
-}
-
-// IPAddressDump represents VPP binary API message 'ip_address_dump'.
-type IPAddressDump struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
-}
-
-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 {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.IsIPv6
- size += 1
- 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 = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsIPv6
- m.IsIPv6 = tmp[pos] != 0
- pos += 1
- return nil
-}
-
-// IPContainerProxyAddDel represents VPP binary API message 'ip_container_proxy_add_del'.
-type IPContainerProxyAddDel struct {
- Pfx fib_types.Prefix `binapi:"prefix,name=pfx" json:"pfx,omitempty"`
- SwIfIndex interface_types.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) 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 += 1
- // 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
- 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
- buf[pos] = uint8(m.Pfx.Address.Af)
- pos += 1
- // 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 = fib_types.AddressFamily(tmp[pos])
- pos += 1
- // 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 = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsAdd
- m.IsAdd = tmp[pos] != 0
- pos += 1
- return nil
-}
-
-// IPContainerProxyAddDelReply represents VPP binary API message 'ip_container_proxy_add_del_reply'.
-type IPContainerProxyAddDelReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-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 (m *IPContainerProxyAddDelReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- 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
- return nil
-}
-
-// IPContainerProxyDetails represents VPP binary API message 'ip_container_proxy_details'.
-type IPContainerProxyDetails struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- Prefix fib_types.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) 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 += 1
- // field[3] m.Prefix.Address.Un
- size += 16
- // field[2] m.Prefix.Len
- size += 1
- 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
- buf[pos] = uint8(m.Prefix.Address.Af)
- pos += 1
- // 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 = interface_types.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 = fib_types.AddressFamily(tmp[pos])
- pos += 1
- // 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
- return nil
-}
-
-// IPContainerProxyDump represents VPP binary API 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) 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
- }
- return buf, nil
-}
-func (m *IPContainerProxyDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- return nil
-}
-
-// IPDetails represents VPP binary API message 'ip_details'.
-type IPDetails struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
-}
-
-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 {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.IsIPv6
- size += 1
- 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 = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsIPv6
- m.IsIPv6 = tmp[pos] != 0
- pos += 1
- return nil
-}
-
-// IPDump represents VPP binary API 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) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.IsIPv6
- size += 1
- 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
- return nil
-}
-
-// IPMrouteAddDel represents VPP binary API 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) 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 += 1
- // 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
- 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
- for j4 := 0; j4 < 16; j4++ {
- var s4 fib_types.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
- }
- }
- 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
- buf[pos] = uint8(m.Route.Prefix.Af)
- pos += 1
- // 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]
- }
- // 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 fib_types.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
- }
- }
- 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 = fib_types.AddressFamily(tmp[pos])
- pos += 1
- // 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 = fib_types.FibPathType(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.Flags
- m.Route.Paths[j2].Path.Flags = fib_types.FibPathFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.Proto
- m.Route.Paths[j2].Path.Proto = fib_types.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 nil
-}
-
-// IPMrouteAddDelReply represents VPP binary API 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) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.StatsIndex
- size += 4
- 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
- return nil
-}
-
-// IPMrouteDetails represents VPP binary API 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) 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 += 1
- // 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
- 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
- for j4 := 0; j4 < 16; j4++ {
- var s4 fib_types.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
- }
- }
- 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
- buf[pos] = uint8(m.Route.Prefix.Af)
- pos += 1
- // 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]
- }
- // 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 fib_types.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
- }
- }
- 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 = fib_types.AddressFamily(tmp[pos])
- pos += 1
- // 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 = fib_types.FibPathType(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.Flags
- m.Route.Paths[j2].Path.Flags = fib_types.FibPathFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[4] m.Route.Paths[j2].Path.Proto
- m.Route.Paths[j2].Path.Proto = fib_types.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 nil
-}
-
-// IPMrouteDump represents VPP binary API 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) 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
- 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
- }
- return nil
-}
-
-// IPMtableDetails represents VPP binary API 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) 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
- 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
- }
- return nil
-}
-
-// IPMtableDump represents VPP binary API 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) 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
- }
- return buf, nil
-}
-func (m *IPMtableDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- return nil
-}
-
-// IPPuntPolice represents VPP binary API 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) 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
- 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
- return nil
-}
-
-// IPPuntPoliceReply represents VPP binary API 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) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- 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
- return nil
-}
-
-// IPPuntRedirect represents VPP binary API 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) 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 += 1
- // field[3] m.Punt.Nh.Un
- size += 16
- // field[1] m.IsAdd
- size += 1
- 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
- buf[pos] = uint8(m.Punt.Nh.Af)
- pos += 1
- // 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 = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Punt.TxSwIfIndex
- m.Punt.TxSwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Punt.Nh
- // field[3] m.Punt.Nh.Af
- m.Punt.Nh.Af = fib_types.AddressFamily(tmp[pos])
- pos += 1
- // 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
- return nil
-}
-
-// IPPuntRedirectDetails represents VPP binary API 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) 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 += 1
- // field[3] m.Punt.Nh.Un
- size += 16
- 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
- buf[pos] = uint8(m.Punt.Nh.Af)
- pos += 1
- // 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 = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Punt.TxSwIfIndex
- m.Punt.TxSwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Punt.Nh
- // field[3] m.Punt.Nh.Af
- m.Punt.Nh.Af = fib_types.AddressFamily(tmp[pos])
- pos += 1
- // field[3] m.Punt.Nh.Un
- copy(m.Punt.Nh.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- return nil
-}
-
-// IPPuntRedirectDump represents VPP binary API message 'ip_punt_redirect_dump'.
-type IPPuntRedirectDump struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
-}
-
-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 {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.IsIPv6
- size += 1
- 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 = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsIPv6
- m.IsIPv6 = tmp[pos] != 0
- pos += 1
- return nil
-}
-
-// IPPuntRedirectReply represents VPP binary API 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) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- 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
- return nil
-}
-
-// IPReassemblyEnableDisable represents VPP binary API message 'ip_reassembly_enable_disable'.
-type IPReassemblyEnableDisable struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- EnableIP4 bool `binapi:"bool,name=enable_ip4" json:"enable_ip4,omitempty"`
- EnableIP6 bool `binapi:"bool,name=enable_ip6" json:"enable_ip6,omitempty"`
- 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) 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
- 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 = interface_types.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
- return nil
-}
-
-// IPReassemblyEnableDisableReply represents VPP binary API message 'ip_reassembly_enable_disable_reply'.
-type IPReassemblyEnableDisableReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *IPReassemblyEnableDisableReply) Reset() { *m = IPReassemblyEnableDisableReply{} }
-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 (m *IPReassemblyEnableDisableReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- 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
- return nil
-}
-
-// IPReassemblyGet represents VPP binary API 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) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.IsIP6
- size += 1
- // field[1] m.Type
- size += 4
- 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
- return nil
-}
-
-// IPReassemblyGetReply represents VPP binary API 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"`
- MaxReassemblies uint32 `binapi:"u32,name=max_reassemblies" json:"max_reassemblies,omitempty"`
- MaxReassemblyLength uint32 `binapi:"u32,name=max_reassembly_length" json:"max_reassembly_length,omitempty"`
- ExpireWalkIntervalMs uint32 `binapi:"u32,name=expire_walk_interval_ms" json:"expire_walk_interval_ms,omitempty"`
- 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) 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
- 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
- return nil
-}
-
-// IPReassemblySet represents VPP binary API 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"`
- MaxReassemblyLength uint32 `binapi:"u32,name=max_reassembly_length" json:"max_reassembly_length,omitempty"`
- ExpireWalkIntervalMs uint32 `binapi:"u32,name=expire_walk_interval_ms" json:"expire_walk_interval_ms,omitempty"`
- IsIP6 bool `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"`
- 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) 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
- 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
- return nil
-}
-
-// IPReassemblySetReply represents VPP binary API 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) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- 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
- return nil
-}
-
-// IPRouteAddDel represents VPP binary API 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) 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 += 1
- // 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
- for j2 := 0; j2 < len(m.Route.Paths); j2++ {
- var s2 fib_types.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
- for j3 := 0; j3 < 16; j3++ {
- var s3 fib_types.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
- }
- }
- 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
- buf[pos] = uint8(m.Route.Prefix.Address.Af)
- pos += 1
- // 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 fib_types.FibPath
- if j2 < len(m.Route.Paths) {
- v2 = m.Route.Paths[j2]
- }
- // 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 fib_types.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
- }
- }
- 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 = fib_types.AddressFamily(tmp[pos])
- pos += 1
- // 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([]fib_types.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 = fib_types.FibPathType(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Flags
- m.Route.Paths[j2].Flags = fib_types.FibPathFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Proto
- m.Route.Paths[j2].Proto = fib_types.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 nil
-}
-
-// IPRouteAddDelReply represents VPP binary API 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) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.StatsIndex
- size += 4
- 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
- return nil
-}
-
-// IPRouteDetails represents VPP binary API 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) 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 += 1
- // 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
- for j2 := 0; j2 < len(m.Route.Paths); j2++ {
- var s2 fib_types.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
- for j3 := 0; j3 < 16; j3++ {
- var s3 fib_types.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
- }
- }
- 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
- buf[pos] = uint8(m.Route.Prefix.Address.Af)
- pos += 1
- // 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 fib_types.FibPath
- if j2 < len(m.Route.Paths) {
- v2 = m.Route.Paths[j2]
- }
- // 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 fib_types.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
- }
- }
- 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 = fib_types.AddressFamily(tmp[pos])
- pos += 1
- // 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([]fib_types.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 = fib_types.FibPathType(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Flags
- m.Route.Paths[j2].Flags = fib_types.FibPathFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Proto
- m.Route.Paths[j2].Proto = fib_types.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 nil
-}
-
-// IPRouteDump represents VPP binary API 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) 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
- 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
- }
- return nil
-}
-
-// IPRouteLookup represents VPP binary API message 'ip_route_lookup'.
-type IPRouteLookup struct {
- TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
- Exact uint8 `binapi:"u8,name=exact" json:"exact,omitempty"`
- Prefix fib_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
-}
-
-func (m *IPRouteLookup) Reset() { *m = IPRouteLookup{} }
-func (*IPRouteLookup) GetMessageName() string { return "ip_route_lookup" }
-func (*IPRouteLookup) GetCrcString() string { return "e2986185" }
-func (*IPRouteLookup) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *IPRouteLookup) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.TableID
- size += 4
- // field[1] m.Exact
- size += 1
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- size += 1
- // field[3] m.Prefix.Address.Un
- size += 16
- // field[2] m.Prefix.Len
- size += 1
- return size
-}
-func (m *IPRouteLookup) 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.TableID
- o.PutUint32(buf[pos:pos+4], uint32(m.TableID))
- pos += 4
- // field[1] m.Exact
- buf[pos] = uint8(m.Exact)
- pos += 1
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- buf[pos] = uint8(m.Prefix.Address.Af)
- pos += 1
- // 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 *IPRouteLookup) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.TableID
- m.TableID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Exact
- m.Exact = uint8(tmp[pos])
- pos += 1
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- m.Prefix.Address.Af = fib_types.AddressFamily(tmp[pos])
- pos += 1
- // 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
- return nil
-}
-
-// IPRouteLookupReply represents VPP binary API message 'ip_route_lookup_reply'.
-type IPRouteLookupReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- Route IPRoute `binapi:"ip_route,name=route" json:"route,omitempty"`
-}
-
-func (m *IPRouteLookupReply) Reset() { *m = IPRouteLookupReply{} }
-func (*IPRouteLookupReply) GetMessageName() string { return "ip_route_lookup_reply" }
-func (*IPRouteLookupReply) GetCrcString() string { return "ae99de8e" }
-func (*IPRouteLookupReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *IPRouteLookupReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // 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 += 1
- // 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
- for j2 := 0; j2 < len(m.Route.Paths); j2++ {
- var s2 fib_types.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
- for j3 := 0; j3 < 16; j3++ {
- var s3 fib_types.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
- }
- }
- return size
-}
-func (m *IPRouteLookupReply) 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.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
- buf[pos] = uint8(m.Route.Prefix.Address.Af)
- pos += 1
- // 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 fib_types.FibPath
- if j2 < len(m.Route.Paths) {
- v2 = m.Route.Paths[j2]
- }
- // 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 fib_types.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
- }
- }
- return buf, nil
-}
-func (m *IPRouteLookupReply) 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.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 = fib_types.AddressFamily(tmp[pos])
- pos += 1
- // 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([]fib_types.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 = fib_types.FibPathType(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Flags
- m.Route.Paths[j2].Flags = fib_types.FibPathFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[3] m.Route.Paths[j2].Proto
- m.Route.Paths[j2].Proto = fib_types.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 nil
-}
-
-// IPSourceAndPortRangeCheckAddDel represents VPP binary API 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 fib_types.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"`
- VrfID uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
-}
-
-func (m *IPSourceAndPortRangeCheckAddDel) Reset() { *m = IPSourceAndPortRangeCheckAddDel{} }
-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 (m *IPSourceAndPortRangeCheckAddDel) 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 += 1
- // 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
- 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
- buf[pos] = uint8(m.Prefix.Address.Af)
- pos += 1
- // 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
- 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
- }
- // 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 = fib_types.AddressFamily(tmp[pos])
- pos += 1
- // 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
- 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
- }
- // 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
- }
- // field[1] m.VrfID
- m.VrfID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// IPSourceAndPortRangeCheckAddDelReply represents VPP binary API message 'ip_source_and_port_range_check_add_del_reply'.
-type IPSourceAndPortRangeCheckAddDelReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *IPSourceAndPortRangeCheckAddDelReply) Reset() { *m = IPSourceAndPortRangeCheckAddDelReply{} }
-func (*IPSourceAndPortRangeCheckAddDelReply) GetMessageName() string {
- return "ip_source_and_port_range_check_add_del_reply"
-}
-func (*IPSourceAndPortRangeCheckAddDelReply) GetCrcString() string { return "e8d4e804" }
-func (*IPSourceAndPortRangeCheckAddDelReply) GetMessageType() api.MessageType {
- return api.ReplyMessage
-}
-
-func (m *IPSourceAndPortRangeCheckAddDelReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- 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
- return nil
-}
-
-// IPSourceAndPortRangeCheckInterfaceAddDel represents VPP binary API 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 interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- TCPInVrfID uint32 `binapi:"u32,name=tcp_in_vrf_id" json:"tcp_in_vrf_id,omitempty"`
- TCPOutVrfID uint32 `binapi:"u32,name=tcp_out_vrf_id" json:"tcp_out_vrf_id,omitempty"`
- UDPInVrfID uint32 `binapi:"u32,name=udp_in_vrf_id" json:"udp_in_vrf_id,omitempty"`
- UDPOutVrfID uint32 `binapi:"u32,name=udp_out_vrf_id" json:"udp_out_vrf_id,omitempty"`
-}
-
-func (m *IPSourceAndPortRangeCheckInterfaceAddDel) Reset() {
- *m = IPSourceAndPortRangeCheckInterfaceAddDel{}
-}
-func (*IPSourceAndPortRangeCheckInterfaceAddDel) GetMessageName() string {
- return "ip_source_and_port_range_check_interface_add_del"
-}
-func (*IPSourceAndPortRangeCheckInterfaceAddDel) GetCrcString() string { return "e1ba8987" }
-func (*IPSourceAndPortRangeCheckInterfaceAddDel) GetMessageType() api.MessageType {
- return api.RequestMessage
-}
-
-func (m *IPSourceAndPortRangeCheckInterfaceAddDel) 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
- 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 = interface_types.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
- return nil
-}
-
-// IPSourceAndPortRangeCheckInterfaceAddDelReply represents VPP binary API message 'ip_source_and_port_range_check_interface_add_del_reply'.
-type IPSourceAndPortRangeCheckInterfaceAddDelReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) Reset() {
- *m = IPSourceAndPortRangeCheckInterfaceAddDelReply{}
-}
-func (*IPSourceAndPortRangeCheckInterfaceAddDelReply) GetMessageName() string {
- return "ip_source_and_port_range_check_interface_add_del_reply"
-}
-func (*IPSourceAndPortRangeCheckInterfaceAddDelReply) GetCrcString() string { return "e8d4e804" }
-func (*IPSourceAndPortRangeCheckInterfaceAddDelReply) GetMessageType() api.MessageType {
- return api.ReplyMessage
-}
-
-func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- 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
- return nil
-}
-
-// IPTableAddDel represents VPP binary API 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) 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
- 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
- }
- return nil
-}
-
-// IPTableAddDelReply represents VPP binary API 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) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- 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
- return nil
-}
-
-// IPTableDetails represents VPP binary API 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) 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
- 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
- }
- return nil
-}
-
-// IPTableDump represents VPP binary API 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) 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
- }
- return buf, nil
-}
-func (m *IPTableDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- return nil
-}
-
-// IPTableFlush represents VPP binary API 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) 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
- 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
- }
- return nil
-}
-
-// IPTableFlushReply represents VPP binary API 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) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- 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
- return nil
-}
-
-// IPTableReplaceBegin represents VPP binary API 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) 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
- 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
- }
- return nil
-}
-
-// IPTableReplaceBeginReply represents VPP binary API 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) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- 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
- return nil
-}
-
-// IPTableReplaceEnd represents VPP binary API 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) 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
- 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
- }
- return nil
-}
-
-// IPTableReplaceEndReply represents VPP binary API 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) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- 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
- return nil
-}
-
-// IPUnnumberedDetails represents VPP binary API message 'ip_unnumbered_details'.
-type IPUnnumberedDetails struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- IPSwIfIndex interface_types.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) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.IPSwIfIndex
- size += 4
- 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 = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IPSwIfIndex
- m.IPSwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// IPUnnumberedDump represents VPP binary API message 'ip_unnumbered_dump'.
-type IPUnnumberedDump struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4.294967295e+09" 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) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- 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 = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// MfibSignalDetails represents VPP binary API message 'mfib_signal_details'.
-type MfibSignalDetails struct {
- SwIfIndex interface_types.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 fib_types.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"`
-}
-
-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 {
- 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 += 1
- // 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
- 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
- buf[pos] = uint8(m.Prefix.Af)
- pos += 1
- // 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 = interface_types.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 = fib_types.AddressFamily(tmp[pos])
- pos += 1
- // 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
- }
- return nil
-}
-
-// MfibSignalDump represents VPP binary API 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) 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
- }
- return buf, nil
-}
-func (m *MfibSignalDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- return nil
-}
-
-// SetIPFlowHash represents VPP binary API 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"`
- Src bool `binapi:"bool,name=src" json:"src,omitempty"`
- Dst bool `binapi:"bool,name=dst" json:"dst,omitempty"`
- Sport bool `binapi:"bool,name=sport" json:"sport,omitempty"`
- Dport bool `binapi:"bool,name=dport" json:"dport,omitempty"`
- Proto bool `binapi:"bool,name=proto" json:"proto,omitempty"`
- Reverse bool `binapi:"bool,name=reverse" json:"reverse,omitempty"`
- 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) 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
- 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
- return nil
-}
-
-// SetIPFlowHashReply represents VPP binary API 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) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- 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
- return nil
-}
-
-// SwInterfaceIP6EnableDisable represents VPP binary API message 'sw_interface_ip6_enable_disable'.
-type SwInterfaceIP6EnableDisable struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
-}
-
-func (m *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 {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Enable
- size += 1
- 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 = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Enable
- m.Enable = tmp[pos] != 0
- pos += 1
- return nil
-}
-
-// SwInterfaceIP6EnableDisableReply represents VPP binary API message 'sw_interface_ip6_enable_disable_reply'.
-type SwInterfaceIP6EnableDisableReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceIP6EnableDisableReply) Reset() { *m = SwInterfaceIP6EnableDisableReply{} }
-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 (m *SwInterfaceIP6EnableDisableReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- 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
- return nil
-}
-
-// SwInterfaceIP6SetLinkLocalAddress represents VPP binary API message 'sw_interface_ip6_set_link_local_address'.
-type SwInterfaceIP6SetLinkLocalAddress struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- IP fib_types.IP6Address `binapi:"ip6_address,name=ip" json:"ip,omitempty"`
-}
-
-func (m *SwInterfaceIP6SetLinkLocalAddress) Reset() { *m = SwInterfaceIP6SetLinkLocalAddress{} }
-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 (m *SwInterfaceIP6SetLinkLocalAddress) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.IP
- size += 16
- 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 = interface_types.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
- }
- return nil
-}
-
-// SwInterfaceIP6SetLinkLocalAddressReply represents VPP binary API message 'sw_interface_ip6_set_link_local_address_reply'.
-type SwInterfaceIP6SetLinkLocalAddressReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SwInterfaceIP6SetLinkLocalAddressReply) Reset() {
- *m = SwInterfaceIP6SetLinkLocalAddressReply{}
-}
-func (*SwInterfaceIP6SetLinkLocalAddressReply) GetMessageName() string {
- return "sw_interface_ip6_set_link_local_address_reply"
-}
-func (*SwInterfaceIP6SetLinkLocalAddressReply) GetCrcString() string { return "e8d4e804" }
-func (*SwInterfaceIP6SetLinkLocalAddressReply) GetMessageType() api.MessageType {
- return api.ReplyMessage
-}
-
-func (m *SwInterfaceIP6SetLinkLocalAddressReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- 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
- 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((*IPRouteLookup)(nil), "ip.IPRouteLookup")
- api.RegisterMessage((*IPRouteLookupReply)(nil), "ip.IPRouteLookupReply")
- 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((*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")
-}
-
-// Messages returns list of all messages in this module.
-func AllMessages() []api.Message {
- return []api.Message{
- (*IoamDisable)(nil),
- (*IoamDisableReply)(nil),
- (*IoamEnable)(nil),
- (*IoamEnableReply)(nil),
- (*IPAddressDetails)(nil),
- (*IPAddressDump)(nil),
- (*IPContainerProxyAddDel)(nil),
- (*IPContainerProxyAddDelReply)(nil),
- (*IPContainerProxyDetails)(nil),
- (*IPContainerProxyDump)(nil),
- (*IPDetails)(nil),
- (*IPDump)(nil),
- (*IPMrouteAddDel)(nil),
- (*IPMrouteAddDelReply)(nil),
- (*IPMrouteDetails)(nil),
- (*IPMrouteDump)(nil),
- (*IPMtableDetails)(nil),
- (*IPMtableDump)(nil),
- (*IPPuntPolice)(nil),
- (*IPPuntPoliceReply)(nil),
- (*IPPuntRedirect)(nil),
- (*IPPuntRedirectDetails)(nil),
- (*IPPuntRedirectDump)(nil),
- (*IPPuntRedirectReply)(nil),
- (*IPReassemblyEnableDisable)(nil),
- (*IPReassemblyEnableDisableReply)(nil),
- (*IPReassemblyGet)(nil),
- (*IPReassemblyGetReply)(nil),
- (*IPReassemblySet)(nil),
- (*IPReassemblySetReply)(nil),
- (*IPRouteAddDel)(nil),
- (*IPRouteAddDelReply)(nil),
- (*IPRouteDetails)(nil),
- (*IPRouteDump)(nil),
- (*IPRouteLookup)(nil),
- (*IPRouteLookupReply)(nil),
- (*IPSourceAndPortRangeCheckAddDel)(nil),
- (*IPSourceAndPortRangeCheckAddDelReply)(nil),
- (*IPSourceAndPortRangeCheckInterfaceAddDel)(nil),
- (*IPSourceAndPortRangeCheckInterfaceAddDelReply)(nil),
- (*IPTableAddDel)(nil),
- (*IPTableAddDelReply)(nil),
- (*IPTableDetails)(nil),
- (*IPTableDump)(nil),
- (*IPTableFlush)(nil),
- (*IPTableFlushReply)(nil),
- (*IPTableReplaceBegin)(nil),
- (*IPTableReplaceBeginReply)(nil),
- (*IPTableReplaceEnd)(nil),
- (*IPTableReplaceEndReply)(nil),
- (*IPUnnumberedDetails)(nil),
- (*IPUnnumberedDump)(nil),
- (*MfibSignalDetails)(nil),
- (*MfibSignalDump)(nil),
- (*SetIPFlowHash)(nil),
- (*SetIPFlowHashReply)(nil),
- (*SwInterfaceIP6EnableDisable)(nil),
- (*SwInterfaceIP6EnableDisableReply)(nil),
- (*SwInterfaceIP6SetLinkLocalAddress)(nil),
- (*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 _ = strings.Contains
-var _ = struc.Pack
-var _ = binary.BigEndian
-var _ = math.Float32bits
-var _ = net.ParseIP
-var _ = fmt.Errorf
diff --git a/examples/binapi/ip/ip_rpc.ba.go b/examples/binapi/ip/ip_rpc.ba.go
deleted file mode 100644
index d1bbd08..0000000
--- a/examples/binapi/ip/ip_rpc.ba.go
+++ /dev/null
@@ -1,497 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-
-package ip
-
-import (
- "context"
- "io"
-
- api "git.fd.io/govpp.git/api"
-)
-
-// RPCService represents RPC service API for ip module.
-type RPCService interface {
- DumpIPAddress(ctx context.Context, in *IPAddressDump) (RPCService_DumpIPAddressClient, error)
- DumpIPContainerProxy(ctx context.Context, in *IPContainerProxyDump) (RPCService_DumpIPContainerProxyClient, error)
- DumpIP(ctx context.Context, in *IPDump) (RPCService_DumpIPClient, error)
- DumpIPMroute(ctx context.Context, in *IPMrouteDump) (RPCService_DumpIPMrouteClient, error)
- DumpIPMtable(ctx context.Context, in *IPMtableDump) (RPCService_DumpIPMtableClient, error)
- DumpIPPuntRedirect(ctx context.Context, in *IPPuntRedirectDump) (RPCService_DumpIPPuntRedirectClient, error)
- DumpIPRoute(ctx context.Context, in *IPRouteDump) (RPCService_DumpIPRouteClient, error)
- DumpIPTable(ctx context.Context, in *IPTableDump) (RPCService_DumpIPTableClient, error)
- DumpIPUnnumbered(ctx context.Context, in *IPUnnumberedDump) (RPCService_DumpIPUnnumberedClient, error)
- DumpMfibSignal(ctx context.Context, in *MfibSignalDump) (RPCService_DumpMfibSignalClient, error)
- IoamDisable(ctx context.Context, in *IoamDisable) (*IoamDisableReply, error)
- IoamEnable(ctx context.Context, in *IoamEnable) (*IoamEnableReply, error)
- IPContainerProxyAddDel(ctx context.Context, in *IPContainerProxyAddDel) (*IPContainerProxyAddDelReply, error)
- IPMrouteAddDel(ctx context.Context, in *IPMrouteAddDel) (*IPMrouteAddDelReply, error)
- IPPuntPolice(ctx context.Context, in *IPPuntPolice) (*IPPuntPoliceReply, error)
- IPPuntRedirect(ctx context.Context, in *IPPuntRedirect) (*IPPuntRedirectReply, error)
- IPReassemblyEnableDisable(ctx context.Context, in *IPReassemblyEnableDisable) (*IPReassemblyEnableDisableReply, error)
- IPReassemblyGet(ctx context.Context, in *IPReassemblyGet) (*IPReassemblyGetReply, error)
- IPReassemblySet(ctx context.Context, in *IPReassemblySet) (*IPReassemblySetReply, error)
- IPRouteAddDel(ctx context.Context, in *IPRouteAddDel) (*IPRouteAddDelReply, error)
- IPRouteLookup(ctx context.Context, in *IPRouteLookup) (*IPRouteLookupReply, error)
- IPSourceAndPortRangeCheckAddDel(ctx context.Context, in *IPSourceAndPortRangeCheckAddDel) (*IPSourceAndPortRangeCheckAddDelReply, error)
- IPSourceAndPortRangeCheckInterfaceAddDel(ctx context.Context, in *IPSourceAndPortRangeCheckInterfaceAddDel) (*IPSourceAndPortRangeCheckInterfaceAddDelReply, error)
- IPTableAddDel(ctx context.Context, in *IPTableAddDel) (*IPTableAddDelReply, error)
- IPTableFlush(ctx context.Context, in *IPTableFlush) (*IPTableFlushReply, error)
- IPTableReplaceBegin(ctx context.Context, in *IPTableReplaceBegin) (*IPTableReplaceBeginReply, error)
- IPTableReplaceEnd(ctx context.Context, in *IPTableReplaceEnd) (*IPTableReplaceEndReply, error)
- SetIPFlowHash(ctx context.Context, in *SetIPFlowHash) (*SetIPFlowHashReply, error)
- SwInterfaceIP6EnableDisable(ctx context.Context, in *SwInterfaceIP6EnableDisable) (*SwInterfaceIP6EnableDisableReply, error)
- SwInterfaceIP6SetLinkLocalAddress(ctx context.Context, in *SwInterfaceIP6SetLinkLocalAddress) (*SwInterfaceIP6SetLinkLocalAddressReply, error)
-}
-
-type serviceClient struct {
- ch api.Channel
-}
-
-func NewServiceClient(ch api.Channel) RPCService {
- return &serviceClient{ch}
-}
-
-func (c *serviceClient) DumpIPAddress(ctx context.Context, in *IPAddressDump) (RPCService_DumpIPAddressClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpIPAddressClient{stream}
- return x, nil
-}
-
-type RPCService_DumpIPAddressClient interface {
- Recv() (*IPAddressDetails, error)
-}
-
-type serviceClient_DumpIPAddressClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpIPAddressClient) Recv() (*IPAddressDetails, error) {
- m := new(IPAddressDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) DumpIPContainerProxy(ctx context.Context, in *IPContainerProxyDump) (RPCService_DumpIPContainerProxyClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpIPContainerProxyClient{stream}
- return x, nil
-}
-
-type RPCService_DumpIPContainerProxyClient interface {
- Recv() (*IPContainerProxyDetails, error)
-}
-
-type serviceClient_DumpIPContainerProxyClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpIPContainerProxyClient) Recv() (*IPContainerProxyDetails, error) {
- m := new(IPContainerProxyDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) DumpIP(ctx context.Context, in *IPDump) (RPCService_DumpIPClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpIPClient{stream}
- return x, nil
-}
-
-type RPCService_DumpIPClient interface {
- Recv() (*IPDetails, error)
-}
-
-type serviceClient_DumpIPClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpIPClient) Recv() (*IPDetails, error) {
- m := new(IPDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) DumpIPMroute(ctx context.Context, in *IPMrouteDump) (RPCService_DumpIPMrouteClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpIPMrouteClient{stream}
- return x, nil
-}
-
-type RPCService_DumpIPMrouteClient interface {
- Recv() (*IPMrouteDetails, error)
-}
-
-type serviceClient_DumpIPMrouteClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpIPMrouteClient) Recv() (*IPMrouteDetails, error) {
- m := new(IPMrouteDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) DumpIPMtable(ctx context.Context, in *IPMtableDump) (RPCService_DumpIPMtableClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpIPMtableClient{stream}
- return x, nil
-}
-
-type RPCService_DumpIPMtableClient interface {
- Recv() (*IPMtableDetails, error)
-}
-
-type serviceClient_DumpIPMtableClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpIPMtableClient) Recv() (*IPMtableDetails, error) {
- m := new(IPMtableDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) DumpIPPuntRedirect(ctx context.Context, in *IPPuntRedirectDump) (RPCService_DumpIPPuntRedirectClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpIPPuntRedirectClient{stream}
- return x, nil
-}
-
-type RPCService_DumpIPPuntRedirectClient interface {
- Recv() (*IPPuntRedirectDetails, error)
-}
-
-type serviceClient_DumpIPPuntRedirectClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpIPPuntRedirectClient) Recv() (*IPPuntRedirectDetails, error) {
- m := new(IPPuntRedirectDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) DumpIPRoute(ctx context.Context, in *IPRouteDump) (RPCService_DumpIPRouteClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpIPRouteClient{stream}
- return x, nil
-}
-
-type RPCService_DumpIPRouteClient interface {
- Recv() (*IPRouteDetails, error)
-}
-
-type serviceClient_DumpIPRouteClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpIPRouteClient) Recv() (*IPRouteDetails, error) {
- m := new(IPRouteDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) DumpIPTable(ctx context.Context, in *IPTableDump) (RPCService_DumpIPTableClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpIPTableClient{stream}
- return x, nil
-}
-
-type RPCService_DumpIPTableClient interface {
- Recv() (*IPTableDetails, error)
-}
-
-type serviceClient_DumpIPTableClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpIPTableClient) Recv() (*IPTableDetails, error) {
- m := new(IPTableDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) DumpIPUnnumbered(ctx context.Context, in *IPUnnumberedDump) (RPCService_DumpIPUnnumberedClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpIPUnnumberedClient{stream}
- return x, nil
-}
-
-type RPCService_DumpIPUnnumberedClient interface {
- Recv() (*IPUnnumberedDetails, error)
-}
-
-type serviceClient_DumpIPUnnumberedClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpIPUnnumberedClient) Recv() (*IPUnnumberedDetails, error) {
- m := new(IPUnnumberedDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) DumpMfibSignal(ctx context.Context, in *MfibSignalDump) (RPCService_DumpMfibSignalClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpMfibSignalClient{stream}
- return x, nil
-}
-
-type RPCService_DumpMfibSignalClient interface {
- Recv() (*MfibSignalDetails, error)
-}
-
-type serviceClient_DumpMfibSignalClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpMfibSignalClient) Recv() (*MfibSignalDetails, error) {
- m := new(MfibSignalDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) IoamDisable(ctx context.Context, in *IoamDisable) (*IoamDisableReply, error) {
- out := new(IoamDisableReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) IoamEnable(ctx context.Context, in *IoamEnable) (*IoamEnableReply, error) {
- out := new(IoamEnableReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) IPContainerProxyAddDel(ctx context.Context, in *IPContainerProxyAddDel) (*IPContainerProxyAddDelReply, error) {
- out := new(IPContainerProxyAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) IPMrouteAddDel(ctx context.Context, in *IPMrouteAddDel) (*IPMrouteAddDelReply, error) {
- out := new(IPMrouteAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) IPPuntPolice(ctx context.Context, in *IPPuntPolice) (*IPPuntPoliceReply, error) {
- out := new(IPPuntPoliceReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) IPPuntRedirect(ctx context.Context, in *IPPuntRedirect) (*IPPuntRedirectReply, error) {
- out := new(IPPuntRedirectReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) IPReassemblyEnableDisable(ctx context.Context, in *IPReassemblyEnableDisable) (*IPReassemblyEnableDisableReply, error) {
- out := new(IPReassemblyEnableDisableReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) IPReassemblyGet(ctx context.Context, in *IPReassemblyGet) (*IPReassemblyGetReply, error) {
- out := new(IPReassemblyGetReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) IPReassemblySet(ctx context.Context, in *IPReassemblySet) (*IPReassemblySetReply, error) {
- out := new(IPReassemblySetReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) IPRouteAddDel(ctx context.Context, in *IPRouteAddDel) (*IPRouteAddDelReply, error) {
- out := new(IPRouteAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) IPRouteLookup(ctx context.Context, in *IPRouteLookup) (*IPRouteLookupReply, error) {
- out := new(IPRouteLookupReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) IPSourceAndPortRangeCheckAddDel(ctx context.Context, in *IPSourceAndPortRangeCheckAddDel) (*IPSourceAndPortRangeCheckAddDelReply, error) {
- out := new(IPSourceAndPortRangeCheckAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) IPSourceAndPortRangeCheckInterfaceAddDel(ctx context.Context, in *IPSourceAndPortRangeCheckInterfaceAddDel) (*IPSourceAndPortRangeCheckInterfaceAddDelReply, error) {
- out := new(IPSourceAndPortRangeCheckInterfaceAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) IPTableAddDel(ctx context.Context, in *IPTableAddDel) (*IPTableAddDelReply, error) {
- out := new(IPTableAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) IPTableFlush(ctx context.Context, in *IPTableFlush) (*IPTableFlushReply, error) {
- out := new(IPTableFlushReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) IPTableReplaceBegin(ctx context.Context, in *IPTableReplaceBegin) (*IPTableReplaceBeginReply, error) {
- out := new(IPTableReplaceBeginReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) IPTableReplaceEnd(ctx context.Context, in *IPTableReplaceEnd) (*IPTableReplaceEndReply, error) {
- out := new(IPTableReplaceEndReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SetIPFlowHash(ctx context.Context, in *SetIPFlowHash) (*SetIPFlowHashReply, error) {
- out := new(SetIPFlowHashReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SwInterfaceIP6EnableDisable(ctx context.Context, in *SwInterfaceIP6EnableDisable) (*SwInterfaceIP6EnableDisableReply, error) {
- out := new(SwInterfaceIP6EnableDisableReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SwInterfaceIP6SetLinkLocalAddress(ctx context.Context, in *SwInterfaceIP6SetLinkLocalAddress) (*SwInterfaceIP6SetLinkLocalAddressReply, error) {
- out := new(SwInterfaceIP6SetLinkLocalAddressReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = context.Background
-var _ = io.Copy
diff --git a/examples/binapi/ip_types/ip_types.ba.go b/examples/binapi/ip_types/ip_types.ba.go
deleted file mode 100644
index fc7fa87..0000000
--- a/examples/binapi/ip_types/ip_types.ba.go
+++ /dev/null
@@ -1,436 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-// versions:
-// binapi-generator: v0.4.0-dev
-// VPP: 20.05-release
-// source: /usr/share/vpp/api/core/ip_types.api.json
-
-/*
-Package ip_types contains generated code for VPP API file ip_types.api (3.0.0).
-
-It consists of:
- 5 aliases
- 4 enums
- 6 types
- 1 union
-*/
-package ip_types
-
-import (
- "bytes"
- "context"
- "encoding/binary"
- "fmt"
- "io"
- "math"
- "net"
- "strconv"
- "strings"
-
- api "git.fd.io/govpp.git/api"
- codec "git.fd.io/govpp.git/codec"
- struc "github.com/lunixbochs/struc"
-)
-
-// 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 (
- // ModuleName is the name of this module.
- ModuleName = "ip_types"
- // APIVersion is the API version of this module.
- APIVersion = "3.0.0"
- // VersionCrc is the CRC of this module.
- VersionCrc = 0x9cb1c2e2
-)
-
-// AddressFamily represents VPP binary API enum 'address_family'.
-type AddressFamily uint8
-
-const (
- ADDRESS_IP4 AddressFamily = 0
- ADDRESS_IP6 AddressFamily = 1
-)
-
-var (
- AddressFamily_name = map[uint8]string{
- 0: "ADDRESS_IP4",
- 1: "ADDRESS_IP6",
- }
- AddressFamily_value = map[string]uint8{
- "ADDRESS_IP4": 0,
- "ADDRESS_IP6": 1,
- }
-)
-
-func (x AddressFamily) String() string {
- s, ok := AddressFamily_name[uint8(x)]
- if ok {
- return s
- }
- return "AddressFamily(" + strconv.Itoa(int(x)) + ")"
-}
-
-// IPDscp represents VPP binary API enum 'ip_dscp'.
-type IPDscp uint8
-
-const (
- IP_API_DSCP_CS0 IPDscp = 0
- IP_API_DSCP_CS1 IPDscp = 8
- IP_API_DSCP_AF11 IPDscp = 10
- IP_API_DSCP_AF12 IPDscp = 12
- IP_API_DSCP_AF13 IPDscp = 14
- IP_API_DSCP_CS2 IPDscp = 16
- IP_API_DSCP_AF21 IPDscp = 18
- IP_API_DSCP_AF22 IPDscp = 20
- IP_API_DSCP_AF23 IPDscp = 22
- IP_API_DSCP_CS3 IPDscp = 24
- IP_API_DSCP_AF31 IPDscp = 26
- IP_API_DSCP_AF32 IPDscp = 28
- IP_API_DSCP_AF33 IPDscp = 30
- IP_API_DSCP_CS4 IPDscp = 32
- IP_API_DSCP_AF41 IPDscp = 34
- IP_API_DSCP_AF42 IPDscp = 36
- IP_API_DSCP_AF43 IPDscp = 38
- IP_API_DSCP_CS5 IPDscp = 40
- IP_API_DSCP_EF IPDscp = 46
- IP_API_DSCP_CS6 IPDscp = 48
- IP_API_DSCP_CS7 IPDscp = 50
-)
-
-var (
- IPDscp_name = map[uint8]string{
- 0: "IP_API_DSCP_CS0",
- 8: "IP_API_DSCP_CS1",
- 10: "IP_API_DSCP_AF11",
- 12: "IP_API_DSCP_AF12",
- 14: "IP_API_DSCP_AF13",
- 16: "IP_API_DSCP_CS2",
- 18: "IP_API_DSCP_AF21",
- 20: "IP_API_DSCP_AF22",
- 22: "IP_API_DSCP_AF23",
- 24: "IP_API_DSCP_CS3",
- 26: "IP_API_DSCP_AF31",
- 28: "IP_API_DSCP_AF32",
- 30: "IP_API_DSCP_AF33",
- 32: "IP_API_DSCP_CS4",
- 34: "IP_API_DSCP_AF41",
- 36: "IP_API_DSCP_AF42",
- 38: "IP_API_DSCP_AF43",
- 40: "IP_API_DSCP_CS5",
- 46: "IP_API_DSCP_EF",
- 48: "IP_API_DSCP_CS6",
- 50: "IP_API_DSCP_CS7",
- }
- IPDscp_value = map[string]uint8{
- "IP_API_DSCP_CS0": 0,
- "IP_API_DSCP_CS1": 8,
- "IP_API_DSCP_AF11": 10,
- "IP_API_DSCP_AF12": 12,
- "IP_API_DSCP_AF13": 14,
- "IP_API_DSCP_CS2": 16,
- "IP_API_DSCP_AF21": 18,
- "IP_API_DSCP_AF22": 20,
- "IP_API_DSCP_AF23": 22,
- "IP_API_DSCP_CS3": 24,
- "IP_API_DSCP_AF31": 26,
- "IP_API_DSCP_AF32": 28,
- "IP_API_DSCP_AF33": 30,
- "IP_API_DSCP_CS4": 32,
- "IP_API_DSCP_AF41": 34,
- "IP_API_DSCP_AF42": 36,
- "IP_API_DSCP_AF43": 38,
- "IP_API_DSCP_CS5": 40,
- "IP_API_DSCP_EF": 46,
- "IP_API_DSCP_CS6": 48,
- "IP_API_DSCP_CS7": 50,
- }
-)
-
-func (x IPDscp) String() string {
- s, ok := IPDscp_name[uint8(x)]
- if ok {
- return s
- }
- return "IPDscp(" + strconv.Itoa(int(x)) + ")"
-}
-
-// IPEcn represents VPP binary API enum 'ip_ecn'.
-type IPEcn uint8
-
-const (
- IP_API_ECN_NONE IPEcn = 0
- IP_API_ECN_ECT0 IPEcn = 1
- IP_API_ECN_ECT1 IPEcn = 2
- IP_API_ECN_CE IPEcn = 3
-)
-
-var (
- IPEcn_name = map[uint8]string{
- 0: "IP_API_ECN_NONE",
- 1: "IP_API_ECN_ECT0",
- 2: "IP_API_ECN_ECT1",
- 3: "IP_API_ECN_CE",
- }
- IPEcn_value = map[string]uint8{
- "IP_API_ECN_NONE": 0,
- "IP_API_ECN_ECT0": 1,
- "IP_API_ECN_ECT1": 2,
- "IP_API_ECN_CE": 3,
- }
-)
-
-func (x IPEcn) String() string {
- s, ok := IPEcn_name[uint8(x)]
- if ok {
- return s
- }
- return "IPEcn(" + strconv.Itoa(int(x)) + ")"
-}
-
-// IPProto represents VPP binary API enum 'ip_proto'.
-type IPProto uint8
-
-const (
- IP_API_PROTO_HOPOPT IPProto = 0
- IP_API_PROTO_ICMP IPProto = 1
- IP_API_PROTO_IGMP IPProto = 2
- IP_API_PROTO_TCP IPProto = 6
- IP_API_PROTO_UDP IPProto = 17
- IP_API_PROTO_GRE IPProto = 47
- IP_API_PROTO_ESP IPProto = 50
- IP_API_PROTO_AH IPProto = 51
- IP_API_PROTO_ICMP6 IPProto = 58
- IP_API_PROTO_EIGRP IPProto = 88
- IP_API_PROTO_OSPF IPProto = 89
- IP_API_PROTO_SCTP IPProto = 132
- IP_API_PROTO_RESERVED IPProto = 255
-)
-
-var (
- IPProto_name = map[uint8]string{
- 0: "IP_API_PROTO_HOPOPT",
- 1: "IP_API_PROTO_ICMP",
- 2: "IP_API_PROTO_IGMP",
- 6: "IP_API_PROTO_TCP",
- 17: "IP_API_PROTO_UDP",
- 47: "IP_API_PROTO_GRE",
- 50: "IP_API_PROTO_ESP",
- 51: "IP_API_PROTO_AH",
- 58: "IP_API_PROTO_ICMP6",
- 88: "IP_API_PROTO_EIGRP",
- 89: "IP_API_PROTO_OSPF",
- 132: "IP_API_PROTO_SCTP",
- 255: "IP_API_PROTO_RESERVED",
- }
- IPProto_value = map[string]uint8{
- "IP_API_PROTO_HOPOPT": 0,
- "IP_API_PROTO_ICMP": 1,
- "IP_API_PROTO_IGMP": 2,
- "IP_API_PROTO_TCP": 6,
- "IP_API_PROTO_UDP": 17,
- "IP_API_PROTO_GRE": 47,
- "IP_API_PROTO_ESP": 50,
- "IP_API_PROTO_AH": 51,
- "IP_API_PROTO_ICMP6": 58,
- "IP_API_PROTO_EIGRP": 88,
- "IP_API_PROTO_OSPF": 89,
- "IP_API_PROTO_SCTP": 132,
- "IP_API_PROTO_RESERVED": 255,
- }
-)
-
-func (x IPProto) String() string {
- s, ok := IPProto_name[uint8(x)]
- if ok {
- return s
- }
- return "IPProto(" + strconv.Itoa(int(x)) + ")"
-}
-
-// AddressWithPrefix represents VPP binary API alias 'address_with_prefix'.
-type AddressWithPrefix Prefix
-
-// IP4Address represents VPP binary API alias 'ip4_address'.
-type IP4Address [4]uint8
-
-// IP4AddressWithPrefix represents VPP binary API alias 'ip4_address_with_prefix'.
-type IP4AddressWithPrefix IP4Prefix
-
-// IP6Address represents VPP binary API alias 'ip6_address'.
-type IP6Address [16]uint8
-
-// IP6AddressWithPrefix represents VPP binary API alias 'ip6_address_with_prefix'.
-type IP6AddressWithPrefix IP6Prefix
-
-// Address represents VPP binary API 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(ip string) (Address, error) {
- var address Address
- netIP := net.ParseIP(ip)
- if netIP == nil {
- return address, fmt.Errorf("invalid address: %s", ip)
- }
- if ip4 := netIP.To4(); ip4 == nil {
- address.Af = ADDRESS_IP6
- var ip6addr IP6Address
- copy(ip6addr[:], netIP.To16())
- address.Un.SetIP6(ip6addr)
- } else {
- address.Af = ADDRESS_IP4
- var ip4addr IP4Address
- copy(ip4addr[:], netIP.To4())
- address.Un.SetIP4(ip4addr)
- }
- return address, nil
-}
-
-func (a *Address) ToString() string {
- var ip string
- if a.Af == ADDRESS_IP6 {
- ip6Address := a.Un.GetIP6()
- ip = net.IP(ip6Address[:]).To16().String()
- } else {
- ip4Address := a.Un.GetIP4()
- ip = net.IP(ip4Address[:]).To4().String()
- }
- return ip
-}
-
-// IP4Prefix represents VPP binary API 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" }
-
-// IP6Prefix represents VPP binary API 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" }
-
-// Mprefix represents VPP binary API 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"`
- GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
- 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'.
-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: %v", 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: %v", 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: %v", ip, err)
- }
- }
- return prefix, nil
-}
-
-func (p *Prefix) ToString() string {
- ip := p.Address.ToString()
- return ip + "/" + strconv.Itoa(int(p.Len))
-}
-
-// PrefixMatcher represents VPP binary API 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" }
-
-// AddressUnion represents VPP binary API union 'address_union'.
-type AddressUnion struct {
- 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())
-}
-func (u *AddressUnion) GetIP4() (a IP4Address) {
- var b = bytes.NewReader(u.XXX_UnionData[:])
- struc.Unpack(b, &a)
- return
-}
-
-func AddressUnionIP6(a IP6Address) (u AddressUnion) {
- u.SetIP6(a)
- 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())
-}
-func (u *AddressUnion) GetIP6() (a IP6Address) {
- var b = bytes.NewReader(u.XXX_UnionData[:])
- struc.Unpack(b, &a)
- return
-}
-
-// 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 _ = strings.Contains
-var _ = struc.Pack
-var _ = binary.BigEndian
-var _ = math.Float32bits
-var _ = net.ParseIP
-var _ = fmt.Errorf
diff --git a/examples/binapi/mactime/mactime.ba.go b/examples/binapi/mactime/mactime.ba.go
deleted file mode 100644
index 7b9a0b2..0000000
--- a/examples/binapi/mactime/mactime.ba.go
+++ /dev/null
@@ -1,689 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-// versions:
-// binapi-generator: v0.4.0-dev
-// VPP: 20.05-release
-// source: /usr/share/vpp/api/plugins/mactime.api.json
-
-/*
-Package mactime contains generated code for VPP API file mactime.api (2.0.0).
-
-It consists of:
- 2 aliases
- 6 enums
- 7 messages
- 2 types
-*/
-package mactime
-
-import (
- "bytes"
- "context"
- "encoding/binary"
- "fmt"
- "io"
- "math"
- "net"
- "strconv"
- "strings"
-
- api "git.fd.io/govpp.git/api"
- codec "git.fd.io/govpp.git/codec"
- struc "github.com/lunixbochs/struc"
-
- interface_types "git.fd.io/govpp.git/examples/binapi/interface_types"
-)
-
-// 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 (
- // ModuleName is the name of this module.
- ModuleName = "mactime"
- // APIVersion is the API version of this module.
- APIVersion = "2.0.0"
- // VersionCrc is the CRC of this module.
- VersionCrc = 0x9283d3e
-)
-
-// MacAddress represents VPP binary API alias 'mac_address'.
-type MacAddress [6]uint8
-
-func ParseMAC(mac string) (parsed MacAddress, err error) {
- var hw net.HardwareAddr
- if hw, err = net.ParseMAC(mac); err != nil {
- return
- }
- copy(parsed[:], hw[:])
- return
-}
-
-func (m *MacAddress) ToString() string {
- return net.HardwareAddr(m[:]).String()
-}
-
-// MactimeTimeRange represents VPP binary API type 'mactime_time_range'.
-type MactimeTimeRange struct {
- Start float64 `binapi:"f64,name=start" json:"start,omitempty"`
- End float64 `binapi:"f64,name=end" json:"end,omitempty"`
-}
-
-func (*MactimeTimeRange) GetTypeName() string { return "mactime_time_range" }
-
-// TimeRange represents VPP binary API type 'time_range'.
-type TimeRange struct {
- Start float64 `binapi:"f64,name=start" json:"start,omitempty"`
- End float64 `binapi:"f64,name=end" json:"end,omitempty"`
-}
-
-func (*TimeRange) GetTypeName() string { return "time_range" }
-
-// MactimeAddDelRange represents VPP binary API message 'mactime_add_del_range'.
-type MactimeAddDelRange struct {
- IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
- Drop bool `binapi:"bool,name=drop" json:"drop,omitempty"`
- Allow bool `binapi:"bool,name=allow" json:"allow,omitempty"`
- AllowQuota uint8 `binapi:"u8,name=allow_quota" json:"allow_quota,omitempty"`
- NoUDP10001 bool `binapi:"bool,name=no_udp_10001" json:"no_udp_10001,omitempty"`
- DataQuota uint64 `binapi:"u64,name=data_quota" json:"data_quota,omitempty"`
- MacAddress MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
- DeviceName string `binapi:"string[64],name=device_name" json:"device_name,omitempty" struc:"[64]byte"`
- Count uint32 `binapi:"u32,name=count" json:"count,omitempty" struc:"sizeof=Ranges"`
- Ranges []TimeRange `binapi:"time_range[count],name=ranges" json:"ranges,omitempty"`
-}
-
-func (m *MactimeAddDelRange) Reset() { *m = MactimeAddDelRange{} }
-func (*MactimeAddDelRange) GetMessageName() string { return "mactime_add_del_range" }
-func (*MactimeAddDelRange) GetCrcString() string { return "101858ef" }
-func (*MactimeAddDelRange) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *MactimeAddDelRange) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.IsAdd
- size += 1
- // field[1] m.Drop
- size += 1
- // field[1] m.Allow
- size += 1
- // field[1] m.AllowQuota
- size += 1
- // field[1] m.NoUDP10001
- size += 1
- // field[1] m.DataQuota
- size += 8
- // field[1] m.MacAddress
- size += 6
- // field[1] m.DeviceName
- size += 64
- // field[1] m.Count
- size += 4
- // field[1] m.Ranges
- for j1 := 0; j1 < len(m.Ranges); j1++ {
- var s1 TimeRange
- _ = s1
- if j1 < len(m.Ranges) {
- s1 = m.Ranges[j1]
- }
- // field[2] s1.Start
- size += 8
- // field[2] s1.End
- size += 8
- }
- return size
-}
-func (m *MactimeAddDelRange) 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.Drop
- if m.Drop {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Allow
- if m.Allow {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.AllowQuota
- buf[pos] = uint8(m.AllowQuota)
- pos += 1
- // field[1] m.NoUDP10001
- if m.NoUDP10001 {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.DataQuota
- o.PutUint64(buf[pos:pos+8], uint64(m.DataQuota))
- pos += 8
- // field[1] m.MacAddress
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.MacAddress) {
- x = uint8(m.MacAddress[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.DeviceName
- copy(buf[pos:pos+64], m.DeviceName)
- pos += 64
- // field[1] m.Count
- o.PutUint32(buf[pos:pos+4], uint32(len(m.Ranges)))
- pos += 4
- // field[1] m.Ranges
- for j1 := 0; j1 < len(m.Ranges); j1++ {
- var v1 TimeRange
- if j1 < len(m.Ranges) {
- v1 = m.Ranges[j1]
- }
- // field[2] v1.Start
- o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(v1.Start)))
- pos += 8
- // field[2] v1.End
- o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(v1.End)))
- pos += 8
- }
- return buf, nil
-}
-func (m *MactimeAddDelRange) 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.Drop
- m.Drop = tmp[pos] != 0
- pos += 1
- // field[1] m.Allow
- m.Allow = tmp[pos] != 0
- pos += 1
- // field[1] m.AllowQuota
- m.AllowQuota = uint8(tmp[pos])
- pos += 1
- // field[1] m.NoUDP10001
- m.NoUDP10001 = tmp[pos] != 0
- pos += 1
- // field[1] m.DataQuota
- m.DataQuota = uint64(o.Uint64(tmp[pos : pos+8]))
- pos += 8
- // field[1] m.MacAddress
- for i := 0; i < len(m.MacAddress); i++ {
- m.MacAddress[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.DeviceName
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.DeviceName = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- // field[1] m.Count
- m.Count = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Ranges
- m.Ranges = make([]TimeRange, int(m.Count))
- for j1 := 0; j1 < int(m.Count); j1++ {
- // field[2] m.Ranges[j1].Start
- m.Ranges[j1].Start = float64(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
- pos += 8
- // field[2] m.Ranges[j1].End
- m.Ranges[j1].End = float64(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
- pos += 8
- }
- return nil
-}
-
-// MactimeAddDelRangeReply represents VPP binary API message 'mactime_add_del_range_reply'.
-type MactimeAddDelRangeReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *MactimeAddDelRangeReply) Reset() { *m = MactimeAddDelRangeReply{} }
-func (*MactimeAddDelRangeReply) GetMessageName() string { return "mactime_add_del_range_reply" }
-func (*MactimeAddDelRangeReply) GetCrcString() string { return "e8d4e804" }
-func (*MactimeAddDelRangeReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *MactimeAddDelRangeReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *MactimeAddDelRangeReply) 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 *MactimeAddDelRangeReply) 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
- return nil
-}
-
-// MactimeDetails represents VPP binary API message 'mactime_details'.
-type MactimeDetails struct {
- PoolIndex uint32 `binapi:"u32,name=pool_index" json:"pool_index,omitempty"`
- MacAddress MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
- DataQuota uint64 `binapi:"u64,name=data_quota" json:"data_quota,omitempty"`
- DataUsedInRange uint64 `binapi:"u64,name=data_used_in_range" json:"data_used_in_range,omitempty"`
- Flags uint32 `binapi:"u32,name=flags" json:"flags,omitempty"`
- DeviceName string `binapi:"string[64],name=device_name" json:"device_name,omitempty" struc:"[64]byte"`
- Nranges uint32 `binapi:"u32,name=nranges" json:"nranges,omitempty" struc:"sizeof=Ranges"`
- Ranges []MactimeTimeRange `binapi:"mactime_time_range[nranges],name=ranges" json:"ranges,omitempty"`
-}
-
-func (m *MactimeDetails) Reset() { *m = MactimeDetails{} }
-func (*MactimeDetails) GetMessageName() string { return "mactime_details" }
-func (*MactimeDetails) GetCrcString() string { return "44921c06" }
-func (*MactimeDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *MactimeDetails) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.PoolIndex
- size += 4
- // field[1] m.MacAddress
- size += 6
- // field[1] m.DataQuota
- size += 8
- // field[1] m.DataUsedInRange
- size += 8
- // field[1] m.Flags
- size += 4
- // field[1] m.DeviceName
- size += 64
- // field[1] m.Nranges
- size += 4
- // field[1] m.Ranges
- for j1 := 0; j1 < len(m.Ranges); j1++ {
- var s1 MactimeTimeRange
- _ = s1
- if j1 < len(m.Ranges) {
- s1 = m.Ranges[j1]
- }
- // field[2] s1.Start
- size += 8
- // field[2] s1.End
- size += 8
- }
- return size
-}
-func (m *MactimeDetails) 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.PoolIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.PoolIndex))
- pos += 4
- // field[1] m.MacAddress
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.MacAddress) {
- x = uint8(m.MacAddress[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.DataQuota
- o.PutUint64(buf[pos:pos+8], uint64(m.DataQuota))
- pos += 8
- // field[1] m.DataUsedInRange
- o.PutUint64(buf[pos:pos+8], uint64(m.DataUsedInRange))
- pos += 8
- // field[1] m.Flags
- o.PutUint32(buf[pos:pos+4], uint32(m.Flags))
- pos += 4
- // field[1] m.DeviceName
- copy(buf[pos:pos+64], m.DeviceName)
- pos += 64
- // field[1] m.Nranges
- o.PutUint32(buf[pos:pos+4], uint32(len(m.Ranges)))
- pos += 4
- // field[1] m.Ranges
- for j1 := 0; j1 < len(m.Ranges); j1++ {
- var v1 MactimeTimeRange
- if j1 < len(m.Ranges) {
- v1 = m.Ranges[j1]
- }
- // field[2] v1.Start
- o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(v1.Start)))
- pos += 8
- // field[2] v1.End
- o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(v1.End)))
- pos += 8
- }
- return buf, nil
-}
-func (m *MactimeDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.PoolIndex
- m.PoolIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.MacAddress
- for i := 0; i < len(m.MacAddress); i++ {
- m.MacAddress[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.DataQuota
- m.DataQuota = uint64(o.Uint64(tmp[pos : pos+8]))
- pos += 8
- // field[1] m.DataUsedInRange
- m.DataUsedInRange = uint64(o.Uint64(tmp[pos : pos+8]))
- pos += 8
- // field[1] m.Flags
- m.Flags = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.DeviceName
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.DeviceName = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- // field[1] m.Nranges
- m.Nranges = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Ranges
- m.Ranges = make([]MactimeTimeRange, int(m.Nranges))
- for j1 := 0; j1 < int(m.Nranges); j1++ {
- // field[2] m.Ranges[j1].Start
- m.Ranges[j1].Start = float64(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
- pos += 8
- // field[2] m.Ranges[j1].End
- m.Ranges[j1].End = float64(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
- pos += 8
- }
- return nil
-}
-
-// MactimeDump represents VPP binary API message 'mactime_dump'.
-type MactimeDump struct {
- MyTableEpoch uint32 `binapi:"u32,name=my_table_epoch" json:"my_table_epoch,omitempty"`
-}
-
-func (m *MactimeDump) Reset() { *m = MactimeDump{} }
-func (*MactimeDump) GetMessageName() string { return "mactime_dump" }
-func (*MactimeDump) GetCrcString() string { return "8f454e23" }
-func (*MactimeDump) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *MactimeDump) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.MyTableEpoch
- size += 4
- return size
-}
-func (m *MactimeDump) 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.MyTableEpoch
- o.PutUint32(buf[pos:pos+4], uint32(m.MyTableEpoch))
- pos += 4
- return buf, nil
-}
-func (m *MactimeDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.MyTableEpoch
- m.MyTableEpoch = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// MactimeDumpReply represents VPP binary API message 'mactime_dump_reply'.
-type MactimeDumpReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- TableEpoch uint32 `binapi:"u32,name=table_epoch" json:"table_epoch,omitempty"`
-}
-
-func (m *MactimeDumpReply) Reset() { *m = MactimeDumpReply{} }
-func (*MactimeDumpReply) GetMessageName() string { return "mactime_dump_reply" }
-func (*MactimeDumpReply) GetCrcString() string { return "49bcc753" }
-func (*MactimeDumpReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *MactimeDumpReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.TableEpoch
- size += 4
- return size
-}
-func (m *MactimeDumpReply) 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.TableEpoch
- o.PutUint32(buf[pos:pos+4], uint32(m.TableEpoch))
- pos += 4
- return buf, nil
-}
-func (m *MactimeDumpReply) 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.TableEpoch
- m.TableEpoch = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// MactimeEnableDisable represents VPP binary API message 'mactime_enable_disable'.
-type MactimeEnableDisable struct {
- EnableDisable bool `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *MactimeEnableDisable) Reset() { *m = MactimeEnableDisable{} }
-func (*MactimeEnableDisable) GetMessageName() string { return "mactime_enable_disable" }
-func (*MactimeEnableDisable) GetCrcString() string { return "3865946c" }
-func (*MactimeEnableDisable) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *MactimeEnableDisable) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.EnableDisable
- size += 1
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *MactimeEnableDisable) 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.EnableDisable
- if m.EnableDisable {
- 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 *MactimeEnableDisable) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.EnableDisable
- m.EnableDisable = tmp[pos] != 0
- pos += 1
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// MactimeEnableDisableReply represents VPP binary API message 'mactime_enable_disable_reply'.
-type MactimeEnableDisableReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *MactimeEnableDisableReply) Reset() { *m = MactimeEnableDisableReply{} }
-func (*MactimeEnableDisableReply) GetMessageName() string { return "mactime_enable_disable_reply" }
-func (*MactimeEnableDisableReply) GetCrcString() string { return "e8d4e804" }
-func (*MactimeEnableDisableReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *MactimeEnableDisableReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *MactimeEnableDisableReply) 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 *MactimeEnableDisableReply) 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
- return nil
-}
-
-func init() { file_mactime_binapi_init() }
-func file_mactime_binapi_init() {
- api.RegisterMessage((*MactimeAddDelRange)(nil), "mactime.MactimeAddDelRange")
- api.RegisterMessage((*MactimeAddDelRangeReply)(nil), "mactime.MactimeAddDelRangeReply")
- api.RegisterMessage((*MactimeDetails)(nil), "mactime.MactimeDetails")
- api.RegisterMessage((*MactimeDump)(nil), "mactime.MactimeDump")
- api.RegisterMessage((*MactimeDumpReply)(nil), "mactime.MactimeDumpReply")
- api.RegisterMessage((*MactimeEnableDisable)(nil), "mactime.MactimeEnableDisable")
- api.RegisterMessage((*MactimeEnableDisableReply)(nil), "mactime.MactimeEnableDisableReply")
-}
-
-// Messages returns list of all messages in this module.
-func AllMessages() []api.Message {
- return []api.Message{
- (*MactimeAddDelRange)(nil),
- (*MactimeAddDelRangeReply)(nil),
- (*MactimeDetails)(nil),
- (*MactimeDump)(nil),
- (*MactimeDumpReply)(nil),
- (*MactimeEnableDisable)(nil),
- (*MactimeEnableDisableReply)(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 _ = strings.Contains
-var _ = struc.Pack
-var _ = binary.BigEndian
-var _ = math.Float32bits
-var _ = net.ParseIP
-var _ = fmt.Errorf
diff --git a/examples/binapi/mactime/mactime_rpc.ba.go b/examples/binapi/mactime/mactime_rpc.ba.go
deleted file mode 100644
index c35b708..0000000
--- a/examples/binapi/mactime/mactime_rpc.ba.go
+++ /dev/null
@@ -1,74 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-
-package mactime
-
-import (
- "context"
- "io"
-
- api "git.fd.io/govpp.git/api"
-)
-
-// RPCService represents RPC service API for mactime module.
-type RPCService interface {
- DumpMactime(ctx context.Context, in *MactimeDump) (RPCService_DumpMactimeClient, error)
- MactimeAddDelRange(ctx context.Context, in *MactimeAddDelRange) (*MactimeAddDelRangeReply, error)
- MactimeEnableDisable(ctx context.Context, in *MactimeEnableDisable) (*MactimeEnableDisableReply, error)
-}
-
-type serviceClient struct {
- ch api.Channel
-}
-
-func NewServiceClient(ch api.Channel) RPCService {
- return &serviceClient{ch}
-}
-
-func (c *serviceClient) DumpMactime(ctx context.Context, in *MactimeDump) (RPCService_DumpMactimeClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpMactimeClient{stream}
- return x, nil
-}
-
-type RPCService_DumpMactimeClient interface {
- Recv() (*MactimeDetails, error)
-}
-
-type serviceClient_DumpMactimeClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpMactimeClient) Recv() (*MactimeDetails, error) {
- m := new(MactimeDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) MactimeAddDelRange(ctx context.Context, in *MactimeAddDelRange) (*MactimeAddDelRangeReply, error) {
- out := new(MactimeAddDelRangeReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) MactimeEnableDisable(ctx context.Context, in *MactimeEnableDisable) (*MactimeEnableDisableReply, error) {
- out := new(MactimeEnableDisableReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = context.Background
-var _ = io.Copy
diff --git a/examples/binapi/memif/memif.ba.go b/examples/binapi/memif/memif.ba.go
deleted file mode 100644
index bea3160..0000000
--- a/examples/binapi/memif/memif.ba.go
+++ /dev/null
@@ -1,857 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-// versions:
-// binapi-generator: v0.4.0-dev
-// VPP: 20.05-release
-// source: /usr/share/vpp/api/plugins/memif.api.json
-
-/*
-Package memif contains generated code for VPP API file memif.api (3.0.0).
-
-It consists of:
- 2 aliases
- 8 enums
- 10 messages
-*/
-package memif
-
-import (
- "bytes"
- "context"
- "encoding/binary"
- "fmt"
- "io"
- "math"
- "net"
- "strconv"
- "strings"
-
- api "git.fd.io/govpp.git/api"
- codec "git.fd.io/govpp.git/codec"
- struc "github.com/lunixbochs/struc"
-
- interface_types "git.fd.io/govpp.git/examples/binapi/interface_types"
-)
-
-// 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 (
- // ModuleName is the name of this module.
- ModuleName = "memif"
- // APIVersion is the API version of this module.
- APIVersion = "3.0.0"
- // VersionCrc is the CRC of this module.
- VersionCrc = 0x1a1c95b8
-)
-
-// MemifMode represents VPP binary API enum 'memif_mode'.
-type MemifMode uint32
-
-const (
- MEMIF_MODE_API_ETHERNET MemifMode = 0
- MEMIF_MODE_API_IP MemifMode = 1
- MEMIF_MODE_API_PUNT_INJECT MemifMode = 2
-)
-
-var (
- MemifMode_name = map[uint32]string{
- 0: "MEMIF_MODE_API_ETHERNET",
- 1: "MEMIF_MODE_API_IP",
- 2: "MEMIF_MODE_API_PUNT_INJECT",
- }
- MemifMode_value = map[string]uint32{
- "MEMIF_MODE_API_ETHERNET": 0,
- "MEMIF_MODE_API_IP": 1,
- "MEMIF_MODE_API_PUNT_INJECT": 2,
- }
-)
-
-func (x MemifMode) String() string {
- s, ok := MemifMode_name[uint32(x)]
- if ok {
- return s
- }
- return "MemifMode(" + strconv.Itoa(int(x)) + ")"
-}
-
-// MemifRole represents VPP binary API enum 'memif_role'.
-type MemifRole uint32
-
-const (
- MEMIF_ROLE_API_MASTER MemifRole = 0
- MEMIF_ROLE_API_SLAVE MemifRole = 1
-)
-
-var (
- MemifRole_name = map[uint32]string{
- 0: "MEMIF_ROLE_API_MASTER",
- 1: "MEMIF_ROLE_API_SLAVE",
- }
- MemifRole_value = map[string]uint32{
- "MEMIF_ROLE_API_MASTER": 0,
- "MEMIF_ROLE_API_SLAVE": 1,
- }
-)
-
-func (x MemifRole) String() string {
- s, ok := MemifRole_name[uint32(x)]
- if ok {
- return s
- }
- return "MemifRole(" + strconv.Itoa(int(x)) + ")"
-}
-
-// MacAddress represents VPP binary API alias 'mac_address'.
-type MacAddress [6]uint8
-
-func ParseMAC(mac string) (parsed MacAddress, err error) {
- var hw net.HardwareAddr
- if hw, err = net.ParseMAC(mac); err != nil {
- return
- }
- copy(parsed[:], hw[:])
- return
-}
-
-func (m *MacAddress) ToString() string {
- return net.HardwareAddr(m[:]).String()
-}
-
-// MemifCreate represents VPP binary API message 'memif_create'.
-type MemifCreate struct {
- Role MemifRole `binapi:"memif_role,name=role" json:"role,omitempty"`
- Mode MemifMode `binapi:"memif_mode,name=mode" json:"mode,omitempty"`
- RxQueues uint8 `binapi:"u8,name=rx_queues" json:"rx_queues,omitempty"`
- TxQueues uint8 `binapi:"u8,name=tx_queues" json:"tx_queues,omitempty"`
- ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
- SocketID uint32 `binapi:"u32,name=socket_id" json:"socket_id,omitempty"`
- RingSize uint32 `binapi:"u32,name=ring_size" json:"ring_size,omitempty"`
- BufferSize uint16 `binapi:"u16,name=buffer_size" json:"buffer_size,omitempty"`
- NoZeroCopy bool `binapi:"bool,name=no_zero_copy" json:"no_zero_copy,omitempty"`
- HwAddr MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"`
- Secret string `binapi:"string[24],name=secret" json:"secret,omitempty" struc:"[24]byte"`
-}
-
-func (m *MemifCreate) Reset() { *m = MemifCreate{} }
-func (*MemifCreate) GetMessageName() string { return "memif_create" }
-func (*MemifCreate) GetCrcString() string { return "b1b25061" }
-func (*MemifCreate) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *MemifCreate) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Role
- size += 4
- // field[1] m.Mode
- size += 4
- // field[1] m.RxQueues
- size += 1
- // field[1] m.TxQueues
- size += 1
- // field[1] m.ID
- size += 4
- // field[1] m.SocketID
- size += 4
- // field[1] m.RingSize
- size += 4
- // field[1] m.BufferSize
- size += 2
- // field[1] m.NoZeroCopy
- size += 1
- // field[1] m.HwAddr
- size += 6
- // field[1] m.Secret
- size += 24
- return size
-}
-func (m *MemifCreate) 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.Role
- o.PutUint32(buf[pos:pos+4], uint32(m.Role))
- pos += 4
- // field[1] m.Mode
- o.PutUint32(buf[pos:pos+4], uint32(m.Mode))
- pos += 4
- // field[1] m.RxQueues
- buf[pos] = uint8(m.RxQueues)
- pos += 1
- // field[1] m.TxQueues
- buf[pos] = uint8(m.TxQueues)
- pos += 1
- // field[1] m.ID
- o.PutUint32(buf[pos:pos+4], uint32(m.ID))
- pos += 4
- // field[1] m.SocketID
- o.PutUint32(buf[pos:pos+4], uint32(m.SocketID))
- pos += 4
- // field[1] m.RingSize
- o.PutUint32(buf[pos:pos+4], uint32(m.RingSize))
- pos += 4
- // field[1] m.BufferSize
- o.PutUint16(buf[pos:pos+2], uint16(m.BufferSize))
- pos += 2
- // field[1] m.NoZeroCopy
- if m.NoZeroCopy {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.HwAddr
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.HwAddr) {
- x = uint8(m.HwAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.Secret
- copy(buf[pos:pos+24], m.Secret)
- pos += 24
- return buf, nil
-}
-func (m *MemifCreate) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Role
- m.Role = MemifRole(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Mode
- m.Mode = MemifMode(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.RxQueues
- m.RxQueues = uint8(tmp[pos])
- pos += 1
- // field[1] m.TxQueues
- m.TxQueues = uint8(tmp[pos])
- pos += 1
- // field[1] m.ID
- m.ID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SocketID
- m.SocketID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.RingSize
- m.RingSize = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.BufferSize
- m.BufferSize = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[1] m.NoZeroCopy
- m.NoZeroCopy = tmp[pos] != 0
- pos += 1
- // field[1] m.HwAddr
- for i := 0; i < len(m.HwAddr); i++ {
- m.HwAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.Secret
- {
- nul := bytes.Index(tmp[pos:pos+24], []byte{0x00})
- m.Secret = codec.DecodeString(tmp[pos : pos+nul])
- pos += 24
- }
- return nil
-}
-
-// MemifCreateReply represents VPP binary API message 'memif_create_reply'.
-type MemifCreateReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *MemifCreateReply) Reset() { *m = MemifCreateReply{} }
-func (*MemifCreateReply) GetMessageName() string { return "memif_create_reply" }
-func (*MemifCreateReply) GetCrcString() string { return "5383d31f" }
-func (*MemifCreateReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *MemifCreateReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *MemifCreateReply) 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.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- return buf, nil
-}
-func (m *MemifCreateReply) 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.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// MemifDelete represents VPP binary API message 'memif_delete'.
-type MemifDelete struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
-}
-
-func (m *MemifDelete) Reset() { *m = MemifDelete{} }
-func (*MemifDelete) GetMessageName() string { return "memif_delete" }
-func (*MemifDelete) GetCrcString() string { return "f9e6675e" }
-func (*MemifDelete) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *MemifDelete) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- return size
-}
-func (m *MemifDelete) 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 *MemifDelete) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// MemifDeleteReply represents VPP binary API message 'memif_delete_reply'.
-type MemifDeleteReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *MemifDeleteReply) Reset() { *m = MemifDeleteReply{} }
-func (*MemifDeleteReply) GetMessageName() string { return "memif_delete_reply" }
-func (*MemifDeleteReply) GetCrcString() string { return "e8d4e804" }
-func (*MemifDeleteReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *MemifDeleteReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *MemifDeleteReply) 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 *MemifDeleteReply) 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
- return nil
-}
-
-// MemifDetails represents VPP binary API message 'memif_details'.
-type MemifDetails struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- HwAddr MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"`
- ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
- Role MemifRole `binapi:"memif_role,name=role" json:"role,omitempty"`
- Mode MemifMode `binapi:"memif_mode,name=mode" json:"mode,omitempty"`
- ZeroCopy bool `binapi:"bool,name=zero_copy" json:"zero_copy,omitempty"`
- SocketID uint32 `binapi:"u32,name=socket_id" json:"socket_id,omitempty"`
- RingSize uint32 `binapi:"u32,name=ring_size" json:"ring_size,omitempty"`
- BufferSize uint16 `binapi:"u16,name=buffer_size" json:"buffer_size,omitempty"`
- Flags interface_types.IfStatusFlags `binapi:"if_status_flags,name=flags" json:"flags,omitempty"`
- IfName string `binapi:"string[64],name=if_name" json:"if_name,omitempty" struc:"[64]byte"`
-}
-
-func (m *MemifDetails) Reset() { *m = MemifDetails{} }
-func (*MemifDetails) GetMessageName() string { return "memif_details" }
-func (*MemifDetails) GetCrcString() string { return "d0382c4c" }
-func (*MemifDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *MemifDetails) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.HwAddr
- size += 6
- // field[1] m.ID
- size += 4
- // field[1] m.Role
- size += 4
- // field[1] m.Mode
- size += 4
- // field[1] m.ZeroCopy
- size += 1
- // field[1] m.SocketID
- size += 4
- // field[1] m.RingSize
- size += 4
- // field[1] m.BufferSize
- size += 2
- // field[1] m.Flags
- size += 4
- // field[1] m.IfName
- size += 64
- return size
-}
-func (m *MemifDetails) 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.HwAddr
- for i := 0; i < 6; i++ {
- var x uint8
- if i < len(m.HwAddr) {
- x = uint8(m.HwAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.ID
- o.PutUint32(buf[pos:pos+4], uint32(m.ID))
- pos += 4
- // field[1] m.Role
- o.PutUint32(buf[pos:pos+4], uint32(m.Role))
- pos += 4
- // field[1] m.Mode
- o.PutUint32(buf[pos:pos+4], uint32(m.Mode))
- pos += 4
- // field[1] m.ZeroCopy
- if m.ZeroCopy {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.SocketID
- o.PutUint32(buf[pos:pos+4], uint32(m.SocketID))
- pos += 4
- // field[1] m.RingSize
- o.PutUint32(buf[pos:pos+4], uint32(m.RingSize))
- pos += 4
- // field[1] m.BufferSize
- o.PutUint16(buf[pos:pos+2], uint16(m.BufferSize))
- pos += 2
- // field[1] m.Flags
- o.PutUint32(buf[pos:pos+4], uint32(m.Flags))
- pos += 4
- // field[1] m.IfName
- copy(buf[pos:pos+64], m.IfName)
- pos += 64
- return buf, nil
-}
-func (m *MemifDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.HwAddr
- for i := 0; i < len(m.HwAddr); i++ {
- m.HwAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.ID
- m.ID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Role
- m.Role = MemifRole(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Mode
- m.Mode = MemifMode(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.ZeroCopy
- m.ZeroCopy = tmp[pos] != 0
- pos += 1
- // field[1] m.SocketID
- m.SocketID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.RingSize
- m.RingSize = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.BufferSize
- m.BufferSize = uint16(o.Uint16(tmp[pos : pos+2]))
- pos += 2
- // field[1] m.Flags
- m.Flags = interface_types.IfStatusFlags(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IfName
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.IfName = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- return nil
-}
-
-// MemifDump represents VPP binary API message 'memif_dump'.
-type MemifDump struct{}
-
-func (m *MemifDump) Reset() { *m = MemifDump{} }
-func (*MemifDump) GetMessageName() string { return "memif_dump" }
-func (*MemifDump) GetCrcString() string { return "51077d14" }
-func (*MemifDump) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *MemifDump) Size() int {
- if m == nil {
- return 0
- }
- var size int
- return size
-}
-func (m *MemifDump) 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
- }
- return buf, nil
-}
-func (m *MemifDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- return nil
-}
-
-// MemifSocketFilenameAddDel represents VPP binary API message 'memif_socket_filename_add_del'.
-type MemifSocketFilenameAddDel struct {
- IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
- SocketID uint32 `binapi:"u32,name=socket_id" json:"socket_id,omitempty"`
- SocketFilename string `binapi:"string[108],name=socket_filename" json:"socket_filename,omitempty" struc:"[108]byte"`
-}
-
-func (m *MemifSocketFilenameAddDel) Reset() { *m = MemifSocketFilenameAddDel{} }
-func (*MemifSocketFilenameAddDel) GetMessageName() string { return "memif_socket_filename_add_del" }
-func (*MemifSocketFilenameAddDel) GetCrcString() string { return "a2ce1a10" }
-func (*MemifSocketFilenameAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *MemifSocketFilenameAddDel) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.IsAdd
- size += 1
- // field[1] m.SocketID
- size += 4
- // field[1] m.SocketFilename
- size += 108
- return size
-}
-func (m *MemifSocketFilenameAddDel) 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.SocketID
- o.PutUint32(buf[pos:pos+4], uint32(m.SocketID))
- pos += 4
- // field[1] m.SocketFilename
- copy(buf[pos:pos+108], m.SocketFilename)
- pos += 108
- return buf, nil
-}
-func (m *MemifSocketFilenameAddDel) 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.SocketID
- m.SocketID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SocketFilename
- {
- nul := bytes.Index(tmp[pos:pos+108], []byte{0x00})
- m.SocketFilename = codec.DecodeString(tmp[pos : pos+nul])
- pos += 108
- }
- return nil
-}
-
-// MemifSocketFilenameAddDelReply represents VPP binary API message 'memif_socket_filename_add_del_reply'.
-type MemifSocketFilenameAddDelReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *MemifSocketFilenameAddDelReply) Reset() { *m = MemifSocketFilenameAddDelReply{} }
-func (*MemifSocketFilenameAddDelReply) GetMessageName() string {
- return "memif_socket_filename_add_del_reply"
-}
-func (*MemifSocketFilenameAddDelReply) GetCrcString() string { return "e8d4e804" }
-func (*MemifSocketFilenameAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *MemifSocketFilenameAddDelReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *MemifSocketFilenameAddDelReply) 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 *MemifSocketFilenameAddDelReply) 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
- return nil
-}
-
-// MemifSocketFilenameDetails represents VPP binary API message 'memif_socket_filename_details'.
-type MemifSocketFilenameDetails struct {
- SocketID uint32 `binapi:"u32,name=socket_id" json:"socket_id,omitempty"`
- SocketFilename string `binapi:"string[108],name=socket_filename" json:"socket_filename,omitempty" struc:"[108]byte"`
-}
-
-func (m *MemifSocketFilenameDetails) Reset() { *m = MemifSocketFilenameDetails{} }
-func (*MemifSocketFilenameDetails) GetMessageName() string { return "memif_socket_filename_details" }
-func (*MemifSocketFilenameDetails) GetCrcString() string { return "7ff326f7" }
-func (*MemifSocketFilenameDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *MemifSocketFilenameDetails) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.SocketID
- size += 4
- // field[1] m.SocketFilename
- size += 108
- return size
-}
-func (m *MemifSocketFilenameDetails) 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.SocketID
- o.PutUint32(buf[pos:pos+4], uint32(m.SocketID))
- pos += 4
- // field[1] m.SocketFilename
- copy(buf[pos:pos+108], m.SocketFilename)
- pos += 108
- return buf, nil
-}
-func (m *MemifSocketFilenameDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.SocketID
- m.SocketID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.SocketFilename
- {
- nul := bytes.Index(tmp[pos:pos+108], []byte{0x00})
- m.SocketFilename = codec.DecodeString(tmp[pos : pos+nul])
- pos += 108
- }
- return nil
-}
-
-// MemifSocketFilenameDump represents VPP binary API message 'memif_socket_filename_dump'.
-type MemifSocketFilenameDump struct{}
-
-func (m *MemifSocketFilenameDump) Reset() { *m = MemifSocketFilenameDump{} }
-func (*MemifSocketFilenameDump) GetMessageName() string { return "memif_socket_filename_dump" }
-func (*MemifSocketFilenameDump) GetCrcString() string { return "51077d14" }
-func (*MemifSocketFilenameDump) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *MemifSocketFilenameDump) Size() int {
- if m == nil {
- return 0
- }
- var size int
- return size
-}
-func (m *MemifSocketFilenameDump) 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
- }
- return buf, nil
-}
-func (m *MemifSocketFilenameDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- return nil
-}
-
-func init() { file_memif_binapi_init() }
-func file_memif_binapi_init() {
- api.RegisterMessage((*MemifCreate)(nil), "memif.MemifCreate")
- api.RegisterMessage((*MemifCreateReply)(nil), "memif.MemifCreateReply")
- api.RegisterMessage((*MemifDelete)(nil), "memif.MemifDelete")
- api.RegisterMessage((*MemifDeleteReply)(nil), "memif.MemifDeleteReply")
- api.RegisterMessage((*MemifDetails)(nil), "memif.MemifDetails")
- api.RegisterMessage((*MemifDump)(nil), "memif.MemifDump")
- api.RegisterMessage((*MemifSocketFilenameAddDel)(nil), "memif.MemifSocketFilenameAddDel")
- api.RegisterMessage((*MemifSocketFilenameAddDelReply)(nil), "memif.MemifSocketFilenameAddDelReply")
- api.RegisterMessage((*MemifSocketFilenameDetails)(nil), "memif.MemifSocketFilenameDetails")
- api.RegisterMessage((*MemifSocketFilenameDump)(nil), "memif.MemifSocketFilenameDump")
-}
-
-// Messages returns list of all messages in this module.
-func AllMessages() []api.Message {
- return []api.Message{
- (*MemifCreate)(nil),
- (*MemifCreateReply)(nil),
- (*MemifDelete)(nil),
- (*MemifDeleteReply)(nil),
- (*MemifDetails)(nil),
- (*MemifDump)(nil),
- (*MemifSocketFilenameAddDel)(nil),
- (*MemifSocketFilenameAddDelReply)(nil),
- (*MemifSocketFilenameDetails)(nil),
- (*MemifSocketFilenameDump)(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 _ = strings.Contains
-var _ = struc.Pack
-var _ = binary.BigEndian
-var _ = math.Float32bits
-var _ = net.ParseIP
-var _ = fmt.Errorf
diff --git a/examples/binapi/memif/memif_rpc.ba.go b/examples/binapi/memif/memif_rpc.ba.go
deleted file mode 100644
index 8eda8f1..0000000
--- a/examples/binapi/memif/memif_rpc.ba.go
+++ /dev/null
@@ -1,111 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-
-package memif
-
-import (
- "context"
- "io"
-
- api "git.fd.io/govpp.git/api"
-)
-
-// RPCService represents RPC service API for memif module.
-type RPCService interface {
- DumpMemif(ctx context.Context, in *MemifDump) (RPCService_DumpMemifClient, error)
- DumpMemifSocketFilename(ctx context.Context, in *MemifSocketFilenameDump) (RPCService_DumpMemifSocketFilenameClient, error)
- MemifCreate(ctx context.Context, in *MemifCreate) (*MemifCreateReply, error)
- MemifDelete(ctx context.Context, in *MemifDelete) (*MemifDeleteReply, error)
- MemifSocketFilenameAddDel(ctx context.Context, in *MemifSocketFilenameAddDel) (*MemifSocketFilenameAddDelReply, error)
-}
-
-type serviceClient struct {
- ch api.Channel
-}
-
-func NewServiceClient(ch api.Channel) RPCService {
- return &serviceClient{ch}
-}
-
-func (c *serviceClient) DumpMemif(ctx context.Context, in *MemifDump) (RPCService_DumpMemifClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpMemifClient{stream}
- return x, nil
-}
-
-type RPCService_DumpMemifClient interface {
- Recv() (*MemifDetails, error)
-}
-
-type serviceClient_DumpMemifClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpMemifClient) Recv() (*MemifDetails, error) {
- m := new(MemifDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) DumpMemifSocketFilename(ctx context.Context, in *MemifSocketFilenameDump) (RPCService_DumpMemifSocketFilenameClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpMemifSocketFilenameClient{stream}
- return x, nil
-}
-
-type RPCService_DumpMemifSocketFilenameClient interface {
- Recv() (*MemifSocketFilenameDetails, error)
-}
-
-type serviceClient_DumpMemifSocketFilenameClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpMemifSocketFilenameClient) Recv() (*MemifSocketFilenameDetails, error) {
- m := new(MemifSocketFilenameDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) MemifCreate(ctx context.Context, in *MemifCreate) (*MemifCreateReply, error) {
- out := new(MemifCreateReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) MemifDelete(ctx context.Context, in *MemifDelete) (*MemifDeleteReply, error) {
- out := new(MemifDeleteReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) MemifSocketFilenameAddDel(ctx context.Context, in *MemifSocketFilenameAddDel) (*MemifSocketFilenameAddDelReply, error) {
- out := new(MemifSocketFilenameAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = context.Background
-var _ = io.Copy
diff --git a/examples/binapi/sr/sr.ba.go b/examples/binapi/sr/sr.ba.go
deleted file mode 100644
index 1803585..0000000
--- a/examples/binapi/sr/sr.ba.go
+++ /dev/null
@@ -1,1784 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-// versions:
-// binapi-generator: v0.4.0-dev
-// VPP: 20.05-release
-// source: /usr/share/vpp/api/core/sr.api.json
-
-/*
-Package sr contains generated code for VPP API file sr.api (2.0.0).
-
-It consists of:
- 6 aliases
- 13 enums
- 20 messages
- 7 types
- 1 union
-*/
-package sr
-
-import (
- "bytes"
- "context"
- "encoding/binary"
- "fmt"
- "io"
- "math"
- "net"
- "strconv"
- "strings"
-
- api "git.fd.io/govpp.git/api"
- codec "git.fd.io/govpp.git/codec"
- struc "github.com/lunixbochs/struc"
-
- interface_types "git.fd.io/govpp.git/examples/binapi/interface_types"
- ip_types "git.fd.io/govpp.git/examples/binapi/ip_types"
-)
-
-// 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 (
- // ModuleName is the name of this module.
- ModuleName = "sr"
- // APIVersion is the API version of this module.
- APIVersion = "2.0.0"
- // VersionCrc is the CRC of this module.
- VersionCrc = 0xd85c77ca
-)
-
-// SrBehavior represents VPP binary API enum 'sr_behavior'.
-type SrBehavior uint8
-
-const (
- SR_BEHAVIOR_API_END SrBehavior = 1
- SR_BEHAVIOR_API_X SrBehavior = 2
- SR_BEHAVIOR_API_T SrBehavior = 3
- SR_BEHAVIOR_API_D_FIRST SrBehavior = 4
- SR_BEHAVIOR_API_DX2 SrBehavior = 5
- SR_BEHAVIOR_API_DX6 SrBehavior = 6
- SR_BEHAVIOR_API_DX4 SrBehavior = 7
- SR_BEHAVIOR_API_DT6 SrBehavior = 8
- SR_BEHAVIOR_API_DT4 SrBehavior = 9
- SR_BEHAVIOR_API_LAST SrBehavior = 10
-)
-
-var (
- SrBehavior_name = map[uint8]string{
- 1: "SR_BEHAVIOR_API_END",
- 2: "SR_BEHAVIOR_API_X",
- 3: "SR_BEHAVIOR_API_T",
- 4: "SR_BEHAVIOR_API_D_FIRST",
- 5: "SR_BEHAVIOR_API_DX2",
- 6: "SR_BEHAVIOR_API_DX6",
- 7: "SR_BEHAVIOR_API_DX4",
- 8: "SR_BEHAVIOR_API_DT6",
- 9: "SR_BEHAVIOR_API_DT4",
- 10: "SR_BEHAVIOR_API_LAST",
- }
- SrBehavior_value = map[string]uint8{
- "SR_BEHAVIOR_API_END": 1,
- "SR_BEHAVIOR_API_X": 2,
- "SR_BEHAVIOR_API_T": 3,
- "SR_BEHAVIOR_API_D_FIRST": 4,
- "SR_BEHAVIOR_API_DX2": 5,
- "SR_BEHAVIOR_API_DX6": 6,
- "SR_BEHAVIOR_API_DX4": 7,
- "SR_BEHAVIOR_API_DT6": 8,
- "SR_BEHAVIOR_API_DT4": 9,
- "SR_BEHAVIOR_API_LAST": 10,
- }
-)
-
-func (x SrBehavior) String() string {
- s, ok := SrBehavior_name[uint8(x)]
- if ok {
- return s
- }
- return "SrBehavior(" + strconv.Itoa(int(x)) + ")"
-}
-
-// SrPolicyOp represents VPP binary API enum 'sr_policy_op'.
-type SrPolicyOp uint8
-
-const (
- SR_POLICY_OP_API_NONE SrPolicyOp = 0
- SR_POLICY_OP_API_ADD SrPolicyOp = 1
- SR_POLICY_OP_API_DEL SrPolicyOp = 2
- SR_POLICY_OP_API_MOD SrPolicyOp = 3
-)
-
-var (
- SrPolicyOp_name = map[uint8]string{
- 0: "SR_POLICY_OP_API_NONE",
- 1: "SR_POLICY_OP_API_ADD",
- 2: "SR_POLICY_OP_API_DEL",
- 3: "SR_POLICY_OP_API_MOD",
- }
- SrPolicyOp_value = map[string]uint8{
- "SR_POLICY_OP_API_NONE": 0,
- "SR_POLICY_OP_API_ADD": 1,
- "SR_POLICY_OP_API_DEL": 2,
- "SR_POLICY_OP_API_MOD": 3,
- }
-)
-
-func (x SrPolicyOp) String() string {
- s, ok := SrPolicyOp_name[uint8(x)]
- if ok {
- return s
- }
- return "SrPolicyOp(" + strconv.Itoa(int(x)) + ")"
-}
-
-// SrSteer represents VPP binary API enum 'sr_steer'.
-type SrSteer uint8
-
-const (
- SR_STEER_API_L2 SrSteer = 2
- SR_STEER_API_IPV4 SrSteer = 4
- SR_STEER_API_IPV6 SrSteer = 6
-)
-
-var (
- SrSteer_name = map[uint8]string{
- 2: "SR_STEER_API_L2",
- 4: "SR_STEER_API_IPV4",
- 6: "SR_STEER_API_IPV6",
- }
- SrSteer_value = map[string]uint8{
- "SR_STEER_API_L2": 2,
- "SR_STEER_API_IPV4": 4,
- "SR_STEER_API_IPV6": 6,
- }
-)
-
-func (x SrSteer) String() string {
- s, ok := SrSteer_name[uint8(x)]
- if ok {
- return s
- }
- return "SrSteer(" + strconv.Itoa(int(x)) + ")"
-}
-
-// Srv6SidList represents VPP binary API type 'srv6_sid_list'.
-type Srv6SidList struct {
- NumSids uint8 `binapi:"u8,name=num_sids" json:"num_sids,omitempty"`
- Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
- Sids [16]ip_types.IP6Address `binapi:"ip6_address[16],name=sids" json:"sids,omitempty" struc:"[16]ip_types.IP6Address"`
-}
-
-func (*Srv6SidList) GetTypeName() string { return "srv6_sid_list" }
-
-// SrLocalsidAddDel represents VPP binary API message 'sr_localsid_add_del'.
-type SrLocalsidAddDel struct {
- IsDel bool `binapi:"bool,name=is_del,default=false" json:"is_del,omitempty"`
- Localsid ip_types.IP6Address `binapi:"ip6_address,name=localsid" json:"localsid,omitempty"`
- EndPsp bool `binapi:"bool,name=end_psp" json:"end_psp,omitempty"`
- Behavior SrBehavior `binapi:"sr_behavior,name=behavior" json:"behavior,omitempty"`
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4.294967295e+09" json:"sw_if_index,omitempty"`
- VlanIndex uint32 `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"`
- FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
- NhAddr ip_types.Address `binapi:"address,name=nh_addr" json:"nh_addr,omitempty"`
-}
-
-func (m *SrLocalsidAddDel) Reset() { *m = SrLocalsidAddDel{} }
-func (*SrLocalsidAddDel) GetMessageName() string { return "sr_localsid_add_del" }
-func (*SrLocalsidAddDel) GetCrcString() string { return "26fa3309" }
-func (*SrLocalsidAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SrLocalsidAddDel) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.IsDel
- size += 1
- // field[1] m.Localsid
- size += 16
- // field[1] m.EndPsp
- size += 1
- // field[1] m.Behavior
- size += 1
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.VlanIndex
- size += 4
- // field[1] m.FibTable
- size += 4
- // field[1] m.NhAddr
- // field[2] m.NhAddr.Af
- size += 1
- // field[2] m.NhAddr.Un
- size += 16
- return size
-}
-func (m *SrLocalsidAddDel) 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.IsDel
- if m.IsDel {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Localsid
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.Localsid) {
- x = uint8(m.Localsid[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.EndPsp
- if m.EndPsp {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Behavior
- buf[pos] = uint8(m.Behavior)
- pos += 1
- // field[1] m.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.VlanIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.VlanIndex))
- pos += 4
- // field[1] m.FibTable
- o.PutUint32(buf[pos:pos+4], uint32(m.FibTable))
- pos += 4
- // field[1] m.NhAddr
- // field[2] m.NhAddr.Af
- buf[pos] = uint8(m.NhAddr.Af)
- pos += 1
- // field[2] m.NhAddr.Un
- copy(buf[pos:pos+16], m.NhAddr.Un.XXX_UnionData[:])
- pos += 16
- return buf, nil
-}
-func (m *SrLocalsidAddDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsDel
- m.IsDel = tmp[pos] != 0
- pos += 1
- // field[1] m.Localsid
- for i := 0; i < len(m.Localsid); i++ {
- m.Localsid[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.EndPsp
- m.EndPsp = tmp[pos] != 0
- pos += 1
- // field[1] m.Behavior
- m.Behavior = SrBehavior(tmp[pos])
- pos += 1
- // field[1] m.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.VlanIndex
- m.VlanIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.FibTable
- m.FibTable = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.NhAddr
- // field[2] m.NhAddr.Af
- m.NhAddr.Af = ip_types.AddressFamily(tmp[pos])
- pos += 1
- // field[2] m.NhAddr.Un
- copy(m.NhAddr.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- return nil
-}
-
-// SrLocalsidAddDelReply represents VPP binary API message 'sr_localsid_add_del_reply'.
-type SrLocalsidAddDelReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SrLocalsidAddDelReply) Reset() { *m = SrLocalsidAddDelReply{} }
-func (*SrLocalsidAddDelReply) GetMessageName() string { return "sr_localsid_add_del_reply" }
-func (*SrLocalsidAddDelReply) GetCrcString() string { return "e8d4e804" }
-func (*SrLocalsidAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SrLocalsidAddDelReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SrLocalsidAddDelReply) 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 *SrLocalsidAddDelReply) 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
- return nil
-}
-
-// SrLocalsidsDetails represents VPP binary API message 'sr_localsids_details'.
-type SrLocalsidsDetails struct {
- Addr ip_types.IP6Address `binapi:"ip6_address,name=addr" json:"addr,omitempty"`
- EndPsp bool `binapi:"bool,name=end_psp" json:"end_psp,omitempty"`
- Behavior SrBehavior `binapi:"sr_behavior,name=behavior" json:"behavior,omitempty"`
- FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
- VlanIndex uint32 `binapi:"u32,name=vlan_index" json:"vlan_index,omitempty"`
- XconnectNhAddr ip_types.Address `binapi:"address,name=xconnect_nh_addr" json:"xconnect_nh_addr,omitempty"`
- XconnectIfaceOrVrfTable uint32 `binapi:"u32,name=xconnect_iface_or_vrf_table" json:"xconnect_iface_or_vrf_table,omitempty"`
-}
-
-func (m *SrLocalsidsDetails) Reset() { *m = SrLocalsidsDetails{} }
-func (*SrLocalsidsDetails) GetMessageName() string { return "sr_localsids_details" }
-func (*SrLocalsidsDetails) GetCrcString() string { return "6a6c0265" }
-func (*SrLocalsidsDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SrLocalsidsDetails) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Addr
- size += 16
- // field[1] m.EndPsp
- size += 1
- // field[1] m.Behavior
- size += 1
- // field[1] m.FibTable
- size += 4
- // field[1] m.VlanIndex
- size += 4
- // field[1] m.XconnectNhAddr
- // field[2] m.XconnectNhAddr.Af
- size += 1
- // field[2] m.XconnectNhAddr.Un
- size += 16
- // field[1] m.XconnectIfaceOrVrfTable
- size += 4
- return size
-}
-func (m *SrLocalsidsDetails) 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.Addr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.Addr) {
- x = uint8(m.Addr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.EndPsp
- if m.EndPsp {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.Behavior
- buf[pos] = uint8(m.Behavior)
- pos += 1
- // field[1] m.FibTable
- o.PutUint32(buf[pos:pos+4], uint32(m.FibTable))
- pos += 4
- // field[1] m.VlanIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.VlanIndex))
- pos += 4
- // field[1] m.XconnectNhAddr
- // field[2] m.XconnectNhAddr.Af
- buf[pos] = uint8(m.XconnectNhAddr.Af)
- pos += 1
- // field[2] m.XconnectNhAddr.Un
- copy(buf[pos:pos+16], m.XconnectNhAddr.Un.XXX_UnionData[:])
- pos += 16
- // field[1] m.XconnectIfaceOrVrfTable
- o.PutUint32(buf[pos:pos+4], uint32(m.XconnectIfaceOrVrfTable))
- pos += 4
- return buf, nil
-}
-func (m *SrLocalsidsDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Addr
- for i := 0; i < len(m.Addr); i++ {
- m.Addr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.EndPsp
- m.EndPsp = tmp[pos] != 0
- pos += 1
- // field[1] m.Behavior
- m.Behavior = SrBehavior(tmp[pos])
- pos += 1
- // field[1] m.FibTable
- m.FibTable = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.VlanIndex
- m.VlanIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.XconnectNhAddr
- // field[2] m.XconnectNhAddr.Af
- m.XconnectNhAddr.Af = ip_types.AddressFamily(tmp[pos])
- pos += 1
- // field[2] m.XconnectNhAddr.Un
- copy(m.XconnectNhAddr.Un.XXX_UnionData[:], tmp[pos:pos+16])
- pos += 16
- // field[1] m.XconnectIfaceOrVrfTable
- m.XconnectIfaceOrVrfTable = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SrLocalsidsDump represents VPP binary API message 'sr_localsids_dump'.
-type SrLocalsidsDump struct{}
-
-func (m *SrLocalsidsDump) Reset() { *m = SrLocalsidsDump{} }
-func (*SrLocalsidsDump) GetMessageName() string { return "sr_localsids_dump" }
-func (*SrLocalsidsDump) GetCrcString() string { return "51077d14" }
-func (*SrLocalsidsDump) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SrLocalsidsDump) Size() int {
- if m == nil {
- return 0
- }
- var size int
- return size
-}
-func (m *SrLocalsidsDump) 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
- }
- return buf, nil
-}
-func (m *SrLocalsidsDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- return nil
-}
-
-// SrPoliciesDetails represents VPP binary API message 'sr_policies_details'.
-type SrPoliciesDetails struct {
- Bsid ip_types.IP6Address `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"`
- IsSpray bool `binapi:"bool,name=is_spray" json:"is_spray,omitempty"`
- IsEncap bool `binapi:"bool,name=is_encap" json:"is_encap,omitempty"`
- FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
- NumSidLists uint8 `binapi:"u8,name=num_sid_lists" json:"num_sid_lists,omitempty" struc:"sizeof=SidLists"`
- SidLists []Srv6SidList `binapi:"srv6_sid_list[num_sid_lists],name=sid_lists" json:"sid_lists,omitempty"`
-}
-
-func (m *SrPoliciesDetails) Reset() { *m = SrPoliciesDetails{} }
-func (*SrPoliciesDetails) GetMessageName() string { return "sr_policies_details" }
-func (*SrPoliciesDetails) GetCrcString() string { return "07ec2d93" }
-func (*SrPoliciesDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SrPoliciesDetails) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Bsid
- size += 16
- // field[1] m.IsSpray
- size += 1
- // field[1] m.IsEncap
- size += 1
- // field[1] m.FibTable
- size += 4
- // field[1] m.NumSidLists
- size += 1
- // field[1] m.SidLists
- for j1 := 0; j1 < len(m.SidLists); j1++ {
- var s1 Srv6SidList
- _ = s1
- if j1 < len(m.SidLists) {
- s1 = m.SidLists[j1]
- }
- // field[2] s1.NumSids
- size += 1
- // field[2] s1.Weight
- size += 4
- // field[2] s1.Sids
- for j2 := 0; j2 < 16; j2++ {
- var s2 ip_types.IP6Address
- _ = s2
- if j2 < len(s1.Sids) {
- s2 = s1.Sids[j2]
- }
- size += 16
- }
- }
- return size
-}
-func (m *SrPoliciesDetails) 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.Bsid
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.Bsid) {
- x = uint8(m.Bsid[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.IsSpray
- if m.IsSpray {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.IsEncap
- if m.IsEncap {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.FibTable
- o.PutUint32(buf[pos:pos+4], uint32(m.FibTable))
- pos += 4
- // field[1] m.NumSidLists
- buf[pos] = uint8(len(m.SidLists))
- pos += 1
- // field[1] m.SidLists
- for j1 := 0; j1 < len(m.SidLists); j1++ {
- var v1 Srv6SidList
- if j1 < len(m.SidLists) {
- v1 = m.SidLists[j1]
- }
- // field[2] v1.NumSids
- buf[pos] = uint8(v1.NumSids)
- pos += 1
- // field[2] v1.Weight
- o.PutUint32(buf[pos:pos+4], uint32(v1.Weight))
- pos += 4
- // field[2] v1.Sids
- for j2 := 0; j2 < 16; j2++ {
- var v2 ip_types.IP6Address
- if j2 < len(v1.Sids) {
- v2 = v1.Sids[j2]
- }
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(v2) {
- x = uint8(v2[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- }
- }
- return buf, nil
-}
-func (m *SrPoliciesDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Bsid
- for i := 0; i < len(m.Bsid); i++ {
- m.Bsid[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.IsSpray
- m.IsSpray = tmp[pos] != 0
- pos += 1
- // field[1] m.IsEncap
- m.IsEncap = tmp[pos] != 0
- pos += 1
- // field[1] m.FibTable
- m.FibTable = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.NumSidLists
- m.NumSidLists = uint8(tmp[pos])
- pos += 1
- // field[1] m.SidLists
- m.SidLists = make([]Srv6SidList, int(m.NumSidLists))
- for j1 := 0; j1 < int(m.NumSidLists); j1++ {
- // field[2] m.SidLists[j1].NumSids
- m.SidLists[j1].NumSids = uint8(tmp[pos])
- pos += 1
- // field[2] m.SidLists[j1].Weight
- m.SidLists[j1].Weight = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.SidLists[j1].Sids
- for j2 := 0; j2 < 16; j2++ {
- for i := 0; i < len(m.SidLists[j1].Sids[j2]); i++ {
- m.SidLists[j1].Sids[j2][i] = uint8(tmp[pos])
- pos += 1
- }
- }
- }
- return nil
-}
-
-// SrPoliciesDump represents VPP binary API message 'sr_policies_dump'.
-type SrPoliciesDump struct{}
-
-func (m *SrPoliciesDump) Reset() { *m = SrPoliciesDump{} }
-func (*SrPoliciesDump) GetMessageName() string { return "sr_policies_dump" }
-func (*SrPoliciesDump) GetCrcString() string { return "51077d14" }
-func (*SrPoliciesDump) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SrPoliciesDump) Size() int {
- if m == nil {
- return 0
- }
- var size int
- return size
-}
-func (m *SrPoliciesDump) 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
- }
- return buf, nil
-}
-func (m *SrPoliciesDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- return nil
-}
-
-// SrPolicyAdd represents VPP binary API message 'sr_policy_add'.
-type SrPolicyAdd struct {
- BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
- Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
- IsEncap bool `binapi:"bool,name=is_encap" json:"is_encap,omitempty"`
- IsSpray bool `binapi:"bool,name=is_spray" json:"is_spray,omitempty"`
- FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
- Sids Srv6SidList `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"`
-}
-
-func (m *SrPolicyAdd) Reset() { *m = SrPolicyAdd{} }
-func (*SrPolicyAdd) GetMessageName() string { return "sr_policy_add" }
-func (*SrPolicyAdd) GetCrcString() string { return "ec79ee6a" }
-func (*SrPolicyAdd) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SrPolicyAdd) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.BsidAddr
- size += 16
- // field[1] m.Weight
- size += 4
- // field[1] m.IsEncap
- size += 1
- // field[1] m.IsSpray
- size += 1
- // field[1] m.FibTable
- size += 4
- // field[1] m.Sids
- // field[2] m.Sids.NumSids
- size += 1
- // field[2] m.Sids.Weight
- size += 4
- // field[2] m.Sids.Sids
- for j2 := 0; j2 < 16; j2++ {
- var s2 ip_types.IP6Address
- _ = s2
- if j2 < len(m.Sids.Sids) {
- s2 = m.Sids.Sids[j2]
- }
- size += 16
- }
- return size
-}
-func (m *SrPolicyAdd) 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.BsidAddr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.BsidAddr) {
- x = uint8(m.BsidAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.Weight
- o.PutUint32(buf[pos:pos+4], uint32(m.Weight))
- pos += 4
- // field[1] m.IsEncap
- if m.IsEncap {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.IsSpray
- if m.IsSpray {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.FibTable
- o.PutUint32(buf[pos:pos+4], uint32(m.FibTable))
- pos += 4
- // field[1] m.Sids
- // field[2] m.Sids.NumSids
- buf[pos] = uint8(m.Sids.NumSids)
- pos += 1
- // field[2] m.Sids.Weight
- o.PutUint32(buf[pos:pos+4], uint32(m.Sids.Weight))
- pos += 4
- // field[2] m.Sids.Sids
- for j2 := 0; j2 < 16; j2++ {
- var v2 ip_types.IP6Address
- if j2 < len(m.Sids.Sids) {
- v2 = m.Sids.Sids[j2]
- }
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(v2) {
- x = uint8(v2[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- }
- return buf, nil
-}
-func (m *SrPolicyAdd) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.BsidAddr
- for i := 0; i < len(m.BsidAddr); i++ {
- m.BsidAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.Weight
- m.Weight = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.IsEncap
- m.IsEncap = tmp[pos] != 0
- pos += 1
- // field[1] m.IsSpray
- m.IsSpray = tmp[pos] != 0
- pos += 1
- // field[1] m.FibTable
- m.FibTable = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Sids
- // field[2] m.Sids.NumSids
- m.Sids.NumSids = uint8(tmp[pos])
- pos += 1
- // field[2] m.Sids.Weight
- m.Sids.Weight = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Sids.Sids
- for j2 := 0; j2 < 16; j2++ {
- for i := 0; i < len(m.Sids.Sids[j2]); i++ {
- m.Sids.Sids[j2][i] = uint8(tmp[pos])
- pos += 1
- }
- }
- return nil
-}
-
-// SrPolicyAddReply represents VPP binary API message 'sr_policy_add_reply'.
-type SrPolicyAddReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SrPolicyAddReply) Reset() { *m = SrPolicyAddReply{} }
-func (*SrPolicyAddReply) GetMessageName() string { return "sr_policy_add_reply" }
-func (*SrPolicyAddReply) GetCrcString() string { return "e8d4e804" }
-func (*SrPolicyAddReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SrPolicyAddReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SrPolicyAddReply) 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 *SrPolicyAddReply) 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
- return nil
-}
-
-// SrPolicyDel represents VPP binary API message 'sr_policy_del'.
-type SrPolicyDel struct {
- BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
- SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
-}
-
-func (m *SrPolicyDel) Reset() { *m = SrPolicyDel{} }
-func (*SrPolicyDel) GetMessageName() string { return "sr_policy_del" }
-func (*SrPolicyDel) GetCrcString() string { return "cb4d48d5" }
-func (*SrPolicyDel) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SrPolicyDel) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.BsidAddr
- size += 16
- // field[1] m.SrPolicyIndex
- size += 4
- return size
-}
-func (m *SrPolicyDel) 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.BsidAddr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.BsidAddr) {
- x = uint8(m.BsidAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.SrPolicyIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SrPolicyIndex))
- pos += 4
- return buf, nil
-}
-func (m *SrPolicyDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.BsidAddr
- for i := 0; i < len(m.BsidAddr); i++ {
- m.BsidAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.SrPolicyIndex
- m.SrPolicyIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// SrPolicyDelReply represents VPP binary API message 'sr_policy_del_reply'.
-type SrPolicyDelReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SrPolicyDelReply) Reset() { *m = SrPolicyDelReply{} }
-func (*SrPolicyDelReply) GetMessageName() string { return "sr_policy_del_reply" }
-func (*SrPolicyDelReply) GetCrcString() string { return "e8d4e804" }
-func (*SrPolicyDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SrPolicyDelReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SrPolicyDelReply) 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 *SrPolicyDelReply) 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
- return nil
-}
-
-// SrPolicyMod represents VPP binary API message 'sr_policy_mod'.
-type SrPolicyMod struct {
- BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
- SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
- FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
- Operation SrPolicyOp `binapi:"sr_policy_op,name=operation" json:"operation,omitempty"`
- SlIndex uint32 `binapi:"u32,name=sl_index" json:"sl_index,omitempty"`
- Weight uint32 `binapi:"u32,name=weight" json:"weight,omitempty"`
- Sids Srv6SidList `binapi:"srv6_sid_list,name=sids" json:"sids,omitempty"`
-}
-
-func (m *SrPolicyMod) Reset() { *m = SrPolicyMod{} }
-func (*SrPolicyMod) GetMessageName() string { return "sr_policy_mod" }
-func (*SrPolicyMod) GetCrcString() string { return "e531a102" }
-func (*SrPolicyMod) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SrPolicyMod) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.BsidAddr
- size += 16
- // field[1] m.SrPolicyIndex
- size += 4
- // field[1] m.FibTable
- size += 4
- // field[1] m.Operation
- size += 1
- // field[1] m.SlIndex
- size += 4
- // field[1] m.Weight
- size += 4
- // field[1] m.Sids
- // field[2] m.Sids.NumSids
- size += 1
- // field[2] m.Sids.Weight
- size += 4
- // field[2] m.Sids.Sids
- for j2 := 0; j2 < 16; j2++ {
- var s2 ip_types.IP6Address
- _ = s2
- if j2 < len(m.Sids.Sids) {
- s2 = m.Sids.Sids[j2]
- }
- size += 16
- }
- return size
-}
-func (m *SrPolicyMod) 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.BsidAddr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.BsidAddr) {
- x = uint8(m.BsidAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.SrPolicyIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SrPolicyIndex))
- pos += 4
- // field[1] m.FibTable
- o.PutUint32(buf[pos:pos+4], uint32(m.FibTable))
- pos += 4
- // field[1] m.Operation
- buf[pos] = uint8(m.Operation)
- pos += 1
- // field[1] m.SlIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SlIndex))
- pos += 4
- // field[1] m.Weight
- o.PutUint32(buf[pos:pos+4], uint32(m.Weight))
- pos += 4
- // field[1] m.Sids
- // field[2] m.Sids.NumSids
- buf[pos] = uint8(m.Sids.NumSids)
- pos += 1
- // field[2] m.Sids.Weight
- o.PutUint32(buf[pos:pos+4], uint32(m.Sids.Weight))
- pos += 4
- // field[2] m.Sids.Sids
- for j2 := 0; j2 < 16; j2++ {
- var v2 ip_types.IP6Address
- if j2 < len(m.Sids.Sids) {
- v2 = m.Sids.Sids[j2]
- }
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(v2) {
- x = uint8(v2[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- }
- return buf, nil
-}
-func (m *SrPolicyMod) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.BsidAddr
- for i := 0; i < len(m.BsidAddr); i++ {
- m.BsidAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.SrPolicyIndex
- m.SrPolicyIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.FibTable
- m.FibTable = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Operation
- m.Operation = SrPolicyOp(tmp[pos])
- pos += 1
- // field[1] m.SlIndex
- m.SlIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Weight
- m.Weight = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Sids
- // field[2] m.Sids.NumSids
- m.Sids.NumSids = uint8(tmp[pos])
- pos += 1
- // field[2] m.Sids.Weight
- m.Sids.Weight = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.Sids.Sids
- for j2 := 0; j2 < 16; j2++ {
- for i := 0; i < len(m.Sids.Sids[j2]); i++ {
- m.Sids.Sids[j2][i] = uint8(tmp[pos])
- pos += 1
- }
- }
- return nil
-}
-
-// SrPolicyModReply represents VPP binary API message 'sr_policy_mod_reply'.
-type SrPolicyModReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SrPolicyModReply) Reset() { *m = SrPolicyModReply{} }
-func (*SrPolicyModReply) GetMessageName() string { return "sr_policy_mod_reply" }
-func (*SrPolicyModReply) GetCrcString() string { return "e8d4e804" }
-func (*SrPolicyModReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SrPolicyModReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SrPolicyModReply) 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 *SrPolicyModReply) 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
- return nil
-}
-
-// SrSetEncapHopLimit represents VPP binary API message 'sr_set_encap_hop_limit'.
-type SrSetEncapHopLimit struct {
- HopLimit uint8 `binapi:"u8,name=hop_limit" json:"hop_limit,omitempty"`
-}
-
-func (m *SrSetEncapHopLimit) Reset() { *m = SrSetEncapHopLimit{} }
-func (*SrSetEncapHopLimit) GetMessageName() string { return "sr_set_encap_hop_limit" }
-func (*SrSetEncapHopLimit) GetCrcString() string { return "aa75d7d0" }
-func (*SrSetEncapHopLimit) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SrSetEncapHopLimit) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.HopLimit
- size += 1
- return size
-}
-func (m *SrSetEncapHopLimit) 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.HopLimit
- buf[pos] = uint8(m.HopLimit)
- pos += 1
- return buf, nil
-}
-func (m *SrSetEncapHopLimit) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.HopLimit
- m.HopLimit = uint8(tmp[pos])
- pos += 1
- return nil
-}
-
-// SrSetEncapHopLimitReply represents VPP binary API message 'sr_set_encap_hop_limit_reply'.
-type SrSetEncapHopLimitReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SrSetEncapHopLimitReply) Reset() { *m = SrSetEncapHopLimitReply{} }
-func (*SrSetEncapHopLimitReply) GetMessageName() string { return "sr_set_encap_hop_limit_reply" }
-func (*SrSetEncapHopLimitReply) GetCrcString() string { return "e8d4e804" }
-func (*SrSetEncapHopLimitReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SrSetEncapHopLimitReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SrSetEncapHopLimitReply) 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 *SrSetEncapHopLimitReply) 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
- return nil
-}
-
-// SrSetEncapSource represents VPP binary API message 'sr_set_encap_source'.
-type SrSetEncapSource struct {
- EncapsSource ip_types.IP6Address `binapi:"ip6_address,name=encaps_source" json:"encaps_source,omitempty"`
-}
-
-func (m *SrSetEncapSource) Reset() { *m = SrSetEncapSource{} }
-func (*SrSetEncapSource) GetMessageName() string { return "sr_set_encap_source" }
-func (*SrSetEncapSource) GetCrcString() string { return "d3bad5e1" }
-func (*SrSetEncapSource) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SrSetEncapSource) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.EncapsSource
- size += 16
- return size
-}
-func (m *SrSetEncapSource) 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.EncapsSource
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.EncapsSource) {
- x = uint8(m.EncapsSource[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- return buf, nil
-}
-func (m *SrSetEncapSource) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.EncapsSource
- for i := 0; i < len(m.EncapsSource); i++ {
- m.EncapsSource[i] = uint8(tmp[pos])
- pos += 1
- }
- return nil
-}
-
-// SrSetEncapSourceReply represents VPP binary API message 'sr_set_encap_source_reply'.
-type SrSetEncapSourceReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SrSetEncapSourceReply) Reset() { *m = SrSetEncapSourceReply{} }
-func (*SrSetEncapSourceReply) GetMessageName() string { return "sr_set_encap_source_reply" }
-func (*SrSetEncapSourceReply) GetCrcString() string { return "e8d4e804" }
-func (*SrSetEncapSourceReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SrSetEncapSourceReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SrSetEncapSourceReply) 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 *SrSetEncapSourceReply) 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
- return nil
-}
-
-// SrSteeringAddDel represents VPP binary API message 'sr_steering_add_del'.
-type SrSteeringAddDel struct {
- IsDel bool `binapi:"bool,name=is_del,default=false" json:"is_del,omitempty"`
- BsidAddr ip_types.IP6Address `binapi:"ip6_address,name=bsid_addr" json:"bsid_addr,omitempty"`
- SrPolicyIndex uint32 `binapi:"u32,name=sr_policy_index" json:"sr_policy_index,omitempty"`
- TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
- Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- TrafficType SrSteer `binapi:"sr_steer,name=traffic_type" json:"traffic_type,omitempty"`
-}
-
-func (m *SrSteeringAddDel) Reset() { *m = SrSteeringAddDel{} }
-func (*SrSteeringAddDel) GetMessageName() string { return "sr_steering_add_del" }
-func (*SrSteeringAddDel) GetCrcString() string { return "3711dace" }
-func (*SrSteeringAddDel) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SrSteeringAddDel) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.IsDel
- size += 1
- // field[1] m.BsidAddr
- size += 16
- // field[1] m.SrPolicyIndex
- size += 4
- // field[1] m.TableID
- size += 4
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- size += 1
- // field[3] m.Prefix.Address.Un
- size += 16
- // field[2] m.Prefix.Len
- size += 1
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.TrafficType
- size += 1
- return size
-}
-func (m *SrSteeringAddDel) 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.IsDel
- if m.IsDel {
- buf[pos] = 1
- }
- pos += 1
- // field[1] m.BsidAddr
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.BsidAddr) {
- x = uint8(m.BsidAddr[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- // field[1] m.SrPolicyIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SrPolicyIndex))
- 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.Address
- // field[3] m.Prefix.Address.Af
- buf[pos] = uint8(m.Prefix.Address.Af)
- pos += 1
- // 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.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.TrafficType
- buf[pos] = uint8(m.TrafficType)
- pos += 1
- return buf, nil
-}
-func (m *SrSteeringAddDel) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.IsDel
- m.IsDel = tmp[pos] != 0
- pos += 1
- // field[1] m.BsidAddr
- for i := 0; i < len(m.BsidAddr); i++ {
- m.BsidAddr[i] = uint8(tmp[pos])
- pos += 1
- }
- // field[1] m.SrPolicyIndex
- m.SrPolicyIndex = uint32(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.Address
- // field[3] m.Prefix.Address.Af
- m.Prefix.Address.Af = ip_types.AddressFamily(tmp[pos])
- pos += 1
- // 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.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.TrafficType
- m.TrafficType = SrSteer(tmp[pos])
- pos += 1
- return nil
-}
-
-// SrSteeringAddDelReply represents VPP binary API message 'sr_steering_add_del_reply'.
-type SrSteeringAddDelReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
-}
-
-func (m *SrSteeringAddDelReply) Reset() { *m = SrSteeringAddDelReply{} }
-func (*SrSteeringAddDelReply) GetMessageName() string { return "sr_steering_add_del_reply" }
-func (*SrSteeringAddDelReply) GetCrcString() string { return "e8d4e804" }
-func (*SrSteeringAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SrSteeringAddDelReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- return size
-}
-func (m *SrSteeringAddDelReply) 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 *SrSteeringAddDelReply) 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
- return nil
-}
-
-// SrSteeringPolDetails represents VPP binary API message 'sr_steering_pol_details'.
-type SrSteeringPolDetails struct {
- TrafficType SrSteer `binapi:"sr_steer,name=traffic_type" json:"traffic_type,omitempty"`
- FibTable uint32 `binapi:"u32,name=fib_table" json:"fib_table,omitempty"`
- Prefix ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
- Bsid ip_types.IP6Address `binapi:"ip6_address,name=bsid" json:"bsid,omitempty"`
-}
-
-func (m *SrSteeringPolDetails) Reset() { *m = SrSteeringPolDetails{} }
-func (*SrSteeringPolDetails) GetMessageName() string { return "sr_steering_pol_details" }
-func (*SrSteeringPolDetails) GetCrcString() string { return "1c1ee786" }
-func (*SrSteeringPolDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *SrSteeringPolDetails) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.TrafficType
- size += 1
- // field[1] m.FibTable
- size += 4
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- size += 1
- // field[3] m.Prefix.Address.Un
- size += 16
- // field[2] m.Prefix.Len
- size += 1
- // field[1] m.SwIfIndex
- size += 4
- // field[1] m.Bsid
- size += 16
- return size
-}
-func (m *SrSteeringPolDetails) 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.TrafficType
- buf[pos] = uint8(m.TrafficType)
- pos += 1
- // field[1] m.FibTable
- o.PutUint32(buf[pos:pos+4], uint32(m.FibTable))
- pos += 4
- // field[1] m.Prefix
- // field[2] m.Prefix.Address
- // field[3] m.Prefix.Address.Af
- buf[pos] = uint8(m.Prefix.Address.Af)
- pos += 1
- // 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.SwIfIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.SwIfIndex))
- pos += 4
- // field[1] m.Bsid
- for i := 0; i < 16; i++ {
- var x uint8
- if i < len(m.Bsid) {
- x = uint8(m.Bsid[i])
- }
- buf[pos] = uint8(x)
- pos += 1
- }
- return buf, nil
-}
-func (m *SrSteeringPolDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.TrafficType
- m.TrafficType = SrSteer(tmp[pos])
- pos += 1
- // field[1] m.FibTable
- m.FibTable = uint32(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 = ip_types.AddressFamily(tmp[pos])
- pos += 1
- // 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.SwIfIndex
- m.SwIfIndex = interface_types.InterfaceIndex(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.Bsid
- for i := 0; i < len(m.Bsid); i++ {
- m.Bsid[i] = uint8(tmp[pos])
- pos += 1
- }
- return nil
-}
-
-// SrSteeringPolDump represents VPP binary API message 'sr_steering_pol_dump'.
-type SrSteeringPolDump struct{}
-
-func (m *SrSteeringPolDump) Reset() { *m = SrSteeringPolDump{} }
-func (*SrSteeringPolDump) GetMessageName() string { return "sr_steering_pol_dump" }
-func (*SrSteeringPolDump) GetCrcString() string { return "51077d14" }
-func (*SrSteeringPolDump) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *SrSteeringPolDump) Size() int {
- if m == nil {
- return 0
- }
- var size int
- return size
-}
-func (m *SrSteeringPolDump) 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
- }
- return buf, nil
-}
-func (m *SrSteeringPolDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- return nil
-}
-
-func init() { file_sr_binapi_init() }
-func file_sr_binapi_init() {
- api.RegisterMessage((*SrLocalsidAddDel)(nil), "sr.SrLocalsidAddDel")
- api.RegisterMessage((*SrLocalsidAddDelReply)(nil), "sr.SrLocalsidAddDelReply")
- api.RegisterMessage((*SrLocalsidsDetails)(nil), "sr.SrLocalsidsDetails")
- api.RegisterMessage((*SrLocalsidsDump)(nil), "sr.SrLocalsidsDump")
- api.RegisterMessage((*SrPoliciesDetails)(nil), "sr.SrPoliciesDetails")
- api.RegisterMessage((*SrPoliciesDump)(nil), "sr.SrPoliciesDump")
- api.RegisterMessage((*SrPolicyAdd)(nil), "sr.SrPolicyAdd")
- api.RegisterMessage((*SrPolicyAddReply)(nil), "sr.SrPolicyAddReply")
- api.RegisterMessage((*SrPolicyDel)(nil), "sr.SrPolicyDel")
- api.RegisterMessage((*SrPolicyDelReply)(nil), "sr.SrPolicyDelReply")
- api.RegisterMessage((*SrPolicyMod)(nil), "sr.SrPolicyMod")
- api.RegisterMessage((*SrPolicyModReply)(nil), "sr.SrPolicyModReply")
- api.RegisterMessage((*SrSetEncapHopLimit)(nil), "sr.SrSetEncapHopLimit")
- api.RegisterMessage((*SrSetEncapHopLimitReply)(nil), "sr.SrSetEncapHopLimitReply")
- api.RegisterMessage((*SrSetEncapSource)(nil), "sr.SrSetEncapSource")
- api.RegisterMessage((*SrSetEncapSourceReply)(nil), "sr.SrSetEncapSourceReply")
- api.RegisterMessage((*SrSteeringAddDel)(nil), "sr.SrSteeringAddDel")
- api.RegisterMessage((*SrSteeringAddDelReply)(nil), "sr.SrSteeringAddDelReply")
- api.RegisterMessage((*SrSteeringPolDetails)(nil), "sr.SrSteeringPolDetails")
- api.RegisterMessage((*SrSteeringPolDump)(nil), "sr.SrSteeringPolDump")
-}
-
-// Messages returns list of all messages in this module.
-func AllMessages() []api.Message {
- return []api.Message{
- (*SrLocalsidAddDel)(nil),
- (*SrLocalsidAddDelReply)(nil),
- (*SrLocalsidsDetails)(nil),
- (*SrLocalsidsDump)(nil),
- (*SrPoliciesDetails)(nil),
- (*SrPoliciesDump)(nil),
- (*SrPolicyAdd)(nil),
- (*SrPolicyAddReply)(nil),
- (*SrPolicyDel)(nil),
- (*SrPolicyDelReply)(nil),
- (*SrPolicyMod)(nil),
- (*SrPolicyModReply)(nil),
- (*SrSetEncapHopLimit)(nil),
- (*SrSetEncapHopLimitReply)(nil),
- (*SrSetEncapSource)(nil),
- (*SrSetEncapSourceReply)(nil),
- (*SrSteeringAddDel)(nil),
- (*SrSteeringAddDelReply)(nil),
- (*SrSteeringPolDetails)(nil),
- (*SrSteeringPolDump)(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 _ = strings.Contains
-var _ = struc.Pack
-var _ = binary.BigEndian
-var _ = math.Float32bits
-var _ = net.ParseIP
-var _ = fmt.Errorf
diff --git a/examples/binapi/sr/sr_rpc.ba.go b/examples/binapi/sr/sr_rpc.ba.go
deleted file mode 100644
index aeb3cde..0000000
--- a/examples/binapi/sr/sr_rpc.ba.go
+++ /dev/null
@@ -1,178 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-
-package sr
-
-import (
- "context"
- "io"
-
- api "git.fd.io/govpp.git/api"
-)
-
-// RPCService represents RPC service API for sr module.
-type RPCService interface {
- DumpSrLocalsids(ctx context.Context, in *SrLocalsidsDump) (RPCService_DumpSrLocalsidsClient, error)
- DumpSrPolicies(ctx context.Context, in *SrPoliciesDump) (RPCService_DumpSrPoliciesClient, error)
- DumpSrSteeringPol(ctx context.Context, in *SrSteeringPolDump) (RPCService_DumpSrSteeringPolClient, error)
- SrLocalsidAddDel(ctx context.Context, in *SrLocalsidAddDel) (*SrLocalsidAddDelReply, error)
- SrPolicyAdd(ctx context.Context, in *SrPolicyAdd) (*SrPolicyAddReply, error)
- SrPolicyDel(ctx context.Context, in *SrPolicyDel) (*SrPolicyDelReply, error)
- SrPolicyMod(ctx context.Context, in *SrPolicyMod) (*SrPolicyModReply, error)
- SrSetEncapHopLimit(ctx context.Context, in *SrSetEncapHopLimit) (*SrSetEncapHopLimitReply, error)
- SrSetEncapSource(ctx context.Context, in *SrSetEncapSource) (*SrSetEncapSourceReply, error)
- SrSteeringAddDel(ctx context.Context, in *SrSteeringAddDel) (*SrSteeringAddDelReply, error)
-}
-
-type serviceClient struct {
- ch api.Channel
-}
-
-func NewServiceClient(ch api.Channel) RPCService {
- return &serviceClient{ch}
-}
-
-func (c *serviceClient) DumpSrLocalsids(ctx context.Context, in *SrLocalsidsDump) (RPCService_DumpSrLocalsidsClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpSrLocalsidsClient{stream}
- return x, nil
-}
-
-type RPCService_DumpSrLocalsidsClient interface {
- Recv() (*SrLocalsidsDetails, error)
-}
-
-type serviceClient_DumpSrLocalsidsClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpSrLocalsidsClient) Recv() (*SrLocalsidsDetails, error) {
- m := new(SrLocalsidsDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) DumpSrPolicies(ctx context.Context, in *SrPoliciesDump) (RPCService_DumpSrPoliciesClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpSrPoliciesClient{stream}
- return x, nil
-}
-
-type RPCService_DumpSrPoliciesClient interface {
- Recv() (*SrPoliciesDetails, error)
-}
-
-type serviceClient_DumpSrPoliciesClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpSrPoliciesClient) Recv() (*SrPoliciesDetails, error) {
- m := new(SrPoliciesDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) DumpSrSteeringPol(ctx context.Context, in *SrSteeringPolDump) (RPCService_DumpSrSteeringPolClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpSrSteeringPolClient{stream}
- return x, nil
-}
-
-type RPCService_DumpSrSteeringPolClient interface {
- Recv() (*SrSteeringPolDetails, error)
-}
-
-type serviceClient_DumpSrSteeringPolClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpSrSteeringPolClient) Recv() (*SrSteeringPolDetails, error) {
- m := new(SrSteeringPolDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) SrLocalsidAddDel(ctx context.Context, in *SrLocalsidAddDel) (*SrLocalsidAddDelReply, error) {
- out := new(SrLocalsidAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SrPolicyAdd(ctx context.Context, in *SrPolicyAdd) (*SrPolicyAddReply, error) {
- out := new(SrPolicyAddReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SrPolicyDel(ctx context.Context, in *SrPolicyDel) (*SrPolicyDelReply, error) {
- out := new(SrPolicyDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SrPolicyMod(ctx context.Context, in *SrPolicyMod) (*SrPolicyModReply, error) {
- out := new(SrPolicyModReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SrSetEncapHopLimit(ctx context.Context, in *SrSetEncapHopLimit) (*SrSetEncapHopLimitReply, error) {
- out := new(SrSetEncapHopLimitReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SrSetEncapSource(ctx context.Context, in *SrSetEncapSource) (*SrSetEncapSourceReply, error) {
- out := new(SrSetEncapSourceReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) SrSteeringAddDel(ctx context.Context, in *SrSteeringAddDel) (*SrSteeringAddDelReply, error) {
- out := new(SrSteeringAddDelReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = context.Background
-var _ = io.Copy
diff --git a/examples/binapi/vpe/vpe.ba.go b/examples/binapi/vpe/vpe.ba.go
deleted file mode 100644
index 411a9f4..0000000
--- a/examples/binapi/vpe/vpe.ba.go
+++ /dev/null
@@ -1,1665 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-// versions:
-// binapi-generator: v0.4.0-dev
-// VPP: 20.05-release
-// source: /usr/share/vpp/api/core/vpe.api.json
-
-/*
-Package vpe contains generated code for VPP API file vpe.api (1.6.1).
-
-It consists of:
- 2 aliases
- 1 enum
- 26 messages
- 2 types
-*/
-package vpe
-
-import (
- "bytes"
- "context"
- "encoding/binary"
- "fmt"
- "io"
- "math"
- "net"
- "strconv"
- "strings"
-
- api "git.fd.io/govpp.git/api"
- codec "git.fd.io/govpp.git/codec"
- struc "github.com/lunixbochs/struc"
-)
-
-// 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 (
- // ModuleName is the name of this module.
- ModuleName = "vpe"
- // APIVersion is the API version of this module.
- APIVersion = "1.6.1"
- // VersionCrc is the CRC of this module.
- VersionCrc = 0xbd2c94f4
-)
-
-// LogLevel represents VPP binary API enum 'log_level'.
-type LogLevel uint32
-
-const (
- VPE_API_LOG_LEVEL_EMERG LogLevel = 0
- VPE_API_LOG_LEVEL_ALERT LogLevel = 1
- VPE_API_LOG_LEVEL_CRIT LogLevel = 2
- VPE_API_LOG_LEVEL_ERR LogLevel = 3
- VPE_API_LOG_LEVEL_WARNING LogLevel = 4
- VPE_API_LOG_LEVEL_NOTICE LogLevel = 5
- VPE_API_LOG_LEVEL_INFO LogLevel = 6
- VPE_API_LOG_LEVEL_DEBUG LogLevel = 7
- VPE_API_LOG_LEVEL_DISABLED LogLevel = 8
-)
-
-var (
- LogLevel_name = map[uint32]string{
- 0: "VPE_API_LOG_LEVEL_EMERG",
- 1: "VPE_API_LOG_LEVEL_ALERT",
- 2: "VPE_API_LOG_LEVEL_CRIT",
- 3: "VPE_API_LOG_LEVEL_ERR",
- 4: "VPE_API_LOG_LEVEL_WARNING",
- 5: "VPE_API_LOG_LEVEL_NOTICE",
- 6: "VPE_API_LOG_LEVEL_INFO",
- 7: "VPE_API_LOG_LEVEL_DEBUG",
- 8: "VPE_API_LOG_LEVEL_DISABLED",
- }
- LogLevel_value = map[string]uint32{
- "VPE_API_LOG_LEVEL_EMERG": 0,
- "VPE_API_LOG_LEVEL_ALERT": 1,
- "VPE_API_LOG_LEVEL_CRIT": 2,
- "VPE_API_LOG_LEVEL_ERR": 3,
- "VPE_API_LOG_LEVEL_WARNING": 4,
- "VPE_API_LOG_LEVEL_NOTICE": 5,
- "VPE_API_LOG_LEVEL_INFO": 6,
- "VPE_API_LOG_LEVEL_DEBUG": 7,
- "VPE_API_LOG_LEVEL_DISABLED": 8,
- }
-)
-
-func (x LogLevel) String() string {
- s, ok := LogLevel_name[uint32(x)]
- if ok {
- return s
- }
- return "LogLevel(" + strconv.Itoa(int(x)) + ")"
-}
-
-// Timedelta represents VPP binary API alias 'timedelta'.
-type Timedelta float64
-
-// Timestamp represents VPP binary API alias 'timestamp'.
-type Timestamp float64
-
-// ThreadData represents VPP binary API type 'thread_data'.
-type ThreadData struct {
- ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
- Name string `binapi:"string[64],name=name" json:"name,omitempty" struc:"[64]byte"`
- Type string `binapi:"string[64],name=type" json:"type,omitempty" struc:"[64]byte"`
- PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
- CPUID uint32 `binapi:"u32,name=cpu_id" json:"cpu_id,omitempty"`
- Core uint32 `binapi:"u32,name=core" json:"core,omitempty"`
- CPUSocket uint32 `binapi:"u32,name=cpu_socket" json:"cpu_socket,omitempty"`
-}
-
-func (*ThreadData) GetTypeName() string { return "thread_data" }
-
-// Version represents VPP binary API type 'version'.
-type Version struct {
- Major uint32 `binapi:"u32,name=major" json:"major,omitempty"`
- Minor uint32 `binapi:"u32,name=minor" json:"minor,omitempty"`
- Patch uint32 `binapi:"u32,name=patch" json:"patch,omitempty"`
- PreRelease []byte `binapi:"u8[17],name=pre_release" json:"pre_release,omitempty" struc:"[17]byte"`
- BuildMetadata []byte `binapi:"u8[17],name=build_metadata" json:"build_metadata,omitempty" struc:"[17]byte"`
-}
-
-func (*Version) GetTypeName() string { return "version" }
-
-// AddNodeNext represents VPP binary API message 'add_node_next'.
-type AddNodeNext struct {
- NodeName string `binapi:"string[64],name=node_name" json:"node_name,omitempty" struc:"[64]byte"`
- NextName string `binapi:"string[64],name=next_name" json:"next_name,omitempty" struc:"[64]byte"`
-}
-
-func (m *AddNodeNext) Reset() { *m = AddNodeNext{} }
-func (*AddNodeNext) GetMessageName() string { return "add_node_next" }
-func (*AddNodeNext) GetCrcString() string { return "2457116d" }
-func (*AddNodeNext) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *AddNodeNext) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.NodeName
- size += 64
- // field[1] m.NextName
- size += 64
- return size
-}
-func (m *AddNodeNext) 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.NodeName
- copy(buf[pos:pos+64], m.NodeName)
- pos += 64
- // field[1] m.NextName
- copy(buf[pos:pos+64], m.NextName)
- pos += 64
- return buf, nil
-}
-func (m *AddNodeNext) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.NodeName
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.NodeName = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- // field[1] m.NextName
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.NextName = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- return nil
-}
-
-// AddNodeNextReply represents VPP binary API message 'add_node_next_reply'.
-type AddNodeNextReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- NextIndex uint32 `binapi:"u32,name=next_index" json:"next_index,omitempty"`
-}
-
-func (m *AddNodeNextReply) Reset() { *m = AddNodeNextReply{} }
-func (*AddNodeNextReply) GetMessageName() string { return "add_node_next_reply" }
-func (*AddNodeNextReply) GetCrcString() string { return "2ed75f32" }
-func (*AddNodeNextReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *AddNodeNextReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.NextIndex
- size += 4
- return size
-}
-func (m *AddNodeNextReply) 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.NextIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.NextIndex))
- pos += 4
- return buf, nil
-}
-func (m *AddNodeNextReply) 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.NextIndex
- m.NextIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// Cli represents VPP binary API message 'cli'.
-type Cli struct {
- CmdInShmem uint64 `binapi:"u64,name=cmd_in_shmem" json:"cmd_in_shmem,omitempty"`
-}
-
-func (m *Cli) Reset() { *m = Cli{} }
-func (*Cli) GetMessageName() string { return "cli" }
-func (*Cli) GetCrcString() string { return "23bfbfff" }
-func (*Cli) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *Cli) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.CmdInShmem
- size += 8
- return size
-}
-func (m *Cli) 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.CmdInShmem
- o.PutUint64(buf[pos:pos+8], uint64(m.CmdInShmem))
- pos += 8
- return buf, nil
-}
-func (m *Cli) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.CmdInShmem
- m.CmdInShmem = uint64(o.Uint64(tmp[pos : pos+8]))
- pos += 8
- return nil
-}
-
-// CliInband represents VPP binary API message 'cli_inband'.
-type CliInband struct {
- XXX_CmdLen uint32 `struc:"sizeof=Cmd"`
- Cmd string `json:"cmd,omitempty"`
-}
-
-func (m *CliInband) Reset() { *m = CliInband{} }
-func (*CliInband) GetMessageName() string { return "cli_inband" }
-func (*CliInband) GetCrcString() string { return "f8377302" }
-func (*CliInband) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *CliInband) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Cmd
- size += 4 + len(m.Cmd)
- return size
-}
-func (m *CliInband) 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.Cmd
- o.PutUint32(buf[pos:pos+4], uint32(len(m.Cmd)))
- pos += 4
- copy(buf[pos:pos+len(m.Cmd)], m.Cmd[:])
- pos += len(m.Cmd)
- return buf, nil
-}
-func (m *CliInband) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Cmd
- {
- siz := o.Uint32(tmp[pos : pos+4])
- pos += 4
- m.Cmd = codec.DecodeString(tmp[pos : pos+int(siz)])
- pos += len(m.Cmd)
- }
- return nil
-}
-
-// CliInbandReply represents VPP binary API message 'cli_inband_reply'.
-type CliInbandReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- XXX_ReplyLen uint32 `struc:"sizeof=Reply"`
- Reply string `json:"reply,omitempty"`
-}
-
-func (m *CliInbandReply) Reset() { *m = CliInbandReply{} }
-func (*CliInbandReply) GetMessageName() string { return "cli_inband_reply" }
-func (*CliInbandReply) GetCrcString() string { return "05879051" }
-func (*CliInbandReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *CliInbandReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.Reply
- size += 4 + len(m.Reply)
- return size
-}
-func (m *CliInbandReply) 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.Reply
- o.PutUint32(buf[pos:pos+4], uint32(len(m.Reply)))
- pos += 4
- copy(buf[pos:pos+len(m.Reply)], m.Reply[:])
- pos += len(m.Reply)
- return buf, nil
-}
-func (m *CliInbandReply) 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.Reply
- {
- siz := o.Uint32(tmp[pos : pos+4])
- pos += 4
- m.Reply = codec.DecodeString(tmp[pos : pos+int(siz)])
- pos += len(m.Reply)
- }
- return nil
-}
-
-// CliReply represents VPP binary API message 'cli_reply'.
-type CliReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- ReplyInShmem uint64 `binapi:"u64,name=reply_in_shmem" json:"reply_in_shmem,omitempty"`
-}
-
-func (m *CliReply) Reset() { *m = CliReply{} }
-func (*CliReply) GetMessageName() string { return "cli_reply" }
-func (*CliReply) GetCrcString() string { return "06d68297" }
-func (*CliReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *CliReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.ReplyInShmem
- size += 8
- return size
-}
-func (m *CliReply) 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.ReplyInShmem
- o.PutUint64(buf[pos:pos+8], uint64(m.ReplyInShmem))
- pos += 8
- return buf, nil
-}
-func (m *CliReply) 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.ReplyInShmem
- m.ReplyInShmem = uint64(o.Uint64(tmp[pos : pos+8]))
- pos += 8
- return nil
-}
-
-// ControlPing represents VPP binary API message 'control_ping'.
-type ControlPing struct{}
-
-func (m *ControlPing) Reset() { *m = ControlPing{} }
-func (*ControlPing) GetMessageName() string { return "control_ping" }
-func (*ControlPing) GetCrcString() string { return "51077d14" }
-func (*ControlPing) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *ControlPing) Size() int {
- if m == nil {
- return 0
- }
- var size int
- return size
-}
-func (m *ControlPing) 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
- }
- return buf, nil
-}
-func (m *ControlPing) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- return nil
-}
-
-// ControlPingReply represents VPP binary API message 'control_ping_reply'.
-type ControlPingReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- ClientIndex uint32 `binapi:"u32,name=client_index" json:"client_index,omitempty"`
- VpePID uint32 `binapi:"u32,name=vpe_pid" json:"vpe_pid,omitempty"`
-}
-
-func (m *ControlPingReply) Reset() { *m = ControlPingReply{} }
-func (*ControlPingReply) GetMessageName() string { return "control_ping_reply" }
-func (*ControlPingReply) GetCrcString() string { return "f6b0b8ca" }
-func (*ControlPingReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *ControlPingReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.ClientIndex
- size += 4
- // field[1] m.VpePID
- size += 4
- return size
-}
-func (m *ControlPingReply) 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.ClientIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.ClientIndex))
- pos += 4
- // field[1] m.VpePID
- o.PutUint32(buf[pos:pos+4], uint32(m.VpePID))
- pos += 4
- return buf, nil
-}
-func (m *ControlPingReply) 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.ClientIndex
- m.ClientIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.VpePID
- m.VpePID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// GetF64EndianValue represents VPP binary API message 'get_f64_endian_value'.
-type GetF64EndianValue struct {
- F64One float64 `binapi:"f64,name=f64_one,default=1" json:"f64_one,omitempty"`
-}
-
-func (m *GetF64EndianValue) Reset() { *m = GetF64EndianValue{} }
-func (*GetF64EndianValue) GetMessageName() string { return "get_f64_endian_value" }
-func (*GetF64EndianValue) GetCrcString() string { return "809fcd44" }
-func (*GetF64EndianValue) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *GetF64EndianValue) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.F64One
- size += 8
- return size
-}
-func (m *GetF64EndianValue) 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.F64One
- o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(m.F64One)))
- pos += 8
- return buf, nil
-}
-func (m *GetF64EndianValue) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.F64One
- m.F64One = float64(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
- pos += 8
- return nil
-}
-
-// GetF64EndianValueReply represents VPP binary API message 'get_f64_endian_value_reply'.
-type GetF64EndianValueReply struct {
- Retval uint32 `binapi:"u32,name=retval" json:"retval,omitempty"`
- F64OneResult float64 `binapi:"f64,name=f64_one_result" json:"f64_one_result,omitempty"`
-}
-
-func (m *GetF64EndianValueReply) Reset() { *m = GetF64EndianValueReply{} }
-func (*GetF64EndianValueReply) GetMessageName() string { return "get_f64_endian_value_reply" }
-func (*GetF64EndianValueReply) GetCrcString() string { return "7e02e404" }
-func (*GetF64EndianValueReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *GetF64EndianValueReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.F64OneResult
- size += 8
- return size
-}
-func (m *GetF64EndianValueReply) 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.F64OneResult
- o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(m.F64OneResult)))
- pos += 8
- return buf, nil
-}
-func (m *GetF64EndianValueReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.F64OneResult
- m.F64OneResult = float64(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
- pos += 8
- return nil
-}
-
-// GetF64IncrementByOne represents VPP binary API message 'get_f64_increment_by_one'.
-type GetF64IncrementByOne struct {
- F64Value float64 `binapi:"f64,name=f64_value,default=1" json:"f64_value,omitempty"`
-}
-
-func (m *GetF64IncrementByOne) Reset() { *m = GetF64IncrementByOne{} }
-func (*GetF64IncrementByOne) GetMessageName() string { return "get_f64_increment_by_one" }
-func (*GetF64IncrementByOne) GetCrcString() string { return "b64f027e" }
-func (*GetF64IncrementByOne) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *GetF64IncrementByOne) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.F64Value
- size += 8
- return size
-}
-func (m *GetF64IncrementByOne) 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.F64Value
- o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(m.F64Value)))
- pos += 8
- return buf, nil
-}
-func (m *GetF64IncrementByOne) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.F64Value
- m.F64Value = float64(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
- pos += 8
- return nil
-}
-
-// GetF64IncrementByOneReply represents VPP binary API message 'get_f64_increment_by_one_reply'.
-type GetF64IncrementByOneReply struct {
- Retval uint32 `binapi:"u32,name=retval" json:"retval,omitempty"`
- F64Value float64 `binapi:"f64,name=f64_value" json:"f64_value,omitempty"`
-}
-
-func (m *GetF64IncrementByOneReply) Reset() { *m = GetF64IncrementByOneReply{} }
-func (*GetF64IncrementByOneReply) GetMessageName() string { return "get_f64_increment_by_one_reply" }
-func (*GetF64IncrementByOneReply) GetCrcString() string { return "d25dbaa3" }
-func (*GetF64IncrementByOneReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *GetF64IncrementByOneReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.F64Value
- size += 8
- return size
-}
-func (m *GetF64IncrementByOneReply) 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.F64Value
- o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(m.F64Value)))
- pos += 8
- return buf, nil
-}
-func (m *GetF64IncrementByOneReply) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Retval
- m.Retval = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.F64Value
- m.F64Value = float64(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
- pos += 8
- return nil
-}
-
-// GetNextIndex represents VPP binary API message 'get_next_index'.
-type GetNextIndex struct {
- NodeName string `binapi:"string[64],name=node_name" json:"node_name,omitempty" struc:"[64]byte"`
- NextName string `binapi:"string[64],name=next_name" json:"next_name,omitempty" struc:"[64]byte"`
-}
-
-func (m *GetNextIndex) Reset() { *m = GetNextIndex{} }
-func (*GetNextIndex) GetMessageName() string { return "get_next_index" }
-func (*GetNextIndex) GetCrcString() string { return "2457116d" }
-func (*GetNextIndex) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *GetNextIndex) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.NodeName
- size += 64
- // field[1] m.NextName
- size += 64
- return size
-}
-func (m *GetNextIndex) 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.NodeName
- copy(buf[pos:pos+64], m.NodeName)
- pos += 64
- // field[1] m.NextName
- copy(buf[pos:pos+64], m.NextName)
- pos += 64
- return buf, nil
-}
-func (m *GetNextIndex) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.NodeName
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.NodeName = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- // field[1] m.NextName
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.NextName = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- return nil
-}
-
-// GetNextIndexReply represents VPP binary API message 'get_next_index_reply'.
-type GetNextIndexReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- NextIndex uint32 `binapi:"u32,name=next_index" json:"next_index,omitempty"`
-}
-
-func (m *GetNextIndexReply) Reset() { *m = GetNextIndexReply{} }
-func (*GetNextIndexReply) GetMessageName() string { return "get_next_index_reply" }
-func (*GetNextIndexReply) GetCrcString() string { return "2ed75f32" }
-func (*GetNextIndexReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *GetNextIndexReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.NextIndex
- size += 4
- return size
-}
-func (m *GetNextIndexReply) 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.NextIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.NextIndex))
- pos += 4
- return buf, nil
-}
-func (m *GetNextIndexReply) 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.NextIndex
- m.NextIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// GetNodeGraph represents VPP binary API message 'get_node_graph'.
-type GetNodeGraph struct{}
-
-func (m *GetNodeGraph) Reset() { *m = GetNodeGraph{} }
-func (*GetNodeGraph) GetMessageName() string { return "get_node_graph" }
-func (*GetNodeGraph) GetCrcString() string { return "51077d14" }
-func (*GetNodeGraph) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *GetNodeGraph) Size() int {
- if m == nil {
- return 0
- }
- var size int
- return size
-}
-func (m *GetNodeGraph) 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
- }
- return buf, nil
-}
-func (m *GetNodeGraph) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- return nil
-}
-
-// GetNodeGraphReply represents VPP binary API message 'get_node_graph_reply'.
-type GetNodeGraphReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- ReplyInShmem uint64 `binapi:"u64,name=reply_in_shmem" json:"reply_in_shmem,omitempty"`
-}
-
-func (m *GetNodeGraphReply) Reset() { *m = GetNodeGraphReply{} }
-func (*GetNodeGraphReply) GetMessageName() string { return "get_node_graph_reply" }
-func (*GetNodeGraphReply) GetCrcString() string { return "06d68297" }
-func (*GetNodeGraphReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *GetNodeGraphReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.ReplyInShmem
- size += 8
- return size
-}
-func (m *GetNodeGraphReply) 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.ReplyInShmem
- o.PutUint64(buf[pos:pos+8], uint64(m.ReplyInShmem))
- pos += 8
- return buf, nil
-}
-func (m *GetNodeGraphReply) 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.ReplyInShmem
- m.ReplyInShmem = uint64(o.Uint64(tmp[pos : pos+8]))
- pos += 8
- return nil
-}
-
-// GetNodeIndex represents VPP binary API message 'get_node_index'.
-type GetNodeIndex struct {
- NodeName string `binapi:"string[64],name=node_name" json:"node_name,omitempty" struc:"[64]byte"`
-}
-
-func (m *GetNodeIndex) Reset() { *m = GetNodeIndex{} }
-func (*GetNodeIndex) GetMessageName() string { return "get_node_index" }
-func (*GetNodeIndex) GetCrcString() string { return "f1984c64" }
-func (*GetNodeIndex) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *GetNodeIndex) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.NodeName
- size += 64
- return size
-}
-func (m *GetNodeIndex) 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.NodeName
- copy(buf[pos:pos+64], m.NodeName)
- pos += 64
- return buf, nil
-}
-func (m *GetNodeIndex) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.NodeName
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.NodeName = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- return nil
-}
-
-// GetNodeIndexReply represents VPP binary API message 'get_node_index_reply'.
-type GetNodeIndexReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- NodeIndex uint32 `binapi:"u32,name=node_index" json:"node_index,omitempty"`
-}
-
-func (m *GetNodeIndexReply) Reset() { *m = GetNodeIndexReply{} }
-func (*GetNodeIndexReply) GetMessageName() string { return "get_node_index_reply" }
-func (*GetNodeIndexReply) GetCrcString() string { return "a8600b89" }
-func (*GetNodeIndexReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *GetNodeIndexReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.NodeIndex
- size += 4
- return size
-}
-func (m *GetNodeIndexReply) 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.NodeIndex
- o.PutUint32(buf[pos:pos+4], uint32(m.NodeIndex))
- pos += 4
- return buf, nil
-}
-func (m *GetNodeIndexReply) 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.NodeIndex
- m.NodeIndex = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- return nil
-}
-
-// LogDetails represents VPP binary API message 'log_details'.
-type LogDetails struct {
- Timestamp Timestamp `binapi:"timestamp,name=timestamp" json:"timestamp,omitempty"`
- Level LogLevel `binapi:"log_level,name=level" json:"level,omitempty"`
- MsgClass string `binapi:"string[32],name=msg_class" json:"msg_class,omitempty" struc:"[32]byte"`
- Message string `binapi:"string[256],name=message" json:"message,omitempty" struc:"[256]byte"`
-}
-
-func (m *LogDetails) Reset() { *m = LogDetails{} }
-func (*LogDetails) GetMessageName() string { return "log_details" }
-func (*LogDetails) GetCrcString() string { return "255827a1" }
-func (*LogDetails) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *LogDetails) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Timestamp
- size += 8
- // field[1] m.Level
- size += 4
- // field[1] m.MsgClass
- size += 32
- // field[1] m.Message
- size += 256
- return size
-}
-func (m *LogDetails) 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.Timestamp
- o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(m.Timestamp)))
- pos += 8
- // field[1] m.Level
- o.PutUint32(buf[pos:pos+4], uint32(m.Level))
- pos += 4
- // field[1] m.MsgClass
- copy(buf[pos:pos+32], m.MsgClass)
- pos += 32
- // field[1] m.Message
- copy(buf[pos:pos+256], m.Message)
- pos += 256
- return buf, nil
-}
-func (m *LogDetails) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.Timestamp
- m.Timestamp = Timestamp(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
- pos += 8
- // field[1] m.Level
- m.Level = LogLevel(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.MsgClass
- {
- nul := bytes.Index(tmp[pos:pos+32], []byte{0x00})
- m.MsgClass = codec.DecodeString(tmp[pos : pos+nul])
- pos += 32
- }
- // field[1] m.Message
- {
- nul := bytes.Index(tmp[pos:pos+256], []byte{0x00})
- m.Message = codec.DecodeString(tmp[pos : pos+nul])
- pos += 256
- }
- return nil
-}
-
-// LogDump represents VPP binary API message 'log_dump'.
-type LogDump struct {
- StartTimestamp Timestamp `binapi:"timestamp,name=start_timestamp" json:"start_timestamp,omitempty"`
-}
-
-func (m *LogDump) Reset() { *m = LogDump{} }
-func (*LogDump) GetMessageName() string { return "log_dump" }
-func (*LogDump) GetCrcString() string { return "6ab31753" }
-func (*LogDump) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *LogDump) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.StartTimestamp
- size += 8
- return size
-}
-func (m *LogDump) 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.StartTimestamp
- o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(m.StartTimestamp)))
- pos += 8
- return buf, nil
-}
-func (m *LogDump) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- // field[1] m.StartTimestamp
- m.StartTimestamp = Timestamp(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
- pos += 8
- return nil
-}
-
-// ShowThreads represents VPP binary API message 'show_threads'.
-type ShowThreads struct{}
-
-func (m *ShowThreads) Reset() { *m = ShowThreads{} }
-func (*ShowThreads) GetMessageName() string { return "show_threads" }
-func (*ShowThreads) GetCrcString() string { return "51077d14" }
-func (*ShowThreads) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *ShowThreads) Size() int {
- if m == nil {
- return 0
- }
- var size int
- return size
-}
-func (m *ShowThreads) 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
- }
- return buf, nil
-}
-func (m *ShowThreads) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- return nil
-}
-
-// ShowThreadsReply represents VPP binary API message 'show_threads_reply'.
-type ShowThreadsReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- Count uint32 `binapi:"u32,name=count" json:"count,omitempty" struc:"sizeof=ThreadData"`
- ThreadData []ThreadData `binapi:"thread_data[count],name=thread_data" json:"thread_data,omitempty"`
-}
-
-func (m *ShowThreadsReply) Reset() { *m = ShowThreadsReply{} }
-func (*ShowThreadsReply) GetMessageName() string { return "show_threads_reply" }
-func (*ShowThreadsReply) GetCrcString() string { return "efd78e83" }
-func (*ShowThreadsReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *ShowThreadsReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.Count
- size += 4
- // field[1] m.ThreadData
- for j1 := 0; j1 < len(m.ThreadData); j1++ {
- var s1 ThreadData
- _ = s1
- if j1 < len(m.ThreadData) {
- s1 = m.ThreadData[j1]
- }
- // field[2] s1.ID
- size += 4
- // field[2] s1.Name
- size += 64
- // field[2] s1.Type
- size += 64
- // field[2] s1.PID
- size += 4
- // field[2] s1.CPUID
- size += 4
- // field[2] s1.Core
- size += 4
- // field[2] s1.CPUSocket
- size += 4
- }
- return size
-}
-func (m *ShowThreadsReply) 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.Count
- o.PutUint32(buf[pos:pos+4], uint32(len(m.ThreadData)))
- pos += 4
- // field[1] m.ThreadData
- for j1 := 0; j1 < len(m.ThreadData); j1++ {
- var v1 ThreadData
- if j1 < len(m.ThreadData) {
- v1 = m.ThreadData[j1]
- }
- // field[2] v1.ID
- o.PutUint32(buf[pos:pos+4], uint32(v1.ID))
- pos += 4
- // field[2] v1.Name
- copy(buf[pos:pos+64], v1.Name)
- pos += 64
- // field[2] v1.Type
- copy(buf[pos:pos+64], v1.Type)
- pos += 64
- // field[2] v1.PID
- o.PutUint32(buf[pos:pos+4], uint32(v1.PID))
- pos += 4
- // field[2] v1.CPUID
- o.PutUint32(buf[pos:pos+4], uint32(v1.CPUID))
- pos += 4
- // field[2] v1.Core
- o.PutUint32(buf[pos:pos+4], uint32(v1.Core))
- pos += 4
- // field[2] v1.CPUSocket
- o.PutUint32(buf[pos:pos+4], uint32(v1.CPUSocket))
- pos += 4
- }
- return buf, nil
-}
-func (m *ShowThreadsReply) 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.Count
- m.Count = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[1] m.ThreadData
- m.ThreadData = make([]ThreadData, int(m.Count))
- for j1 := 0; j1 < int(m.Count); j1++ {
- // field[2] m.ThreadData[j1].ID
- m.ThreadData[j1].ID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.ThreadData[j1].Name
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.ThreadData[j1].Name = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- // field[2] m.ThreadData[j1].Type
- {
- nul := bytes.Index(tmp[pos:pos+64], []byte{0x00})
- m.ThreadData[j1].Type = codec.DecodeString(tmp[pos : pos+nul])
- pos += 64
- }
- // field[2] m.ThreadData[j1].PID
- m.ThreadData[j1].PID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.ThreadData[j1].CPUID
- m.ThreadData[j1].CPUID = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.ThreadData[j1].Core
- m.ThreadData[j1].Core = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- // field[2] m.ThreadData[j1].CPUSocket
- m.ThreadData[j1].CPUSocket = uint32(o.Uint32(tmp[pos : pos+4]))
- pos += 4
- }
- return nil
-}
-
-// ShowVersion represents VPP binary API message 'show_version'.
-type ShowVersion struct{}
-
-func (m *ShowVersion) Reset() { *m = ShowVersion{} }
-func (*ShowVersion) GetMessageName() string { return "show_version" }
-func (*ShowVersion) GetCrcString() string { return "51077d14" }
-func (*ShowVersion) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *ShowVersion) Size() int {
- if m == nil {
- return 0
- }
- var size int
- return size
-}
-func (m *ShowVersion) 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
- }
- return buf, nil
-}
-func (m *ShowVersion) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- return nil
-}
-
-// ShowVersionReply represents VPP binary API message 'show_version_reply'.
-type ShowVersionReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- Program string `binapi:"string[32],name=program" json:"program,omitempty" struc:"[32]byte"`
- Version string `binapi:"string[32],name=version" json:"version,omitempty" struc:"[32]byte"`
- BuildDate string `binapi:"string[32],name=build_date" json:"build_date,omitempty" struc:"[32]byte"`
- BuildDirectory string `binapi:"string[256],name=build_directory" json:"build_directory,omitempty" struc:"[256]byte"`
-}
-
-func (m *ShowVersionReply) Reset() { *m = ShowVersionReply{} }
-func (*ShowVersionReply) GetMessageName() string { return "show_version_reply" }
-func (*ShowVersionReply) GetCrcString() string { return "c919bde1" }
-func (*ShowVersionReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *ShowVersionReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.Program
- size += 32
- // field[1] m.Version
- size += 32
- // field[1] m.BuildDate
- size += 32
- // field[1] m.BuildDirectory
- size += 256
- return size
-}
-func (m *ShowVersionReply) 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.Program
- copy(buf[pos:pos+32], m.Program)
- pos += 32
- // field[1] m.Version
- copy(buf[pos:pos+32], m.Version)
- pos += 32
- // field[1] m.BuildDate
- copy(buf[pos:pos+32], m.BuildDate)
- pos += 32
- // field[1] m.BuildDirectory
- copy(buf[pos:pos+256], m.BuildDirectory)
- pos += 256
- return buf, nil
-}
-func (m *ShowVersionReply) 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.Program
- {
- nul := bytes.Index(tmp[pos:pos+32], []byte{0x00})
- m.Program = codec.DecodeString(tmp[pos : pos+nul])
- pos += 32
- }
- // field[1] m.Version
- {
- nul := bytes.Index(tmp[pos:pos+32], []byte{0x00})
- m.Version = codec.DecodeString(tmp[pos : pos+nul])
- pos += 32
- }
- // field[1] m.BuildDate
- {
- nul := bytes.Index(tmp[pos:pos+32], []byte{0x00})
- m.BuildDate = codec.DecodeString(tmp[pos : pos+nul])
- pos += 32
- }
- // field[1] m.BuildDirectory
- {
- nul := bytes.Index(tmp[pos:pos+256], []byte{0x00})
- m.BuildDirectory = codec.DecodeString(tmp[pos : pos+nul])
- pos += 256
- }
- return nil
-}
-
-// ShowVpeSystemTime represents VPP binary API message 'show_vpe_system_time'.
-type ShowVpeSystemTime struct{}
-
-func (m *ShowVpeSystemTime) Reset() { *m = ShowVpeSystemTime{} }
-func (*ShowVpeSystemTime) GetMessageName() string { return "show_vpe_system_time" }
-func (*ShowVpeSystemTime) GetCrcString() string { return "51077d14" }
-func (*ShowVpeSystemTime) GetMessageType() api.MessageType { return api.RequestMessage }
-
-func (m *ShowVpeSystemTime) Size() int {
- if m == nil {
- return 0
- }
- var size int
- return size
-}
-func (m *ShowVpeSystemTime) 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
- }
- return buf, nil
-}
-func (m *ShowVpeSystemTime) Unmarshal(tmp []byte) error {
- o := binary.BigEndian
- _ = o
- pos := 0
- _ = pos
- return nil
-}
-
-// ShowVpeSystemTimeReply represents VPP binary API message 'show_vpe_system_time_reply'.
-type ShowVpeSystemTimeReply struct {
- Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
- VpeSystemTime Timestamp `binapi:"timestamp,name=vpe_system_time" json:"vpe_system_time,omitempty"`
-}
-
-func (m *ShowVpeSystemTimeReply) Reset() { *m = ShowVpeSystemTimeReply{} }
-func (*ShowVpeSystemTimeReply) GetMessageName() string { return "show_vpe_system_time_reply" }
-func (*ShowVpeSystemTimeReply) GetCrcString() string { return "7ffd8193" }
-func (*ShowVpeSystemTimeReply) GetMessageType() api.MessageType { return api.ReplyMessage }
-
-func (m *ShowVpeSystemTimeReply) Size() int {
- if m == nil {
- return 0
- }
- var size int
- // field[1] m.Retval
- size += 4
- // field[1] m.VpeSystemTime
- size += 8
- return size
-}
-func (m *ShowVpeSystemTimeReply) 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.VpeSystemTime
- o.PutUint64(buf[pos:pos+8], math.Float64bits(float64(m.VpeSystemTime)))
- pos += 8
- return buf, nil
-}
-func (m *ShowVpeSystemTimeReply) 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.VpeSystemTime
- m.VpeSystemTime = Timestamp(math.Float64frombits(o.Uint64(tmp[pos : pos+8])))
- pos += 8
- return nil
-}
-
-func init() { file_vpe_binapi_init() }
-func file_vpe_binapi_init() {
- api.RegisterMessage((*AddNodeNext)(nil), "vpe.AddNodeNext")
- api.RegisterMessage((*AddNodeNextReply)(nil), "vpe.AddNodeNextReply")
- api.RegisterMessage((*Cli)(nil), "vpe.Cli")
- api.RegisterMessage((*CliInband)(nil), "vpe.CliInband")
- api.RegisterMessage((*CliInbandReply)(nil), "vpe.CliInbandReply")
- api.RegisterMessage((*CliReply)(nil), "vpe.CliReply")
- api.RegisterMessage((*ControlPing)(nil), "vpe.ControlPing")
- api.RegisterMessage((*ControlPingReply)(nil), "vpe.ControlPingReply")
- api.RegisterMessage((*GetF64EndianValue)(nil), "vpe.GetF64EndianValue")
- api.RegisterMessage((*GetF64EndianValueReply)(nil), "vpe.GetF64EndianValueReply")
- api.RegisterMessage((*GetF64IncrementByOne)(nil), "vpe.GetF64IncrementByOne")
- api.RegisterMessage((*GetF64IncrementByOneReply)(nil), "vpe.GetF64IncrementByOneReply")
- api.RegisterMessage((*GetNextIndex)(nil), "vpe.GetNextIndex")
- api.RegisterMessage((*GetNextIndexReply)(nil), "vpe.GetNextIndexReply")
- api.RegisterMessage((*GetNodeGraph)(nil), "vpe.GetNodeGraph")
- api.RegisterMessage((*GetNodeGraphReply)(nil), "vpe.GetNodeGraphReply")
- api.RegisterMessage((*GetNodeIndex)(nil), "vpe.GetNodeIndex")
- api.RegisterMessage((*GetNodeIndexReply)(nil), "vpe.GetNodeIndexReply")
- api.RegisterMessage((*LogDetails)(nil), "vpe.LogDetails")
- api.RegisterMessage((*LogDump)(nil), "vpe.LogDump")
- api.RegisterMessage((*ShowThreads)(nil), "vpe.ShowThreads")
- api.RegisterMessage((*ShowThreadsReply)(nil), "vpe.ShowThreadsReply")
- api.RegisterMessage((*ShowVersion)(nil), "vpe.ShowVersion")
- api.RegisterMessage((*ShowVersionReply)(nil), "vpe.ShowVersionReply")
- api.RegisterMessage((*ShowVpeSystemTime)(nil), "vpe.ShowVpeSystemTime")
- api.RegisterMessage((*ShowVpeSystemTimeReply)(nil), "vpe.ShowVpeSystemTimeReply")
-}
-
-// Messages returns list of all messages in this module.
-func AllMessages() []api.Message {
- return []api.Message{
- (*AddNodeNext)(nil),
- (*AddNodeNextReply)(nil),
- (*Cli)(nil),
- (*CliInband)(nil),
- (*CliInbandReply)(nil),
- (*CliReply)(nil),
- (*ControlPing)(nil),
- (*ControlPingReply)(nil),
- (*GetF64EndianValue)(nil),
- (*GetF64EndianValueReply)(nil),
- (*GetF64IncrementByOne)(nil),
- (*GetF64IncrementByOneReply)(nil),
- (*GetNextIndex)(nil),
- (*GetNextIndexReply)(nil),
- (*GetNodeGraph)(nil),
- (*GetNodeGraphReply)(nil),
- (*GetNodeIndex)(nil),
- (*GetNodeIndexReply)(nil),
- (*LogDetails)(nil),
- (*LogDump)(nil),
- (*ShowThreads)(nil),
- (*ShowThreadsReply)(nil),
- (*ShowVersion)(nil),
- (*ShowVersionReply)(nil),
- (*ShowVpeSystemTime)(nil),
- (*ShowVpeSystemTimeReply)(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 _ = strings.Contains
-var _ = struc.Pack
-var _ = binary.BigEndian
-var _ = math.Float32bits
-var _ = net.ParseIP
-var _ = fmt.Errorf
diff --git a/examples/binapi/vpe/vpe_rpc.ba.go b/examples/binapi/vpe/vpe_rpc.ba.go
deleted file mode 100644
index e81fb91..0000000
--- a/examples/binapi/vpe/vpe_rpc.ba.go
+++ /dev/null
@@ -1,174 +0,0 @@
-// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
-
-package vpe
-
-import (
- "context"
- "io"
-
- api "git.fd.io/govpp.git/api"
-)
-
-// RPCService represents RPC service API for vpe module.
-type RPCService interface {
- DumpLog(ctx context.Context, in *LogDump) (RPCService_DumpLogClient, error)
- AddNodeNext(ctx context.Context, in *AddNodeNext) (*AddNodeNextReply, error)
- Cli(ctx context.Context, in *Cli) (*CliReply, error)
- CliInband(ctx context.Context, in *CliInband) (*CliInbandReply, error)
- ControlPing(ctx context.Context, in *ControlPing) (*ControlPingReply, error)
- GetF64EndianValue(ctx context.Context, in *GetF64EndianValue) (*GetF64EndianValueReply, error)
- GetF64IncrementByOne(ctx context.Context, in *GetF64IncrementByOne) (*GetF64IncrementByOneReply, error)
- GetNextIndex(ctx context.Context, in *GetNextIndex) (*GetNextIndexReply, error)
- GetNodeGraph(ctx context.Context, in *GetNodeGraph) (*GetNodeGraphReply, error)
- GetNodeIndex(ctx context.Context, in *GetNodeIndex) (*GetNodeIndexReply, error)
- ShowThreads(ctx context.Context, in *ShowThreads) (*ShowThreadsReply, error)
- ShowVersion(ctx context.Context, in *ShowVersion) (*ShowVersionReply, error)
- ShowVpeSystemTime(ctx context.Context, in *ShowVpeSystemTime) (*ShowVpeSystemTimeReply, error)
-}
-
-type serviceClient struct {
- ch api.Channel
-}
-
-func NewServiceClient(ch api.Channel) RPCService {
- return &serviceClient{ch}
-}
-
-func (c *serviceClient) DumpLog(ctx context.Context, in *LogDump) (RPCService_DumpLogClient, error) {
- stream := c.ch.SendMultiRequest(in)
- x := &serviceClient_DumpLogClient{stream}
- return x, nil
-}
-
-type RPCService_DumpLogClient interface {
- Recv() (*LogDetails, error)
-}
-
-type serviceClient_DumpLogClient struct {
- api.MultiRequestCtx
-}
-
-func (c *serviceClient_DumpLogClient) Recv() (*LogDetails, error) {
- m := new(LogDetails)
- stop, err := c.MultiRequestCtx.ReceiveReply(m)
- if err != nil {
- return nil, err
- }
- if stop {
- return nil, io.EOF
- }
- return m, nil
-}
-
-func (c *serviceClient) AddNodeNext(ctx context.Context, in *AddNodeNext) (*AddNodeNextReply, error) {
- out := new(AddNodeNextReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) Cli(ctx context.Context, in *Cli) (*CliReply, error) {
- out := new(CliReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) CliInband(ctx context.Context, in *CliInband) (*CliInbandReply, error) {
- out := new(CliInbandReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) ControlPing(ctx context.Context, in *ControlPing) (*ControlPingReply, error) {
- out := new(ControlPingReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) GetF64EndianValue(ctx context.Context, in *GetF64EndianValue) (*GetF64EndianValueReply, error) {
- out := new(GetF64EndianValueReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) GetF64IncrementByOne(ctx context.Context, in *GetF64IncrementByOne) (*GetF64IncrementByOneReply, error) {
- out := new(GetF64IncrementByOneReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) GetNextIndex(ctx context.Context, in *GetNextIndex) (*GetNextIndexReply, error) {
- out := new(GetNextIndexReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) GetNodeGraph(ctx context.Context, in *GetNodeGraph) (*GetNodeGraphReply, error) {
- out := new(GetNodeGraphReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) GetNodeIndex(ctx context.Context, in *GetNodeIndex) (*GetNodeIndexReply, error) {
- out := new(GetNodeIndexReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) ShowThreads(ctx context.Context, in *ShowThreads) (*ShowThreadsReply, error) {
- out := new(ShowThreadsReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) ShowVersion(ctx context.Context, in *ShowVersion) (*ShowVersionReply, error) {
- out := new(ShowVersionReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-func (c *serviceClient) ShowVpeSystemTime(ctx context.Context, in *ShowVpeSystemTime) (*ShowVpeSystemTimeReply, error) {
- out := new(ShowVpeSystemTimeReply)
- err := c.ch.SendRequest(in).ReceiveReply(out)
- if err != nil {
- return nil, err
- }
- return out, nil
-}
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ = api.RegisterMessage
-var _ = context.Background
-var _ = io.Copy
diff --git a/examples/multi-vpp/multi_vpp.go b/examples/multi-vpp/multi_vpp.go
index 244dd03..8714c9a 100644
--- a/examples/multi-vpp/multi_vpp.go
+++ b/examples/multi-vpp/multi_vpp.go
@@ -18,17 +18,18 @@ package main
import (
"flag"
"fmt"
+ "log"
+ "os"
+
"git.fd.io/govpp.git"
"git.fd.io/govpp.git/adapter/socketclient"
"git.fd.io/govpp.git/api"
+ interfaces "git.fd.io/govpp.git/binapi/interface"
+ "git.fd.io/govpp.git/binapi/interface_types"
+ "git.fd.io/govpp.git/binapi/ip"
+ "git.fd.io/govpp.git/binapi/ip_types"
+ "git.fd.io/govpp.git/binapi/vpe"
"git.fd.io/govpp.git/core"
- "git.fd.io/govpp.git/examples/binapi/interface_types"
- "git.fd.io/govpp.git/examples/binapi/interfaces"
- "git.fd.io/govpp.git/examples/binapi/ip"
- "git.fd.io/govpp.git/examples/binapi/ip_types"
- "git.fd.io/govpp.git/examples/binapi/vpe"
- "log"
- "os"
)
var (
@@ -175,7 +176,6 @@ func addIPToInterface(ch api.Channel, index interface_types.InterfaceIndex, ip s
return
}
-
req := &interfaces.SwInterfaceAddDelAddress{
SwIfIndex: index,
IsAdd: true,
@@ -212,7 +212,7 @@ func retrieveIPAddresses(ch api.Channel, index interface_types.InterfaceIndex) {
break
}
prefix := ip_types.Prefix(msg.Prefix)
- fmt.Printf(" - ip address: %+v\n", prefix.ToString())
+ fmt.Printf(" - ip address: %v\n", prefix)
}
fmt.Println("OK")
diff --git a/examples/perf-bench/perf-bench.go b/examples/perf-bench/perf-bench.go
index a7ec146..6472068 100644
--- a/examples/perf-bench/perf-bench.go
+++ b/examples/perf-bench/perf-bench.go
@@ -30,8 +30,8 @@ import (
"git.fd.io/govpp.git/adapter/socketclient"
"git.fd.io/govpp.git/adapter/statsclient"
"git.fd.io/govpp.git/api"
+ "git.fd.io/govpp.git/binapi/vpe"
"git.fd.io/govpp.git/core"
- "git.fd.io/govpp.git/examples/binapi/vpe"
)
const (
diff --git a/examples/rpc-service/rpc_service.go b/examples/rpc-service/rpc_service.go
index 8ff6c08..e20e5c0 100644
--- a/examples/rpc-service/rpc_service.go
+++ b/examples/rpc-service/rpc_service.go
@@ -27,8 +27,8 @@ import (
"git.fd.io/govpp.git"
"git.fd.io/govpp.git/adapter/socketclient"
"git.fd.io/govpp.git/api"
- "git.fd.io/govpp.git/examples/binapi/interfaces"
- "git.fd.io/govpp.git/examples/binapi/vpe"
+ interfaces "git.fd.io/govpp.git/binapi/interface"
+ "git.fd.io/govpp.git/binapi/vpe"
)
var (
@@ -47,20 +47,13 @@ func main() {
}
defer conn.Disconnect()
- // create a channel
- ch, err := conn.NewAPIChannel()
- if err != nil {
- log.Fatalln("ERROR: creating channel failed:", err)
- }
- defer ch.Close()
-
- showVersion(ch)
- interfaceDump(ch)
+ showVersion(conn)
+ interfaceDump(conn)
}
// showVersion shows an example of simple request with services.
-func showVersion(ch api.Channel) {
- c := vpe.NewServiceClient(ch)
+func showVersion(conn api.Connection) {
+ c := vpe.NewServiceClient(conn)
version, err := c.ShowVersion(context.Background(), &vpe.ShowVersion{})
if err != nil {
@@ -71,10 +64,10 @@ func showVersion(ch api.Channel) {
}
// interfaceDump shows an example of multi request with services.
-func interfaceDump(ch api.Channel) {
- c := interfaces.NewServiceClient(ch)
+func interfaceDump(conn api.Connection) {
+ c := interfaces.NewServiceClient(conn)
- stream, err := c.DumpSwInterface(context.Background(), &interfaces.SwInterfaceDump{})
+ stream, err := c.SwInterfaceDump(context.Background(), &interfaces.SwInterfaceDump{})
if err != nil {
log.Fatalln("ERROR: DumpSwInterface failed:", err)
}
diff --git a/examples/simple-client/simple_client.go b/examples/simple-client/simple_client.go
index 7aeaa0b..e3ba83d 100644
--- a/examples/simple-client/simple_client.go
+++ b/examples/simple-client/simple_client.go
@@ -18,6 +18,7 @@ package main
import (
"context"
+ "encoding/json"
"flag"
"fmt"
"log"
@@ -26,13 +27,13 @@ import (
"git.fd.io/govpp.git"
"git.fd.io/govpp.git/adapter/socketclient"
"git.fd.io/govpp.git/api"
+ interfaces "git.fd.io/govpp.git/binapi/interface"
+ "git.fd.io/govpp.git/binapi/interface_types"
+ "git.fd.io/govpp.git/binapi/ip"
+ "git.fd.io/govpp.git/binapi/ip_types"
+ "git.fd.io/govpp.git/binapi/mactime"
+ "git.fd.io/govpp.git/binapi/vpe"
"git.fd.io/govpp.git/core"
- "git.fd.io/govpp.git/examples/binapi/interface_types"
- "git.fd.io/govpp.git/examples/binapi/interfaces"
- "git.fd.io/govpp.git/examples/binapi/ip"
- "git.fd.io/govpp.git/examples/binapi/ip_types"
- "git.fd.io/govpp.git/examples/binapi/mactime"
- "git.fd.io/govpp.git/examples/binapi/vpe"
)
var (
@@ -156,6 +157,7 @@ func interfaceDump(ch api.Channel) {
}
n++
fmt.Printf(" - interface #%d: %+v\n", n, msg)
+ marshal(msg)
}
fmt.Println("OK")
@@ -177,6 +179,7 @@ func addIPAddress(ch api.Channel, index interface_types.InterfaceIndex) {
Len: 32,
},
}
+ marshal(req)
reply := &interfaces.SwInterfaceAddDelAddressReply{}
if err := ch.SendRequest(req).ReceiveReply(reply); err != nil {
@@ -208,6 +211,7 @@ func ipAddressDump(ch api.Channel, index interface_types.InterfaceIndex) {
break
}
fmt.Printf(" - ip address: %+v\n", msg)
+ marshal(msg)
}
fmt.Println("OK")
@@ -242,7 +246,9 @@ func interfaceNotifications(ch api.Channel, index interface_types.InterfaceIndex
// receive notifications
go func() {
for notif := range notifChan {
- fmt.Printf("incoming event: %+v\n", notif.(*interfaces.SwInterfaceEvent))
+ e := notif.(*interfaces.SwInterfaceEvent)
+ fmt.Printf("incoming event: %+v\n", e)
+ marshal(e)
}
}()
@@ -326,3 +332,12 @@ Loop:
fmt.Println("OK")
fmt.Println()
}
+
+func marshal(v interface{}) {
+ fmt.Printf("GO: %#v\n", v)
+ b, err := json.MarshalIndent(v, "", " ")
+ if err != nil {
+ panic(err)
+ }
+ fmt.Printf("JSON: %s\n", b)
+}