Improve binapi generator
[govpp.git] / binapi / bier / bier.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/bier.api.json
6
7 // Package bier contains generated bindings for API file bier.api.
8 //
9 // Contents:
10 //   2 structs
11 //  22 messages
12 //
13 package bier
14
15 import (
16         api "git.fd.io/govpp.git/api"
17         fib_types "git.fd.io/govpp.git/binapi/fib_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    = "bier"
30         APIVersion = "1.2.1"
31         VersionCrc = 0x9196a2d4
32 )
33
34 // BierRoute defines type 'bier_route'.
35 type BierRoute struct {
36         BrBp     uint32              `binapi:"u32,name=br_bp" json:"br_bp,omitempty"`
37         BrTblID  BierTableID         `binapi:"bier_table_id,name=br_tbl_id" json:"br_tbl_id,omitempty"`
38         BrNPaths uint8               `binapi:"u8,name=br_n_paths" json:"-"`
39         BrPaths  []fib_types.FibPath `binapi:"fib_path[br_n_paths],name=br_paths" json:"br_paths,omitempty"`
40 }
41
42 // BierTableID defines type 'bier_table_id'.
43 type BierTableID struct {
44         BtSet       uint8 `binapi:"u8,name=bt_set" json:"bt_set,omitempty"`
45         BtSubDomain uint8 `binapi:"u8,name=bt_sub_domain" json:"bt_sub_domain,omitempty"`
46         BtHdrLenID  uint8 `binapi:"u8,name=bt_hdr_len_id" json:"bt_hdr_len_id,omitempty"`
47 }
48
49 // BierDispEntryAddDel defines message 'bier_disp_entry_add_del'.
50 type BierDispEntryAddDel struct {
51         BdeBp           uint16              `binapi:"u16,name=bde_bp" json:"bde_bp,omitempty"`
52         BdeTblID        uint32              `binapi:"u32,name=bde_tbl_id" json:"bde_tbl_id,omitempty"`
53         BdeIsAdd        bool                `binapi:"bool,name=bde_is_add" json:"bde_is_add,omitempty"`
54         BdePayloadProto uint8               `binapi:"u8,name=bde_payload_proto" json:"bde_payload_proto,omitempty"`
55         BdeNPaths       uint8               `binapi:"u8,name=bde_n_paths" json:"-"`
56         BdePaths        []fib_types.FibPath `binapi:"fib_path[bde_n_paths],name=bde_paths" json:"bde_paths,omitempty"`
57 }
58
59 func (m *BierDispEntryAddDel) Reset()               { *m = BierDispEntryAddDel{} }
60 func (*BierDispEntryAddDel) GetMessageName() string { return "bier_disp_entry_add_del" }
61 func (*BierDispEntryAddDel) GetCrcString() string   { return "648323eb" }
62 func (*BierDispEntryAddDel) GetMessageType() api.MessageType {
63         return api.RequestMessage
64 }
65
66 func (m *BierDispEntryAddDel) Size() int {
67         if m == nil {
68                 return 0
69         }
70         var size int
71         size += 2 // m.BdeBp
72         size += 4 // m.BdeTblID
73         size += 1 // m.BdeIsAdd
74         size += 1 // m.BdePayloadProto
75         size += 1 // m.BdeNPaths
76         for j1 := 0; j1 < len(m.BdePaths); j1++ {
77                 var s1 fib_types.FibPath
78                 _ = s1
79                 if j1 < len(m.BdePaths) {
80                         s1 = m.BdePaths[j1]
81                 }
82                 size += 4      // s1.SwIfIndex
83                 size += 4      // s1.TableID
84                 size += 4      // s1.RpfID
85                 size += 1      // s1.Weight
86                 size += 1      // s1.Preference
87                 size += 4      // s1.Type
88                 size += 4      // s1.Flags
89                 size += 4      // s1.Proto
90                 size += 1 * 16 // s1.Nh.Address
91                 size += 4      // s1.Nh.ViaLabel
92                 size += 4      // s1.Nh.ObjID
93                 size += 4      // s1.Nh.ClassifyTableIndex
94                 size += 1      // s1.NLabels
95                 for j2 := 0; j2 < 16; j2++ {
96                         var s2 fib_types.FibMplsLabel
97                         _ = s2
98                         if j2 < len(s1.LabelStack) {
99                                 s2 = s1.LabelStack[j2]
100                         }
101                         size += 1 // s2.IsUniform
102                         size += 4 // s2.Label
103                         size += 1 // s2.TTL
104                         size += 1 // s2.Exp
105                 }
106         }
107         return size
108 }
109 func (m *BierDispEntryAddDel) Marshal(b []byte) ([]byte, error) {
110         var buf *codec.Buffer
111         if b == nil {
112                 buf = codec.NewBuffer(make([]byte, m.Size()))
113         } else {
114                 buf = codec.NewBuffer(b)
115         }
116         buf.EncodeUint16(uint16(m.BdeBp))
117         buf.EncodeUint32(uint32(m.BdeTblID))
118         buf.EncodeBool(m.BdeIsAdd)
119         buf.EncodeUint8(uint8(m.BdePayloadProto))
120         buf.EncodeUint8(uint8(len(m.BdePaths)))
121         for j0 := 0; j0 < len(m.BdePaths); j0++ {
122                 var v0 fib_types.FibPath
123                 if j0 < len(m.BdePaths) {
124                         v0 = m.BdePaths[j0]
125                 }
126                 buf.EncodeUint32(uint32(v0.SwIfIndex))
127                 buf.EncodeUint32(uint32(v0.TableID))
128                 buf.EncodeUint32(uint32(v0.RpfID))
129                 buf.EncodeUint8(uint8(v0.Weight))
130                 buf.EncodeUint8(uint8(v0.Preference))
131                 buf.EncodeUint32(uint32(v0.Type))
132                 buf.EncodeUint32(uint32(v0.Flags))
133                 buf.EncodeUint32(uint32(v0.Proto))
134                 buf.EncodeBytes(v0.Nh.Address.XXX_UnionData[:], 0)
135                 buf.EncodeUint32(uint32(v0.Nh.ViaLabel))
136                 buf.EncodeUint32(uint32(v0.Nh.ObjID))
137                 buf.EncodeUint32(uint32(v0.Nh.ClassifyTableIndex))
138                 buf.EncodeUint8(uint8(v0.NLabels))
139                 for j1 := 0; j1 < 16; j1++ {
140                         var v1 fib_types.FibMplsLabel
141                         if j1 < len(v0.LabelStack) {
142                                 v1 = v0.LabelStack[j1]
143                         }
144                         buf.EncodeUint8(uint8(v1.IsUniform))
145                         buf.EncodeUint32(uint32(v1.Label))
146                         buf.EncodeUint8(uint8(v1.TTL))
147                         buf.EncodeUint8(uint8(v1.Exp))
148                 }
149         }
150         return buf.Bytes(), nil
151 }
152 func (m *BierDispEntryAddDel) Unmarshal(b []byte) error {
153         buf := codec.NewBuffer(b)
154         m.BdeBp = buf.DecodeUint16()
155         m.BdeTblID = buf.DecodeUint32()
156         m.BdeIsAdd = buf.DecodeBool()
157         m.BdePayloadProto = buf.DecodeUint8()
158         m.BdeNPaths = buf.DecodeUint8()
159         m.BdePaths = make([]fib_types.FibPath, int(m.BdeNPaths))
160         for j0 := 0; j0 < len(m.BdePaths); j0++ {
161                 m.BdePaths[j0].SwIfIndex = buf.DecodeUint32()
162                 m.BdePaths[j0].TableID = buf.DecodeUint32()
163                 m.BdePaths[j0].RpfID = buf.DecodeUint32()
164                 m.BdePaths[j0].Weight = buf.DecodeUint8()
165                 m.BdePaths[j0].Preference = buf.DecodeUint8()
166                 m.BdePaths[j0].Type = fib_types.FibPathType(buf.DecodeUint32())
167                 m.BdePaths[j0].Flags = fib_types.FibPathFlags(buf.DecodeUint32())
168                 m.BdePaths[j0].Proto = fib_types.FibPathNhProto(buf.DecodeUint32())
169                 copy(m.BdePaths[j0].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
170                 m.BdePaths[j0].Nh.ViaLabel = buf.DecodeUint32()
171                 m.BdePaths[j0].Nh.ObjID = buf.DecodeUint32()
172                 m.BdePaths[j0].Nh.ClassifyTableIndex = buf.DecodeUint32()
173                 m.BdePaths[j0].NLabels = buf.DecodeUint8()
174                 for j1 := 0; j1 < 16; j1++ {
175                         m.BdePaths[j0].LabelStack[j1].IsUniform = buf.DecodeUint8()
176                         m.BdePaths[j0].LabelStack[j1].Label = buf.DecodeUint32()
177                         m.BdePaths[j0].LabelStack[j1].TTL = buf.DecodeUint8()
178                         m.BdePaths[j0].LabelStack[j1].Exp = buf.DecodeUint8()
179                 }
180         }
181         return nil
182 }
183
184 // BierDispEntryAddDelReply defines message 'bier_disp_entry_add_del_reply'.
185 type BierDispEntryAddDelReply struct {
186         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
187 }
188
189 func (m *BierDispEntryAddDelReply) Reset()               { *m = BierDispEntryAddDelReply{} }
190 func (*BierDispEntryAddDelReply) GetMessageName() string { return "bier_disp_entry_add_del_reply" }
191 func (*BierDispEntryAddDelReply) GetCrcString() string   { return "e8d4e804" }
192 func (*BierDispEntryAddDelReply) GetMessageType() api.MessageType {
193         return api.ReplyMessage
194 }
195
196 func (m *BierDispEntryAddDelReply) Size() int {
197         if m == nil {
198                 return 0
199         }
200         var size int
201         size += 4 // m.Retval
202         return size
203 }
204 func (m *BierDispEntryAddDelReply) Marshal(b []byte) ([]byte, error) {
205         var buf *codec.Buffer
206         if b == nil {
207                 buf = codec.NewBuffer(make([]byte, m.Size()))
208         } else {
209                 buf = codec.NewBuffer(b)
210         }
211         buf.EncodeUint32(uint32(m.Retval))
212         return buf.Bytes(), nil
213 }
214 func (m *BierDispEntryAddDelReply) Unmarshal(b []byte) error {
215         buf := codec.NewBuffer(b)
216         m.Retval = int32(buf.DecodeUint32())
217         return nil
218 }
219
220 // BierDispEntryDetails defines message 'bier_disp_entry_details'.
221 type BierDispEntryDetails struct {
222         BdeBp           uint16              `binapi:"u16,name=bde_bp" json:"bde_bp,omitempty"`
223         BdeTblID        uint32              `binapi:"u32,name=bde_tbl_id" json:"bde_tbl_id,omitempty"`
224         BdeIsAdd        bool                `binapi:"bool,name=bde_is_add" json:"bde_is_add,omitempty"`
225         BdePayloadProto uint8               `binapi:"u8,name=bde_payload_proto" json:"bde_payload_proto,omitempty"`
226         BdeNPaths       uint8               `binapi:"u8,name=bde_n_paths" json:"-"`
227         BdePaths        []fib_types.FibPath `binapi:"fib_path[bde_n_paths],name=bde_paths" json:"bde_paths,omitempty"`
228 }
229
230 func (m *BierDispEntryDetails) Reset()               { *m = BierDispEntryDetails{} }
231 func (*BierDispEntryDetails) GetMessageName() string { return "bier_disp_entry_details" }
232 func (*BierDispEntryDetails) GetCrcString() string   { return "e5b039a9" }
233 func (*BierDispEntryDetails) GetMessageType() api.MessageType {
234         return api.ReplyMessage
235 }
236
237 func (m *BierDispEntryDetails) Size() int {
238         if m == nil {
239                 return 0
240         }
241         var size int
242         size += 2 // m.BdeBp
243         size += 4 // m.BdeTblID
244         size += 1 // m.BdeIsAdd
245         size += 1 // m.BdePayloadProto
246         size += 1 // m.BdeNPaths
247         for j1 := 0; j1 < len(m.BdePaths); j1++ {
248                 var s1 fib_types.FibPath
249                 _ = s1
250                 if j1 < len(m.BdePaths) {
251                         s1 = m.BdePaths[j1]
252                 }
253                 size += 4      // s1.SwIfIndex
254                 size += 4      // s1.TableID
255                 size += 4      // s1.RpfID
256                 size += 1      // s1.Weight
257                 size += 1      // s1.Preference
258                 size += 4      // s1.Type
259                 size += 4      // s1.Flags
260                 size += 4      // s1.Proto
261                 size += 1 * 16 // s1.Nh.Address
262                 size += 4      // s1.Nh.ViaLabel
263                 size += 4      // s1.Nh.ObjID
264                 size += 4      // s1.Nh.ClassifyTableIndex
265                 size += 1      // s1.NLabels
266                 for j2 := 0; j2 < 16; j2++ {
267                         var s2 fib_types.FibMplsLabel
268                         _ = s2
269                         if j2 < len(s1.LabelStack) {
270                                 s2 = s1.LabelStack[j2]
271                         }
272                         size += 1 // s2.IsUniform
273                         size += 4 // s2.Label
274                         size += 1 // s2.TTL
275                         size += 1 // s2.Exp
276                 }
277         }
278         return size
279 }
280 func (m *BierDispEntryDetails) Marshal(b []byte) ([]byte, error) {
281         var buf *codec.Buffer
282         if b == nil {
283                 buf = codec.NewBuffer(make([]byte, m.Size()))
284         } else {
285                 buf = codec.NewBuffer(b)
286         }
287         buf.EncodeUint16(uint16(m.BdeBp))
288         buf.EncodeUint32(uint32(m.BdeTblID))
289         buf.EncodeBool(m.BdeIsAdd)
290         buf.EncodeUint8(uint8(m.BdePayloadProto))
291         buf.EncodeUint8(uint8(len(m.BdePaths)))
292         for j0 := 0; j0 < len(m.BdePaths); j0++ {
293                 var v0 fib_types.FibPath
294                 if j0 < len(m.BdePaths) {
295                         v0 = m.BdePaths[j0]
296                 }
297                 buf.EncodeUint32(uint32(v0.SwIfIndex))
298                 buf.EncodeUint32(uint32(v0.TableID))
299                 buf.EncodeUint32(uint32(v0.RpfID))
300                 buf.EncodeUint8(uint8(v0.Weight))
301                 buf.EncodeUint8(uint8(v0.Preference))
302                 buf.EncodeUint32(uint32(v0.Type))
303                 buf.EncodeUint32(uint32(v0.Flags))
304                 buf.EncodeUint32(uint32(v0.Proto))
305                 buf.EncodeBytes(v0.Nh.Address.XXX_UnionData[:], 0)
306                 buf.EncodeUint32(uint32(v0.Nh.ViaLabel))
307                 buf.EncodeUint32(uint32(v0.Nh.ObjID))
308                 buf.EncodeUint32(uint32(v0.Nh.ClassifyTableIndex))
309                 buf.EncodeUint8(uint8(v0.NLabels))
310                 for j1 := 0; j1 < 16; j1++ {
311                         var v1 fib_types.FibMplsLabel
312                         if j1 < len(v0.LabelStack) {
313                                 v1 = v0.LabelStack[j1]
314                         }
315                         buf.EncodeUint8(uint8(v1.IsUniform))
316                         buf.EncodeUint32(uint32(v1.Label))
317                         buf.EncodeUint8(uint8(v1.TTL))
318                         buf.EncodeUint8(uint8(v1.Exp))
319                 }
320         }
321         return buf.Bytes(), nil
322 }
323 func (m *BierDispEntryDetails) Unmarshal(b []byte) error {
324         buf := codec.NewBuffer(b)
325         m.BdeBp = buf.DecodeUint16()
326         m.BdeTblID = buf.DecodeUint32()
327         m.BdeIsAdd = buf.DecodeBool()
328         m.BdePayloadProto = buf.DecodeUint8()
329         m.BdeNPaths = buf.DecodeUint8()
330         m.BdePaths = make([]fib_types.FibPath, int(m.BdeNPaths))
331         for j0 := 0; j0 < len(m.BdePaths); j0++ {
332                 m.BdePaths[j0].SwIfIndex = buf.DecodeUint32()
333                 m.BdePaths[j0].TableID = buf.DecodeUint32()
334                 m.BdePaths[j0].RpfID = buf.DecodeUint32()
335                 m.BdePaths[j0].Weight = buf.DecodeUint8()
336                 m.BdePaths[j0].Preference = buf.DecodeUint8()
337                 m.BdePaths[j0].Type = fib_types.FibPathType(buf.DecodeUint32())
338                 m.BdePaths[j0].Flags = fib_types.FibPathFlags(buf.DecodeUint32())
339                 m.BdePaths[j0].Proto = fib_types.FibPathNhProto(buf.DecodeUint32())
340                 copy(m.BdePaths[j0].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
341                 m.BdePaths[j0].Nh.ViaLabel = buf.DecodeUint32()
342                 m.BdePaths[j0].Nh.ObjID = buf.DecodeUint32()
343                 m.BdePaths[j0].Nh.ClassifyTableIndex = buf.DecodeUint32()
344                 m.BdePaths[j0].NLabels = buf.DecodeUint8()
345                 for j1 := 0; j1 < 16; j1++ {
346                         m.BdePaths[j0].LabelStack[j1].IsUniform = buf.DecodeUint8()
347                         m.BdePaths[j0].LabelStack[j1].Label = buf.DecodeUint32()
348                         m.BdePaths[j0].LabelStack[j1].TTL = buf.DecodeUint8()
349                         m.BdePaths[j0].LabelStack[j1].Exp = buf.DecodeUint8()
350                 }
351         }
352         return nil
353 }
354
355 // BierDispEntryDump defines message 'bier_disp_entry_dump'.
356 type BierDispEntryDump struct {
357         BdeTblID uint32 `binapi:"u32,name=bde_tbl_id" json:"bde_tbl_id,omitempty"`
358 }
359
360 func (m *BierDispEntryDump) Reset()               { *m = BierDispEntryDump{} }
361 func (*BierDispEntryDump) GetMessageName() string { return "bier_disp_entry_dump" }
362 func (*BierDispEntryDump) GetCrcString() string   { return "b5fa54ad" }
363 func (*BierDispEntryDump) GetMessageType() api.MessageType {
364         return api.RequestMessage
365 }
366
367 func (m *BierDispEntryDump) Size() int {
368         if m == nil {
369                 return 0
370         }
371         var size int
372         size += 4 // m.BdeTblID
373         return size
374 }
375 func (m *BierDispEntryDump) Marshal(b []byte) ([]byte, error) {
376         var buf *codec.Buffer
377         if b == nil {
378                 buf = codec.NewBuffer(make([]byte, m.Size()))
379         } else {
380                 buf = codec.NewBuffer(b)
381         }
382         buf.EncodeUint32(uint32(m.BdeTblID))
383         return buf.Bytes(), nil
384 }
385 func (m *BierDispEntryDump) Unmarshal(b []byte) error {
386         buf := codec.NewBuffer(b)
387         m.BdeTblID = buf.DecodeUint32()
388         return nil
389 }
390
391 // BierDispTableAddDel defines message 'bier_disp_table_add_del'.
392 type BierDispTableAddDel struct {
393         BdtTblID uint32 `binapi:"u32,name=bdt_tbl_id" json:"bdt_tbl_id,omitempty"`
394         BdtIsAdd bool   `binapi:"bool,name=bdt_is_add" json:"bdt_is_add,omitempty"`
395 }
396
397 func (m *BierDispTableAddDel) Reset()               { *m = BierDispTableAddDel{} }
398 func (*BierDispTableAddDel) GetMessageName() string { return "bier_disp_table_add_del" }
399 func (*BierDispTableAddDel) GetCrcString() string   { return "889657ac" }
400 func (*BierDispTableAddDel) GetMessageType() api.MessageType {
401         return api.RequestMessage
402 }
403
404 func (m *BierDispTableAddDel) Size() int {
405         if m == nil {
406                 return 0
407         }
408         var size int
409         size += 4 // m.BdtTblID
410         size += 1 // m.BdtIsAdd
411         return size
412 }
413 func (m *BierDispTableAddDel) Marshal(b []byte) ([]byte, error) {
414         var buf *codec.Buffer
415         if b == nil {
416                 buf = codec.NewBuffer(make([]byte, m.Size()))
417         } else {
418                 buf = codec.NewBuffer(b)
419         }
420         buf.EncodeUint32(uint32(m.BdtTblID))
421         buf.EncodeBool(m.BdtIsAdd)
422         return buf.Bytes(), nil
423 }
424 func (m *BierDispTableAddDel) Unmarshal(b []byte) error {
425         buf := codec.NewBuffer(b)
426         m.BdtTblID = buf.DecodeUint32()
427         m.BdtIsAdd = buf.DecodeBool()
428         return nil
429 }
430
431 // BierDispTableAddDelReply defines message 'bier_disp_table_add_del_reply'.
432 type BierDispTableAddDelReply struct {
433         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
434 }
435
436 func (m *BierDispTableAddDelReply) Reset()               { *m = BierDispTableAddDelReply{} }
437 func (*BierDispTableAddDelReply) GetMessageName() string { return "bier_disp_table_add_del_reply" }
438 func (*BierDispTableAddDelReply) GetCrcString() string   { return "e8d4e804" }
439 func (*BierDispTableAddDelReply) GetMessageType() api.MessageType {
440         return api.ReplyMessage
441 }
442
443 func (m *BierDispTableAddDelReply) Size() int {
444         if m == nil {
445                 return 0
446         }
447         var size int
448         size += 4 // m.Retval
449         return size
450 }
451 func (m *BierDispTableAddDelReply) Marshal(b []byte) ([]byte, error) {
452         var buf *codec.Buffer
453         if b == nil {
454                 buf = codec.NewBuffer(make([]byte, m.Size()))
455         } else {
456                 buf = codec.NewBuffer(b)
457         }
458         buf.EncodeUint32(uint32(m.Retval))
459         return buf.Bytes(), nil
460 }
461 func (m *BierDispTableAddDelReply) Unmarshal(b []byte) error {
462         buf := codec.NewBuffer(b)
463         m.Retval = int32(buf.DecodeUint32())
464         return nil
465 }
466
467 // BierDispTableDetails defines message 'bier_disp_table_details'.
468 type BierDispTableDetails struct {
469         BdtTblID uint32 `binapi:"u32,name=bdt_tbl_id" json:"bdt_tbl_id,omitempty"`
470 }
471
472 func (m *BierDispTableDetails) Reset()               { *m = BierDispTableDetails{} }
473 func (*BierDispTableDetails) GetMessageName() string { return "bier_disp_table_details" }
474 func (*BierDispTableDetails) GetCrcString() string   { return "d27942c0" }
475 func (*BierDispTableDetails) GetMessageType() api.MessageType {
476         return api.ReplyMessage
477 }
478
479 func (m *BierDispTableDetails) Size() int {
480         if m == nil {
481                 return 0
482         }
483         var size int
484         size += 4 // m.BdtTblID
485         return size
486 }
487 func (m *BierDispTableDetails) Marshal(b []byte) ([]byte, error) {
488         var buf *codec.Buffer
489         if b == nil {
490                 buf = codec.NewBuffer(make([]byte, m.Size()))
491         } else {
492                 buf = codec.NewBuffer(b)
493         }
494         buf.EncodeUint32(uint32(m.BdtTblID))
495         return buf.Bytes(), nil
496 }
497 func (m *BierDispTableDetails) Unmarshal(b []byte) error {
498         buf := codec.NewBuffer(b)
499         m.BdtTblID = buf.DecodeUint32()
500         return nil
501 }
502
503 // BierDispTableDump defines message 'bier_disp_table_dump'.
504 type BierDispTableDump struct{}
505
506 func (m *BierDispTableDump) Reset()               { *m = BierDispTableDump{} }
507 func (*BierDispTableDump) GetMessageName() string { return "bier_disp_table_dump" }
508 func (*BierDispTableDump) GetCrcString() string   { return "51077d14" }
509 func (*BierDispTableDump) GetMessageType() api.MessageType {
510         return api.RequestMessage
511 }
512
513 func (m *BierDispTableDump) Size() int {
514         if m == nil {
515                 return 0
516         }
517         var size int
518         return size
519 }
520 func (m *BierDispTableDump) Marshal(b []byte) ([]byte, error) {
521         var buf *codec.Buffer
522         if b == nil {
523                 buf = codec.NewBuffer(make([]byte, m.Size()))
524         } else {
525                 buf = codec.NewBuffer(b)
526         }
527         return buf.Bytes(), nil
528 }
529 func (m *BierDispTableDump) Unmarshal(b []byte) error {
530         return nil
531 }
532
533 // BierImpAdd defines message 'bier_imp_add'.
534 type BierImpAdd struct {
535         BiTblID  BierTableID `binapi:"bier_table_id,name=bi_tbl_id" json:"bi_tbl_id,omitempty"`
536         BiSrc    uint16      `binapi:"u16,name=bi_src" json:"bi_src,omitempty"`
537         BiNBytes uint8       `binapi:"u8,name=bi_n_bytes" json:"-"`
538         BiBytes  []byte      `binapi:"u8[bi_n_bytes],name=bi_bytes" json:"bi_bytes,omitempty"`
539 }
540
541 func (m *BierImpAdd) Reset()               { *m = BierImpAdd{} }
542 func (*BierImpAdd) GetMessageName() string { return "bier_imp_add" }
543 func (*BierImpAdd) GetCrcString() string   { return "3856dc3d" }
544 func (*BierImpAdd) GetMessageType() api.MessageType {
545         return api.RequestMessage
546 }
547
548 func (m *BierImpAdd) Size() int {
549         if m == nil {
550                 return 0
551         }
552         var size int
553         size += 1                  // m.BiTblID.BtSet
554         size += 1                  // m.BiTblID.BtSubDomain
555         size += 1                  // m.BiTblID.BtHdrLenID
556         size += 2                  // m.BiSrc
557         size += 1                  // m.BiNBytes
558         size += 1 * len(m.BiBytes) // m.BiBytes
559         return size
560 }
561 func (m *BierImpAdd) Marshal(b []byte) ([]byte, error) {
562         var buf *codec.Buffer
563         if b == nil {
564                 buf = codec.NewBuffer(make([]byte, m.Size()))
565         } else {
566                 buf = codec.NewBuffer(b)
567         }
568         buf.EncodeUint8(uint8(m.BiTblID.BtSet))
569         buf.EncodeUint8(uint8(m.BiTblID.BtSubDomain))
570         buf.EncodeUint8(uint8(m.BiTblID.BtHdrLenID))
571         buf.EncodeUint16(uint16(m.BiSrc))
572         buf.EncodeUint8(uint8(len(m.BiBytes)))
573         buf.EncodeBytes(m.BiBytes[:], 0)
574         return buf.Bytes(), nil
575 }
576 func (m *BierImpAdd) Unmarshal(b []byte) error {
577         buf := codec.NewBuffer(b)
578         m.BiTblID.BtSet = buf.DecodeUint8()
579         m.BiTblID.BtSubDomain = buf.DecodeUint8()
580         m.BiTblID.BtHdrLenID = buf.DecodeUint8()
581         m.BiSrc = buf.DecodeUint16()
582         m.BiNBytes = buf.DecodeUint8()
583         copy(m.BiBytes[:], buf.DecodeBytes(0))
584         return nil
585 }
586
587 // BierImpAddReply defines message 'bier_imp_add_reply'.
588 type BierImpAddReply struct {
589         Retval  int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
590         BiIndex uint32 `binapi:"u32,name=bi_index" json:"bi_index,omitempty"`
591 }
592
593 func (m *BierImpAddReply) Reset()               { *m = BierImpAddReply{} }
594 func (*BierImpAddReply) GetMessageName() string { return "bier_imp_add_reply" }
595 func (*BierImpAddReply) GetCrcString() string   { return "d49c5793" }
596 func (*BierImpAddReply) GetMessageType() api.MessageType {
597         return api.ReplyMessage
598 }
599
600 func (m *BierImpAddReply) Size() int {
601         if m == nil {
602                 return 0
603         }
604         var size int
605         size += 4 // m.Retval
606         size += 4 // m.BiIndex
607         return size
608 }
609 func (m *BierImpAddReply) Marshal(b []byte) ([]byte, error) {
610         var buf *codec.Buffer
611         if b == nil {
612                 buf = codec.NewBuffer(make([]byte, m.Size()))
613         } else {
614                 buf = codec.NewBuffer(b)
615         }
616         buf.EncodeUint32(uint32(m.Retval))
617         buf.EncodeUint32(uint32(m.BiIndex))
618         return buf.Bytes(), nil
619 }
620 func (m *BierImpAddReply) Unmarshal(b []byte) error {
621         buf := codec.NewBuffer(b)
622         m.Retval = int32(buf.DecodeUint32())
623         m.BiIndex = buf.DecodeUint32()
624         return nil
625 }
626
627 // BierImpDel defines message 'bier_imp_del'.
628 type BierImpDel struct {
629         BiIndex uint32 `binapi:"u32,name=bi_index" json:"bi_index,omitempty"`
630 }
631
632 func (m *BierImpDel) Reset()               { *m = BierImpDel{} }
633 func (*BierImpDel) GetMessageName() string { return "bier_imp_del" }
634 func (*BierImpDel) GetCrcString() string   { return "7d45edf6" }
635 func (*BierImpDel) GetMessageType() api.MessageType {
636         return api.RequestMessage
637 }
638
639 func (m *BierImpDel) Size() int {
640         if m == nil {
641                 return 0
642         }
643         var size int
644         size += 4 // m.BiIndex
645         return size
646 }
647 func (m *BierImpDel) Marshal(b []byte) ([]byte, error) {
648         var buf *codec.Buffer
649         if b == nil {
650                 buf = codec.NewBuffer(make([]byte, m.Size()))
651         } else {
652                 buf = codec.NewBuffer(b)
653         }
654         buf.EncodeUint32(uint32(m.BiIndex))
655         return buf.Bytes(), nil
656 }
657 func (m *BierImpDel) Unmarshal(b []byte) error {
658         buf := codec.NewBuffer(b)
659         m.BiIndex = buf.DecodeUint32()
660         return nil
661 }
662
663 // BierImpDelReply defines message 'bier_imp_del_reply'.
664 type BierImpDelReply struct {
665         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
666 }
667
668 func (m *BierImpDelReply) Reset()               { *m = BierImpDelReply{} }
669 func (*BierImpDelReply) GetMessageName() string { return "bier_imp_del_reply" }
670 func (*BierImpDelReply) GetCrcString() string   { return "e8d4e804" }
671 func (*BierImpDelReply) GetMessageType() api.MessageType {
672         return api.ReplyMessage
673 }
674
675 func (m *BierImpDelReply) Size() int {
676         if m == nil {
677                 return 0
678         }
679         var size int
680         size += 4 // m.Retval
681         return size
682 }
683 func (m *BierImpDelReply) Marshal(b []byte) ([]byte, error) {
684         var buf *codec.Buffer
685         if b == nil {
686                 buf = codec.NewBuffer(make([]byte, m.Size()))
687         } else {
688                 buf = codec.NewBuffer(b)
689         }
690         buf.EncodeUint32(uint32(m.Retval))
691         return buf.Bytes(), nil
692 }
693 func (m *BierImpDelReply) Unmarshal(b []byte) error {
694         buf := codec.NewBuffer(b)
695         m.Retval = int32(buf.DecodeUint32())
696         return nil
697 }
698
699 // BierImpDetails defines message 'bier_imp_details'.
700 type BierImpDetails struct {
701         BiTblID  BierTableID `binapi:"bier_table_id,name=bi_tbl_id" json:"bi_tbl_id,omitempty"`
702         BiSrc    uint16      `binapi:"u16,name=bi_src" json:"bi_src,omitempty"`
703         BiNBytes uint8       `binapi:"u8,name=bi_n_bytes" json:"-"`
704         BiBytes  []byte      `binapi:"u8[bi_n_bytes],name=bi_bytes" json:"bi_bytes,omitempty"`
705 }
706
707 func (m *BierImpDetails) Reset()               { *m = BierImpDetails{} }
708 func (*BierImpDetails) GetMessageName() string { return "bier_imp_details" }
709 func (*BierImpDetails) GetCrcString() string   { return "b76192df" }
710 func (*BierImpDetails) GetMessageType() api.MessageType {
711         return api.ReplyMessage
712 }
713
714 func (m *BierImpDetails) Size() int {
715         if m == nil {
716                 return 0
717         }
718         var size int
719         size += 1                  // m.BiTblID.BtSet
720         size += 1                  // m.BiTblID.BtSubDomain
721         size += 1                  // m.BiTblID.BtHdrLenID
722         size += 2                  // m.BiSrc
723         size += 1                  // m.BiNBytes
724         size += 1 * len(m.BiBytes) // m.BiBytes
725         return size
726 }
727 func (m *BierImpDetails) Marshal(b []byte) ([]byte, error) {
728         var buf *codec.Buffer
729         if b == nil {
730                 buf = codec.NewBuffer(make([]byte, m.Size()))
731         } else {
732                 buf = codec.NewBuffer(b)
733         }
734         buf.EncodeUint8(uint8(m.BiTblID.BtSet))
735         buf.EncodeUint8(uint8(m.BiTblID.BtSubDomain))
736         buf.EncodeUint8(uint8(m.BiTblID.BtHdrLenID))
737         buf.EncodeUint16(uint16(m.BiSrc))
738         buf.EncodeUint8(uint8(len(m.BiBytes)))
739         buf.EncodeBytes(m.BiBytes[:], 0)
740         return buf.Bytes(), nil
741 }
742 func (m *BierImpDetails) Unmarshal(b []byte) error {
743         buf := codec.NewBuffer(b)
744         m.BiTblID.BtSet = buf.DecodeUint8()
745         m.BiTblID.BtSubDomain = buf.DecodeUint8()
746         m.BiTblID.BtHdrLenID = buf.DecodeUint8()
747         m.BiSrc = buf.DecodeUint16()
748         m.BiNBytes = buf.DecodeUint8()
749         copy(m.BiBytes[:], buf.DecodeBytes(0))
750         return nil
751 }
752
753 // BierImpDump defines message 'bier_imp_dump'.
754 type BierImpDump struct{}
755
756 func (m *BierImpDump) Reset()               { *m = BierImpDump{} }
757 func (*BierImpDump) GetMessageName() string { return "bier_imp_dump" }
758 func (*BierImpDump) GetCrcString() string   { return "51077d14" }
759 func (*BierImpDump) GetMessageType() api.MessageType {
760         return api.RequestMessage
761 }
762
763 func (m *BierImpDump) Size() int {
764         if m == nil {
765                 return 0
766         }
767         var size int
768         return size
769 }
770 func (m *BierImpDump) Marshal(b []byte) ([]byte, error) {
771         var buf *codec.Buffer
772         if b == nil {
773                 buf = codec.NewBuffer(make([]byte, m.Size()))
774         } else {
775                 buf = codec.NewBuffer(b)
776         }
777         return buf.Bytes(), nil
778 }
779 func (m *BierImpDump) Unmarshal(b []byte) error {
780         return nil
781 }
782
783 // BierRouteAddDel defines message 'bier_route_add_del'.
784 type BierRouteAddDel struct {
785         BrIsAdd     bool      `binapi:"bool,name=br_is_add" json:"br_is_add,omitempty"`
786         BrIsReplace bool      `binapi:"bool,name=br_is_replace" json:"br_is_replace,omitempty"`
787         BrRoute     BierRoute `binapi:"bier_route,name=br_route" json:"br_route,omitempty"`
788 }
789
790 func (m *BierRouteAddDel) Reset()               { *m = BierRouteAddDel{} }
791 func (*BierRouteAddDel) GetMessageName() string { return "bier_route_add_del" }
792 func (*BierRouteAddDel) GetCrcString() string   { return "f29edca0" }
793 func (*BierRouteAddDel) GetMessageType() api.MessageType {
794         return api.RequestMessage
795 }
796
797 func (m *BierRouteAddDel) Size() int {
798         if m == nil {
799                 return 0
800         }
801         var size int
802         size += 1 // m.BrIsAdd
803         size += 1 // m.BrIsReplace
804         size += 4 // m.BrRoute.BrBp
805         size += 1 // m.BrRoute.BrTblID.BtSet
806         size += 1 // m.BrRoute.BrTblID.BtSubDomain
807         size += 1 // m.BrRoute.BrTblID.BtHdrLenID
808         size += 1 // m.BrRoute.BrNPaths
809         for j2 := 0; j2 < len(m.BrRoute.BrPaths); j2++ {
810                 var s2 fib_types.FibPath
811                 _ = s2
812                 if j2 < len(m.BrRoute.BrPaths) {
813                         s2 = m.BrRoute.BrPaths[j2]
814                 }
815                 size += 4      // s2.SwIfIndex
816                 size += 4      // s2.TableID
817                 size += 4      // s2.RpfID
818                 size += 1      // s2.Weight
819                 size += 1      // s2.Preference
820                 size += 4      // s2.Type
821                 size += 4      // s2.Flags
822                 size += 4      // s2.Proto
823                 size += 1 * 16 // s2.Nh.Address
824                 size += 4      // s2.Nh.ViaLabel
825                 size += 4      // s2.Nh.ObjID
826                 size += 4      // s2.Nh.ClassifyTableIndex
827                 size += 1      // s2.NLabels
828                 for j3 := 0; j3 < 16; j3++ {
829                         var s3 fib_types.FibMplsLabel
830                         _ = s3
831                         if j3 < len(s2.LabelStack) {
832                                 s3 = s2.LabelStack[j3]
833                         }
834                         size += 1 // s3.IsUniform
835                         size += 4 // s3.Label
836                         size += 1 // s3.TTL
837                         size += 1 // s3.Exp
838                 }
839         }
840         return size
841 }
842 func (m *BierRouteAddDel) Marshal(b []byte) ([]byte, error) {
843         var buf *codec.Buffer
844         if b == nil {
845                 buf = codec.NewBuffer(make([]byte, m.Size()))
846         } else {
847                 buf = codec.NewBuffer(b)
848         }
849         buf.EncodeBool(m.BrIsAdd)
850         buf.EncodeBool(m.BrIsReplace)
851         buf.EncodeUint32(uint32(m.BrRoute.BrBp))
852         buf.EncodeUint8(uint8(m.BrRoute.BrTblID.BtSet))
853         buf.EncodeUint8(uint8(m.BrRoute.BrTblID.BtSubDomain))
854         buf.EncodeUint8(uint8(m.BrRoute.BrTblID.BtHdrLenID))
855         buf.EncodeUint8(uint8(len(m.BrRoute.BrPaths)))
856         for j1 := 0; j1 < len(m.BrRoute.BrPaths); j1++ {
857                 var v1 fib_types.FibPath
858                 if j1 < len(m.BrRoute.BrPaths) {
859                         v1 = m.BrRoute.BrPaths[j1]
860                 }
861                 buf.EncodeUint32(uint32(v1.SwIfIndex))
862                 buf.EncodeUint32(uint32(v1.TableID))
863                 buf.EncodeUint32(uint32(v1.RpfID))
864                 buf.EncodeUint8(uint8(v1.Weight))
865                 buf.EncodeUint8(uint8(v1.Preference))
866                 buf.EncodeUint32(uint32(v1.Type))
867                 buf.EncodeUint32(uint32(v1.Flags))
868                 buf.EncodeUint32(uint32(v1.Proto))
869                 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 0)
870                 buf.EncodeUint32(uint32(v1.Nh.ViaLabel))
871                 buf.EncodeUint32(uint32(v1.Nh.ObjID))
872                 buf.EncodeUint32(uint32(v1.Nh.ClassifyTableIndex))
873                 buf.EncodeUint8(uint8(v1.NLabels))
874                 for j2 := 0; j2 < 16; j2++ {
875                         var v2 fib_types.FibMplsLabel
876                         if j2 < len(v1.LabelStack) {
877                                 v2 = v1.LabelStack[j2]
878                         }
879                         buf.EncodeUint8(uint8(v2.IsUniform))
880                         buf.EncodeUint32(uint32(v2.Label))
881                         buf.EncodeUint8(uint8(v2.TTL))
882                         buf.EncodeUint8(uint8(v2.Exp))
883                 }
884         }
885         return buf.Bytes(), nil
886 }
887 func (m *BierRouteAddDel) Unmarshal(b []byte) error {
888         buf := codec.NewBuffer(b)
889         m.BrIsAdd = buf.DecodeBool()
890         m.BrIsReplace = buf.DecodeBool()
891         m.BrRoute.BrBp = buf.DecodeUint32()
892         m.BrRoute.BrTblID.BtSet = buf.DecodeUint8()
893         m.BrRoute.BrTblID.BtSubDomain = buf.DecodeUint8()
894         m.BrRoute.BrTblID.BtHdrLenID = buf.DecodeUint8()
895         m.BrRoute.BrNPaths = buf.DecodeUint8()
896         m.BrRoute.BrPaths = make([]fib_types.FibPath, int(m.BrRoute.BrNPaths))
897         for j1 := 0; j1 < len(m.BrRoute.BrPaths); j1++ {
898                 m.BrRoute.BrPaths[j1].SwIfIndex = buf.DecodeUint32()
899                 m.BrRoute.BrPaths[j1].TableID = buf.DecodeUint32()
900                 m.BrRoute.BrPaths[j1].RpfID = buf.DecodeUint32()
901                 m.BrRoute.BrPaths[j1].Weight = buf.DecodeUint8()
902                 m.BrRoute.BrPaths[j1].Preference = buf.DecodeUint8()
903                 m.BrRoute.BrPaths[j1].Type = fib_types.FibPathType(buf.DecodeUint32())
904                 m.BrRoute.BrPaths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32())
905                 m.BrRoute.BrPaths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32())
906                 copy(m.BrRoute.BrPaths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
907                 m.BrRoute.BrPaths[j1].Nh.ViaLabel = buf.DecodeUint32()
908                 m.BrRoute.BrPaths[j1].Nh.ObjID = buf.DecodeUint32()
909                 m.BrRoute.BrPaths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
910                 m.BrRoute.BrPaths[j1].NLabels = buf.DecodeUint8()
911                 for j2 := 0; j2 < 16; j2++ {
912                         m.BrRoute.BrPaths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
913                         m.BrRoute.BrPaths[j1].LabelStack[j2].Label = buf.DecodeUint32()
914                         m.BrRoute.BrPaths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
915                         m.BrRoute.BrPaths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
916                 }
917         }
918         return nil
919 }
920
921 // BierRouteAddDelReply defines message 'bier_route_add_del_reply'.
922 type BierRouteAddDelReply struct {
923         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
924 }
925
926 func (m *BierRouteAddDelReply) Reset()               { *m = BierRouteAddDelReply{} }
927 func (*BierRouteAddDelReply) GetMessageName() string { return "bier_route_add_del_reply" }
928 func (*BierRouteAddDelReply) GetCrcString() string   { return "e8d4e804" }
929 func (*BierRouteAddDelReply) GetMessageType() api.MessageType {
930         return api.ReplyMessage
931 }
932
933 func (m *BierRouteAddDelReply) Size() int {
934         if m == nil {
935                 return 0
936         }
937         var size int
938         size += 4 // m.Retval
939         return size
940 }
941 func (m *BierRouteAddDelReply) Marshal(b []byte) ([]byte, error) {
942         var buf *codec.Buffer
943         if b == nil {
944                 buf = codec.NewBuffer(make([]byte, m.Size()))
945         } else {
946                 buf = codec.NewBuffer(b)
947         }
948         buf.EncodeUint32(uint32(m.Retval))
949         return buf.Bytes(), nil
950 }
951 func (m *BierRouteAddDelReply) Unmarshal(b []byte) error {
952         buf := codec.NewBuffer(b)
953         m.Retval = int32(buf.DecodeUint32())
954         return nil
955 }
956
957 // BierRouteDetails defines message 'bier_route_details'.
958 type BierRouteDetails struct {
959         BrRoute BierRoute `binapi:"bier_route,name=br_route" json:"br_route,omitempty"`
960 }
961
962 func (m *BierRouteDetails) Reset()               { *m = BierRouteDetails{} }
963 func (*BierRouteDetails) GetMessageName() string { return "bier_route_details" }
964 func (*BierRouteDetails) GetCrcString() string   { return "39ee6a56" }
965 func (*BierRouteDetails) GetMessageType() api.MessageType {
966         return api.ReplyMessage
967 }
968
969 func (m *BierRouteDetails) Size() int {
970         if m == nil {
971                 return 0
972         }
973         var size int
974         size += 4 // m.BrRoute.BrBp
975         size += 1 // m.BrRoute.BrTblID.BtSet
976         size += 1 // m.BrRoute.BrTblID.BtSubDomain
977         size += 1 // m.BrRoute.BrTblID.BtHdrLenID
978         size += 1 // m.BrRoute.BrNPaths
979         for j2 := 0; j2 < len(m.BrRoute.BrPaths); j2++ {
980                 var s2 fib_types.FibPath
981                 _ = s2
982                 if j2 < len(m.BrRoute.BrPaths) {
983                         s2 = m.BrRoute.BrPaths[j2]
984                 }
985                 size += 4      // s2.SwIfIndex
986                 size += 4      // s2.TableID
987                 size += 4      // s2.RpfID
988                 size += 1      // s2.Weight
989                 size += 1      // s2.Preference
990                 size += 4      // s2.Type
991                 size += 4      // s2.Flags
992                 size += 4      // s2.Proto
993                 size += 1 * 16 // s2.Nh.Address
994                 size += 4      // s2.Nh.ViaLabel
995                 size += 4      // s2.Nh.ObjID
996                 size += 4      // s2.Nh.ClassifyTableIndex
997                 size += 1      // s2.NLabels
998                 for j3 := 0; j3 < 16; j3++ {
999                         var s3 fib_types.FibMplsLabel
1000                         _ = s3
1001                         if j3 < len(s2.LabelStack) {
1002                                 s3 = s2.LabelStack[j3]
1003                         }
1004                         size += 1 // s3.IsUniform
1005                         size += 4 // s3.Label
1006                         size += 1 // s3.TTL
1007                         size += 1 // s3.Exp
1008                 }
1009         }
1010         return size
1011 }
1012 func (m *BierRouteDetails) Marshal(b []byte) ([]byte, error) {
1013         var buf *codec.Buffer
1014         if b == nil {
1015                 buf = codec.NewBuffer(make([]byte, m.Size()))
1016         } else {
1017                 buf = codec.NewBuffer(b)
1018         }
1019         buf.EncodeUint32(uint32(m.BrRoute.BrBp))
1020         buf.EncodeUint8(uint8(m.BrRoute.BrTblID.BtSet))
1021         buf.EncodeUint8(uint8(m.BrRoute.BrTblID.BtSubDomain))
1022         buf.EncodeUint8(uint8(m.BrRoute.BrTblID.BtHdrLenID))
1023         buf.EncodeUint8(uint8(len(m.BrRoute.BrPaths)))
1024         for j1 := 0; j1 < len(m.BrRoute.BrPaths); j1++ {
1025                 var v1 fib_types.FibPath
1026                 if j1 < len(m.BrRoute.BrPaths) {
1027                         v1 = m.BrRoute.BrPaths[j1]
1028                 }
1029                 buf.EncodeUint32(uint32(v1.SwIfIndex))
1030                 buf.EncodeUint32(uint32(v1.TableID))
1031                 buf.EncodeUint32(uint32(v1.RpfID))
1032                 buf.EncodeUint8(uint8(v1.Weight))
1033                 buf.EncodeUint8(uint8(v1.Preference))
1034                 buf.EncodeUint32(uint32(v1.Type))
1035                 buf.EncodeUint32(uint32(v1.Flags))
1036                 buf.EncodeUint32(uint32(v1.Proto))
1037                 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 0)
1038                 buf.EncodeUint32(uint32(v1.Nh.ViaLabel))
1039                 buf.EncodeUint32(uint32(v1.Nh.ObjID))
1040                 buf.EncodeUint32(uint32(v1.Nh.ClassifyTableIndex))
1041                 buf.EncodeUint8(uint8(v1.NLabels))
1042                 for j2 := 0; j2 < 16; j2++ {
1043                         var v2 fib_types.FibMplsLabel
1044                         if j2 < len(v1.LabelStack) {
1045                                 v2 = v1.LabelStack[j2]
1046                         }
1047                         buf.EncodeUint8(uint8(v2.IsUniform))
1048                         buf.EncodeUint32(uint32(v2.Label))
1049                         buf.EncodeUint8(uint8(v2.TTL))
1050                         buf.EncodeUint8(uint8(v2.Exp))
1051                 }
1052         }
1053         return buf.Bytes(), nil
1054 }
1055 func (m *BierRouteDetails) Unmarshal(b []byte) error {
1056         buf := codec.NewBuffer(b)
1057         m.BrRoute.BrBp = buf.DecodeUint32()
1058         m.BrRoute.BrTblID.BtSet = buf.DecodeUint8()
1059         m.BrRoute.BrTblID.BtSubDomain = buf.DecodeUint8()
1060         m.BrRoute.BrTblID.BtHdrLenID = buf.DecodeUint8()
1061         m.BrRoute.BrNPaths = buf.DecodeUint8()
1062         m.BrRoute.BrPaths = make([]fib_types.FibPath, int(m.BrRoute.BrNPaths))
1063         for j1 := 0; j1 < len(m.BrRoute.BrPaths); j1++ {
1064                 m.BrRoute.BrPaths[j1].SwIfIndex = buf.DecodeUint32()
1065                 m.BrRoute.BrPaths[j1].TableID = buf.DecodeUint32()
1066                 m.BrRoute.BrPaths[j1].RpfID = buf.DecodeUint32()
1067                 m.BrRoute.BrPaths[j1].Weight = buf.DecodeUint8()
1068                 m.BrRoute.BrPaths[j1].Preference = buf.DecodeUint8()
1069                 m.BrRoute.BrPaths[j1].Type = fib_types.FibPathType(buf.DecodeUint32())
1070                 m.BrRoute.BrPaths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32())
1071                 m.BrRoute.BrPaths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32())
1072                 copy(m.BrRoute.BrPaths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
1073                 m.BrRoute.BrPaths[j1].Nh.ViaLabel = buf.DecodeUint32()
1074                 m.BrRoute.BrPaths[j1].Nh.ObjID = buf.DecodeUint32()
1075                 m.BrRoute.BrPaths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
1076                 m.BrRoute.BrPaths[j1].NLabels = buf.DecodeUint8()
1077                 for j2 := 0; j2 < 16; j2++ {
1078                         m.BrRoute.BrPaths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
1079                         m.BrRoute.BrPaths[j1].LabelStack[j2].Label = buf.DecodeUint32()
1080                         m.BrRoute.BrPaths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
1081                         m.BrRoute.BrPaths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
1082                 }
1083         }
1084         return nil
1085 }
1086
1087 // BierRouteDump defines message 'bier_route_dump'.
1088 type BierRouteDump struct {
1089         BrTblID BierTableID `binapi:"bier_table_id,name=br_tbl_id" json:"br_tbl_id,omitempty"`
1090 }
1091
1092 func (m *BierRouteDump) Reset()               { *m = BierRouteDump{} }
1093 func (*BierRouteDump) GetMessageName() string { return "bier_route_dump" }
1094 func (*BierRouteDump) GetCrcString() string   { return "38339846" }
1095 func (*BierRouteDump) GetMessageType() api.MessageType {
1096         return api.RequestMessage
1097 }
1098
1099 func (m *BierRouteDump) Size() int {
1100         if m == nil {
1101                 return 0
1102         }
1103         var size int
1104         size += 1 // m.BrTblID.BtSet
1105         size += 1 // m.BrTblID.BtSubDomain
1106         size += 1 // m.BrTblID.BtHdrLenID
1107         return size
1108 }
1109 func (m *BierRouteDump) Marshal(b []byte) ([]byte, error) {
1110         var buf *codec.Buffer
1111         if b == nil {
1112                 buf = codec.NewBuffer(make([]byte, m.Size()))
1113         } else {
1114                 buf = codec.NewBuffer(b)
1115         }
1116         buf.EncodeUint8(uint8(m.BrTblID.BtSet))
1117         buf.EncodeUint8(uint8(m.BrTblID.BtSubDomain))
1118         buf.EncodeUint8(uint8(m.BrTblID.BtHdrLenID))
1119         return buf.Bytes(), nil
1120 }
1121 func (m *BierRouteDump) Unmarshal(b []byte) error {
1122         buf := codec.NewBuffer(b)
1123         m.BrTblID.BtSet = buf.DecodeUint8()
1124         m.BrTblID.BtSubDomain = buf.DecodeUint8()
1125         m.BrTblID.BtHdrLenID = buf.DecodeUint8()
1126         return nil
1127 }
1128
1129 // BierTableAddDel defines message 'bier_table_add_del'.
1130 type BierTableAddDel struct {
1131         BtTblID BierTableID `binapi:"bier_table_id,name=bt_tbl_id" json:"bt_tbl_id,omitempty"`
1132         BtLabel uint32      `binapi:"u32,name=bt_label" json:"bt_label,omitempty"`
1133         BtIsAdd bool        `binapi:"bool,name=bt_is_add" json:"bt_is_add,omitempty"`
1134 }
1135
1136 func (m *BierTableAddDel) Reset()               { *m = BierTableAddDel{} }
1137 func (*BierTableAddDel) GetMessageName() string { return "bier_table_add_del" }
1138 func (*BierTableAddDel) GetCrcString() string   { return "35e59209" }
1139 func (*BierTableAddDel) GetMessageType() api.MessageType {
1140         return api.RequestMessage
1141 }
1142
1143 func (m *BierTableAddDel) Size() int {
1144         if m == nil {
1145                 return 0
1146         }
1147         var size int
1148         size += 1 // m.BtTblID.BtSet
1149         size += 1 // m.BtTblID.BtSubDomain
1150         size += 1 // m.BtTblID.BtHdrLenID
1151         size += 4 // m.BtLabel
1152         size += 1 // m.BtIsAdd
1153         return size
1154 }
1155 func (m *BierTableAddDel) Marshal(b []byte) ([]byte, error) {
1156         var buf *codec.Buffer
1157         if b == nil {
1158                 buf = codec.NewBuffer(make([]byte, m.Size()))
1159         } else {
1160                 buf = codec.NewBuffer(b)
1161         }
1162         buf.EncodeUint8(uint8(m.BtTblID.BtSet))
1163         buf.EncodeUint8(uint8(m.BtTblID.BtSubDomain))
1164         buf.EncodeUint8(uint8(m.BtTblID.BtHdrLenID))
1165         buf.EncodeUint32(uint32(m.BtLabel))
1166         buf.EncodeBool(m.BtIsAdd)
1167         return buf.Bytes(), nil
1168 }
1169 func (m *BierTableAddDel) Unmarshal(b []byte) error {
1170         buf := codec.NewBuffer(b)
1171         m.BtTblID.BtSet = buf.DecodeUint8()
1172         m.BtTblID.BtSubDomain = buf.DecodeUint8()
1173         m.BtTblID.BtHdrLenID = buf.DecodeUint8()
1174         m.BtLabel = buf.DecodeUint32()
1175         m.BtIsAdd = buf.DecodeBool()
1176         return nil
1177 }
1178
1179 // BierTableAddDelReply defines message 'bier_table_add_del_reply'.
1180 type BierTableAddDelReply struct {
1181         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1182 }
1183
1184 func (m *BierTableAddDelReply) Reset()               { *m = BierTableAddDelReply{} }
1185 func (*BierTableAddDelReply) GetMessageName() string { return "bier_table_add_del_reply" }
1186 func (*BierTableAddDelReply) GetCrcString() string   { return "e8d4e804" }
1187 func (*BierTableAddDelReply) GetMessageType() api.MessageType {
1188         return api.ReplyMessage
1189 }
1190
1191 func (m *BierTableAddDelReply) Size() int {
1192         if m == nil {
1193                 return 0
1194         }
1195         var size int
1196         size += 4 // m.Retval
1197         return size
1198 }
1199 func (m *BierTableAddDelReply) Marshal(b []byte) ([]byte, error) {
1200         var buf *codec.Buffer
1201         if b == nil {
1202                 buf = codec.NewBuffer(make([]byte, m.Size()))
1203         } else {
1204                 buf = codec.NewBuffer(b)
1205         }
1206         buf.EncodeUint32(uint32(m.Retval))
1207         return buf.Bytes(), nil
1208 }
1209 func (m *BierTableAddDelReply) Unmarshal(b []byte) error {
1210         buf := codec.NewBuffer(b)
1211         m.Retval = int32(buf.DecodeUint32())
1212         return nil
1213 }
1214
1215 // BierTableDetails defines message 'bier_table_details'.
1216 type BierTableDetails struct {
1217         BtLabel uint32      `binapi:"u32,name=bt_label" json:"bt_label,omitempty"`
1218         BtTblID BierTableID `binapi:"bier_table_id,name=bt_tbl_id" json:"bt_tbl_id,omitempty"`
1219 }
1220
1221 func (m *BierTableDetails) Reset()               { *m = BierTableDetails{} }
1222 func (*BierTableDetails) GetMessageName() string { return "bier_table_details" }
1223 func (*BierTableDetails) GetCrcString() string   { return "fc44a9dd" }
1224 func (*BierTableDetails) GetMessageType() api.MessageType {
1225         return api.ReplyMessage
1226 }
1227
1228 func (m *BierTableDetails) Size() int {
1229         if m == nil {
1230                 return 0
1231         }
1232         var size int
1233         size += 4 // m.BtLabel
1234         size += 1 // m.BtTblID.BtSet
1235         size += 1 // m.BtTblID.BtSubDomain
1236         size += 1 // m.BtTblID.BtHdrLenID
1237         return size
1238 }
1239 func (m *BierTableDetails) Marshal(b []byte) ([]byte, error) {
1240         var buf *codec.Buffer
1241         if b == nil {
1242                 buf = codec.NewBuffer(make([]byte, m.Size()))
1243         } else {
1244                 buf = codec.NewBuffer(b)
1245         }
1246         buf.EncodeUint32(uint32(m.BtLabel))
1247         buf.EncodeUint8(uint8(m.BtTblID.BtSet))
1248         buf.EncodeUint8(uint8(m.BtTblID.BtSubDomain))
1249         buf.EncodeUint8(uint8(m.BtTblID.BtHdrLenID))
1250         return buf.Bytes(), nil
1251 }
1252 func (m *BierTableDetails) Unmarshal(b []byte) error {
1253         buf := codec.NewBuffer(b)
1254         m.BtLabel = buf.DecodeUint32()
1255         m.BtTblID.BtSet = buf.DecodeUint8()
1256         m.BtTblID.BtSubDomain = buf.DecodeUint8()
1257         m.BtTblID.BtHdrLenID = buf.DecodeUint8()
1258         return nil
1259 }
1260
1261 // BierTableDump defines message 'bier_table_dump'.
1262 type BierTableDump struct{}
1263
1264 func (m *BierTableDump) Reset()               { *m = BierTableDump{} }
1265 func (*BierTableDump) GetMessageName() string { return "bier_table_dump" }
1266 func (*BierTableDump) GetCrcString() string   { return "51077d14" }
1267 func (*BierTableDump) GetMessageType() api.MessageType {
1268         return api.RequestMessage
1269 }
1270
1271 func (m *BierTableDump) Size() int {
1272         if m == nil {
1273                 return 0
1274         }
1275         var size int
1276         return size
1277 }
1278 func (m *BierTableDump) Marshal(b []byte) ([]byte, error) {
1279         var buf *codec.Buffer
1280         if b == nil {
1281                 buf = codec.NewBuffer(make([]byte, m.Size()))
1282         } else {
1283                 buf = codec.NewBuffer(b)
1284         }
1285         return buf.Bytes(), nil
1286 }
1287 func (m *BierTableDump) Unmarshal(b []byte) error {
1288         return nil
1289 }
1290
1291 func init() { file_bier_binapi_init() }
1292 func file_bier_binapi_init() {
1293         api.RegisterMessage((*BierDispEntryAddDel)(nil), "bier_disp_entry_add_del_648323eb")
1294         api.RegisterMessage((*BierDispEntryAddDelReply)(nil), "bier_disp_entry_add_del_reply_e8d4e804")
1295         api.RegisterMessage((*BierDispEntryDetails)(nil), "bier_disp_entry_details_e5b039a9")
1296         api.RegisterMessage((*BierDispEntryDump)(nil), "bier_disp_entry_dump_b5fa54ad")
1297         api.RegisterMessage((*BierDispTableAddDel)(nil), "bier_disp_table_add_del_889657ac")
1298         api.RegisterMessage((*BierDispTableAddDelReply)(nil), "bier_disp_table_add_del_reply_e8d4e804")
1299         api.RegisterMessage((*BierDispTableDetails)(nil), "bier_disp_table_details_d27942c0")
1300         api.RegisterMessage((*BierDispTableDump)(nil), "bier_disp_table_dump_51077d14")
1301         api.RegisterMessage((*BierImpAdd)(nil), "bier_imp_add_3856dc3d")
1302         api.RegisterMessage((*BierImpAddReply)(nil), "bier_imp_add_reply_d49c5793")
1303         api.RegisterMessage((*BierImpDel)(nil), "bier_imp_del_7d45edf6")
1304         api.RegisterMessage((*BierImpDelReply)(nil), "bier_imp_del_reply_e8d4e804")
1305         api.RegisterMessage((*BierImpDetails)(nil), "bier_imp_details_b76192df")
1306         api.RegisterMessage((*BierImpDump)(nil), "bier_imp_dump_51077d14")
1307         api.RegisterMessage((*BierRouteAddDel)(nil), "bier_route_add_del_f29edca0")
1308         api.RegisterMessage((*BierRouteAddDelReply)(nil), "bier_route_add_del_reply_e8d4e804")
1309         api.RegisterMessage((*BierRouteDetails)(nil), "bier_route_details_39ee6a56")
1310         api.RegisterMessage((*BierRouteDump)(nil), "bier_route_dump_38339846")
1311         api.RegisterMessage((*BierTableAddDel)(nil), "bier_table_add_del_35e59209")
1312         api.RegisterMessage((*BierTableAddDelReply)(nil), "bier_table_add_del_reply_e8d4e804")
1313         api.RegisterMessage((*BierTableDetails)(nil), "bier_table_details_fc44a9dd")
1314         api.RegisterMessage((*BierTableDump)(nil), "bier_table_dump_51077d14")
1315 }
1316
1317 // Messages returns list of all messages in this module.
1318 func AllMessages() []api.Message {
1319         return []api.Message{
1320                 (*BierDispEntryAddDel)(nil),
1321                 (*BierDispEntryAddDelReply)(nil),
1322                 (*BierDispEntryDetails)(nil),
1323                 (*BierDispEntryDump)(nil),
1324                 (*BierDispTableAddDel)(nil),
1325                 (*BierDispTableAddDelReply)(nil),
1326                 (*BierDispTableDetails)(nil),
1327                 (*BierDispTableDump)(nil),
1328                 (*BierImpAdd)(nil),
1329                 (*BierImpAddReply)(nil),
1330                 (*BierImpDel)(nil),
1331                 (*BierImpDelReply)(nil),
1332                 (*BierImpDetails)(nil),
1333                 (*BierImpDump)(nil),
1334                 (*BierRouteAddDel)(nil),
1335                 (*BierRouteAddDelReply)(nil),
1336                 (*BierRouteDetails)(nil),
1337                 (*BierRouteDump)(nil),
1338                 (*BierTableAddDel)(nil),
1339                 (*BierTableAddDelReply)(nil),
1340                 (*BierTableDetails)(nil),
1341                 (*BierTableDump)(nil),
1342         }
1343 }