0a059158d098f054a274b44cf53cdf667d19d8db
[govpp.git] / binapi / l3xc / l3xc.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 l3xc contains generated bindings for API file l3xc.api.
7 //
8 // Contents:
9 //   1 struct
10 //   8 messages
11 //
12 package l3xc
13
14 import (
15         api "git.fd.io/govpp.git/api"
16         fib_types "git.fd.io/govpp.git/binapi/fib_types"
17         interface_types "git.fd.io/govpp.git/binapi/interface_types"
18         _ "git.fd.io/govpp.git/binapi/ip_types"
19         codec "git.fd.io/govpp.git/codec"
20 )
21
22 // This is a compile-time assertion to ensure that this generated file
23 // is compatible with the GoVPP api package it is being compiled against.
24 // A compilation error at this line likely means your copy of the
25 // GoVPP api package needs to be updated.
26 const _ = api.GoVppAPIPackageIsVersion2
27
28 const (
29         APIFile    = "l3xc"
30         APIVersion = "1.0.1"
31         VersionCrc = 0xaf18effb
32 )
33
34 // L3xc defines type 'l3xc'.
35 type L3xc struct {
36         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
37         IsIP6     bool                           `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"`
38         NPaths    uint8                          `binapi:"u8,name=n_paths" json:"-"`
39         Paths     []fib_types.FibPath            `binapi:"fib_path[n_paths],name=paths" json:"paths,omitempty"`
40 }
41
42 // L3xcDel defines message 'l3xc_del'.
43 type L3xcDel struct {
44         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
45         IsIP6     bool                           `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"`
46 }
47
48 func (m *L3xcDel) Reset()               { *m = L3xcDel{} }
49 func (*L3xcDel) GetMessageName() string { return "l3xc_del" }
50 func (*L3xcDel) GetCrcString() string   { return "e7dbef91" }
51 func (*L3xcDel) GetMessageType() api.MessageType {
52         return api.RequestMessage
53 }
54
55 func (m *L3xcDel) Size() (size int) {
56         if m == nil {
57                 return 0
58         }
59         size += 4 // m.SwIfIndex
60         size += 1 // m.IsIP6
61         return size
62 }
63 func (m *L3xcDel) Marshal(b []byte) ([]byte, error) {
64         if b == nil {
65                 b = make([]byte, m.Size())
66         }
67         buf := codec.NewBuffer(b)
68         buf.EncodeUint32(uint32(m.SwIfIndex))
69         buf.EncodeBool(m.IsIP6)
70         return buf.Bytes(), nil
71 }
72 func (m *L3xcDel) Unmarshal(b []byte) error {
73         buf := codec.NewBuffer(b)
74         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
75         m.IsIP6 = buf.DecodeBool()
76         return nil
77 }
78
79 // L3xcDelReply defines message 'l3xc_del_reply'.
80 type L3xcDelReply struct {
81         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
82 }
83
84 func (m *L3xcDelReply) Reset()               { *m = L3xcDelReply{} }
85 func (*L3xcDelReply) GetMessageName() string { return "l3xc_del_reply" }
86 func (*L3xcDelReply) GetCrcString() string   { return "e8d4e804" }
87 func (*L3xcDelReply) GetMessageType() api.MessageType {
88         return api.ReplyMessage
89 }
90
91 func (m *L3xcDelReply) Size() (size int) {
92         if m == nil {
93                 return 0
94         }
95         size += 4 // m.Retval
96         return size
97 }
98 func (m *L3xcDelReply) Marshal(b []byte) ([]byte, error) {
99         if b == nil {
100                 b = make([]byte, m.Size())
101         }
102         buf := codec.NewBuffer(b)
103         buf.EncodeInt32(m.Retval)
104         return buf.Bytes(), nil
105 }
106 func (m *L3xcDelReply) Unmarshal(b []byte) error {
107         buf := codec.NewBuffer(b)
108         m.Retval = buf.DecodeInt32()
109         return nil
110 }
111
112 // L3xcDetails defines message 'l3xc_details'.
113 type L3xcDetails struct {
114         L3xc L3xc `binapi:"l3xc,name=l3xc" json:"l3xc,omitempty"`
115 }
116
117 func (m *L3xcDetails) Reset()               { *m = L3xcDetails{} }
118 func (*L3xcDetails) GetMessageName() string { return "l3xc_details" }
119 func (*L3xcDetails) GetCrcString() string   { return "d4f69627" }
120 func (*L3xcDetails) GetMessageType() api.MessageType {
121         return api.ReplyMessage
122 }
123
124 func (m *L3xcDetails) Size() (size int) {
125         if m == nil {
126                 return 0
127         }
128         size += 4 // m.L3xc.SwIfIndex
129         size += 1 // m.L3xc.IsIP6
130         size += 1 // m.L3xc.NPaths
131         for j2 := 0; j2 < len(m.L3xc.Paths); j2++ {
132                 var s2 fib_types.FibPath
133                 _ = s2
134                 if j2 < len(m.L3xc.Paths) {
135                         s2 = m.L3xc.Paths[j2]
136                 }
137                 size += 4      // s2.SwIfIndex
138                 size += 4      // s2.TableID
139                 size += 4      // s2.RpfID
140                 size += 1      // s2.Weight
141                 size += 1      // s2.Preference
142                 size += 4      // s2.Type
143                 size += 4      // s2.Flags
144                 size += 4      // s2.Proto
145                 size += 1 * 16 // s2.Nh.Address
146                 size += 4      // s2.Nh.ViaLabel
147                 size += 4      // s2.Nh.ObjID
148                 size += 4      // s2.Nh.ClassifyTableIndex
149                 size += 1      // s2.NLabels
150                 for j3 := 0; j3 < 16; j3++ {
151                         size += 1 // s2.LabelStack[j3].IsUniform
152                         size += 4 // s2.LabelStack[j3].Label
153                         size += 1 // s2.LabelStack[j3].TTL
154                         size += 1 // s2.LabelStack[j3].Exp
155                 }
156         }
157         return size
158 }
159 func (m *L3xcDetails) Marshal(b []byte) ([]byte, error) {
160         if b == nil {
161                 b = make([]byte, m.Size())
162         }
163         buf := codec.NewBuffer(b)
164         buf.EncodeUint32(uint32(m.L3xc.SwIfIndex))
165         buf.EncodeBool(m.L3xc.IsIP6)
166         buf.EncodeUint8(uint8(len(m.L3xc.Paths)))
167         for j1 := 0; j1 < len(m.L3xc.Paths); j1++ {
168                 var v1 fib_types.FibPath // Paths
169                 if j1 < len(m.L3xc.Paths) {
170                         v1 = m.L3xc.Paths[j1]
171                 }
172                 buf.EncodeUint32(v1.SwIfIndex)
173                 buf.EncodeUint32(v1.TableID)
174                 buf.EncodeUint32(v1.RpfID)
175                 buf.EncodeUint8(v1.Weight)
176                 buf.EncodeUint8(v1.Preference)
177                 buf.EncodeUint32(uint32(v1.Type))
178                 buf.EncodeUint32(uint32(v1.Flags))
179                 buf.EncodeUint32(uint32(v1.Proto))
180                 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16)
181                 buf.EncodeUint32(v1.Nh.ViaLabel)
182                 buf.EncodeUint32(v1.Nh.ObjID)
183                 buf.EncodeUint32(v1.Nh.ClassifyTableIndex)
184                 buf.EncodeUint8(v1.NLabels)
185                 for j2 := 0; j2 < 16; j2++ {
186                         buf.EncodeUint8(v1.LabelStack[j2].IsUniform)
187                         buf.EncodeUint32(v1.LabelStack[j2].Label)
188                         buf.EncodeUint8(v1.LabelStack[j2].TTL)
189                         buf.EncodeUint8(v1.LabelStack[j2].Exp)
190                 }
191         }
192         return buf.Bytes(), nil
193 }
194 func (m *L3xcDetails) Unmarshal(b []byte) error {
195         buf := codec.NewBuffer(b)
196         m.L3xc.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
197         m.L3xc.IsIP6 = buf.DecodeBool()
198         m.L3xc.NPaths = buf.DecodeUint8()
199         m.L3xc.Paths = make([]fib_types.FibPath, m.L3xc.NPaths)
200         for j1 := 0; j1 < len(m.L3xc.Paths); j1++ {
201                 m.L3xc.Paths[j1].SwIfIndex = buf.DecodeUint32()
202                 m.L3xc.Paths[j1].TableID = buf.DecodeUint32()
203                 m.L3xc.Paths[j1].RpfID = buf.DecodeUint32()
204                 m.L3xc.Paths[j1].Weight = buf.DecodeUint8()
205                 m.L3xc.Paths[j1].Preference = buf.DecodeUint8()
206                 m.L3xc.Paths[j1].Type = fib_types.FibPathType(buf.DecodeUint32())
207                 m.L3xc.Paths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32())
208                 m.L3xc.Paths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32())
209                 copy(m.L3xc.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
210                 m.L3xc.Paths[j1].Nh.ViaLabel = buf.DecodeUint32()
211                 m.L3xc.Paths[j1].Nh.ObjID = buf.DecodeUint32()
212                 m.L3xc.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
213                 m.L3xc.Paths[j1].NLabels = buf.DecodeUint8()
214                 for j2 := 0; j2 < 16; j2++ {
215                         m.L3xc.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
216                         m.L3xc.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32()
217                         m.L3xc.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
218                         m.L3xc.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
219                 }
220         }
221         return nil
222 }
223
224 // L3xcDump defines message 'l3xc_dump'.
225 type L3xcDump struct {
226         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
227 }
228
229 func (m *L3xcDump) Reset()               { *m = L3xcDump{} }
230 func (*L3xcDump) GetMessageName() string { return "l3xc_dump" }
231 func (*L3xcDump) GetCrcString() string   { return "f9e6675e" }
232 func (*L3xcDump) GetMessageType() api.MessageType {
233         return api.RequestMessage
234 }
235
236 func (m *L3xcDump) Size() (size int) {
237         if m == nil {
238                 return 0
239         }
240         size += 4 // m.SwIfIndex
241         return size
242 }
243 func (m *L3xcDump) Marshal(b []byte) ([]byte, error) {
244         if b == nil {
245                 b = make([]byte, m.Size())
246         }
247         buf := codec.NewBuffer(b)
248         buf.EncodeUint32(uint32(m.SwIfIndex))
249         return buf.Bytes(), nil
250 }
251 func (m *L3xcDump) Unmarshal(b []byte) error {
252         buf := codec.NewBuffer(b)
253         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
254         return nil
255 }
256
257 // L3xcPluginGetVersion defines message 'l3xc_plugin_get_version'.
258 type L3xcPluginGetVersion struct{}
259
260 func (m *L3xcPluginGetVersion) Reset()               { *m = L3xcPluginGetVersion{} }
261 func (*L3xcPluginGetVersion) GetMessageName() string { return "l3xc_plugin_get_version" }
262 func (*L3xcPluginGetVersion) GetCrcString() string   { return "51077d14" }
263 func (*L3xcPluginGetVersion) GetMessageType() api.MessageType {
264         return api.RequestMessage
265 }
266
267 func (m *L3xcPluginGetVersion) Size() (size int) {
268         if m == nil {
269                 return 0
270         }
271         return size
272 }
273 func (m *L3xcPluginGetVersion) Marshal(b []byte) ([]byte, error) {
274         if b == nil {
275                 b = make([]byte, m.Size())
276         }
277         buf := codec.NewBuffer(b)
278         return buf.Bytes(), nil
279 }
280 func (m *L3xcPluginGetVersion) Unmarshal(b []byte) error {
281         return nil
282 }
283
284 // L3xcPluginGetVersionReply defines message 'l3xc_plugin_get_version_reply'.
285 type L3xcPluginGetVersionReply struct {
286         Major uint32 `binapi:"u32,name=major" json:"major,omitempty"`
287         Minor uint32 `binapi:"u32,name=minor" json:"minor,omitempty"`
288 }
289
290 func (m *L3xcPluginGetVersionReply) Reset()               { *m = L3xcPluginGetVersionReply{} }
291 func (*L3xcPluginGetVersionReply) GetMessageName() string { return "l3xc_plugin_get_version_reply" }
292 func (*L3xcPluginGetVersionReply) GetCrcString() string   { return "9b32cf86" }
293 func (*L3xcPluginGetVersionReply) GetMessageType() api.MessageType {
294         return api.ReplyMessage
295 }
296
297 func (m *L3xcPluginGetVersionReply) Size() (size int) {
298         if m == nil {
299                 return 0
300         }
301         size += 4 // m.Major
302         size += 4 // m.Minor
303         return size
304 }
305 func (m *L3xcPluginGetVersionReply) Marshal(b []byte) ([]byte, error) {
306         if b == nil {
307                 b = make([]byte, m.Size())
308         }
309         buf := codec.NewBuffer(b)
310         buf.EncodeUint32(m.Major)
311         buf.EncodeUint32(m.Minor)
312         return buf.Bytes(), nil
313 }
314 func (m *L3xcPluginGetVersionReply) Unmarshal(b []byte) error {
315         buf := codec.NewBuffer(b)
316         m.Major = buf.DecodeUint32()
317         m.Minor = buf.DecodeUint32()
318         return nil
319 }
320
321 // L3xcUpdate defines message 'l3xc_update'.
322 type L3xcUpdate struct {
323         L3xc L3xc `binapi:"l3xc,name=l3xc" json:"l3xc,omitempty"`
324 }
325
326 func (m *L3xcUpdate) Reset()               { *m = L3xcUpdate{} }
327 func (*L3xcUpdate) GetMessageName() string { return "l3xc_update" }
328 func (*L3xcUpdate) GetCrcString() string   { return "0787b1d3" }
329 func (*L3xcUpdate) GetMessageType() api.MessageType {
330         return api.RequestMessage
331 }
332
333 func (m *L3xcUpdate) Size() (size int) {
334         if m == nil {
335                 return 0
336         }
337         size += 4 // m.L3xc.SwIfIndex
338         size += 1 // m.L3xc.IsIP6
339         size += 1 // m.L3xc.NPaths
340         for j2 := 0; j2 < len(m.L3xc.Paths); j2++ {
341                 var s2 fib_types.FibPath
342                 _ = s2
343                 if j2 < len(m.L3xc.Paths) {
344                         s2 = m.L3xc.Paths[j2]
345                 }
346                 size += 4      // s2.SwIfIndex
347                 size += 4      // s2.TableID
348                 size += 4      // s2.RpfID
349                 size += 1      // s2.Weight
350                 size += 1      // s2.Preference
351                 size += 4      // s2.Type
352                 size += 4      // s2.Flags
353                 size += 4      // s2.Proto
354                 size += 1 * 16 // s2.Nh.Address
355                 size += 4      // s2.Nh.ViaLabel
356                 size += 4      // s2.Nh.ObjID
357                 size += 4      // s2.Nh.ClassifyTableIndex
358                 size += 1      // s2.NLabels
359                 for j3 := 0; j3 < 16; j3++ {
360                         size += 1 // s2.LabelStack[j3].IsUniform
361                         size += 4 // s2.LabelStack[j3].Label
362                         size += 1 // s2.LabelStack[j3].TTL
363                         size += 1 // s2.LabelStack[j3].Exp
364                 }
365         }
366         return size
367 }
368 func (m *L3xcUpdate) Marshal(b []byte) ([]byte, error) {
369         if b == nil {
370                 b = make([]byte, m.Size())
371         }
372         buf := codec.NewBuffer(b)
373         buf.EncodeUint32(uint32(m.L3xc.SwIfIndex))
374         buf.EncodeBool(m.L3xc.IsIP6)
375         buf.EncodeUint8(uint8(len(m.L3xc.Paths)))
376         for j1 := 0; j1 < len(m.L3xc.Paths); j1++ {
377                 var v1 fib_types.FibPath // Paths
378                 if j1 < len(m.L3xc.Paths) {
379                         v1 = m.L3xc.Paths[j1]
380                 }
381                 buf.EncodeUint32(v1.SwIfIndex)
382                 buf.EncodeUint32(v1.TableID)
383                 buf.EncodeUint32(v1.RpfID)
384                 buf.EncodeUint8(v1.Weight)
385                 buf.EncodeUint8(v1.Preference)
386                 buf.EncodeUint32(uint32(v1.Type))
387                 buf.EncodeUint32(uint32(v1.Flags))
388                 buf.EncodeUint32(uint32(v1.Proto))
389                 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16)
390                 buf.EncodeUint32(v1.Nh.ViaLabel)
391                 buf.EncodeUint32(v1.Nh.ObjID)
392                 buf.EncodeUint32(v1.Nh.ClassifyTableIndex)
393                 buf.EncodeUint8(v1.NLabels)
394                 for j2 := 0; j2 < 16; j2++ {
395                         buf.EncodeUint8(v1.LabelStack[j2].IsUniform)
396                         buf.EncodeUint32(v1.LabelStack[j2].Label)
397                         buf.EncodeUint8(v1.LabelStack[j2].TTL)
398                         buf.EncodeUint8(v1.LabelStack[j2].Exp)
399                 }
400         }
401         return buf.Bytes(), nil
402 }
403 func (m *L3xcUpdate) Unmarshal(b []byte) error {
404         buf := codec.NewBuffer(b)
405         m.L3xc.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
406         m.L3xc.IsIP6 = buf.DecodeBool()
407         m.L3xc.NPaths = buf.DecodeUint8()
408         m.L3xc.Paths = make([]fib_types.FibPath, m.L3xc.NPaths)
409         for j1 := 0; j1 < len(m.L3xc.Paths); j1++ {
410                 m.L3xc.Paths[j1].SwIfIndex = buf.DecodeUint32()
411                 m.L3xc.Paths[j1].TableID = buf.DecodeUint32()
412                 m.L3xc.Paths[j1].RpfID = buf.DecodeUint32()
413                 m.L3xc.Paths[j1].Weight = buf.DecodeUint8()
414                 m.L3xc.Paths[j1].Preference = buf.DecodeUint8()
415                 m.L3xc.Paths[j1].Type = fib_types.FibPathType(buf.DecodeUint32())
416                 m.L3xc.Paths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32())
417                 m.L3xc.Paths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32())
418                 copy(m.L3xc.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
419                 m.L3xc.Paths[j1].Nh.ViaLabel = buf.DecodeUint32()
420                 m.L3xc.Paths[j1].Nh.ObjID = buf.DecodeUint32()
421                 m.L3xc.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
422                 m.L3xc.Paths[j1].NLabels = buf.DecodeUint8()
423                 for j2 := 0; j2 < 16; j2++ {
424                         m.L3xc.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
425                         m.L3xc.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32()
426                         m.L3xc.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
427                         m.L3xc.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
428                 }
429         }
430         return nil
431 }
432
433 // L3xcUpdateReply defines message 'l3xc_update_reply'.
434 type L3xcUpdateReply struct {
435         Retval     int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
436         StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"`
437 }
438
439 func (m *L3xcUpdateReply) Reset()               { *m = L3xcUpdateReply{} }
440 func (*L3xcUpdateReply) GetMessageName() string { return "l3xc_update_reply" }
441 func (*L3xcUpdateReply) GetCrcString() string   { return "1992deab" }
442 func (*L3xcUpdateReply) GetMessageType() api.MessageType {
443         return api.ReplyMessage
444 }
445
446 func (m *L3xcUpdateReply) Size() (size int) {
447         if m == nil {
448                 return 0
449         }
450         size += 4 // m.Retval
451         size += 4 // m.StatsIndex
452         return size
453 }
454 func (m *L3xcUpdateReply) Marshal(b []byte) ([]byte, error) {
455         if b == nil {
456                 b = make([]byte, m.Size())
457         }
458         buf := codec.NewBuffer(b)
459         buf.EncodeInt32(m.Retval)
460         buf.EncodeUint32(m.StatsIndex)
461         return buf.Bytes(), nil
462 }
463 func (m *L3xcUpdateReply) Unmarshal(b []byte) error {
464         buf := codec.NewBuffer(b)
465         m.Retval = buf.DecodeInt32()
466         m.StatsIndex = buf.DecodeUint32()
467         return nil
468 }
469
470 func init() { file_l3xc_binapi_init() }
471 func file_l3xc_binapi_init() {
472         api.RegisterMessage((*L3xcDel)(nil), "l3xc_del_e7dbef91")
473         api.RegisterMessage((*L3xcDelReply)(nil), "l3xc_del_reply_e8d4e804")
474         api.RegisterMessage((*L3xcDetails)(nil), "l3xc_details_d4f69627")
475         api.RegisterMessage((*L3xcDump)(nil), "l3xc_dump_f9e6675e")
476         api.RegisterMessage((*L3xcPluginGetVersion)(nil), "l3xc_plugin_get_version_51077d14")
477         api.RegisterMessage((*L3xcPluginGetVersionReply)(nil), "l3xc_plugin_get_version_reply_9b32cf86")
478         api.RegisterMessage((*L3xcUpdate)(nil), "l3xc_update_0787b1d3")
479         api.RegisterMessage((*L3xcUpdateReply)(nil), "l3xc_update_reply_1992deab")
480 }
481
482 // Messages returns list of all messages in this module.
483 func AllMessages() []api.Message {
484         return []api.Message{
485                 (*L3xcDel)(nil),
486                 (*L3xcDelReply)(nil),
487                 (*L3xcDetails)(nil),
488                 (*L3xcDump)(nil),
489                 (*L3xcPluginGetVersion)(nil),
490                 (*L3xcPluginGetVersionReply)(nil),
491                 (*L3xcUpdate)(nil),
492                 (*L3xcUpdateReply)(nil),
493         }
494 }