diff options
author | 2021-08-26 13:10:48 +0200 | |
---|---|---|
committer | 2021-08-26 13:10:48 +0200 | |
commit | debc52dea8a81417bb08ca5bb934c7876b6d65e0 (patch) | |
tree | 23909430d78d6b77c2b414814e843708a6bab08e /binapi/virtio | |
parent | c0da1f2999a6b08d003c0fed1a23e1ca60dd1571 (diff) |
regenerate binapi
Signed-off-by: mhalaj1 <matus.halaj@pantheon.tech>
Change-Id: I9bb6a5ca00aa542128bde0bfbbba7b57b9f16ed2
Diffstat (limited to 'binapi/virtio')
-rw-r--r-- | binapi/virtio/virtio.ba.go | 180 | ||||
-rw-r--r-- | binapi/virtio/virtio_rpc.ba.go | 10 |
2 files changed, 181 insertions, 9 deletions
diff --git a/binapi/virtio/virtio.ba.go b/binapi/virtio/virtio.ba.go index 6234a17..3124aef 100644 --- a/binapi/virtio/virtio.ba.go +++ b/binapi/virtio/virtio.ba.go @@ -1,17 +1,20 @@ // Code generated by GoVPP's binapi-generator. DO NOT EDIT. // versions: -// binapi-generator: v0.4.0 -// VPP: 20.05.1-release +// binapi-generator: v0.3.5-56-gc0da1f2-dirty +// VPP: 21.06-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 ( + "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" @@ -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), } diff --git a/binapi/virtio/virtio_rpc.ba.go b/binapi/virtio/virtio_rpc.ba.go index 4ee8ff7..22716e1 100644 --- a/binapi/virtio/virtio_rpc.ba.go +++ b/binapi/virtio/virtio_rpc.ba.go @@ -15,6 +15,7 @@ import ( type RPCService interface { SwInterfaceVirtioPciDump(ctx context.Context, in *SwInterfaceVirtioPciDump) (RPCService_SwInterfaceVirtioPciDumpClient, error) VirtioPciCreate(ctx context.Context, in *VirtioPciCreate) (*VirtioPciCreateReply, error) + VirtioPciCreateV2(ctx context.Context, in *VirtioPciCreateV2) (*VirtioPciCreateV2Reply, error) VirtioPciDelete(ctx context.Context, in *VirtioPciDelete) (*VirtioPciDeleteReply, error) } @@ -74,6 +75,15 @@ func (c *serviceClient) VirtioPciCreate(ctx context.Context, in *VirtioPciCreate return out, api.RetvalToVPPApiError(out.Retval) } +func (c *serviceClient) VirtioPciCreateV2(ctx context.Context, in *VirtioPciCreateV2) (*VirtioPciCreateV2Reply, error) { + out := new(VirtioPciCreateV2Reply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, api.RetvalToVPPApiError(out.Retval) +} + func (c *serviceClient) VirtioPciDelete(ctx context.Context, in *VirtioPciDelete) (*VirtioPciDeleteReply, error) { out := new(VirtioPciDeleteReply) err := c.conn.Invoke(ctx, in, out) |