Improve binapi generator
[govpp.git] / binapi / vxlan_gpe / vxlan_gpe.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_gpe.api.json
6
7 // Package vxlan_gpe contains generated bindings for API file vxlan_gpe.api.
8 //
9 // Contents:
10 //   6 messages
11 //
12 package vxlan_gpe
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_gpe"
29         APIVersion = "2.0.0"
30         VersionCrc = 0x8295f28f
31 )
32
33 // SwInterfaceSetVxlanGpeBypass defines message 'sw_interface_set_vxlan_gpe_bypass'.
34 type SwInterfaceSetVxlanGpeBypass 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 *SwInterfaceSetVxlanGpeBypass) Reset() { *m = SwInterfaceSetVxlanGpeBypass{} }
41 func (*SwInterfaceSetVxlanGpeBypass) GetMessageName() string {
42         return "sw_interface_set_vxlan_gpe_bypass"
43 }
44 func (*SwInterfaceSetVxlanGpeBypass) GetCrcString() string { return "65247409" }
45 func (*SwInterfaceSetVxlanGpeBypass) GetMessageType() api.MessageType {
46         return api.RequestMessage
47 }
48
49 func (m *SwInterfaceSetVxlanGpeBypass) Size() int {
50         if m == nil {
51                 return 0
52         }
53         var size int
54         size += 4 // m.SwIfIndex
55         size += 1 // m.IsIPv6
56         size += 1 // m.Enable
57         return size
58 }
59 func (m *SwInterfaceSetVxlanGpeBypass) Marshal(b []byte) ([]byte, error) {
60         var buf *codec.Buffer
61         if b == nil {
62                 buf = codec.NewBuffer(make([]byte, m.Size()))
63         } else {
64                 buf = codec.NewBuffer(b)
65         }
66         buf.EncodeUint32(uint32(m.SwIfIndex))
67         buf.EncodeBool(m.IsIPv6)
68         buf.EncodeBool(m.Enable)
69         return buf.Bytes(), nil
70 }
71 func (m *SwInterfaceSetVxlanGpeBypass) Unmarshal(b []byte) error {
72         buf := codec.NewBuffer(b)
73         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
74         m.IsIPv6 = buf.DecodeBool()
75         m.Enable = buf.DecodeBool()
76         return nil
77 }
78
79 // SwInterfaceSetVxlanGpeBypassReply defines message 'sw_interface_set_vxlan_gpe_bypass_reply'.
80 type SwInterfaceSetVxlanGpeBypassReply struct {
81         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
82 }
83
84 func (m *SwInterfaceSetVxlanGpeBypassReply) Reset() { *m = SwInterfaceSetVxlanGpeBypassReply{} }
85 func (*SwInterfaceSetVxlanGpeBypassReply) GetMessageName() string {
86         return "sw_interface_set_vxlan_gpe_bypass_reply"
87 }
88 func (*SwInterfaceSetVxlanGpeBypassReply) GetCrcString() string { return "e8d4e804" }
89 func (*SwInterfaceSetVxlanGpeBypassReply) GetMessageType() api.MessageType {
90         return api.ReplyMessage
91 }
92
93 func (m *SwInterfaceSetVxlanGpeBypassReply) Size() int {
94         if m == nil {
95                 return 0
96         }
97         var size int
98         size += 4 // m.Retval
99         return size
100 }
101 func (m *SwInterfaceSetVxlanGpeBypassReply) Marshal(b []byte) ([]byte, error) {
102         var buf *codec.Buffer
103         if b == nil {
104                 buf = codec.NewBuffer(make([]byte, m.Size()))
105         } else {
106                 buf = codec.NewBuffer(b)
107         }
108         buf.EncodeUint32(uint32(m.Retval))
109         return buf.Bytes(), nil
110 }
111 func (m *SwInterfaceSetVxlanGpeBypassReply) Unmarshal(b []byte) error {
112         buf := codec.NewBuffer(b)
113         m.Retval = int32(buf.DecodeUint32())
114         return nil
115 }
116
117 // VxlanGpeAddDelTunnel defines message 'vxlan_gpe_add_del_tunnel'.
118 type VxlanGpeAddDelTunnel struct {
119         Local          ip_types.Address               `binapi:"address,name=local" json:"local,omitempty"`
120         Remote         ip_types.Address               `binapi:"address,name=remote" json:"remote,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         DecapVrfID     uint32                         `binapi:"u32,name=decap_vrf_id" json:"decap_vrf_id,omitempty"`
124         Protocol       ip_types.IPProto               `binapi:"ip_proto,name=protocol" json:"protocol,omitempty"`
125         Vni            uint32                         `binapi:"u32,name=vni" json:"vni,omitempty"`
126         IsAdd          bool                           `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
127 }
128
129 func (m *VxlanGpeAddDelTunnel) Reset()               { *m = VxlanGpeAddDelTunnel{} }
130 func (*VxlanGpeAddDelTunnel) GetMessageName() string { return "vxlan_gpe_add_del_tunnel" }
131 func (*VxlanGpeAddDelTunnel) GetCrcString() string   { return "7c6da6ae" }
132 func (*VxlanGpeAddDelTunnel) GetMessageType() api.MessageType {
133         return api.RequestMessage
134 }
135
136 func (m *VxlanGpeAddDelTunnel) Size() int {
137         if m == nil {
138                 return 0
139         }
140         var size int
141         size += 1      // m.Local.Af
142         size += 1 * 16 // m.Local.Un
143         size += 1      // m.Remote.Af
144         size += 1 * 16 // m.Remote.Un
145         size += 4      // m.McastSwIfIndex
146         size += 4      // m.EncapVrfID
147         size += 4      // m.DecapVrfID
148         size += 1      // m.Protocol
149         size += 4      // m.Vni
150         size += 1      // m.IsAdd
151         return size
152 }
153 func (m *VxlanGpeAddDelTunnel) Marshal(b []byte) ([]byte, error) {
154         var buf *codec.Buffer
155         if b == nil {
156                 buf = codec.NewBuffer(make([]byte, m.Size()))
157         } else {
158                 buf = codec.NewBuffer(b)
159         }
160         buf.EncodeUint8(uint8(m.Local.Af))
161         buf.EncodeBytes(m.Local.Un.XXX_UnionData[:], 0)
162         buf.EncodeUint8(uint8(m.Remote.Af))
163         buf.EncodeBytes(m.Remote.Un.XXX_UnionData[:], 0)
164         buf.EncodeUint32(uint32(m.McastSwIfIndex))
165         buf.EncodeUint32(uint32(m.EncapVrfID))
166         buf.EncodeUint32(uint32(m.DecapVrfID))
167         buf.EncodeUint8(uint8(m.Protocol))
168         buf.EncodeUint32(uint32(m.Vni))
169         buf.EncodeBool(m.IsAdd)
170         return buf.Bytes(), nil
171 }
172 func (m *VxlanGpeAddDelTunnel) Unmarshal(b []byte) error {
173         buf := codec.NewBuffer(b)
174         m.Local.Af = ip_types.AddressFamily(buf.DecodeUint8())
175         copy(m.Local.Un.XXX_UnionData[:], buf.DecodeBytes(16))
176         m.Remote.Af = ip_types.AddressFamily(buf.DecodeUint8())
177         copy(m.Remote.Un.XXX_UnionData[:], buf.DecodeBytes(16))
178         m.McastSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
179         m.EncapVrfID = buf.DecodeUint32()
180         m.DecapVrfID = buf.DecodeUint32()
181         m.Protocol = ip_types.IPProto(buf.DecodeUint8())
182         m.Vni = buf.DecodeUint32()
183         m.IsAdd = buf.DecodeBool()
184         return nil
185 }
186
187 // VxlanGpeAddDelTunnelReply defines message 'vxlan_gpe_add_del_tunnel_reply'.
188 type VxlanGpeAddDelTunnelReply struct {
189         Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
190         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
191 }
192
193 func (m *VxlanGpeAddDelTunnelReply) Reset()               { *m = VxlanGpeAddDelTunnelReply{} }
194 func (*VxlanGpeAddDelTunnelReply) GetMessageName() string { return "vxlan_gpe_add_del_tunnel_reply" }
195 func (*VxlanGpeAddDelTunnelReply) GetCrcString() string   { return "5383d31f" }
196 func (*VxlanGpeAddDelTunnelReply) GetMessageType() api.MessageType {
197         return api.ReplyMessage
198 }
199
200 func (m *VxlanGpeAddDelTunnelReply) Size() int {
201         if m == nil {
202                 return 0
203         }
204         var size int
205         size += 4 // m.Retval
206         size += 4 // m.SwIfIndex
207         return size
208 }
209 func (m *VxlanGpeAddDelTunnelReply) Marshal(b []byte) ([]byte, error) {
210         var buf *codec.Buffer
211         if b == nil {
212                 buf = codec.NewBuffer(make([]byte, m.Size()))
213         } else {
214                 buf = codec.NewBuffer(b)
215         }
216         buf.EncodeUint32(uint32(m.Retval))
217         buf.EncodeUint32(uint32(m.SwIfIndex))
218         return buf.Bytes(), nil
219 }
220 func (m *VxlanGpeAddDelTunnelReply) Unmarshal(b []byte) error {
221         buf := codec.NewBuffer(b)
222         m.Retval = int32(buf.DecodeUint32())
223         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
224         return nil
225 }
226
227 // VxlanGpeTunnelDetails defines message 'vxlan_gpe_tunnel_details'.
228 type VxlanGpeTunnelDetails struct {
229         SwIfIndex      interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
230         Local          ip_types.Address               `binapi:"address,name=local" json:"local,omitempty"`
231         Remote         ip_types.Address               `binapi:"address,name=remote" json:"remote,omitempty"`
232         Vni            uint32                         `binapi:"u32,name=vni" json:"vni,omitempty"`
233         Protocol       ip_types.IPProto               `binapi:"ip_proto,name=protocol" json:"protocol,omitempty"`
234         McastSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=mcast_sw_if_index" json:"mcast_sw_if_index,omitempty"`
235         EncapVrfID     uint32                         `binapi:"u32,name=encap_vrf_id" json:"encap_vrf_id,omitempty"`
236         DecapVrfID     uint32                         `binapi:"u32,name=decap_vrf_id" json:"decap_vrf_id,omitempty"`
237         IsIPv6         bool                           `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
238 }
239
240 func (m *VxlanGpeTunnelDetails) Reset()               { *m = VxlanGpeTunnelDetails{} }
241 func (*VxlanGpeTunnelDetails) GetMessageName() string { return "vxlan_gpe_tunnel_details" }
242 func (*VxlanGpeTunnelDetails) GetCrcString() string   { return "57712346" }
243 func (*VxlanGpeTunnelDetails) GetMessageType() api.MessageType {
244         return api.ReplyMessage
245 }
246
247 func (m *VxlanGpeTunnelDetails) Size() int {
248         if m == nil {
249                 return 0
250         }
251         var size int
252         size += 4      // m.SwIfIndex
253         size += 1      // m.Local.Af
254         size += 1 * 16 // m.Local.Un
255         size += 1      // m.Remote.Af
256         size += 1 * 16 // m.Remote.Un
257         size += 4      // m.Vni
258         size += 1      // m.Protocol
259         size += 4      // m.McastSwIfIndex
260         size += 4      // m.EncapVrfID
261         size += 4      // m.DecapVrfID
262         size += 1      // m.IsIPv6
263         return size
264 }
265 func (m *VxlanGpeTunnelDetails) Marshal(b []byte) ([]byte, error) {
266         var buf *codec.Buffer
267         if b == nil {
268                 buf = codec.NewBuffer(make([]byte, m.Size()))
269         } else {
270                 buf = codec.NewBuffer(b)
271         }
272         buf.EncodeUint32(uint32(m.SwIfIndex))
273         buf.EncodeUint8(uint8(m.Local.Af))
274         buf.EncodeBytes(m.Local.Un.XXX_UnionData[:], 0)
275         buf.EncodeUint8(uint8(m.Remote.Af))
276         buf.EncodeBytes(m.Remote.Un.XXX_UnionData[:], 0)
277         buf.EncodeUint32(uint32(m.Vni))
278         buf.EncodeUint8(uint8(m.Protocol))
279         buf.EncodeUint32(uint32(m.McastSwIfIndex))
280         buf.EncodeUint32(uint32(m.EncapVrfID))
281         buf.EncodeUint32(uint32(m.DecapVrfID))
282         buf.EncodeBool(m.IsIPv6)
283         return buf.Bytes(), nil
284 }
285 func (m *VxlanGpeTunnelDetails) Unmarshal(b []byte) error {
286         buf := codec.NewBuffer(b)
287         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
288         m.Local.Af = ip_types.AddressFamily(buf.DecodeUint8())
289         copy(m.Local.Un.XXX_UnionData[:], buf.DecodeBytes(16))
290         m.Remote.Af = ip_types.AddressFamily(buf.DecodeUint8())
291         copy(m.Remote.Un.XXX_UnionData[:], buf.DecodeBytes(16))
292         m.Vni = buf.DecodeUint32()
293         m.Protocol = ip_types.IPProto(buf.DecodeUint8())
294         m.McastSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
295         m.EncapVrfID = buf.DecodeUint32()
296         m.DecapVrfID = buf.DecodeUint32()
297         m.IsIPv6 = buf.DecodeBool()
298         return nil
299 }
300
301 // VxlanGpeTunnelDump defines message 'vxlan_gpe_tunnel_dump'.
302 type VxlanGpeTunnelDump struct {
303         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
304 }
305
306 func (m *VxlanGpeTunnelDump) Reset()               { *m = VxlanGpeTunnelDump{} }
307 func (*VxlanGpeTunnelDump) GetMessageName() string { return "vxlan_gpe_tunnel_dump" }
308 func (*VxlanGpeTunnelDump) GetCrcString() string   { return "f9e6675e" }
309 func (*VxlanGpeTunnelDump) GetMessageType() api.MessageType {
310         return api.RequestMessage
311 }
312
313 func (m *VxlanGpeTunnelDump) Size() int {
314         if m == nil {
315                 return 0
316         }
317         var size int
318         size += 4 // m.SwIfIndex
319         return size
320 }
321 func (m *VxlanGpeTunnelDump) Marshal(b []byte) ([]byte, error) {
322         var buf *codec.Buffer
323         if b == nil {
324                 buf = codec.NewBuffer(make([]byte, m.Size()))
325         } else {
326                 buf = codec.NewBuffer(b)
327         }
328         buf.EncodeUint32(uint32(m.SwIfIndex))
329         return buf.Bytes(), nil
330 }
331 func (m *VxlanGpeTunnelDump) Unmarshal(b []byte) error {
332         buf := codec.NewBuffer(b)
333         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
334         return nil
335 }
336
337 func init() { file_vxlan_gpe_binapi_init() }
338 func file_vxlan_gpe_binapi_init() {
339         api.RegisterMessage((*SwInterfaceSetVxlanGpeBypass)(nil), "sw_interface_set_vxlan_gpe_bypass_65247409")
340         api.RegisterMessage((*SwInterfaceSetVxlanGpeBypassReply)(nil), "sw_interface_set_vxlan_gpe_bypass_reply_e8d4e804")
341         api.RegisterMessage((*VxlanGpeAddDelTunnel)(nil), "vxlan_gpe_add_del_tunnel_7c6da6ae")
342         api.RegisterMessage((*VxlanGpeAddDelTunnelReply)(nil), "vxlan_gpe_add_del_tunnel_reply_5383d31f")
343         api.RegisterMessage((*VxlanGpeTunnelDetails)(nil), "vxlan_gpe_tunnel_details_57712346")
344         api.RegisterMessage((*VxlanGpeTunnelDump)(nil), "vxlan_gpe_tunnel_dump_f9e6675e")
345 }
346
347 // Messages returns list of all messages in this module.
348 func AllMessages() []api.Message {
349         return []api.Message{
350                 (*SwInterfaceSetVxlanGpeBypass)(nil),
351                 (*SwInterfaceSetVxlanGpeBypassReply)(nil),
352                 (*VxlanGpeAddDelTunnel)(nil),
353                 (*VxlanGpeAddDelTunnelReply)(nil),
354                 (*VxlanGpeTunnelDetails)(nil),
355                 (*VxlanGpeTunnelDump)(nil),
356         }
357 }