Introduce Stream - experimental API for low-level access to VPP API
[govpp.git] / examples / binapi / fib_types / fib_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/fib_types.api.json
6
7 /*
8 Package fib_types contains generated code for VPP API file fib_types.api (2.0.0).
9
10 It consists of:
11           5 aliases
12           7 enums
13           9 types
14           1 union
15 */
16 package fib_types
17
18 import (
19         "bytes"
20         "context"
21         "encoding/binary"
22         "io"
23         "math"
24         "strconv"
25
26         api "git.fd.io/govpp.git/api"
27         codec "git.fd.io/govpp.git/codec"
28         struc "github.com/lunixbochs/struc"
29
30         ip_types "git.fd.io/govpp.git/examples/binapi/ip_types"
31 )
32
33 // This is a compile-time assertion to ensure that this generated file
34 // is compatible with the GoVPP api package it is being compiled against.
35 // A compilation error at this line likely means your copy of the
36 // GoVPP api package needs to be updated.
37 const _ = api.GoVppAPIPackageIsVersion2 // please upgrade the GoVPP api package
38
39 const (
40         // ModuleName is the name of this module.
41         ModuleName = "fib_types"
42         // APIVersion is the API version of this module.
43         APIVersion = "2.0.0"
44         // VersionCrc is the CRC of this module.
45         VersionCrc = 0xd6a5938
46 )
47
48 type AddressFamily = ip_types.AddressFamily
49
50 // FibPathFlags represents VPP binary API enum 'fib_path_flags'.
51 type FibPathFlags uint32
52
53 const (
54         FIB_API_PATH_FLAG_NONE                 FibPathFlags = 0
55         FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED FibPathFlags = 1
56         FIB_API_PATH_FLAG_RESOLVE_VIA_HOST     FibPathFlags = 2
57         FIB_API_PATH_FLAG_POP_PW_CW            FibPathFlags = 4
58 )
59
60 var (
61         FibPathFlags_name = map[uint32]string{
62                 0: "FIB_API_PATH_FLAG_NONE",
63                 1: "FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED",
64                 2: "FIB_API_PATH_FLAG_RESOLVE_VIA_HOST",
65                 4: "FIB_API_PATH_FLAG_POP_PW_CW",
66         }
67         FibPathFlags_value = map[string]uint32{
68                 "FIB_API_PATH_FLAG_NONE":                 0,
69                 "FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED": 1,
70                 "FIB_API_PATH_FLAG_RESOLVE_VIA_HOST":     2,
71                 "FIB_API_PATH_FLAG_POP_PW_CW":            4,
72         }
73 )
74
75 func (x FibPathFlags) String() string {
76         s, ok := FibPathFlags_name[uint32(x)]
77         if ok {
78                 return s
79         }
80         return "FibPathFlags(" + strconv.Itoa(int(x)) + ")"
81 }
82
83 // FibPathNhProto represents VPP binary API enum 'fib_path_nh_proto'.
84 type FibPathNhProto uint32
85
86 const (
87         FIB_API_PATH_NH_PROTO_IP4      FibPathNhProto = 0
88         FIB_API_PATH_NH_PROTO_IP6      FibPathNhProto = 1
89         FIB_API_PATH_NH_PROTO_MPLS     FibPathNhProto = 2
90         FIB_API_PATH_NH_PROTO_ETHERNET FibPathNhProto = 3
91         FIB_API_PATH_NH_PROTO_BIER     FibPathNhProto = 4
92 )
93
94 var (
95         FibPathNhProto_name = map[uint32]string{
96                 0: "FIB_API_PATH_NH_PROTO_IP4",
97                 1: "FIB_API_PATH_NH_PROTO_IP6",
98                 2: "FIB_API_PATH_NH_PROTO_MPLS",
99                 3: "FIB_API_PATH_NH_PROTO_ETHERNET",
100                 4: "FIB_API_PATH_NH_PROTO_BIER",
101         }
102         FibPathNhProto_value = map[string]uint32{
103                 "FIB_API_PATH_NH_PROTO_IP4":      0,
104                 "FIB_API_PATH_NH_PROTO_IP6":      1,
105                 "FIB_API_PATH_NH_PROTO_MPLS":     2,
106                 "FIB_API_PATH_NH_PROTO_ETHERNET": 3,
107                 "FIB_API_PATH_NH_PROTO_BIER":     4,
108         }
109 )
110
111 func (x FibPathNhProto) String() string {
112         s, ok := FibPathNhProto_name[uint32(x)]
113         if ok {
114                 return s
115         }
116         return "FibPathNhProto(" + strconv.Itoa(int(x)) + ")"
117 }
118
119 // FibPathType represents VPP binary API enum 'fib_path_type'.
120 type FibPathType uint32
121
122 const (
123         FIB_API_PATH_TYPE_NORMAL        FibPathType = 0
124         FIB_API_PATH_TYPE_LOCAL         FibPathType = 1
125         FIB_API_PATH_TYPE_DROP          FibPathType = 2
126         FIB_API_PATH_TYPE_UDP_ENCAP     FibPathType = 3
127         FIB_API_PATH_TYPE_BIER_IMP      FibPathType = 4
128         FIB_API_PATH_TYPE_ICMP_UNREACH  FibPathType = 5
129         FIB_API_PATH_TYPE_ICMP_PROHIBIT FibPathType = 6
130         FIB_API_PATH_TYPE_SOURCE_LOOKUP FibPathType = 7
131         FIB_API_PATH_TYPE_DVR           FibPathType = 8
132         FIB_API_PATH_TYPE_INTERFACE_RX  FibPathType = 9
133         FIB_API_PATH_TYPE_CLASSIFY      FibPathType = 10
134 )
135
136 var (
137         FibPathType_name = map[uint32]string{
138                 0:  "FIB_API_PATH_TYPE_NORMAL",
139                 1:  "FIB_API_PATH_TYPE_LOCAL",
140                 2:  "FIB_API_PATH_TYPE_DROP",
141                 3:  "FIB_API_PATH_TYPE_UDP_ENCAP",
142                 4:  "FIB_API_PATH_TYPE_BIER_IMP",
143                 5:  "FIB_API_PATH_TYPE_ICMP_UNREACH",
144                 6:  "FIB_API_PATH_TYPE_ICMP_PROHIBIT",
145                 7:  "FIB_API_PATH_TYPE_SOURCE_LOOKUP",
146                 8:  "FIB_API_PATH_TYPE_DVR",
147                 9:  "FIB_API_PATH_TYPE_INTERFACE_RX",
148                 10: "FIB_API_PATH_TYPE_CLASSIFY",
149         }
150         FibPathType_value = map[string]uint32{
151                 "FIB_API_PATH_TYPE_NORMAL":        0,
152                 "FIB_API_PATH_TYPE_LOCAL":         1,
153                 "FIB_API_PATH_TYPE_DROP":          2,
154                 "FIB_API_PATH_TYPE_UDP_ENCAP":     3,
155                 "FIB_API_PATH_TYPE_BIER_IMP":      4,
156                 "FIB_API_PATH_TYPE_ICMP_UNREACH":  5,
157                 "FIB_API_PATH_TYPE_ICMP_PROHIBIT": 6,
158                 "FIB_API_PATH_TYPE_SOURCE_LOOKUP": 7,
159                 "FIB_API_PATH_TYPE_DVR":           8,
160                 "FIB_API_PATH_TYPE_INTERFACE_RX":  9,
161                 "FIB_API_PATH_TYPE_CLASSIFY":      10,
162         }
163 )
164
165 func (x FibPathType) String() string {
166         s, ok := FibPathType_name[uint32(x)]
167         if ok {
168                 return s
169         }
170         return "FibPathType(" + strconv.Itoa(int(x)) + ")"
171 }
172
173 type IPDscp = ip_types.IPDscp
174
175 type IPEcn = ip_types.IPEcn
176
177 type IPProto = ip_types.IPProto
178
179 type AddressWithPrefix = ip_types.AddressWithPrefix
180
181 type IP4Address = ip_types.IP4Address
182
183 type IP4AddressWithPrefix = ip_types.IP4AddressWithPrefix
184
185 type IP6Address = ip_types.IP6Address
186
187 type IP6AddressWithPrefix = ip_types.IP6AddressWithPrefix
188
189 type Address = ip_types.Address
190
191 // FibMplsLabel represents VPP binary API type 'fib_mpls_label'.
192 type FibMplsLabel struct {
193         IsUniform uint8  `binapi:"u8,name=is_uniform" json:"is_uniform,omitempty"`
194         Label     uint32 `binapi:"u32,name=label" json:"label,omitempty"`
195         TTL       uint8  `binapi:"u8,name=ttl" json:"ttl,omitempty"`
196         Exp       uint8  `binapi:"u8,name=exp" json:"exp,omitempty"`
197 }
198
199 func (*FibMplsLabel) GetTypeName() string { return "fib_mpls_label" }
200
201 // FibPath represents VPP binary API type 'fib_path'.
202 type FibPath struct {
203         SwIfIndex  uint32           `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
204         TableID    uint32           `binapi:"u32,name=table_id" json:"table_id,omitempty"`
205         RpfID      uint32           `binapi:"u32,name=rpf_id" json:"rpf_id,omitempty"`
206         Weight     uint8            `binapi:"u8,name=weight" json:"weight,omitempty"`
207         Preference uint8            `binapi:"u8,name=preference" json:"preference,omitempty"`
208         Type       FibPathType      `binapi:"fib_path_type,name=type" json:"type,omitempty"`
209         Flags      FibPathFlags     `binapi:"fib_path_flags,name=flags" json:"flags,omitempty"`
210         Proto      FibPathNhProto   `binapi:"fib_path_nh_proto,name=proto" json:"proto,omitempty"`
211         Nh         FibPathNh        `binapi:"fib_path_nh,name=nh" json:"nh,omitempty"`
212         NLabels    uint8            `binapi:"u8,name=n_labels" json:"n_labels,omitempty"`
213         LabelStack [16]FibMplsLabel `binapi:"fib_mpls_label[16],name=label_stack" json:"label_stack,omitempty" struc:"[16]FibMplsLabel"`
214 }
215
216 func (*FibPath) GetTypeName() string { return "fib_path" }
217
218 // FibPathNh represents VPP binary API type 'fib_path_nh'.
219 type FibPathNh struct {
220         Address            AddressUnion `binapi:"address_union,name=address" json:"address,omitempty"`
221         ViaLabel           uint32       `binapi:"u32,name=via_label" json:"via_label,omitempty"`
222         ObjID              uint32       `binapi:"u32,name=obj_id" json:"obj_id,omitempty"`
223         ClassifyTableIndex uint32       `binapi:"u32,name=classify_table_index" json:"classify_table_index,omitempty"`
224 }
225
226 func (*FibPathNh) GetTypeName() string { return "fib_path_nh" }
227
228 type IP4Prefix = ip_types.IP4Prefix
229
230 type IP6Prefix = ip_types.IP6Prefix
231
232 type Mprefix = ip_types.Mprefix
233
234 type Prefix = ip_types.Prefix
235
236 type PrefixMatcher = ip_types.PrefixMatcher
237
238 type AddressUnion = ip_types.AddressUnion
239
240 // Reference imports to suppress errors if they are not otherwise used.
241 var _ = api.RegisterMessage
242 var _ = codec.DecodeString
243 var _ = bytes.NewBuffer
244 var _ = context.Background
245 var _ = io.Copy
246 var _ = strconv.Itoa
247 var _ = struc.Pack
248 var _ = binary.BigEndian
249 var _ = math.Float32bits