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