binapigen: fix union size
[govpp.git] / binapi / mfib_types / mfib_types.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.05-release
5 // source: /usr/share/vpp/api/core/mfib_types.api.json
6
7 // Package mfib_types contains generated bindings for API file mfib_types.api.
8 //
9 // Contents:
10 //   1 enum
11 //   1 struct
12 //
13 package mfib_types
14
15 import (
16         "strconv"
17
18         api "git.fd.io/govpp.git/api"
19         fib_types "git.fd.io/govpp.git/binapi/fib_types"
20         _ "git.fd.io/govpp.git/binapi/ip_types"
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 // MfibItfFlags defines enum 'mfib_itf_flags'.
30 type MfibItfFlags uint32
31
32 const (
33         MFIB_API_ITF_FLAG_NONE           MfibItfFlags = 0
34         MFIB_API_ITF_FLAG_NEGATE_SIGNAL  MfibItfFlags = 1
35         MFIB_API_ITF_FLAG_ACCEPT         MfibItfFlags = 2
36         MFIB_API_ITF_FLAG_FORWARD        MfibItfFlags = 4
37         MFIB_API_ITF_FLAG_SIGNAL_PRESENT MfibItfFlags = 8
38         MFIB_API_ITF_FLAG_DONT_PRESERVE  MfibItfFlags = 16
39 )
40
41 var (
42         MfibItfFlags_name = map[uint32]string{
43                 0:  "MFIB_API_ITF_FLAG_NONE",
44                 1:  "MFIB_API_ITF_FLAG_NEGATE_SIGNAL",
45                 2:  "MFIB_API_ITF_FLAG_ACCEPT",
46                 4:  "MFIB_API_ITF_FLAG_FORWARD",
47                 8:  "MFIB_API_ITF_FLAG_SIGNAL_PRESENT",
48                 16: "MFIB_API_ITF_FLAG_DONT_PRESERVE",
49         }
50         MfibItfFlags_value = map[string]uint32{
51                 "MFIB_API_ITF_FLAG_NONE":           0,
52                 "MFIB_API_ITF_FLAG_NEGATE_SIGNAL":  1,
53                 "MFIB_API_ITF_FLAG_ACCEPT":         2,
54                 "MFIB_API_ITF_FLAG_FORWARD":        4,
55                 "MFIB_API_ITF_FLAG_SIGNAL_PRESENT": 8,
56                 "MFIB_API_ITF_FLAG_DONT_PRESERVE":  16,
57         }
58 )
59
60 func (x MfibItfFlags) String() string {
61         s, ok := MfibItfFlags_name[uint32(x)]
62         if ok {
63                 return s
64         }
65         str := func(n uint32) string {
66                 s, ok := MfibItfFlags_name[uint32(n)]
67                 if ok {
68                         return s
69                 }
70                 return "MfibItfFlags(" + strconv.Itoa(int(n)) + ")"
71         }
72         for i := uint32(0); i <= 32; i++ {
73                 val := uint32(x)
74                 if val&(1<<i) != 0 {
75                         if s != "" {
76                                 s += "|"
77                         }
78                         s += str(1 << i)
79                 }
80         }
81         if s == "" {
82                 return str(uint32(x))
83         }
84         return s
85 }
86
87 // MfibPath defines type 'mfib_path'.
88 type MfibPath struct {
89         ItfFlags MfibItfFlags      `binapi:"mfib_itf_flags,name=itf_flags" json:"itf_flags,omitempty"`
90         Path     fib_types.FibPath `binapi:"fib_path,name=path" json:"path,omitempty"`
91 }