Improve binapi generator
[govpp.git] / binapi / mpls / mpls.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/mpls.api.json
6
7 // Package mpls contains generated bindings for API file mpls.api.
8 //
9 // Contents:
10 //   3 structs
11 //  16 messages
12 //
13 package mpls
14
15 import (
16         api "git.fd.io/govpp.git/api"
17         fib_types "git.fd.io/govpp.git/binapi/fib_types"
18         interface_types "git.fd.io/govpp.git/binapi/interface_types"
19         ip_types "git.fd.io/govpp.git/binapi/ip_types"
20         codec "git.fd.io/govpp.git/codec"
21 )
22
23 // This is a compile-time assertion to ensure that this generated file
24 // is compatible with the GoVPP api package it is being compiled against.
25 // A compilation error at this line likely means your copy of the
26 // GoVPP api package needs to be updated.
27 const _ = api.GoVppAPIPackageIsVersion2
28
29 const (
30         APIFile    = "mpls"
31         APIVersion = "1.1.1"
32         VersionCrc = 0xd83a030f
33 )
34
35 // MplsRoute defines type 'mpls_route'.
36 type MplsRoute struct {
37         MrTableID     uint32              `binapi:"u32,name=mr_table_id" json:"mr_table_id,omitempty"`
38         MrLabel       uint32              `binapi:"u32,name=mr_label" json:"mr_label,omitempty"`
39         MrEos         uint8               `binapi:"u8,name=mr_eos" json:"mr_eos,omitempty"`
40         MrEosProto    uint8               `binapi:"u8,name=mr_eos_proto" json:"mr_eos_proto,omitempty"`
41         MrIsMulticast bool                `binapi:"bool,name=mr_is_multicast" json:"mr_is_multicast,omitempty"`
42         MrNPaths      uint8               `binapi:"u8,name=mr_n_paths" json:"-"`
43         MrPaths       []fib_types.FibPath `binapi:"fib_path[mr_n_paths],name=mr_paths" json:"mr_paths,omitempty"`
44 }
45
46 // MplsTable defines type 'mpls_table'.
47 type MplsTable struct {
48         MtTableID uint32 `binapi:"u32,name=mt_table_id" json:"mt_table_id,omitempty"`
49         MtName    string `binapi:"string[64],name=mt_name" json:"mt_name,omitempty"`
50 }
51
52 // MplsTunnel defines type 'mpls_tunnel'.
53 type MplsTunnel struct {
54         MtSwIfIndex   interface_types.InterfaceIndex `binapi:"interface_index,name=mt_sw_if_index" json:"mt_sw_if_index,omitempty"`
55         MtTunnelIndex uint32                         `binapi:"u32,name=mt_tunnel_index" json:"mt_tunnel_index,omitempty"`
56         MtL2Only      bool                           `binapi:"bool,name=mt_l2_only" json:"mt_l2_only,omitempty"`
57         MtIsMulticast bool                           `binapi:"bool,name=mt_is_multicast" json:"mt_is_multicast,omitempty"`
58         MtTag         string                         `binapi:"string[64],name=mt_tag" json:"mt_tag,omitempty"`
59         MtNPaths      uint8                          `binapi:"u8,name=mt_n_paths" json:"-"`
60         MtPaths       []fib_types.FibPath            `binapi:"fib_path[mt_n_paths],name=mt_paths" json:"mt_paths,omitempty"`
61 }
62
63 // MplsIPBindUnbind defines message 'mpls_ip_bind_unbind'.
64 type MplsIPBindUnbind struct {
65         MbMplsTableID uint32          `binapi:"u32,name=mb_mpls_table_id" json:"mb_mpls_table_id,omitempty"`
66         MbLabel       uint32          `binapi:"u32,name=mb_label" json:"mb_label,omitempty"`
67         MbIPTableID   uint32          `binapi:"u32,name=mb_ip_table_id" json:"mb_ip_table_id,omitempty"`
68         MbIsBind      bool            `binapi:"bool,name=mb_is_bind" json:"mb_is_bind,omitempty"`
69         MbPrefix      ip_types.Prefix `binapi:"prefix,name=mb_prefix" json:"mb_prefix,omitempty"`
70 }
71
72 func (m *MplsIPBindUnbind) Reset()               { *m = MplsIPBindUnbind{} }
73 func (*MplsIPBindUnbind) GetMessageName() string { return "mpls_ip_bind_unbind" }
74 func (*MplsIPBindUnbind) GetCrcString() string   { return "48249a27" }
75 func (*MplsIPBindUnbind) GetMessageType() api.MessageType {
76         return api.RequestMessage
77 }
78
79 func (m *MplsIPBindUnbind) Size() int {
80         if m == nil {
81                 return 0
82         }
83         var size int
84         size += 4      // m.MbMplsTableID
85         size += 4      // m.MbLabel
86         size += 4      // m.MbIPTableID
87         size += 1      // m.MbIsBind
88         size += 1      // m.MbPrefix.Address.Af
89         size += 1 * 16 // m.MbPrefix.Address.Un
90         size += 1      // m.MbPrefix.Len
91         return size
92 }
93 func (m *MplsIPBindUnbind) Marshal(b []byte) ([]byte, error) {
94         var buf *codec.Buffer
95         if b == nil {
96                 buf = codec.NewBuffer(make([]byte, m.Size()))
97         } else {
98                 buf = codec.NewBuffer(b)
99         }
100         buf.EncodeUint32(uint32(m.MbMplsTableID))
101         buf.EncodeUint32(uint32(m.MbLabel))
102         buf.EncodeUint32(uint32(m.MbIPTableID))
103         buf.EncodeBool(m.MbIsBind)
104         buf.EncodeUint8(uint8(m.MbPrefix.Address.Af))
105         buf.EncodeBytes(m.MbPrefix.Address.Un.XXX_UnionData[:], 0)
106         buf.EncodeUint8(uint8(m.MbPrefix.Len))
107         return buf.Bytes(), nil
108 }
109 func (m *MplsIPBindUnbind) Unmarshal(b []byte) error {
110         buf := codec.NewBuffer(b)
111         m.MbMplsTableID = buf.DecodeUint32()
112         m.MbLabel = buf.DecodeUint32()
113         m.MbIPTableID = buf.DecodeUint32()
114         m.MbIsBind = buf.DecodeBool()
115         m.MbPrefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
116         copy(m.MbPrefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
117         m.MbPrefix.Len = buf.DecodeUint8()
118         return nil
119 }
120
121 // MplsIPBindUnbindReply defines message 'mpls_ip_bind_unbind_reply'.
122 type MplsIPBindUnbindReply struct {
123         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
124 }
125
126 func (m *MplsIPBindUnbindReply) Reset()               { *m = MplsIPBindUnbindReply{} }
127 func (*MplsIPBindUnbindReply) GetMessageName() string { return "mpls_ip_bind_unbind_reply" }
128 func (*MplsIPBindUnbindReply) GetCrcString() string   { return "e8d4e804" }
129 func (*MplsIPBindUnbindReply) GetMessageType() api.MessageType {
130         return api.ReplyMessage
131 }
132
133 func (m *MplsIPBindUnbindReply) Size() int {
134         if m == nil {
135                 return 0
136         }
137         var size int
138         size += 4 // m.Retval
139         return size
140 }
141 func (m *MplsIPBindUnbindReply) Marshal(b []byte) ([]byte, error) {
142         var buf *codec.Buffer
143         if b == nil {
144                 buf = codec.NewBuffer(make([]byte, m.Size()))
145         } else {
146                 buf = codec.NewBuffer(b)
147         }
148         buf.EncodeUint32(uint32(m.Retval))
149         return buf.Bytes(), nil
150 }
151 func (m *MplsIPBindUnbindReply) Unmarshal(b []byte) error {
152         buf := codec.NewBuffer(b)
153         m.Retval = int32(buf.DecodeUint32())
154         return nil
155 }
156
157 // MplsRouteAddDel defines message 'mpls_route_add_del'.
158 type MplsRouteAddDel struct {
159         MrIsAdd       bool      `binapi:"bool,name=mr_is_add" json:"mr_is_add,omitempty"`
160         MrIsMultipath bool      `binapi:"bool,name=mr_is_multipath" json:"mr_is_multipath,omitempty"`
161         MrRoute       MplsRoute `binapi:"mpls_route,name=mr_route" json:"mr_route,omitempty"`
162 }
163
164 func (m *MplsRouteAddDel) Reset()               { *m = MplsRouteAddDel{} }
165 func (*MplsRouteAddDel) GetMessageName() string { return "mpls_route_add_del" }
166 func (*MplsRouteAddDel) GetCrcString() string   { return "343cff54" }
167 func (*MplsRouteAddDel) GetMessageType() api.MessageType {
168         return api.RequestMessage
169 }
170
171 func (m *MplsRouteAddDel) Size() int {
172         if m == nil {
173                 return 0
174         }
175         var size int
176         size += 1 // m.MrIsAdd
177         size += 1 // m.MrIsMultipath
178         size += 4 // m.MrRoute.MrTableID
179         size += 4 // m.MrRoute.MrLabel
180         size += 1 // m.MrRoute.MrEos
181         size += 1 // m.MrRoute.MrEosProto
182         size += 1 // m.MrRoute.MrIsMulticast
183         size += 1 // m.MrRoute.MrNPaths
184         for j2 := 0; j2 < len(m.MrRoute.MrPaths); j2++ {
185                 var s2 fib_types.FibPath
186                 _ = s2
187                 if j2 < len(m.MrRoute.MrPaths) {
188                         s2 = m.MrRoute.MrPaths[j2]
189                 }
190                 size += 4      // s2.SwIfIndex
191                 size += 4      // s2.TableID
192                 size += 4      // s2.RpfID
193                 size += 1      // s2.Weight
194                 size += 1      // s2.Preference
195                 size += 4      // s2.Type
196                 size += 4      // s2.Flags
197                 size += 4      // s2.Proto
198                 size += 1 * 16 // s2.Nh.Address
199                 size += 4      // s2.Nh.ViaLabel
200                 size += 4      // s2.Nh.ObjID
201                 size += 4      // s2.Nh.ClassifyTableIndex
202                 size += 1      // s2.NLabels
203                 for j3 := 0; j3 < 16; j3++ {
204                         var s3 fib_types.FibMplsLabel
205                         _ = s3
206                         if j3 < len(s2.LabelStack) {
207                                 s3 = s2.LabelStack[j3]
208                         }
209                         size += 1 // s3.IsUniform
210                         size += 4 // s3.Label
211                         size += 1 // s3.TTL
212                         size += 1 // s3.Exp
213                 }
214         }
215         return size
216 }
217 func (m *MplsRouteAddDel) Marshal(b []byte) ([]byte, error) {
218         var buf *codec.Buffer
219         if b == nil {
220                 buf = codec.NewBuffer(make([]byte, m.Size()))
221         } else {
222                 buf = codec.NewBuffer(b)
223         }
224         buf.EncodeBool(m.MrIsAdd)
225         buf.EncodeBool(m.MrIsMultipath)
226         buf.EncodeUint32(uint32(m.MrRoute.MrTableID))
227         buf.EncodeUint32(uint32(m.MrRoute.MrLabel))
228         buf.EncodeUint8(uint8(m.MrRoute.MrEos))
229         buf.EncodeUint8(uint8(m.MrRoute.MrEosProto))
230         buf.EncodeBool(m.MrRoute.MrIsMulticast)
231         buf.EncodeUint8(uint8(len(m.MrRoute.MrPaths)))
232         for j1 := 0; j1 < len(m.MrRoute.MrPaths); j1++ {
233                 var v1 fib_types.FibPath
234                 if j1 < len(m.MrRoute.MrPaths) {
235                         v1 = m.MrRoute.MrPaths[j1]
236                 }
237                 buf.EncodeUint32(uint32(v1.SwIfIndex))
238                 buf.EncodeUint32(uint32(v1.TableID))
239                 buf.EncodeUint32(uint32(v1.RpfID))
240                 buf.EncodeUint8(uint8(v1.Weight))
241                 buf.EncodeUint8(uint8(v1.Preference))
242                 buf.EncodeUint32(uint32(v1.Type))
243                 buf.EncodeUint32(uint32(v1.Flags))
244                 buf.EncodeUint32(uint32(v1.Proto))
245                 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 0)
246                 buf.EncodeUint32(uint32(v1.Nh.ViaLabel))
247                 buf.EncodeUint32(uint32(v1.Nh.ObjID))
248                 buf.EncodeUint32(uint32(v1.Nh.ClassifyTableIndex))
249                 buf.EncodeUint8(uint8(v1.NLabels))
250                 for j2 := 0; j2 < 16; j2++ {
251                         var v2 fib_types.FibMplsLabel
252                         if j2 < len(v1.LabelStack) {
253                                 v2 = v1.LabelStack[j2]
254                         }
255                         buf.EncodeUint8(uint8(v2.IsUniform))
256                         buf.EncodeUint32(uint32(v2.Label))
257                         buf.EncodeUint8(uint8(v2.TTL))
258                         buf.EncodeUint8(uint8(v2.Exp))
259                 }
260         }
261         return buf.Bytes(), nil
262 }
263 func (m *MplsRouteAddDel) Unmarshal(b []byte) error {
264         buf := codec.NewBuffer(b)
265         m.MrIsAdd = buf.DecodeBool()
266         m.MrIsMultipath = buf.DecodeBool()
267         m.MrRoute.MrTableID = buf.DecodeUint32()
268         m.MrRoute.MrLabel = buf.DecodeUint32()
269         m.MrRoute.MrEos = buf.DecodeUint8()
270         m.MrRoute.MrEosProto = buf.DecodeUint8()
271         m.MrRoute.MrIsMulticast = buf.DecodeBool()
272         m.MrRoute.MrNPaths = buf.DecodeUint8()
273         m.MrRoute.MrPaths = make([]fib_types.FibPath, int(m.MrRoute.MrNPaths))
274         for j1 := 0; j1 < len(m.MrRoute.MrPaths); j1++ {
275                 m.MrRoute.MrPaths[j1].SwIfIndex = buf.DecodeUint32()
276                 m.MrRoute.MrPaths[j1].TableID = buf.DecodeUint32()
277                 m.MrRoute.MrPaths[j1].RpfID = buf.DecodeUint32()
278                 m.MrRoute.MrPaths[j1].Weight = buf.DecodeUint8()
279                 m.MrRoute.MrPaths[j1].Preference = buf.DecodeUint8()
280                 m.MrRoute.MrPaths[j1].Type = fib_types.FibPathType(buf.DecodeUint32())
281                 m.MrRoute.MrPaths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32())
282                 m.MrRoute.MrPaths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32())
283                 copy(m.MrRoute.MrPaths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
284                 m.MrRoute.MrPaths[j1].Nh.ViaLabel = buf.DecodeUint32()
285                 m.MrRoute.MrPaths[j1].Nh.ObjID = buf.DecodeUint32()
286                 m.MrRoute.MrPaths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
287                 m.MrRoute.MrPaths[j1].NLabels = buf.DecodeUint8()
288                 for j2 := 0; j2 < 16; j2++ {
289                         m.MrRoute.MrPaths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
290                         m.MrRoute.MrPaths[j1].LabelStack[j2].Label = buf.DecodeUint32()
291                         m.MrRoute.MrPaths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
292                         m.MrRoute.MrPaths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
293                 }
294         }
295         return nil
296 }
297
298 // MplsRouteAddDelReply defines message 'mpls_route_add_del_reply'.
299 type MplsRouteAddDelReply struct {
300         Retval     int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
301         StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"`
302 }
303
304 func (m *MplsRouteAddDelReply) Reset()               { *m = MplsRouteAddDelReply{} }
305 func (*MplsRouteAddDelReply) GetMessageName() string { return "mpls_route_add_del_reply" }
306 func (*MplsRouteAddDelReply) GetCrcString() string   { return "1992deab" }
307 func (*MplsRouteAddDelReply) GetMessageType() api.MessageType {
308         return api.ReplyMessage
309 }
310
311 func (m *MplsRouteAddDelReply) Size() int {
312         if m == nil {
313                 return 0
314         }
315         var size int
316         size += 4 // m.Retval
317         size += 4 // m.StatsIndex
318         return size
319 }
320 func (m *MplsRouteAddDelReply) Marshal(b []byte) ([]byte, error) {
321         var buf *codec.Buffer
322         if b == nil {
323                 buf = codec.NewBuffer(make([]byte, m.Size()))
324         } else {
325                 buf = codec.NewBuffer(b)
326         }
327         buf.EncodeUint32(uint32(m.Retval))
328         buf.EncodeUint32(uint32(m.StatsIndex))
329         return buf.Bytes(), nil
330 }
331 func (m *MplsRouteAddDelReply) Unmarshal(b []byte) error {
332         buf := codec.NewBuffer(b)
333         m.Retval = int32(buf.DecodeUint32())
334         m.StatsIndex = buf.DecodeUint32()
335         return nil
336 }
337
338 // MplsRouteDetails defines message 'mpls_route_details'.
339 type MplsRouteDetails struct {
340         MrRoute MplsRoute `binapi:"mpls_route,name=mr_route" json:"mr_route,omitempty"`
341 }
342
343 func (m *MplsRouteDetails) Reset()               { *m = MplsRouteDetails{} }
344 func (*MplsRouteDetails) GetMessageName() string { return "mpls_route_details" }
345 func (*MplsRouteDetails) GetCrcString() string   { return "d0ac384c" }
346 func (*MplsRouteDetails) GetMessageType() api.MessageType {
347         return api.ReplyMessage
348 }
349
350 func (m *MplsRouteDetails) Size() int {
351         if m == nil {
352                 return 0
353         }
354         var size int
355         size += 4 // m.MrRoute.MrTableID
356         size += 4 // m.MrRoute.MrLabel
357         size += 1 // m.MrRoute.MrEos
358         size += 1 // m.MrRoute.MrEosProto
359         size += 1 // m.MrRoute.MrIsMulticast
360         size += 1 // m.MrRoute.MrNPaths
361         for j2 := 0; j2 < len(m.MrRoute.MrPaths); j2++ {
362                 var s2 fib_types.FibPath
363                 _ = s2
364                 if j2 < len(m.MrRoute.MrPaths) {
365                         s2 = m.MrRoute.MrPaths[j2]
366                 }
367                 size += 4      // s2.SwIfIndex
368                 size += 4      // s2.TableID
369                 size += 4      // s2.RpfID
370                 size += 1      // s2.Weight
371                 size += 1      // s2.Preference
372                 size += 4      // s2.Type
373                 size += 4      // s2.Flags
374                 size += 4      // s2.Proto
375                 size += 1 * 16 // s2.Nh.Address
376                 size += 4      // s2.Nh.ViaLabel
377                 size += 4      // s2.Nh.ObjID
378                 size += 4      // s2.Nh.ClassifyTableIndex
379                 size += 1      // s2.NLabels
380                 for j3 := 0; j3 < 16; j3++ {
381                         var s3 fib_types.FibMplsLabel
382                         _ = s3
383                         if j3 < len(s2.LabelStack) {
384                                 s3 = s2.LabelStack[j3]
385                         }
386                         size += 1 // s3.IsUniform
387                         size += 4 // s3.Label
388                         size += 1 // s3.TTL
389                         size += 1 // s3.Exp
390                 }
391         }
392         return size
393 }
394 func (m *MplsRouteDetails) Marshal(b []byte) ([]byte, error) {
395         var buf *codec.Buffer
396         if b == nil {
397                 buf = codec.NewBuffer(make([]byte, m.Size()))
398         } else {
399                 buf = codec.NewBuffer(b)
400         }
401         buf.EncodeUint32(uint32(m.MrRoute.MrTableID))
402         buf.EncodeUint32(uint32(m.MrRoute.MrLabel))
403         buf.EncodeUint8(uint8(m.MrRoute.MrEos))
404         buf.EncodeUint8(uint8(m.MrRoute.MrEosProto))
405         buf.EncodeBool(m.MrRoute.MrIsMulticast)
406         buf.EncodeUint8(uint8(len(m.MrRoute.MrPaths)))
407         for j1 := 0; j1 < len(m.MrRoute.MrPaths); j1++ {
408                 var v1 fib_types.FibPath
409                 if j1 < len(m.MrRoute.MrPaths) {
410                         v1 = m.MrRoute.MrPaths[j1]
411                 }
412                 buf.EncodeUint32(uint32(v1.SwIfIndex))
413                 buf.EncodeUint32(uint32(v1.TableID))
414                 buf.EncodeUint32(uint32(v1.RpfID))
415                 buf.EncodeUint8(uint8(v1.Weight))
416                 buf.EncodeUint8(uint8(v1.Preference))
417                 buf.EncodeUint32(uint32(v1.Type))
418                 buf.EncodeUint32(uint32(v1.Flags))
419                 buf.EncodeUint32(uint32(v1.Proto))
420                 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 0)
421                 buf.EncodeUint32(uint32(v1.Nh.ViaLabel))
422                 buf.EncodeUint32(uint32(v1.Nh.ObjID))
423                 buf.EncodeUint32(uint32(v1.Nh.ClassifyTableIndex))
424                 buf.EncodeUint8(uint8(v1.NLabels))
425                 for j2 := 0; j2 < 16; j2++ {
426                         var v2 fib_types.FibMplsLabel
427                         if j2 < len(v1.LabelStack) {
428                                 v2 = v1.LabelStack[j2]
429                         }
430                         buf.EncodeUint8(uint8(v2.IsUniform))
431                         buf.EncodeUint32(uint32(v2.Label))
432                         buf.EncodeUint8(uint8(v2.TTL))
433                         buf.EncodeUint8(uint8(v2.Exp))
434                 }
435         }
436         return buf.Bytes(), nil
437 }
438 func (m *MplsRouteDetails) Unmarshal(b []byte) error {
439         buf := codec.NewBuffer(b)
440         m.MrRoute.MrTableID = buf.DecodeUint32()
441         m.MrRoute.MrLabel = buf.DecodeUint32()
442         m.MrRoute.MrEos = buf.DecodeUint8()
443         m.MrRoute.MrEosProto = buf.DecodeUint8()
444         m.MrRoute.MrIsMulticast = buf.DecodeBool()
445         m.MrRoute.MrNPaths = buf.DecodeUint8()
446         m.MrRoute.MrPaths = make([]fib_types.FibPath, int(m.MrRoute.MrNPaths))
447         for j1 := 0; j1 < len(m.MrRoute.MrPaths); j1++ {
448                 m.MrRoute.MrPaths[j1].SwIfIndex = buf.DecodeUint32()
449                 m.MrRoute.MrPaths[j1].TableID = buf.DecodeUint32()
450                 m.MrRoute.MrPaths[j1].RpfID = buf.DecodeUint32()
451                 m.MrRoute.MrPaths[j1].Weight = buf.DecodeUint8()
452                 m.MrRoute.MrPaths[j1].Preference = buf.DecodeUint8()
453                 m.MrRoute.MrPaths[j1].Type = fib_types.FibPathType(buf.DecodeUint32())
454                 m.MrRoute.MrPaths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32())
455                 m.MrRoute.MrPaths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32())
456                 copy(m.MrRoute.MrPaths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
457                 m.MrRoute.MrPaths[j1].Nh.ViaLabel = buf.DecodeUint32()
458                 m.MrRoute.MrPaths[j1].Nh.ObjID = buf.DecodeUint32()
459                 m.MrRoute.MrPaths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
460                 m.MrRoute.MrPaths[j1].NLabels = buf.DecodeUint8()
461                 for j2 := 0; j2 < 16; j2++ {
462                         m.MrRoute.MrPaths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
463                         m.MrRoute.MrPaths[j1].LabelStack[j2].Label = buf.DecodeUint32()
464                         m.MrRoute.MrPaths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
465                         m.MrRoute.MrPaths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
466                 }
467         }
468         return nil
469 }
470
471 // MplsRouteDump defines message 'mpls_route_dump'.
472 type MplsRouteDump struct {
473         Table MplsTable `binapi:"mpls_table,name=table" json:"table,omitempty"`
474 }
475
476 func (m *MplsRouteDump) Reset()               { *m = MplsRouteDump{} }
477 func (*MplsRouteDump) GetMessageName() string { return "mpls_route_dump" }
478 func (*MplsRouteDump) GetCrcString() string   { return "935fdefa" }
479 func (*MplsRouteDump) GetMessageType() api.MessageType {
480         return api.RequestMessage
481 }
482
483 func (m *MplsRouteDump) Size() int {
484         if m == nil {
485                 return 0
486         }
487         var size int
488         size += 4  // m.Table.MtTableID
489         size += 64 // m.Table.MtName
490         return size
491 }
492 func (m *MplsRouteDump) Marshal(b []byte) ([]byte, error) {
493         var buf *codec.Buffer
494         if b == nil {
495                 buf = codec.NewBuffer(make([]byte, m.Size()))
496         } else {
497                 buf = codec.NewBuffer(b)
498         }
499         buf.EncodeUint32(uint32(m.Table.MtTableID))
500         buf.EncodeString(m.Table.MtName, 64)
501         return buf.Bytes(), nil
502 }
503 func (m *MplsRouteDump) Unmarshal(b []byte) error {
504         buf := codec.NewBuffer(b)
505         m.Table.MtTableID = buf.DecodeUint32()
506         m.Table.MtName = buf.DecodeString(64)
507         return nil
508 }
509
510 // MplsTableAddDel defines message 'mpls_table_add_del'.
511 type MplsTableAddDel struct {
512         MtIsAdd bool      `binapi:"bool,name=mt_is_add,default=true" json:"mt_is_add,omitempty"`
513         MtTable MplsTable `binapi:"mpls_table,name=mt_table" json:"mt_table,omitempty"`
514 }
515
516 func (m *MplsTableAddDel) Reset()               { *m = MplsTableAddDel{} }
517 func (*MplsTableAddDel) GetMessageName() string { return "mpls_table_add_del" }
518 func (*MplsTableAddDel) GetCrcString() string   { return "57817512" }
519 func (*MplsTableAddDel) GetMessageType() api.MessageType {
520         return api.RequestMessage
521 }
522
523 func (m *MplsTableAddDel) Size() int {
524         if m == nil {
525                 return 0
526         }
527         var size int
528         size += 1  // m.MtIsAdd
529         size += 4  // m.MtTable.MtTableID
530         size += 64 // m.MtTable.MtName
531         return size
532 }
533 func (m *MplsTableAddDel) Marshal(b []byte) ([]byte, error) {
534         var buf *codec.Buffer
535         if b == nil {
536                 buf = codec.NewBuffer(make([]byte, m.Size()))
537         } else {
538                 buf = codec.NewBuffer(b)
539         }
540         buf.EncodeBool(m.MtIsAdd)
541         buf.EncodeUint32(uint32(m.MtTable.MtTableID))
542         buf.EncodeString(m.MtTable.MtName, 64)
543         return buf.Bytes(), nil
544 }
545 func (m *MplsTableAddDel) Unmarshal(b []byte) error {
546         buf := codec.NewBuffer(b)
547         m.MtIsAdd = buf.DecodeBool()
548         m.MtTable.MtTableID = buf.DecodeUint32()
549         m.MtTable.MtName = buf.DecodeString(64)
550         return nil
551 }
552
553 // MplsTableAddDelReply defines message 'mpls_table_add_del_reply'.
554 type MplsTableAddDelReply struct {
555         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
556 }
557
558 func (m *MplsTableAddDelReply) Reset()               { *m = MplsTableAddDelReply{} }
559 func (*MplsTableAddDelReply) GetMessageName() string { return "mpls_table_add_del_reply" }
560 func (*MplsTableAddDelReply) GetCrcString() string   { return "e8d4e804" }
561 func (*MplsTableAddDelReply) GetMessageType() api.MessageType {
562         return api.ReplyMessage
563 }
564
565 func (m *MplsTableAddDelReply) Size() int {
566         if m == nil {
567                 return 0
568         }
569         var size int
570         size += 4 // m.Retval
571         return size
572 }
573 func (m *MplsTableAddDelReply) Marshal(b []byte) ([]byte, error) {
574         var buf *codec.Buffer
575         if b == nil {
576                 buf = codec.NewBuffer(make([]byte, m.Size()))
577         } else {
578                 buf = codec.NewBuffer(b)
579         }
580         buf.EncodeUint32(uint32(m.Retval))
581         return buf.Bytes(), nil
582 }
583 func (m *MplsTableAddDelReply) Unmarshal(b []byte) error {
584         buf := codec.NewBuffer(b)
585         m.Retval = int32(buf.DecodeUint32())
586         return nil
587 }
588
589 // MplsTableDetails defines message 'mpls_table_details'.
590 type MplsTableDetails struct {
591         MtTable MplsTable `binapi:"mpls_table,name=mt_table" json:"mt_table,omitempty"`
592 }
593
594 func (m *MplsTableDetails) Reset()               { *m = MplsTableDetails{} }
595 func (*MplsTableDetails) GetMessageName() string { return "mpls_table_details" }
596 func (*MplsTableDetails) GetCrcString() string   { return "f03ecdc8" }
597 func (*MplsTableDetails) GetMessageType() api.MessageType {
598         return api.ReplyMessage
599 }
600
601 func (m *MplsTableDetails) Size() int {
602         if m == nil {
603                 return 0
604         }
605         var size int
606         size += 4  // m.MtTable.MtTableID
607         size += 64 // m.MtTable.MtName
608         return size
609 }
610 func (m *MplsTableDetails) Marshal(b []byte) ([]byte, error) {
611         var buf *codec.Buffer
612         if b == nil {
613                 buf = codec.NewBuffer(make([]byte, m.Size()))
614         } else {
615                 buf = codec.NewBuffer(b)
616         }
617         buf.EncodeUint32(uint32(m.MtTable.MtTableID))
618         buf.EncodeString(m.MtTable.MtName, 64)
619         return buf.Bytes(), nil
620 }
621 func (m *MplsTableDetails) Unmarshal(b []byte) error {
622         buf := codec.NewBuffer(b)
623         m.MtTable.MtTableID = buf.DecodeUint32()
624         m.MtTable.MtName = buf.DecodeString(64)
625         return nil
626 }
627
628 // MplsTableDump defines message 'mpls_table_dump'.
629 type MplsTableDump struct{}
630
631 func (m *MplsTableDump) Reset()               { *m = MplsTableDump{} }
632 func (*MplsTableDump) GetMessageName() string { return "mpls_table_dump" }
633 func (*MplsTableDump) GetCrcString() string   { return "51077d14" }
634 func (*MplsTableDump) GetMessageType() api.MessageType {
635         return api.RequestMessage
636 }
637
638 func (m *MplsTableDump) Size() int {
639         if m == nil {
640                 return 0
641         }
642         var size int
643         return size
644 }
645 func (m *MplsTableDump) Marshal(b []byte) ([]byte, error) {
646         var buf *codec.Buffer
647         if b == nil {
648                 buf = codec.NewBuffer(make([]byte, m.Size()))
649         } else {
650                 buf = codec.NewBuffer(b)
651         }
652         return buf.Bytes(), nil
653 }
654 func (m *MplsTableDump) Unmarshal(b []byte) error {
655         return nil
656 }
657
658 // MplsTunnelAddDel defines message 'mpls_tunnel_add_del'.
659 type MplsTunnelAddDel struct {
660         MtIsAdd  bool       `binapi:"bool,name=mt_is_add,default=true" json:"mt_is_add,omitempty"`
661         MtTunnel MplsTunnel `binapi:"mpls_tunnel,name=mt_tunnel" json:"mt_tunnel,omitempty"`
662 }
663
664 func (m *MplsTunnelAddDel) Reset()               { *m = MplsTunnelAddDel{} }
665 func (*MplsTunnelAddDel) GetMessageName() string { return "mpls_tunnel_add_del" }
666 func (*MplsTunnelAddDel) GetCrcString() string   { return "e57ce61d" }
667 func (*MplsTunnelAddDel) GetMessageType() api.MessageType {
668         return api.RequestMessage
669 }
670
671 func (m *MplsTunnelAddDel) Size() int {
672         if m == nil {
673                 return 0
674         }
675         var size int
676         size += 1  // m.MtIsAdd
677         size += 4  // m.MtTunnel.MtSwIfIndex
678         size += 4  // m.MtTunnel.MtTunnelIndex
679         size += 1  // m.MtTunnel.MtL2Only
680         size += 1  // m.MtTunnel.MtIsMulticast
681         size += 64 // m.MtTunnel.MtTag
682         size += 1  // m.MtTunnel.MtNPaths
683         for j2 := 0; j2 < len(m.MtTunnel.MtPaths); j2++ {
684                 var s2 fib_types.FibPath
685                 _ = s2
686                 if j2 < len(m.MtTunnel.MtPaths) {
687                         s2 = m.MtTunnel.MtPaths[j2]
688                 }
689                 size += 4      // s2.SwIfIndex
690                 size += 4      // s2.TableID
691                 size += 4      // s2.RpfID
692                 size += 1      // s2.Weight
693                 size += 1      // s2.Preference
694                 size += 4      // s2.Type
695                 size += 4      // s2.Flags
696                 size += 4      // s2.Proto
697                 size += 1 * 16 // s2.Nh.Address
698                 size += 4      // s2.Nh.ViaLabel
699                 size += 4      // s2.Nh.ObjID
700                 size += 4      // s2.Nh.ClassifyTableIndex
701                 size += 1      // s2.NLabels
702                 for j3 := 0; j3 < 16; j3++ {
703                         var s3 fib_types.FibMplsLabel
704                         _ = s3
705                         if j3 < len(s2.LabelStack) {
706                                 s3 = s2.LabelStack[j3]
707                         }
708                         size += 1 // s3.IsUniform
709                         size += 4 // s3.Label
710                         size += 1 // s3.TTL
711                         size += 1 // s3.Exp
712                 }
713         }
714         return size
715 }
716 func (m *MplsTunnelAddDel) Marshal(b []byte) ([]byte, error) {
717         var buf *codec.Buffer
718         if b == nil {
719                 buf = codec.NewBuffer(make([]byte, m.Size()))
720         } else {
721                 buf = codec.NewBuffer(b)
722         }
723         buf.EncodeBool(m.MtIsAdd)
724         buf.EncodeUint32(uint32(m.MtTunnel.MtSwIfIndex))
725         buf.EncodeUint32(uint32(m.MtTunnel.MtTunnelIndex))
726         buf.EncodeBool(m.MtTunnel.MtL2Only)
727         buf.EncodeBool(m.MtTunnel.MtIsMulticast)
728         buf.EncodeString(m.MtTunnel.MtTag, 64)
729         buf.EncodeUint8(uint8(len(m.MtTunnel.MtPaths)))
730         for j1 := 0; j1 < len(m.MtTunnel.MtPaths); j1++ {
731                 var v1 fib_types.FibPath
732                 if j1 < len(m.MtTunnel.MtPaths) {
733                         v1 = m.MtTunnel.MtPaths[j1]
734                 }
735                 buf.EncodeUint32(uint32(v1.SwIfIndex))
736                 buf.EncodeUint32(uint32(v1.TableID))
737                 buf.EncodeUint32(uint32(v1.RpfID))
738                 buf.EncodeUint8(uint8(v1.Weight))
739                 buf.EncodeUint8(uint8(v1.Preference))
740                 buf.EncodeUint32(uint32(v1.Type))
741                 buf.EncodeUint32(uint32(v1.Flags))
742                 buf.EncodeUint32(uint32(v1.Proto))
743                 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 0)
744                 buf.EncodeUint32(uint32(v1.Nh.ViaLabel))
745                 buf.EncodeUint32(uint32(v1.Nh.ObjID))
746                 buf.EncodeUint32(uint32(v1.Nh.ClassifyTableIndex))
747                 buf.EncodeUint8(uint8(v1.NLabels))
748                 for j2 := 0; j2 < 16; j2++ {
749                         var v2 fib_types.FibMplsLabel
750                         if j2 < len(v1.LabelStack) {
751                                 v2 = v1.LabelStack[j2]
752                         }
753                         buf.EncodeUint8(uint8(v2.IsUniform))
754                         buf.EncodeUint32(uint32(v2.Label))
755                         buf.EncodeUint8(uint8(v2.TTL))
756                         buf.EncodeUint8(uint8(v2.Exp))
757                 }
758         }
759         return buf.Bytes(), nil
760 }
761 func (m *MplsTunnelAddDel) Unmarshal(b []byte) error {
762         buf := codec.NewBuffer(b)
763         m.MtIsAdd = buf.DecodeBool()
764         m.MtTunnel.MtSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
765         m.MtTunnel.MtTunnelIndex = buf.DecodeUint32()
766         m.MtTunnel.MtL2Only = buf.DecodeBool()
767         m.MtTunnel.MtIsMulticast = buf.DecodeBool()
768         m.MtTunnel.MtTag = buf.DecodeString(64)
769         m.MtTunnel.MtNPaths = buf.DecodeUint8()
770         m.MtTunnel.MtPaths = make([]fib_types.FibPath, int(m.MtTunnel.MtNPaths))
771         for j1 := 0; j1 < len(m.MtTunnel.MtPaths); j1++ {
772                 m.MtTunnel.MtPaths[j1].SwIfIndex = buf.DecodeUint32()
773                 m.MtTunnel.MtPaths[j1].TableID = buf.DecodeUint32()
774                 m.MtTunnel.MtPaths[j1].RpfID = buf.DecodeUint32()
775                 m.MtTunnel.MtPaths[j1].Weight = buf.DecodeUint8()
776                 m.MtTunnel.MtPaths[j1].Preference = buf.DecodeUint8()
777                 m.MtTunnel.MtPaths[j1].Type = fib_types.FibPathType(buf.DecodeUint32())
778                 m.MtTunnel.MtPaths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32())
779                 m.MtTunnel.MtPaths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32())
780                 copy(m.MtTunnel.MtPaths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
781                 m.MtTunnel.MtPaths[j1].Nh.ViaLabel = buf.DecodeUint32()
782                 m.MtTunnel.MtPaths[j1].Nh.ObjID = buf.DecodeUint32()
783                 m.MtTunnel.MtPaths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
784                 m.MtTunnel.MtPaths[j1].NLabels = buf.DecodeUint8()
785                 for j2 := 0; j2 < 16; j2++ {
786                         m.MtTunnel.MtPaths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
787                         m.MtTunnel.MtPaths[j1].LabelStack[j2].Label = buf.DecodeUint32()
788                         m.MtTunnel.MtPaths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
789                         m.MtTunnel.MtPaths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
790                 }
791         }
792         return nil
793 }
794
795 // MplsTunnelAddDelReply defines message 'mpls_tunnel_add_del_reply'.
796 type MplsTunnelAddDelReply struct {
797         Retval      int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
798         SwIfIndex   interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
799         TunnelIndex uint32                         `binapi:"u32,name=tunnel_index" json:"tunnel_index,omitempty"`
800 }
801
802 func (m *MplsTunnelAddDelReply) Reset()               { *m = MplsTunnelAddDelReply{} }
803 func (*MplsTunnelAddDelReply) GetMessageName() string { return "mpls_tunnel_add_del_reply" }
804 func (*MplsTunnelAddDelReply) GetCrcString() string   { return "afb01472" }
805 func (*MplsTunnelAddDelReply) GetMessageType() api.MessageType {
806         return api.ReplyMessage
807 }
808
809 func (m *MplsTunnelAddDelReply) Size() int {
810         if m == nil {
811                 return 0
812         }
813         var size int
814         size += 4 // m.Retval
815         size += 4 // m.SwIfIndex
816         size += 4 // m.TunnelIndex
817         return size
818 }
819 func (m *MplsTunnelAddDelReply) Marshal(b []byte) ([]byte, error) {
820         var buf *codec.Buffer
821         if b == nil {
822                 buf = codec.NewBuffer(make([]byte, m.Size()))
823         } else {
824                 buf = codec.NewBuffer(b)
825         }
826         buf.EncodeUint32(uint32(m.Retval))
827         buf.EncodeUint32(uint32(m.SwIfIndex))
828         buf.EncodeUint32(uint32(m.TunnelIndex))
829         return buf.Bytes(), nil
830 }
831 func (m *MplsTunnelAddDelReply) Unmarshal(b []byte) error {
832         buf := codec.NewBuffer(b)
833         m.Retval = int32(buf.DecodeUint32())
834         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
835         m.TunnelIndex = buf.DecodeUint32()
836         return nil
837 }
838
839 // MplsTunnelDetails defines message 'mpls_tunnel_details'.
840 type MplsTunnelDetails struct {
841         MtTunnel MplsTunnel `binapi:"mpls_tunnel,name=mt_tunnel" json:"mt_tunnel,omitempty"`
842 }
843
844 func (m *MplsTunnelDetails) Reset()               { *m = MplsTunnelDetails{} }
845 func (*MplsTunnelDetails) GetMessageName() string { return "mpls_tunnel_details" }
846 func (*MplsTunnelDetails) GetCrcString() string   { return "f3c0928e" }
847 func (*MplsTunnelDetails) GetMessageType() api.MessageType {
848         return api.ReplyMessage
849 }
850
851 func (m *MplsTunnelDetails) Size() int {
852         if m == nil {
853                 return 0
854         }
855         var size int
856         size += 4  // m.MtTunnel.MtSwIfIndex
857         size += 4  // m.MtTunnel.MtTunnelIndex
858         size += 1  // m.MtTunnel.MtL2Only
859         size += 1  // m.MtTunnel.MtIsMulticast
860         size += 64 // m.MtTunnel.MtTag
861         size += 1  // m.MtTunnel.MtNPaths
862         for j2 := 0; j2 < len(m.MtTunnel.MtPaths); j2++ {
863                 var s2 fib_types.FibPath
864                 _ = s2
865                 if j2 < len(m.MtTunnel.MtPaths) {
866                         s2 = m.MtTunnel.MtPaths[j2]
867                 }
868                 size += 4      // s2.SwIfIndex
869                 size += 4      // s2.TableID
870                 size += 4      // s2.RpfID
871                 size += 1      // s2.Weight
872                 size += 1      // s2.Preference
873                 size += 4      // s2.Type
874                 size += 4      // s2.Flags
875                 size += 4      // s2.Proto
876                 size += 1 * 16 // s2.Nh.Address
877                 size += 4      // s2.Nh.ViaLabel
878                 size += 4      // s2.Nh.ObjID
879                 size += 4      // s2.Nh.ClassifyTableIndex
880                 size += 1      // s2.NLabels
881                 for j3 := 0; j3 < 16; j3++ {
882                         var s3 fib_types.FibMplsLabel
883                         _ = s3
884                         if j3 < len(s2.LabelStack) {
885                                 s3 = s2.LabelStack[j3]
886                         }
887                         size += 1 // s3.IsUniform
888                         size += 4 // s3.Label
889                         size += 1 // s3.TTL
890                         size += 1 // s3.Exp
891                 }
892         }
893         return size
894 }
895 func (m *MplsTunnelDetails) Marshal(b []byte) ([]byte, error) {
896         var buf *codec.Buffer
897         if b == nil {
898                 buf = codec.NewBuffer(make([]byte, m.Size()))
899         } else {
900                 buf = codec.NewBuffer(b)
901         }
902         buf.EncodeUint32(uint32(m.MtTunnel.MtSwIfIndex))
903         buf.EncodeUint32(uint32(m.MtTunnel.MtTunnelIndex))
904         buf.EncodeBool(m.MtTunnel.MtL2Only)
905         buf.EncodeBool(m.MtTunnel.MtIsMulticast)
906         buf.EncodeString(m.MtTunnel.MtTag, 64)
907         buf.EncodeUint8(uint8(len(m.MtTunnel.MtPaths)))
908         for j1 := 0; j1 < len(m.MtTunnel.MtPaths); j1++ {
909                 var v1 fib_types.FibPath
910                 if j1 < len(m.MtTunnel.MtPaths) {
911                         v1 = m.MtTunnel.MtPaths[j1]
912                 }
913                 buf.EncodeUint32(uint32(v1.SwIfIndex))
914                 buf.EncodeUint32(uint32(v1.TableID))
915                 buf.EncodeUint32(uint32(v1.RpfID))
916                 buf.EncodeUint8(uint8(v1.Weight))
917                 buf.EncodeUint8(uint8(v1.Preference))
918                 buf.EncodeUint32(uint32(v1.Type))
919                 buf.EncodeUint32(uint32(v1.Flags))
920                 buf.EncodeUint32(uint32(v1.Proto))
921                 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 0)
922                 buf.EncodeUint32(uint32(v1.Nh.ViaLabel))
923                 buf.EncodeUint32(uint32(v1.Nh.ObjID))
924                 buf.EncodeUint32(uint32(v1.Nh.ClassifyTableIndex))
925                 buf.EncodeUint8(uint8(v1.NLabels))
926                 for j2 := 0; j2 < 16; j2++ {
927                         var v2 fib_types.FibMplsLabel
928                         if j2 < len(v1.LabelStack) {
929                                 v2 = v1.LabelStack[j2]
930                         }
931                         buf.EncodeUint8(uint8(v2.IsUniform))
932                         buf.EncodeUint32(uint32(v2.Label))
933                         buf.EncodeUint8(uint8(v2.TTL))
934                         buf.EncodeUint8(uint8(v2.Exp))
935                 }
936         }
937         return buf.Bytes(), nil
938 }
939 func (m *MplsTunnelDetails) Unmarshal(b []byte) error {
940         buf := codec.NewBuffer(b)
941         m.MtTunnel.MtSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
942         m.MtTunnel.MtTunnelIndex = buf.DecodeUint32()
943         m.MtTunnel.MtL2Only = buf.DecodeBool()
944         m.MtTunnel.MtIsMulticast = buf.DecodeBool()
945         m.MtTunnel.MtTag = buf.DecodeString(64)
946         m.MtTunnel.MtNPaths = buf.DecodeUint8()
947         m.MtTunnel.MtPaths = make([]fib_types.FibPath, int(m.MtTunnel.MtNPaths))
948         for j1 := 0; j1 < len(m.MtTunnel.MtPaths); j1++ {
949                 m.MtTunnel.MtPaths[j1].SwIfIndex = buf.DecodeUint32()
950                 m.MtTunnel.MtPaths[j1].TableID = buf.DecodeUint32()
951                 m.MtTunnel.MtPaths[j1].RpfID = buf.DecodeUint32()
952                 m.MtTunnel.MtPaths[j1].Weight = buf.DecodeUint8()
953                 m.MtTunnel.MtPaths[j1].Preference = buf.DecodeUint8()
954                 m.MtTunnel.MtPaths[j1].Type = fib_types.FibPathType(buf.DecodeUint32())
955                 m.MtTunnel.MtPaths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32())
956                 m.MtTunnel.MtPaths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32())
957                 copy(m.MtTunnel.MtPaths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
958                 m.MtTunnel.MtPaths[j1].Nh.ViaLabel = buf.DecodeUint32()
959                 m.MtTunnel.MtPaths[j1].Nh.ObjID = buf.DecodeUint32()
960                 m.MtTunnel.MtPaths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
961                 m.MtTunnel.MtPaths[j1].NLabels = buf.DecodeUint8()
962                 for j2 := 0; j2 < 16; j2++ {
963                         m.MtTunnel.MtPaths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
964                         m.MtTunnel.MtPaths[j1].LabelStack[j2].Label = buf.DecodeUint32()
965                         m.MtTunnel.MtPaths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
966                         m.MtTunnel.MtPaths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
967                 }
968         }
969         return nil
970 }
971
972 // MplsTunnelDump defines message 'mpls_tunnel_dump'.
973 type MplsTunnelDump struct {
974         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"`
975 }
976
977 func (m *MplsTunnelDump) Reset()               { *m = MplsTunnelDump{} }
978 func (*MplsTunnelDump) GetMessageName() string { return "mpls_tunnel_dump" }
979 func (*MplsTunnelDump) GetCrcString() string   { return "f9e6675e" }
980 func (*MplsTunnelDump) GetMessageType() api.MessageType {
981         return api.RequestMessage
982 }
983
984 func (m *MplsTunnelDump) Size() int {
985         if m == nil {
986                 return 0
987         }
988         var size int
989         size += 4 // m.SwIfIndex
990         return size
991 }
992 func (m *MplsTunnelDump) Marshal(b []byte) ([]byte, error) {
993         var buf *codec.Buffer
994         if b == nil {
995                 buf = codec.NewBuffer(make([]byte, m.Size()))
996         } else {
997                 buf = codec.NewBuffer(b)
998         }
999         buf.EncodeUint32(uint32(m.SwIfIndex))
1000         return buf.Bytes(), nil
1001 }
1002 func (m *MplsTunnelDump) Unmarshal(b []byte) error {
1003         buf := codec.NewBuffer(b)
1004         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1005         return nil
1006 }
1007
1008 // SwInterfaceSetMplsEnable defines message 'sw_interface_set_mpls_enable'.
1009 type SwInterfaceSetMplsEnable struct {
1010         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1011         Enable    bool                           `binapi:"bool,name=enable,default=true" json:"enable,omitempty"`
1012 }
1013
1014 func (m *SwInterfaceSetMplsEnable) Reset()               { *m = SwInterfaceSetMplsEnable{} }
1015 func (*SwInterfaceSetMplsEnable) GetMessageName() string { return "sw_interface_set_mpls_enable" }
1016 func (*SwInterfaceSetMplsEnable) GetCrcString() string   { return "ae6cfcfb" }
1017 func (*SwInterfaceSetMplsEnable) GetMessageType() api.MessageType {
1018         return api.RequestMessage
1019 }
1020
1021 func (m *SwInterfaceSetMplsEnable) Size() int {
1022         if m == nil {
1023                 return 0
1024         }
1025         var size int
1026         size += 4 // m.SwIfIndex
1027         size += 1 // m.Enable
1028         return size
1029 }
1030 func (m *SwInterfaceSetMplsEnable) Marshal(b []byte) ([]byte, error) {
1031         var buf *codec.Buffer
1032         if b == nil {
1033                 buf = codec.NewBuffer(make([]byte, m.Size()))
1034         } else {
1035                 buf = codec.NewBuffer(b)
1036         }
1037         buf.EncodeUint32(uint32(m.SwIfIndex))
1038         buf.EncodeBool(m.Enable)
1039         return buf.Bytes(), nil
1040 }
1041 func (m *SwInterfaceSetMplsEnable) Unmarshal(b []byte) error {
1042         buf := codec.NewBuffer(b)
1043         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1044         m.Enable = buf.DecodeBool()
1045         return nil
1046 }
1047
1048 // SwInterfaceSetMplsEnableReply defines message 'sw_interface_set_mpls_enable_reply'.
1049 type SwInterfaceSetMplsEnableReply struct {
1050         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1051 }
1052
1053 func (m *SwInterfaceSetMplsEnableReply) Reset() { *m = SwInterfaceSetMplsEnableReply{} }
1054 func (*SwInterfaceSetMplsEnableReply) GetMessageName() string {
1055         return "sw_interface_set_mpls_enable_reply"
1056 }
1057 func (*SwInterfaceSetMplsEnableReply) GetCrcString() string { return "e8d4e804" }
1058 func (*SwInterfaceSetMplsEnableReply) GetMessageType() api.MessageType {
1059         return api.ReplyMessage
1060 }
1061
1062 func (m *SwInterfaceSetMplsEnableReply) Size() int {
1063         if m == nil {
1064                 return 0
1065         }
1066         var size int
1067         size += 4 // m.Retval
1068         return size
1069 }
1070 func (m *SwInterfaceSetMplsEnableReply) Marshal(b []byte) ([]byte, error) {
1071         var buf *codec.Buffer
1072         if b == nil {
1073                 buf = codec.NewBuffer(make([]byte, m.Size()))
1074         } else {
1075                 buf = codec.NewBuffer(b)
1076         }
1077         buf.EncodeUint32(uint32(m.Retval))
1078         return buf.Bytes(), nil
1079 }
1080 func (m *SwInterfaceSetMplsEnableReply) Unmarshal(b []byte) error {
1081         buf := codec.NewBuffer(b)
1082         m.Retval = int32(buf.DecodeUint32())
1083         return nil
1084 }
1085
1086 func init() { file_mpls_binapi_init() }
1087 func file_mpls_binapi_init() {
1088         api.RegisterMessage((*MplsIPBindUnbind)(nil), "mpls_ip_bind_unbind_48249a27")
1089         api.RegisterMessage((*MplsIPBindUnbindReply)(nil), "mpls_ip_bind_unbind_reply_e8d4e804")
1090         api.RegisterMessage((*MplsRouteAddDel)(nil), "mpls_route_add_del_343cff54")
1091         api.RegisterMessage((*MplsRouteAddDelReply)(nil), "mpls_route_add_del_reply_1992deab")
1092         api.RegisterMessage((*MplsRouteDetails)(nil), "mpls_route_details_d0ac384c")
1093         api.RegisterMessage((*MplsRouteDump)(nil), "mpls_route_dump_935fdefa")
1094         api.RegisterMessage((*MplsTableAddDel)(nil), "mpls_table_add_del_57817512")
1095         api.RegisterMessage((*MplsTableAddDelReply)(nil), "mpls_table_add_del_reply_e8d4e804")
1096         api.RegisterMessage((*MplsTableDetails)(nil), "mpls_table_details_f03ecdc8")
1097         api.RegisterMessage((*MplsTableDump)(nil), "mpls_table_dump_51077d14")
1098         api.RegisterMessage((*MplsTunnelAddDel)(nil), "mpls_tunnel_add_del_e57ce61d")
1099         api.RegisterMessage((*MplsTunnelAddDelReply)(nil), "mpls_tunnel_add_del_reply_afb01472")
1100         api.RegisterMessage((*MplsTunnelDetails)(nil), "mpls_tunnel_details_f3c0928e")
1101         api.RegisterMessage((*MplsTunnelDump)(nil), "mpls_tunnel_dump_f9e6675e")
1102         api.RegisterMessage((*SwInterfaceSetMplsEnable)(nil), "sw_interface_set_mpls_enable_ae6cfcfb")
1103         api.RegisterMessage((*SwInterfaceSetMplsEnableReply)(nil), "sw_interface_set_mpls_enable_reply_e8d4e804")
1104 }
1105
1106 // Messages returns list of all messages in this module.
1107 func AllMessages() []api.Message {
1108         return []api.Message{
1109                 (*MplsIPBindUnbind)(nil),
1110                 (*MplsIPBindUnbindReply)(nil),
1111                 (*MplsRouteAddDel)(nil),
1112                 (*MplsRouteAddDelReply)(nil),
1113                 (*MplsRouteDetails)(nil),
1114                 (*MplsRouteDump)(nil),
1115                 (*MplsTableAddDel)(nil),
1116                 (*MplsTableAddDelReply)(nil),
1117                 (*MplsTableDetails)(nil),
1118                 (*MplsTableDump)(nil),
1119                 (*MplsTunnelAddDel)(nil),
1120                 (*MplsTunnelAddDelReply)(nil),
1121                 (*MplsTunnelDetails)(nil),
1122                 (*MplsTunnelDump)(nil),
1123                 (*SwInterfaceSetMplsEnable)(nil),
1124                 (*SwInterfaceSetMplsEnableReply)(nil),
1125         }
1126 }