1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
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() int {
75 size += 4 // m.PciAddr
76 size += 4 // m.EnableElog
77 size += 2 // m.RxqSize
79 size += 2 // m.TxqSize
82 size += 1 // m.EnableGso
85 func (m *Vmxnet3Create) Marshal(b []byte) ([]byte, error) {
88 buf = codec.NewBuffer(make([]byte, m.Size()))
90 buf = codec.NewBuffer(b)
92 buf.EncodeUint32(uint32(m.PciAddr))
93 buf.EncodeUint32(uint32(m.EnableElog))
94 buf.EncodeUint16(uint16(m.RxqSize))
95 buf.EncodeUint16(uint16(m.RxqNum))
96 buf.EncodeUint16(uint16(m.TxqSize))
97 buf.EncodeUint16(uint16(m.TxqNum))
98 buf.EncodeUint8(uint8(m.Bind))
99 buf.EncodeBool(m.EnableGso)
100 return buf.Bytes(), nil
102 func (m *Vmxnet3Create) Unmarshal(b []byte) error {
103 buf := codec.NewBuffer(b)
104 m.PciAddr = buf.DecodeUint32()
105 m.EnableElog = int32(buf.DecodeUint32())
106 m.RxqSize = buf.DecodeUint16()
107 m.RxqNum = buf.DecodeUint16()
108 m.TxqSize = buf.DecodeUint16()
109 m.TxqNum = buf.DecodeUint16()
110 m.Bind = buf.DecodeUint8()
111 m.EnableGso = buf.DecodeBool()
115 // Vmxnet3CreateReply defines message 'vmxnet3_create_reply'.
116 type Vmxnet3CreateReply struct {
117 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
118 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
121 func (m *Vmxnet3CreateReply) Reset() { *m = Vmxnet3CreateReply{} }
122 func (*Vmxnet3CreateReply) GetMessageName() string { return "vmxnet3_create_reply" }
123 func (*Vmxnet3CreateReply) GetCrcString() string { return "5383d31f" }
124 func (*Vmxnet3CreateReply) GetMessageType() api.MessageType {
125 return api.ReplyMessage
128 func (m *Vmxnet3CreateReply) Size() int {
133 size += 4 // m.Retval
134 size += 4 // m.SwIfIndex
137 func (m *Vmxnet3CreateReply) Marshal(b []byte) ([]byte, error) {
138 var buf *codec.Buffer
140 buf = codec.NewBuffer(make([]byte, m.Size()))
142 buf = codec.NewBuffer(b)
144 buf.EncodeUint32(uint32(m.Retval))
145 buf.EncodeUint32(uint32(m.SwIfIndex))
146 return buf.Bytes(), nil
148 func (m *Vmxnet3CreateReply) Unmarshal(b []byte) error {
149 buf := codec.NewBuffer(b)
150 m.Retval = int32(buf.DecodeUint32())
151 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
155 // Vmxnet3Delete defines message 'vmxnet3_delete'.
156 type Vmxnet3Delete struct {
157 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
160 func (m *Vmxnet3Delete) Reset() { *m = Vmxnet3Delete{} }
161 func (*Vmxnet3Delete) GetMessageName() string { return "vmxnet3_delete" }
162 func (*Vmxnet3Delete) GetCrcString() string { return "f9e6675e" }
163 func (*Vmxnet3Delete) GetMessageType() api.MessageType {
164 return api.RequestMessage
167 func (m *Vmxnet3Delete) Size() int {
172 size += 4 // m.SwIfIndex
175 func (m *Vmxnet3Delete) Marshal(b []byte) ([]byte, error) {
176 var buf *codec.Buffer
178 buf = codec.NewBuffer(make([]byte, m.Size()))
180 buf = codec.NewBuffer(b)
182 buf.EncodeUint32(uint32(m.SwIfIndex))
183 return buf.Bytes(), nil
185 func (m *Vmxnet3Delete) Unmarshal(b []byte) error {
186 buf := codec.NewBuffer(b)
187 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
191 // Vmxnet3DeleteReply defines message 'vmxnet3_delete_reply'.
192 type Vmxnet3DeleteReply struct {
193 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
196 func (m *Vmxnet3DeleteReply) Reset() { *m = Vmxnet3DeleteReply{} }
197 func (*Vmxnet3DeleteReply) GetMessageName() string { return "vmxnet3_delete_reply" }
198 func (*Vmxnet3DeleteReply) GetCrcString() string { return "e8d4e804" }
199 func (*Vmxnet3DeleteReply) GetMessageType() api.MessageType {
200 return api.ReplyMessage
203 func (m *Vmxnet3DeleteReply) Size() int {
208 size += 4 // m.Retval
211 func (m *Vmxnet3DeleteReply) Marshal(b []byte) ([]byte, error) {
212 var buf *codec.Buffer
214 buf = codec.NewBuffer(make([]byte, m.Size()))
216 buf = codec.NewBuffer(b)
218 buf.EncodeUint32(uint32(m.Retval))
219 return buf.Bytes(), nil
221 func (m *Vmxnet3DeleteReply) Unmarshal(b []byte) error {
222 buf := codec.NewBuffer(b)
223 m.Retval = int32(buf.DecodeUint32())
227 // Vmxnet3Details defines message 'vmxnet3_details'.
228 type Vmxnet3Details struct {
229 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
230 IfName string `binapi:"string[64],name=if_name" json:"if_name,omitempty"`
231 HwAddr ethernet_types.MacAddress `binapi:"mac_address,name=hw_addr" json:"hw_addr,omitempty"`
232 PciAddr uint32 `binapi:"u32,name=pci_addr" json:"pci_addr,omitempty"`
233 Version uint8 `binapi:"u8,name=version" json:"version,omitempty"`
234 AdminUpDown bool `binapi:"bool,name=admin_up_down" json:"admin_up_down,omitempty"`
235 RxCount uint8 `binapi:"u8,name=rx_count" json:"rx_count,omitempty"`
236 RxList [16]Vmxnet3RxList `binapi:"vmxnet3_rx_list[16],name=rx_list" json:"rx_list,omitempty"`
237 TxCount uint8 `binapi:"u8,name=tx_count" json:"tx_count,omitempty"`
238 TxList [8]Vmxnet3TxList `binapi:"vmxnet3_tx_list[8],name=tx_list" json:"tx_list,omitempty"`
241 func (m *Vmxnet3Details) Reset() { *m = Vmxnet3Details{} }
242 func (*Vmxnet3Details) GetMessageName() string { return "vmxnet3_details" }
243 func (*Vmxnet3Details) GetCrcString() string { return "829ba055" }
244 func (*Vmxnet3Details) GetMessageType() api.MessageType {
245 return api.ReplyMessage
248 func (m *Vmxnet3Details) Size() int {
253 size += 4 // m.SwIfIndex
254 size += 64 // m.IfName
255 size += 1 * 6 // m.HwAddr
256 size += 4 // m.PciAddr
257 size += 1 // m.Version
258 size += 1 // m.AdminUpDown
259 size += 1 // m.RxCount
260 for j1 := 0; j1 < 16; j1++ {
263 if j1 < len(m.RxList) {
266 size += 2 // s1.RxQsize
267 size += 2 * 2 // s1.RxFill
268 size += 2 // s1.RxNext
269 size += 2 * 2 // s1.RxProduce
270 size += 2 * 2 // s1.RxConsume
272 size += 1 // m.TxCount
273 for j1 := 0; j1 < 8; j1++ {
276 if j1 < len(m.TxList) {
279 size += 2 // s1.TxQsize
280 size += 2 // s1.TxNext
281 size += 2 // s1.TxProduce
282 size += 2 // s1.TxConsume
286 func (m *Vmxnet3Details) Marshal(b []byte) ([]byte, error) {
287 var buf *codec.Buffer
289 buf = codec.NewBuffer(make([]byte, m.Size()))
291 buf = codec.NewBuffer(b)
293 buf.EncodeUint32(uint32(m.SwIfIndex))
294 buf.EncodeString(m.IfName, 64)
295 buf.EncodeBytes(m.HwAddr[:], 6)
296 buf.EncodeUint32(uint32(m.PciAddr))
297 buf.EncodeUint8(uint8(m.Version))
298 buf.EncodeBool(m.AdminUpDown)
299 buf.EncodeUint8(uint8(m.RxCount))
300 for j0 := 0; j0 < 16; j0++ {
302 if j0 < len(m.RxList) {
305 buf.EncodeUint16(uint16(v0.RxQsize))
306 for i := 0; i < 2; i++ {
308 if i < len(v0.RxFill) {
309 x = uint16(v0.RxFill[i])
311 buf.EncodeUint16(uint16(x))
313 buf.EncodeUint16(uint16(v0.RxNext))
314 for i := 0; i < 2; i++ {
316 if i < len(v0.RxProduce) {
317 x = uint16(v0.RxProduce[i])
319 buf.EncodeUint16(uint16(x))
321 for i := 0; i < 2; i++ {
323 if i < len(v0.RxConsume) {
324 x = uint16(v0.RxConsume[i])
326 buf.EncodeUint16(uint16(x))
329 buf.EncodeUint8(uint8(m.TxCount))
330 for j0 := 0; j0 < 8; j0++ {
332 if j0 < len(m.TxList) {
335 buf.EncodeUint16(uint16(v0.TxQsize))
336 buf.EncodeUint16(uint16(v0.TxNext))
337 buf.EncodeUint16(uint16(v0.TxProduce))
338 buf.EncodeUint16(uint16(v0.TxConsume))
340 return buf.Bytes(), nil
342 func (m *Vmxnet3Details) Unmarshal(b []byte) error {
343 buf := codec.NewBuffer(b)
344 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
345 m.IfName = buf.DecodeString(64)
346 copy(m.HwAddr[:], buf.DecodeBytes(6))
347 m.PciAddr = buf.DecodeUint32()
348 m.Version = buf.DecodeUint8()
349 m.AdminUpDown = buf.DecodeBool()
350 m.RxCount = buf.DecodeUint8()
351 for j0 := 0; j0 < 16; j0++ {
352 m.RxList[j0].RxQsize = buf.DecodeUint16()
353 m.RxList[j0].RxFill = make([]uint16, 2)
354 for i := 0; i < len(m.RxList[j0].RxFill); i++ {
355 m.RxList[j0].RxFill[i] = buf.DecodeUint16()
357 m.RxList[j0].RxNext = buf.DecodeUint16()
358 m.RxList[j0].RxProduce = make([]uint16, 2)
359 for i := 0; i < len(m.RxList[j0].RxProduce); i++ {
360 m.RxList[j0].RxProduce[i] = buf.DecodeUint16()
362 m.RxList[j0].RxConsume = make([]uint16, 2)
363 for i := 0; i < len(m.RxList[j0].RxConsume); i++ {
364 m.RxList[j0].RxConsume[i] = buf.DecodeUint16()
367 m.TxCount = buf.DecodeUint8()
368 for j0 := 0; j0 < 8; j0++ {
369 m.TxList[j0].TxQsize = buf.DecodeUint16()
370 m.TxList[j0].TxNext = buf.DecodeUint16()
371 m.TxList[j0].TxProduce = buf.DecodeUint16()
372 m.TxList[j0].TxConsume = buf.DecodeUint16()
377 // Vmxnet3Dump defines message 'vmxnet3_dump'.
378 type Vmxnet3Dump struct{}
380 func (m *Vmxnet3Dump) Reset() { *m = Vmxnet3Dump{} }
381 func (*Vmxnet3Dump) GetMessageName() string { return "vmxnet3_dump" }
382 func (*Vmxnet3Dump) GetCrcString() string { return "51077d14" }
383 func (*Vmxnet3Dump) GetMessageType() api.MessageType {
384 return api.RequestMessage
387 func (m *Vmxnet3Dump) Size() int {
394 func (m *Vmxnet3Dump) Marshal(b []byte) ([]byte, error) {
395 var buf *codec.Buffer
397 buf = codec.NewBuffer(make([]byte, m.Size()))
399 buf = codec.NewBuffer(b)
401 return buf.Bytes(), nil
403 func (m *Vmxnet3Dump) Unmarshal(b []byte) error {
407 func init() { file_vmxnet3_binapi_init() }
408 func file_vmxnet3_binapi_init() {
409 api.RegisterMessage((*Vmxnet3Create)(nil), "vmxnet3_create_71a07314")
410 api.RegisterMessage((*Vmxnet3CreateReply)(nil), "vmxnet3_create_reply_5383d31f")
411 api.RegisterMessage((*Vmxnet3Delete)(nil), "vmxnet3_delete_f9e6675e")
412 api.RegisterMessage((*Vmxnet3DeleteReply)(nil), "vmxnet3_delete_reply_e8d4e804")
413 api.RegisterMessage((*Vmxnet3Details)(nil), "vmxnet3_details_829ba055")
414 api.RegisterMessage((*Vmxnet3Dump)(nil), "vmxnet3_dump_51077d14")
417 // Messages returns list of all messages in this module.
418 func AllMessages() []api.Message {
419 return []api.Message{
420 (*Vmxnet3Create)(nil),
421 (*Vmxnet3CreateReply)(nil),
422 (*Vmxnet3Delete)(nil),
423 (*Vmxnet3DeleteReply)(nil),
424 (*Vmxnet3Details)(nil),