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