Update generated binapi to v22.02 & makefile changes
[govpp.git] / internal / testbinapi / binapi2001 / rdma / rdma.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.5.0-dev
4 //  VPP:              20.01
5 // source: .vppapi/plugins/rdma.api.json
6
7 // Package rdma contains generated bindings for API file rdma.api.
8 //
9 // Contents:
10 //   1 alias
11 //   7 enums
12 //   4 messages
13 //
14 package rdma
15
16 import (
17         "strconv"
18
19         api "git.fd.io/govpp.git/api"
20         codec "git.fd.io/govpp.git/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 = "1.0.0"
32         VersionCrc = 0x5ce233e0
33 )
34
35 // IfStatusFlags defines enum 'if_status_flags'.
36 type IfStatusFlags uint32
37
38 const (
39         IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
40         IF_STATUS_API_FLAG_LINK_UP  IfStatusFlags = 2
41 )
42
43 var (
44         IfStatusFlags_name = map[uint32]string{
45                 1: "IF_STATUS_API_FLAG_ADMIN_UP",
46                 2: "IF_STATUS_API_FLAG_LINK_UP",
47         }
48         IfStatusFlags_value = map[string]uint32{
49                 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
50                 "IF_STATUS_API_FLAG_LINK_UP":  2,
51         }
52 )
53
54 func (x IfStatusFlags) String() string {
55         s, ok := IfStatusFlags_name[uint32(x)]
56         if ok {
57                 return s
58         }
59         str := func(n uint32) string {
60                 s, ok := IfStatusFlags_name[uint32(n)]
61                 if ok {
62                         return s
63                 }
64                 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
65         }
66         for i := uint32(0); i <= 32; i++ {
67                 val := uint32(x)
68                 if val&(1<<i) != 0 {
69                         if s != "" {
70                                 s += "|"
71                         }
72                         s += str(1 << i)
73                 }
74         }
75         if s == "" {
76                 return str(uint32(x))
77         }
78         return s
79 }
80
81 // IfType defines enum 'if_type'.
82 type IfType uint32
83
84 const (
85         IF_API_TYPE_HARDWARE IfType = 1
86         IF_API_TYPE_SUB      IfType = 2
87         IF_API_TYPE_P2P      IfType = 3
88         IF_API_TYPE_PIPE     IfType = 4
89 )
90
91 var (
92         IfType_name = map[uint32]string{
93                 1: "IF_API_TYPE_HARDWARE",
94                 2: "IF_API_TYPE_SUB",
95                 3: "IF_API_TYPE_P2P",
96                 4: "IF_API_TYPE_PIPE",
97         }
98         IfType_value = map[string]uint32{
99                 "IF_API_TYPE_HARDWARE": 1,
100                 "IF_API_TYPE_SUB":      2,
101                 "IF_API_TYPE_P2P":      3,
102                 "IF_API_TYPE_PIPE":     4,
103         }
104 )
105
106 func (x IfType) String() string {
107         s, ok := IfType_name[uint32(x)]
108         if ok {
109                 return s
110         }
111         return "IfType(" + strconv.Itoa(int(x)) + ")"
112 }
113
114 // LinkDuplex defines enum 'link_duplex'.
115 type LinkDuplex uint32
116
117 const (
118         LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
119         LINK_DUPLEX_API_HALF    LinkDuplex = 1
120         LINK_DUPLEX_API_FULL    LinkDuplex = 2
121 )
122
123 var (
124         LinkDuplex_name = map[uint32]string{
125                 0: "LINK_DUPLEX_API_UNKNOWN",
126                 1: "LINK_DUPLEX_API_HALF",
127                 2: "LINK_DUPLEX_API_FULL",
128         }
129         LinkDuplex_value = map[string]uint32{
130                 "LINK_DUPLEX_API_UNKNOWN": 0,
131                 "LINK_DUPLEX_API_HALF":    1,
132                 "LINK_DUPLEX_API_FULL":    2,
133         }
134 )
135
136 func (x LinkDuplex) String() string {
137         s, ok := LinkDuplex_name[uint32(x)]
138         if ok {
139                 return s
140         }
141         return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
142 }
143
144 // MtuProto defines enum 'mtu_proto'.
145 type MtuProto uint32
146
147 const (
148         MTU_PROTO_API_L3   MtuProto = 1
149         MTU_PROTO_API_IP4  MtuProto = 2
150         MTU_PROTO_API_IP6  MtuProto = 3
151         MTU_PROTO_API_MPLS MtuProto = 4
152         MTU_PROTO_API_N    MtuProto = 5
153 )
154
155 var (
156         MtuProto_name = map[uint32]string{
157                 1: "MTU_PROTO_API_L3",
158                 2: "MTU_PROTO_API_IP4",
159                 3: "MTU_PROTO_API_IP6",
160                 4: "MTU_PROTO_API_MPLS",
161                 5: "MTU_PROTO_API_N",
162         }
163         MtuProto_value = map[string]uint32{
164                 "MTU_PROTO_API_L3":   1,
165                 "MTU_PROTO_API_IP4":  2,
166                 "MTU_PROTO_API_IP6":  3,
167                 "MTU_PROTO_API_MPLS": 4,
168                 "MTU_PROTO_API_N":    5,
169         }
170 )
171
172 func (x MtuProto) String() string {
173         s, ok := MtuProto_name[uint32(x)]
174         if ok {
175                 return s
176         }
177         return "MtuProto(" + strconv.Itoa(int(x)) + ")"
178 }
179
180 // RdmaMode defines enum 'rdma_mode'.
181 type RdmaMode uint32
182
183 const (
184         RDMA_API_MODE_AUTO RdmaMode = 0
185         RDMA_API_MODE_IBV  RdmaMode = 1
186         RDMA_API_MODE_DV   RdmaMode = 2
187 )
188
189 var (
190         RdmaMode_name = map[uint32]string{
191                 0: "RDMA_API_MODE_AUTO",
192                 1: "RDMA_API_MODE_IBV",
193                 2: "RDMA_API_MODE_DV",
194         }
195         RdmaMode_value = map[string]uint32{
196                 "RDMA_API_MODE_AUTO": 0,
197                 "RDMA_API_MODE_IBV":  1,
198                 "RDMA_API_MODE_DV":   2,
199         }
200 )
201
202 func (x RdmaMode) String() string {
203         s, ok := RdmaMode_name[uint32(x)]
204         if ok {
205                 return s
206         }
207         return "RdmaMode(" + strconv.Itoa(int(x)) + ")"
208 }
209
210 // RxMode defines enum 'rx_mode'.
211 type RxMode uint32
212
213 const (
214         RX_MODE_API_UNKNOWN   RxMode = 0
215         RX_MODE_API_POLLING   RxMode = 1
216         RX_MODE_API_INTERRUPT RxMode = 2
217         RX_MODE_API_ADAPTIVE  RxMode = 3
218         RX_MODE_API_DEFAULT   RxMode = 4
219 )
220
221 var (
222         RxMode_name = map[uint32]string{
223                 0: "RX_MODE_API_UNKNOWN",
224                 1: "RX_MODE_API_POLLING",
225                 2: "RX_MODE_API_INTERRUPT",
226                 3: "RX_MODE_API_ADAPTIVE",
227                 4: "RX_MODE_API_DEFAULT",
228         }
229         RxMode_value = map[string]uint32{
230                 "RX_MODE_API_UNKNOWN":   0,
231                 "RX_MODE_API_POLLING":   1,
232                 "RX_MODE_API_INTERRUPT": 2,
233                 "RX_MODE_API_ADAPTIVE":  3,
234                 "RX_MODE_API_DEFAULT":   4,
235         }
236 )
237
238 func (x RxMode) String() string {
239         s, ok := RxMode_name[uint32(x)]
240         if ok {
241                 return s
242         }
243         return "RxMode(" + strconv.Itoa(int(x)) + ")"
244 }
245
246 // SubIfFlags defines enum 'sub_if_flags'.
247 type SubIfFlags uint32
248
249 const (
250         SUB_IF_API_FLAG_NO_TAGS           SubIfFlags = 1
251         SUB_IF_API_FLAG_ONE_TAG           SubIfFlags = 2
252         SUB_IF_API_FLAG_TWO_TAGS          SubIfFlags = 4
253         SUB_IF_API_FLAG_DOT1AD            SubIfFlags = 8
254         SUB_IF_API_FLAG_EXACT_MATCH       SubIfFlags = 16
255         SUB_IF_API_FLAG_DEFAULT           SubIfFlags = 32
256         SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
257         SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
258         SUB_IF_API_FLAG_MASK_VNET         SubIfFlags = 254
259         SUB_IF_API_FLAG_DOT1AH            SubIfFlags = 256
260 )
261
262 var (
263         SubIfFlags_name = map[uint32]string{
264                 1:   "SUB_IF_API_FLAG_NO_TAGS",
265                 2:   "SUB_IF_API_FLAG_ONE_TAG",
266                 4:   "SUB_IF_API_FLAG_TWO_TAGS",
267                 8:   "SUB_IF_API_FLAG_DOT1AD",
268                 16:  "SUB_IF_API_FLAG_EXACT_MATCH",
269                 32:  "SUB_IF_API_FLAG_DEFAULT",
270                 64:  "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
271                 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
272                 254: "SUB_IF_API_FLAG_MASK_VNET",
273                 256: "SUB_IF_API_FLAG_DOT1AH",
274         }
275         SubIfFlags_value = map[string]uint32{
276                 "SUB_IF_API_FLAG_NO_TAGS":           1,
277                 "SUB_IF_API_FLAG_ONE_TAG":           2,
278                 "SUB_IF_API_FLAG_TWO_TAGS":          4,
279                 "SUB_IF_API_FLAG_DOT1AD":            8,
280                 "SUB_IF_API_FLAG_EXACT_MATCH":       16,
281                 "SUB_IF_API_FLAG_DEFAULT":           32,
282                 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
283                 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
284                 "SUB_IF_API_FLAG_MASK_VNET":         254,
285                 "SUB_IF_API_FLAG_DOT1AH":            256,
286         }
287 )
288
289 func (x SubIfFlags) String() string {
290         s, ok := SubIfFlags_name[uint32(x)]
291         if ok {
292                 return s
293         }
294         str := func(n uint32) string {
295                 s, ok := SubIfFlags_name[uint32(n)]
296                 if ok {
297                         return s
298                 }
299                 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
300         }
301         for i := uint32(0); i <= 32; i++ {
302                 val := uint32(x)
303                 if val&(1<<i) != 0 {
304                         if s != "" {
305                                 s += "|"
306                         }
307                         s += str(1 << i)
308                 }
309         }
310         if s == "" {
311                 return str(uint32(x))
312         }
313         return s
314 }
315
316 // InterfaceIndex defines alias 'interface_index'.
317 type InterfaceIndex uint32
318
319 // RdmaCreate defines message 'rdma_create'.
320 type RdmaCreate struct {
321         HostIf  string   `binapi:"string[64],name=host_if" json:"host_if,omitempty"`
322         Name    string   `binapi:"string[64],name=name" json:"name,omitempty"`
323         RxqNum  uint16   `binapi:"u16,name=rxq_num,default=1" json:"rxq_num,omitempty"`
324         RxqSize uint16   `binapi:"u16,name=rxq_size,default=1024" json:"rxq_size,omitempty"`
325         TxqSize uint16   `binapi:"u16,name=txq_size,default=1024" json:"txq_size,omitempty"`
326         Mode    RdmaMode `binapi:"rdma_mode,name=mode,default=0" json:"mode,omitempty"`
327 }
328
329 func (m *RdmaCreate) Reset()               { *m = RdmaCreate{} }
330 func (*RdmaCreate) GetMessageName() string { return "rdma_create" }
331 func (*RdmaCreate) GetCrcString() string   { return "076fe418" }
332 func (*RdmaCreate) GetMessageType() api.MessageType {
333         return api.RequestMessage
334 }
335
336 func (m *RdmaCreate) Size() (size int) {
337         if m == nil {
338                 return 0
339         }
340         size += 64 // m.HostIf
341         size += 64 // m.Name
342         size += 2  // m.RxqNum
343         size += 2  // m.RxqSize
344         size += 2  // m.TxqSize
345         size += 4  // m.Mode
346         return size
347 }
348 func (m *RdmaCreate) Marshal(b []byte) ([]byte, error) {
349         if b == nil {
350                 b = make([]byte, m.Size())
351         }
352         buf := codec.NewBuffer(b)
353         buf.EncodeString(m.HostIf, 64)
354         buf.EncodeString(m.Name, 64)
355         buf.EncodeUint16(m.RxqNum)
356         buf.EncodeUint16(m.RxqSize)
357         buf.EncodeUint16(m.TxqSize)
358         buf.EncodeUint32(uint32(m.Mode))
359         return buf.Bytes(), nil
360 }
361 func (m *RdmaCreate) Unmarshal(b []byte) error {
362         buf := codec.NewBuffer(b)
363         m.HostIf = buf.DecodeString(64)
364         m.Name = buf.DecodeString(64)
365         m.RxqNum = buf.DecodeUint16()
366         m.RxqSize = buf.DecodeUint16()
367         m.TxqSize = buf.DecodeUint16()
368         m.Mode = RdmaMode(buf.DecodeUint32())
369         return nil
370 }
371
372 // RdmaCreateReply defines message 'rdma_create_reply'.
373 type RdmaCreateReply struct {
374         Retval    int32          `binapi:"i32,name=retval" json:"retval,omitempty"`
375         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
376 }
377
378 func (m *RdmaCreateReply) Reset()               { *m = RdmaCreateReply{} }
379 func (*RdmaCreateReply) GetMessageName() string { return "rdma_create_reply" }
380 func (*RdmaCreateReply) GetCrcString() string   { return "5383d31f" }
381 func (*RdmaCreateReply) GetMessageType() api.MessageType {
382         return api.ReplyMessage
383 }
384
385 func (m *RdmaCreateReply) Size() (size int) {
386         if m == nil {
387                 return 0
388         }
389         size += 4 // m.Retval
390         size += 4 // m.SwIfIndex
391         return size
392 }
393 func (m *RdmaCreateReply) Marshal(b []byte) ([]byte, error) {
394         if b == nil {
395                 b = make([]byte, m.Size())
396         }
397         buf := codec.NewBuffer(b)
398         buf.EncodeInt32(m.Retval)
399         buf.EncodeUint32(uint32(m.SwIfIndex))
400         return buf.Bytes(), nil
401 }
402 func (m *RdmaCreateReply) Unmarshal(b []byte) error {
403         buf := codec.NewBuffer(b)
404         m.Retval = buf.DecodeInt32()
405         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
406         return nil
407 }
408
409 // RdmaDelete defines message 'rdma_delete'.
410 type RdmaDelete struct {
411         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
412 }
413
414 func (m *RdmaDelete) Reset()               { *m = RdmaDelete{} }
415 func (*RdmaDelete) GetMessageName() string { return "rdma_delete" }
416 func (*RdmaDelete) GetCrcString() string   { return "f9e6675e" }
417 func (*RdmaDelete) GetMessageType() api.MessageType {
418         return api.RequestMessage
419 }
420
421 func (m *RdmaDelete) Size() (size int) {
422         if m == nil {
423                 return 0
424         }
425         size += 4 // m.SwIfIndex
426         return size
427 }
428 func (m *RdmaDelete) Marshal(b []byte) ([]byte, error) {
429         if b == nil {
430                 b = make([]byte, m.Size())
431         }
432         buf := codec.NewBuffer(b)
433         buf.EncodeUint32(uint32(m.SwIfIndex))
434         return buf.Bytes(), nil
435 }
436 func (m *RdmaDelete) Unmarshal(b []byte) error {
437         buf := codec.NewBuffer(b)
438         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
439         return nil
440 }
441
442 // RdmaDeleteReply defines message 'rdma_delete_reply'.
443 type RdmaDeleteReply struct {
444         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
445 }
446
447 func (m *RdmaDeleteReply) Reset()               { *m = RdmaDeleteReply{} }
448 func (*RdmaDeleteReply) GetMessageName() string { return "rdma_delete_reply" }
449 func (*RdmaDeleteReply) GetCrcString() string   { return "e8d4e804" }
450 func (*RdmaDeleteReply) GetMessageType() api.MessageType {
451         return api.ReplyMessage
452 }
453
454 func (m *RdmaDeleteReply) Size() (size int) {
455         if m == nil {
456                 return 0
457         }
458         size += 4 // m.Retval
459         return size
460 }
461 func (m *RdmaDeleteReply) Marshal(b []byte) ([]byte, error) {
462         if b == nil {
463                 b = make([]byte, m.Size())
464         }
465         buf := codec.NewBuffer(b)
466         buf.EncodeInt32(m.Retval)
467         return buf.Bytes(), nil
468 }
469 func (m *RdmaDeleteReply) Unmarshal(b []byte) error {
470         buf := codec.NewBuffer(b)
471         m.Retval = buf.DecodeInt32()
472         return nil
473 }
474
475 func init() { file_rdma_binapi_init() }
476 func file_rdma_binapi_init() {
477         api.RegisterMessage((*RdmaCreate)(nil), "rdma_create_076fe418")
478         api.RegisterMessage((*RdmaCreateReply)(nil), "rdma_create_reply_5383d31f")
479         api.RegisterMessage((*RdmaDelete)(nil), "rdma_delete_f9e6675e")
480         api.RegisterMessage((*RdmaDeleteReply)(nil), "rdma_delete_reply_e8d4e804")
481 }
482
483 // Messages returns list of all messages in this module.
484 func AllMessages() []api.Message {
485         return []api.Message{
486                 (*RdmaCreate)(nil),
487                 (*RdmaCreateReply)(nil),
488                 (*RdmaDelete)(nil),
489                 (*RdmaDeleteReply)(nil),
490         }
491 }