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