Update generated binapi to v22.02 & makefile changes
[govpp.git] / internal / testbinapi / binapi2001 / vmxnet3 / vmxnet3.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.5.0-dev
4 //  VPP:              20.01
5 // source: .vppapi/plugins/vmxnet3.api.json
6
7 // Package vmxnet3 contains generated bindings for API file vmxnet3.api.
8 //
9 // Contents:
10 //   2 aliases
11 //   6 enums
12 //   2 structs
13 //   6 messages
14 //
15 package vmxnet3
16
17 import (
18         "net"
19         "strconv"
20
21         api "git.fd.io/govpp.git/api"
22         codec "git.fd.io/govpp.git/codec"
23 )
24
25 // This is a compile-time assertion to ensure that this generated file
26 // is compatible with the GoVPP api package it is being compiled against.
27 // A compilation error at this line likely means your copy of the
28 // GoVPP api package needs to be updated.
29 const _ = api.GoVppAPIPackageIsVersion2
30
31 const (
32         APIFile    = "vmxnet3"
33         APIVersion = "1.1.0"
34         VersionCrc = 0xe89a60f7
35 )
36
37 // IfStatusFlags defines enum 'if_status_flags'.
38 type IfStatusFlags uint32
39
40 const (
41         IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
42         IF_STATUS_API_FLAG_LINK_UP  IfStatusFlags = 2
43 )
44
45 var (
46         IfStatusFlags_name = map[uint32]string{
47                 1: "IF_STATUS_API_FLAG_ADMIN_UP",
48                 2: "IF_STATUS_API_FLAG_LINK_UP",
49         }
50         IfStatusFlags_value = map[string]uint32{
51                 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
52                 "IF_STATUS_API_FLAG_LINK_UP":  2,
53         }
54 )
55
56 func (x IfStatusFlags) String() string {
57         s, ok := IfStatusFlags_name[uint32(x)]
58         if ok {
59                 return s
60         }
61         str := func(n uint32) string {
62                 s, ok := IfStatusFlags_name[uint32(n)]
63                 if ok {
64                         return s
65                 }
66                 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
67         }
68         for i := uint32(0); i <= 32; i++ {
69                 val := uint32(x)
70                 if val&(1<<i) != 0 {
71                         if s != "" {
72                                 s += "|"
73                         }
74                         s += str(1 << i)
75                 }
76         }
77         if s == "" {
78                 return str(uint32(x))
79         }
80         return s
81 }
82
83 // IfType defines enum 'if_type'.
84 type IfType uint32
85
86 const (
87         IF_API_TYPE_HARDWARE IfType = 1
88         IF_API_TYPE_SUB      IfType = 2
89         IF_API_TYPE_P2P      IfType = 3
90         IF_API_TYPE_PIPE     IfType = 4
91 )
92
93 var (
94         IfType_name = map[uint32]string{
95                 1: "IF_API_TYPE_HARDWARE",
96                 2: "IF_API_TYPE_SUB",
97                 3: "IF_API_TYPE_P2P",
98                 4: "IF_API_TYPE_PIPE",
99         }
100         IfType_value = map[string]uint32{
101                 "IF_API_TYPE_HARDWARE": 1,
102                 "IF_API_TYPE_SUB":      2,
103                 "IF_API_TYPE_P2P":      3,
104                 "IF_API_TYPE_PIPE":     4,
105         }
106 )
107
108 func (x IfType) String() string {
109         s, ok := IfType_name[uint32(x)]
110         if ok {
111                 return s
112         }
113         return "IfType(" + strconv.Itoa(int(x)) + ")"
114 }
115
116 // LinkDuplex defines enum 'link_duplex'.
117 type LinkDuplex uint32
118
119 const (
120         LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
121         LINK_DUPLEX_API_HALF    LinkDuplex = 1
122         LINK_DUPLEX_API_FULL    LinkDuplex = 2
123 )
124
125 var (
126         LinkDuplex_name = map[uint32]string{
127                 0: "LINK_DUPLEX_API_UNKNOWN",
128                 1: "LINK_DUPLEX_API_HALF",
129                 2: "LINK_DUPLEX_API_FULL",
130         }
131         LinkDuplex_value = map[string]uint32{
132                 "LINK_DUPLEX_API_UNKNOWN": 0,
133                 "LINK_DUPLEX_API_HALF":    1,
134                 "LINK_DUPLEX_API_FULL":    2,
135         }
136 )
137
138 func (x LinkDuplex) String() string {
139         s, ok := LinkDuplex_name[uint32(x)]
140         if ok {
141                 return s
142         }
143         return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
144 }
145
146 // MtuProto defines enum 'mtu_proto'.
147 type MtuProto uint32
148
149 const (
150         MTU_PROTO_API_L3   MtuProto = 1
151         MTU_PROTO_API_IP4  MtuProto = 2
152         MTU_PROTO_API_IP6  MtuProto = 3
153         MTU_PROTO_API_MPLS MtuProto = 4
154         MTU_PROTO_API_N    MtuProto = 5
155 )
156
157 var (
158         MtuProto_name = map[uint32]string{
159                 1: "MTU_PROTO_API_L3",
160                 2: "MTU_PROTO_API_IP4",
161                 3: "MTU_PROTO_API_IP6",
162                 4: "MTU_PROTO_API_MPLS",
163                 5: "MTU_PROTO_API_N",
164         }
165         MtuProto_value = map[string]uint32{
166                 "MTU_PROTO_API_L3":   1,
167                 "MTU_PROTO_API_IP4":  2,
168                 "MTU_PROTO_API_IP6":  3,
169                 "MTU_PROTO_API_MPLS": 4,
170                 "MTU_PROTO_API_N":    5,
171         }
172 )
173
174 func (x MtuProto) String() string {
175         s, ok := MtuProto_name[uint32(x)]
176         if ok {
177                 return s
178         }
179         return "MtuProto(" + strconv.Itoa(int(x)) + ")"
180 }
181
182 // RxMode defines enum 'rx_mode'.
183 type RxMode uint32
184
185 const (
186         RX_MODE_API_UNKNOWN   RxMode = 0
187         RX_MODE_API_POLLING   RxMode = 1
188         RX_MODE_API_INTERRUPT RxMode = 2
189         RX_MODE_API_ADAPTIVE  RxMode = 3
190         RX_MODE_API_DEFAULT   RxMode = 4
191 )
192
193 var (
194         RxMode_name = map[uint32]string{
195                 0: "RX_MODE_API_UNKNOWN",
196                 1: "RX_MODE_API_POLLING",
197                 2: "RX_MODE_API_INTERRUPT",
198                 3: "RX_MODE_API_ADAPTIVE",
199                 4: "RX_MODE_API_DEFAULT",
200         }
201         RxMode_value = map[string]uint32{
202                 "RX_MODE_API_UNKNOWN":   0,
203                 "RX_MODE_API_POLLING":   1,
204                 "RX_MODE_API_INTERRUPT": 2,
205                 "RX_MODE_API_ADAPTIVE":  3,
206                 "RX_MODE_API_DEFAULT":   4,
207         }
208 )
209
210 func (x RxMode) String() string {
211         s, ok := RxMode_name[uint32(x)]
212         if ok {
213                 return s
214         }
215         return "RxMode(" + strconv.Itoa(int(x)) + ")"
216 }
217
218 // SubIfFlags defines enum 'sub_if_flags'.
219 type SubIfFlags uint32
220
221 const (
222         SUB_IF_API_FLAG_NO_TAGS           SubIfFlags = 1
223         SUB_IF_API_FLAG_ONE_TAG           SubIfFlags = 2
224         SUB_IF_API_FLAG_TWO_TAGS          SubIfFlags = 4
225         SUB_IF_API_FLAG_DOT1AD            SubIfFlags = 8
226         SUB_IF_API_FLAG_EXACT_MATCH       SubIfFlags = 16
227         SUB_IF_API_FLAG_DEFAULT           SubIfFlags = 32
228         SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
229         SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
230         SUB_IF_API_FLAG_MASK_VNET         SubIfFlags = 254
231         SUB_IF_API_FLAG_DOT1AH            SubIfFlags = 256
232 )
233
234 var (
235         SubIfFlags_name = map[uint32]string{
236                 1:   "SUB_IF_API_FLAG_NO_TAGS",
237                 2:   "SUB_IF_API_FLAG_ONE_TAG",
238                 4:   "SUB_IF_API_FLAG_TWO_TAGS",
239                 8:   "SUB_IF_API_FLAG_DOT1AD",
240                 16:  "SUB_IF_API_FLAG_EXACT_MATCH",
241                 32:  "SUB_IF_API_FLAG_DEFAULT",
242                 64:  "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
243                 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
244                 254: "SUB_IF_API_FLAG_MASK_VNET",
245                 256: "SUB_IF_API_FLAG_DOT1AH",
246         }
247         SubIfFlags_value = map[string]uint32{
248                 "SUB_IF_API_FLAG_NO_TAGS":           1,
249                 "SUB_IF_API_FLAG_ONE_TAG":           2,
250                 "SUB_IF_API_FLAG_TWO_TAGS":          4,
251                 "SUB_IF_API_FLAG_DOT1AD":            8,
252                 "SUB_IF_API_FLAG_EXACT_MATCH":       16,
253                 "SUB_IF_API_FLAG_DEFAULT":           32,
254                 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
255                 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
256                 "SUB_IF_API_FLAG_MASK_VNET":         254,
257                 "SUB_IF_API_FLAG_DOT1AH":            256,
258         }
259 )
260
261 func (x SubIfFlags) String() string {
262         s, ok := SubIfFlags_name[uint32(x)]
263         if ok {
264                 return s
265         }
266         str := func(n uint32) string {
267                 s, ok := SubIfFlags_name[uint32(n)]
268                 if ok {
269                         return s
270                 }
271                 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
272         }
273         for i := uint32(0); i <= 32; i++ {
274                 val := uint32(x)
275                 if val&(1<<i) != 0 {
276                         if s != "" {
277                                 s += "|"
278                         }
279                         s += str(1 << i)
280                 }
281         }
282         if s == "" {
283                 return str(uint32(x))
284         }
285         return s
286 }
287
288 // InterfaceIndex defines alias 'interface_index'.
289 type InterfaceIndex uint32
290
291 // MacAddress defines alias 'mac_address'.
292 type MacAddress [6]uint8
293
294 func ParseMacAddress(s string) (MacAddress, error) {
295         var macaddr MacAddress
296         mac, err := net.ParseMAC(s)
297         if err != nil {
298                 return macaddr, err
299         }
300         copy(macaddr[:], mac[:])
301         return macaddr, nil
302 }
303
304 func (x MacAddress) ToMAC() net.HardwareAddr {
305         return net.HardwareAddr(x[:])
306 }
307
308 func (x MacAddress) String() string {
309         return x.ToMAC().String()
310 }
311
312 func (x *MacAddress) MarshalText() ([]byte, error) {
313         return []byte(x.String()), nil
314 }
315
316 func (x *MacAddress) UnmarshalText(text []byte) error {
317         mac, err := ParseMacAddress(string(text))
318         if err != nil {
319                 return err
320         }
321         *x = mac
322         return nil
323 }
324
325 // Vmxnet3RxList defines type 'vmxnet3_rx_list'.
326 type Vmxnet3RxList struct {
327         RxQsize   uint16   `binapi:"u16,name=rx_qsize" json:"rx_qsize,omitempty"`
328         RxFill    []uint16 `binapi:"u16[2],name=rx_fill" json:"rx_fill,omitempty"`
329         RxNext    uint16   `binapi:"u16,name=rx_next" json:"rx_next,omitempty"`
330         RxProduce []uint16 `binapi:"u16[2],name=rx_produce" json:"rx_produce,omitempty"`
331         RxConsume []uint16 `binapi:"u16[2],name=rx_consume" json:"rx_consume,omitempty"`
332 }
333
334 // Vmxnet3TxList defines type 'vmxnet3_tx_list'.
335 type Vmxnet3TxList struct {
336         TxQsize   uint16 `binapi:"u16,name=tx_qsize" json:"tx_qsize,omitempty"`
337         TxNext    uint16 `binapi:"u16,name=tx_next" json:"tx_next,omitempty"`
338         TxProduce uint16 `binapi:"u16,name=tx_produce" json:"tx_produce,omitempty"`
339         TxConsume uint16 `binapi:"u16,name=tx_consume" json:"tx_consume,omitempty"`
340 }
341
342 // Vmxnet3Create defines message 'vmxnet3_create'.
343 type Vmxnet3Create struct {
344         PciAddr    uint32 `binapi:"u32,name=pci_addr" json:"pci_addr,omitempty"`
345         EnableElog int32  `binapi:"i32,name=enable_elog" json:"enable_elog,omitempty"`
346         RxqSize    uint16 `binapi:"u16,name=rxq_size" json:"rxq_size,omitempty"`
347         RxqNum     uint16 `binapi:"u16,name=rxq_num" json:"rxq_num,omitempty"`
348         TxqSize    uint16 `binapi:"u16,name=txq_size" json:"txq_size,omitempty"`
349         TxqNum     uint16 `binapi:"u16,name=txq_num" json:"txq_num,omitempty"`
350         Bind       uint8  `binapi:"u8,name=bind" json:"bind,omitempty"`
351         EnableGso  bool   `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"`
352 }
353
354 func (m *Vmxnet3Create) Reset()               { *m = Vmxnet3Create{} }
355 func (*Vmxnet3Create) GetMessageName() string { return "vmxnet3_create" }
356 func (*Vmxnet3Create) GetCrcString() string   { return "71a07314" }
357 func (*Vmxnet3Create) GetMessageType() api.MessageType {
358         return api.RequestMessage
359 }
360
361 func (m *Vmxnet3Create) Size() (size int) {
362         if m == nil {
363                 return 0
364         }
365         size += 4 // m.PciAddr
366         size += 4 // m.EnableElog
367         size += 2 // m.RxqSize
368         size += 2 // m.RxqNum
369         size += 2 // m.TxqSize
370         size += 2 // m.TxqNum
371         size += 1 // m.Bind
372         size += 1 // m.EnableGso
373         return size
374 }
375 func (m *Vmxnet3Create) Marshal(b []byte) ([]byte, error) {
376         if b == nil {
377                 b = make([]byte, m.Size())
378         }
379         buf := codec.NewBuffer(b)
380         buf.EncodeUint32(m.PciAddr)
381         buf.EncodeInt32(m.EnableElog)
382         buf.EncodeUint16(m.RxqSize)
383         buf.EncodeUint16(m.RxqNum)
384         buf.EncodeUint16(m.TxqSize)
385         buf.EncodeUint16(m.TxqNum)
386         buf.EncodeUint8(m.Bind)
387         buf.EncodeBool(m.EnableGso)
388         return buf.Bytes(), nil
389 }
390 func (m *Vmxnet3Create) Unmarshal(b []byte) error {
391         buf := codec.NewBuffer(b)
392         m.PciAddr = buf.DecodeUint32()
393         m.EnableElog = buf.DecodeInt32()
394         m.RxqSize = buf.DecodeUint16()
395         m.RxqNum = buf.DecodeUint16()
396         m.TxqSize = buf.DecodeUint16()
397         m.TxqNum = buf.DecodeUint16()
398         m.Bind = buf.DecodeUint8()
399         m.EnableGso = buf.DecodeBool()
400         return nil
401 }
402
403 // Vmxnet3CreateReply defines message 'vmxnet3_create_reply'.
404 type Vmxnet3CreateReply struct {
405         Retval    int32          `binapi:"i32,name=retval" json:"retval,omitempty"`
406         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
407 }
408
409 func (m *Vmxnet3CreateReply) Reset()               { *m = Vmxnet3CreateReply{} }
410 func (*Vmxnet3CreateReply) GetMessageName() string { return "vmxnet3_create_reply" }
411 func (*Vmxnet3CreateReply) GetCrcString() string   { return "5383d31f" }
412 func (*Vmxnet3CreateReply) GetMessageType() api.MessageType {
413         return api.ReplyMessage
414 }
415
416 func (m *Vmxnet3CreateReply) Size() (size int) {
417         if m == nil {
418                 return 0
419         }
420         size += 4 // m.Retval
421         size += 4 // m.SwIfIndex
422         return size
423 }
424 func (m *Vmxnet3CreateReply) Marshal(b []byte) ([]byte, error) {
425         if b == nil {
426                 b = make([]byte, m.Size())
427         }
428         buf := codec.NewBuffer(b)
429         buf.EncodeInt32(m.Retval)
430         buf.EncodeUint32(uint32(m.SwIfIndex))
431         return buf.Bytes(), nil
432 }
433 func (m *Vmxnet3CreateReply) Unmarshal(b []byte) error {
434         buf := codec.NewBuffer(b)
435         m.Retval = buf.DecodeInt32()
436         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
437         return nil
438 }
439
440 // Vmxnet3Delete defines message 'vmxnet3_delete'.
441 type Vmxnet3Delete struct {
442         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
443 }
444
445 func (m *Vmxnet3Delete) Reset()               { *m = Vmxnet3Delete{} }
446 func (*Vmxnet3Delete) GetMessageName() string { return "vmxnet3_delete" }
447 func (*Vmxnet3Delete) GetCrcString() string   { return "f9e6675e" }
448 func (*Vmxnet3Delete) GetMessageType() api.MessageType {
449         return api.RequestMessage
450 }
451
452 func (m *Vmxnet3Delete) Size() (size int) {
453         if m == nil {
454                 return 0
455         }
456         size += 4 // m.SwIfIndex
457         return size
458 }
459 func (m *Vmxnet3Delete) Marshal(b []byte) ([]byte, error) {
460         if b == nil {
461                 b = make([]byte, m.Size())
462         }
463         buf := codec.NewBuffer(b)
464         buf.EncodeUint32(uint32(m.SwIfIndex))
465         return buf.Bytes(), nil
466 }
467 func (m *Vmxnet3Delete) Unmarshal(b []byte) error {
468         buf := codec.NewBuffer(b)
469         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
470         return nil
471 }
472
473 // Vmxnet3DeleteReply defines message 'vmxnet3_delete_reply'.
474 type Vmxnet3DeleteReply struct {
475         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
476 }
477
478 func (m *Vmxnet3DeleteReply) Reset()               { *m = Vmxnet3DeleteReply{} }
479 func (*Vmxnet3DeleteReply) GetMessageName() string { return "vmxnet3_delete_reply" }
480 func (*Vmxnet3DeleteReply) GetCrcString() string   { return "e8d4e804" }
481 func (*Vmxnet3DeleteReply) GetMessageType() api.MessageType {
482         return api.ReplyMessage
483 }
484
485 func (m *Vmxnet3DeleteReply) Size() (size int) {
486         if m == nil {
487                 return 0
488         }
489         size += 4 // m.Retval
490         return size
491 }
492 func (m *Vmxnet3DeleteReply) Marshal(b []byte) ([]byte, error) {
493         if b == nil {
494                 b = make([]byte, m.Size())
495         }
496         buf := codec.NewBuffer(b)
497         buf.EncodeInt32(m.Retval)
498         return buf.Bytes(), nil
499 }
500 func (m *Vmxnet3DeleteReply) Unmarshal(b []byte) error {
501         buf := codec.NewBuffer(b)
502         m.Retval = buf.DecodeInt32()
503         return nil
504 }
505
506 // Vmxnet3Details defines message 'vmxnet3_details'.
507 type Vmxnet3Details struct {
508         SwIfIndex   InterfaceIndex    `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
509         IfName      string            `binapi:"string[64],name=if_name" json:"if_name,omitempty"`
510         HwAddr      MacAddress        `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"`
511         PciAddr     uint32            `binapi:"u32,name=pci_addr" json:"pci_addr,omitempty"`
512         Version     uint8             `binapi:"u8,name=version" json:"version,omitempty"`
513         AdminUpDown bool              `binapi:"bool,name=admin_up_down" json:"admin_up_down,omitempty"`
514         RxCount     uint8             `binapi:"u8,name=rx_count" json:"rx_count,omitempty"`
515         RxList      [16]Vmxnet3RxList `binapi:"vmxnet3_rx_list[16],name=rx_list" json:"rx_list,omitempty"`
516         TxCount     uint8             `binapi:"u8,name=tx_count" json:"tx_count,omitempty"`
517         TxList      [8]Vmxnet3TxList  `binapi:"vmxnet3_tx_list[8],name=tx_list" json:"tx_list,omitempty"`
518 }
519
520 func (m *Vmxnet3Details) Reset()               { *m = Vmxnet3Details{} }
521 func (*Vmxnet3Details) GetMessageName() string { return "vmxnet3_details" }
522 func (*Vmxnet3Details) GetCrcString() string   { return "829ba055" }
523 func (*Vmxnet3Details) GetMessageType() api.MessageType {
524         return api.ReplyMessage
525 }
526
527 func (m *Vmxnet3Details) Size() (size int) {
528         if m == nil {
529                 return 0
530         }
531         size += 4     // m.SwIfIndex
532         size += 64    // m.IfName
533         size += 1 * 6 // m.HwAddr
534         size += 4     // m.PciAddr
535         size += 1     // m.Version
536         size += 1     // m.AdminUpDown
537         size += 1     // m.RxCount
538         for j1 := 0; j1 < 16; j1++ {
539                 size += 2     // m.RxList[j1].RxQsize
540                 size += 2 * 2 // m.RxList[j1].RxFill
541                 size += 2     // m.RxList[j1].RxNext
542                 size += 2 * 2 // m.RxList[j1].RxProduce
543                 size += 2 * 2 // m.RxList[j1].RxConsume
544         }
545         size += 1 // m.TxCount
546         for j1 := 0; j1 < 8; j1++ {
547                 size += 2 // m.TxList[j1].TxQsize
548                 size += 2 // m.TxList[j1].TxNext
549                 size += 2 // m.TxList[j1].TxProduce
550                 size += 2 // m.TxList[j1].TxConsume
551         }
552         return size
553 }
554 func (m *Vmxnet3Details) Marshal(b []byte) ([]byte, error) {
555         if b == nil {
556                 b = make([]byte, m.Size())
557         }
558         buf := codec.NewBuffer(b)
559         buf.EncodeUint32(uint32(m.SwIfIndex))
560         buf.EncodeString(m.IfName, 64)
561         buf.EncodeBytes(m.HwAddr[:], 6)
562         buf.EncodeUint32(m.PciAddr)
563         buf.EncodeUint8(m.Version)
564         buf.EncodeBool(m.AdminUpDown)
565         buf.EncodeUint8(m.RxCount)
566         for j0 := 0; j0 < 16; j0++ {
567                 buf.EncodeUint16(m.RxList[j0].RxQsize)
568                 for i := 0; i < 2; i++ {
569                         var x uint16
570                         if i < len(m.RxList[j0].RxFill) {
571                                 x = uint16(m.RxList[j0].RxFill[i])
572                         }
573                         buf.EncodeUint16(x)
574                 }
575                 buf.EncodeUint16(m.RxList[j0].RxNext)
576                 for i := 0; i < 2; i++ {
577                         var x uint16
578                         if i < len(m.RxList[j0].RxProduce) {
579                                 x = uint16(m.RxList[j0].RxProduce[i])
580                         }
581                         buf.EncodeUint16(x)
582                 }
583                 for i := 0; i < 2; i++ {
584                         var x uint16
585                         if i < len(m.RxList[j0].RxConsume) {
586                                 x = uint16(m.RxList[j0].RxConsume[i])
587                         }
588                         buf.EncodeUint16(x)
589                 }
590         }
591         buf.EncodeUint8(m.TxCount)
592         for j0 := 0; j0 < 8; j0++ {
593                 buf.EncodeUint16(m.TxList[j0].TxQsize)
594                 buf.EncodeUint16(m.TxList[j0].TxNext)
595                 buf.EncodeUint16(m.TxList[j0].TxProduce)
596                 buf.EncodeUint16(m.TxList[j0].TxConsume)
597         }
598         return buf.Bytes(), nil
599 }
600 func (m *Vmxnet3Details) Unmarshal(b []byte) error {
601         buf := codec.NewBuffer(b)
602         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
603         m.IfName = buf.DecodeString(64)
604         copy(m.HwAddr[:], buf.DecodeBytes(6))
605         m.PciAddr = buf.DecodeUint32()
606         m.Version = buf.DecodeUint8()
607         m.AdminUpDown = buf.DecodeBool()
608         m.RxCount = buf.DecodeUint8()
609         for j0 := 0; j0 < 16; j0++ {
610                 m.RxList[j0].RxQsize = buf.DecodeUint16()
611                 m.RxList[j0].RxFill = make([]uint16, 2)
612                 for i := 0; i < len(m.RxList[j0].RxFill); i++ {
613                         m.RxList[j0].RxFill[i] = buf.DecodeUint16()
614                 }
615                 m.RxList[j0].RxNext = buf.DecodeUint16()
616                 m.RxList[j0].RxProduce = make([]uint16, 2)
617                 for i := 0; i < len(m.RxList[j0].RxProduce); i++ {
618                         m.RxList[j0].RxProduce[i] = buf.DecodeUint16()
619                 }
620                 m.RxList[j0].RxConsume = make([]uint16, 2)
621                 for i := 0; i < len(m.RxList[j0].RxConsume); i++ {
622                         m.RxList[j0].RxConsume[i] = buf.DecodeUint16()
623                 }
624         }
625         m.TxCount = buf.DecodeUint8()
626         for j0 := 0; j0 < 8; j0++ {
627                 m.TxList[j0].TxQsize = buf.DecodeUint16()
628                 m.TxList[j0].TxNext = buf.DecodeUint16()
629                 m.TxList[j0].TxProduce = buf.DecodeUint16()
630                 m.TxList[j0].TxConsume = buf.DecodeUint16()
631         }
632         return nil
633 }
634
635 // Vmxnet3Dump defines message 'vmxnet3_dump'.
636 type Vmxnet3Dump struct{}
637
638 func (m *Vmxnet3Dump) Reset()               { *m = Vmxnet3Dump{} }
639 func (*Vmxnet3Dump) GetMessageName() string { return "vmxnet3_dump" }
640 func (*Vmxnet3Dump) GetCrcString() string   { return "51077d14" }
641 func (*Vmxnet3Dump) GetMessageType() api.MessageType {
642         return api.RequestMessage
643 }
644
645 func (m *Vmxnet3Dump) Size() (size int) {
646         if m == nil {
647                 return 0
648         }
649         return size
650 }
651 func (m *Vmxnet3Dump) Marshal(b []byte) ([]byte, error) {
652         if b == nil {
653                 b = make([]byte, m.Size())
654         }
655         buf := codec.NewBuffer(b)
656         return buf.Bytes(), nil
657 }
658 func (m *Vmxnet3Dump) Unmarshal(b []byte) error {
659         return nil
660 }
661
662 func init() { file_vmxnet3_binapi_init() }
663 func file_vmxnet3_binapi_init() {
664         api.RegisterMessage((*Vmxnet3Create)(nil), "vmxnet3_create_71a07314")
665         api.RegisterMessage((*Vmxnet3CreateReply)(nil), "vmxnet3_create_reply_5383d31f")
666         api.RegisterMessage((*Vmxnet3Delete)(nil), "vmxnet3_delete_f9e6675e")
667         api.RegisterMessage((*Vmxnet3DeleteReply)(nil), "vmxnet3_delete_reply_e8d4e804")
668         api.RegisterMessage((*Vmxnet3Details)(nil), "vmxnet3_details_829ba055")
669         api.RegisterMessage((*Vmxnet3Dump)(nil), "vmxnet3_dump_51077d14")
670 }
671
672 // Messages returns list of all messages in this module.
673 func AllMessages() []api.Message {
674         return []api.Message{
675                 (*Vmxnet3Create)(nil),
676                 (*Vmxnet3CreateReply)(nil),
677                 (*Vmxnet3Delete)(nil),
678                 (*Vmxnet3DeleteReply)(nil),
679                 (*Vmxnet3Details)(nil),
680                 (*Vmxnet3Dump)(nil),
681         }
682 }