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