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