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