aboutsummaryrefslogtreecommitdiffstats
path: root/binapi/virtio/virtio.ba.go
diff options
context:
space:
mode:
Diffstat (limited to 'binapi/virtio/virtio.ba.go')
-rw-r--r--binapi/virtio/virtio.ba.go190
1 files changed, 176 insertions, 14 deletions
diff --git a/binapi/virtio/virtio.ba.go b/binapi/virtio/virtio.ba.go
index b29b52f..7cb371b 100644
--- a/binapi/virtio/virtio.ba.go
+++ b/binapi/virtio/virtio.ba.go
@@ -1,22 +1,25 @@
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// versions:
-// binapi-generator: v0.4.0-dev
-// VPP: 20.05-release
+// binapi-generator: v0.6.0-dev
+// VPP: 22.02-release
// source: /usr/share/vpp/api/core/virtio.api.json
// Package virtio contains generated bindings for API file virtio.api.
//
// Contents:
-// 6 messages
+// 1 enum
+// 8 messages
//
package virtio
import (
- 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"
- pci_types "git.fd.io/govpp.git/binapi/pci_types"
- codec "git.fd.io/govpp.git/codec"
+ "strconv"
+
+ api "go.fd.io/govpp/api"
+ ethernet_types "go.fd.io/govpp/binapi/ethernet_types"
+ interface_types "go.fd.io/govpp/binapi/interface_types"
+ pci_types "go.fd.io/govpp/binapi/pci_types"
+ codec "go.fd.io/govpp/codec"
)
// This is a compile-time assertion to ensure that this generated file
@@ -27,10 +30,68 @@ const _ = api.GoVppAPIPackageIsVersion2
const (
APIFile = "virtio"
- APIVersion = "2.0.0"
- VersionCrc = 0x601b1fdc
+ APIVersion = "3.0.0"
+ VersionCrc = 0xa507d784
+)
+
+// VirtioFlags defines enum 'virtio_flags'.
+type VirtioFlags uint32
+
+const (
+ VIRTIO_API_FLAG_GSO VirtioFlags = 1
+ VIRTIO_API_FLAG_CSUM_OFFLOAD VirtioFlags = 2
+ VIRTIO_API_FLAG_GRO_COALESCE VirtioFlags = 4
+ VIRTIO_API_FLAG_PACKED VirtioFlags = 8
+ VIRTIO_API_FLAG_IN_ORDER VirtioFlags = 16
+ VIRTIO_API_FLAG_BUFFERING VirtioFlags = 32
)
+var (
+ VirtioFlags_name = map[uint32]string{
+ 1: "VIRTIO_API_FLAG_GSO",
+ 2: "VIRTIO_API_FLAG_CSUM_OFFLOAD",
+ 4: "VIRTIO_API_FLAG_GRO_COALESCE",
+ 8: "VIRTIO_API_FLAG_PACKED",
+ 16: "VIRTIO_API_FLAG_IN_ORDER",
+ 32: "VIRTIO_API_FLAG_BUFFERING",
+ }
+ VirtioFlags_value = map[string]uint32{
+ "VIRTIO_API_FLAG_GSO": 1,
+ "VIRTIO_API_FLAG_CSUM_OFFLOAD": 2,
+ "VIRTIO_API_FLAG_GRO_COALESCE": 4,
+ "VIRTIO_API_FLAG_PACKED": 8,
+ "VIRTIO_API_FLAG_IN_ORDER": 16,
+ "VIRTIO_API_FLAG_BUFFERING": 32,
+ }
+)
+
+func (x VirtioFlags) String() string {
+ s, ok := VirtioFlags_name[uint32(x)]
+ if ok {
+ return s
+ }
+ str := func(n uint32) string {
+ s, ok := VirtioFlags_name[uint32(n)]
+ if ok {
+ return s
+ }
+ return "VirtioFlags(" + strconv.Itoa(int(n)) + ")"
+ }
+ for i := uint32(0); i <= 32; i++ {
+ val := uint32(x)
+ if val&(1<<i) != 0 {
+ if s != "" {
+ s += "|"
+ }
+ s += str(1 << i)
+ }
+ }
+ if s == "" {
+ return str(uint32(x))
+ }
+ return s
+}
+
// SwInterfaceVirtioPciDetails defines message 'sw_interface_virtio_pci_details'.
type SwInterfaceVirtioPciDetails struct {
SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
@@ -43,7 +104,7 @@ type SwInterfaceVirtioPciDetails struct {
func (m *SwInterfaceVirtioPciDetails) Reset() { *m = SwInterfaceVirtioPciDetails{} }
func (*SwInterfaceVirtioPciDetails) GetMessageName() string { return "sw_interface_virtio_pci_details" }
-func (*SwInterfaceVirtioPciDetails) GetCrcString() string { return "16187f3a" }
+func (*SwInterfaceVirtioPciDetails) GetCrcString() string { return "6ca9c167" }
func (*SwInterfaceVirtioPciDetails) GetMessageType() api.MessageType {
return api.ReplyMessage
}
@@ -121,6 +182,7 @@ func (m *SwInterfaceVirtioPciDump) Unmarshal(b []byte) error {
}
// VirtioPciCreate defines message 'virtio_pci_create'.
+// Deprecated: the message will be removed in the future versions
type VirtioPciCreate struct {
PciAddr pci_types.PciAddress `binapi:"pci_address,name=pci_addr" json:"pci_addr,omitempty"`
UseRandomMac bool `binapi:"bool,name=use_random_mac" json:"use_random_mac,omitempty"`
@@ -132,7 +194,7 @@ type VirtioPciCreate struct {
func (m *VirtioPciCreate) Reset() { *m = VirtioPciCreate{} }
func (*VirtioPciCreate) GetMessageName() string { return "virtio_pci_create" }
-func (*VirtioPciCreate) GetCrcString() string { return "a9f1370c" }
+func (*VirtioPciCreate) GetCrcString() string { return "1944f8db" }
func (*VirtioPciCreate) GetMessageType() api.MessageType {
return api.RequestMessage
}
@@ -183,6 +245,7 @@ func (m *VirtioPciCreate) Unmarshal(b []byte) error {
}
// VirtioPciCreateReply defines message 'virtio_pci_create_reply'.
+// Deprecated: the message will be removed in the future versions
type VirtioPciCreateReply 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"`
@@ -219,6 +282,101 @@ func (m *VirtioPciCreateReply) Unmarshal(b []byte) error {
return nil
}
+// VirtioPciCreateV2 defines message 'virtio_pci_create_v2'.
+type VirtioPciCreateV2 struct {
+ PciAddr pci_types.PciAddress `binapi:"pci_address,name=pci_addr" json:"pci_addr,omitempty"`
+ UseRandomMac bool `binapi:"bool,name=use_random_mac" json:"use_random_mac,omitempty"`
+ MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
+ VirtioFlags VirtioFlags `binapi:"virtio_flags,name=virtio_flags" json:"virtio_flags,omitempty"`
+ Features uint64 `binapi:"u64,name=features" json:"features,omitempty"`
+}
+
+func (m *VirtioPciCreateV2) Reset() { *m = VirtioPciCreateV2{} }
+func (*VirtioPciCreateV2) GetMessageName() string { return "virtio_pci_create_v2" }
+func (*VirtioPciCreateV2) GetCrcString() string { return "5d096e1a" }
+func (*VirtioPciCreateV2) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *VirtioPciCreateV2) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 2 // m.PciAddr.Domain
+ size += 1 // m.PciAddr.Bus
+ size += 1 // m.PciAddr.Slot
+ size += 1 // m.PciAddr.Function
+ size += 1 // m.UseRandomMac
+ size += 1 * 6 // m.MacAddress
+ size += 4 // m.VirtioFlags
+ size += 8 // m.Features
+ return size
+}
+func (m *VirtioPciCreateV2) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeUint16(m.PciAddr.Domain)
+ buf.EncodeUint8(m.PciAddr.Bus)
+ buf.EncodeUint8(m.PciAddr.Slot)
+ buf.EncodeUint8(m.PciAddr.Function)
+ buf.EncodeBool(m.UseRandomMac)
+ buf.EncodeBytes(m.MacAddress[:], 6)
+ buf.EncodeUint32(uint32(m.VirtioFlags))
+ buf.EncodeUint64(m.Features)
+ return buf.Bytes(), nil
+}
+func (m *VirtioPciCreateV2) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.PciAddr.Domain = buf.DecodeUint16()
+ m.PciAddr.Bus = buf.DecodeUint8()
+ m.PciAddr.Slot = buf.DecodeUint8()
+ m.PciAddr.Function = buf.DecodeUint8()
+ m.UseRandomMac = buf.DecodeBool()
+ copy(m.MacAddress[:], buf.DecodeBytes(6))
+ m.VirtioFlags = VirtioFlags(buf.DecodeUint32())
+ m.Features = buf.DecodeUint64()
+ return nil
+}
+
+// VirtioPciCreateV2Reply defines message 'virtio_pci_create_v2_reply'.
+type VirtioPciCreateV2Reply 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 *VirtioPciCreateV2Reply) Reset() { *m = VirtioPciCreateV2Reply{} }
+func (*VirtioPciCreateV2Reply) GetMessageName() string { return "virtio_pci_create_v2_reply" }
+func (*VirtioPciCreateV2Reply) GetCrcString() string { return "5383d31f" }
+func (*VirtioPciCreateV2Reply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *VirtioPciCreateV2Reply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *VirtioPciCreateV2Reply) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeInt32(m.Retval)
+ buf.EncodeUint32(uint32(m.SwIfIndex))
+ return buf.Bytes(), nil
+}
+func (m *VirtioPciCreateV2Reply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+
// VirtioPciDelete defines message 'virtio_pci_delete'.
type VirtioPciDelete struct {
SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
@@ -287,10 +445,12 @@ func (m *VirtioPciDeleteReply) Unmarshal(b []byte) error {
func init() { file_virtio_binapi_init() }
func file_virtio_binapi_init() {
- api.RegisterMessage((*SwInterfaceVirtioPciDetails)(nil), "sw_interface_virtio_pci_details_16187f3a")
+ api.RegisterMessage((*SwInterfaceVirtioPciDetails)(nil), "sw_interface_virtio_pci_details_6ca9c167")
api.RegisterMessage((*SwInterfaceVirtioPciDump)(nil), "sw_interface_virtio_pci_dump_51077d14")
- api.RegisterMessage((*VirtioPciCreate)(nil), "virtio_pci_create_a9f1370c")
+ api.RegisterMessage((*VirtioPciCreate)(nil), "virtio_pci_create_1944f8db")
api.RegisterMessage((*VirtioPciCreateReply)(nil), "virtio_pci_create_reply_5383d31f")
+ api.RegisterMessage((*VirtioPciCreateV2)(nil), "virtio_pci_create_v2_5d096e1a")
+ api.RegisterMessage((*VirtioPciCreateV2Reply)(nil), "virtio_pci_create_v2_reply_5383d31f")
api.RegisterMessage((*VirtioPciDelete)(nil), "virtio_pci_delete_f9e6675e")
api.RegisterMessage((*VirtioPciDeleteReply)(nil), "virtio_pci_delete_reply_e8d4e804")
}
@@ -302,6 +462,8 @@ func AllMessages() []api.Message {
(*SwInterfaceVirtioPciDump)(nil),
(*VirtioPciCreate)(nil),
(*VirtioPciCreateReply)(nil),
+ (*VirtioPciCreateV2)(nil),
+ (*VirtioPciCreateV2Reply)(nil),
(*VirtioPciDelete)(nil),
(*VirtioPciDeleteReply)(nil),
}