1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0
4 // VPP: 20.05.1-release
5 // source: /usr/share/vpp/api/plugins/vmxnet3.api.json
7 // Package vmxnet3 contains generated bindings for API file vmxnet3.api.
16 api "git.fd.io/govpp.git/api"
17 ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
18 interface_types "git.fd.io/govpp.git/binapi/interface_types"
19 codec "git.fd.io/govpp.git/codec"
22 // This is a compile-time assertion to ensure that this generated file
23 // is compatible with the GoVPP api package it is being compiled against.
24 // A compilation error at this line likely means your copy of the
25 // GoVPP api package needs to be updated.
26 const _ = api.GoVppAPIPackageIsVersion2
31 VersionCrc = 0x38928311
34 // Vmxnet3RxList defines type 'vmxnet3_rx_list'.
35 type Vmxnet3RxList struct {
36 RxQsize uint16 `binapi:"u16,name=rx_qsize" json:"rx_qsize,omitempty"`
37 RxFill []uint16 `binapi:"u16[2],name=rx_fill" json:"rx_fill,omitempty"`
38 RxNext uint16 `binapi:"u16,name=rx_next" json:"rx_next,omitempty"`
39 RxProduce []uint16 `binapi:"u16[2],name=rx_produce" json:"rx_produce,omitempty"`
40 RxConsume []uint16 `binapi:"u16[2],name=rx_consume" json:"rx_consume,omitempty"`
43 // Vmxnet3TxList defines type 'vmxnet3_tx_list'.
44 type Vmxnet3TxList struct {
45 TxQsize uint16 `binapi:"u16,name=tx_qsize" json:"tx_qsize,omitempty"`
46 TxNext uint16 `binapi:"u16,name=tx_next" json:"tx_next,omitempty"`
47 TxProduce uint16 `binapi:"u16,name=tx_produce" json:"tx_produce,omitempty"`
48 TxConsume uint16 `binapi:"u16,name=tx_consume" json:"tx_consume,omitempty"`
51 // Vmxnet3Create defines message 'vmxnet3_create'.
52 type Vmxnet3Create struct {
53 PciAddr uint32 `binapi:"u32,name=pci_addr" json:"pci_addr,omitempty"`
54 EnableElog int32 `binapi:"i32,name=enable_elog" json:"enable_elog,omitempty"`
55 RxqSize uint16 `binapi:"u16,name=rxq_size" json:"rxq_size,omitempty"`
56 RxqNum uint16 `binapi:"u16,name=rxq_num" json:"rxq_num,omitempty"`
57 TxqSize uint16 `binapi:"u16,name=txq_size" json:"txq_size,omitempty"`
58 TxqNum uint16 `binapi:"u16,name=txq_num" json:"txq_num,omitempty"`
59 Bind uint8 `binapi:"u8,name=bind" json:"bind,omitempty"`
60 EnableGso bool `binapi:"bool,name=enable_gso" json:"enable_gso,omitempty"`
63 func (m *Vmxnet3Create) Reset() { *m = Vmxnet3Create{} }
64 func (*Vmxnet3Create) GetMessageName() string { return "vmxnet3_create" }
65 func (*Vmxnet3Create) GetCrcString() string { return "71a07314" }
66 func (*Vmxnet3Create) GetMessageType() api.MessageType {
67 return api.RequestMessage
70 func (m *Vmxnet3Create) Size() (size int) {
74 size += 4 // m.PciAddr
75 size += 4 // m.EnableElog
76 size += 2 // m.RxqSize
78 size += 2 // m.TxqSize
81 size += 1 // m.EnableGso
84 func (m *Vmxnet3Create) Marshal(b []byte) ([]byte, error) {
86 b = make([]byte, m.Size())
88 buf := codec.NewBuffer(b)
89 buf.EncodeUint32(m.PciAddr)
90 buf.EncodeInt32(m.EnableElog)
91 buf.EncodeUint16(m.RxqSize)
92 buf.EncodeUint16(m.RxqNum)
93 buf.EncodeUint16(m.TxqSize)
94 buf.EncodeUint16(m.TxqNum)
95 buf.EncodeUint8(m.Bind)
96 buf.EncodeBool(m.EnableGso)
97 return buf.Bytes(), nil
99 func (m *Vmxnet3Create) Unmarshal(b []byte) error {
100 buf := codec.NewBuffer(b)
101 m.PciAddr = buf.DecodeUint32()
102 m.EnableElog = buf.DecodeInt32()
103 m.RxqSize = buf.DecodeUint16()
104 m.RxqNum = buf.DecodeUint16()
105 m.TxqSize = buf.DecodeUint16()
106 m.TxqNum = buf.DecodeUint16()
107 m.Bind = buf.DecodeUint8()
108 m.EnableGso = buf.DecodeBool()
112 // Vmxnet3CreateReply defines message 'vmxnet3_create_reply'.
113 type Vmxnet3CreateReply struct {
114 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
115 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
118 func (m *Vmxnet3CreateReply) Reset() { *m = Vmxnet3CreateReply{} }
119 func (*Vmxnet3CreateReply) GetMessageName() string { return "vmxnet3_create_reply" }
120 func (*Vmxnet3CreateReply) GetCrcString() string { return "5383d31f" }
121 func (*Vmxnet3CreateReply) GetMessageType() api.MessageType {
122 return api.ReplyMessage
125 func (m *Vmxnet3CreateReply) Size() (size int) {
129 size += 4 // m.Retval
130 size += 4 // m.SwIfIndex
133 func (m *Vmxnet3CreateReply) Marshal(b []byte) ([]byte, error) {
135 b = make([]byte, m.Size())
137 buf := codec.NewBuffer(b)
138 buf.EncodeInt32(m.Retval)
139 buf.EncodeUint32(uint32(m.SwIfIndex))
140 return buf.Bytes(), nil
142 func (m *Vmxnet3CreateReply) Unmarshal(b []byte) error {
143 buf := codec.NewBuffer(b)
144 m.Retval = buf.DecodeInt32()
145 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
149 // Vmxnet3Delete defines message 'vmxnet3_delete'.
150 type Vmxnet3Delete struct {
151 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
154 func (m *Vmxnet3Delete) Reset() { *m = Vmxnet3Delete{} }
155 func (*Vmxnet3Delete) GetMessageName() string { return "vmxnet3_delete" }
156 func (*Vmxnet3Delete) GetCrcString() string { return "f9e6675e" }
157 func (*Vmxnet3Delete) GetMessageType() api.MessageType {
158 return api.RequestMessage
161 func (m *Vmxnet3Delete) Size() (size int) {
165 size += 4 // m.SwIfIndex
168 func (m *Vmxnet3Delete) Marshal(b []byte) ([]byte, error) {
170 b = make([]byte, m.Size())
172 buf := codec.NewBuffer(b)
173 buf.EncodeUint32(uint32(m.SwIfIndex))
174 return buf.Bytes(), nil
176 func (m *Vmxnet3Delete) Unmarshal(b []byte) error {
177 buf := codec.NewBuffer(b)
178 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
182 // Vmxnet3DeleteReply defines message 'vmxnet3_delete_reply'.
183 type Vmxnet3DeleteReply struct {
184 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
187 func (m *Vmxnet3DeleteReply) Reset() { *m = Vmxnet3DeleteReply{} }
188 func (*Vmxnet3DeleteReply) GetMessageName() string { return "vmxnet3_delete_reply" }
189 func (*Vmxnet3DeleteReply) GetCrcString() string { return "e8d4e804" }
190 func (*Vmxnet3DeleteReply) GetMessageType() api.MessageType {
191 return api.ReplyMessage
194 func (m *Vmxnet3DeleteReply) Size() (size int) {
198 size += 4 // m.Retval
201 func (m *Vmxnet3DeleteReply) Marshal(b []byte) ([]byte, error) {
203 b = make([]byte, m.Size())
205 buf := codec.NewBuffer(b)
206 buf.EncodeInt32(m.Retval)
207 return buf.Bytes(), nil
209 func (m *Vmxnet3DeleteReply) Unmarshal(b []byte) error {
210 buf := codec.NewBuffer(b)
211 m.Retval = buf.DecodeInt32()
215 // Vmxnet3Details defines message 'vmxnet3_details'.
216 type Vmxnet3Details struct {
217 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
218 IfName string `binapi:"string[64],name=if_name" json:"if_name,omitempty"`
219 HwAddr ethernet_types.MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"`
220 PciAddr uint32 `binapi:"u32,name=pci_addr" json:"pci_addr,omitempty"`
221 Version uint8 `binapi:"u8,name=version" json:"version,omitempty"`
222 AdminUpDown bool `binapi:"bool,name=admin_up_down" json:"admin_up_down,omitempty"`
223 RxCount uint8 `binapi:"u8,name=rx_count" json:"rx_count,omitempty"`
224 RxList [16]Vmxnet3RxList `binapi:"vmxnet3_rx_list[16],name=rx_list" json:"rx_list,omitempty"`
225 TxCount uint8 `binapi:"u8,name=tx_count" json:"tx_count,omitempty"`
226 TxList [8]Vmxnet3TxList `binapi:"vmxnet3_tx_list[8],name=tx_list" json:"tx_list,omitempty"`
229 func (m *Vmxnet3Details) Reset() { *m = Vmxnet3Details{} }
230 func (*Vmxnet3Details) GetMessageName() string { return "vmxnet3_details" }
231 func (*Vmxnet3Details) GetCrcString() string { return "829ba055" }
232 func (*Vmxnet3Details) GetMessageType() api.MessageType {
233 return api.ReplyMessage
236 func (m *Vmxnet3Details) Size() (size int) {
240 size += 4 // m.SwIfIndex
241 size += 64 // m.IfName
242 size += 1 * 6 // m.HwAddr
243 size += 4 // m.PciAddr
244 size += 1 // m.Version
245 size += 1 // m.AdminUpDown
246 size += 1 // m.RxCount
247 for j1 := 0; j1 < 16; j1++ {
248 size += 2 // m.RxList[j1].RxQsize
249 size += 2 * 2 // m.RxList[j1].RxFill
250 size += 2 // m.RxList[j1].RxNext
251 size += 2 * 2 // m.RxList[j1].RxProduce
252 size += 2 * 2 // m.RxList[j1].RxConsume
254 size += 1 // m.TxCount
255 for j1 := 0; j1 < 8; j1++ {
256 size += 2 // m.TxList[j1].TxQsize
257 size += 2 // m.TxList[j1].TxNext
258 size += 2 // m.TxList[j1].TxProduce
259 size += 2 // m.TxList[j1].TxConsume
263 func (m *Vmxnet3Details) Marshal(b []byte) ([]byte, error) {
265 b = make([]byte, m.Size())
267 buf := codec.NewBuffer(b)
268 buf.EncodeUint32(uint32(m.SwIfIndex))
269 buf.EncodeString(m.IfName, 64)
270 buf.EncodeBytes(m.HwAddr[:], 6)
271 buf.EncodeUint32(m.PciAddr)
272 buf.EncodeUint8(m.Version)
273 buf.EncodeBool(m.AdminUpDown)
274 buf.EncodeUint8(m.RxCount)
275 for j0 := 0; j0 < 16; j0++ {
276 buf.EncodeUint16(m.RxList[j0].RxQsize)
277 for i := 0; i < 2; i++ {
279 if i < len(m.RxList[j0].RxFill) {
280 x = uint16(m.RxList[j0].RxFill[i])
284 buf.EncodeUint16(m.RxList[j0].RxNext)
285 for i := 0; i < 2; i++ {
287 if i < len(m.RxList[j0].RxProduce) {
288 x = uint16(m.RxList[j0].RxProduce[i])
292 for i := 0; i < 2; i++ {
294 if i < len(m.RxList[j0].RxConsume) {
295 x = uint16(m.RxList[j0].RxConsume[i])
300 buf.EncodeUint8(m.TxCount)
301 for j0 := 0; j0 < 8; j0++ {
302 buf.EncodeUint16(m.TxList[j0].TxQsize)
303 buf.EncodeUint16(m.TxList[j0].TxNext)
304 buf.EncodeUint16(m.TxList[j0].TxProduce)
305 buf.EncodeUint16(m.TxList[j0].TxConsume)
307 return buf.Bytes(), nil
309 func (m *Vmxnet3Details) Unmarshal(b []byte) error {
310 buf := codec.NewBuffer(b)
311 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
312 m.IfName = buf.DecodeString(64)
313 copy(m.HwAddr[:], buf.DecodeBytes(6))
314 m.PciAddr = buf.DecodeUint32()
315 m.Version = buf.DecodeUint8()
316 m.AdminUpDown = buf.DecodeBool()
317 m.RxCount = buf.DecodeUint8()
318 for j0 := 0; j0 < 16; j0++ {
319 m.RxList[j0].RxQsize = buf.DecodeUint16()
320 m.RxList[j0].RxFill = make([]uint16, 2)
321 for i := 0; i < len(m.RxList[j0].RxFill); i++ {
322 m.RxList[j0].RxFill[i] = buf.DecodeUint16()
324 m.RxList[j0].RxNext = buf.DecodeUint16()
325 m.RxList[j0].RxProduce = make([]uint16, 2)
326 for i := 0; i < len(m.RxList[j0].RxProduce); i++ {
327 m.RxList[j0].RxProduce[i] = buf.DecodeUint16()
329 m.RxList[j0].RxConsume = make([]uint16, 2)
330 for i := 0; i < len(m.RxList[j0].RxConsume); i++ {
331 m.RxList[j0].RxConsume[i] = buf.DecodeUint16()
334 m.TxCount = buf.DecodeUint8()
335 for j0 := 0; j0 < 8; j0++ {
336 m.TxList[j0].TxQsize = buf.DecodeUint16()
337 m.TxList[j0].TxNext = buf.DecodeUint16()
338 m.TxList[j0].TxProduce = buf.DecodeUint16()
339 m.TxList[j0].TxConsume = buf.DecodeUint16()
344 // Vmxnet3Dump defines message 'vmxnet3_dump'.
345 type Vmxnet3Dump struct{}
347 func (m *Vmxnet3Dump) Reset() { *m = Vmxnet3Dump{} }
348 func (*Vmxnet3Dump) GetMessageName() string { return "vmxnet3_dump" }
349 func (*Vmxnet3Dump) GetCrcString() string { return "51077d14" }
350 func (*Vmxnet3Dump) GetMessageType() api.MessageType {
351 return api.RequestMessage
354 func (m *Vmxnet3Dump) Size() (size int) {
360 func (m *Vmxnet3Dump) Marshal(b []byte) ([]byte, error) {
362 b = make([]byte, m.Size())
364 buf := codec.NewBuffer(b)
365 return buf.Bytes(), nil
367 func (m *Vmxnet3Dump) Unmarshal(b []byte) error {
371 func init() { file_vmxnet3_binapi_init() }
372 func file_vmxnet3_binapi_init() {
373 api.RegisterMessage((*Vmxnet3Create)(nil), "vmxnet3_create_71a07314")
374 api.RegisterMessage((*Vmxnet3CreateReply)(nil), "vmxnet3_create_reply_5383d31f")
375 api.RegisterMessage((*Vmxnet3Delete)(nil), "vmxnet3_delete_f9e6675e")
376 api.RegisterMessage((*Vmxnet3DeleteReply)(nil), "vmxnet3_delete_reply_e8d4e804")
377 api.RegisterMessage((*Vmxnet3Details)(nil), "vmxnet3_details_829ba055")
378 api.RegisterMessage((*Vmxnet3Dump)(nil), "vmxnet3_dump_51077d14")
381 // Messages returns list of all messages in this module.
382 func AllMessages() []api.Message {
383 return []api.Message{
384 (*Vmxnet3Create)(nil),
385 (*Vmxnet3CreateReply)(nil),
386 (*Vmxnet3Delete)(nil),
387 (*Vmxnet3DeleteReply)(nil),
388 (*Vmxnet3Details)(nil),