Improve binapi generator
[govpp.git] / binapi / vxlan / vxlan.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/vxlan.api.json
6
7 // Package vxlan contains generated bindings for API file vxlan.api.
8 //
9 // Contents:
10 //   8 messages
11 //
12 package vxlan
13
14 import (
15         api "git.fd.io/govpp.git/api"
16         interface_types "git.fd.io/govpp.git/binapi/interface_types"
17         ip_types "git.fd.io/govpp.git/binapi/ip_types"
18         codec "git.fd.io/govpp.git/codec"
19 )
20
21 // This is a compile-time assertion to ensure that this generated file
22 // is compatible with the GoVPP api package it is being compiled against.
23 // A compilation error at this line likely means your copy of the
24 // GoVPP api package needs to be updated.
25 const _ = api.GoVppAPIPackageIsVersion2
26
27 const (
28         APIFile    = "vxlan"
29         APIVersion = "2.0.0"
30         VersionCrc = 0xf11ad29f
31 )
32
33 // SwInterfaceSetVxlanBypass defines message 'sw_interface_set_vxlan_bypass'.
34 type SwInterfaceSetVxlanBypass struct {
35         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
36         IsIPv6    bool                           `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
37         Enable    bool                           `binapi:"bool,name=enable,default=true" json:"enable,omitempty"`
38 }
39
40 func (m *SwInterfaceSetVxlanBypass) Reset()               { *m = SwInterfaceSetVxlanBypass{} }
41 func (*SwInterfaceSetVxlanBypass) GetMessageName() string { return "sw_interface_set_vxlan_bypass" }
42 func (*SwInterfaceSetVxlanBypass) GetCrcString() string   { return "65247409" }
43 func (*SwInterfaceSetVxlanBypass) GetMessageType() api.MessageType {
44         return api.RequestMessage
45 }
46
47 func (m *SwInterfaceSetVxlanBypass) Size() int {
48         if m == nil {
49                 return 0
50         }
51         var size int
52         size += 4 // m.SwIfIndex
53         size += 1 // m.IsIPv6
54         size += 1 // m.Enable
55         return size
56 }
57 func (m *SwInterfaceSetVxlanBypass) Marshal(b []byte) ([]byte, error) {
58         var buf *codec.Buffer
59         if b == nil {
60                 buf = codec.NewBuffer(make([]byte, m.Size()))
61         } else {
62                 buf = codec.NewBuffer(b)
63         }
64         buf.EncodeUint32(uint32(m.SwIfIndex))
65         buf.EncodeBool(m.IsIPv6)
66         buf.EncodeBool(m.Enable)
67         return buf.Bytes(), nil
68 }
69 func (m *SwInterfaceSetVxlanBypass) Unmarshal(b []byte) error {
70         buf := codec.NewBuffer(b)
71         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
72         m.IsIPv6 = buf.DecodeBool()
73         m.Enable = buf.DecodeBool()
74         return nil
75 }
76
77 // SwInterfaceSetVxlanBypassReply defines message 'sw_interface_set_vxlan_bypass_reply'.
78 type SwInterfaceSetVxlanBypassReply struct {
79         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
80 }
81
82 func (m *SwInterfaceSetVxlanBypassReply) Reset() { *m = SwInterfaceSetVxlanBypassReply{} }
83 func (*SwInterfaceSetVxlanBypassReply) GetMessageName() string {
84         return "sw_interface_set_vxlan_bypass_reply"
85 }
86 func (*SwInterfaceSetVxlanBypassReply) GetCrcString() string { return "e8d4e804" }
87 func (*SwInterfaceSetVxlanBypassReply) GetMessageType() api.MessageType {
88         return api.ReplyMessage
89 }
90
91 func (m *SwInterfaceSetVxlanBypassReply) Size() int {
92         if m == nil {
93                 return 0
94         }
95         var size int
96         size += 4 // m.Retval
97         return size
98 }
99 func (m *SwInterfaceSetVxlanBypassReply) Marshal(b []byte) ([]byte, error) {
100         var buf *codec.Buffer
101         if b == nil {
102                 buf = codec.NewBuffer(make([]byte, m.Size()))
103         } else {
104                 buf = codec.NewBuffer(b)
105         }
106         buf.EncodeUint32(uint32(m.Retval))
107         return buf.Bytes(), nil
108 }
109 func (m *SwInterfaceSetVxlanBypassReply) Unmarshal(b []byte) error {
110         buf := codec.NewBuffer(b)
111         m.Retval = int32(buf.DecodeUint32())
112         return nil
113 }
114
115 // VxlanAddDelTunnel defines message 'vxlan_add_del_tunnel'.
116 type VxlanAddDelTunnel struct {
117         IsAdd          bool                           `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
118         Instance       uint32                         `binapi:"u32,name=instance" json:"instance,omitempty"`
119         SrcAddress     ip_types.Address               `binapi:"address,name=src_address" json:"src_address,omitempty"`
120         DstAddress     ip_types.Address               `binapi:"address,name=dst_address" json:"dst_address,omitempty"`
121         McastSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=mcast_sw_if_index" json:"mcast_sw_if_index,omitempty"`
122         EncapVrfID     uint32                         `binapi:"u32,name=encap_vrf_id" json:"encap_vrf_id,omitempty"`
123         DecapNextIndex uint32                         `binapi:"u32,name=decap_next_index" json:"decap_next_index,omitempty"`
124         Vni            uint32                         `binapi:"u32,name=vni" json:"vni,omitempty"`
125 }
126
127 func (m *VxlanAddDelTunnel) Reset()               { *m = VxlanAddDelTunnel{} }
128 func (*VxlanAddDelTunnel) GetMessageName() string { return "vxlan_add_del_tunnel" }
129 func (*VxlanAddDelTunnel) GetCrcString() string   { return "a35dc8f5" }
130 func (*VxlanAddDelTunnel) GetMessageType() api.MessageType {
131         return api.RequestMessage
132 }
133
134 func (m *VxlanAddDelTunnel) Size() int {
135         if m == nil {
136                 return 0
137         }
138         var size int
139         size += 1      // m.IsAdd
140         size += 4      // m.Instance
141         size += 1      // m.SrcAddress.Af
142         size += 1 * 16 // m.SrcAddress.Un
143         size += 1      // m.DstAddress.Af
144         size += 1 * 16 // m.DstAddress.Un
145         size += 4      // m.McastSwIfIndex
146         size += 4      // m.EncapVrfID
147         size += 4      // m.DecapNextIndex
148         size += 4      // m.Vni
149         return size
150 }
151 func (m *VxlanAddDelTunnel) Marshal(b []byte) ([]byte, error) {
152         var buf *codec.Buffer
153         if b == nil {
154                 buf = codec.NewBuffer(make([]byte, m.Size()))
155         } else {
156                 buf = codec.NewBuffer(b)
157         }
158         buf.EncodeBool(m.IsAdd)
159         buf.EncodeUint32(uint32(m.Instance))
160         buf.EncodeUint8(uint8(m.SrcAddress.Af))
161         buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 0)
162         buf.EncodeUint8(uint8(m.DstAddress.Af))
163         buf.EncodeBytes(m.DstAddress.Un.XXX_UnionData[:], 0)
164         buf.EncodeUint32(uint32(m.McastSwIfIndex))
165         buf.EncodeUint32(uint32(m.EncapVrfID))
166         buf.EncodeUint32(uint32(m.DecapNextIndex))
167         buf.EncodeUint32(uint32(m.Vni))
168         return buf.Bytes(), nil
169 }
170 func (m *VxlanAddDelTunnel) Unmarshal(b []byte) error {
171         buf := codec.NewBuffer(b)
172         m.IsAdd = buf.DecodeBool()
173         m.Instance = buf.DecodeUint32()
174         m.SrcAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
175         copy(m.SrcAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
176         m.DstAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
177         copy(m.DstAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
178         m.McastSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
179         m.EncapVrfID = buf.DecodeUint32()
180         m.DecapNextIndex = buf.DecodeUint32()
181         m.Vni = buf.DecodeUint32()
182         return nil
183 }
184
185 // VxlanAddDelTunnelReply defines message 'vxlan_add_del_tunnel_reply'.
186 type VxlanAddDelTunnelReply struct {
187         Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
188         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
189 }
190
191 func (m *VxlanAddDelTunnelReply) Reset()               { *m = VxlanAddDelTunnelReply{} }
192 func (*VxlanAddDelTunnelReply) GetMessageName() string { return "vxlan_add_del_tunnel_reply" }
193 func (*VxlanAddDelTunnelReply) GetCrcString() string   { return "5383d31f" }
194 func (*VxlanAddDelTunnelReply) GetMessageType() api.MessageType {
195         return api.ReplyMessage
196 }
197
198 func (m *VxlanAddDelTunnelReply) Size() int {
199         if m == nil {
200                 return 0
201         }
202         var size int
203         size += 4 // m.Retval
204         size += 4 // m.SwIfIndex
205         return size
206 }
207 func (m *VxlanAddDelTunnelReply) Marshal(b []byte) ([]byte, error) {
208         var buf *codec.Buffer
209         if b == nil {
210                 buf = codec.NewBuffer(make([]byte, m.Size()))
211         } else {
212                 buf = codec.NewBuffer(b)
213         }
214         buf.EncodeUint32(uint32(m.Retval))
215         buf.EncodeUint32(uint32(m.SwIfIndex))
216         return buf.Bytes(), nil
217 }
218 func (m *VxlanAddDelTunnelReply) Unmarshal(b []byte) error {
219         buf := codec.NewBuffer(b)
220         m.Retval = int32(buf.DecodeUint32())
221         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
222         return nil
223 }
224
225 // VxlanOffloadRx defines message 'vxlan_offload_rx'.
226 type VxlanOffloadRx struct {
227         HwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=hw_if_index" json:"hw_if_index,omitempty"`
228         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
229         Enable    bool                           `binapi:"bool,name=enable,default=true" json:"enable,omitempty"`
230 }
231
232 func (m *VxlanOffloadRx) Reset()               { *m = VxlanOffloadRx{} }
233 func (*VxlanOffloadRx) GetMessageName() string { return "vxlan_offload_rx" }
234 func (*VxlanOffloadRx) GetCrcString() string   { return "89a1564b" }
235 func (*VxlanOffloadRx) GetMessageType() api.MessageType {
236         return api.RequestMessage
237 }
238
239 func (m *VxlanOffloadRx) Size() int {
240         if m == nil {
241                 return 0
242         }
243         var size int
244         size += 4 // m.HwIfIndex
245         size += 4 // m.SwIfIndex
246         size += 1 // m.Enable
247         return size
248 }
249 func (m *VxlanOffloadRx) Marshal(b []byte) ([]byte, error) {
250         var buf *codec.Buffer
251         if b == nil {
252                 buf = codec.NewBuffer(make([]byte, m.Size()))
253         } else {
254                 buf = codec.NewBuffer(b)
255         }
256         buf.EncodeUint32(uint32(m.HwIfIndex))
257         buf.EncodeUint32(uint32(m.SwIfIndex))
258         buf.EncodeBool(m.Enable)
259         return buf.Bytes(), nil
260 }
261 func (m *VxlanOffloadRx) Unmarshal(b []byte) error {
262         buf := codec.NewBuffer(b)
263         m.HwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
264         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
265         m.Enable = buf.DecodeBool()
266         return nil
267 }
268
269 // VxlanOffloadRxReply defines message 'vxlan_offload_rx_reply'.
270 type VxlanOffloadRxReply struct {
271         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
272 }
273
274 func (m *VxlanOffloadRxReply) Reset()               { *m = VxlanOffloadRxReply{} }
275 func (*VxlanOffloadRxReply) GetMessageName() string { return "vxlan_offload_rx_reply" }
276 func (*VxlanOffloadRxReply) GetCrcString() string   { return "e8d4e804" }
277 func (*VxlanOffloadRxReply) GetMessageType() api.MessageType {
278         return api.ReplyMessage
279 }
280
281 func (m *VxlanOffloadRxReply) Size() int {
282         if m == nil {
283                 return 0
284         }
285         var size int
286         size += 4 // m.Retval
287         return size
288 }
289 func (m *VxlanOffloadRxReply) Marshal(b []byte) ([]byte, error) {
290         var buf *codec.Buffer
291         if b == nil {
292                 buf = codec.NewBuffer(make([]byte, m.Size()))
293         } else {
294                 buf = codec.NewBuffer(b)
295         }
296         buf.EncodeUint32(uint32(m.Retval))
297         return buf.Bytes(), nil
298 }
299 func (m *VxlanOffloadRxReply) Unmarshal(b []byte) error {
300         buf := codec.NewBuffer(b)
301         m.Retval = int32(buf.DecodeUint32())
302         return nil
303 }
304
305 // VxlanTunnelDetails defines message 'vxlan_tunnel_details'.
306 type VxlanTunnelDetails struct {
307         SwIfIndex      interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
308         Instance       uint32                         `binapi:"u32,name=instance" json:"instance,omitempty"`
309         SrcAddress     ip_types.Address               `binapi:"address,name=src_address" json:"src_address,omitempty"`
310         DstAddress     ip_types.Address               `binapi:"address,name=dst_address" json:"dst_address,omitempty"`
311         McastSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=mcast_sw_if_index" json:"mcast_sw_if_index,omitempty"`
312         EncapVrfID     uint32                         `binapi:"u32,name=encap_vrf_id" json:"encap_vrf_id,omitempty"`
313         DecapNextIndex uint32                         `binapi:"u32,name=decap_next_index" json:"decap_next_index,omitempty"`
314         Vni            uint32                         `binapi:"u32,name=vni" json:"vni,omitempty"`
315 }
316
317 func (m *VxlanTunnelDetails) Reset()               { *m = VxlanTunnelDetails{} }
318 func (*VxlanTunnelDetails) GetMessageName() string { return "vxlan_tunnel_details" }
319 func (*VxlanTunnelDetails) GetCrcString() string   { return "e782f70f" }
320 func (*VxlanTunnelDetails) GetMessageType() api.MessageType {
321         return api.ReplyMessage
322 }
323
324 func (m *VxlanTunnelDetails) Size() int {
325         if m == nil {
326                 return 0
327         }
328         var size int
329         size += 4      // m.SwIfIndex
330         size += 4      // m.Instance
331         size += 1      // m.SrcAddress.Af
332         size += 1 * 16 // m.SrcAddress.Un
333         size += 1      // m.DstAddress.Af
334         size += 1 * 16 // m.DstAddress.Un
335         size += 4      // m.McastSwIfIndex
336         size += 4      // m.EncapVrfID
337         size += 4      // m.DecapNextIndex
338         size += 4      // m.Vni
339         return size
340 }
341 func (m *VxlanTunnelDetails) Marshal(b []byte) ([]byte, error) {
342         var buf *codec.Buffer
343         if b == nil {
344                 buf = codec.NewBuffer(make([]byte, m.Size()))
345         } else {
346                 buf = codec.NewBuffer(b)
347         }
348         buf.EncodeUint32(uint32(m.SwIfIndex))
349         buf.EncodeUint32(uint32(m.Instance))
350         buf.EncodeUint8(uint8(m.SrcAddress.Af))
351         buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 0)
352         buf.EncodeUint8(uint8(m.DstAddress.Af))
353         buf.EncodeBytes(m.DstAddress.Un.XXX_UnionData[:], 0)
354         buf.EncodeUint32(uint32(m.McastSwIfIndex))
355         buf.EncodeUint32(uint32(m.EncapVrfID))
356         buf.EncodeUint32(uint32(m.DecapNextIndex))
357         buf.EncodeUint32(uint32(m.Vni))
358         return buf.Bytes(), nil
359 }
360 func (m *VxlanTunnelDetails) Unmarshal(b []byte) error {
361         buf := codec.NewBuffer(b)
362         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
363         m.Instance = buf.DecodeUint32()
364         m.SrcAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
365         copy(m.SrcAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
366         m.DstAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
367         copy(m.DstAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
368         m.McastSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
369         m.EncapVrfID = buf.DecodeUint32()
370         m.DecapNextIndex = buf.DecodeUint32()
371         m.Vni = buf.DecodeUint32()
372         return nil
373 }
374
375 // VxlanTunnelDump defines message 'vxlan_tunnel_dump'.
376 type VxlanTunnelDump struct {
377         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
378 }
379
380 func (m *VxlanTunnelDump) Reset()               { *m = VxlanTunnelDump{} }
381 func (*VxlanTunnelDump) GetMessageName() string { return "vxlan_tunnel_dump" }
382 func (*VxlanTunnelDump) GetCrcString() string   { return "f9e6675e" }
383 func (*VxlanTunnelDump) GetMessageType() api.MessageType {
384         return api.RequestMessage
385 }
386
387 func (m *VxlanTunnelDump) Size() int {
388         if m == nil {
389                 return 0
390         }
391         var size int
392         size += 4 // m.SwIfIndex
393         return size
394 }
395 func (m *VxlanTunnelDump) Marshal(b []byte) ([]byte, error) {
396         var buf *codec.Buffer
397         if b == nil {
398                 buf = codec.NewBuffer(make([]byte, m.Size()))
399         } else {
400                 buf = codec.NewBuffer(b)
401         }
402         buf.EncodeUint32(uint32(m.SwIfIndex))
403         return buf.Bytes(), nil
404 }
405 func (m *VxlanTunnelDump) Unmarshal(b []byte) error {
406         buf := codec.NewBuffer(b)
407         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
408         return nil
409 }
410
411 func init() { file_vxlan_binapi_init() }
412 func file_vxlan_binapi_init() {
413         api.RegisterMessage((*SwInterfaceSetVxlanBypass)(nil), "sw_interface_set_vxlan_bypass_65247409")
414         api.RegisterMessage((*SwInterfaceSetVxlanBypassReply)(nil), "sw_interface_set_vxlan_bypass_reply_e8d4e804")
415         api.RegisterMessage((*VxlanAddDelTunnel)(nil), "vxlan_add_del_tunnel_a35dc8f5")
416         api.RegisterMessage((*VxlanAddDelTunnelReply)(nil), "vxlan_add_del_tunnel_reply_5383d31f")
417         api.RegisterMessage((*VxlanOffloadRx)(nil), "vxlan_offload_rx_89a1564b")
418         api.RegisterMessage((*VxlanOffloadRxReply)(nil), "vxlan_offload_rx_reply_e8d4e804")
419         api.RegisterMessage((*VxlanTunnelDetails)(nil), "vxlan_tunnel_details_e782f70f")
420         api.RegisterMessage((*VxlanTunnelDump)(nil), "vxlan_tunnel_dump_f9e6675e")
421 }
422
423 // Messages returns list of all messages in this module.
424 func AllMessages() []api.Message {
425         return []api.Message{
426                 (*SwInterfaceSetVxlanBypass)(nil),
427                 (*SwInterfaceSetVxlanBypassReply)(nil),
428                 (*VxlanAddDelTunnel)(nil),
429                 (*VxlanAddDelTunnelReply)(nil),
430                 (*VxlanOffloadRx)(nil),
431                 (*VxlanOffloadRxReply)(nil),
432                 (*VxlanTunnelDetails)(nil),
433                 (*VxlanTunnelDump)(nil),
434         }
435 }