test: Fix test dependancy
[govpp.git] / binapi / vxlan_gbp / vxlan_gbp.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.5.0-dev
4 //  VPP:              21.06-release
5 // source: /usr/share/vpp/api/core/vxlan_gbp.api.json
6
7 // Package vxlan_gbp contains generated bindings for API file vxlan_gbp.api.
8 //
9 // Contents:
10 //   1 enum
11 //   1 struct
12 //   6 messages
13 //
14 package vxlan_gbp
15
16 import (
17         "strconv"
18
19         api "git.fd.io/govpp.git/api"
20         interface_types "git.fd.io/govpp.git/binapi/interface_types"
21         ip_types "git.fd.io/govpp.git/binapi/ip_types"
22         codec "git.fd.io/govpp.git/codec"
23 )
24
25 // This is a compile-time assertion to ensure that this generated file
26 // is compatible with the GoVPP api package it is being compiled against.
27 // A compilation error at this line likely means your copy of the
28 // GoVPP api package needs to be updated.
29 const _ = api.GoVppAPIPackageIsVersion2
30
31 const (
32         APIFile    = "vxlan_gbp"
33         APIVersion = "1.1.1"
34         VersionCrc = 0xb40203a1
35 )
36
37 // VxlanGbpAPITunnelMode defines enum 'vxlan_gbp_api_tunnel_mode'.
38 type VxlanGbpAPITunnelMode uint32
39
40 const (
41         VXLAN_GBP_API_TUNNEL_MODE_L2 VxlanGbpAPITunnelMode = 1
42         VXLAN_GBP_API_TUNNEL_MODE_L3 VxlanGbpAPITunnelMode = 2
43 )
44
45 var (
46         VxlanGbpAPITunnelMode_name = map[uint32]string{
47                 1: "VXLAN_GBP_API_TUNNEL_MODE_L2",
48                 2: "VXLAN_GBP_API_TUNNEL_MODE_L3",
49         }
50         VxlanGbpAPITunnelMode_value = map[string]uint32{
51                 "VXLAN_GBP_API_TUNNEL_MODE_L2": 1,
52                 "VXLAN_GBP_API_TUNNEL_MODE_L3": 2,
53         }
54 )
55
56 func (x VxlanGbpAPITunnelMode) String() string {
57         s, ok := VxlanGbpAPITunnelMode_name[uint32(x)]
58         if ok {
59                 return s
60         }
61         return "VxlanGbpAPITunnelMode(" + strconv.Itoa(int(x)) + ")"
62 }
63
64 // VxlanGbpTunnel defines type 'vxlan_gbp_tunnel'.
65 type VxlanGbpTunnel struct {
66         Instance       uint32                         `binapi:"u32,name=instance" json:"instance,omitempty"`
67         Src            ip_types.Address               `binapi:"address,name=src" json:"src,omitempty"`
68         Dst            ip_types.Address               `binapi:"address,name=dst" json:"dst,omitempty"`
69         McastSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=mcast_sw_if_index" json:"mcast_sw_if_index,omitempty"`
70         EncapTableID   uint32                         `binapi:"u32,name=encap_table_id" json:"encap_table_id,omitempty"`
71         Vni            uint32                         `binapi:"u32,name=vni" json:"vni,omitempty"`
72         SwIfIndex      interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
73         Mode           VxlanGbpAPITunnelMode          `binapi:"vxlan_gbp_api_tunnel_mode,name=mode" json:"mode,omitempty"`
74 }
75
76 // SwInterfaceSetVxlanGbpBypass defines message 'sw_interface_set_vxlan_gbp_bypass'.
77 // InProgress: the message form may change in the future versions
78 type SwInterfaceSetVxlanGbpBypass struct {
79         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
80         IsIPv6    bool                           `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
81         Enable    bool                           `binapi:"bool,name=enable,default=true" json:"enable,omitempty"`
82 }
83
84 func (m *SwInterfaceSetVxlanGbpBypass) Reset() { *m = SwInterfaceSetVxlanGbpBypass{} }
85 func (*SwInterfaceSetVxlanGbpBypass) GetMessageName() string {
86         return "sw_interface_set_vxlan_gbp_bypass"
87 }
88 func (*SwInterfaceSetVxlanGbpBypass) GetCrcString() string { return "65247409" }
89 func (*SwInterfaceSetVxlanGbpBypass) GetMessageType() api.MessageType {
90         return api.RequestMessage
91 }
92
93 func (m *SwInterfaceSetVxlanGbpBypass) Size() (size int) {
94         if m == nil {
95                 return 0
96         }
97         size += 4 // m.SwIfIndex
98         size += 1 // m.IsIPv6
99         size += 1 // m.Enable
100         return size
101 }
102 func (m *SwInterfaceSetVxlanGbpBypass) Marshal(b []byte) ([]byte, error) {
103         if b == nil {
104                 b = make([]byte, m.Size())
105         }
106         buf := codec.NewBuffer(b)
107         buf.EncodeUint32(uint32(m.SwIfIndex))
108         buf.EncodeBool(m.IsIPv6)
109         buf.EncodeBool(m.Enable)
110         return buf.Bytes(), nil
111 }
112 func (m *SwInterfaceSetVxlanGbpBypass) Unmarshal(b []byte) error {
113         buf := codec.NewBuffer(b)
114         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
115         m.IsIPv6 = buf.DecodeBool()
116         m.Enable = buf.DecodeBool()
117         return nil
118 }
119
120 // SwInterfaceSetVxlanGbpBypassReply defines message 'sw_interface_set_vxlan_gbp_bypass_reply'.
121 // InProgress: the message form may change in the future versions
122 type SwInterfaceSetVxlanGbpBypassReply struct {
123         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
124 }
125
126 func (m *SwInterfaceSetVxlanGbpBypassReply) Reset() { *m = SwInterfaceSetVxlanGbpBypassReply{} }
127 func (*SwInterfaceSetVxlanGbpBypassReply) GetMessageName() string {
128         return "sw_interface_set_vxlan_gbp_bypass_reply"
129 }
130 func (*SwInterfaceSetVxlanGbpBypassReply) GetCrcString() string { return "e8d4e804" }
131 func (*SwInterfaceSetVxlanGbpBypassReply) GetMessageType() api.MessageType {
132         return api.ReplyMessage
133 }
134
135 func (m *SwInterfaceSetVxlanGbpBypassReply) Size() (size int) {
136         if m == nil {
137                 return 0
138         }
139         size += 4 // m.Retval
140         return size
141 }
142 func (m *SwInterfaceSetVxlanGbpBypassReply) Marshal(b []byte) ([]byte, error) {
143         if b == nil {
144                 b = make([]byte, m.Size())
145         }
146         buf := codec.NewBuffer(b)
147         buf.EncodeInt32(m.Retval)
148         return buf.Bytes(), nil
149 }
150 func (m *SwInterfaceSetVxlanGbpBypassReply) Unmarshal(b []byte) error {
151         buf := codec.NewBuffer(b)
152         m.Retval = buf.DecodeInt32()
153         return nil
154 }
155
156 // VxlanGbpTunnelAddDel defines message 'vxlan_gbp_tunnel_add_del'.
157 // InProgress: the message form may change in the future versions
158 type VxlanGbpTunnelAddDel struct {
159         IsAdd  bool           `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
160         Tunnel VxlanGbpTunnel `binapi:"vxlan_gbp_tunnel,name=tunnel" json:"tunnel,omitempty"`
161 }
162
163 func (m *VxlanGbpTunnelAddDel) Reset()               { *m = VxlanGbpTunnelAddDel{} }
164 func (*VxlanGbpTunnelAddDel) GetMessageName() string { return "vxlan_gbp_tunnel_add_del" }
165 func (*VxlanGbpTunnelAddDel) GetCrcString() string   { return "6c743427" }
166 func (*VxlanGbpTunnelAddDel) GetMessageType() api.MessageType {
167         return api.RequestMessage
168 }
169
170 func (m *VxlanGbpTunnelAddDel) Size() (size int) {
171         if m == nil {
172                 return 0
173         }
174         size += 1      // m.IsAdd
175         size += 4      // m.Tunnel.Instance
176         size += 1      // m.Tunnel.Src.Af
177         size += 1 * 16 // m.Tunnel.Src.Un
178         size += 1      // m.Tunnel.Dst.Af
179         size += 1 * 16 // m.Tunnel.Dst.Un
180         size += 4      // m.Tunnel.McastSwIfIndex
181         size += 4      // m.Tunnel.EncapTableID
182         size += 4      // m.Tunnel.Vni
183         size += 4      // m.Tunnel.SwIfIndex
184         size += 4      // m.Tunnel.Mode
185         return size
186 }
187 func (m *VxlanGbpTunnelAddDel) Marshal(b []byte) ([]byte, error) {
188         if b == nil {
189                 b = make([]byte, m.Size())
190         }
191         buf := codec.NewBuffer(b)
192         buf.EncodeBool(m.IsAdd)
193         buf.EncodeUint32(m.Tunnel.Instance)
194         buf.EncodeUint8(uint8(m.Tunnel.Src.Af))
195         buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 16)
196         buf.EncodeUint8(uint8(m.Tunnel.Dst.Af))
197         buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 16)
198         buf.EncodeUint32(uint32(m.Tunnel.McastSwIfIndex))
199         buf.EncodeUint32(m.Tunnel.EncapTableID)
200         buf.EncodeUint32(m.Tunnel.Vni)
201         buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex))
202         buf.EncodeUint32(uint32(m.Tunnel.Mode))
203         return buf.Bytes(), nil
204 }
205 func (m *VxlanGbpTunnelAddDel) Unmarshal(b []byte) error {
206         buf := codec.NewBuffer(b)
207         m.IsAdd = buf.DecodeBool()
208         m.Tunnel.Instance = buf.DecodeUint32()
209         m.Tunnel.Src.Af = ip_types.AddressFamily(buf.DecodeUint8())
210         copy(m.Tunnel.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
211         m.Tunnel.Dst.Af = ip_types.AddressFamily(buf.DecodeUint8())
212         copy(m.Tunnel.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
213         m.Tunnel.McastSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
214         m.Tunnel.EncapTableID = buf.DecodeUint32()
215         m.Tunnel.Vni = buf.DecodeUint32()
216         m.Tunnel.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
217         m.Tunnel.Mode = VxlanGbpAPITunnelMode(buf.DecodeUint32())
218         return nil
219 }
220
221 // VxlanGbpTunnelAddDelReply defines message 'vxlan_gbp_tunnel_add_del_reply'.
222 // InProgress: the message form may change in the future versions
223 type VxlanGbpTunnelAddDelReply struct {
224         Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
225         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
226 }
227
228 func (m *VxlanGbpTunnelAddDelReply) Reset()               { *m = VxlanGbpTunnelAddDelReply{} }
229 func (*VxlanGbpTunnelAddDelReply) GetMessageName() string { return "vxlan_gbp_tunnel_add_del_reply" }
230 func (*VxlanGbpTunnelAddDelReply) GetCrcString() string   { return "5383d31f" }
231 func (*VxlanGbpTunnelAddDelReply) GetMessageType() api.MessageType {
232         return api.ReplyMessage
233 }
234
235 func (m *VxlanGbpTunnelAddDelReply) Size() (size int) {
236         if m == nil {
237                 return 0
238         }
239         size += 4 // m.Retval
240         size += 4 // m.SwIfIndex
241         return size
242 }
243 func (m *VxlanGbpTunnelAddDelReply) Marshal(b []byte) ([]byte, error) {
244         if b == nil {
245                 b = make([]byte, m.Size())
246         }
247         buf := codec.NewBuffer(b)
248         buf.EncodeInt32(m.Retval)
249         buf.EncodeUint32(uint32(m.SwIfIndex))
250         return buf.Bytes(), nil
251 }
252 func (m *VxlanGbpTunnelAddDelReply) Unmarshal(b []byte) error {
253         buf := codec.NewBuffer(b)
254         m.Retval = buf.DecodeInt32()
255         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
256         return nil
257 }
258
259 // VxlanGbpTunnelDetails defines message 'vxlan_gbp_tunnel_details'.
260 // InProgress: the message form may change in the future versions
261 type VxlanGbpTunnelDetails struct {
262         Tunnel VxlanGbpTunnel `binapi:"vxlan_gbp_tunnel,name=tunnel" json:"tunnel,omitempty"`
263 }
264
265 func (m *VxlanGbpTunnelDetails) Reset()               { *m = VxlanGbpTunnelDetails{} }
266 func (*VxlanGbpTunnelDetails) GetMessageName() string { return "vxlan_gbp_tunnel_details" }
267 func (*VxlanGbpTunnelDetails) GetCrcString() string   { return "66e94a89" }
268 func (*VxlanGbpTunnelDetails) GetMessageType() api.MessageType {
269         return api.ReplyMessage
270 }
271
272 func (m *VxlanGbpTunnelDetails) Size() (size int) {
273         if m == nil {
274                 return 0
275         }
276         size += 4      // m.Tunnel.Instance
277         size += 1      // m.Tunnel.Src.Af
278         size += 1 * 16 // m.Tunnel.Src.Un
279         size += 1      // m.Tunnel.Dst.Af
280         size += 1 * 16 // m.Tunnel.Dst.Un
281         size += 4      // m.Tunnel.McastSwIfIndex
282         size += 4      // m.Tunnel.EncapTableID
283         size += 4      // m.Tunnel.Vni
284         size += 4      // m.Tunnel.SwIfIndex
285         size += 4      // m.Tunnel.Mode
286         return size
287 }
288 func (m *VxlanGbpTunnelDetails) Marshal(b []byte) ([]byte, error) {
289         if b == nil {
290                 b = make([]byte, m.Size())
291         }
292         buf := codec.NewBuffer(b)
293         buf.EncodeUint32(m.Tunnel.Instance)
294         buf.EncodeUint8(uint8(m.Tunnel.Src.Af))
295         buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 16)
296         buf.EncodeUint8(uint8(m.Tunnel.Dst.Af))
297         buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 16)
298         buf.EncodeUint32(uint32(m.Tunnel.McastSwIfIndex))
299         buf.EncodeUint32(m.Tunnel.EncapTableID)
300         buf.EncodeUint32(m.Tunnel.Vni)
301         buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex))
302         buf.EncodeUint32(uint32(m.Tunnel.Mode))
303         return buf.Bytes(), nil
304 }
305 func (m *VxlanGbpTunnelDetails) Unmarshal(b []byte) error {
306         buf := codec.NewBuffer(b)
307         m.Tunnel.Instance = buf.DecodeUint32()
308         m.Tunnel.Src.Af = ip_types.AddressFamily(buf.DecodeUint8())
309         copy(m.Tunnel.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
310         m.Tunnel.Dst.Af = ip_types.AddressFamily(buf.DecodeUint8())
311         copy(m.Tunnel.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
312         m.Tunnel.McastSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
313         m.Tunnel.EncapTableID = buf.DecodeUint32()
314         m.Tunnel.Vni = buf.DecodeUint32()
315         m.Tunnel.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
316         m.Tunnel.Mode = VxlanGbpAPITunnelMode(buf.DecodeUint32())
317         return nil
318 }
319
320 // VxlanGbpTunnelDump defines message 'vxlan_gbp_tunnel_dump'.
321 // InProgress: the message form may change in the future versions
322 type VxlanGbpTunnelDump struct {
323         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
324 }
325
326 func (m *VxlanGbpTunnelDump) Reset()               { *m = VxlanGbpTunnelDump{} }
327 func (*VxlanGbpTunnelDump) GetMessageName() string { return "vxlan_gbp_tunnel_dump" }
328 func (*VxlanGbpTunnelDump) GetCrcString() string   { return "f9e6675e" }
329 func (*VxlanGbpTunnelDump) GetMessageType() api.MessageType {
330         return api.RequestMessage
331 }
332
333 func (m *VxlanGbpTunnelDump) Size() (size int) {
334         if m == nil {
335                 return 0
336         }
337         size += 4 // m.SwIfIndex
338         return size
339 }
340 func (m *VxlanGbpTunnelDump) Marshal(b []byte) ([]byte, error) {
341         if b == nil {
342                 b = make([]byte, m.Size())
343         }
344         buf := codec.NewBuffer(b)
345         buf.EncodeUint32(uint32(m.SwIfIndex))
346         return buf.Bytes(), nil
347 }
348 func (m *VxlanGbpTunnelDump) Unmarshal(b []byte) error {
349         buf := codec.NewBuffer(b)
350         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
351         return nil
352 }
353
354 func init() { file_vxlan_gbp_binapi_init() }
355 func file_vxlan_gbp_binapi_init() {
356         api.RegisterMessage((*SwInterfaceSetVxlanGbpBypass)(nil), "sw_interface_set_vxlan_gbp_bypass_65247409")
357         api.RegisterMessage((*SwInterfaceSetVxlanGbpBypassReply)(nil), "sw_interface_set_vxlan_gbp_bypass_reply_e8d4e804")
358         api.RegisterMessage((*VxlanGbpTunnelAddDel)(nil), "vxlan_gbp_tunnel_add_del_6c743427")
359         api.RegisterMessage((*VxlanGbpTunnelAddDelReply)(nil), "vxlan_gbp_tunnel_add_del_reply_5383d31f")
360         api.RegisterMessage((*VxlanGbpTunnelDetails)(nil), "vxlan_gbp_tunnel_details_66e94a89")
361         api.RegisterMessage((*VxlanGbpTunnelDump)(nil), "vxlan_gbp_tunnel_dump_f9e6675e")
362 }
363
364 // Messages returns list of all messages in this module.
365 func AllMessages() []api.Message {
366         return []api.Message{
367                 (*SwInterfaceSetVxlanGbpBypass)(nil),
368                 (*SwInterfaceSetVxlanGbpBypassReply)(nil),
369                 (*VxlanGbpTunnelAddDel)(nil),
370                 (*VxlanGbpTunnelAddDelReply)(nil),
371                 (*VxlanGbpTunnelDetails)(nil),
372                 (*VxlanGbpTunnelDump)(nil),
373         }
374 }