// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
-// binapi-generator: v0.4.0-dev
-// VPP: 20.05-release
+// binapi-generator: v0.5.0-dev
+// VPP: 21.06-release
// source: /usr/share/vpp/api/core/tapv2.api.json
// Package tapv2 contains generated bindings for API file tapv2.api.
package tapv2
import (
+ "strconv"
+
api "git.fd.io/govpp.git/api"
ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
interface_types "git.fd.io/govpp.git/binapi/interface_types"
ip_types "git.fd.io/govpp.git/binapi/ip_types"
codec "git.fd.io/govpp.git/codec"
- "strconv"
)
// This is a compile-time assertion to ensure that this generated file
const (
APIFile = "tapv2"
APIVersion = "4.0.0"
- VersionCrc = 0x3ed7c42d
+ VersionCrc = 0xc20c291f
)
// TapFlags defines enum 'tap_flags'.
TAP_API_FLAG_ATTACH TapFlags = 8
TAP_API_FLAG_TUN TapFlags = 16
TAP_API_FLAG_GRO_COALESCE TapFlags = 32
+ TAP_API_FLAG_PACKED TapFlags = 64
+ TAP_API_FLAG_IN_ORDER TapFlags = 128
)
var (
TapFlags_name = map[uint32]string{
- 1: "TAP_API_FLAG_GSO",
- 2: "TAP_API_FLAG_CSUM_OFFLOAD",
- 4: "TAP_API_FLAG_PERSIST",
- 8: "TAP_API_FLAG_ATTACH",
- 16: "TAP_API_FLAG_TUN",
- 32: "TAP_API_FLAG_GRO_COALESCE",
+ 1: "TAP_API_FLAG_GSO",
+ 2: "TAP_API_FLAG_CSUM_OFFLOAD",
+ 4: "TAP_API_FLAG_PERSIST",
+ 8: "TAP_API_FLAG_ATTACH",
+ 16: "TAP_API_FLAG_TUN",
+ 32: "TAP_API_FLAG_GRO_COALESCE",
+ 64: "TAP_API_FLAG_PACKED",
+ 128: "TAP_API_FLAG_IN_ORDER",
}
TapFlags_value = map[string]uint32{
"TAP_API_FLAG_GSO": 1,
"TAP_API_FLAG_ATTACH": 8,
"TAP_API_FLAG_TUN": 16,
"TAP_API_FLAG_GRO_COALESCE": 32,
+ "TAP_API_FLAG_PACKED": 64,
+ "TAP_API_FLAG_IN_ORDER": 128,
}
)
func (m *SwInterfaceTapV2Details) Reset() { *m = SwInterfaceTapV2Details{} }
func (*SwInterfaceTapV2Details) GetMessageName() string { return "sw_interface_tap_v2_details" }
-func (*SwInterfaceTapV2Details) GetCrcString() string { return "e53c16de" }
+func (*SwInterfaceTapV2Details) GetCrcString() string { return "1e2b2a47" }
func (*SwInterfaceTapV2Details) GetMessageType() api.MessageType {
return api.ReplyMessage
}
-func (m *SwInterfaceTapV2Details) Size() int {
+func (m *SwInterfaceTapV2Details) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.SwIfIndex
size += 4 // m.ID
size += 2 // m.TxRingSz
return size
}
func (m *SwInterfaceTapV2Details) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.SwIfIndex))
- buf.EncodeUint32(uint32(m.ID))
- buf.EncodeUint16(uint16(m.TxRingSz))
- buf.EncodeUint16(uint16(m.RxRingSz))
- buf.EncodeUint32(uint32(m.HostMtuSize))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.SwIfIndex)
+ buf.EncodeUint32(m.ID)
+ buf.EncodeUint16(m.TxRingSz)
+ buf.EncodeUint16(m.RxRingSz)
+ buf.EncodeUint32(m.HostMtuSize)
buf.EncodeBytes(m.HostMacAddr[:], 6)
buf.EncodeBytes(m.HostIP4Prefix.Address[:], 4)
- buf.EncodeUint8(uint8(m.HostIP4Prefix.Len))
+ buf.EncodeUint8(m.HostIP4Prefix.Len)
buf.EncodeBytes(m.HostIP6Prefix.Address[:], 16)
- buf.EncodeUint8(uint8(m.HostIP6Prefix.Len))
+ buf.EncodeUint8(m.HostIP6Prefix.Len)
buf.EncodeUint32(uint32(m.TapFlags))
buf.EncodeString(m.DevName, 64)
buf.EncodeString(m.HostIfName, 64)
// SwInterfaceTapV2Dump defines message 'sw_interface_tap_v2_dump'.
type SwInterfaceTapV2Dump struct {
- SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"`
+ SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
}
func (m *SwInterfaceTapV2Dump) Reset() { *m = SwInterfaceTapV2Dump{} }
return api.RequestMessage
}
-func (m *SwInterfaceTapV2Dump) Size() int {
+func (m *SwInterfaceTapV2Dump) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.SwIfIndex
return size
}
func (m *SwInterfaceTapV2Dump) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
buf.EncodeUint32(uint32(m.SwIfIndex))
return buf.Bytes(), nil
}
// TapCreateV2 defines message 'tap_create_v2'.
type TapCreateV2 struct {
- ID uint32 `binapi:"u32,name=id,default=%!s(float64=4.294967295e+09)" json:"id,omitempty"`
+ ID uint32 `binapi:"u32,name=id,default=4294967295" json:"id,omitempty"`
UseRandomMac bool `binapi:"bool,name=use_random_mac,default=true" json:"use_random_mac,omitempty"`
MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
- NumRxQueues uint8 `binapi:"u8,name=num_rx_queues,default=%!s(float64=1)" json:"num_rx_queues,omitempty"`
- TxRingSz uint16 `binapi:"u16,name=tx_ring_sz,default=%!s(float64=256)" json:"tx_ring_sz,omitempty"`
- RxRingSz uint16 `binapi:"u16,name=rx_ring_sz,default=%!s(float64=256)" json:"rx_ring_sz,omitempty"`
+ NumRxQueues uint8 `binapi:"u8,name=num_rx_queues,default=1" json:"num_rx_queues,omitempty"`
+ TxRingSz uint16 `binapi:"u16,name=tx_ring_sz,default=256" json:"tx_ring_sz,omitempty"`
+ RxRingSz uint16 `binapi:"u16,name=rx_ring_sz,default=256" json:"rx_ring_sz,omitempty"`
HostMtuSet bool `binapi:"bool,name=host_mtu_set" json:"host_mtu_set,omitempty"`
HostMtuSize uint32 `binapi:"u32,name=host_mtu_size" json:"host_mtu_size,omitempty"`
HostMacAddrSet bool `binapi:"bool,name=host_mac_addr_set" json:"host_mac_addr_set,omitempty"`
func (m *TapCreateV2) Reset() { *m = TapCreateV2{} }
func (*TapCreateV2) GetMessageName() string { return "tap_create_v2" }
-func (*TapCreateV2) GetCrcString() string { return "445835fd" }
+func (*TapCreateV2) GetCrcString() string { return "2d0d6570" }
func (*TapCreateV2) GetMessageType() api.MessageType {
return api.RequestMessage
}
-func (m *TapCreateV2) Size() int {
+func (m *TapCreateV2) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.ID
size += 1 // m.UseRandomMac
size += 1 * 6 // m.MacAddress
return size
}
func (m *TapCreateV2) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.ID))
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint32(m.ID)
buf.EncodeBool(m.UseRandomMac)
buf.EncodeBytes(m.MacAddress[:], 6)
- buf.EncodeUint8(uint8(m.NumRxQueues))
- buf.EncodeUint16(uint16(m.TxRingSz))
- buf.EncodeUint16(uint16(m.RxRingSz))
+ buf.EncodeUint8(m.NumRxQueues)
+ buf.EncodeUint16(m.TxRingSz)
+ buf.EncodeUint16(m.RxRingSz)
buf.EncodeBool(m.HostMtuSet)
- buf.EncodeUint32(uint32(m.HostMtuSize))
+ buf.EncodeUint32(m.HostMtuSize)
buf.EncodeBool(m.HostMacAddrSet)
buf.EncodeBytes(m.HostMacAddr[:], 6)
buf.EncodeBool(m.HostIP4PrefixSet)
buf.EncodeBytes(m.HostIP4Prefix.Address[:], 4)
- buf.EncodeUint8(uint8(m.HostIP4Prefix.Len))
+ buf.EncodeUint8(m.HostIP4Prefix.Len)
buf.EncodeBool(m.HostIP6PrefixSet)
buf.EncodeBytes(m.HostIP6Prefix.Address[:], 16)
- buf.EncodeUint8(uint8(m.HostIP6Prefix.Len))
+ buf.EncodeUint8(m.HostIP6Prefix.Len)
buf.EncodeBool(m.HostIP4GwSet)
buf.EncodeBytes(m.HostIP4Gw[:], 4)
buf.EncodeBool(m.HostIP6GwSet)
return api.ReplyMessage
}
-func (m *TapCreateV2Reply) Size() int {
+func (m *TapCreateV2Reply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
size += 4 // m.SwIfIndex
return size
}
func (m *TapCreateV2Reply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
buf.EncodeUint32(uint32(m.SwIfIndex))
return buf.Bytes(), nil
}
func (m *TapCreateV2Reply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
return nil
}
return api.RequestMessage
}
-func (m *TapDeleteV2) Size() int {
+func (m *TapDeleteV2) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.SwIfIndex
return size
}
func (m *TapDeleteV2) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
+ buf := codec.NewBuffer(b)
buf.EncodeUint32(uint32(m.SwIfIndex))
return buf.Bytes(), nil
}
return api.ReplyMessage
}
-func (m *TapDeleteV2Reply) Size() int {
+func (m *TapDeleteV2Reply) Size() (size int) {
if m == nil {
return 0
}
- var size int
size += 4 // m.Retval
return size
}
func (m *TapDeleteV2Reply) Marshal(b []byte) ([]byte, error) {
- var buf *codec.Buffer
if b == nil {
- buf = codec.NewBuffer(make([]byte, m.Size()))
- } else {
- buf = codec.NewBuffer(b)
+ b = make([]byte, m.Size())
}
- buf.EncodeUint32(uint32(m.Retval))
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
return buf.Bytes(), nil
}
func (m *TapDeleteV2Reply) Unmarshal(b []byte) error {
buf := codec.NewBuffer(b)
- m.Retval = int32(buf.DecodeUint32())
+ m.Retval = buf.DecodeInt32()
return nil
}
func init() { file_tapv2_binapi_init() }
func file_tapv2_binapi_init() {
- api.RegisterMessage((*SwInterfaceTapV2Details)(nil), "sw_interface_tap_v2_details_e53c16de")
+ api.RegisterMessage((*SwInterfaceTapV2Details)(nil), "sw_interface_tap_v2_details_1e2b2a47")
api.RegisterMessage((*SwInterfaceTapV2Dump)(nil), "sw_interface_tap_v2_dump_f9e6675e")
- api.RegisterMessage((*TapCreateV2)(nil), "tap_create_v2_445835fd")
+ api.RegisterMessage((*TapCreateV2)(nil), "tap_create_v2_2d0d6570")
api.RegisterMessage((*TapCreateV2Reply)(nil), "tap_create_v2_reply_5383d31f")
api.RegisterMessage((*TapDeleteV2)(nil), "tap_delete_v2_f9e6675e")
api.RegisterMessage((*TapDeleteV2Reply)(nil), "tap_delete_v2_reply_e8d4e804")