github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/vmxnet3/vmxnet3.ba.go (about)

     1  // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
     2  // versions:
     3  //  binapi-generator: v0.10.0-dev
     4  //  VPP:              23.10-rc0~170-g6f1548434
     5  // source: plugins/vmxnet3.api.json
     6  
     7  // Package vmxnet3 contains generated bindings for API file vmxnet3.api.
     8  //
     9  // Contents:
    10  // -  2 structs
    11  // -  8 messages
    12  package vmxnet3
    13  
    14  import (
    15  	ethernet_types "github.com/networkservicemesh/govpp/binapi/ethernet_types"
    16  	interface_types "github.com/networkservicemesh/govpp/binapi/interface_types"
    17  	api "go.fd.io/govpp/api"
    18  	codec "go.fd.io/govpp/codec"
    19  )
    20  
    21  // This is a compile-time assertion to ensure that this generated file
    22  // is compatible with the GoVPP api package it is being compiled against.
    23  // A compilation error at this line likely means your copy of the
    24  // GoVPP api package needs to be updated.
    25  const _ = api.GoVppAPIPackageIsVersion2
    26  
    27  const (
    28  	APIFile    = "vmxnet3"
    29  	APIVersion = "1.2.0"
    30  	VersionCrc = 0x609454ea
    31  )
    32  
    33  // Vmxnet3RxList defines type 'vmxnet3_rx_list'.
    34  type Vmxnet3RxList struct {
    35  	RxQsize   uint16   `binapi:"u16,name=rx_qsize" json:"rx_qsize,omitempty"`
    36  	RxFill    []uint16 `binapi:"u16[2],name=rx_fill" json:"rx_fill,omitempty"`
    37  	RxNext    uint16   `binapi:"u16,name=rx_next" json:"rx_next,omitempty"`
    38  	RxProduce []uint16 `binapi:"u16[2],name=rx_produce" json:"rx_produce,omitempty"`
    39  	RxConsume []uint16 `binapi:"u16[2],name=rx_consume" json:"rx_consume,omitempty"`
    40  }
    41  
    42  // Vmxnet3TxList defines type 'vmxnet3_tx_list'.
    43  type Vmxnet3TxList struct {
    44  	TxQsize   uint16 `binapi:"u16,name=tx_qsize" json:"tx_qsize,omitempty"`
    45  	TxNext    uint16 `binapi:"u16,name=tx_next" json:"tx_next,omitempty"`
    46  	TxProduce uint16 `binapi:"u16,name=tx_produce" json:"tx_produce,omitempty"`
    47  	TxConsume uint16 `binapi:"u16,name=tx_consume" json:"tx_consume,omitempty"`
    48  }
    49  
    50  // Reply for vmxnet3_interface_dump
    51  //   - sw_if_index - index of the interface
    52  //   - if_name - name of the interface
    53  //   - hw_addr - interface MAC address
    54  //   - pci_addr - pci address of the interface
    55  //   - version - vmxnet3 hardware version
    56  //   - admin_up_down - interface administrative status
    57  //   - rx_count - number of elements in rx_list
    58  //   - rx_list - list of vmxnet3_rx_list
    59  //   - tx_count - number of elements in tx_list
    60  //   - tx_list - list of vmnxnet3_tx_list
    61  //
    62  // SwVmxnet3InterfaceDetails defines message 'sw_vmxnet3_interface_details'.
    63  type SwVmxnet3InterfaceDetails struct {
    64  	SwIfIndex   interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
    65  	IfName      string                         `binapi:"string[64],name=if_name" json:"if_name,omitempty"`
    66  	HwAddr      ethernet_types.MacAddress      `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"`
    67  	PciAddr     uint32                         `binapi:"u32,name=pci_addr" json:"pci_addr,omitempty"`
    68  	Version     uint8                          `binapi:"u8,name=version" json:"version,omitempty"`
    69  	AdminUpDown bool                           `binapi:"bool,name=admin_up_down" json:"admin_up_down,omitempty"`
    70  	RxCount     uint8                          `binapi:"u8,name=rx_count" json:"rx_count,omitempty"`
    71  	RxList      [16]Vmxnet3RxList              `binapi:"vmxnet3_rx_list[16],name=rx_list" json:"rx_list,omitempty"`
    72  	TxCount     uint8                          `binapi:"u8,name=tx_count" json:"tx_count,omitempty"`
    73  	TxList      [8]Vmxnet3TxList               `binapi:"vmxnet3_tx_list[8],name=tx_list" json:"tx_list,omitempty"`
    74  }
    75  
    76  func (m *SwVmxnet3InterfaceDetails) Reset()               { *m = SwVmxnet3InterfaceDetails{} }
    77  func (*SwVmxnet3InterfaceDetails) GetMessageName() string { return "sw_vmxnet3_interface_details" }
    78  func (*SwVmxnet3InterfaceDetails) GetCrcString() string   { return "6a1a5498" }
    79  func (*SwVmxnet3InterfaceDetails) GetMessageType() api.MessageType {
    80  	return api.ReplyMessage
    81  }
    82  
    83  func (m *SwVmxnet3InterfaceDetails) Size() (size int) {
    84  	if m == nil {
    85  		return 0
    86  	}
    87  	size += 4     // m.SwIfIndex
    88  	size += 64    // m.IfName
    89  	size += 1 * 6 // m.HwAddr
    90  	size += 4     // m.PciAddr
    91  	size += 1     // m.Version
    92  	size += 1     // m.AdminUpDown
    93  	size += 1     // m.RxCount
    94  	for j1 := 0; j1 < 16; j1++ {
    95  		size += 2     // m.RxList[j1].RxQsize
    96  		size += 2 * 2 // m.RxList[j1].RxFill
    97  		size += 2     // m.RxList[j1].RxNext
    98  		size += 2 * 2 // m.RxList[j1].RxProduce
    99  		size += 2 * 2 // m.RxList[j1].RxConsume
   100  	}
   101  	size += 1 // m.TxCount
   102  	for j1 := 0; j1 < 8; j1++ {
   103  		size += 2 // m.TxList[j1].TxQsize
   104  		size += 2 // m.TxList[j1].TxNext
   105  		size += 2 // m.TxList[j1].TxProduce
   106  		size += 2 // m.TxList[j1].TxConsume
   107  	}
   108  	return size
   109  }
   110  func (m *SwVmxnet3InterfaceDetails) Marshal(b []byte) ([]byte, error) {
   111  	if b == nil {
   112  		b = make([]byte, m.Size())
   113  	}
   114  	buf := codec.NewBuffer(b)
   115  	buf.EncodeUint32(uint32(m.SwIfIndex))
   116  	buf.EncodeString(m.IfName, 64)
   117  	buf.EncodeBytes(m.HwAddr[:], 6)
   118  	buf.EncodeUint32(m.PciAddr)
   119  	buf.EncodeUint8(m.Version)
   120  	buf.EncodeBool(m.AdminUpDown)
   121  	buf.EncodeUint8(m.RxCount)
   122  	for j0 := 0; j0 < 16; j0++ {
   123  		buf.EncodeUint16(m.RxList[j0].RxQsize)
   124  		for i := 0; i < 2; i++ {
   125  			var x uint16
   126  			if i < len(m.RxList[j0].RxFill) {
   127  				x = uint16(m.RxList[j0].RxFill[i])
   128  			}
   129  			buf.EncodeUint16(x)
   130  		}
   131  		buf.EncodeUint16(m.RxList[j0].RxNext)
   132  		for i := 0; i < 2; i++ {
   133  			var x uint16
   134  			if i < len(m.RxList[j0].RxProduce) {
   135  				x = uint16(m.RxList[j0].RxProduce[i])
   136  			}
   137  			buf.EncodeUint16(x)
   138  		}
   139  		for i := 0; i < 2; i++ {
   140  			var x uint16
   141  			if i < len(m.RxList[j0].RxConsume) {
   142  				x = uint16(m.RxList[j0].RxConsume[i])
   143  			}
   144  			buf.EncodeUint16(x)
   145  		}
   146  	}
   147  	buf.EncodeUint8(m.TxCount)
   148  	for j0 := 0; j0 < 8; j0++ {
   149  		buf.EncodeUint16(m.TxList[j0].TxQsize)
   150  		buf.EncodeUint16(m.TxList[j0].TxNext)
   151  		buf.EncodeUint16(m.TxList[j0].TxProduce)
   152  		buf.EncodeUint16(m.TxList[j0].TxConsume)
   153  	}
   154  	return buf.Bytes(), nil
   155  }
   156  func (m *SwVmxnet3InterfaceDetails) Unmarshal(b []byte) error {
   157  	buf := codec.NewBuffer(b)
   158  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   159  	m.IfName = buf.DecodeString(64)
   160  	copy(m.HwAddr[:], buf.DecodeBytes(6))
   161  	m.PciAddr = buf.DecodeUint32()
   162  	m.Version = buf.DecodeUint8()
   163  	m.AdminUpDown = buf.DecodeBool()
   164  	m.RxCount = buf.DecodeUint8()
   165  	for j0 := 0; j0 < 16; j0++ {
   166  		m.RxList[j0].RxQsize = buf.DecodeUint16()
   167  		m.RxList[j0].RxFill = make([]uint16, 2)
   168  		for i := 0; i < len(m.RxList[j0].RxFill); i++ {
   169  			m.RxList[j0].RxFill[i] = buf.DecodeUint16()
   170  		}
   171  		m.RxList[j0].RxNext = buf.DecodeUint16()
   172  		m.RxList[j0].RxProduce = make([]uint16, 2)
   173  		for i := 0; i < len(m.RxList[j0].RxProduce); i++ {
   174  			m.RxList[j0].RxProduce[i] = buf.DecodeUint16()
   175  		}
   176  		m.RxList[j0].RxConsume = make([]uint16, 2)
   177  		for i := 0; i < len(m.RxList[j0].RxConsume); i++ {
   178  			m.RxList[j0].RxConsume[i] = buf.DecodeUint16()
   179  		}
   180  	}
   181  	m.TxCount = buf.DecodeUint8()
   182  	for j0 := 0; j0 < 8; j0++ {
   183  		m.TxList[j0].TxQsize = buf.DecodeUint16()
   184  		m.TxList[j0].TxNext = buf.DecodeUint16()
   185  		m.TxList[j0].TxProduce = buf.DecodeUint16()
   186  		m.TxList[j0].TxConsume = buf.DecodeUint16()
   187  	}
   188  	return nil
   189  }
   190  
   191  // Dump vmxnet3 interfaces
   192  //   - vl_api_interface_index_t sw_if_index [default=0xffffffff];
   193  //
   194  // SwVmxnet3InterfaceDump defines message 'sw_vmxnet3_interface_dump'.
   195  type SwVmxnet3InterfaceDump struct {
   196  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
   197  }
   198  
   199  func (m *SwVmxnet3InterfaceDump) Reset()               { *m = SwVmxnet3InterfaceDump{} }
   200  func (*SwVmxnet3InterfaceDump) GetMessageName() string { return "sw_vmxnet3_interface_dump" }
   201  func (*SwVmxnet3InterfaceDump) GetCrcString() string   { return "f9e6675e" }
   202  func (*SwVmxnet3InterfaceDump) GetMessageType() api.MessageType {
   203  	return api.RequestMessage
   204  }
   205  
   206  func (m *SwVmxnet3InterfaceDump) Size() (size int) {
   207  	if m == nil {
   208  		return 0
   209  	}
   210  	size += 4 // m.SwIfIndex
   211  	return size
   212  }
   213  func (m *SwVmxnet3InterfaceDump) Marshal(b []byte) ([]byte, error) {
   214  	if b == nil {
   215  		b = make([]byte, m.Size())
   216  	}
   217  	buf := codec.NewBuffer(b)
   218  	buf.EncodeUint32(uint32(m.SwIfIndex))
   219  	return buf.Bytes(), nil
   220  }
   221  func (m *SwVmxnet3InterfaceDump) Unmarshal(b []byte) error {
   222  	buf := codec.NewBuffer(b)
   223  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   224  	return nil
   225  }
   226  
   227  // - client_index - opaque cookie to identify the sender
   228  //   - pci_addr - pci address as unsigned 32bit integer:
   229  //     0-15 domain, 16-23 bus, 24-28 slot, 29-31 function
   230  //     ddddddddddddddddbbbbbbbbsssssfff
   231  //   - enable_elog - turn on elog (optional - default is off)
   232  //   - rxq_size - receive queue size (optional - default is 1024)
   233  //   - rxq_num - number of receive queues (optional - default is 1)
   234  //   - txq_size - transmit queue size (optional - default is 1024)
   235  //   - txq_num - number of transmit queues (optional - default is 1)
   236  //   - bind - automatically bind PCI to vfio-pci module
   237  //     (optional - default is 0)
   238  //   - enable_gso - enable gso (optional - default is 0)
   239  //
   240  // Vmxnet3Create defines message 'vmxnet3_create'.
   241  type Vmxnet3Create struct {
   242  	PciAddr    uint32 `binapi:"u32,name=pci_addr" json:"pci_addr,omitempty"`
   243  	EnableElog int32  `binapi:"i32,name=enable_elog" json:"enable_elog,omitempty"`
   244  	RxqSize    uint16 `binapi:"u16,name=rxq_size" json:"rxq_size,omitempty"`
   245  	RxqNum     uint16 `binapi:"u16,name=rxq_num" json:"rxq_num,omitempty"`
   246  	TxqSize    uint16 `binapi:"u16,name=txq_size" json:"txq_size,omitempty"`
   247  	TxqNum     uint16 `binapi:"u16,name=txq_num" json:"txq_num,omitempty"`
   248  	Bind       uint8  `binapi:"u8,name=bind" json:"bind,omitempty"`
   249  	EnableGso  bool   `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"`
   250  }
   251  
   252  func (m *Vmxnet3Create) Reset()               { *m = Vmxnet3Create{} }
   253  func (*Vmxnet3Create) GetMessageName() string { return "vmxnet3_create" }
   254  func (*Vmxnet3Create) GetCrcString() string   { return "71a07314" }
   255  func (*Vmxnet3Create) GetMessageType() api.MessageType {
   256  	return api.RequestMessage
   257  }
   258  
   259  func (m *Vmxnet3Create) Size() (size int) {
   260  	if m == nil {
   261  		return 0
   262  	}
   263  	size += 4 // m.PciAddr
   264  	size += 4 // m.EnableElog
   265  	size += 2 // m.RxqSize
   266  	size += 2 // m.RxqNum
   267  	size += 2 // m.TxqSize
   268  	size += 2 // m.TxqNum
   269  	size += 1 // m.Bind
   270  	size += 1 // m.EnableGso
   271  	return size
   272  }
   273  func (m *Vmxnet3Create) Marshal(b []byte) ([]byte, error) {
   274  	if b == nil {
   275  		b = make([]byte, m.Size())
   276  	}
   277  	buf := codec.NewBuffer(b)
   278  	buf.EncodeUint32(m.PciAddr)
   279  	buf.EncodeInt32(m.EnableElog)
   280  	buf.EncodeUint16(m.RxqSize)
   281  	buf.EncodeUint16(m.RxqNum)
   282  	buf.EncodeUint16(m.TxqSize)
   283  	buf.EncodeUint16(m.TxqNum)
   284  	buf.EncodeUint8(m.Bind)
   285  	buf.EncodeBool(m.EnableGso)
   286  	return buf.Bytes(), nil
   287  }
   288  func (m *Vmxnet3Create) Unmarshal(b []byte) error {
   289  	buf := codec.NewBuffer(b)
   290  	m.PciAddr = buf.DecodeUint32()
   291  	m.EnableElog = buf.DecodeInt32()
   292  	m.RxqSize = buf.DecodeUint16()
   293  	m.RxqNum = buf.DecodeUint16()
   294  	m.TxqSize = buf.DecodeUint16()
   295  	m.TxqNum = buf.DecodeUint16()
   296  	m.Bind = buf.DecodeUint8()
   297  	m.EnableGso = buf.DecodeBool()
   298  	return nil
   299  }
   300  
   301  // - context - sender context, to match reply w/ request
   302  //   - retval - return value for request
   303  //   - sw_if_index - software index for the new vmxnet3 interface
   304  //
   305  // Vmxnet3CreateReply defines message 'vmxnet3_create_reply'.
   306  type Vmxnet3CreateReply struct {
   307  	Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
   308  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   309  }
   310  
   311  func (m *Vmxnet3CreateReply) Reset()               { *m = Vmxnet3CreateReply{} }
   312  func (*Vmxnet3CreateReply) GetMessageName() string { return "vmxnet3_create_reply" }
   313  func (*Vmxnet3CreateReply) GetCrcString() string   { return "5383d31f" }
   314  func (*Vmxnet3CreateReply) GetMessageType() api.MessageType {
   315  	return api.ReplyMessage
   316  }
   317  
   318  func (m *Vmxnet3CreateReply) Size() (size int) {
   319  	if m == nil {
   320  		return 0
   321  	}
   322  	size += 4 // m.Retval
   323  	size += 4 // m.SwIfIndex
   324  	return size
   325  }
   326  func (m *Vmxnet3CreateReply) Marshal(b []byte) ([]byte, error) {
   327  	if b == nil {
   328  		b = make([]byte, m.Size())
   329  	}
   330  	buf := codec.NewBuffer(b)
   331  	buf.EncodeInt32(m.Retval)
   332  	buf.EncodeUint32(uint32(m.SwIfIndex))
   333  	return buf.Bytes(), nil
   334  }
   335  func (m *Vmxnet3CreateReply) Unmarshal(b []byte) error {
   336  	buf := codec.NewBuffer(b)
   337  	m.Retval = buf.DecodeInt32()
   338  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   339  	return nil
   340  }
   341  
   342  // - client_index - opaque cookie to identify the sender
   343  //   - sw_if_index - interface index
   344  //
   345  // Vmxnet3Delete defines message 'vmxnet3_delete'.
   346  type Vmxnet3Delete struct {
   347  	SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   348  }
   349  
   350  func (m *Vmxnet3Delete) Reset()               { *m = Vmxnet3Delete{} }
   351  func (*Vmxnet3Delete) GetMessageName() string { return "vmxnet3_delete" }
   352  func (*Vmxnet3Delete) GetCrcString() string   { return "f9e6675e" }
   353  func (*Vmxnet3Delete) GetMessageType() api.MessageType {
   354  	return api.RequestMessage
   355  }
   356  
   357  func (m *Vmxnet3Delete) Size() (size int) {
   358  	if m == nil {
   359  		return 0
   360  	}
   361  	size += 4 // m.SwIfIndex
   362  	return size
   363  }
   364  func (m *Vmxnet3Delete) Marshal(b []byte) ([]byte, error) {
   365  	if b == nil {
   366  		b = make([]byte, m.Size())
   367  	}
   368  	buf := codec.NewBuffer(b)
   369  	buf.EncodeUint32(uint32(m.SwIfIndex))
   370  	return buf.Bytes(), nil
   371  }
   372  func (m *Vmxnet3Delete) Unmarshal(b []byte) error {
   373  	buf := codec.NewBuffer(b)
   374  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   375  	return nil
   376  }
   377  
   378  // Vmxnet3DeleteReply defines message 'vmxnet3_delete_reply'.
   379  type Vmxnet3DeleteReply struct {
   380  	Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
   381  }
   382  
   383  func (m *Vmxnet3DeleteReply) Reset()               { *m = Vmxnet3DeleteReply{} }
   384  func (*Vmxnet3DeleteReply) GetMessageName() string { return "vmxnet3_delete_reply" }
   385  func (*Vmxnet3DeleteReply) GetCrcString() string   { return "e8d4e804" }
   386  func (*Vmxnet3DeleteReply) GetMessageType() api.MessageType {
   387  	return api.ReplyMessage
   388  }
   389  
   390  func (m *Vmxnet3DeleteReply) Size() (size int) {
   391  	if m == nil {
   392  		return 0
   393  	}
   394  	size += 4 // m.Retval
   395  	return size
   396  }
   397  func (m *Vmxnet3DeleteReply) Marshal(b []byte) ([]byte, error) {
   398  	if b == nil {
   399  		b = make([]byte, m.Size())
   400  	}
   401  	buf := codec.NewBuffer(b)
   402  	buf.EncodeInt32(m.Retval)
   403  	return buf.Bytes(), nil
   404  }
   405  func (m *Vmxnet3DeleteReply) Unmarshal(b []byte) error {
   406  	buf := codec.NewBuffer(b)
   407  	m.Retval = buf.DecodeInt32()
   408  	return nil
   409  }
   410  
   411  // Memory interface details structure
   412  //   - sw_if_index - index of the interface
   413  //   - if_name - name of the interface
   414  //   - hw_addr - interface MAC address
   415  //   - pci_addr - pci address of the interface
   416  //   - version - vmxnet3 hardware version
   417  //   - admin_up_down - interface administrative status
   418  //   - rx_count - number of elements in rx_list
   419  //   - rx_list - list of vmxnet3_rx_list
   420  //   - tx_count - number of elements in tx_list
   421  //   - tx_list - list of vmnxnet3_tx_list
   422  //
   423  // Vmxnet3Details defines message 'vmxnet3_details'.
   424  type Vmxnet3Details struct {
   425  	SwIfIndex   interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
   426  	IfName      string                         `binapi:"string[64],name=if_name" json:"if_name,omitempty"`
   427  	HwAddr      ethernet_types.MacAddress      `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"`
   428  	PciAddr     uint32                         `binapi:"u32,name=pci_addr" json:"pci_addr,omitempty"`
   429  	Version     uint8                          `binapi:"u8,name=version" json:"version,omitempty"`
   430  	AdminUpDown bool                           `binapi:"bool,name=admin_up_down" json:"admin_up_down,omitempty"`
   431  	RxCount     uint8                          `binapi:"u8,name=rx_count" json:"rx_count,omitempty"`
   432  	RxList      [16]Vmxnet3RxList              `binapi:"vmxnet3_rx_list[16],name=rx_list" json:"rx_list,omitempty"`
   433  	TxCount     uint8                          `binapi:"u8,name=tx_count" json:"tx_count,omitempty"`
   434  	TxList      [8]Vmxnet3TxList               `binapi:"vmxnet3_tx_list[8],name=tx_list" json:"tx_list,omitempty"`
   435  }
   436  
   437  func (m *Vmxnet3Details) Reset()               { *m = Vmxnet3Details{} }
   438  func (*Vmxnet3Details) GetMessageName() string { return "vmxnet3_details" }
   439  func (*Vmxnet3Details) GetCrcString() string   { return "6a1a5498" }
   440  func (*Vmxnet3Details) GetMessageType() api.MessageType {
   441  	return api.ReplyMessage
   442  }
   443  
   444  func (m *Vmxnet3Details) Size() (size int) {
   445  	if m == nil {
   446  		return 0
   447  	}
   448  	size += 4     // m.SwIfIndex
   449  	size += 64    // m.IfName
   450  	size += 1 * 6 // m.HwAddr
   451  	size += 4     // m.PciAddr
   452  	size += 1     // m.Version
   453  	size += 1     // m.AdminUpDown
   454  	size += 1     // m.RxCount
   455  	for j1 := 0; j1 < 16; j1++ {
   456  		size += 2     // m.RxList[j1].RxQsize
   457  		size += 2 * 2 // m.RxList[j1].RxFill
   458  		size += 2     // m.RxList[j1].RxNext
   459  		size += 2 * 2 // m.RxList[j1].RxProduce
   460  		size += 2 * 2 // m.RxList[j1].RxConsume
   461  	}
   462  	size += 1 // m.TxCount
   463  	for j1 := 0; j1 < 8; j1++ {
   464  		size += 2 // m.TxList[j1].TxQsize
   465  		size += 2 // m.TxList[j1].TxNext
   466  		size += 2 // m.TxList[j1].TxProduce
   467  		size += 2 // m.TxList[j1].TxConsume
   468  	}
   469  	return size
   470  }
   471  func (m *Vmxnet3Details) Marshal(b []byte) ([]byte, error) {
   472  	if b == nil {
   473  		b = make([]byte, m.Size())
   474  	}
   475  	buf := codec.NewBuffer(b)
   476  	buf.EncodeUint32(uint32(m.SwIfIndex))
   477  	buf.EncodeString(m.IfName, 64)
   478  	buf.EncodeBytes(m.HwAddr[:], 6)
   479  	buf.EncodeUint32(m.PciAddr)
   480  	buf.EncodeUint8(m.Version)
   481  	buf.EncodeBool(m.AdminUpDown)
   482  	buf.EncodeUint8(m.RxCount)
   483  	for j0 := 0; j0 < 16; j0++ {
   484  		buf.EncodeUint16(m.RxList[j0].RxQsize)
   485  		for i := 0; i < 2; i++ {
   486  			var x uint16
   487  			if i < len(m.RxList[j0].RxFill) {
   488  				x = uint16(m.RxList[j0].RxFill[i])
   489  			}
   490  			buf.EncodeUint16(x)
   491  		}
   492  		buf.EncodeUint16(m.RxList[j0].RxNext)
   493  		for i := 0; i < 2; i++ {
   494  			var x uint16
   495  			if i < len(m.RxList[j0].RxProduce) {
   496  				x = uint16(m.RxList[j0].RxProduce[i])
   497  			}
   498  			buf.EncodeUint16(x)
   499  		}
   500  		for i := 0; i < 2; i++ {
   501  			var x uint16
   502  			if i < len(m.RxList[j0].RxConsume) {
   503  				x = uint16(m.RxList[j0].RxConsume[i])
   504  			}
   505  			buf.EncodeUint16(x)
   506  		}
   507  	}
   508  	buf.EncodeUint8(m.TxCount)
   509  	for j0 := 0; j0 < 8; j0++ {
   510  		buf.EncodeUint16(m.TxList[j0].TxQsize)
   511  		buf.EncodeUint16(m.TxList[j0].TxNext)
   512  		buf.EncodeUint16(m.TxList[j0].TxProduce)
   513  		buf.EncodeUint16(m.TxList[j0].TxConsume)
   514  	}
   515  	return buf.Bytes(), nil
   516  }
   517  func (m *Vmxnet3Details) Unmarshal(b []byte) error {
   518  	buf := codec.NewBuffer(b)
   519  	m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
   520  	m.IfName = buf.DecodeString(64)
   521  	copy(m.HwAddr[:], buf.DecodeBytes(6))
   522  	m.PciAddr = buf.DecodeUint32()
   523  	m.Version = buf.DecodeUint8()
   524  	m.AdminUpDown = buf.DecodeBool()
   525  	m.RxCount = buf.DecodeUint8()
   526  	for j0 := 0; j0 < 16; j0++ {
   527  		m.RxList[j0].RxQsize = buf.DecodeUint16()
   528  		m.RxList[j0].RxFill = make([]uint16, 2)
   529  		for i := 0; i < len(m.RxList[j0].RxFill); i++ {
   530  			m.RxList[j0].RxFill[i] = buf.DecodeUint16()
   531  		}
   532  		m.RxList[j0].RxNext = buf.DecodeUint16()
   533  		m.RxList[j0].RxProduce = make([]uint16, 2)
   534  		for i := 0; i < len(m.RxList[j0].RxProduce); i++ {
   535  			m.RxList[j0].RxProduce[i] = buf.DecodeUint16()
   536  		}
   537  		m.RxList[j0].RxConsume = make([]uint16, 2)
   538  		for i := 0; i < len(m.RxList[j0].RxConsume); i++ {
   539  			m.RxList[j0].RxConsume[i] = buf.DecodeUint16()
   540  		}
   541  	}
   542  	m.TxCount = buf.DecodeUint8()
   543  	for j0 := 0; j0 < 8; j0++ {
   544  		m.TxList[j0].TxQsize = buf.DecodeUint16()
   545  		m.TxList[j0].TxNext = buf.DecodeUint16()
   546  		m.TxList[j0].TxProduce = buf.DecodeUint16()
   547  		m.TxList[j0].TxConsume = buf.DecodeUint16()
   548  	}
   549  	return nil
   550  }
   551  
   552  // Dump all vmxnet3 interfaces
   553  // Vmxnet3Dump defines message 'vmxnet3_dump'.
   554  // Deprecated: the message will be removed in the future versions
   555  type Vmxnet3Dump struct{}
   556  
   557  func (m *Vmxnet3Dump) Reset()               { *m = Vmxnet3Dump{} }
   558  func (*Vmxnet3Dump) GetMessageName() string { return "vmxnet3_dump" }
   559  func (*Vmxnet3Dump) GetCrcString() string   { return "51077d14" }
   560  func (*Vmxnet3Dump) GetMessageType() api.MessageType {
   561  	return api.RequestMessage
   562  }
   563  
   564  func (m *Vmxnet3Dump) Size() (size int) {
   565  	if m == nil {
   566  		return 0
   567  	}
   568  	return size
   569  }
   570  func (m *Vmxnet3Dump) Marshal(b []byte) ([]byte, error) {
   571  	if b == nil {
   572  		b = make([]byte, m.Size())
   573  	}
   574  	buf := codec.NewBuffer(b)
   575  	return buf.Bytes(), nil
   576  }
   577  func (m *Vmxnet3Dump) Unmarshal(b []byte) error {
   578  	return nil
   579  }
   580  
   581  func init() { file_vmxnet3_binapi_init() }
   582  func file_vmxnet3_binapi_init() {
   583  	api.RegisterMessage((*SwVmxnet3InterfaceDetails)(nil), "sw_vmxnet3_interface_details_6a1a5498")
   584  	api.RegisterMessage((*SwVmxnet3InterfaceDump)(nil), "sw_vmxnet3_interface_dump_f9e6675e")
   585  	api.RegisterMessage((*Vmxnet3Create)(nil), "vmxnet3_create_71a07314")
   586  	api.RegisterMessage((*Vmxnet3CreateReply)(nil), "vmxnet3_create_reply_5383d31f")
   587  	api.RegisterMessage((*Vmxnet3Delete)(nil), "vmxnet3_delete_f9e6675e")
   588  	api.RegisterMessage((*Vmxnet3DeleteReply)(nil), "vmxnet3_delete_reply_e8d4e804")
   589  	api.RegisterMessage((*Vmxnet3Details)(nil), "vmxnet3_details_6a1a5498")
   590  	api.RegisterMessage((*Vmxnet3Dump)(nil), "vmxnet3_dump_51077d14")
   591  }
   592  
   593  // Messages returns list of all messages in this module.
   594  func AllMessages() []api.Message {
   595  	return []api.Message{
   596  		(*SwVmxnet3InterfaceDetails)(nil),
   597  		(*SwVmxnet3InterfaceDump)(nil),
   598  		(*Vmxnet3Create)(nil),
   599  		(*Vmxnet3CreateReply)(nil),
   600  		(*Vmxnet3Delete)(nil),
   601  		(*Vmxnet3DeleteReply)(nil),
   602  		(*Vmxnet3Details)(nil),
   603  		(*Vmxnet3Dump)(nil),
   604  	}
   605  }