Change module name to go.fd.io/govpp
[govpp.git] / binapi / rdma / rdma.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.6.0-dev
4 //  VPP:              22.02-release
5 // source: /usr/share/vpp/api/plugins/rdma.api.json
6
7 // Package rdma contains generated bindings for API file rdma.api.
8 //
9 // Contents:
10 //   3 enums
11 //   8 messages
12 //
13 package rdma
14
15 import (
16         "strconv"
17
18         api "go.fd.io/govpp/api"
19         interface_types "go.fd.io/govpp/binapi/interface_types"
20         codec "go.fd.io/govpp/codec"
21 )
22
23 // This is a compile-time assertion to ensure that this generated file
24 // is compatible with the GoVPP api package it is being compiled against.
25 // A compilation error at this line likely means your copy of the
26 // GoVPP api package needs to be updated.
27 const _ = api.GoVppAPIPackageIsVersion2
28
29 const (
30         APIFile    = "rdma"
31         APIVersion = "3.0.0"
32         VersionCrc = 0xdab70fa9
33 )
34
35 // RdmaMode defines enum 'rdma_mode'.
36 type RdmaMode uint32
37
38 const (
39         RDMA_API_MODE_AUTO RdmaMode = 0
40         RDMA_API_MODE_IBV  RdmaMode = 1
41         RDMA_API_MODE_DV   RdmaMode = 2
42 )
43
44 var (
45         RdmaMode_name = map[uint32]string{
46                 0: "RDMA_API_MODE_AUTO",
47                 1: "RDMA_API_MODE_IBV",
48                 2: "RDMA_API_MODE_DV",
49         }
50         RdmaMode_value = map[string]uint32{
51                 "RDMA_API_MODE_AUTO": 0,
52                 "RDMA_API_MODE_IBV":  1,
53                 "RDMA_API_MODE_DV":   2,
54         }
55 )
56
57 func (x RdmaMode) String() string {
58         s, ok := RdmaMode_name[uint32(x)]
59         if ok {
60                 return s
61         }
62         return "RdmaMode(" + strconv.Itoa(int(x)) + ")"
63 }
64
65 // RdmaRss4 defines enum 'rdma_rss4'.
66 type RdmaRss4 uint32
67
68 const (
69         RDMA_API_RSS4_AUTO   RdmaRss4 = 0
70         RDMA_API_RSS4_IP     RdmaRss4 = 1
71         RDMA_API_RSS4_IP_UDP RdmaRss4 = 2
72         RDMA_API_RSS4_IP_TCP RdmaRss4 = 3
73 )
74
75 var (
76         RdmaRss4_name = map[uint32]string{
77                 0: "RDMA_API_RSS4_AUTO",
78                 1: "RDMA_API_RSS4_IP",
79                 2: "RDMA_API_RSS4_IP_UDP",
80                 3: "RDMA_API_RSS4_IP_TCP",
81         }
82         RdmaRss4_value = map[string]uint32{
83                 "RDMA_API_RSS4_AUTO":   0,
84                 "RDMA_API_RSS4_IP":     1,
85                 "RDMA_API_RSS4_IP_UDP": 2,
86                 "RDMA_API_RSS4_IP_TCP": 3,
87         }
88 )
89
90 func (x RdmaRss4) String() string {
91         s, ok := RdmaRss4_name[uint32(x)]
92         if ok {
93                 return s
94         }
95         return "RdmaRss4(" + strconv.Itoa(int(x)) + ")"
96 }
97
98 // RdmaRss6 defines enum 'rdma_rss6'.
99 type RdmaRss6 uint32
100
101 const (
102         RDMA_API_RSS6_AUTO   RdmaRss6 = 0
103         RDMA_API_RSS6_IP     RdmaRss6 = 1
104         RDMA_API_RSS6_IP_UDP RdmaRss6 = 2
105         RDMA_API_RSS6_IP_TCP RdmaRss6 = 3
106 )
107
108 var (
109         RdmaRss6_name = map[uint32]string{
110                 0: "RDMA_API_RSS6_AUTO",
111                 1: "RDMA_API_RSS6_IP",
112                 2: "RDMA_API_RSS6_IP_UDP",
113                 3: "RDMA_API_RSS6_IP_TCP",
114         }
115         RdmaRss6_value = map[string]uint32{
116                 "RDMA_API_RSS6_AUTO":   0,
117                 "RDMA_API_RSS6_IP":     1,
118                 "RDMA_API_RSS6_IP_UDP": 2,
119                 "RDMA_API_RSS6_IP_TCP": 3,
120         }
121 )
122
123 func (x RdmaRss6) String() string {
124         s, ok := RdmaRss6_name[uint32(x)]
125         if ok {
126                 return s
127         }
128         return "RdmaRss6(" + strconv.Itoa(int(x)) + ")"
129 }
130
131 // RdmaCreate defines message 'rdma_create'.
132 // Deprecated: 21.01
133 type RdmaCreate struct {
134         HostIf  string   `binapi:"string[64],name=host_if" json:"host_if,omitempty"`
135         Name    string   `binapi:"string[64],name=name" json:"name,omitempty"`
136         RxqNum  uint16   `binapi:"u16,name=rxq_num,default=1" json:"rxq_num,omitempty"`
137         RxqSize uint16   `binapi:"u16,name=rxq_size,default=1024" json:"rxq_size,omitempty"`
138         TxqSize uint16   `binapi:"u16,name=txq_size,default=1024" json:"txq_size,omitempty"`
139         Mode    RdmaMode `binapi:"rdma_mode,name=mode,default=0" json:"mode,omitempty"`
140 }
141
142 func (m *RdmaCreate) Reset()               { *m = RdmaCreate{} }
143 func (*RdmaCreate) GetMessageName() string { return "rdma_create" }
144 func (*RdmaCreate) GetCrcString() string   { return "076fe418" }
145 func (*RdmaCreate) GetMessageType() api.MessageType {
146         return api.RequestMessage
147 }
148
149 func (m *RdmaCreate) Size() (size int) {
150         if m == nil {
151                 return 0
152         }
153         size += 64 // m.HostIf
154         size += 64 // m.Name
155         size += 2  // m.RxqNum
156         size += 2  // m.RxqSize
157         size += 2  // m.TxqSize
158         size += 4  // m.Mode
159         return size
160 }
161 func (m *RdmaCreate) Marshal(b []byte) ([]byte, error) {
162         if b == nil {
163                 b = make([]byte, m.Size())
164         }
165         buf := codec.NewBuffer(b)
166         buf.EncodeString(m.HostIf, 64)
167         buf.EncodeString(m.Name, 64)
168         buf.EncodeUint16(m.RxqNum)
169         buf.EncodeUint16(m.RxqSize)
170         buf.EncodeUint16(m.TxqSize)
171         buf.EncodeUint32(uint32(m.Mode))
172         return buf.Bytes(), nil
173 }
174 func (m *RdmaCreate) Unmarshal(b []byte) error {
175         buf := codec.NewBuffer(b)
176         m.HostIf = buf.DecodeString(64)
177         m.Name = buf.DecodeString(64)
178         m.RxqNum = buf.DecodeUint16()
179         m.RxqSize = buf.DecodeUint16()
180         m.TxqSize = buf.DecodeUint16()
181         m.Mode = RdmaMode(buf.DecodeUint32())
182         return nil
183 }
184
185 // RdmaCreateReply defines message 'rdma_create_reply'.
186 type RdmaCreateReply struct {
187         Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
188         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
189 }
190
191 func (m *RdmaCreateReply) Reset()               { *m = RdmaCreateReply{} }
192 func (*RdmaCreateReply) GetMessageName() string { return "rdma_create_reply" }
193 func (*RdmaCreateReply) GetCrcString() string   { return "5383d31f" }
194 func (*RdmaCreateReply) GetMessageType() api.MessageType {
195         return api.ReplyMessage
196 }
197
198 func (m *RdmaCreateReply) Size() (size int) {
199         if m == nil {
200                 return 0
201         }
202         size += 4 // m.Retval
203         size += 4 // m.SwIfIndex
204         return size
205 }
206 func (m *RdmaCreateReply) Marshal(b []byte) ([]byte, error) {
207         if b == nil {
208                 b = make([]byte, m.Size())
209         }
210         buf := codec.NewBuffer(b)
211         buf.EncodeInt32(m.Retval)
212         buf.EncodeUint32(uint32(m.SwIfIndex))
213         return buf.Bytes(), nil
214 }
215 func (m *RdmaCreateReply) Unmarshal(b []byte) error {
216         buf := codec.NewBuffer(b)
217         m.Retval = buf.DecodeInt32()
218         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
219         return nil
220 }
221
222 // RdmaCreateV2 defines message 'rdma_create_v2'.
223 // Deprecated: the message will be removed in the future versions
224 type RdmaCreateV2 struct {
225         HostIf     string   `binapi:"string[64],name=host_if" json:"host_if,omitempty"`
226         Name       string   `binapi:"string[64],name=name" json:"name,omitempty"`
227         RxqNum     uint16   `binapi:"u16,name=rxq_num,default=1" json:"rxq_num,omitempty"`
228         RxqSize    uint16   `binapi:"u16,name=rxq_size,default=1024" json:"rxq_size,omitempty"`
229         TxqSize    uint16   `binapi:"u16,name=txq_size,default=1024" json:"txq_size,omitempty"`
230         Mode       RdmaMode `binapi:"rdma_mode,name=mode,default=0" json:"mode,omitempty"`
231         NoMultiSeg bool     `binapi:"bool,name=no_multi_seg,default=0" json:"no_multi_seg,omitempty"`
232         MaxPktlen  uint16   `binapi:"u16,name=max_pktlen,default=0" json:"max_pktlen,omitempty"`
233 }
234
235 func (m *RdmaCreateV2) Reset()               { *m = RdmaCreateV2{} }
236 func (*RdmaCreateV2) GetMessageName() string { return "rdma_create_v2" }
237 func (*RdmaCreateV2) GetCrcString() string   { return "5826a4f3" }
238 func (*RdmaCreateV2) GetMessageType() api.MessageType {
239         return api.RequestMessage
240 }
241
242 func (m *RdmaCreateV2) Size() (size int) {
243         if m == nil {
244                 return 0
245         }
246         size += 64 // m.HostIf
247         size += 64 // m.Name
248         size += 2  // m.RxqNum
249         size += 2  // m.RxqSize
250         size += 2  // m.TxqSize
251         size += 4  // m.Mode
252         size += 1  // m.NoMultiSeg
253         size += 2  // m.MaxPktlen
254         return size
255 }
256 func (m *RdmaCreateV2) Marshal(b []byte) ([]byte, error) {
257         if b == nil {
258                 b = make([]byte, m.Size())
259         }
260         buf := codec.NewBuffer(b)
261         buf.EncodeString(m.HostIf, 64)
262         buf.EncodeString(m.Name, 64)
263         buf.EncodeUint16(m.RxqNum)
264         buf.EncodeUint16(m.RxqSize)
265         buf.EncodeUint16(m.TxqSize)
266         buf.EncodeUint32(uint32(m.Mode))
267         buf.EncodeBool(m.NoMultiSeg)
268         buf.EncodeUint16(m.MaxPktlen)
269         return buf.Bytes(), nil
270 }
271 func (m *RdmaCreateV2) Unmarshal(b []byte) error {
272         buf := codec.NewBuffer(b)
273         m.HostIf = buf.DecodeString(64)
274         m.Name = buf.DecodeString(64)
275         m.RxqNum = buf.DecodeUint16()
276         m.RxqSize = buf.DecodeUint16()
277         m.TxqSize = buf.DecodeUint16()
278         m.Mode = RdmaMode(buf.DecodeUint32())
279         m.NoMultiSeg = buf.DecodeBool()
280         m.MaxPktlen = buf.DecodeUint16()
281         return nil
282 }
283
284 // RdmaCreateV2Reply defines message 'rdma_create_v2_reply'.
285 type RdmaCreateV2Reply struct {
286         Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
287         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
288 }
289
290 func (m *RdmaCreateV2Reply) Reset()               { *m = RdmaCreateV2Reply{} }
291 func (*RdmaCreateV2Reply) GetMessageName() string { return "rdma_create_v2_reply" }
292 func (*RdmaCreateV2Reply) GetCrcString() string   { return "5383d31f" }
293 func (*RdmaCreateV2Reply) GetMessageType() api.MessageType {
294         return api.ReplyMessage
295 }
296
297 func (m *RdmaCreateV2Reply) Size() (size int) {
298         if m == nil {
299                 return 0
300         }
301         size += 4 // m.Retval
302         size += 4 // m.SwIfIndex
303         return size
304 }
305 func (m *RdmaCreateV2Reply) Marshal(b []byte) ([]byte, error) {
306         if b == nil {
307                 b = make([]byte, m.Size())
308         }
309         buf := codec.NewBuffer(b)
310         buf.EncodeInt32(m.Retval)
311         buf.EncodeUint32(uint32(m.SwIfIndex))
312         return buf.Bytes(), nil
313 }
314 func (m *RdmaCreateV2Reply) Unmarshal(b []byte) error {
315         buf := codec.NewBuffer(b)
316         m.Retval = buf.DecodeInt32()
317         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
318         return nil
319 }
320
321 // RdmaCreateV3 defines message 'rdma_create_v3'.
322 type RdmaCreateV3 struct {
323         HostIf     string   `binapi:"string[64],name=host_if" json:"host_if,omitempty"`
324         Name       string   `binapi:"string[64],name=name" json:"name,omitempty"`
325         RxqNum     uint16   `binapi:"u16,name=rxq_num,default=1" json:"rxq_num,omitempty"`
326         RxqSize    uint16   `binapi:"u16,name=rxq_size,default=1024" json:"rxq_size,omitempty"`
327         TxqSize    uint16   `binapi:"u16,name=txq_size,default=1024" json:"txq_size,omitempty"`
328         Mode       RdmaMode `binapi:"rdma_mode,name=mode,default=0" json:"mode,omitempty"`
329         NoMultiSeg bool     `binapi:"bool,name=no_multi_seg,default=0" json:"no_multi_seg,omitempty"`
330         MaxPktlen  uint16   `binapi:"u16,name=max_pktlen,default=0" json:"max_pktlen,omitempty"`
331         Rss4       RdmaRss4 `binapi:"rdma_rss4,name=rss4,default=0" json:"rss4,omitempty"`
332         Rss6       RdmaRss6 `binapi:"rdma_rss6,name=rss6,default=0" json:"rss6,omitempty"`
333 }
334
335 func (m *RdmaCreateV3) Reset()               { *m = RdmaCreateV3{} }
336 func (*RdmaCreateV3) GetMessageName() string { return "rdma_create_v3" }
337 func (*RdmaCreateV3) GetCrcString() string   { return "c6287ea8" }
338 func (*RdmaCreateV3) GetMessageType() api.MessageType {
339         return api.RequestMessage
340 }
341
342 func (m *RdmaCreateV3) Size() (size int) {
343         if m == nil {
344                 return 0
345         }
346         size += 64 // m.HostIf
347         size += 64 // m.Name
348         size += 2  // m.RxqNum
349         size += 2  // m.RxqSize
350         size += 2  // m.TxqSize
351         size += 4  // m.Mode
352         size += 1  // m.NoMultiSeg
353         size += 2  // m.MaxPktlen
354         size += 4  // m.Rss4
355         size += 4  // m.Rss6
356         return size
357 }
358 func (m *RdmaCreateV3) Marshal(b []byte) ([]byte, error) {
359         if b == nil {
360                 b = make([]byte, m.Size())
361         }
362         buf := codec.NewBuffer(b)
363         buf.EncodeString(m.HostIf, 64)
364         buf.EncodeString(m.Name, 64)
365         buf.EncodeUint16(m.RxqNum)
366         buf.EncodeUint16(m.RxqSize)
367         buf.EncodeUint16(m.TxqSize)
368         buf.EncodeUint32(uint32(m.Mode))
369         buf.EncodeBool(m.NoMultiSeg)
370         buf.EncodeUint16(m.MaxPktlen)
371         buf.EncodeUint32(uint32(m.Rss4))
372         buf.EncodeUint32(uint32(m.Rss6))
373         return buf.Bytes(), nil
374 }
375 func (m *RdmaCreateV3) Unmarshal(b []byte) error {
376         buf := codec.NewBuffer(b)
377         m.HostIf = buf.DecodeString(64)
378         m.Name = buf.DecodeString(64)
379         m.RxqNum = buf.DecodeUint16()
380         m.RxqSize = buf.DecodeUint16()
381         m.TxqSize = buf.DecodeUint16()
382         m.Mode = RdmaMode(buf.DecodeUint32())
383         m.NoMultiSeg = buf.DecodeBool()
384         m.MaxPktlen = buf.DecodeUint16()
385         m.Rss4 = RdmaRss4(buf.DecodeUint32())
386         m.Rss6 = RdmaRss6(buf.DecodeUint32())
387         return nil
388 }
389
390 // RdmaCreateV3Reply defines message 'rdma_create_v3_reply'.
391 type RdmaCreateV3Reply struct {
392         Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
393         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
394 }
395
396 func (m *RdmaCreateV3Reply) Reset()               { *m = RdmaCreateV3Reply{} }
397 func (*RdmaCreateV3Reply) GetMessageName() string { return "rdma_create_v3_reply" }
398 func (*RdmaCreateV3Reply) GetCrcString() string   { return "5383d31f" }
399 func (*RdmaCreateV3Reply) GetMessageType() api.MessageType {
400         return api.ReplyMessage
401 }
402
403 func (m *RdmaCreateV3Reply) Size() (size int) {
404         if m == nil {
405                 return 0
406         }
407         size += 4 // m.Retval
408         size += 4 // m.SwIfIndex
409         return size
410 }
411 func (m *RdmaCreateV3Reply) Marshal(b []byte) ([]byte, error) {
412         if b == nil {
413                 b = make([]byte, m.Size())
414         }
415         buf := codec.NewBuffer(b)
416         buf.EncodeInt32(m.Retval)
417         buf.EncodeUint32(uint32(m.SwIfIndex))
418         return buf.Bytes(), nil
419 }
420 func (m *RdmaCreateV3Reply) Unmarshal(b []byte) error {
421         buf := codec.NewBuffer(b)
422         m.Retval = buf.DecodeInt32()
423         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
424         return nil
425 }
426
427 // RdmaDelete defines message 'rdma_delete'.
428 type RdmaDelete struct {
429         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
430 }
431
432 func (m *RdmaDelete) Reset()               { *m = RdmaDelete{} }
433 func (*RdmaDelete) GetMessageName() string { return "rdma_delete" }
434 func (*RdmaDelete) GetCrcString() string   { return "f9e6675e" }
435 func (*RdmaDelete) GetMessageType() api.MessageType {
436         return api.RequestMessage
437 }
438
439 func (m *RdmaDelete) Size() (size int) {
440         if m == nil {
441                 return 0
442         }
443         size += 4 // m.SwIfIndex
444         return size
445 }
446 func (m *RdmaDelete) Marshal(b []byte) ([]byte, error) {
447         if b == nil {
448                 b = make([]byte, m.Size())
449         }
450         buf := codec.NewBuffer(b)
451         buf.EncodeUint32(uint32(m.SwIfIndex))
452         return buf.Bytes(), nil
453 }
454 func (m *RdmaDelete) Unmarshal(b []byte) error {
455         buf := codec.NewBuffer(b)
456         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
457         return nil
458 }
459
460 // RdmaDeleteReply defines message 'rdma_delete_reply'.
461 type RdmaDeleteReply struct {
462         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
463 }
464
465 func (m *RdmaDeleteReply) Reset()               { *m = RdmaDeleteReply{} }
466 func (*RdmaDeleteReply) GetMessageName() string { return "rdma_delete_reply" }
467 func (*RdmaDeleteReply) GetCrcString() string   { return "e8d4e804" }
468 func (*RdmaDeleteReply) GetMessageType() api.MessageType {
469         return api.ReplyMessage
470 }
471
472 func (m *RdmaDeleteReply) Size() (size int) {
473         if m == nil {
474                 return 0
475         }
476         size += 4 // m.Retval
477         return size
478 }
479 func (m *RdmaDeleteReply) Marshal(b []byte) ([]byte, error) {
480         if b == nil {
481                 b = make([]byte, m.Size())
482         }
483         buf := codec.NewBuffer(b)
484         buf.EncodeInt32(m.Retval)
485         return buf.Bytes(), nil
486 }
487 func (m *RdmaDeleteReply) Unmarshal(b []byte) error {
488         buf := codec.NewBuffer(b)
489         m.Retval = buf.DecodeInt32()
490         return nil
491 }
492
493 func init() { file_rdma_binapi_init() }
494 func file_rdma_binapi_init() {
495         api.RegisterMessage((*RdmaCreate)(nil), "rdma_create_076fe418")
496         api.RegisterMessage((*RdmaCreateReply)(nil), "rdma_create_reply_5383d31f")
497         api.RegisterMessage((*RdmaCreateV2)(nil), "rdma_create_v2_5826a4f3")
498         api.RegisterMessage((*RdmaCreateV2Reply)(nil), "rdma_create_v2_reply_5383d31f")
499         api.RegisterMessage((*RdmaCreateV3)(nil), "rdma_create_v3_c6287ea8")
500         api.RegisterMessage((*RdmaCreateV3Reply)(nil), "rdma_create_v3_reply_5383d31f")
501         api.RegisterMessage((*RdmaDelete)(nil), "rdma_delete_f9e6675e")
502         api.RegisterMessage((*RdmaDeleteReply)(nil), "rdma_delete_reply_e8d4e804")
503 }
504
505 // Messages returns list of all messages in this module.
506 func AllMessages() []api.Message {
507         return []api.Message{
508                 (*RdmaCreate)(nil),
509                 (*RdmaCreateReply)(nil),
510                 (*RdmaCreateV2)(nil),
511                 (*RdmaCreateV2Reply)(nil),
512                 (*RdmaCreateV3)(nil),
513                 (*RdmaCreateV3Reply)(nil),
514                 (*RdmaDelete)(nil),
515                 (*RdmaDeleteReply)(nil),
516         }
517 }