+// CreateVhostUserIfV2 defines message 'create_vhost_user_if_v2'.
+type CreateVhostUserIfV2 struct {
+ IsServer bool `binapi:"bool,name=is_server" json:"is_server,omitempty"`
+ SockFilename string `binapi:"string[256],name=sock_filename" json:"sock_filename,omitempty"`
+ Renumber bool `binapi:"bool,name=renumber" json:"renumber,omitempty"`
+ DisableMrgRxbuf bool `binapi:"bool,name=disable_mrg_rxbuf" json:"disable_mrg_rxbuf,omitempty"`
+ DisableIndirectDesc bool `binapi:"bool,name=disable_indirect_desc" json:"disable_indirect_desc,omitempty"`
+ EnableGso bool `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"`
+ EnablePacked bool `binapi:"bool,name=enable_packed" json:"enable_packed,omitempty"`
+ EnableEventIdx bool `binapi:"bool,name=enable_event_idx" json:"enable_event_idx,omitempty"`
+ CustomDevInstance uint32 `binapi:"u32,name=custom_dev_instance" json:"custom_dev_instance,omitempty"`
+ UseCustomMac bool `binapi:"bool,name=use_custom_mac" json:"use_custom_mac,omitempty"`
+ MacAddress ethernet_types.MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
+ Tag string `binapi:"string[64],name=tag" json:"tag,omitempty"`
+}
+
+func (m *CreateVhostUserIfV2) Reset() { *m = CreateVhostUserIfV2{} }
+func (*CreateVhostUserIfV2) GetMessageName() string { return "create_vhost_user_if_v2" }
+func (*CreateVhostUserIfV2) GetCrcString() string { return "dba1cc1d" }
+func (*CreateVhostUserIfV2) GetMessageType() api.MessageType {
+ return api.RequestMessage
+}
+
+func (m *CreateVhostUserIfV2) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 1 // m.IsServer
+ size += 256 // m.SockFilename
+ size += 1 // m.Renumber
+ size += 1 // m.DisableMrgRxbuf
+ size += 1 // m.DisableIndirectDesc
+ size += 1 // m.EnableGso
+ size += 1 // m.EnablePacked
+ size += 1 // m.EnableEventIdx
+ size += 4 // m.CustomDevInstance
+ size += 1 // m.UseCustomMac
+ size += 1 * 6 // m.MacAddress
+ size += 64 // m.Tag
+ return size
+}
+func (m *CreateVhostUserIfV2) Marshal(b []byte) ([]byte, error) {
+ if b == nil {
+ b = make([]byte, m.Size())
+ }
+ buf := codec.NewBuffer(b)
+ buf.EncodeBool(m.IsServer)
+ buf.EncodeString(m.SockFilename, 256)
+ buf.EncodeBool(m.Renumber)
+ buf.EncodeBool(m.DisableMrgRxbuf)
+ buf.EncodeBool(m.DisableIndirectDesc)
+ buf.EncodeBool(m.EnableGso)
+ buf.EncodeBool(m.EnablePacked)
+ buf.EncodeBool(m.EnableEventIdx)
+ buf.EncodeUint32(m.CustomDevInstance)
+ buf.EncodeBool(m.UseCustomMac)
+ buf.EncodeBytes(m.MacAddress[:], 6)
+ buf.EncodeString(m.Tag, 64)
+ return buf.Bytes(), nil
+}
+func (m *CreateVhostUserIfV2) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.IsServer = buf.DecodeBool()
+ m.SockFilename = buf.DecodeString(256)
+ m.Renumber = buf.DecodeBool()
+ m.DisableMrgRxbuf = buf.DecodeBool()
+ m.DisableIndirectDesc = buf.DecodeBool()
+ m.EnableGso = buf.DecodeBool()
+ m.EnablePacked = buf.DecodeBool()
+ m.EnableEventIdx = buf.DecodeBool()
+ m.CustomDevInstance = buf.DecodeUint32()
+ m.UseCustomMac = buf.DecodeBool()
+ copy(m.MacAddress[:], buf.DecodeBytes(6))
+ m.Tag = buf.DecodeString(64)
+ return nil
+}
+
+// CreateVhostUserIfV2Reply defines message 'create_vhost_user_if_v2_reply'.
+type CreateVhostUserIfV2Reply 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 *CreateVhostUserIfV2Reply) Reset() { *m = CreateVhostUserIfV2Reply{} }
+func (*CreateVhostUserIfV2Reply) GetMessageName() string { return "create_vhost_user_if_v2_reply" }
+func (*CreateVhostUserIfV2Reply) GetCrcString() string { return "5383d31f" }
+func (*CreateVhostUserIfV2Reply) GetMessageType() api.MessageType {
+ return api.ReplyMessage
+}
+
+func (m *CreateVhostUserIfV2Reply) Size() (size int) {
+ if m == nil {
+ return 0
+ }
+ size += 4 // m.Retval
+ size += 4 // m.SwIfIndex
+ return size
+}
+func (m *CreateVhostUserIfV2Reply) 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 *CreateVhostUserIfV2Reply) Unmarshal(b []byte) error {
+ buf := codec.NewBuffer(b)
+ m.Retval = buf.DecodeInt32()
+ m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
+ return nil
+}
+