Update generated binapi to v22.02 & makefile changes
[govpp.git] / internal / testbinapi / binapi2001 / flowprobe / flowprobe.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/flowprobe.api.json
6
7 // Package flowprobe contains generated bindings for API file flowprobe.api.
8 //
9 // Contents:
10 //   1 alias
11 //   8 enums
12 //   4 messages
13 //
14 package flowprobe
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    = "flowprobe"
31         APIVersion = "1.0.0"
32         VersionCrc = 0xbb4dfc0d
33 )
34
35 // FlowprobeRecordFlags defines enum 'flowprobe_record_flags'.
36 type FlowprobeRecordFlags uint8
37
38 const (
39         FLOWPROBE_RECORD_FLAG_L2 FlowprobeRecordFlags = 1
40         FLOWPROBE_RECORD_FLAG_L3 FlowprobeRecordFlags = 2
41         FLOWPROBE_RECORD_FLAG_L4 FlowprobeRecordFlags = 4
42 )
43
44 var (
45         FlowprobeRecordFlags_name = map[uint8]string{
46                 1: "FLOWPROBE_RECORD_FLAG_L2",
47                 2: "FLOWPROBE_RECORD_FLAG_L3",
48                 4: "FLOWPROBE_RECORD_FLAG_L4",
49         }
50         FlowprobeRecordFlags_value = map[string]uint8{
51                 "FLOWPROBE_RECORD_FLAG_L2": 1,
52                 "FLOWPROBE_RECORD_FLAG_L3": 2,
53                 "FLOWPROBE_RECORD_FLAG_L4": 4,
54         }
55 )
56
57 func (x FlowprobeRecordFlags) String() string {
58         s, ok := FlowprobeRecordFlags_name[uint8(x)]
59         if ok {
60                 return s
61         }
62         str := func(n uint8) string {
63                 s, ok := FlowprobeRecordFlags_name[uint8(n)]
64                 if ok {
65                         return s
66                 }
67                 return "FlowprobeRecordFlags(" + strconv.Itoa(int(n)) + ")"
68         }
69         for i := uint8(0); i <= 8; i++ {
70                 val := uint8(x)
71                 if val&(1<<i) != 0 {
72                         if s != "" {
73                                 s += "|"
74                         }
75                         s += str(1 << i)
76                 }
77         }
78         if s == "" {
79                 return str(uint8(x))
80         }
81         return s
82 }
83
84 // FlowprobeWhichFlags defines enum 'flowprobe_which_flags'.
85 type FlowprobeWhichFlags uint8
86
87 const (
88         FLOWPROBE_WHICH_FLAG_IP4 FlowprobeWhichFlags = 1
89         FLOWPROBE_WHICH_FLAG_L2  FlowprobeWhichFlags = 2
90         FLOWPROBE_WHICH_FLAG_IP6 FlowprobeWhichFlags = 4
91 )
92
93 var (
94         FlowprobeWhichFlags_name = map[uint8]string{
95                 1: "FLOWPROBE_WHICH_FLAG_IP4",
96                 2: "FLOWPROBE_WHICH_FLAG_L2",
97                 4: "FLOWPROBE_WHICH_FLAG_IP6",
98         }
99         FlowprobeWhichFlags_value = map[string]uint8{
100                 "FLOWPROBE_WHICH_FLAG_IP4": 1,
101                 "FLOWPROBE_WHICH_FLAG_L2":  2,
102                 "FLOWPROBE_WHICH_FLAG_IP6": 4,
103         }
104 )
105
106 func (x FlowprobeWhichFlags) String() string {
107         s, ok := FlowprobeWhichFlags_name[uint8(x)]
108         if ok {
109                 return s
110         }
111         str := func(n uint8) string {
112                 s, ok := FlowprobeWhichFlags_name[uint8(n)]
113                 if ok {
114                         return s
115                 }
116                 return "FlowprobeWhichFlags(" + strconv.Itoa(int(n)) + ")"
117         }
118         for i := uint8(0); i <= 8; i++ {
119                 val := uint8(x)
120                 if val&(1<<i) != 0 {
121                         if s != "" {
122                                 s += "|"
123                         }
124                         s += str(1 << i)
125                 }
126         }
127         if s == "" {
128                 return str(uint8(x))
129         }
130         return s
131 }
132
133 // IfStatusFlags defines enum 'if_status_flags'.
134 type IfStatusFlags uint32
135
136 const (
137         IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
138         IF_STATUS_API_FLAG_LINK_UP  IfStatusFlags = 2
139 )
140
141 var (
142         IfStatusFlags_name = map[uint32]string{
143                 1: "IF_STATUS_API_FLAG_ADMIN_UP",
144                 2: "IF_STATUS_API_FLAG_LINK_UP",
145         }
146         IfStatusFlags_value = map[string]uint32{
147                 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
148                 "IF_STATUS_API_FLAG_LINK_UP":  2,
149         }
150 )
151
152 func (x IfStatusFlags) String() string {
153         s, ok := IfStatusFlags_name[uint32(x)]
154         if ok {
155                 return s
156         }
157         str := func(n uint32) string {
158                 s, ok := IfStatusFlags_name[uint32(n)]
159                 if ok {
160                         return s
161                 }
162                 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
163         }
164         for i := uint32(0); i <= 32; i++ {
165                 val := uint32(x)
166                 if val&(1<<i) != 0 {
167                         if s != "" {
168                                 s += "|"
169                         }
170                         s += str(1 << i)
171                 }
172         }
173         if s == "" {
174                 return str(uint32(x))
175         }
176         return s
177 }
178
179 // IfType defines enum 'if_type'.
180 type IfType uint32
181
182 const (
183         IF_API_TYPE_HARDWARE IfType = 1
184         IF_API_TYPE_SUB      IfType = 2
185         IF_API_TYPE_P2P      IfType = 3
186         IF_API_TYPE_PIPE     IfType = 4
187 )
188
189 var (
190         IfType_name = map[uint32]string{
191                 1: "IF_API_TYPE_HARDWARE",
192                 2: "IF_API_TYPE_SUB",
193                 3: "IF_API_TYPE_P2P",
194                 4: "IF_API_TYPE_PIPE",
195         }
196         IfType_value = map[string]uint32{
197                 "IF_API_TYPE_HARDWARE": 1,
198                 "IF_API_TYPE_SUB":      2,
199                 "IF_API_TYPE_P2P":      3,
200                 "IF_API_TYPE_PIPE":     4,
201         }
202 )
203
204 func (x IfType) String() string {
205         s, ok := IfType_name[uint32(x)]
206         if ok {
207                 return s
208         }
209         return "IfType(" + strconv.Itoa(int(x)) + ")"
210 }
211
212 // LinkDuplex defines enum 'link_duplex'.
213 type LinkDuplex uint32
214
215 const (
216         LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
217         LINK_DUPLEX_API_HALF    LinkDuplex = 1
218         LINK_DUPLEX_API_FULL    LinkDuplex = 2
219 )
220
221 var (
222         LinkDuplex_name = map[uint32]string{
223                 0: "LINK_DUPLEX_API_UNKNOWN",
224                 1: "LINK_DUPLEX_API_HALF",
225                 2: "LINK_DUPLEX_API_FULL",
226         }
227         LinkDuplex_value = map[string]uint32{
228                 "LINK_DUPLEX_API_UNKNOWN": 0,
229                 "LINK_DUPLEX_API_HALF":    1,
230                 "LINK_DUPLEX_API_FULL":    2,
231         }
232 )
233
234 func (x LinkDuplex) String() string {
235         s, ok := LinkDuplex_name[uint32(x)]
236         if ok {
237                 return s
238         }
239         return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
240 }
241
242 // MtuProto defines enum 'mtu_proto'.
243 type MtuProto uint32
244
245 const (
246         MTU_PROTO_API_L3   MtuProto = 1
247         MTU_PROTO_API_IP4  MtuProto = 2
248         MTU_PROTO_API_IP6  MtuProto = 3
249         MTU_PROTO_API_MPLS MtuProto = 4
250         MTU_PROTO_API_N    MtuProto = 5
251 )
252
253 var (
254         MtuProto_name = map[uint32]string{
255                 1: "MTU_PROTO_API_L3",
256                 2: "MTU_PROTO_API_IP4",
257                 3: "MTU_PROTO_API_IP6",
258                 4: "MTU_PROTO_API_MPLS",
259                 5: "MTU_PROTO_API_N",
260         }
261         MtuProto_value = map[string]uint32{
262                 "MTU_PROTO_API_L3":   1,
263                 "MTU_PROTO_API_IP4":  2,
264                 "MTU_PROTO_API_IP6":  3,
265                 "MTU_PROTO_API_MPLS": 4,
266                 "MTU_PROTO_API_N":    5,
267         }
268 )
269
270 func (x MtuProto) String() string {
271         s, ok := MtuProto_name[uint32(x)]
272         if ok {
273                 return s
274         }
275         return "MtuProto(" + strconv.Itoa(int(x)) + ")"
276 }
277
278 // RxMode defines enum 'rx_mode'.
279 type RxMode uint32
280
281 const (
282         RX_MODE_API_UNKNOWN   RxMode = 0
283         RX_MODE_API_POLLING   RxMode = 1
284         RX_MODE_API_INTERRUPT RxMode = 2
285         RX_MODE_API_ADAPTIVE  RxMode = 3
286         RX_MODE_API_DEFAULT   RxMode = 4
287 )
288
289 var (
290         RxMode_name = map[uint32]string{
291                 0: "RX_MODE_API_UNKNOWN",
292                 1: "RX_MODE_API_POLLING",
293                 2: "RX_MODE_API_INTERRUPT",
294                 3: "RX_MODE_API_ADAPTIVE",
295                 4: "RX_MODE_API_DEFAULT",
296         }
297         RxMode_value = map[string]uint32{
298                 "RX_MODE_API_UNKNOWN":   0,
299                 "RX_MODE_API_POLLING":   1,
300                 "RX_MODE_API_INTERRUPT": 2,
301                 "RX_MODE_API_ADAPTIVE":  3,
302                 "RX_MODE_API_DEFAULT":   4,
303         }
304 )
305
306 func (x RxMode) String() string {
307         s, ok := RxMode_name[uint32(x)]
308         if ok {
309                 return s
310         }
311         return "RxMode(" + strconv.Itoa(int(x)) + ")"
312 }
313
314 // SubIfFlags defines enum 'sub_if_flags'.
315 type SubIfFlags uint32
316
317 const (
318         SUB_IF_API_FLAG_NO_TAGS           SubIfFlags = 1
319         SUB_IF_API_FLAG_ONE_TAG           SubIfFlags = 2
320         SUB_IF_API_FLAG_TWO_TAGS          SubIfFlags = 4
321         SUB_IF_API_FLAG_DOT1AD            SubIfFlags = 8
322         SUB_IF_API_FLAG_EXACT_MATCH       SubIfFlags = 16
323         SUB_IF_API_FLAG_DEFAULT           SubIfFlags = 32
324         SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
325         SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
326         SUB_IF_API_FLAG_MASK_VNET         SubIfFlags = 254
327         SUB_IF_API_FLAG_DOT1AH            SubIfFlags = 256
328 )
329
330 var (
331         SubIfFlags_name = map[uint32]string{
332                 1:   "SUB_IF_API_FLAG_NO_TAGS",
333                 2:   "SUB_IF_API_FLAG_ONE_TAG",
334                 4:   "SUB_IF_API_FLAG_TWO_TAGS",
335                 8:   "SUB_IF_API_FLAG_DOT1AD",
336                 16:  "SUB_IF_API_FLAG_EXACT_MATCH",
337                 32:  "SUB_IF_API_FLAG_DEFAULT",
338                 64:  "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
339                 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
340                 254: "SUB_IF_API_FLAG_MASK_VNET",
341                 256: "SUB_IF_API_FLAG_DOT1AH",
342         }
343         SubIfFlags_value = map[string]uint32{
344                 "SUB_IF_API_FLAG_NO_TAGS":           1,
345                 "SUB_IF_API_FLAG_ONE_TAG":           2,
346                 "SUB_IF_API_FLAG_TWO_TAGS":          4,
347                 "SUB_IF_API_FLAG_DOT1AD":            8,
348                 "SUB_IF_API_FLAG_EXACT_MATCH":       16,
349                 "SUB_IF_API_FLAG_DEFAULT":           32,
350                 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
351                 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
352                 "SUB_IF_API_FLAG_MASK_VNET":         254,
353                 "SUB_IF_API_FLAG_DOT1AH":            256,
354         }
355 )
356
357 func (x SubIfFlags) String() string {
358         s, ok := SubIfFlags_name[uint32(x)]
359         if ok {
360                 return s
361         }
362         str := func(n uint32) string {
363                 s, ok := SubIfFlags_name[uint32(n)]
364                 if ok {
365                         return s
366                 }
367                 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
368         }
369         for i := uint32(0); i <= 32; i++ {
370                 val := uint32(x)
371                 if val&(1<<i) != 0 {
372                         if s != "" {
373                                 s += "|"
374                         }
375                         s += str(1 << i)
376                 }
377         }
378         if s == "" {
379                 return str(uint32(x))
380         }
381         return s
382 }
383
384 // InterfaceIndex defines alias 'interface_index'.
385 type InterfaceIndex uint32
386
387 // FlowprobeParams defines message 'flowprobe_params'.
388 type FlowprobeParams struct {
389         RecordFlags  FlowprobeRecordFlags `binapi:"flowprobe_record_flags,name=record_flags" json:"record_flags,omitempty"`
390         ActiveTimer  uint32               `binapi:"u32,name=active_timer" json:"active_timer,omitempty"`
391         PassiveTimer uint32               `binapi:"u32,name=passive_timer" json:"passive_timer,omitempty"`
392 }
393
394 func (m *FlowprobeParams) Reset()               { *m = FlowprobeParams{} }
395 func (*FlowprobeParams) GetMessageName() string { return "flowprobe_params" }
396 func (*FlowprobeParams) GetCrcString() string   { return "baa46c09" }
397 func (*FlowprobeParams) GetMessageType() api.MessageType {
398         return api.RequestMessage
399 }
400
401 func (m *FlowprobeParams) Size() (size int) {
402         if m == nil {
403                 return 0
404         }
405         size += 1 // m.RecordFlags
406         size += 4 // m.ActiveTimer
407         size += 4 // m.PassiveTimer
408         return size
409 }
410 func (m *FlowprobeParams) Marshal(b []byte) ([]byte, error) {
411         if b == nil {
412                 b = make([]byte, m.Size())
413         }
414         buf := codec.NewBuffer(b)
415         buf.EncodeUint8(uint8(m.RecordFlags))
416         buf.EncodeUint32(m.ActiveTimer)
417         buf.EncodeUint32(m.PassiveTimer)
418         return buf.Bytes(), nil
419 }
420 func (m *FlowprobeParams) Unmarshal(b []byte) error {
421         buf := codec.NewBuffer(b)
422         m.RecordFlags = FlowprobeRecordFlags(buf.DecodeUint8())
423         m.ActiveTimer = buf.DecodeUint32()
424         m.PassiveTimer = buf.DecodeUint32()
425         return nil
426 }
427
428 // FlowprobeParamsReply defines message 'flowprobe_params_reply'.
429 type FlowprobeParamsReply struct {
430         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
431 }
432
433 func (m *FlowprobeParamsReply) Reset()               { *m = FlowprobeParamsReply{} }
434 func (*FlowprobeParamsReply) GetMessageName() string { return "flowprobe_params_reply" }
435 func (*FlowprobeParamsReply) GetCrcString() string   { return "e8d4e804" }
436 func (*FlowprobeParamsReply) GetMessageType() api.MessageType {
437         return api.ReplyMessage
438 }
439
440 func (m *FlowprobeParamsReply) Size() (size int) {
441         if m == nil {
442                 return 0
443         }
444         size += 4 // m.Retval
445         return size
446 }
447 func (m *FlowprobeParamsReply) Marshal(b []byte) ([]byte, error) {
448         if b == nil {
449                 b = make([]byte, m.Size())
450         }
451         buf := codec.NewBuffer(b)
452         buf.EncodeInt32(m.Retval)
453         return buf.Bytes(), nil
454 }
455 func (m *FlowprobeParamsReply) Unmarshal(b []byte) error {
456         buf := codec.NewBuffer(b)
457         m.Retval = buf.DecodeInt32()
458         return nil
459 }
460
461 // FlowprobeTxInterfaceAddDel defines message 'flowprobe_tx_interface_add_del'.
462 type FlowprobeTxInterfaceAddDel struct {
463         IsAdd     bool                `binapi:"bool,name=is_add" json:"is_add,omitempty"`
464         Which     FlowprobeWhichFlags `binapi:"flowprobe_which_flags,name=which" json:"which,omitempty"`
465         SwIfIndex InterfaceIndex      `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
466 }
467
468 func (m *FlowprobeTxInterfaceAddDel) Reset()               { *m = FlowprobeTxInterfaceAddDel{} }
469 func (*FlowprobeTxInterfaceAddDel) GetMessageName() string { return "flowprobe_tx_interface_add_del" }
470 func (*FlowprobeTxInterfaceAddDel) GetCrcString() string   { return "b782c976" }
471 func (*FlowprobeTxInterfaceAddDel) GetMessageType() api.MessageType {
472         return api.RequestMessage
473 }
474
475 func (m *FlowprobeTxInterfaceAddDel) Size() (size int) {
476         if m == nil {
477                 return 0
478         }
479         size += 1 // m.IsAdd
480         size += 1 // m.Which
481         size += 4 // m.SwIfIndex
482         return size
483 }
484 func (m *FlowprobeTxInterfaceAddDel) Marshal(b []byte) ([]byte, error) {
485         if b == nil {
486                 b = make([]byte, m.Size())
487         }
488         buf := codec.NewBuffer(b)
489         buf.EncodeBool(m.IsAdd)
490         buf.EncodeUint8(uint8(m.Which))
491         buf.EncodeUint32(uint32(m.SwIfIndex))
492         return buf.Bytes(), nil
493 }
494 func (m *FlowprobeTxInterfaceAddDel) Unmarshal(b []byte) error {
495         buf := codec.NewBuffer(b)
496         m.IsAdd = buf.DecodeBool()
497         m.Which = FlowprobeWhichFlags(buf.DecodeUint8())
498         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
499         return nil
500 }
501
502 // FlowprobeTxInterfaceAddDelReply defines message 'flowprobe_tx_interface_add_del_reply'.
503 type FlowprobeTxInterfaceAddDelReply struct {
504         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
505 }
506
507 func (m *FlowprobeTxInterfaceAddDelReply) Reset() { *m = FlowprobeTxInterfaceAddDelReply{} }
508 func (*FlowprobeTxInterfaceAddDelReply) GetMessageName() string {
509         return "flowprobe_tx_interface_add_del_reply"
510 }
511 func (*FlowprobeTxInterfaceAddDelReply) GetCrcString() string { return "e8d4e804" }
512 func (*FlowprobeTxInterfaceAddDelReply) GetMessageType() api.MessageType {
513         return api.ReplyMessage
514 }
515
516 func (m *FlowprobeTxInterfaceAddDelReply) Size() (size int) {
517         if m == nil {
518                 return 0
519         }
520         size += 4 // m.Retval
521         return size
522 }
523 func (m *FlowprobeTxInterfaceAddDelReply) Marshal(b []byte) ([]byte, error) {
524         if b == nil {
525                 b = make([]byte, m.Size())
526         }
527         buf := codec.NewBuffer(b)
528         buf.EncodeInt32(m.Retval)
529         return buf.Bytes(), nil
530 }
531 func (m *FlowprobeTxInterfaceAddDelReply) Unmarshal(b []byte) error {
532         buf := codec.NewBuffer(b)
533         m.Retval = buf.DecodeInt32()
534         return nil
535 }
536
537 func init() { file_flowprobe_binapi_init() }
538 func file_flowprobe_binapi_init() {
539         api.RegisterMessage((*FlowprobeParams)(nil), "flowprobe_params_baa46c09")
540         api.RegisterMessage((*FlowprobeParamsReply)(nil), "flowprobe_params_reply_e8d4e804")
541         api.RegisterMessage((*FlowprobeTxInterfaceAddDel)(nil), "flowprobe_tx_interface_add_del_b782c976")
542         api.RegisterMessage((*FlowprobeTxInterfaceAddDelReply)(nil), "flowprobe_tx_interface_add_del_reply_e8d4e804")
543 }
544
545 // Messages returns list of all messages in this module.
546 func AllMessages() []api.Message {
547         return []api.Message{
548                 (*FlowprobeParams)(nil),
549                 (*FlowprobeParamsReply)(nil),
550                 (*FlowprobeTxInterfaceAddDel)(nil),
551                 (*FlowprobeTxInterfaceAddDelReply)(nil),
552         }
553 }