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