2abc2a091bae18f75162f7a96462695ca10576fe
[govpp.git] / binapi / 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.05-release
5
6 // Package vmxnet3 contains generated bindings for API file vmxnet3.api.
7 //
8 // Contents:
9 //   2 structs
10 //   6 messages
11 //
12 package vmxnet3
13
14 import (
15         api "git.fd.io/govpp.git/api"
16         ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
17         interface_types "git.fd.io/govpp.git/binapi/interface_types"
18         codec "git.fd.io/govpp.git/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.1.0"
30         VersionCrc = 0x38928311
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 // Vmxnet3Create defines message 'vmxnet3_create'.
51 type Vmxnet3Create struct {
52         PciAddr    uint32 `binapi:"u32,name=pci_addr" json:"pci_addr,omitempty"`
53         EnableElog int32  `binapi:"i32,name=enable_elog" json:"enable_elog,omitempty"`
54         RxqSize    uint16 `binapi:"u16,name=rxq_size" json:"rxq_size,omitempty"`
55         RxqNum     uint16 `binapi:"u16,name=rxq_num" json:"rxq_num,omitempty"`
56         TxqSize    uint16 `binapi:"u16,name=txq_size" json:"txq_size,omitempty"`
57         TxqNum     uint16 `binapi:"u16,name=txq_num" json:"txq_num,omitempty"`
58         Bind       uint8  `binapi:"u8,name=bind" json:"bind,omitempty"`
59         EnableGso  bool   `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"`
60 }
61
62 func (m *Vmxnet3Create) Reset()               { *m = Vmxnet3Create{} }
63 func (*Vmxnet3Create) GetMessageName() string { return "vmxnet3_create" }
64 func (*Vmxnet3Create) GetCrcString() string   { return "71a07314" }
65 func (*Vmxnet3Create) GetMessageType() api.MessageType {
66         return api.RequestMessage
67 }
68
69 func (m *Vmxnet3Create) Size() (size int) {
70         if m == nil {
71                 return 0
72         }
73         size += 4 // m.PciAddr
74         size += 4 // m.EnableElog
75         size += 2 // m.RxqSize
76         size += 2 // m.RxqNum
77         size += 2 // m.TxqSize
78         size += 2 // m.TxqNum
79         size += 1 // m.Bind
80         size += 1 // m.EnableGso
81         return size
82 }
83 func (m *Vmxnet3Create) Marshal(b []byte) ([]byte, error) {
84         if b == nil {
85                 b = make([]byte, m.Size())
86         }
87         buf := codec.NewBuffer(b)
88         buf.EncodeUint32(m.PciAddr)
89         buf.EncodeInt32(m.EnableElog)
90         buf.EncodeUint16(m.RxqSize)
91         buf.EncodeUint16(m.RxqNum)
92         buf.EncodeUint16(m.TxqSize)
93         buf.EncodeUint16(m.TxqNum)
94         buf.EncodeUint8(m.Bind)
95         buf.EncodeBool(m.EnableGso)
96         return buf.Bytes(), nil
97 }
98 func (m *Vmxnet3Create) Unmarshal(b []byte) error {
99         buf := codec.NewBuffer(b)
100         m.PciAddr = buf.DecodeUint32()
101         m.EnableElog = buf.DecodeInt32()
102         m.RxqSize = buf.DecodeUint16()
103         m.RxqNum = buf.DecodeUint16()
104         m.TxqSize = buf.DecodeUint16()
105         m.TxqNum = buf.DecodeUint16()
106         m.Bind = buf.DecodeUint8()
107         m.EnableGso = buf.DecodeBool()
108         return nil
109 }
110
111 // Vmxnet3CreateReply defines message 'vmxnet3_create_reply'.
112 type Vmxnet3CreateReply struct {
113         Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
114         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
115 }
116
117 func (m *Vmxnet3CreateReply) Reset()               { *m = Vmxnet3CreateReply{} }
118 func (*Vmxnet3CreateReply) GetMessageName() string { return "vmxnet3_create_reply" }
119 func (*Vmxnet3CreateReply) GetCrcString() string   { return "5383d31f" }
120 func (*Vmxnet3CreateReply) GetMessageType() api.MessageType {
121         return api.ReplyMessage
122 }
123
124 func (m *Vmxnet3CreateReply) Size() (size int) {
125         if m == nil {
126                 return 0
127         }
128         size += 4 // m.Retval
129         size += 4 // m.SwIfIndex
130         return size
131 }
132 func (m *Vmxnet3CreateReply) Marshal(b []byte) ([]byte, error) {
133         if b == nil {
134                 b = make([]byte, m.Size())
135         }
136         buf := codec.NewBuffer(b)
137         buf.EncodeInt32(m.Retval)
138         buf.EncodeUint32(uint32(m.SwIfIndex))
139         return buf.Bytes(), nil
140 }
141 func (m *Vmxnet3CreateReply) Unmarshal(b []byte) error {
142         buf := codec.NewBuffer(b)
143         m.Retval = buf.DecodeInt32()
144         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
145         return nil
146 }
147
148 // Vmxnet3Delete defines message 'vmxnet3_delete'.
149 type Vmxnet3Delete struct {
150         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
151 }
152
153 func (m *Vmxnet3Delete) Reset()               { *m = Vmxnet3Delete{} }
154 func (*Vmxnet3Delete) GetMessageName() string { return "vmxnet3_delete" }
155 func (*Vmxnet3Delete) GetCrcString() string   { return "f9e6675e" }
156 func (*Vmxnet3Delete) GetMessageType() api.MessageType {
157         return api.RequestMessage
158 }
159
160 func (m *Vmxnet3Delete) Size() (size int) {
161         if m == nil {
162                 return 0
163         }
164         size += 4 // m.SwIfIndex
165         return size
166 }
167 func (m *Vmxnet3Delete) Marshal(b []byte) ([]byte, error) {
168         if b == nil {
169                 b = make([]byte, m.Size())
170         }
171         buf := codec.NewBuffer(b)
172         buf.EncodeUint32(uint32(m.SwIfIndex))
173         return buf.Bytes(), nil
174 }
175 func (m *Vmxnet3Delete) Unmarshal(b []byte) error {
176         buf := codec.NewBuffer(b)
177         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
178         return nil
179 }
180
181 // Vmxnet3DeleteReply defines message 'vmxnet3_delete_reply'.
182 type Vmxnet3DeleteReply struct {
183         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
184 }
185
186 func (m *Vmxnet3DeleteReply) Reset()               { *m = Vmxnet3DeleteReply{} }
187 func (*Vmxnet3DeleteReply) GetMessageName() string { return "vmxnet3_delete_reply" }
188 func (*Vmxnet3DeleteReply) GetCrcString() string   { return "e8d4e804" }
189 func (*Vmxnet3DeleteReply) GetMessageType() api.MessageType {
190         return api.ReplyMessage
191 }
192
193 func (m *Vmxnet3DeleteReply) Size() (size int) {
194         if m == nil {
195                 return 0
196         }
197         size += 4 // m.Retval
198         return size
199 }
200 func (m *Vmxnet3DeleteReply) Marshal(b []byte) ([]byte, error) {
201         if b == nil {
202                 b = make([]byte, m.Size())
203         }
204         buf := codec.NewBuffer(b)
205         buf.EncodeInt32(m.Retval)
206         return buf.Bytes(), nil
207 }
208 func (m *Vmxnet3DeleteReply) Unmarshal(b []byte) error {
209         buf := codec.NewBuffer(b)
210         m.Retval = buf.DecodeInt32()
211         return nil
212 }
213
214 // Vmxnet3Details defines message 'vmxnet3_details'.
215 type Vmxnet3Details struct {
216         SwIfIndex   interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
217         IfName      string                         `binapi:"string[64],name=if_name" json:"if_name,omitempty"`
218         HwAddr      ethernet_types.MacAddress      `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"`
219         PciAddr     uint32                         `binapi:"u32,name=pci_addr" json:"pci_addr,omitempty"`
220         Version     uint8                          `binapi:"u8,name=version" json:"version,omitempty"`
221         AdminUpDown bool                           `binapi:"bool,name=admin_up_down" json:"admin_up_down,omitempty"`
222         RxCount     uint8                          `binapi:"u8,name=rx_count" json:"rx_count,omitempty"`
223         RxList      [16]Vmxnet3RxList              `binapi:"vmxnet3_rx_list[16],name=rx_list" json:"rx_list,omitempty"`
224         TxCount     uint8                          `binapi:"u8,name=tx_count" json:"tx_count,omitempty"`
225         TxList      [8]Vmxnet3TxList               `binapi:"vmxnet3_tx_list[8],name=tx_list" json:"tx_list,omitempty"`
226 }
227
228 func (m *Vmxnet3Details) Reset()               { *m = Vmxnet3Details{} }
229 func (*Vmxnet3Details) GetMessageName() string { return "vmxnet3_details" }
230 func (*Vmxnet3Details) GetCrcString() string   { return "829ba055" }
231 func (*Vmxnet3Details) GetMessageType() api.MessageType {
232         return api.ReplyMessage
233 }
234
235 func (m *Vmxnet3Details) Size() (size int) {
236         if m == nil {
237                 return 0
238         }
239         size += 4     // m.SwIfIndex
240         size += 64    // m.IfName
241         size += 1 * 6 // m.HwAddr
242         size += 4     // m.PciAddr
243         size += 1     // m.Version
244         size += 1     // m.AdminUpDown
245         size += 1     // m.RxCount
246         for j1 := 0; j1 < 16; j1++ {
247                 size += 2     // m.RxList[j1].RxQsize
248                 size += 2 * 2 // m.RxList[j1].RxFill
249                 size += 2     // m.RxList[j1].RxNext
250                 size += 2 * 2 // m.RxList[j1].RxProduce
251                 size += 2 * 2 // m.RxList[j1].RxConsume
252         }
253         size += 1 // m.TxCount
254         for j1 := 0; j1 < 8; j1++ {
255                 size += 2 // m.TxList[j1].TxQsize
256                 size += 2 // m.TxList[j1].TxNext
257                 size += 2 // m.TxList[j1].TxProduce
258                 size += 2 // m.TxList[j1].TxConsume
259         }
260         return size
261 }
262 func (m *Vmxnet3Details) Marshal(b []byte) ([]byte, error) {
263         if b == nil {
264                 b = make([]byte, m.Size())
265         }
266         buf := codec.NewBuffer(b)
267         buf.EncodeUint32(uint32(m.SwIfIndex))
268         buf.EncodeString(m.IfName, 64)
269         buf.EncodeBytes(m.HwAddr[:], 6)
270         buf.EncodeUint32(m.PciAddr)
271         buf.EncodeUint8(m.Version)
272         buf.EncodeBool(m.AdminUpDown)
273         buf.EncodeUint8(m.RxCount)
274         for j0 := 0; j0 < 16; j0++ {
275                 buf.EncodeUint16(m.RxList[j0].RxQsize)
276                 for i := 0; i < 2; i++ {
277                         var x uint16
278                         if i < len(m.RxList[j0].RxFill) {
279                                 x = uint16(m.RxList[j0].RxFill[i])
280                         }
281                         buf.EncodeUint16(x)
282                 }
283                 buf.EncodeUint16(m.RxList[j0].RxNext)
284                 for i := 0; i < 2; i++ {
285                         var x uint16
286                         if i < len(m.RxList[j0].RxProduce) {
287                                 x = uint16(m.RxList[j0].RxProduce[i])
288                         }
289                         buf.EncodeUint16(x)
290                 }
291                 for i := 0; i < 2; i++ {
292                         var x uint16
293                         if i < len(m.RxList[j0].RxConsume) {
294                                 x = uint16(m.RxList[j0].RxConsume[i])
295                         }
296                         buf.EncodeUint16(x)
297                 }
298         }
299         buf.EncodeUint8(m.TxCount)
300         for j0 := 0; j0 < 8; j0++ {
301                 buf.EncodeUint16(m.TxList[j0].TxQsize)
302                 buf.EncodeUint16(m.TxList[j0].TxNext)
303                 buf.EncodeUint16(m.TxList[j0].TxProduce)
304                 buf.EncodeUint16(m.TxList[j0].TxConsume)
305         }
306         return buf.Bytes(), nil
307 }
308 func (m *Vmxnet3Details) Unmarshal(b []byte) error {
309         buf := codec.NewBuffer(b)
310         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
311         m.IfName = buf.DecodeString(64)
312         copy(m.HwAddr[:], buf.DecodeBytes(6))
313         m.PciAddr = buf.DecodeUint32()
314         m.Version = buf.DecodeUint8()
315         m.AdminUpDown = buf.DecodeBool()
316         m.RxCount = buf.DecodeUint8()
317         for j0 := 0; j0 < 16; j0++ {
318                 m.RxList[j0].RxQsize = buf.DecodeUint16()
319                 m.RxList[j0].RxFill = make([]uint16, 2)
320                 for i := 0; i < len(m.RxList[j0].RxFill); i++ {
321                         m.RxList[j0].RxFill[i] = buf.DecodeUint16()
322                 }
323                 m.RxList[j0].RxNext = buf.DecodeUint16()
324                 m.RxList[j0].RxProduce = make([]uint16, 2)
325                 for i := 0; i < len(m.RxList[j0].RxProduce); i++ {
326                         m.RxList[j0].RxProduce[i] = buf.DecodeUint16()
327                 }
328                 m.RxList[j0].RxConsume = make([]uint16, 2)
329                 for i := 0; i < len(m.RxList[j0].RxConsume); i++ {
330                         m.RxList[j0].RxConsume[i] = buf.DecodeUint16()
331                 }
332         }
333         m.TxCount = buf.DecodeUint8()
334         for j0 := 0; j0 < 8; j0++ {
335                 m.TxList[j0].TxQsize = buf.DecodeUint16()
336                 m.TxList[j0].TxNext = buf.DecodeUint16()
337                 m.TxList[j0].TxProduce = buf.DecodeUint16()
338                 m.TxList[j0].TxConsume = buf.DecodeUint16()
339         }
340         return nil
341 }
342
343 // Vmxnet3Dump defines message 'vmxnet3_dump'.
344 type Vmxnet3Dump struct{}
345
346 func (m *Vmxnet3Dump) Reset()               { *m = Vmxnet3Dump{} }
347 func (*Vmxnet3Dump) GetMessageName() string { return "vmxnet3_dump" }
348 func (*Vmxnet3Dump) GetCrcString() string   { return "51077d14" }
349 func (*Vmxnet3Dump) GetMessageType() api.MessageType {
350         return api.RequestMessage
351 }
352
353 func (m *Vmxnet3Dump) Size() (size int) {
354         if m == nil {
355                 return 0
356         }
357         return size
358 }
359 func (m *Vmxnet3Dump) Marshal(b []byte) ([]byte, error) {
360         if b == nil {
361                 b = make([]byte, m.Size())
362         }
363         buf := codec.NewBuffer(b)
364         return buf.Bytes(), nil
365 }
366 func (m *Vmxnet3Dump) Unmarshal(b []byte) error {
367         return nil
368 }
369
370 func init() { file_vmxnet3_binapi_init() }
371 func file_vmxnet3_binapi_init() {
372         api.RegisterMessage((*Vmxnet3Create)(nil), "vmxnet3_create_71a07314")
373         api.RegisterMessage((*Vmxnet3CreateReply)(nil), "vmxnet3_create_reply_5383d31f")
374         api.RegisterMessage((*Vmxnet3Delete)(nil), "vmxnet3_delete_f9e6675e")
375         api.RegisterMessage((*Vmxnet3DeleteReply)(nil), "vmxnet3_delete_reply_e8d4e804")
376         api.RegisterMessage((*Vmxnet3Details)(nil), "vmxnet3_details_829ba055")
377         api.RegisterMessage((*Vmxnet3Dump)(nil), "vmxnet3_dump_51077d14")
378 }
379
380 // Messages returns list of all messages in this module.
381 func AllMessages() []api.Message {
382         return []api.Message{
383                 (*Vmxnet3Create)(nil),
384                 (*Vmxnet3CreateReply)(nil),
385                 (*Vmxnet3Delete)(nil),
386                 (*Vmxnet3DeleteReply)(nil),
387                 (*Vmxnet3Details)(nil),
388                 (*Vmxnet3Dump)(nil),
389         }
390 }