Improve binapi generator
[govpp.git] / binapi / abf / abf.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.4.0-dev
4 //  VPP:              20.05-release
5 // source: /usr/share/vpp/api/plugins/abf.api.json
6
7 // Package abf contains generated bindings for API file abf.api.
8 //
9 // Contents:
10 //   2 structs
11 //  10 messages
12 //
13 package abf
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         _ "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    = "abf"
31         APIVersion = "1.0.0"
32         VersionCrc = 0x460b09b9
33 )
34
35 // AbfItfAttach defines type 'abf_itf_attach'.
36 type AbfItfAttach struct {
37         PolicyID  uint32                         `binapi:"u32,name=policy_id" json:"policy_id,omitempty"`
38         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
39         Priority  uint32                         `binapi:"u32,name=priority" json:"priority,omitempty"`
40         IsIPv6    bool                           `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
41 }
42
43 // AbfPolicy defines type 'abf_policy'.
44 type AbfPolicy struct {
45         PolicyID uint32              `binapi:"u32,name=policy_id" json:"policy_id,omitempty"`
46         ACLIndex uint32              `binapi:"u32,name=acl_index" json:"acl_index,omitempty"`
47         NPaths   uint8               `binapi:"u8,name=n_paths" json:"-"`
48         Paths    []fib_types.FibPath `binapi:"fib_path[n_paths],name=paths" json:"paths,omitempty"`
49 }
50
51 // AbfItfAttachAddDel defines message 'abf_itf_attach_add_del'.
52 type AbfItfAttachAddDel struct {
53         IsAdd  bool         `binapi:"bool,name=is_add" json:"is_add,omitempty"`
54         Attach AbfItfAttach `binapi:"abf_itf_attach,name=attach" json:"attach,omitempty"`
55 }
56
57 func (m *AbfItfAttachAddDel) Reset()               { *m = AbfItfAttachAddDel{} }
58 func (*AbfItfAttachAddDel) GetMessageName() string { return "abf_itf_attach_add_del" }
59 func (*AbfItfAttachAddDel) GetCrcString() string   { return "25c8621b" }
60 func (*AbfItfAttachAddDel) GetMessageType() api.MessageType {
61         return api.RequestMessage
62 }
63
64 func (m *AbfItfAttachAddDel) Size() int {
65         if m == nil {
66                 return 0
67         }
68         var size int
69         size += 1 // m.IsAdd
70         size += 4 // m.Attach.PolicyID
71         size += 4 // m.Attach.SwIfIndex
72         size += 4 // m.Attach.Priority
73         size += 1 // m.Attach.IsIPv6
74         return size
75 }
76 func (m *AbfItfAttachAddDel) Marshal(b []byte) ([]byte, error) {
77         var buf *codec.Buffer
78         if b == nil {
79                 buf = codec.NewBuffer(make([]byte, m.Size()))
80         } else {
81                 buf = codec.NewBuffer(b)
82         }
83         buf.EncodeBool(m.IsAdd)
84         buf.EncodeUint32(uint32(m.Attach.PolicyID))
85         buf.EncodeUint32(uint32(m.Attach.SwIfIndex))
86         buf.EncodeUint32(uint32(m.Attach.Priority))
87         buf.EncodeBool(m.Attach.IsIPv6)
88         return buf.Bytes(), nil
89 }
90 func (m *AbfItfAttachAddDel) Unmarshal(b []byte) error {
91         buf := codec.NewBuffer(b)
92         m.IsAdd = buf.DecodeBool()
93         m.Attach.PolicyID = buf.DecodeUint32()
94         m.Attach.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
95         m.Attach.Priority = buf.DecodeUint32()
96         m.Attach.IsIPv6 = buf.DecodeBool()
97         return nil
98 }
99
100 // AbfItfAttachAddDelReply defines message 'abf_itf_attach_add_del_reply'.
101 type AbfItfAttachAddDelReply struct {
102         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
103 }
104
105 func (m *AbfItfAttachAddDelReply) Reset()               { *m = AbfItfAttachAddDelReply{} }
106 func (*AbfItfAttachAddDelReply) GetMessageName() string { return "abf_itf_attach_add_del_reply" }
107 func (*AbfItfAttachAddDelReply) GetCrcString() string   { return "e8d4e804" }
108 func (*AbfItfAttachAddDelReply) GetMessageType() api.MessageType {
109         return api.ReplyMessage
110 }
111
112 func (m *AbfItfAttachAddDelReply) Size() int {
113         if m == nil {
114                 return 0
115         }
116         var size int
117         size += 4 // m.Retval
118         return size
119 }
120 func (m *AbfItfAttachAddDelReply) Marshal(b []byte) ([]byte, error) {
121         var buf *codec.Buffer
122         if b == nil {
123                 buf = codec.NewBuffer(make([]byte, m.Size()))
124         } else {
125                 buf = codec.NewBuffer(b)
126         }
127         buf.EncodeUint32(uint32(m.Retval))
128         return buf.Bytes(), nil
129 }
130 func (m *AbfItfAttachAddDelReply) Unmarshal(b []byte) error {
131         buf := codec.NewBuffer(b)
132         m.Retval = int32(buf.DecodeUint32())
133         return nil
134 }
135
136 // AbfItfAttachDetails defines message 'abf_itf_attach_details'.
137 type AbfItfAttachDetails struct {
138         Attach AbfItfAttach `binapi:"abf_itf_attach,name=attach" json:"attach,omitempty"`
139 }
140
141 func (m *AbfItfAttachDetails) Reset()               { *m = AbfItfAttachDetails{} }
142 func (*AbfItfAttachDetails) GetMessageName() string { return "abf_itf_attach_details" }
143 func (*AbfItfAttachDetails) GetCrcString() string   { return "7819523e" }
144 func (*AbfItfAttachDetails) GetMessageType() api.MessageType {
145         return api.ReplyMessage
146 }
147
148 func (m *AbfItfAttachDetails) Size() int {
149         if m == nil {
150                 return 0
151         }
152         var size int
153         size += 4 // m.Attach.PolicyID
154         size += 4 // m.Attach.SwIfIndex
155         size += 4 // m.Attach.Priority
156         size += 1 // m.Attach.IsIPv6
157         return size
158 }
159 func (m *AbfItfAttachDetails) Marshal(b []byte) ([]byte, error) {
160         var buf *codec.Buffer
161         if b == nil {
162                 buf = codec.NewBuffer(make([]byte, m.Size()))
163         } else {
164                 buf = codec.NewBuffer(b)
165         }
166         buf.EncodeUint32(uint32(m.Attach.PolicyID))
167         buf.EncodeUint32(uint32(m.Attach.SwIfIndex))
168         buf.EncodeUint32(uint32(m.Attach.Priority))
169         buf.EncodeBool(m.Attach.IsIPv6)
170         return buf.Bytes(), nil
171 }
172 func (m *AbfItfAttachDetails) Unmarshal(b []byte) error {
173         buf := codec.NewBuffer(b)
174         m.Attach.PolicyID = buf.DecodeUint32()
175         m.Attach.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
176         m.Attach.Priority = buf.DecodeUint32()
177         m.Attach.IsIPv6 = buf.DecodeBool()
178         return nil
179 }
180
181 // AbfItfAttachDump defines message 'abf_itf_attach_dump'.
182 type AbfItfAttachDump struct{}
183
184 func (m *AbfItfAttachDump) Reset()               { *m = AbfItfAttachDump{} }
185 func (*AbfItfAttachDump) GetMessageName() string { return "abf_itf_attach_dump" }
186 func (*AbfItfAttachDump) GetCrcString() string   { return "51077d14" }
187 func (*AbfItfAttachDump) GetMessageType() api.MessageType {
188         return api.RequestMessage
189 }
190
191 func (m *AbfItfAttachDump) Size() int {
192         if m == nil {
193                 return 0
194         }
195         var size int
196         return size
197 }
198 func (m *AbfItfAttachDump) Marshal(b []byte) ([]byte, error) {
199         var buf *codec.Buffer
200         if b == nil {
201                 buf = codec.NewBuffer(make([]byte, m.Size()))
202         } else {
203                 buf = codec.NewBuffer(b)
204         }
205         return buf.Bytes(), nil
206 }
207 func (m *AbfItfAttachDump) Unmarshal(b []byte) error {
208         return nil
209 }
210
211 // AbfPluginGetVersion defines message 'abf_plugin_get_version'.
212 type AbfPluginGetVersion struct{}
213
214 func (m *AbfPluginGetVersion) Reset()               { *m = AbfPluginGetVersion{} }
215 func (*AbfPluginGetVersion) GetMessageName() string { return "abf_plugin_get_version" }
216 func (*AbfPluginGetVersion) GetCrcString() string   { return "51077d14" }
217 func (*AbfPluginGetVersion) GetMessageType() api.MessageType {
218         return api.RequestMessage
219 }
220
221 func (m *AbfPluginGetVersion) Size() int {
222         if m == nil {
223                 return 0
224         }
225         var size int
226         return size
227 }
228 func (m *AbfPluginGetVersion) Marshal(b []byte) ([]byte, error) {
229         var buf *codec.Buffer
230         if b == nil {
231                 buf = codec.NewBuffer(make([]byte, m.Size()))
232         } else {
233                 buf = codec.NewBuffer(b)
234         }
235         return buf.Bytes(), nil
236 }
237 func (m *AbfPluginGetVersion) Unmarshal(b []byte) error {
238         return nil
239 }
240
241 // AbfPluginGetVersionReply defines message 'abf_plugin_get_version_reply'.
242 type AbfPluginGetVersionReply struct {
243         Major uint32 `binapi:"u32,name=major" json:"major,omitempty"`
244         Minor uint32 `binapi:"u32,name=minor" json:"minor,omitempty"`
245 }
246
247 func (m *AbfPluginGetVersionReply) Reset()               { *m = AbfPluginGetVersionReply{} }
248 func (*AbfPluginGetVersionReply) GetMessageName() string { return "abf_plugin_get_version_reply" }
249 func (*AbfPluginGetVersionReply) GetCrcString() string   { return "9b32cf86" }
250 func (*AbfPluginGetVersionReply) GetMessageType() api.MessageType {
251         return api.ReplyMessage
252 }
253
254 func (m *AbfPluginGetVersionReply) Size() int {
255         if m == nil {
256                 return 0
257         }
258         var size int
259         size += 4 // m.Major
260         size += 4 // m.Minor
261         return size
262 }
263 func (m *AbfPluginGetVersionReply) Marshal(b []byte) ([]byte, error) {
264         var buf *codec.Buffer
265         if b == nil {
266                 buf = codec.NewBuffer(make([]byte, m.Size()))
267         } else {
268                 buf = codec.NewBuffer(b)
269         }
270         buf.EncodeUint32(uint32(m.Major))
271         buf.EncodeUint32(uint32(m.Minor))
272         return buf.Bytes(), nil
273 }
274 func (m *AbfPluginGetVersionReply) Unmarshal(b []byte) error {
275         buf := codec.NewBuffer(b)
276         m.Major = buf.DecodeUint32()
277         m.Minor = buf.DecodeUint32()
278         return nil
279 }
280
281 // AbfPolicyAddDel defines message 'abf_policy_add_del'.
282 type AbfPolicyAddDel struct {
283         IsAdd  bool      `binapi:"bool,name=is_add" json:"is_add,omitempty"`
284         Policy AbfPolicy `binapi:"abf_policy,name=policy" json:"policy,omitempty"`
285 }
286
287 func (m *AbfPolicyAddDel) Reset()               { *m = AbfPolicyAddDel{} }
288 func (*AbfPolicyAddDel) GetMessageName() string { return "abf_policy_add_del" }
289 func (*AbfPolicyAddDel) GetCrcString() string   { return "ee66f93e" }
290 func (*AbfPolicyAddDel) GetMessageType() api.MessageType {
291         return api.RequestMessage
292 }
293
294 func (m *AbfPolicyAddDel) Size() int {
295         if m == nil {
296                 return 0
297         }
298         var size int
299         size += 1 // m.IsAdd
300         size += 4 // m.Policy.PolicyID
301         size += 4 // m.Policy.ACLIndex
302         size += 1 // m.Policy.NPaths
303         for j2 := 0; j2 < len(m.Policy.Paths); j2++ {
304                 var s2 fib_types.FibPath
305                 _ = s2
306                 if j2 < len(m.Policy.Paths) {
307                         s2 = m.Policy.Paths[j2]
308                 }
309                 size += 4      // s2.SwIfIndex
310                 size += 4      // s2.TableID
311                 size += 4      // s2.RpfID
312                 size += 1      // s2.Weight
313                 size += 1      // s2.Preference
314                 size += 4      // s2.Type
315                 size += 4      // s2.Flags
316                 size += 4      // s2.Proto
317                 size += 1 * 16 // s2.Nh.Address
318                 size += 4      // s2.Nh.ViaLabel
319                 size += 4      // s2.Nh.ObjID
320                 size += 4      // s2.Nh.ClassifyTableIndex
321                 size += 1      // s2.NLabels
322                 for j3 := 0; j3 < 16; j3++ {
323                         var s3 fib_types.FibMplsLabel
324                         _ = s3
325                         if j3 < len(s2.LabelStack) {
326                                 s3 = s2.LabelStack[j3]
327                         }
328                         size += 1 // s3.IsUniform
329                         size += 4 // s3.Label
330                         size += 1 // s3.TTL
331                         size += 1 // s3.Exp
332                 }
333         }
334         return size
335 }
336 func (m *AbfPolicyAddDel) Marshal(b []byte) ([]byte, error) {
337         var buf *codec.Buffer
338         if b == nil {
339                 buf = codec.NewBuffer(make([]byte, m.Size()))
340         } else {
341                 buf = codec.NewBuffer(b)
342         }
343         buf.EncodeBool(m.IsAdd)
344         buf.EncodeUint32(uint32(m.Policy.PolicyID))
345         buf.EncodeUint32(uint32(m.Policy.ACLIndex))
346         buf.EncodeUint8(uint8(len(m.Policy.Paths)))
347         for j1 := 0; j1 < len(m.Policy.Paths); j1++ {
348                 var v1 fib_types.FibPath
349                 if j1 < len(m.Policy.Paths) {
350                         v1 = m.Policy.Paths[j1]
351                 }
352                 buf.EncodeUint32(uint32(v1.SwIfIndex))
353                 buf.EncodeUint32(uint32(v1.TableID))
354                 buf.EncodeUint32(uint32(v1.RpfID))
355                 buf.EncodeUint8(uint8(v1.Weight))
356                 buf.EncodeUint8(uint8(v1.Preference))
357                 buf.EncodeUint32(uint32(v1.Type))
358                 buf.EncodeUint32(uint32(v1.Flags))
359                 buf.EncodeUint32(uint32(v1.Proto))
360                 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 0)
361                 buf.EncodeUint32(uint32(v1.Nh.ViaLabel))
362                 buf.EncodeUint32(uint32(v1.Nh.ObjID))
363                 buf.EncodeUint32(uint32(v1.Nh.ClassifyTableIndex))
364                 buf.EncodeUint8(uint8(v1.NLabels))
365                 for j2 := 0; j2 < 16; j2++ {
366                         var v2 fib_types.FibMplsLabel
367                         if j2 < len(v1.LabelStack) {
368                                 v2 = v1.LabelStack[j2]
369                         }
370                         buf.EncodeUint8(uint8(v2.IsUniform))
371                         buf.EncodeUint32(uint32(v2.Label))
372                         buf.EncodeUint8(uint8(v2.TTL))
373                         buf.EncodeUint8(uint8(v2.Exp))
374                 }
375         }
376         return buf.Bytes(), nil
377 }
378 func (m *AbfPolicyAddDel) Unmarshal(b []byte) error {
379         buf := codec.NewBuffer(b)
380         m.IsAdd = buf.DecodeBool()
381         m.Policy.PolicyID = buf.DecodeUint32()
382         m.Policy.ACLIndex = buf.DecodeUint32()
383         m.Policy.NPaths = buf.DecodeUint8()
384         m.Policy.Paths = make([]fib_types.FibPath, int(m.Policy.NPaths))
385         for j1 := 0; j1 < len(m.Policy.Paths); j1++ {
386                 m.Policy.Paths[j1].SwIfIndex = buf.DecodeUint32()
387                 m.Policy.Paths[j1].TableID = buf.DecodeUint32()
388                 m.Policy.Paths[j1].RpfID = buf.DecodeUint32()
389                 m.Policy.Paths[j1].Weight = buf.DecodeUint8()
390                 m.Policy.Paths[j1].Preference = buf.DecodeUint8()
391                 m.Policy.Paths[j1].Type = fib_types.FibPathType(buf.DecodeUint32())
392                 m.Policy.Paths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32())
393                 m.Policy.Paths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32())
394                 copy(m.Policy.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
395                 m.Policy.Paths[j1].Nh.ViaLabel = buf.DecodeUint32()
396                 m.Policy.Paths[j1].Nh.ObjID = buf.DecodeUint32()
397                 m.Policy.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
398                 m.Policy.Paths[j1].NLabels = buf.DecodeUint8()
399                 for j2 := 0; j2 < 16; j2++ {
400                         m.Policy.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
401                         m.Policy.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32()
402                         m.Policy.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
403                         m.Policy.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
404                 }
405         }
406         return nil
407 }
408
409 // AbfPolicyAddDelReply defines message 'abf_policy_add_del_reply'.
410 type AbfPolicyAddDelReply struct {
411         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
412 }
413
414 func (m *AbfPolicyAddDelReply) Reset()               { *m = AbfPolicyAddDelReply{} }
415 func (*AbfPolicyAddDelReply) GetMessageName() string { return "abf_policy_add_del_reply" }
416 func (*AbfPolicyAddDelReply) GetCrcString() string   { return "e8d4e804" }
417 func (*AbfPolicyAddDelReply) GetMessageType() api.MessageType {
418         return api.ReplyMessage
419 }
420
421 func (m *AbfPolicyAddDelReply) Size() int {
422         if m == nil {
423                 return 0
424         }
425         var size int
426         size += 4 // m.Retval
427         return size
428 }
429 func (m *AbfPolicyAddDelReply) Marshal(b []byte) ([]byte, error) {
430         var buf *codec.Buffer
431         if b == nil {
432                 buf = codec.NewBuffer(make([]byte, m.Size()))
433         } else {
434                 buf = codec.NewBuffer(b)
435         }
436         buf.EncodeUint32(uint32(m.Retval))
437         return buf.Bytes(), nil
438 }
439 func (m *AbfPolicyAddDelReply) Unmarshal(b []byte) error {
440         buf := codec.NewBuffer(b)
441         m.Retval = int32(buf.DecodeUint32())
442         return nil
443 }
444
445 // AbfPolicyDetails defines message 'abf_policy_details'.
446 type AbfPolicyDetails struct {
447         Policy AbfPolicy `binapi:"abf_policy,name=policy" json:"policy,omitempty"`
448 }
449
450 func (m *AbfPolicyDetails) Reset()               { *m = AbfPolicyDetails{} }
451 func (*AbfPolicyDetails) GetMessageName() string { return "abf_policy_details" }
452 func (*AbfPolicyDetails) GetCrcString() string   { return "6769e504" }
453 func (*AbfPolicyDetails) GetMessageType() api.MessageType {
454         return api.ReplyMessage
455 }
456
457 func (m *AbfPolicyDetails) Size() int {
458         if m == nil {
459                 return 0
460         }
461         var size int
462         size += 4 // m.Policy.PolicyID
463         size += 4 // m.Policy.ACLIndex
464         size += 1 // m.Policy.NPaths
465         for j2 := 0; j2 < len(m.Policy.Paths); j2++ {
466                 var s2 fib_types.FibPath
467                 _ = s2
468                 if j2 < len(m.Policy.Paths) {
469                         s2 = m.Policy.Paths[j2]
470                 }
471                 size += 4      // s2.SwIfIndex
472                 size += 4      // s2.TableID
473                 size += 4      // s2.RpfID
474                 size += 1      // s2.Weight
475                 size += 1      // s2.Preference
476                 size += 4      // s2.Type
477                 size += 4      // s2.Flags
478                 size += 4      // s2.Proto
479                 size += 1 * 16 // s2.Nh.Address
480                 size += 4      // s2.Nh.ViaLabel
481                 size += 4      // s2.Nh.ObjID
482                 size += 4      // s2.Nh.ClassifyTableIndex
483                 size += 1      // s2.NLabels
484                 for j3 := 0; j3 < 16; j3++ {
485                         var s3 fib_types.FibMplsLabel
486                         _ = s3
487                         if j3 < len(s2.LabelStack) {
488                                 s3 = s2.LabelStack[j3]
489                         }
490                         size += 1 // s3.IsUniform
491                         size += 4 // s3.Label
492                         size += 1 // s3.TTL
493                         size += 1 // s3.Exp
494                 }
495         }
496         return size
497 }
498 func (m *AbfPolicyDetails) Marshal(b []byte) ([]byte, error) {
499         var buf *codec.Buffer
500         if b == nil {
501                 buf = codec.NewBuffer(make([]byte, m.Size()))
502         } else {
503                 buf = codec.NewBuffer(b)
504         }
505         buf.EncodeUint32(uint32(m.Policy.PolicyID))
506         buf.EncodeUint32(uint32(m.Policy.ACLIndex))
507         buf.EncodeUint8(uint8(len(m.Policy.Paths)))
508         for j1 := 0; j1 < len(m.Policy.Paths); j1++ {
509                 var v1 fib_types.FibPath
510                 if j1 < len(m.Policy.Paths) {
511                         v1 = m.Policy.Paths[j1]
512                 }
513                 buf.EncodeUint32(uint32(v1.SwIfIndex))
514                 buf.EncodeUint32(uint32(v1.TableID))
515                 buf.EncodeUint32(uint32(v1.RpfID))
516                 buf.EncodeUint8(uint8(v1.Weight))
517                 buf.EncodeUint8(uint8(v1.Preference))
518                 buf.EncodeUint32(uint32(v1.Type))
519                 buf.EncodeUint32(uint32(v1.Flags))
520                 buf.EncodeUint32(uint32(v1.Proto))
521                 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 0)
522                 buf.EncodeUint32(uint32(v1.Nh.ViaLabel))
523                 buf.EncodeUint32(uint32(v1.Nh.ObjID))
524                 buf.EncodeUint32(uint32(v1.Nh.ClassifyTableIndex))
525                 buf.EncodeUint8(uint8(v1.NLabels))
526                 for j2 := 0; j2 < 16; j2++ {
527                         var v2 fib_types.FibMplsLabel
528                         if j2 < len(v1.LabelStack) {
529                                 v2 = v1.LabelStack[j2]
530                         }
531                         buf.EncodeUint8(uint8(v2.IsUniform))
532                         buf.EncodeUint32(uint32(v2.Label))
533                         buf.EncodeUint8(uint8(v2.TTL))
534                         buf.EncodeUint8(uint8(v2.Exp))
535                 }
536         }
537         return buf.Bytes(), nil
538 }
539 func (m *AbfPolicyDetails) Unmarshal(b []byte) error {
540         buf := codec.NewBuffer(b)
541         m.Policy.PolicyID = buf.DecodeUint32()
542         m.Policy.ACLIndex = buf.DecodeUint32()
543         m.Policy.NPaths = buf.DecodeUint8()
544         m.Policy.Paths = make([]fib_types.FibPath, int(m.Policy.NPaths))
545         for j1 := 0; j1 < len(m.Policy.Paths); j1++ {
546                 m.Policy.Paths[j1].SwIfIndex = buf.DecodeUint32()
547                 m.Policy.Paths[j1].TableID = buf.DecodeUint32()
548                 m.Policy.Paths[j1].RpfID = buf.DecodeUint32()
549                 m.Policy.Paths[j1].Weight = buf.DecodeUint8()
550                 m.Policy.Paths[j1].Preference = buf.DecodeUint8()
551                 m.Policy.Paths[j1].Type = fib_types.FibPathType(buf.DecodeUint32())
552                 m.Policy.Paths[j1].Flags = fib_types.FibPathFlags(buf.DecodeUint32())
553                 m.Policy.Paths[j1].Proto = fib_types.FibPathNhProto(buf.DecodeUint32())
554                 copy(m.Policy.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
555                 m.Policy.Paths[j1].Nh.ViaLabel = buf.DecodeUint32()
556                 m.Policy.Paths[j1].Nh.ObjID = buf.DecodeUint32()
557                 m.Policy.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
558                 m.Policy.Paths[j1].NLabels = buf.DecodeUint8()
559                 for j2 := 0; j2 < 16; j2++ {
560                         m.Policy.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
561                         m.Policy.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32()
562                         m.Policy.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
563                         m.Policy.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
564                 }
565         }
566         return nil
567 }
568
569 // AbfPolicyDump defines message 'abf_policy_dump'.
570 type AbfPolicyDump struct{}
571
572 func (m *AbfPolicyDump) Reset()               { *m = AbfPolicyDump{} }
573 func (*AbfPolicyDump) GetMessageName() string { return "abf_policy_dump" }
574 func (*AbfPolicyDump) GetCrcString() string   { return "51077d14" }
575 func (*AbfPolicyDump) GetMessageType() api.MessageType {
576         return api.RequestMessage
577 }
578
579 func (m *AbfPolicyDump) Size() int {
580         if m == nil {
581                 return 0
582         }
583         var size int
584         return size
585 }
586 func (m *AbfPolicyDump) Marshal(b []byte) ([]byte, error) {
587         var buf *codec.Buffer
588         if b == nil {
589                 buf = codec.NewBuffer(make([]byte, m.Size()))
590         } else {
591                 buf = codec.NewBuffer(b)
592         }
593         return buf.Bytes(), nil
594 }
595 func (m *AbfPolicyDump) Unmarshal(b []byte) error {
596         return nil
597 }
598
599 func init() { file_abf_binapi_init() }
600 func file_abf_binapi_init() {
601         api.RegisterMessage((*AbfItfAttachAddDel)(nil), "abf_itf_attach_add_del_25c8621b")
602         api.RegisterMessage((*AbfItfAttachAddDelReply)(nil), "abf_itf_attach_add_del_reply_e8d4e804")
603         api.RegisterMessage((*AbfItfAttachDetails)(nil), "abf_itf_attach_details_7819523e")
604         api.RegisterMessage((*AbfItfAttachDump)(nil), "abf_itf_attach_dump_51077d14")
605         api.RegisterMessage((*AbfPluginGetVersion)(nil), "abf_plugin_get_version_51077d14")
606         api.RegisterMessage((*AbfPluginGetVersionReply)(nil), "abf_plugin_get_version_reply_9b32cf86")
607         api.RegisterMessage((*AbfPolicyAddDel)(nil), "abf_policy_add_del_ee66f93e")
608         api.RegisterMessage((*AbfPolicyAddDelReply)(nil), "abf_policy_add_del_reply_e8d4e804")
609         api.RegisterMessage((*AbfPolicyDetails)(nil), "abf_policy_details_6769e504")
610         api.RegisterMessage((*AbfPolicyDump)(nil), "abf_policy_dump_51077d14")
611 }
612
613 // Messages returns list of all messages in this module.
614 func AllMessages() []api.Message {
615         return []api.Message{
616                 (*AbfItfAttachAddDel)(nil),
617                 (*AbfItfAttachAddDelReply)(nil),
618                 (*AbfItfAttachDetails)(nil),
619                 (*AbfItfAttachDump)(nil),
620                 (*AbfPluginGetVersion)(nil),
621                 (*AbfPluginGetVersionReply)(nil),
622                 (*AbfPolicyAddDel)(nil),
623                 (*AbfPolicyAddDelReply)(nil),
624                 (*AbfPolicyDetails)(nil),
625                 (*AbfPolicyDump)(nil),
626         }
627 }