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