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