+// 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
+}
+