Update generated binapi to v22.02 & makefile changes
[govpp.git] / internal / testbinapi / binapi2001 / ip / ip.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.5.0-dev
4 //  VPP:              20.01
5 // source: .vppapi/core/ip.api.json
6
7 // Package ip contains generated bindings for API file ip.api.
8 //
9 // Contents:
10 //   7 aliases
11 //  15 enums
12 //  14 structs
13 //   1 union
14 //  60 messages
15 //
16 package ip
17
18 import (
19         "fmt"
20         "net"
21         "strconv"
22         "strings"
23
24         api "git.fd.io/govpp.git/api"
25         codec "git.fd.io/govpp.git/codec"
26 )
27
28 // This is a compile-time assertion to ensure that this generated file
29 // is compatible with the GoVPP api package it is being compiled against.
30 // A compilation error at this line likely means your copy of the
31 // GoVPP api package needs to be updated.
32 const _ = api.GoVppAPIPackageIsVersion2
33
34 const (
35         APIFile    = "ip"
36         APIVersion = "3.0.1"
37         VersionCrc = 0xfc3fea46
38 )
39
40 // AddressFamily defines enum 'address_family'.
41 type AddressFamily uint32
42
43 const (
44         ADDRESS_IP4 AddressFamily = 0
45         ADDRESS_IP6 AddressFamily = 1
46 )
47
48 var (
49         AddressFamily_name = map[uint32]string{
50                 0: "ADDRESS_IP4",
51                 1: "ADDRESS_IP6",
52         }
53         AddressFamily_value = map[string]uint32{
54                 "ADDRESS_IP4": 0,
55                 "ADDRESS_IP6": 1,
56         }
57 )
58
59 func (x AddressFamily) String() string {
60         s, ok := AddressFamily_name[uint32(x)]
61         if ok {
62                 return s
63         }
64         return "AddressFamily(" + strconv.Itoa(int(x)) + ")"
65 }
66
67 // FibPathFlags defines enum 'fib_path_flags'.
68 type FibPathFlags uint32
69
70 const (
71         FIB_API_PATH_FLAG_NONE                 FibPathFlags = 0
72         FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED FibPathFlags = 1
73         FIB_API_PATH_FLAG_RESOLVE_VIA_HOST     FibPathFlags = 2
74         FIB_API_PATH_FLAG_POP_PW_CW            FibPathFlags = 4
75 )
76
77 var (
78         FibPathFlags_name = map[uint32]string{
79                 0: "FIB_API_PATH_FLAG_NONE",
80                 1: "FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED",
81                 2: "FIB_API_PATH_FLAG_RESOLVE_VIA_HOST",
82                 4: "FIB_API_PATH_FLAG_POP_PW_CW",
83         }
84         FibPathFlags_value = map[string]uint32{
85                 "FIB_API_PATH_FLAG_NONE":                 0,
86                 "FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED": 1,
87                 "FIB_API_PATH_FLAG_RESOLVE_VIA_HOST":     2,
88                 "FIB_API_PATH_FLAG_POP_PW_CW":            4,
89         }
90 )
91
92 func (x FibPathFlags) String() string {
93         s, ok := FibPathFlags_name[uint32(x)]
94         if ok {
95                 return s
96         }
97         str := func(n uint32) string {
98                 s, ok := FibPathFlags_name[uint32(n)]
99                 if ok {
100                         return s
101                 }
102                 return "FibPathFlags(" + strconv.Itoa(int(n)) + ")"
103         }
104         for i := uint32(0); i <= 32; i++ {
105                 val := uint32(x)
106                 if val&(1<<i) != 0 {
107                         if s != "" {
108                                 s += "|"
109                         }
110                         s += str(1 << i)
111                 }
112         }
113         if s == "" {
114                 return str(uint32(x))
115         }
116         return s
117 }
118
119 // FibPathNhProto defines enum 'fib_path_nh_proto'.
120 type FibPathNhProto uint32
121
122 const (
123         FIB_API_PATH_NH_PROTO_IP4      FibPathNhProto = 0
124         FIB_API_PATH_NH_PROTO_IP6      FibPathNhProto = 1
125         FIB_API_PATH_NH_PROTO_MPLS     FibPathNhProto = 2
126         FIB_API_PATH_NH_PROTO_ETHERNET FibPathNhProto = 3
127         FIB_API_PATH_NH_PROTO_BIER     FibPathNhProto = 4
128 )
129
130 var (
131         FibPathNhProto_name = map[uint32]string{
132                 0: "FIB_API_PATH_NH_PROTO_IP4",
133                 1: "FIB_API_PATH_NH_PROTO_IP6",
134                 2: "FIB_API_PATH_NH_PROTO_MPLS",
135                 3: "FIB_API_PATH_NH_PROTO_ETHERNET",
136                 4: "FIB_API_PATH_NH_PROTO_BIER",
137         }
138         FibPathNhProto_value = map[string]uint32{
139                 "FIB_API_PATH_NH_PROTO_IP4":      0,
140                 "FIB_API_PATH_NH_PROTO_IP6":      1,
141                 "FIB_API_PATH_NH_PROTO_MPLS":     2,
142                 "FIB_API_PATH_NH_PROTO_ETHERNET": 3,
143                 "FIB_API_PATH_NH_PROTO_BIER":     4,
144         }
145 )
146
147 func (x FibPathNhProto) String() string {
148         s, ok := FibPathNhProto_name[uint32(x)]
149         if ok {
150                 return s
151         }
152         return "FibPathNhProto(" + strconv.Itoa(int(x)) + ")"
153 }
154
155 // FibPathType defines enum 'fib_path_type'.
156 type FibPathType uint32
157
158 const (
159         FIB_API_PATH_TYPE_NORMAL        FibPathType = 0
160         FIB_API_PATH_TYPE_LOCAL         FibPathType = 1
161         FIB_API_PATH_TYPE_DROP          FibPathType = 2
162         FIB_API_PATH_TYPE_UDP_ENCAP     FibPathType = 3
163         FIB_API_PATH_TYPE_BIER_IMP      FibPathType = 4
164         FIB_API_PATH_TYPE_ICMP_UNREACH  FibPathType = 5
165         FIB_API_PATH_TYPE_ICMP_PROHIBIT FibPathType = 6
166         FIB_API_PATH_TYPE_SOURCE_LOOKUP FibPathType = 7
167         FIB_API_PATH_TYPE_DVR           FibPathType = 8
168         FIB_API_PATH_TYPE_INTERFACE_RX  FibPathType = 9
169         FIB_API_PATH_TYPE_CLASSIFY      FibPathType = 10
170 )
171
172 var (
173         FibPathType_name = map[uint32]string{
174                 0:  "FIB_API_PATH_TYPE_NORMAL",
175                 1:  "FIB_API_PATH_TYPE_LOCAL",
176                 2:  "FIB_API_PATH_TYPE_DROP",
177                 3:  "FIB_API_PATH_TYPE_UDP_ENCAP",
178                 4:  "FIB_API_PATH_TYPE_BIER_IMP",
179                 5:  "FIB_API_PATH_TYPE_ICMP_UNREACH",
180                 6:  "FIB_API_PATH_TYPE_ICMP_PROHIBIT",
181                 7:  "FIB_API_PATH_TYPE_SOURCE_LOOKUP",
182                 8:  "FIB_API_PATH_TYPE_DVR",
183                 9:  "FIB_API_PATH_TYPE_INTERFACE_RX",
184                 10: "FIB_API_PATH_TYPE_CLASSIFY",
185         }
186         FibPathType_value = map[string]uint32{
187                 "FIB_API_PATH_TYPE_NORMAL":        0,
188                 "FIB_API_PATH_TYPE_LOCAL":         1,
189                 "FIB_API_PATH_TYPE_DROP":          2,
190                 "FIB_API_PATH_TYPE_UDP_ENCAP":     3,
191                 "FIB_API_PATH_TYPE_BIER_IMP":      4,
192                 "FIB_API_PATH_TYPE_ICMP_UNREACH":  5,
193                 "FIB_API_PATH_TYPE_ICMP_PROHIBIT": 6,
194                 "FIB_API_PATH_TYPE_SOURCE_LOOKUP": 7,
195                 "FIB_API_PATH_TYPE_DVR":           8,
196                 "FIB_API_PATH_TYPE_INTERFACE_RX":  9,
197                 "FIB_API_PATH_TYPE_CLASSIFY":      10,
198         }
199 )
200
201 func (x FibPathType) String() string {
202         s, ok := FibPathType_name[uint32(x)]
203         if ok {
204                 return s
205         }
206         return "FibPathType(" + strconv.Itoa(int(x)) + ")"
207 }
208
209 // IfStatusFlags defines enum 'if_status_flags'.
210 type IfStatusFlags uint32
211
212 const (
213         IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
214         IF_STATUS_API_FLAG_LINK_UP  IfStatusFlags = 2
215 )
216
217 var (
218         IfStatusFlags_name = map[uint32]string{
219                 1: "IF_STATUS_API_FLAG_ADMIN_UP",
220                 2: "IF_STATUS_API_FLAG_LINK_UP",
221         }
222         IfStatusFlags_value = map[string]uint32{
223                 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
224                 "IF_STATUS_API_FLAG_LINK_UP":  2,
225         }
226 )
227
228 func (x IfStatusFlags) String() string {
229         s, ok := IfStatusFlags_name[uint32(x)]
230         if ok {
231                 return s
232         }
233         str := func(n uint32) string {
234                 s, ok := IfStatusFlags_name[uint32(n)]
235                 if ok {
236                         return s
237                 }
238                 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
239         }
240         for i := uint32(0); i <= 32; i++ {
241                 val := uint32(x)
242                 if val&(1<<i) != 0 {
243                         if s != "" {
244                                 s += "|"
245                         }
246                         s += str(1 << i)
247                 }
248         }
249         if s == "" {
250                 return str(uint32(x))
251         }
252         return s
253 }
254
255 // IfType defines enum 'if_type'.
256 type IfType uint32
257
258 const (
259         IF_API_TYPE_HARDWARE IfType = 1
260         IF_API_TYPE_SUB      IfType = 2
261         IF_API_TYPE_P2P      IfType = 3
262         IF_API_TYPE_PIPE     IfType = 4
263 )
264
265 var (
266         IfType_name = map[uint32]string{
267                 1: "IF_API_TYPE_HARDWARE",
268                 2: "IF_API_TYPE_SUB",
269                 3: "IF_API_TYPE_P2P",
270                 4: "IF_API_TYPE_PIPE",
271         }
272         IfType_value = map[string]uint32{
273                 "IF_API_TYPE_HARDWARE": 1,
274                 "IF_API_TYPE_SUB":      2,
275                 "IF_API_TYPE_P2P":      3,
276                 "IF_API_TYPE_PIPE":     4,
277         }
278 )
279
280 func (x IfType) String() string {
281         s, ok := IfType_name[uint32(x)]
282         if ok {
283                 return s
284         }
285         return "IfType(" + strconv.Itoa(int(x)) + ")"
286 }
287
288 // IPDscp defines enum 'ip_dscp'.
289 type IPDscp uint8
290
291 const (
292         IP_API_DSCP_CS0  IPDscp = 0
293         IP_API_DSCP_CS1  IPDscp = 8
294         IP_API_DSCP_AF11 IPDscp = 10
295         IP_API_DSCP_AF12 IPDscp = 12
296         IP_API_DSCP_AF13 IPDscp = 14
297         IP_API_DSCP_CS2  IPDscp = 16
298         IP_API_DSCP_AF21 IPDscp = 18
299         IP_API_DSCP_AF22 IPDscp = 20
300         IP_API_DSCP_AF23 IPDscp = 22
301         IP_API_DSCP_CS3  IPDscp = 24
302         IP_API_DSCP_AF31 IPDscp = 26
303         IP_API_DSCP_AF32 IPDscp = 28
304         IP_API_DSCP_AF33 IPDscp = 30
305         IP_API_DSCP_CS4  IPDscp = 32
306         IP_API_DSCP_AF41 IPDscp = 34
307         IP_API_DSCP_AF42 IPDscp = 36
308         IP_API_DSCP_AF43 IPDscp = 38
309         IP_API_DSCP_CS5  IPDscp = 40
310         IP_API_DSCP_EF   IPDscp = 46
311         IP_API_DSCP_CS6  IPDscp = 48
312         IP_API_DSCP_CS7  IPDscp = 50
313 )
314
315 var (
316         IPDscp_name = map[uint8]string{
317                 0:  "IP_API_DSCP_CS0",
318                 8:  "IP_API_DSCP_CS1",
319                 10: "IP_API_DSCP_AF11",
320                 12: "IP_API_DSCP_AF12",
321                 14: "IP_API_DSCP_AF13",
322                 16: "IP_API_DSCP_CS2",
323                 18: "IP_API_DSCP_AF21",
324                 20: "IP_API_DSCP_AF22",
325                 22: "IP_API_DSCP_AF23",
326                 24: "IP_API_DSCP_CS3",
327                 26: "IP_API_DSCP_AF31",
328                 28: "IP_API_DSCP_AF32",
329                 30: "IP_API_DSCP_AF33",
330                 32: "IP_API_DSCP_CS4",
331                 34: "IP_API_DSCP_AF41",
332                 36: "IP_API_DSCP_AF42",
333                 38: "IP_API_DSCP_AF43",
334                 40: "IP_API_DSCP_CS5",
335                 46: "IP_API_DSCP_EF",
336                 48: "IP_API_DSCP_CS6",
337                 50: "IP_API_DSCP_CS7",
338         }
339         IPDscp_value = map[string]uint8{
340                 "IP_API_DSCP_CS0":  0,
341                 "IP_API_DSCP_CS1":  8,
342                 "IP_API_DSCP_AF11": 10,
343                 "IP_API_DSCP_AF12": 12,
344                 "IP_API_DSCP_AF13": 14,
345                 "IP_API_DSCP_CS2":  16,
346                 "IP_API_DSCP_AF21": 18,
347                 "IP_API_DSCP_AF22": 20,
348                 "IP_API_DSCP_AF23": 22,
349                 "IP_API_DSCP_CS3":  24,
350                 "IP_API_DSCP_AF31": 26,
351                 "IP_API_DSCP_AF32": 28,
352                 "IP_API_DSCP_AF33": 30,
353                 "IP_API_DSCP_CS4":  32,
354                 "IP_API_DSCP_AF41": 34,
355                 "IP_API_DSCP_AF42": 36,
356                 "IP_API_DSCP_AF43": 38,
357                 "IP_API_DSCP_CS5":  40,
358                 "IP_API_DSCP_EF":   46,
359                 "IP_API_DSCP_CS6":  48,
360                 "IP_API_DSCP_CS7":  50,
361         }
362 )
363
364 func (x IPDscp) String() string {
365         s, ok := IPDscp_name[uint8(x)]
366         if ok {
367                 return s
368         }
369         return "IPDscp(" + strconv.Itoa(int(x)) + ")"
370 }
371
372 // IPEcn defines enum 'ip_ecn'.
373 type IPEcn uint8
374
375 const (
376         IP_API_ECN_NONE IPEcn = 0
377         IP_API_ECN_ECT0 IPEcn = 1
378         IP_API_ECN_ECT1 IPEcn = 2
379         IP_API_ECN_CE   IPEcn = 3
380 )
381
382 var (
383         IPEcn_name = map[uint8]string{
384                 0: "IP_API_ECN_NONE",
385                 1: "IP_API_ECN_ECT0",
386                 2: "IP_API_ECN_ECT1",
387                 3: "IP_API_ECN_CE",
388         }
389         IPEcn_value = map[string]uint8{
390                 "IP_API_ECN_NONE": 0,
391                 "IP_API_ECN_ECT0": 1,
392                 "IP_API_ECN_ECT1": 2,
393                 "IP_API_ECN_CE":   3,
394         }
395 )
396
397 func (x IPEcn) String() string {
398         s, ok := IPEcn_name[uint8(x)]
399         if ok {
400                 return s
401         }
402         return "IPEcn(" + strconv.Itoa(int(x)) + ")"
403 }
404
405 // IPProto defines enum 'ip_proto'.
406 type IPProto uint32
407
408 const (
409         IP_API_PROTO_HOPOPT   IPProto = 0
410         IP_API_PROTO_ICMP     IPProto = 1
411         IP_API_PROTO_IGMP     IPProto = 2
412         IP_API_PROTO_TCP      IPProto = 6
413         IP_API_PROTO_UDP      IPProto = 17
414         IP_API_PROTO_GRE      IPProto = 47
415         IP_API_PROTO_AH       IPProto = 50
416         IP_API_PROTO_ESP      IPProto = 51
417         IP_API_PROTO_EIGRP    IPProto = 88
418         IP_API_PROTO_OSPF     IPProto = 89
419         IP_API_PROTO_SCTP     IPProto = 132
420         IP_API_PROTO_RESERVED IPProto = 255
421 )
422
423 var (
424         IPProto_name = map[uint32]string{
425                 0:   "IP_API_PROTO_HOPOPT",
426                 1:   "IP_API_PROTO_ICMP",
427                 2:   "IP_API_PROTO_IGMP",
428                 6:   "IP_API_PROTO_TCP",
429                 17:  "IP_API_PROTO_UDP",
430                 47:  "IP_API_PROTO_GRE",
431                 50:  "IP_API_PROTO_AH",
432                 51:  "IP_API_PROTO_ESP",
433                 88:  "IP_API_PROTO_EIGRP",
434                 89:  "IP_API_PROTO_OSPF",
435                 132: "IP_API_PROTO_SCTP",
436                 255: "IP_API_PROTO_RESERVED",
437         }
438         IPProto_value = map[string]uint32{
439                 "IP_API_PROTO_HOPOPT":   0,
440                 "IP_API_PROTO_ICMP":     1,
441                 "IP_API_PROTO_IGMP":     2,
442                 "IP_API_PROTO_TCP":      6,
443                 "IP_API_PROTO_UDP":      17,
444                 "IP_API_PROTO_GRE":      47,
445                 "IP_API_PROTO_AH":       50,
446                 "IP_API_PROTO_ESP":      51,
447                 "IP_API_PROTO_EIGRP":    88,
448                 "IP_API_PROTO_OSPF":     89,
449                 "IP_API_PROTO_SCTP":     132,
450                 "IP_API_PROTO_RESERVED": 255,
451         }
452 )
453
454 func (x IPProto) String() string {
455         s, ok := IPProto_name[uint32(x)]
456         if ok {
457                 return s
458         }
459         return "IPProto(" + strconv.Itoa(int(x)) + ")"
460 }
461
462 // IPReassType defines enum 'ip_reass_type'.
463 type IPReassType uint32
464
465 const (
466         IP_REASS_TYPE_FULL            IPReassType = 0
467         IP_REASS_TYPE_SHALLOW_VIRTUAL IPReassType = 1
468 )
469
470 var (
471         IPReassType_name = map[uint32]string{
472                 0: "IP_REASS_TYPE_FULL",
473                 1: "IP_REASS_TYPE_SHALLOW_VIRTUAL",
474         }
475         IPReassType_value = map[string]uint32{
476                 "IP_REASS_TYPE_FULL":            0,
477                 "IP_REASS_TYPE_SHALLOW_VIRTUAL": 1,
478         }
479 )
480
481 func (x IPReassType) String() string {
482         s, ok := IPReassType_name[uint32(x)]
483         if ok {
484                 return s
485         }
486         return "IPReassType(" + strconv.Itoa(int(x)) + ")"
487 }
488
489 // LinkDuplex defines enum 'link_duplex'.
490 type LinkDuplex uint32
491
492 const (
493         LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
494         LINK_DUPLEX_API_HALF    LinkDuplex = 1
495         LINK_DUPLEX_API_FULL    LinkDuplex = 2
496 )
497
498 var (
499         LinkDuplex_name = map[uint32]string{
500                 0: "LINK_DUPLEX_API_UNKNOWN",
501                 1: "LINK_DUPLEX_API_HALF",
502                 2: "LINK_DUPLEX_API_FULL",
503         }
504         LinkDuplex_value = map[string]uint32{
505                 "LINK_DUPLEX_API_UNKNOWN": 0,
506                 "LINK_DUPLEX_API_HALF":    1,
507                 "LINK_DUPLEX_API_FULL":    2,
508         }
509 )
510
511 func (x LinkDuplex) String() string {
512         s, ok := LinkDuplex_name[uint32(x)]
513         if ok {
514                 return s
515         }
516         return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
517 }
518
519 // MfibItfFlags defines enum 'mfib_itf_flags'.
520 type MfibItfFlags uint32
521
522 const (
523         MFIB_API_ITF_FLAG_NONE           MfibItfFlags = 0
524         MFIB_API_ITF_FLAG_NEGATE_SIGNAL  MfibItfFlags = 1
525         MFIB_API_ITF_FLAG_ACCEPT         MfibItfFlags = 2
526         MFIB_API_ITF_FLAG_FORWARD        MfibItfFlags = 4
527         MFIB_API_ITF_FLAG_SIGNAL_PRESENT MfibItfFlags = 8
528         MFIB_API_ITF_FLAG_DONT_PRESERVE  MfibItfFlags = 16
529 )
530
531 var (
532         MfibItfFlags_name = map[uint32]string{
533                 0:  "MFIB_API_ITF_FLAG_NONE",
534                 1:  "MFIB_API_ITF_FLAG_NEGATE_SIGNAL",
535                 2:  "MFIB_API_ITF_FLAG_ACCEPT",
536                 4:  "MFIB_API_ITF_FLAG_FORWARD",
537                 8:  "MFIB_API_ITF_FLAG_SIGNAL_PRESENT",
538                 16: "MFIB_API_ITF_FLAG_DONT_PRESERVE",
539         }
540         MfibItfFlags_value = map[string]uint32{
541                 "MFIB_API_ITF_FLAG_NONE":           0,
542                 "MFIB_API_ITF_FLAG_NEGATE_SIGNAL":  1,
543                 "MFIB_API_ITF_FLAG_ACCEPT":         2,
544                 "MFIB_API_ITF_FLAG_FORWARD":        4,
545                 "MFIB_API_ITF_FLAG_SIGNAL_PRESENT": 8,
546                 "MFIB_API_ITF_FLAG_DONT_PRESERVE":  16,
547         }
548 )
549
550 func (x MfibItfFlags) String() string {
551         s, ok := MfibItfFlags_name[uint32(x)]
552         if ok {
553                 return s
554         }
555         str := func(n uint32) string {
556                 s, ok := MfibItfFlags_name[uint32(n)]
557                 if ok {
558                         return s
559                 }
560                 return "MfibItfFlags(" + strconv.Itoa(int(n)) + ")"
561         }
562         for i := uint32(0); i <= 32; i++ {
563                 val := uint32(x)
564                 if val&(1<<i) != 0 {
565                         if s != "" {
566                                 s += "|"
567                         }
568                         s += str(1 << i)
569                 }
570         }
571         if s == "" {
572                 return str(uint32(x))
573         }
574         return s
575 }
576
577 // MtuProto defines enum 'mtu_proto'.
578 type MtuProto uint32
579
580 const (
581         MTU_PROTO_API_L3   MtuProto = 1
582         MTU_PROTO_API_IP4  MtuProto = 2
583         MTU_PROTO_API_IP6  MtuProto = 3
584         MTU_PROTO_API_MPLS MtuProto = 4
585         MTU_PROTO_API_N    MtuProto = 5
586 )
587
588 var (
589         MtuProto_name = map[uint32]string{
590                 1: "MTU_PROTO_API_L3",
591                 2: "MTU_PROTO_API_IP4",
592                 3: "MTU_PROTO_API_IP6",
593                 4: "MTU_PROTO_API_MPLS",
594                 5: "MTU_PROTO_API_N",
595         }
596         MtuProto_value = map[string]uint32{
597                 "MTU_PROTO_API_L3":   1,
598                 "MTU_PROTO_API_IP4":  2,
599                 "MTU_PROTO_API_IP6":  3,
600                 "MTU_PROTO_API_MPLS": 4,
601                 "MTU_PROTO_API_N":    5,
602         }
603 )
604
605 func (x MtuProto) String() string {
606         s, ok := MtuProto_name[uint32(x)]
607         if ok {
608                 return s
609         }
610         return "MtuProto(" + strconv.Itoa(int(x)) + ")"
611 }
612
613 // RxMode defines enum 'rx_mode'.
614 type RxMode uint32
615
616 const (
617         RX_MODE_API_UNKNOWN   RxMode = 0
618         RX_MODE_API_POLLING   RxMode = 1
619         RX_MODE_API_INTERRUPT RxMode = 2
620         RX_MODE_API_ADAPTIVE  RxMode = 3
621         RX_MODE_API_DEFAULT   RxMode = 4
622 )
623
624 var (
625         RxMode_name = map[uint32]string{
626                 0: "RX_MODE_API_UNKNOWN",
627                 1: "RX_MODE_API_POLLING",
628                 2: "RX_MODE_API_INTERRUPT",
629                 3: "RX_MODE_API_ADAPTIVE",
630                 4: "RX_MODE_API_DEFAULT",
631         }
632         RxMode_value = map[string]uint32{
633                 "RX_MODE_API_UNKNOWN":   0,
634                 "RX_MODE_API_POLLING":   1,
635                 "RX_MODE_API_INTERRUPT": 2,
636                 "RX_MODE_API_ADAPTIVE":  3,
637                 "RX_MODE_API_DEFAULT":   4,
638         }
639 )
640
641 func (x RxMode) String() string {
642         s, ok := RxMode_name[uint32(x)]
643         if ok {
644                 return s
645         }
646         return "RxMode(" + strconv.Itoa(int(x)) + ")"
647 }
648
649 // SubIfFlags defines enum 'sub_if_flags'.
650 type SubIfFlags uint32
651
652 const (
653         SUB_IF_API_FLAG_NO_TAGS           SubIfFlags = 1
654         SUB_IF_API_FLAG_ONE_TAG           SubIfFlags = 2
655         SUB_IF_API_FLAG_TWO_TAGS          SubIfFlags = 4
656         SUB_IF_API_FLAG_DOT1AD            SubIfFlags = 8
657         SUB_IF_API_FLAG_EXACT_MATCH       SubIfFlags = 16
658         SUB_IF_API_FLAG_DEFAULT           SubIfFlags = 32
659         SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
660         SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
661         SUB_IF_API_FLAG_MASK_VNET         SubIfFlags = 254
662         SUB_IF_API_FLAG_DOT1AH            SubIfFlags = 256
663 )
664
665 var (
666         SubIfFlags_name = map[uint32]string{
667                 1:   "SUB_IF_API_FLAG_NO_TAGS",
668                 2:   "SUB_IF_API_FLAG_ONE_TAG",
669                 4:   "SUB_IF_API_FLAG_TWO_TAGS",
670                 8:   "SUB_IF_API_FLAG_DOT1AD",
671                 16:  "SUB_IF_API_FLAG_EXACT_MATCH",
672                 32:  "SUB_IF_API_FLAG_DEFAULT",
673                 64:  "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
674                 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
675                 254: "SUB_IF_API_FLAG_MASK_VNET",
676                 256: "SUB_IF_API_FLAG_DOT1AH",
677         }
678         SubIfFlags_value = map[string]uint32{
679                 "SUB_IF_API_FLAG_NO_TAGS":           1,
680                 "SUB_IF_API_FLAG_ONE_TAG":           2,
681                 "SUB_IF_API_FLAG_TWO_TAGS":          4,
682                 "SUB_IF_API_FLAG_DOT1AD":            8,
683                 "SUB_IF_API_FLAG_EXACT_MATCH":       16,
684                 "SUB_IF_API_FLAG_DEFAULT":           32,
685                 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
686                 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
687                 "SUB_IF_API_FLAG_MASK_VNET":         254,
688                 "SUB_IF_API_FLAG_DOT1AH":            256,
689         }
690 )
691
692 func (x SubIfFlags) String() string {
693         s, ok := SubIfFlags_name[uint32(x)]
694         if ok {
695                 return s
696         }
697         str := func(n uint32) string {
698                 s, ok := SubIfFlags_name[uint32(n)]
699                 if ok {
700                         return s
701                 }
702                 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
703         }
704         for i := uint32(0); i <= 32; i++ {
705                 val := uint32(x)
706                 if val&(1<<i) != 0 {
707                         if s != "" {
708                                 s += "|"
709                         }
710                         s += str(1 << i)
711                 }
712         }
713         if s == "" {
714                 return str(uint32(x))
715         }
716         return s
717 }
718
719 // AddressWithPrefix defines alias 'address_with_prefix'.
720 type AddressWithPrefix Prefix
721
722 func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
723         prefix, err := ParsePrefix(s)
724         if err != nil {
725                 return AddressWithPrefix{}, err
726         }
727         return AddressWithPrefix(prefix), nil
728 }
729
730 func (x AddressWithPrefix) String() string {
731         return Prefix(x).String()
732 }
733
734 func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
735         return []byte(x.String()), nil
736 }
737
738 func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
739         prefix, err := ParseAddressWithPrefix(string(text))
740         if err != nil {
741                 return err
742         }
743         *x = prefix
744         return nil
745 }
746
747 // InterfaceIndex defines alias 'interface_index'.
748 type InterfaceIndex uint32
749
750 // IP4Address defines alias 'ip4_address'.
751 type IP4Address [4]uint8
752
753 func ParseIP4Address(s string) (IP4Address, error) {
754         ip := net.ParseIP(s).To4()
755         if ip == nil {
756                 return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
757         }
758         var ipaddr IP4Address
759         copy(ipaddr[:], ip.To4())
760         return ipaddr, nil
761 }
762
763 func (x IP4Address) ToIP() net.IP {
764         return net.IP(x[:]).To4()
765 }
766
767 func (x IP4Address) String() string {
768         return x.ToIP().String()
769 }
770
771 func (x *IP4Address) MarshalText() ([]byte, error) {
772         return []byte(x.String()), nil
773 }
774
775 func (x *IP4Address) UnmarshalText(text []byte) error {
776         ipaddr, err := ParseIP4Address(string(text))
777         if err != nil {
778                 return err
779         }
780         *x = ipaddr
781         return nil
782 }
783
784 // IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
785 type IP4AddressWithPrefix IP4Prefix
786
787 // IP6Address defines alias 'ip6_address'.
788 type IP6Address [16]uint8
789
790 func ParseIP6Address(s string) (IP6Address, error) {
791         ip := net.ParseIP(s).To16()
792         if ip == nil {
793                 return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
794         }
795         var ipaddr IP6Address
796         copy(ipaddr[:], ip.To16())
797         return ipaddr, nil
798 }
799
800 func (x IP6Address) ToIP() net.IP {
801         return net.IP(x[:]).To16()
802 }
803
804 func (x IP6Address) String() string {
805         return x.ToIP().String()
806 }
807
808 func (x *IP6Address) MarshalText() ([]byte, error) {
809         return []byte(x.String()), nil
810 }
811
812 func (x *IP6Address) UnmarshalText(text []byte) error {
813         ipaddr, err := ParseIP6Address(string(text))
814         if err != nil {
815                 return err
816         }
817         *x = ipaddr
818         return nil
819 }
820
821 // IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
822 type IP6AddressWithPrefix IP6Prefix
823
824 // MacAddress defines alias 'mac_address'.
825 type MacAddress [6]uint8
826
827 func ParseMacAddress(s string) (MacAddress, error) {
828         var macaddr MacAddress
829         mac, err := net.ParseMAC(s)
830         if err != nil {
831                 return macaddr, err
832         }
833         copy(macaddr[:], mac[:])
834         return macaddr, nil
835 }
836
837 func (x MacAddress) ToMAC() net.HardwareAddr {
838         return net.HardwareAddr(x[:])
839 }
840
841 func (x MacAddress) String() string {
842         return x.ToMAC().String()
843 }
844
845 func (x *MacAddress) MarshalText() ([]byte, error) {
846         return []byte(x.String()), nil
847 }
848
849 func (x *MacAddress) UnmarshalText(text []byte) error {
850         mac, err := ParseMacAddress(string(text))
851         if err != nil {
852                 return err
853         }
854         *x = mac
855         return nil
856 }
857
858 // Address defines type 'address'.
859 type Address struct {
860         Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
861         Un AddressUnion  `binapi:"address_union,name=un" json:"un,omitempty"`
862 }
863
864 func ParseAddress(s string) (Address, error) {
865         ip := net.ParseIP(s)
866         if ip == nil {
867                 return Address{}, fmt.Errorf("invalid address: %s", s)
868         }
869         return AddressFromIP(ip), nil
870 }
871
872 func AddressFromIP(ip net.IP) Address {
873         var addr Address
874         if ip.To4() == nil {
875                 addr.Af = ADDRESS_IP6
876                 var ip6 IP6Address
877                 copy(ip6[:], ip.To16())
878                 addr.Un.SetIP6(ip6)
879         } else {
880                 addr.Af = ADDRESS_IP4
881                 var ip4 IP4Address
882                 copy(ip4[:], ip.To4())
883                 addr.Un.SetIP4(ip4)
884         }
885         return addr
886 }
887
888 func (x Address) ToIP() net.IP {
889         if x.Af == ADDRESS_IP6 {
890                 ip6 := x.Un.GetIP6()
891                 return net.IP(ip6[:]).To16()
892         } else {
893                 ip4 := x.Un.GetIP4()
894                 return net.IP(ip4[:]).To4()
895         }
896 }
897
898 func (x Address) String() string {
899         return x.ToIP().String()
900 }
901
902 func (x *Address) MarshalText() ([]byte, error) {
903         return []byte(x.String()), nil
904 }
905
906 func (x *Address) UnmarshalText(text []byte) error {
907         addr, err := ParseAddress(string(text))
908         if err != nil {
909                 return err
910         }
911         *x = addr
912         return nil
913 }
914
915 // FibMplsLabel defines type 'fib_mpls_label'.
916 type FibMplsLabel struct {
917         IsUniform uint8  `binapi:"u8,name=is_uniform" json:"is_uniform,omitempty"`
918         Label     uint32 `binapi:"u32,name=label" json:"label,omitempty"`
919         TTL       uint8  `binapi:"u8,name=ttl" json:"ttl,omitempty"`
920         Exp       uint8  `binapi:"u8,name=exp" json:"exp,omitempty"`
921 }
922
923 // FibPath defines type 'fib_path'.
924 type FibPath struct {
925         SwIfIndex  uint32           `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
926         TableID    uint32           `binapi:"u32,name=table_id" json:"table_id,omitempty"`
927         RpfID      uint32           `binapi:"u32,name=rpf_id" json:"rpf_id,omitempty"`
928         Weight     uint8            `binapi:"u8,name=weight" json:"weight,omitempty"`
929         Preference uint8            `binapi:"u8,name=preference" json:"preference,omitempty"`
930         Type       FibPathType      `binapi:"fib_path_type,name=type" json:"type,omitempty"`
931         Flags      FibPathFlags     `binapi:"fib_path_flags,name=flags" json:"flags,omitempty"`
932         Proto      FibPathNhProto   `binapi:"fib_path_nh_proto,name=proto" json:"proto,omitempty"`
933         Nh         FibPathNh        `binapi:"fib_path_nh,name=nh" json:"nh,omitempty"`
934         NLabels    uint8            `binapi:"u8,name=n_labels" json:"n_labels,omitempty"`
935         LabelStack [16]FibMplsLabel `binapi:"fib_mpls_label[16],name=label_stack" json:"label_stack,omitempty"`
936 }
937
938 // FibPathNh defines type 'fib_path_nh'.
939 type FibPathNh struct {
940         Address            AddressUnion `binapi:"address_union,name=address" json:"address,omitempty"`
941         ViaLabel           uint32       `binapi:"u32,name=via_label" json:"via_label,omitempty"`
942         ObjID              uint32       `binapi:"u32,name=obj_id" json:"obj_id,omitempty"`
943         ClassifyTableIndex uint32       `binapi:"u32,name=classify_table_index" json:"classify_table_index,omitempty"`
944 }
945
946 // IP4Prefix defines type 'ip4_prefix'.
947 type IP4Prefix struct {
948         Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
949         Len     uint8      `binapi:"u8,name=len" json:"len,omitempty"`
950 }
951
952 func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
953         hasPrefix := strings.Contains(s, "/")
954         if hasPrefix {
955                 ip, network, err := net.ParseCIDR(s)
956                 if err != nil {
957                         return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
958                 }
959                 maskSize, _ := network.Mask.Size()
960                 prefix.Len = byte(maskSize)
961                 prefix.Address, err = ParseIP4Address(ip.String())
962                 if err != nil {
963                         return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
964                 }
965         } else {
966                 ip := net.ParseIP(s)
967                 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
968                 if ip.To4() == nil {
969                         defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
970                 }
971                 prefix.Len = byte(defaultMaskSize)
972                 prefix.Address, err = ParseIP4Address(ip.String())
973                 if err != nil {
974                         return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
975                 }
976         }
977         return prefix, nil
978 }
979
980 func (x IP4Prefix) ToIPNet() *net.IPNet {
981         mask := net.CIDRMask(int(x.Len), 32)
982         ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
983         return ipnet
984 }
985
986 func (x IP4Prefix) String() string {
987         ip := x.Address.String()
988         return ip + "/" + strconv.Itoa(int(x.Len))
989 }
990
991 func (x *IP4Prefix) MarshalText() ([]byte, error) {
992         return []byte(x.String()), nil
993 }
994
995 func (x *IP4Prefix) UnmarshalText(text []byte) error {
996         prefix, err := ParseIP4Prefix(string(text))
997         if err != nil {
998                 return err
999         }
1000         *x = prefix
1001         return nil
1002 }
1003
1004 // IP6Prefix defines type 'ip6_prefix'.
1005 type IP6Prefix struct {
1006         Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
1007         Len     uint8      `binapi:"u8,name=len" json:"len,omitempty"`
1008 }
1009
1010 func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
1011         hasPrefix := strings.Contains(s, "/")
1012         if hasPrefix {
1013                 ip, network, err := net.ParseCIDR(s)
1014                 if err != nil {
1015                         return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
1016                 }
1017                 maskSize, _ := network.Mask.Size()
1018                 prefix.Len = byte(maskSize)
1019                 prefix.Address, err = ParseIP6Address(ip.String())
1020                 if err != nil {
1021                         return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
1022                 }
1023         } else {
1024                 ip := net.ParseIP(s)
1025                 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
1026                 if ip.To4() == nil {
1027                         defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
1028                 }
1029                 prefix.Len = byte(defaultMaskSize)
1030                 prefix.Address, err = ParseIP6Address(ip.String())
1031                 if err != nil {
1032                         return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
1033                 }
1034         }
1035         return prefix, nil
1036 }
1037
1038 func (x IP6Prefix) ToIPNet() *net.IPNet {
1039         mask := net.CIDRMask(int(x.Len), 128)
1040         ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
1041         return ipnet
1042 }
1043
1044 func (x IP6Prefix) String() string {
1045         ip := x.Address.String()
1046         return ip + "/" + strconv.Itoa(int(x.Len))
1047 }
1048
1049 func (x *IP6Prefix) MarshalText() ([]byte, error) {
1050         return []byte(x.String()), nil
1051 }
1052
1053 func (x *IP6Prefix) UnmarshalText(text []byte) error {
1054         prefix, err := ParseIP6Prefix(string(text))
1055         if err != nil {
1056                 return err
1057         }
1058         *x = prefix
1059         return nil
1060 }
1061
1062 // IPMroute defines type 'ip_mroute'.
1063 type IPMroute struct {
1064         TableID    uint32     `binapi:"u32,name=table_id" json:"table_id,omitempty"`
1065         EntryFlags uint32     `binapi:"u32,name=entry_flags" json:"entry_flags,omitempty"`
1066         RpfID      uint32     `binapi:"u32,name=rpf_id" json:"rpf_id,omitempty"`
1067         Prefix     Mprefix    `binapi:"mprefix,name=prefix" json:"prefix,omitempty"`
1068         NPaths     uint8      `binapi:"u8,name=n_paths" json:"-"`
1069         Paths      []MfibPath `binapi:"mfib_path[n_paths],name=paths" json:"paths,omitempty"`
1070 }
1071
1072 // IPRoute defines type 'ip_route'.
1073 type IPRoute struct {
1074         TableID    uint32    `binapi:"u32,name=table_id" json:"table_id,omitempty"`
1075         StatsIndex uint32    `binapi:"u32,name=stats_index" json:"stats_index,omitempty"`
1076         Prefix     Prefix    `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
1077         NPaths     uint8     `binapi:"u8,name=n_paths" json:"-"`
1078         Paths      []FibPath `binapi:"fib_path[n_paths],name=paths" json:"paths,omitempty"`
1079 }
1080
1081 // IPTable defines type 'ip_table'.
1082 type IPTable struct {
1083         TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
1084         IsIP6   bool   `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"`
1085         Name    string `binapi:"string[64],name=name" json:"name,omitempty"`
1086 }
1087
1088 // MfibPath defines type 'mfib_path'.
1089 type MfibPath struct {
1090         ItfFlags MfibItfFlags `binapi:"mfib_itf_flags,name=itf_flags" json:"itf_flags,omitempty"`
1091         Path     FibPath      `binapi:"fib_path,name=path" json:"path,omitempty"`
1092 }
1093
1094 // Mprefix defines type 'mprefix'.
1095 type Mprefix struct {
1096         Af               AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
1097         GrpAddressLength uint16        `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
1098         GrpAddress       AddressUnion  `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
1099         SrcAddress       AddressUnion  `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
1100 }
1101
1102 // Prefix defines type 'prefix'.
1103 type Prefix struct {
1104         Address Address `binapi:"address,name=address" json:"address,omitempty"`
1105         Len     uint8   `binapi:"u8,name=len" json:"len,omitempty"`
1106 }
1107
1108 func ParsePrefix(ip string) (prefix Prefix, err error) {
1109         hasPrefix := strings.Contains(ip, "/")
1110         if hasPrefix {
1111                 netIP, network, err := net.ParseCIDR(ip)
1112                 if err != nil {
1113                         return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
1114                 }
1115                 maskSize, _ := network.Mask.Size()
1116                 prefix.Len = byte(maskSize)
1117                 prefix.Address, err = ParseAddress(netIP.String())
1118                 if err != nil {
1119                         return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
1120                 }
1121         } else {
1122                 netIP := net.ParseIP(ip)
1123                 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
1124                 if netIP.To4() == nil {
1125                         defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
1126                 }
1127                 prefix.Len = byte(defaultMaskSize)
1128                 prefix.Address, err = ParseAddress(netIP.String())
1129                 if err != nil {
1130                         return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
1131                 }
1132         }
1133         return prefix, nil
1134 }
1135
1136 func (x Prefix) ToIPNet() *net.IPNet {
1137         var mask net.IPMask
1138         if x.Address.Af == ADDRESS_IP4 {
1139                 mask = net.CIDRMask(int(x.Len), 32)
1140         } else {
1141                 mask = net.CIDRMask(int(x.Len), 128)
1142         }
1143         ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
1144         return ipnet
1145 }
1146
1147 func (x Prefix) String() string {
1148         ip := x.Address.String()
1149         return ip + "/" + strconv.Itoa(int(x.Len))
1150 }
1151
1152 func (x *Prefix) MarshalText() ([]byte, error) {
1153         return []byte(x.String()), nil
1154 }
1155
1156 func (x *Prefix) UnmarshalText(text []byte) error {
1157         prefix, err := ParsePrefix(string(text))
1158         if err != nil {
1159                 return err
1160         }
1161         *x = prefix
1162         return nil
1163 }
1164
1165 // PrefixMatcher defines type 'prefix_matcher'.
1166 type PrefixMatcher struct {
1167         Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
1168         Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
1169 }
1170
1171 // PuntRedirect defines type 'punt_redirect'.
1172 type PuntRedirect struct {
1173         RxSwIfIndex InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
1174         TxSwIfIndex InterfaceIndex `binapi:"interface_index,name=tx_sw_if_index" json:"tx_sw_if_index,omitempty"`
1175         Nh          Address        `binapi:"address,name=nh" json:"nh,omitempty"`
1176 }
1177
1178 // AddressUnion defines union 'address_union'.
1179 type AddressUnion struct {
1180         // AddressUnion can be one of:
1181         // - IP4 *IP4Address
1182         // - IP6 *IP6Address
1183         XXX_UnionData [16]byte
1184 }
1185
1186 func AddressUnionIP4(a IP4Address) (u AddressUnion) {
1187         u.SetIP4(a)
1188         return
1189 }
1190 func (u *AddressUnion) SetIP4(a IP4Address) {
1191         buf := codec.NewBuffer(u.XXX_UnionData[:])
1192         buf.EncodeBytes(a[:], 4)
1193 }
1194 func (u *AddressUnion) GetIP4() (a IP4Address) {
1195         buf := codec.NewBuffer(u.XXX_UnionData[:])
1196         copy(a[:], buf.DecodeBytes(4))
1197         return
1198 }
1199
1200 func AddressUnionIP6(a IP6Address) (u AddressUnion) {
1201         u.SetIP6(a)
1202         return
1203 }
1204 func (u *AddressUnion) SetIP6(a IP6Address) {
1205         buf := codec.NewBuffer(u.XXX_UnionData[:])
1206         buf.EncodeBytes(a[:], 16)
1207 }
1208 func (u *AddressUnion) GetIP6() (a IP6Address) {
1209         buf := codec.NewBuffer(u.XXX_UnionData[:])
1210         copy(a[:], buf.DecodeBytes(16))
1211         return
1212 }
1213
1214 // IoamDisable defines message 'ioam_disable'.
1215 type IoamDisable struct {
1216         ID uint16 `binapi:"u16,name=id" json:"id,omitempty"`
1217 }
1218
1219 func (m *IoamDisable) Reset()               { *m = IoamDisable{} }
1220 func (*IoamDisable) GetMessageName() string { return "ioam_disable" }
1221 func (*IoamDisable) GetCrcString() string   { return "6b16a45e" }
1222 func (*IoamDisable) GetMessageType() api.MessageType {
1223         return api.RequestMessage
1224 }
1225
1226 func (m *IoamDisable) Size() (size int) {
1227         if m == nil {
1228                 return 0
1229         }
1230         size += 2 // m.ID
1231         return size
1232 }
1233 func (m *IoamDisable) Marshal(b []byte) ([]byte, error) {
1234         if b == nil {
1235                 b = make([]byte, m.Size())
1236         }
1237         buf := codec.NewBuffer(b)
1238         buf.EncodeUint16(m.ID)
1239         return buf.Bytes(), nil
1240 }
1241 func (m *IoamDisable) Unmarshal(b []byte) error {
1242         buf := codec.NewBuffer(b)
1243         m.ID = buf.DecodeUint16()
1244         return nil
1245 }
1246
1247 // IoamDisableReply defines message 'ioam_disable_reply'.
1248 type IoamDisableReply struct {
1249         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1250 }
1251
1252 func (m *IoamDisableReply) Reset()               { *m = IoamDisableReply{} }
1253 func (*IoamDisableReply) GetMessageName() string { return "ioam_disable_reply" }
1254 func (*IoamDisableReply) GetCrcString() string   { return "e8d4e804" }
1255 func (*IoamDisableReply) GetMessageType() api.MessageType {
1256         return api.ReplyMessage
1257 }
1258
1259 func (m *IoamDisableReply) Size() (size int) {
1260         if m == nil {
1261                 return 0
1262         }
1263         size += 4 // m.Retval
1264         return size
1265 }
1266 func (m *IoamDisableReply) Marshal(b []byte) ([]byte, error) {
1267         if b == nil {
1268                 b = make([]byte, m.Size())
1269         }
1270         buf := codec.NewBuffer(b)
1271         buf.EncodeInt32(m.Retval)
1272         return buf.Bytes(), nil
1273 }
1274 func (m *IoamDisableReply) Unmarshal(b []byte) error {
1275         buf := codec.NewBuffer(b)
1276         m.Retval = buf.DecodeInt32()
1277         return nil
1278 }
1279
1280 // IoamEnable defines message 'ioam_enable'.
1281 type IoamEnable struct {
1282         ID          uint16 `binapi:"u16,name=id" json:"id,omitempty"`
1283         Seqno       bool   `binapi:"bool,name=seqno" json:"seqno,omitempty"`
1284         Analyse     bool   `binapi:"bool,name=analyse" json:"analyse,omitempty"`
1285         PotEnable   bool   `binapi:"bool,name=pot_enable" json:"pot_enable,omitempty"`
1286         TraceEnable bool   `binapi:"bool,name=trace_enable" json:"trace_enable,omitempty"`
1287         NodeID      uint32 `binapi:"u32,name=node_id" json:"node_id,omitempty"`
1288 }
1289
1290 func (m *IoamEnable) Reset()               { *m = IoamEnable{} }
1291 func (*IoamEnable) GetMessageName() string { return "ioam_enable" }
1292 func (*IoamEnable) GetCrcString() string   { return "51ccd868" }
1293 func (*IoamEnable) GetMessageType() api.MessageType {
1294         return api.RequestMessage
1295 }
1296
1297 func (m *IoamEnable) Size() (size int) {
1298         if m == nil {
1299                 return 0
1300         }
1301         size += 2 // m.ID
1302         size += 1 // m.Seqno
1303         size += 1 // m.Analyse
1304         size += 1 // m.PotEnable
1305         size += 1 // m.TraceEnable
1306         size += 4 // m.NodeID
1307         return size
1308 }
1309 func (m *IoamEnable) Marshal(b []byte) ([]byte, error) {
1310         if b == nil {
1311                 b = make([]byte, m.Size())
1312         }
1313         buf := codec.NewBuffer(b)
1314         buf.EncodeUint16(m.ID)
1315         buf.EncodeBool(m.Seqno)
1316         buf.EncodeBool(m.Analyse)
1317         buf.EncodeBool(m.PotEnable)
1318         buf.EncodeBool(m.TraceEnable)
1319         buf.EncodeUint32(m.NodeID)
1320         return buf.Bytes(), nil
1321 }
1322 func (m *IoamEnable) Unmarshal(b []byte) error {
1323         buf := codec.NewBuffer(b)
1324         m.ID = buf.DecodeUint16()
1325         m.Seqno = buf.DecodeBool()
1326         m.Analyse = buf.DecodeBool()
1327         m.PotEnable = buf.DecodeBool()
1328         m.TraceEnable = buf.DecodeBool()
1329         m.NodeID = buf.DecodeUint32()
1330         return nil
1331 }
1332
1333 // IoamEnableReply defines message 'ioam_enable_reply'.
1334 type IoamEnableReply struct {
1335         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1336 }
1337
1338 func (m *IoamEnableReply) Reset()               { *m = IoamEnableReply{} }
1339 func (*IoamEnableReply) GetMessageName() string { return "ioam_enable_reply" }
1340 func (*IoamEnableReply) GetCrcString() string   { return "e8d4e804" }
1341 func (*IoamEnableReply) GetMessageType() api.MessageType {
1342         return api.ReplyMessage
1343 }
1344
1345 func (m *IoamEnableReply) Size() (size int) {
1346         if m == nil {
1347                 return 0
1348         }
1349         size += 4 // m.Retval
1350         return size
1351 }
1352 func (m *IoamEnableReply) Marshal(b []byte) ([]byte, error) {
1353         if b == nil {
1354                 b = make([]byte, m.Size())
1355         }
1356         buf := codec.NewBuffer(b)
1357         buf.EncodeInt32(m.Retval)
1358         return buf.Bytes(), nil
1359 }
1360 func (m *IoamEnableReply) Unmarshal(b []byte) error {
1361         buf := codec.NewBuffer(b)
1362         m.Retval = buf.DecodeInt32()
1363         return nil
1364 }
1365
1366 // IPAddressDetails defines message 'ip_address_details'.
1367 type IPAddressDetails struct {
1368         SwIfIndex InterfaceIndex    `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1369         Prefix    AddressWithPrefix `binapi:"address_with_prefix,name=prefix" json:"prefix,omitempty"`
1370 }
1371
1372 func (m *IPAddressDetails) Reset()               { *m = IPAddressDetails{} }
1373 func (*IPAddressDetails) GetMessageName() string { return "ip_address_details" }
1374 func (*IPAddressDetails) GetCrcString() string   { return "b1199745" }
1375 func (*IPAddressDetails) GetMessageType() api.MessageType {
1376         return api.ReplyMessage
1377 }
1378
1379 func (m *IPAddressDetails) Size() (size int) {
1380         if m == nil {
1381                 return 0
1382         }
1383         size += 4      // m.SwIfIndex
1384         size += 4      // m.Prefix.Address.Af
1385         size += 1 * 16 // m.Prefix.Address.Un
1386         size += 1      // m.Prefix.Len
1387         return size
1388 }
1389 func (m *IPAddressDetails) Marshal(b []byte) ([]byte, error) {
1390         if b == nil {
1391                 b = make([]byte, m.Size())
1392         }
1393         buf := codec.NewBuffer(b)
1394         buf.EncodeUint32(uint32(m.SwIfIndex))
1395         buf.EncodeUint32(uint32(m.Prefix.Address.Af))
1396         buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16)
1397         buf.EncodeUint8(m.Prefix.Len)
1398         return buf.Bytes(), nil
1399 }
1400 func (m *IPAddressDetails) Unmarshal(b []byte) error {
1401         buf := codec.NewBuffer(b)
1402         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1403         m.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
1404         copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1405         m.Prefix.Len = buf.DecodeUint8()
1406         return nil
1407 }
1408
1409 // IPAddressDump defines message 'ip_address_dump'.
1410 type IPAddressDump struct {
1411         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1412         IsIPv6    bool           `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
1413 }
1414
1415 func (m *IPAddressDump) Reset()               { *m = IPAddressDump{} }
1416 func (*IPAddressDump) GetMessageName() string { return "ip_address_dump" }
1417 func (*IPAddressDump) GetCrcString() string   { return "2d033de4" }
1418 func (*IPAddressDump) GetMessageType() api.MessageType {
1419         return api.RequestMessage
1420 }
1421
1422 func (m *IPAddressDump) Size() (size int) {
1423         if m == nil {
1424                 return 0
1425         }
1426         size += 4 // m.SwIfIndex
1427         size += 1 // m.IsIPv6
1428         return size
1429 }
1430 func (m *IPAddressDump) Marshal(b []byte) ([]byte, error) {
1431         if b == nil {
1432                 b = make([]byte, m.Size())
1433         }
1434         buf := codec.NewBuffer(b)
1435         buf.EncodeUint32(uint32(m.SwIfIndex))
1436         buf.EncodeBool(m.IsIPv6)
1437         return buf.Bytes(), nil
1438 }
1439 func (m *IPAddressDump) Unmarshal(b []byte) error {
1440         buf := codec.NewBuffer(b)
1441         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1442         m.IsIPv6 = buf.DecodeBool()
1443         return nil
1444 }
1445
1446 // IPContainerProxyAddDel defines message 'ip_container_proxy_add_del'.
1447 type IPContainerProxyAddDel struct {
1448         Pfx       Prefix         `binapi:"prefix,name=pfx" json:"pfx,omitempty"`
1449         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1450         IsAdd     bool           `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
1451 }
1452
1453 func (m *IPContainerProxyAddDel) Reset()               { *m = IPContainerProxyAddDel{} }
1454 func (*IPContainerProxyAddDel) GetMessageName() string { return "ip_container_proxy_add_del" }
1455 func (*IPContainerProxyAddDel) GetCrcString() string   { return "91189f40" }
1456 func (*IPContainerProxyAddDel) GetMessageType() api.MessageType {
1457         return api.RequestMessage
1458 }
1459
1460 func (m *IPContainerProxyAddDel) Size() (size int) {
1461         if m == nil {
1462                 return 0
1463         }
1464         size += 4      // m.Pfx.Address.Af
1465         size += 1 * 16 // m.Pfx.Address.Un
1466         size += 1      // m.Pfx.Len
1467         size += 4      // m.SwIfIndex
1468         size += 1      // m.IsAdd
1469         return size
1470 }
1471 func (m *IPContainerProxyAddDel) Marshal(b []byte) ([]byte, error) {
1472         if b == nil {
1473                 b = make([]byte, m.Size())
1474         }
1475         buf := codec.NewBuffer(b)
1476         buf.EncodeUint32(uint32(m.Pfx.Address.Af))
1477         buf.EncodeBytes(m.Pfx.Address.Un.XXX_UnionData[:], 16)
1478         buf.EncodeUint8(m.Pfx.Len)
1479         buf.EncodeUint32(uint32(m.SwIfIndex))
1480         buf.EncodeBool(m.IsAdd)
1481         return buf.Bytes(), nil
1482 }
1483 func (m *IPContainerProxyAddDel) Unmarshal(b []byte) error {
1484         buf := codec.NewBuffer(b)
1485         m.Pfx.Address.Af = AddressFamily(buf.DecodeUint32())
1486         copy(m.Pfx.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1487         m.Pfx.Len = buf.DecodeUint8()
1488         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1489         m.IsAdd = buf.DecodeBool()
1490         return nil
1491 }
1492
1493 // IPContainerProxyAddDelReply defines message 'ip_container_proxy_add_del_reply'.
1494 type IPContainerProxyAddDelReply struct {
1495         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1496 }
1497
1498 func (m *IPContainerProxyAddDelReply) Reset() { *m = IPContainerProxyAddDelReply{} }
1499 func (*IPContainerProxyAddDelReply) GetMessageName() string {
1500         return "ip_container_proxy_add_del_reply"
1501 }
1502 func (*IPContainerProxyAddDelReply) GetCrcString() string { return "e8d4e804" }
1503 func (*IPContainerProxyAddDelReply) GetMessageType() api.MessageType {
1504         return api.ReplyMessage
1505 }
1506
1507 func (m *IPContainerProxyAddDelReply) Size() (size int) {
1508         if m == nil {
1509                 return 0
1510         }
1511         size += 4 // m.Retval
1512         return size
1513 }
1514 func (m *IPContainerProxyAddDelReply) Marshal(b []byte) ([]byte, error) {
1515         if b == nil {
1516                 b = make([]byte, m.Size())
1517         }
1518         buf := codec.NewBuffer(b)
1519         buf.EncodeInt32(m.Retval)
1520         return buf.Bytes(), nil
1521 }
1522 func (m *IPContainerProxyAddDelReply) Unmarshal(b []byte) error {
1523         buf := codec.NewBuffer(b)
1524         m.Retval = buf.DecodeInt32()
1525         return nil
1526 }
1527
1528 // IPContainerProxyDetails defines message 'ip_container_proxy_details'.
1529 type IPContainerProxyDetails struct {
1530         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1531         Prefix    Prefix         `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
1532 }
1533
1534 func (m *IPContainerProxyDetails) Reset()               { *m = IPContainerProxyDetails{} }
1535 func (*IPContainerProxyDetails) GetMessageName() string { return "ip_container_proxy_details" }
1536 func (*IPContainerProxyDetails) GetCrcString() string   { return "0ee460e8" }
1537 func (*IPContainerProxyDetails) GetMessageType() api.MessageType {
1538         return api.ReplyMessage
1539 }
1540
1541 func (m *IPContainerProxyDetails) Size() (size int) {
1542         if m == nil {
1543                 return 0
1544         }
1545         size += 4      // m.SwIfIndex
1546         size += 4      // m.Prefix.Address.Af
1547         size += 1 * 16 // m.Prefix.Address.Un
1548         size += 1      // m.Prefix.Len
1549         return size
1550 }
1551 func (m *IPContainerProxyDetails) Marshal(b []byte) ([]byte, error) {
1552         if b == nil {
1553                 b = make([]byte, m.Size())
1554         }
1555         buf := codec.NewBuffer(b)
1556         buf.EncodeUint32(uint32(m.SwIfIndex))
1557         buf.EncodeUint32(uint32(m.Prefix.Address.Af))
1558         buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16)
1559         buf.EncodeUint8(m.Prefix.Len)
1560         return buf.Bytes(), nil
1561 }
1562 func (m *IPContainerProxyDetails) Unmarshal(b []byte) error {
1563         buf := codec.NewBuffer(b)
1564         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1565         m.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
1566         copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1567         m.Prefix.Len = buf.DecodeUint8()
1568         return nil
1569 }
1570
1571 // IPContainerProxyDump defines message 'ip_container_proxy_dump'.
1572 type IPContainerProxyDump struct{}
1573
1574 func (m *IPContainerProxyDump) Reset()               { *m = IPContainerProxyDump{} }
1575 func (*IPContainerProxyDump) GetMessageName() string { return "ip_container_proxy_dump" }
1576 func (*IPContainerProxyDump) GetCrcString() string   { return "51077d14" }
1577 func (*IPContainerProxyDump) GetMessageType() api.MessageType {
1578         return api.RequestMessage
1579 }
1580
1581 func (m *IPContainerProxyDump) Size() (size int) {
1582         if m == nil {
1583                 return 0
1584         }
1585         return size
1586 }
1587 func (m *IPContainerProxyDump) Marshal(b []byte) ([]byte, error) {
1588         if b == nil {
1589                 b = make([]byte, m.Size())
1590         }
1591         buf := codec.NewBuffer(b)
1592         return buf.Bytes(), nil
1593 }
1594 func (m *IPContainerProxyDump) Unmarshal(b []byte) error {
1595         return nil
1596 }
1597
1598 // IPDetails defines message 'ip_details'.
1599 type IPDetails struct {
1600         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1601         IsIPv6    bool           `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
1602 }
1603
1604 func (m *IPDetails) Reset()               { *m = IPDetails{} }
1605 func (*IPDetails) GetMessageName() string { return "ip_details" }
1606 func (*IPDetails) GetCrcString() string   { return "eb152d07" }
1607 func (*IPDetails) GetMessageType() api.MessageType {
1608         return api.ReplyMessage
1609 }
1610
1611 func (m *IPDetails) Size() (size int) {
1612         if m == nil {
1613                 return 0
1614         }
1615         size += 4 // m.SwIfIndex
1616         size += 1 // m.IsIPv6
1617         return size
1618 }
1619 func (m *IPDetails) Marshal(b []byte) ([]byte, error) {
1620         if b == nil {
1621                 b = make([]byte, m.Size())
1622         }
1623         buf := codec.NewBuffer(b)
1624         buf.EncodeUint32(uint32(m.SwIfIndex))
1625         buf.EncodeBool(m.IsIPv6)
1626         return buf.Bytes(), nil
1627 }
1628 func (m *IPDetails) Unmarshal(b []byte) error {
1629         buf := codec.NewBuffer(b)
1630         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1631         m.IsIPv6 = buf.DecodeBool()
1632         return nil
1633 }
1634
1635 // IPDump defines message 'ip_dump'.
1636 type IPDump struct {
1637         IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
1638 }
1639
1640 func (m *IPDump) Reset()               { *m = IPDump{} }
1641 func (*IPDump) GetMessageName() string { return "ip_dump" }
1642 func (*IPDump) GetCrcString() string   { return "98d231ca" }
1643 func (*IPDump) GetMessageType() api.MessageType {
1644         return api.RequestMessage
1645 }
1646
1647 func (m *IPDump) Size() (size int) {
1648         if m == nil {
1649                 return 0
1650         }
1651         size += 1 // m.IsIPv6
1652         return size
1653 }
1654 func (m *IPDump) Marshal(b []byte) ([]byte, error) {
1655         if b == nil {
1656                 b = make([]byte, m.Size())
1657         }
1658         buf := codec.NewBuffer(b)
1659         buf.EncodeBool(m.IsIPv6)
1660         return buf.Bytes(), nil
1661 }
1662 func (m *IPDump) Unmarshal(b []byte) error {
1663         buf := codec.NewBuffer(b)
1664         m.IsIPv6 = buf.DecodeBool()
1665         return nil
1666 }
1667
1668 // IPMrouteAddDel defines message 'ip_mroute_add_del'.
1669 type IPMrouteAddDel struct {
1670         IsAdd       bool     `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
1671         IsMultipath bool     `binapi:"bool,name=is_multipath" json:"is_multipath,omitempty"`
1672         Route       IPMroute `binapi:"ip_mroute,name=route" json:"route,omitempty"`
1673 }
1674
1675 func (m *IPMrouteAddDel) Reset()               { *m = IPMrouteAddDel{} }
1676 func (*IPMrouteAddDel) GetMessageName() string { return "ip_mroute_add_del" }
1677 func (*IPMrouteAddDel) GetCrcString() string   { return "f6627d17" }
1678 func (*IPMrouteAddDel) GetMessageType() api.MessageType {
1679         return api.RequestMessage
1680 }
1681
1682 func (m *IPMrouteAddDel) Size() (size int) {
1683         if m == nil {
1684                 return 0
1685         }
1686         size += 1      // m.IsAdd
1687         size += 1      // m.IsMultipath
1688         size += 4      // m.Route.TableID
1689         size += 4      // m.Route.EntryFlags
1690         size += 4      // m.Route.RpfID
1691         size += 4      // m.Route.Prefix.Af
1692         size += 2      // m.Route.Prefix.GrpAddressLength
1693         size += 1 * 16 // m.Route.Prefix.GrpAddress
1694         size += 1 * 16 // m.Route.Prefix.SrcAddress
1695         size += 1      // m.Route.NPaths
1696         for j2 := 0; j2 < len(m.Route.Paths); j2++ {
1697                 var s2 MfibPath
1698                 _ = s2
1699                 if j2 < len(m.Route.Paths) {
1700                         s2 = m.Route.Paths[j2]
1701                 }
1702                 size += 4      // s2.ItfFlags
1703                 size += 4      // s2.Path.SwIfIndex
1704                 size += 4      // s2.Path.TableID
1705                 size += 4      // s2.Path.RpfID
1706                 size += 1      // s2.Path.Weight
1707                 size += 1      // s2.Path.Preference
1708                 size += 4      // s2.Path.Type
1709                 size += 4      // s2.Path.Flags
1710                 size += 4      // s2.Path.Proto
1711                 size += 1 * 16 // s2.Path.Nh.Address
1712                 size += 4      // s2.Path.Nh.ViaLabel
1713                 size += 4      // s2.Path.Nh.ObjID
1714                 size += 4      // s2.Path.Nh.ClassifyTableIndex
1715                 size += 1      // s2.Path.NLabels
1716                 for j4 := 0; j4 < 16; j4++ {
1717                         size += 1 // s2.Path.LabelStack[j4].IsUniform
1718                         size += 4 // s2.Path.LabelStack[j4].Label
1719                         size += 1 // s2.Path.LabelStack[j4].TTL
1720                         size += 1 // s2.Path.LabelStack[j4].Exp
1721                 }
1722         }
1723         return size
1724 }
1725 func (m *IPMrouteAddDel) Marshal(b []byte) ([]byte, error) {
1726         if b == nil {
1727                 b = make([]byte, m.Size())
1728         }
1729         buf := codec.NewBuffer(b)
1730         buf.EncodeBool(m.IsAdd)
1731         buf.EncodeBool(m.IsMultipath)
1732         buf.EncodeUint32(m.Route.TableID)
1733         buf.EncodeUint32(m.Route.EntryFlags)
1734         buf.EncodeUint32(m.Route.RpfID)
1735         buf.EncodeUint32(uint32(m.Route.Prefix.Af))
1736         buf.EncodeUint16(m.Route.Prefix.GrpAddressLength)
1737         buf.EncodeBytes(m.Route.Prefix.GrpAddress.XXX_UnionData[:], 16)
1738         buf.EncodeBytes(m.Route.Prefix.SrcAddress.XXX_UnionData[:], 16)
1739         buf.EncodeUint8(uint8(len(m.Route.Paths)))
1740         for j1 := 0; j1 < len(m.Route.Paths); j1++ {
1741                 var v1 MfibPath // Paths
1742                 if j1 < len(m.Route.Paths) {
1743                         v1 = m.Route.Paths[j1]
1744                 }
1745                 buf.EncodeUint32(uint32(v1.ItfFlags))
1746                 buf.EncodeUint32(v1.Path.SwIfIndex)
1747                 buf.EncodeUint32(v1.Path.TableID)
1748                 buf.EncodeUint32(v1.Path.RpfID)
1749                 buf.EncodeUint8(v1.Path.Weight)
1750                 buf.EncodeUint8(v1.Path.Preference)
1751                 buf.EncodeUint32(uint32(v1.Path.Type))
1752                 buf.EncodeUint32(uint32(v1.Path.Flags))
1753                 buf.EncodeUint32(uint32(v1.Path.Proto))
1754                 buf.EncodeBytes(v1.Path.Nh.Address.XXX_UnionData[:], 16)
1755                 buf.EncodeUint32(v1.Path.Nh.ViaLabel)
1756                 buf.EncodeUint32(v1.Path.Nh.ObjID)
1757                 buf.EncodeUint32(v1.Path.Nh.ClassifyTableIndex)
1758                 buf.EncodeUint8(v1.Path.NLabels)
1759                 for j3 := 0; j3 < 16; j3++ {
1760                         buf.EncodeUint8(v1.Path.LabelStack[j3].IsUniform)
1761                         buf.EncodeUint32(v1.Path.LabelStack[j3].Label)
1762                         buf.EncodeUint8(v1.Path.LabelStack[j3].TTL)
1763                         buf.EncodeUint8(v1.Path.LabelStack[j3].Exp)
1764                 }
1765         }
1766         return buf.Bytes(), nil
1767 }
1768 func (m *IPMrouteAddDel) Unmarshal(b []byte) error {
1769         buf := codec.NewBuffer(b)
1770         m.IsAdd = buf.DecodeBool()
1771         m.IsMultipath = buf.DecodeBool()
1772         m.Route.TableID = buf.DecodeUint32()
1773         m.Route.EntryFlags = buf.DecodeUint32()
1774         m.Route.RpfID = buf.DecodeUint32()
1775         m.Route.Prefix.Af = AddressFamily(buf.DecodeUint32())
1776         m.Route.Prefix.GrpAddressLength = buf.DecodeUint16()
1777         copy(m.Route.Prefix.GrpAddress.XXX_UnionData[:], buf.DecodeBytes(16))
1778         copy(m.Route.Prefix.SrcAddress.XXX_UnionData[:], buf.DecodeBytes(16))
1779         m.Route.NPaths = buf.DecodeUint8()
1780         m.Route.Paths = make([]MfibPath, m.Route.NPaths)
1781         for j1 := 0; j1 < len(m.Route.Paths); j1++ {
1782                 m.Route.Paths[j1].ItfFlags = MfibItfFlags(buf.DecodeUint32())
1783                 m.Route.Paths[j1].Path.SwIfIndex = buf.DecodeUint32()
1784                 m.Route.Paths[j1].Path.TableID = buf.DecodeUint32()
1785                 m.Route.Paths[j1].Path.RpfID = buf.DecodeUint32()
1786                 m.Route.Paths[j1].Path.Weight = buf.DecodeUint8()
1787                 m.Route.Paths[j1].Path.Preference = buf.DecodeUint8()
1788                 m.Route.Paths[j1].Path.Type = FibPathType(buf.DecodeUint32())
1789                 m.Route.Paths[j1].Path.Flags = FibPathFlags(buf.DecodeUint32())
1790                 m.Route.Paths[j1].Path.Proto = FibPathNhProto(buf.DecodeUint32())
1791                 copy(m.Route.Paths[j1].Path.Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
1792                 m.Route.Paths[j1].Path.Nh.ViaLabel = buf.DecodeUint32()
1793                 m.Route.Paths[j1].Path.Nh.ObjID = buf.DecodeUint32()
1794                 m.Route.Paths[j1].Path.Nh.ClassifyTableIndex = buf.DecodeUint32()
1795                 m.Route.Paths[j1].Path.NLabels = buf.DecodeUint8()
1796                 for j3 := 0; j3 < 16; j3++ {
1797                         m.Route.Paths[j1].Path.LabelStack[j3].IsUniform = buf.DecodeUint8()
1798                         m.Route.Paths[j1].Path.LabelStack[j3].Label = buf.DecodeUint32()
1799                         m.Route.Paths[j1].Path.LabelStack[j3].TTL = buf.DecodeUint8()
1800                         m.Route.Paths[j1].Path.LabelStack[j3].Exp = buf.DecodeUint8()
1801                 }
1802         }
1803         return nil
1804 }
1805
1806 // IPMrouteAddDelReply defines message 'ip_mroute_add_del_reply'.
1807 type IPMrouteAddDelReply struct {
1808         Retval     int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
1809         StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"`
1810 }
1811
1812 func (m *IPMrouteAddDelReply) Reset()               { *m = IPMrouteAddDelReply{} }
1813 func (*IPMrouteAddDelReply) GetMessageName() string { return "ip_mroute_add_del_reply" }
1814 func (*IPMrouteAddDelReply) GetCrcString() string   { return "1992deab" }
1815 func (*IPMrouteAddDelReply) GetMessageType() api.MessageType {
1816         return api.ReplyMessage
1817 }
1818
1819 func (m *IPMrouteAddDelReply) Size() (size int) {
1820         if m == nil {
1821                 return 0
1822         }
1823         size += 4 // m.Retval
1824         size += 4 // m.StatsIndex
1825         return size
1826 }
1827 func (m *IPMrouteAddDelReply) Marshal(b []byte) ([]byte, error) {
1828         if b == nil {
1829                 b = make([]byte, m.Size())
1830         }
1831         buf := codec.NewBuffer(b)
1832         buf.EncodeInt32(m.Retval)
1833         buf.EncodeUint32(m.StatsIndex)
1834         return buf.Bytes(), nil
1835 }
1836 func (m *IPMrouteAddDelReply) Unmarshal(b []byte) error {
1837         buf := codec.NewBuffer(b)
1838         m.Retval = buf.DecodeInt32()
1839         m.StatsIndex = buf.DecodeUint32()
1840         return nil
1841 }
1842
1843 // IPMrouteDetails defines message 'ip_mroute_details'.
1844 type IPMrouteDetails struct {
1845         Route IPMroute `binapi:"ip_mroute,name=route" json:"route,omitempty"`
1846 }
1847
1848 func (m *IPMrouteDetails) Reset()               { *m = IPMrouteDetails{} }
1849 func (*IPMrouteDetails) GetMessageName() string { return "ip_mroute_details" }
1850 func (*IPMrouteDetails) GetCrcString() string   { return "c1cb4b44" }
1851 func (*IPMrouteDetails) GetMessageType() api.MessageType {
1852         return api.ReplyMessage
1853 }
1854
1855 func (m *IPMrouteDetails) Size() (size int) {
1856         if m == nil {
1857                 return 0
1858         }
1859         size += 4      // m.Route.TableID
1860         size += 4      // m.Route.EntryFlags
1861         size += 4      // m.Route.RpfID
1862         size += 4      // m.Route.Prefix.Af
1863         size += 2      // m.Route.Prefix.GrpAddressLength
1864         size += 1 * 16 // m.Route.Prefix.GrpAddress
1865         size += 1 * 16 // m.Route.Prefix.SrcAddress
1866         size += 1      // m.Route.NPaths
1867         for j2 := 0; j2 < len(m.Route.Paths); j2++ {
1868                 var s2 MfibPath
1869                 _ = s2
1870                 if j2 < len(m.Route.Paths) {
1871                         s2 = m.Route.Paths[j2]
1872                 }
1873                 size += 4      // s2.ItfFlags
1874                 size += 4      // s2.Path.SwIfIndex
1875                 size += 4      // s2.Path.TableID
1876                 size += 4      // s2.Path.RpfID
1877                 size += 1      // s2.Path.Weight
1878                 size += 1      // s2.Path.Preference
1879                 size += 4      // s2.Path.Type
1880                 size += 4      // s2.Path.Flags
1881                 size += 4      // s2.Path.Proto
1882                 size += 1 * 16 // s2.Path.Nh.Address
1883                 size += 4      // s2.Path.Nh.ViaLabel
1884                 size += 4      // s2.Path.Nh.ObjID
1885                 size += 4      // s2.Path.Nh.ClassifyTableIndex
1886                 size += 1      // s2.Path.NLabels
1887                 for j4 := 0; j4 < 16; j4++ {
1888                         size += 1 // s2.Path.LabelStack[j4].IsUniform
1889                         size += 4 // s2.Path.LabelStack[j4].Label
1890                         size += 1 // s2.Path.LabelStack[j4].TTL
1891                         size += 1 // s2.Path.LabelStack[j4].Exp
1892                 }
1893         }
1894         return size
1895 }
1896 func (m *IPMrouteDetails) Marshal(b []byte) ([]byte, error) {
1897         if b == nil {
1898                 b = make([]byte, m.Size())
1899         }
1900         buf := codec.NewBuffer(b)
1901         buf.EncodeUint32(m.Route.TableID)
1902         buf.EncodeUint32(m.Route.EntryFlags)
1903         buf.EncodeUint32(m.Route.RpfID)
1904         buf.EncodeUint32(uint32(m.Route.Prefix.Af))
1905         buf.EncodeUint16(m.Route.Prefix.GrpAddressLength)
1906         buf.EncodeBytes(m.Route.Prefix.GrpAddress.XXX_UnionData[:], 16)
1907         buf.EncodeBytes(m.Route.Prefix.SrcAddress.XXX_UnionData[:], 16)
1908         buf.EncodeUint8(uint8(len(m.Route.Paths)))
1909         for j1 := 0; j1 < len(m.Route.Paths); j1++ {
1910                 var v1 MfibPath // Paths
1911                 if j1 < len(m.Route.Paths) {
1912                         v1 = m.Route.Paths[j1]
1913                 }
1914                 buf.EncodeUint32(uint32(v1.ItfFlags))
1915                 buf.EncodeUint32(v1.Path.SwIfIndex)
1916                 buf.EncodeUint32(v1.Path.TableID)
1917                 buf.EncodeUint32(v1.Path.RpfID)
1918                 buf.EncodeUint8(v1.Path.Weight)
1919                 buf.EncodeUint8(v1.Path.Preference)
1920                 buf.EncodeUint32(uint32(v1.Path.Type))
1921                 buf.EncodeUint32(uint32(v1.Path.Flags))
1922                 buf.EncodeUint32(uint32(v1.Path.Proto))
1923                 buf.EncodeBytes(v1.Path.Nh.Address.XXX_UnionData[:], 16)
1924                 buf.EncodeUint32(v1.Path.Nh.ViaLabel)
1925                 buf.EncodeUint32(v1.Path.Nh.ObjID)
1926                 buf.EncodeUint32(v1.Path.Nh.ClassifyTableIndex)
1927                 buf.EncodeUint8(v1.Path.NLabels)
1928                 for j3 := 0; j3 < 16; j3++ {
1929                         buf.EncodeUint8(v1.Path.LabelStack[j3].IsUniform)
1930                         buf.EncodeUint32(v1.Path.LabelStack[j3].Label)
1931                         buf.EncodeUint8(v1.Path.LabelStack[j3].TTL)
1932                         buf.EncodeUint8(v1.Path.LabelStack[j3].Exp)
1933                 }
1934         }
1935         return buf.Bytes(), nil
1936 }
1937 func (m *IPMrouteDetails) Unmarshal(b []byte) error {
1938         buf := codec.NewBuffer(b)
1939         m.Route.TableID = buf.DecodeUint32()
1940         m.Route.EntryFlags = buf.DecodeUint32()
1941         m.Route.RpfID = buf.DecodeUint32()
1942         m.Route.Prefix.Af = AddressFamily(buf.DecodeUint32())
1943         m.Route.Prefix.GrpAddressLength = buf.DecodeUint16()
1944         copy(m.Route.Prefix.GrpAddress.XXX_UnionData[:], buf.DecodeBytes(16))
1945         copy(m.Route.Prefix.SrcAddress.XXX_UnionData[:], buf.DecodeBytes(16))
1946         m.Route.NPaths = buf.DecodeUint8()
1947         m.Route.Paths = make([]MfibPath, m.Route.NPaths)
1948         for j1 := 0; j1 < len(m.Route.Paths); j1++ {
1949                 m.Route.Paths[j1].ItfFlags = MfibItfFlags(buf.DecodeUint32())
1950                 m.Route.Paths[j1].Path.SwIfIndex = buf.DecodeUint32()
1951                 m.Route.Paths[j1].Path.TableID = buf.DecodeUint32()
1952                 m.Route.Paths[j1].Path.RpfID = buf.DecodeUint32()
1953                 m.Route.Paths[j1].Path.Weight = buf.DecodeUint8()
1954                 m.Route.Paths[j1].Path.Preference = buf.DecodeUint8()
1955                 m.Route.Paths[j1].Path.Type = FibPathType(buf.DecodeUint32())
1956                 m.Route.Paths[j1].Path.Flags = FibPathFlags(buf.DecodeUint32())
1957                 m.Route.Paths[j1].Path.Proto = FibPathNhProto(buf.DecodeUint32())
1958                 copy(m.Route.Paths[j1].Path.Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
1959                 m.Route.Paths[j1].Path.Nh.ViaLabel = buf.DecodeUint32()
1960                 m.Route.Paths[j1].Path.Nh.ObjID = buf.DecodeUint32()
1961                 m.Route.Paths[j1].Path.Nh.ClassifyTableIndex = buf.DecodeUint32()
1962                 m.Route.Paths[j1].Path.NLabels = buf.DecodeUint8()
1963                 for j3 := 0; j3 < 16; j3++ {
1964                         m.Route.Paths[j1].Path.LabelStack[j3].IsUniform = buf.DecodeUint8()
1965                         m.Route.Paths[j1].Path.LabelStack[j3].Label = buf.DecodeUint32()
1966                         m.Route.Paths[j1].Path.LabelStack[j3].TTL = buf.DecodeUint8()
1967                         m.Route.Paths[j1].Path.LabelStack[j3].Exp = buf.DecodeUint8()
1968                 }
1969         }
1970         return nil
1971 }
1972
1973 // IPMrouteDump defines message 'ip_mroute_dump'.
1974 type IPMrouteDump struct {
1975         Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
1976 }
1977
1978 func (m *IPMrouteDump) Reset()               { *m = IPMrouteDump{} }
1979 func (*IPMrouteDump) GetMessageName() string { return "ip_mroute_dump" }
1980 func (*IPMrouteDump) GetCrcString() string   { return "b9d2e09e" }
1981 func (*IPMrouteDump) GetMessageType() api.MessageType {
1982         return api.RequestMessage
1983 }
1984
1985 func (m *IPMrouteDump) Size() (size int) {
1986         if m == nil {
1987                 return 0
1988         }
1989         size += 4  // m.Table.TableID
1990         size += 1  // m.Table.IsIP6
1991         size += 64 // m.Table.Name
1992         return size
1993 }
1994 func (m *IPMrouteDump) Marshal(b []byte) ([]byte, error) {
1995         if b == nil {
1996                 b = make([]byte, m.Size())
1997         }
1998         buf := codec.NewBuffer(b)
1999         buf.EncodeUint32(m.Table.TableID)
2000         buf.EncodeBool(m.Table.IsIP6)
2001         buf.EncodeString(m.Table.Name, 64)
2002         return buf.Bytes(), nil
2003 }
2004 func (m *IPMrouteDump) Unmarshal(b []byte) error {
2005         buf := codec.NewBuffer(b)
2006         m.Table.TableID = buf.DecodeUint32()
2007         m.Table.IsIP6 = buf.DecodeBool()
2008         m.Table.Name = buf.DecodeString(64)
2009         return nil
2010 }
2011
2012 // IPMtableDetails defines message 'ip_mtable_details'.
2013 type IPMtableDetails struct {
2014         Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
2015 }
2016
2017 func (m *IPMtableDetails) Reset()               { *m = IPMtableDetails{} }
2018 func (*IPMtableDetails) GetMessageName() string { return "ip_mtable_details" }
2019 func (*IPMtableDetails) GetCrcString() string   { return "b9d2e09e" }
2020 func (*IPMtableDetails) GetMessageType() api.MessageType {
2021         return api.RequestMessage
2022 }
2023
2024 func (m *IPMtableDetails) Size() (size int) {
2025         if m == nil {
2026                 return 0
2027         }
2028         size += 4  // m.Table.TableID
2029         size += 1  // m.Table.IsIP6
2030         size += 64 // m.Table.Name
2031         return size
2032 }
2033 func (m *IPMtableDetails) Marshal(b []byte) ([]byte, error) {
2034         if b == nil {
2035                 b = make([]byte, m.Size())
2036         }
2037         buf := codec.NewBuffer(b)
2038         buf.EncodeUint32(m.Table.TableID)
2039         buf.EncodeBool(m.Table.IsIP6)
2040         buf.EncodeString(m.Table.Name, 64)
2041         return buf.Bytes(), nil
2042 }
2043 func (m *IPMtableDetails) Unmarshal(b []byte) error {
2044         buf := codec.NewBuffer(b)
2045         m.Table.TableID = buf.DecodeUint32()
2046         m.Table.IsIP6 = buf.DecodeBool()
2047         m.Table.Name = buf.DecodeString(64)
2048         return nil
2049 }
2050
2051 // IPMtableDump defines message 'ip_mtable_dump'.
2052 type IPMtableDump struct{}
2053
2054 func (m *IPMtableDump) Reset()               { *m = IPMtableDump{} }
2055 func (*IPMtableDump) GetMessageName() string { return "ip_mtable_dump" }
2056 func (*IPMtableDump) GetCrcString() string   { return "51077d14" }
2057 func (*IPMtableDump) GetMessageType() api.MessageType {
2058         return api.RequestMessage
2059 }
2060
2061 func (m *IPMtableDump) Size() (size int) {
2062         if m == nil {
2063                 return 0
2064         }
2065         return size
2066 }
2067 func (m *IPMtableDump) Marshal(b []byte) ([]byte, error) {
2068         if b == nil {
2069                 b = make([]byte, m.Size())
2070         }
2071         buf := codec.NewBuffer(b)
2072         return buf.Bytes(), nil
2073 }
2074 func (m *IPMtableDump) Unmarshal(b []byte) error {
2075         return nil
2076 }
2077
2078 // IPPuntPolice defines message 'ip_punt_police'.
2079 type IPPuntPolice struct {
2080         PolicerIndex uint32 `binapi:"u32,name=policer_index" json:"policer_index,omitempty"`
2081         IsAdd        bool   `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
2082         IsIP6        bool   `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"`
2083 }
2084
2085 func (m *IPPuntPolice) Reset()               { *m = IPPuntPolice{} }
2086 func (*IPPuntPolice) GetMessageName() string { return "ip_punt_police" }
2087 func (*IPPuntPolice) GetCrcString() string   { return "db867cea" }
2088 func (*IPPuntPolice) GetMessageType() api.MessageType {
2089         return api.RequestMessage
2090 }
2091
2092 func (m *IPPuntPolice) Size() (size int) {
2093         if m == nil {
2094                 return 0
2095         }
2096         size += 4 // m.PolicerIndex
2097         size += 1 // m.IsAdd
2098         size += 1 // m.IsIP6
2099         return size
2100 }
2101 func (m *IPPuntPolice) Marshal(b []byte) ([]byte, error) {
2102         if b == nil {
2103                 b = make([]byte, m.Size())
2104         }
2105         buf := codec.NewBuffer(b)
2106         buf.EncodeUint32(m.PolicerIndex)
2107         buf.EncodeBool(m.IsAdd)
2108         buf.EncodeBool(m.IsIP6)
2109         return buf.Bytes(), nil
2110 }
2111 func (m *IPPuntPolice) Unmarshal(b []byte) error {
2112         buf := codec.NewBuffer(b)
2113         m.PolicerIndex = buf.DecodeUint32()
2114         m.IsAdd = buf.DecodeBool()
2115         m.IsIP6 = buf.DecodeBool()
2116         return nil
2117 }
2118
2119 // IPPuntPoliceReply defines message 'ip_punt_police_reply'.
2120 type IPPuntPoliceReply struct {
2121         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2122 }
2123
2124 func (m *IPPuntPoliceReply) Reset()               { *m = IPPuntPoliceReply{} }
2125 func (*IPPuntPoliceReply) GetMessageName() string { return "ip_punt_police_reply" }
2126 func (*IPPuntPoliceReply) GetCrcString() string   { return "e8d4e804" }
2127 func (*IPPuntPoliceReply) GetMessageType() api.MessageType {
2128         return api.ReplyMessage
2129 }
2130
2131 func (m *IPPuntPoliceReply) Size() (size int) {
2132         if m == nil {
2133                 return 0
2134         }
2135         size += 4 // m.Retval
2136         return size
2137 }
2138 func (m *IPPuntPoliceReply) Marshal(b []byte) ([]byte, error) {
2139         if b == nil {
2140                 b = make([]byte, m.Size())
2141         }
2142         buf := codec.NewBuffer(b)
2143         buf.EncodeInt32(m.Retval)
2144         return buf.Bytes(), nil
2145 }
2146 func (m *IPPuntPoliceReply) Unmarshal(b []byte) error {
2147         buf := codec.NewBuffer(b)
2148         m.Retval = buf.DecodeInt32()
2149         return nil
2150 }
2151
2152 // IPPuntRedirect defines message 'ip_punt_redirect'.
2153 type IPPuntRedirect struct {
2154         Punt  PuntRedirect `binapi:"punt_redirect,name=punt" json:"punt,omitempty"`
2155         IsAdd bool         `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
2156 }
2157
2158 func (m *IPPuntRedirect) Reset()               { *m = IPPuntRedirect{} }
2159 func (*IPPuntRedirect) GetMessageName() string { return "ip_punt_redirect" }
2160 func (*IPPuntRedirect) GetCrcString() string   { return "a9a5592c" }
2161 func (*IPPuntRedirect) GetMessageType() api.MessageType {
2162         return api.RequestMessage
2163 }
2164
2165 func (m *IPPuntRedirect) Size() (size int) {
2166         if m == nil {
2167                 return 0
2168         }
2169         size += 4      // m.Punt.RxSwIfIndex
2170         size += 4      // m.Punt.TxSwIfIndex
2171         size += 4      // m.Punt.Nh.Af
2172         size += 1 * 16 // m.Punt.Nh.Un
2173         size += 1      // m.IsAdd
2174         return size
2175 }
2176 func (m *IPPuntRedirect) Marshal(b []byte) ([]byte, error) {
2177         if b == nil {
2178                 b = make([]byte, m.Size())
2179         }
2180         buf := codec.NewBuffer(b)
2181         buf.EncodeUint32(uint32(m.Punt.RxSwIfIndex))
2182         buf.EncodeUint32(uint32(m.Punt.TxSwIfIndex))
2183         buf.EncodeUint32(uint32(m.Punt.Nh.Af))
2184         buf.EncodeBytes(m.Punt.Nh.Un.XXX_UnionData[:], 16)
2185         buf.EncodeBool(m.IsAdd)
2186         return buf.Bytes(), nil
2187 }
2188 func (m *IPPuntRedirect) Unmarshal(b []byte) error {
2189         buf := codec.NewBuffer(b)
2190         m.Punt.RxSwIfIndex = InterfaceIndex(buf.DecodeUint32())
2191         m.Punt.TxSwIfIndex = InterfaceIndex(buf.DecodeUint32())
2192         m.Punt.Nh.Af = AddressFamily(buf.DecodeUint32())
2193         copy(m.Punt.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16))
2194         m.IsAdd = buf.DecodeBool()
2195         return nil
2196 }
2197
2198 // IPPuntRedirectDetails defines message 'ip_punt_redirect_details'.
2199 type IPPuntRedirectDetails struct {
2200         Punt PuntRedirect `binapi:"punt_redirect,name=punt" json:"punt,omitempty"`
2201 }
2202
2203 func (m *IPPuntRedirectDetails) Reset()               { *m = IPPuntRedirectDetails{} }
2204 func (*IPPuntRedirectDetails) GetMessageName() string { return "ip_punt_redirect_details" }
2205 func (*IPPuntRedirectDetails) GetCrcString() string   { return "3924f5d3" }
2206 func (*IPPuntRedirectDetails) GetMessageType() api.MessageType {
2207         return api.ReplyMessage
2208 }
2209
2210 func (m *IPPuntRedirectDetails) Size() (size int) {
2211         if m == nil {
2212                 return 0
2213         }
2214         size += 4      // m.Punt.RxSwIfIndex
2215         size += 4      // m.Punt.TxSwIfIndex
2216         size += 4      // m.Punt.Nh.Af
2217         size += 1 * 16 // m.Punt.Nh.Un
2218         return size
2219 }
2220 func (m *IPPuntRedirectDetails) Marshal(b []byte) ([]byte, error) {
2221         if b == nil {
2222                 b = make([]byte, m.Size())
2223         }
2224         buf := codec.NewBuffer(b)
2225         buf.EncodeUint32(uint32(m.Punt.RxSwIfIndex))
2226         buf.EncodeUint32(uint32(m.Punt.TxSwIfIndex))
2227         buf.EncodeUint32(uint32(m.Punt.Nh.Af))
2228         buf.EncodeBytes(m.Punt.Nh.Un.XXX_UnionData[:], 16)
2229         return buf.Bytes(), nil
2230 }
2231 func (m *IPPuntRedirectDetails) Unmarshal(b []byte) error {
2232         buf := codec.NewBuffer(b)
2233         m.Punt.RxSwIfIndex = InterfaceIndex(buf.DecodeUint32())
2234         m.Punt.TxSwIfIndex = InterfaceIndex(buf.DecodeUint32())
2235         m.Punt.Nh.Af = AddressFamily(buf.DecodeUint32())
2236         copy(m.Punt.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16))
2237         return nil
2238 }
2239
2240 // IPPuntRedirectDump defines message 'ip_punt_redirect_dump'.
2241 type IPPuntRedirectDump struct {
2242         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
2243         IsIPv6    bool           `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
2244 }
2245
2246 func (m *IPPuntRedirectDump) Reset()               { *m = IPPuntRedirectDump{} }
2247 func (*IPPuntRedirectDump) GetMessageName() string { return "ip_punt_redirect_dump" }
2248 func (*IPPuntRedirectDump) GetCrcString() string   { return "2d033de4" }
2249 func (*IPPuntRedirectDump) GetMessageType() api.MessageType {
2250         return api.RequestMessage
2251 }
2252
2253 func (m *IPPuntRedirectDump) Size() (size int) {
2254         if m == nil {
2255                 return 0
2256         }
2257         size += 4 // m.SwIfIndex
2258         size += 1 // m.IsIPv6
2259         return size
2260 }
2261 func (m *IPPuntRedirectDump) Marshal(b []byte) ([]byte, error) {
2262         if b == nil {
2263                 b = make([]byte, m.Size())
2264         }
2265         buf := codec.NewBuffer(b)
2266         buf.EncodeUint32(uint32(m.SwIfIndex))
2267         buf.EncodeBool(m.IsIPv6)
2268         return buf.Bytes(), nil
2269 }
2270 func (m *IPPuntRedirectDump) Unmarshal(b []byte) error {
2271         buf := codec.NewBuffer(b)
2272         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2273         m.IsIPv6 = buf.DecodeBool()
2274         return nil
2275 }
2276
2277 // IPPuntRedirectReply defines message 'ip_punt_redirect_reply'.
2278 type IPPuntRedirectReply struct {
2279         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2280 }
2281
2282 func (m *IPPuntRedirectReply) Reset()               { *m = IPPuntRedirectReply{} }
2283 func (*IPPuntRedirectReply) GetMessageName() string { return "ip_punt_redirect_reply" }
2284 func (*IPPuntRedirectReply) GetCrcString() string   { return "e8d4e804" }
2285 func (*IPPuntRedirectReply) GetMessageType() api.MessageType {
2286         return api.ReplyMessage
2287 }
2288
2289 func (m *IPPuntRedirectReply) Size() (size int) {
2290         if m == nil {
2291                 return 0
2292         }
2293         size += 4 // m.Retval
2294         return size
2295 }
2296 func (m *IPPuntRedirectReply) Marshal(b []byte) ([]byte, error) {
2297         if b == nil {
2298                 b = make([]byte, m.Size())
2299         }
2300         buf := codec.NewBuffer(b)
2301         buf.EncodeInt32(m.Retval)
2302         return buf.Bytes(), nil
2303 }
2304 func (m *IPPuntRedirectReply) Unmarshal(b []byte) error {
2305         buf := codec.NewBuffer(b)
2306         m.Retval = buf.DecodeInt32()
2307         return nil
2308 }
2309
2310 // IPReassemblyEnableDisable defines message 'ip_reassembly_enable_disable'.
2311 type IPReassemblyEnableDisable struct {
2312         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
2313         EnableIP4 bool           `binapi:"bool,name=enable_ip4" json:"enable_ip4,omitempty"`
2314         EnableIP6 bool           `binapi:"bool,name=enable_ip6" json:"enable_ip6,omitempty"`
2315         Type      IPReassType    `binapi:"ip_reass_type,name=type" json:"type,omitempty"`
2316 }
2317
2318 func (m *IPReassemblyEnableDisable) Reset()               { *m = IPReassemblyEnableDisable{} }
2319 func (*IPReassemblyEnableDisable) GetMessageName() string { return "ip_reassembly_enable_disable" }
2320 func (*IPReassemblyEnableDisable) GetCrcString() string   { return "885c85a6" }
2321 func (*IPReassemblyEnableDisable) GetMessageType() api.MessageType {
2322         return api.RequestMessage
2323 }
2324
2325 func (m *IPReassemblyEnableDisable) Size() (size int) {
2326         if m == nil {
2327                 return 0
2328         }
2329         size += 4 // m.SwIfIndex
2330         size += 1 // m.EnableIP4
2331         size += 1 // m.EnableIP6
2332         size += 4 // m.Type
2333         return size
2334 }
2335 func (m *IPReassemblyEnableDisable) Marshal(b []byte) ([]byte, error) {
2336         if b == nil {
2337                 b = make([]byte, m.Size())
2338         }
2339         buf := codec.NewBuffer(b)
2340         buf.EncodeUint32(uint32(m.SwIfIndex))
2341         buf.EncodeBool(m.EnableIP4)
2342         buf.EncodeBool(m.EnableIP6)
2343         buf.EncodeUint32(uint32(m.Type))
2344         return buf.Bytes(), nil
2345 }
2346 func (m *IPReassemblyEnableDisable) Unmarshal(b []byte) error {
2347         buf := codec.NewBuffer(b)
2348         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2349         m.EnableIP4 = buf.DecodeBool()
2350         m.EnableIP6 = buf.DecodeBool()
2351         m.Type = IPReassType(buf.DecodeUint32())
2352         return nil
2353 }
2354
2355 // IPReassemblyEnableDisableReply defines message 'ip_reassembly_enable_disable_reply'.
2356 type IPReassemblyEnableDisableReply struct {
2357         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2358 }
2359
2360 func (m *IPReassemblyEnableDisableReply) Reset() { *m = IPReassemblyEnableDisableReply{} }
2361 func (*IPReassemblyEnableDisableReply) GetMessageName() string {
2362         return "ip_reassembly_enable_disable_reply"
2363 }
2364 func (*IPReassemblyEnableDisableReply) GetCrcString() string { return "e8d4e804" }
2365 func (*IPReassemblyEnableDisableReply) GetMessageType() api.MessageType {
2366         return api.ReplyMessage
2367 }
2368
2369 func (m *IPReassemblyEnableDisableReply) Size() (size int) {
2370         if m == nil {
2371                 return 0
2372         }
2373         size += 4 // m.Retval
2374         return size
2375 }
2376 func (m *IPReassemblyEnableDisableReply) Marshal(b []byte) ([]byte, error) {
2377         if b == nil {
2378                 b = make([]byte, m.Size())
2379         }
2380         buf := codec.NewBuffer(b)
2381         buf.EncodeInt32(m.Retval)
2382         return buf.Bytes(), nil
2383 }
2384 func (m *IPReassemblyEnableDisableReply) Unmarshal(b []byte) error {
2385         buf := codec.NewBuffer(b)
2386         m.Retval = buf.DecodeInt32()
2387         return nil
2388 }
2389
2390 // IPReassemblyGet defines message 'ip_reassembly_get'.
2391 type IPReassemblyGet struct {
2392         IsIP6 bool        `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"`
2393         Type  IPReassType `binapi:"ip_reass_type,name=type" json:"type,omitempty"`
2394 }
2395
2396 func (m *IPReassemblyGet) Reset()               { *m = IPReassemblyGet{} }
2397 func (*IPReassemblyGet) GetMessageName() string { return "ip_reassembly_get" }
2398 func (*IPReassemblyGet) GetCrcString() string   { return "ea13ff63" }
2399 func (*IPReassemblyGet) GetMessageType() api.MessageType {
2400         return api.RequestMessage
2401 }
2402
2403 func (m *IPReassemblyGet) Size() (size int) {
2404         if m == nil {
2405                 return 0
2406         }
2407         size += 1 // m.IsIP6
2408         size += 4 // m.Type
2409         return size
2410 }
2411 func (m *IPReassemblyGet) Marshal(b []byte) ([]byte, error) {
2412         if b == nil {
2413                 b = make([]byte, m.Size())
2414         }
2415         buf := codec.NewBuffer(b)
2416         buf.EncodeBool(m.IsIP6)
2417         buf.EncodeUint32(uint32(m.Type))
2418         return buf.Bytes(), nil
2419 }
2420 func (m *IPReassemblyGet) Unmarshal(b []byte) error {
2421         buf := codec.NewBuffer(b)
2422         m.IsIP6 = buf.DecodeBool()
2423         m.Type = IPReassType(buf.DecodeUint32())
2424         return nil
2425 }
2426
2427 // IPReassemblyGetReply defines message 'ip_reassembly_get_reply'.
2428 type IPReassemblyGetReply struct {
2429         Retval               int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
2430         TimeoutMs            uint32 `binapi:"u32,name=timeout_ms" json:"timeout_ms,omitempty"`
2431         MaxReassemblies      uint32 `binapi:"u32,name=max_reassemblies" json:"max_reassemblies,omitempty"`
2432         MaxReassemblyLength  uint32 `binapi:"u32,name=max_reassembly_length" json:"max_reassembly_length,omitempty"`
2433         ExpireWalkIntervalMs uint32 `binapi:"u32,name=expire_walk_interval_ms" json:"expire_walk_interval_ms,omitempty"`
2434         IsIP6                bool   `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"`
2435 }
2436
2437 func (m *IPReassemblyGetReply) Reset()               { *m = IPReassemblyGetReply{} }
2438 func (*IPReassemblyGetReply) GetMessageName() string { return "ip_reassembly_get_reply" }
2439 func (*IPReassemblyGetReply) GetCrcString() string   { return "d5eb8d34" }
2440 func (*IPReassemblyGetReply) GetMessageType() api.MessageType {
2441         return api.ReplyMessage
2442 }
2443
2444 func (m *IPReassemblyGetReply) Size() (size int) {
2445         if m == nil {
2446                 return 0
2447         }
2448         size += 4 // m.Retval
2449         size += 4 // m.TimeoutMs
2450         size += 4 // m.MaxReassemblies
2451         size += 4 // m.MaxReassemblyLength
2452         size += 4 // m.ExpireWalkIntervalMs
2453         size += 1 // m.IsIP6
2454         return size
2455 }
2456 func (m *IPReassemblyGetReply) Marshal(b []byte) ([]byte, error) {
2457         if b == nil {
2458                 b = make([]byte, m.Size())
2459         }
2460         buf := codec.NewBuffer(b)
2461         buf.EncodeInt32(m.Retval)
2462         buf.EncodeUint32(m.TimeoutMs)
2463         buf.EncodeUint32(m.MaxReassemblies)
2464         buf.EncodeUint32(m.MaxReassemblyLength)
2465         buf.EncodeUint32(m.ExpireWalkIntervalMs)
2466         buf.EncodeBool(m.IsIP6)
2467         return buf.Bytes(), nil
2468 }
2469 func (m *IPReassemblyGetReply) Unmarshal(b []byte) error {
2470         buf := codec.NewBuffer(b)
2471         m.Retval = buf.DecodeInt32()
2472         m.TimeoutMs = buf.DecodeUint32()
2473         m.MaxReassemblies = buf.DecodeUint32()
2474         m.MaxReassemblyLength = buf.DecodeUint32()
2475         m.ExpireWalkIntervalMs = buf.DecodeUint32()
2476         m.IsIP6 = buf.DecodeBool()
2477         return nil
2478 }
2479
2480 // IPReassemblySet defines message 'ip_reassembly_set'.
2481 type IPReassemblySet struct {
2482         TimeoutMs            uint32      `binapi:"u32,name=timeout_ms" json:"timeout_ms,omitempty"`
2483         MaxReassemblies      uint32      `binapi:"u32,name=max_reassemblies" json:"max_reassemblies,omitempty"`
2484         MaxReassemblyLength  uint32      `binapi:"u32,name=max_reassembly_length" json:"max_reassembly_length,omitempty"`
2485         ExpireWalkIntervalMs uint32      `binapi:"u32,name=expire_walk_interval_ms" json:"expire_walk_interval_ms,omitempty"`
2486         IsIP6                bool        `binapi:"bool,name=is_ip6" json:"is_ip6,omitempty"`
2487         Type                 IPReassType `binapi:"ip_reass_type,name=type" json:"type,omitempty"`
2488 }
2489
2490 func (m *IPReassemblySet) Reset()               { *m = IPReassemblySet{} }
2491 func (*IPReassemblySet) GetMessageName() string { return "ip_reassembly_set" }
2492 func (*IPReassemblySet) GetCrcString() string   { return "16467d25" }
2493 func (*IPReassemblySet) GetMessageType() api.MessageType {
2494         return api.RequestMessage
2495 }
2496
2497 func (m *IPReassemblySet) Size() (size int) {
2498         if m == nil {
2499                 return 0
2500         }
2501         size += 4 // m.TimeoutMs
2502         size += 4 // m.MaxReassemblies
2503         size += 4 // m.MaxReassemblyLength
2504         size += 4 // m.ExpireWalkIntervalMs
2505         size += 1 // m.IsIP6
2506         size += 4 // m.Type
2507         return size
2508 }
2509 func (m *IPReassemblySet) Marshal(b []byte) ([]byte, error) {
2510         if b == nil {
2511                 b = make([]byte, m.Size())
2512         }
2513         buf := codec.NewBuffer(b)
2514         buf.EncodeUint32(m.TimeoutMs)
2515         buf.EncodeUint32(m.MaxReassemblies)
2516         buf.EncodeUint32(m.MaxReassemblyLength)
2517         buf.EncodeUint32(m.ExpireWalkIntervalMs)
2518         buf.EncodeBool(m.IsIP6)
2519         buf.EncodeUint32(uint32(m.Type))
2520         return buf.Bytes(), nil
2521 }
2522 func (m *IPReassemblySet) Unmarshal(b []byte) error {
2523         buf := codec.NewBuffer(b)
2524         m.TimeoutMs = buf.DecodeUint32()
2525         m.MaxReassemblies = buf.DecodeUint32()
2526         m.MaxReassemblyLength = buf.DecodeUint32()
2527         m.ExpireWalkIntervalMs = buf.DecodeUint32()
2528         m.IsIP6 = buf.DecodeBool()
2529         m.Type = IPReassType(buf.DecodeUint32())
2530         return nil
2531 }
2532
2533 // IPReassemblySetReply defines message 'ip_reassembly_set_reply'.
2534 type IPReassemblySetReply struct {
2535         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2536 }
2537
2538 func (m *IPReassemblySetReply) Reset()               { *m = IPReassemblySetReply{} }
2539 func (*IPReassemblySetReply) GetMessageName() string { return "ip_reassembly_set_reply" }
2540 func (*IPReassemblySetReply) GetCrcString() string   { return "e8d4e804" }
2541 func (*IPReassemblySetReply) GetMessageType() api.MessageType {
2542         return api.ReplyMessage
2543 }
2544
2545 func (m *IPReassemblySetReply) Size() (size int) {
2546         if m == nil {
2547                 return 0
2548         }
2549         size += 4 // m.Retval
2550         return size
2551 }
2552 func (m *IPReassemblySetReply) Marshal(b []byte) ([]byte, error) {
2553         if b == nil {
2554                 b = make([]byte, m.Size())
2555         }
2556         buf := codec.NewBuffer(b)
2557         buf.EncodeInt32(m.Retval)
2558         return buf.Bytes(), nil
2559 }
2560 func (m *IPReassemblySetReply) Unmarshal(b []byte) error {
2561         buf := codec.NewBuffer(b)
2562         m.Retval = buf.DecodeInt32()
2563         return nil
2564 }
2565
2566 // IPRouteAddDel defines message 'ip_route_add_del'.
2567 type IPRouteAddDel struct {
2568         IsAdd       bool    `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
2569         IsMultipath bool    `binapi:"bool,name=is_multipath" json:"is_multipath,omitempty"`
2570         Route       IPRoute `binapi:"ip_route,name=route" json:"route,omitempty"`
2571 }
2572
2573 func (m *IPRouteAddDel) Reset()               { *m = IPRouteAddDel{} }
2574 func (*IPRouteAddDel) GetMessageName() string { return "ip_route_add_del" }
2575 func (*IPRouteAddDel) GetCrcString() string   { return "c1ff832d" }
2576 func (*IPRouteAddDel) GetMessageType() api.MessageType {
2577         return api.RequestMessage
2578 }
2579
2580 func (m *IPRouteAddDel) Size() (size int) {
2581         if m == nil {
2582                 return 0
2583         }
2584         size += 1      // m.IsAdd
2585         size += 1      // m.IsMultipath
2586         size += 4      // m.Route.TableID
2587         size += 4      // m.Route.StatsIndex
2588         size += 4      // m.Route.Prefix.Address.Af
2589         size += 1 * 16 // m.Route.Prefix.Address.Un
2590         size += 1      // m.Route.Prefix.Len
2591         size += 1      // m.Route.NPaths
2592         for j2 := 0; j2 < len(m.Route.Paths); j2++ {
2593                 var s2 FibPath
2594                 _ = s2
2595                 if j2 < len(m.Route.Paths) {
2596                         s2 = m.Route.Paths[j2]
2597                 }
2598                 size += 4      // s2.SwIfIndex
2599                 size += 4      // s2.TableID
2600                 size += 4      // s2.RpfID
2601                 size += 1      // s2.Weight
2602                 size += 1      // s2.Preference
2603                 size += 4      // s2.Type
2604                 size += 4      // s2.Flags
2605                 size += 4      // s2.Proto
2606                 size += 1 * 16 // s2.Nh.Address
2607                 size += 4      // s2.Nh.ViaLabel
2608                 size += 4      // s2.Nh.ObjID
2609                 size += 4      // s2.Nh.ClassifyTableIndex
2610                 size += 1      // s2.NLabels
2611                 for j3 := 0; j3 < 16; j3++ {
2612                         size += 1 // s2.LabelStack[j3].IsUniform
2613                         size += 4 // s2.LabelStack[j3].Label
2614                         size += 1 // s2.LabelStack[j3].TTL
2615                         size += 1 // s2.LabelStack[j3].Exp
2616                 }
2617         }
2618         return size
2619 }
2620 func (m *IPRouteAddDel) Marshal(b []byte) ([]byte, error) {
2621         if b == nil {
2622                 b = make([]byte, m.Size())
2623         }
2624         buf := codec.NewBuffer(b)
2625         buf.EncodeBool(m.IsAdd)
2626         buf.EncodeBool(m.IsMultipath)
2627         buf.EncodeUint32(m.Route.TableID)
2628         buf.EncodeUint32(m.Route.StatsIndex)
2629         buf.EncodeUint32(uint32(m.Route.Prefix.Address.Af))
2630         buf.EncodeBytes(m.Route.Prefix.Address.Un.XXX_UnionData[:], 16)
2631         buf.EncodeUint8(m.Route.Prefix.Len)
2632         buf.EncodeUint8(uint8(len(m.Route.Paths)))
2633         for j1 := 0; j1 < len(m.Route.Paths); j1++ {
2634                 var v1 FibPath // Paths
2635                 if j1 < len(m.Route.Paths) {
2636                         v1 = m.Route.Paths[j1]
2637                 }
2638                 buf.EncodeUint32(v1.SwIfIndex)
2639                 buf.EncodeUint32(v1.TableID)
2640                 buf.EncodeUint32(v1.RpfID)
2641                 buf.EncodeUint8(v1.Weight)
2642                 buf.EncodeUint8(v1.Preference)
2643                 buf.EncodeUint32(uint32(v1.Type))
2644                 buf.EncodeUint32(uint32(v1.Flags))
2645                 buf.EncodeUint32(uint32(v1.Proto))
2646                 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16)
2647                 buf.EncodeUint32(v1.Nh.ViaLabel)
2648                 buf.EncodeUint32(v1.Nh.ObjID)
2649                 buf.EncodeUint32(v1.Nh.ClassifyTableIndex)
2650                 buf.EncodeUint8(v1.NLabels)
2651                 for j2 := 0; j2 < 16; j2++ {
2652                         buf.EncodeUint8(v1.LabelStack[j2].IsUniform)
2653                         buf.EncodeUint32(v1.LabelStack[j2].Label)
2654                         buf.EncodeUint8(v1.LabelStack[j2].TTL)
2655                         buf.EncodeUint8(v1.LabelStack[j2].Exp)
2656                 }
2657         }
2658         return buf.Bytes(), nil
2659 }
2660 func (m *IPRouteAddDel) Unmarshal(b []byte) error {
2661         buf := codec.NewBuffer(b)
2662         m.IsAdd = buf.DecodeBool()
2663         m.IsMultipath = buf.DecodeBool()
2664         m.Route.TableID = buf.DecodeUint32()
2665         m.Route.StatsIndex = buf.DecodeUint32()
2666         m.Route.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
2667         copy(m.Route.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
2668         m.Route.Prefix.Len = buf.DecodeUint8()
2669         m.Route.NPaths = buf.DecodeUint8()
2670         m.Route.Paths = make([]FibPath, m.Route.NPaths)
2671         for j1 := 0; j1 < len(m.Route.Paths); j1++ {
2672                 m.Route.Paths[j1].SwIfIndex = buf.DecodeUint32()
2673                 m.Route.Paths[j1].TableID = buf.DecodeUint32()
2674                 m.Route.Paths[j1].RpfID = buf.DecodeUint32()
2675                 m.Route.Paths[j1].Weight = buf.DecodeUint8()
2676                 m.Route.Paths[j1].Preference = buf.DecodeUint8()
2677                 m.Route.Paths[j1].Type = FibPathType(buf.DecodeUint32())
2678                 m.Route.Paths[j1].Flags = FibPathFlags(buf.DecodeUint32())
2679                 m.Route.Paths[j1].Proto = FibPathNhProto(buf.DecodeUint32())
2680                 copy(m.Route.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
2681                 m.Route.Paths[j1].Nh.ViaLabel = buf.DecodeUint32()
2682                 m.Route.Paths[j1].Nh.ObjID = buf.DecodeUint32()
2683                 m.Route.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
2684                 m.Route.Paths[j1].NLabels = buf.DecodeUint8()
2685                 for j2 := 0; j2 < 16; j2++ {
2686                         m.Route.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
2687                         m.Route.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32()
2688                         m.Route.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
2689                         m.Route.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
2690                 }
2691         }
2692         return nil
2693 }
2694
2695 // IPRouteAddDelReply defines message 'ip_route_add_del_reply'.
2696 type IPRouteAddDelReply struct {
2697         Retval     int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
2698         StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"`
2699 }
2700
2701 func (m *IPRouteAddDelReply) Reset()               { *m = IPRouteAddDelReply{} }
2702 func (*IPRouteAddDelReply) GetMessageName() string { return "ip_route_add_del_reply" }
2703 func (*IPRouteAddDelReply) GetCrcString() string   { return "1992deab" }
2704 func (*IPRouteAddDelReply) GetMessageType() api.MessageType {
2705         return api.ReplyMessage
2706 }
2707
2708 func (m *IPRouteAddDelReply) Size() (size int) {
2709         if m == nil {
2710                 return 0
2711         }
2712         size += 4 // m.Retval
2713         size += 4 // m.StatsIndex
2714         return size
2715 }
2716 func (m *IPRouteAddDelReply) Marshal(b []byte) ([]byte, error) {
2717         if b == nil {
2718                 b = make([]byte, m.Size())
2719         }
2720         buf := codec.NewBuffer(b)
2721         buf.EncodeInt32(m.Retval)
2722         buf.EncodeUint32(m.StatsIndex)
2723         return buf.Bytes(), nil
2724 }
2725 func (m *IPRouteAddDelReply) Unmarshal(b []byte) error {
2726         buf := codec.NewBuffer(b)
2727         m.Retval = buf.DecodeInt32()
2728         m.StatsIndex = buf.DecodeUint32()
2729         return nil
2730 }
2731
2732 // IPRouteDetails defines message 'ip_route_details'.
2733 type IPRouteDetails struct {
2734         Route IPRoute `binapi:"ip_route,name=route" json:"route,omitempty"`
2735 }
2736
2737 func (m *IPRouteDetails) Reset()               { *m = IPRouteDetails{} }
2738 func (*IPRouteDetails) GetMessageName() string { return "ip_route_details" }
2739 func (*IPRouteDetails) GetCrcString() string   { return "d1ffaae1" }
2740 func (*IPRouteDetails) GetMessageType() api.MessageType {
2741         return api.ReplyMessage
2742 }
2743
2744 func (m *IPRouteDetails) Size() (size int) {
2745         if m == nil {
2746                 return 0
2747         }
2748         size += 4      // m.Route.TableID
2749         size += 4      // m.Route.StatsIndex
2750         size += 4      // m.Route.Prefix.Address.Af
2751         size += 1 * 16 // m.Route.Prefix.Address.Un
2752         size += 1      // m.Route.Prefix.Len
2753         size += 1      // m.Route.NPaths
2754         for j2 := 0; j2 < len(m.Route.Paths); j2++ {
2755                 var s2 FibPath
2756                 _ = s2
2757                 if j2 < len(m.Route.Paths) {
2758                         s2 = m.Route.Paths[j2]
2759                 }
2760                 size += 4      // s2.SwIfIndex
2761                 size += 4      // s2.TableID
2762                 size += 4      // s2.RpfID
2763                 size += 1      // s2.Weight
2764                 size += 1      // s2.Preference
2765                 size += 4      // s2.Type
2766                 size += 4      // s2.Flags
2767                 size += 4      // s2.Proto
2768                 size += 1 * 16 // s2.Nh.Address
2769                 size += 4      // s2.Nh.ViaLabel
2770                 size += 4      // s2.Nh.ObjID
2771                 size += 4      // s2.Nh.ClassifyTableIndex
2772                 size += 1      // s2.NLabels
2773                 for j3 := 0; j3 < 16; j3++ {
2774                         size += 1 // s2.LabelStack[j3].IsUniform
2775                         size += 4 // s2.LabelStack[j3].Label
2776                         size += 1 // s2.LabelStack[j3].TTL
2777                         size += 1 // s2.LabelStack[j3].Exp
2778                 }
2779         }
2780         return size
2781 }
2782 func (m *IPRouteDetails) Marshal(b []byte) ([]byte, error) {
2783         if b == nil {
2784                 b = make([]byte, m.Size())
2785         }
2786         buf := codec.NewBuffer(b)
2787         buf.EncodeUint32(m.Route.TableID)
2788         buf.EncodeUint32(m.Route.StatsIndex)
2789         buf.EncodeUint32(uint32(m.Route.Prefix.Address.Af))
2790         buf.EncodeBytes(m.Route.Prefix.Address.Un.XXX_UnionData[:], 16)
2791         buf.EncodeUint8(m.Route.Prefix.Len)
2792         buf.EncodeUint8(uint8(len(m.Route.Paths)))
2793         for j1 := 0; j1 < len(m.Route.Paths); j1++ {
2794                 var v1 FibPath // Paths
2795                 if j1 < len(m.Route.Paths) {
2796                         v1 = m.Route.Paths[j1]
2797                 }
2798                 buf.EncodeUint32(v1.SwIfIndex)
2799                 buf.EncodeUint32(v1.TableID)
2800                 buf.EncodeUint32(v1.RpfID)
2801                 buf.EncodeUint8(v1.Weight)
2802                 buf.EncodeUint8(v1.Preference)
2803                 buf.EncodeUint32(uint32(v1.Type))
2804                 buf.EncodeUint32(uint32(v1.Flags))
2805                 buf.EncodeUint32(uint32(v1.Proto))
2806                 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16)
2807                 buf.EncodeUint32(v1.Nh.ViaLabel)
2808                 buf.EncodeUint32(v1.Nh.ObjID)
2809                 buf.EncodeUint32(v1.Nh.ClassifyTableIndex)
2810                 buf.EncodeUint8(v1.NLabels)
2811                 for j2 := 0; j2 < 16; j2++ {
2812                         buf.EncodeUint8(v1.LabelStack[j2].IsUniform)
2813                         buf.EncodeUint32(v1.LabelStack[j2].Label)
2814                         buf.EncodeUint8(v1.LabelStack[j2].TTL)
2815                         buf.EncodeUint8(v1.LabelStack[j2].Exp)
2816                 }
2817         }
2818         return buf.Bytes(), nil
2819 }
2820 func (m *IPRouteDetails) Unmarshal(b []byte) error {
2821         buf := codec.NewBuffer(b)
2822         m.Route.TableID = buf.DecodeUint32()
2823         m.Route.StatsIndex = buf.DecodeUint32()
2824         m.Route.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
2825         copy(m.Route.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
2826         m.Route.Prefix.Len = buf.DecodeUint8()
2827         m.Route.NPaths = buf.DecodeUint8()
2828         m.Route.Paths = make([]FibPath, m.Route.NPaths)
2829         for j1 := 0; j1 < len(m.Route.Paths); j1++ {
2830                 m.Route.Paths[j1].SwIfIndex = buf.DecodeUint32()
2831                 m.Route.Paths[j1].TableID = buf.DecodeUint32()
2832                 m.Route.Paths[j1].RpfID = buf.DecodeUint32()
2833                 m.Route.Paths[j1].Weight = buf.DecodeUint8()
2834                 m.Route.Paths[j1].Preference = buf.DecodeUint8()
2835                 m.Route.Paths[j1].Type = FibPathType(buf.DecodeUint32())
2836                 m.Route.Paths[j1].Flags = FibPathFlags(buf.DecodeUint32())
2837                 m.Route.Paths[j1].Proto = FibPathNhProto(buf.DecodeUint32())
2838                 copy(m.Route.Paths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
2839                 m.Route.Paths[j1].Nh.ViaLabel = buf.DecodeUint32()
2840                 m.Route.Paths[j1].Nh.ObjID = buf.DecodeUint32()
2841                 m.Route.Paths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
2842                 m.Route.Paths[j1].NLabels = buf.DecodeUint8()
2843                 for j2 := 0; j2 < 16; j2++ {
2844                         m.Route.Paths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
2845                         m.Route.Paths[j1].LabelStack[j2].Label = buf.DecodeUint32()
2846                         m.Route.Paths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
2847                         m.Route.Paths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
2848                 }
2849         }
2850         return nil
2851 }
2852
2853 // IPRouteDump defines message 'ip_route_dump'.
2854 type IPRouteDump struct {
2855         Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
2856 }
2857
2858 func (m *IPRouteDump) Reset()               { *m = IPRouteDump{} }
2859 func (*IPRouteDump) GetMessageName() string { return "ip_route_dump" }
2860 func (*IPRouteDump) GetCrcString() string   { return "b9d2e09e" }
2861 func (*IPRouteDump) GetMessageType() api.MessageType {
2862         return api.RequestMessage
2863 }
2864
2865 func (m *IPRouteDump) Size() (size int) {
2866         if m == nil {
2867                 return 0
2868         }
2869         size += 4  // m.Table.TableID
2870         size += 1  // m.Table.IsIP6
2871         size += 64 // m.Table.Name
2872         return size
2873 }
2874 func (m *IPRouteDump) Marshal(b []byte) ([]byte, error) {
2875         if b == nil {
2876                 b = make([]byte, m.Size())
2877         }
2878         buf := codec.NewBuffer(b)
2879         buf.EncodeUint32(m.Table.TableID)
2880         buf.EncodeBool(m.Table.IsIP6)
2881         buf.EncodeString(m.Table.Name, 64)
2882         return buf.Bytes(), nil
2883 }
2884 func (m *IPRouteDump) Unmarshal(b []byte) error {
2885         buf := codec.NewBuffer(b)
2886         m.Table.TableID = buf.DecodeUint32()
2887         m.Table.IsIP6 = buf.DecodeBool()
2888         m.Table.Name = buf.DecodeString(64)
2889         return nil
2890 }
2891
2892 // IPSourceAndPortRangeCheckAddDel defines message 'ip_source_and_port_range_check_add_del'.
2893 type IPSourceAndPortRangeCheckAddDel struct {
2894         IsAdd          bool     `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
2895         Prefix         Prefix   `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
2896         NumberOfRanges uint8    `binapi:"u8,name=number_of_ranges" json:"number_of_ranges,omitempty"`
2897         LowPorts       []uint16 `binapi:"u16[32],name=low_ports" json:"low_ports,omitempty"`
2898         HighPorts      []uint16 `binapi:"u16[32],name=high_ports" json:"high_ports,omitempty"`
2899         VrfID          uint32   `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
2900 }
2901
2902 func (m *IPSourceAndPortRangeCheckAddDel) Reset() { *m = IPSourceAndPortRangeCheckAddDel{} }
2903 func (*IPSourceAndPortRangeCheckAddDel) GetMessageName() string {
2904         return "ip_source_and_port_range_check_add_del"
2905 }
2906 func (*IPSourceAndPortRangeCheckAddDel) GetCrcString() string { return "8bfc76f2" }
2907 func (*IPSourceAndPortRangeCheckAddDel) GetMessageType() api.MessageType {
2908         return api.RequestMessage
2909 }
2910
2911 func (m *IPSourceAndPortRangeCheckAddDel) Size() (size int) {
2912         if m == nil {
2913                 return 0
2914         }
2915         size += 1      // m.IsAdd
2916         size += 4      // m.Prefix.Address.Af
2917         size += 1 * 16 // m.Prefix.Address.Un
2918         size += 1      // m.Prefix.Len
2919         size += 1      // m.NumberOfRanges
2920         size += 2 * 32 // m.LowPorts
2921         size += 2 * 32 // m.HighPorts
2922         size += 4      // m.VrfID
2923         return size
2924 }
2925 func (m *IPSourceAndPortRangeCheckAddDel) Marshal(b []byte) ([]byte, error) {
2926         if b == nil {
2927                 b = make([]byte, m.Size())
2928         }
2929         buf := codec.NewBuffer(b)
2930         buf.EncodeBool(m.IsAdd)
2931         buf.EncodeUint32(uint32(m.Prefix.Address.Af))
2932         buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16)
2933         buf.EncodeUint8(m.Prefix.Len)
2934         buf.EncodeUint8(m.NumberOfRanges)
2935         for i := 0; i < 32; i++ {
2936                 var x uint16
2937                 if i < len(m.LowPorts) {
2938                         x = uint16(m.LowPorts[i])
2939                 }
2940                 buf.EncodeUint16(x)
2941         }
2942         for i := 0; i < 32; i++ {
2943                 var x uint16
2944                 if i < len(m.HighPorts) {
2945                         x = uint16(m.HighPorts[i])
2946                 }
2947                 buf.EncodeUint16(x)
2948         }
2949         buf.EncodeUint32(m.VrfID)
2950         return buf.Bytes(), nil
2951 }
2952 func (m *IPSourceAndPortRangeCheckAddDel) Unmarshal(b []byte) error {
2953         buf := codec.NewBuffer(b)
2954         m.IsAdd = buf.DecodeBool()
2955         m.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
2956         copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
2957         m.Prefix.Len = buf.DecodeUint8()
2958         m.NumberOfRanges = buf.DecodeUint8()
2959         m.LowPorts = make([]uint16, 32)
2960         for i := 0; i < len(m.LowPorts); i++ {
2961                 m.LowPorts[i] = buf.DecodeUint16()
2962         }
2963         m.HighPorts = make([]uint16, 32)
2964         for i := 0; i < len(m.HighPorts); i++ {
2965                 m.HighPorts[i] = buf.DecodeUint16()
2966         }
2967         m.VrfID = buf.DecodeUint32()
2968         return nil
2969 }
2970
2971 // IPSourceAndPortRangeCheckAddDelReply defines message 'ip_source_and_port_range_check_add_del_reply'.
2972 type IPSourceAndPortRangeCheckAddDelReply struct {
2973         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2974 }
2975
2976 func (m *IPSourceAndPortRangeCheckAddDelReply) Reset() { *m = IPSourceAndPortRangeCheckAddDelReply{} }
2977 func (*IPSourceAndPortRangeCheckAddDelReply) GetMessageName() string {
2978         return "ip_source_and_port_range_check_add_del_reply"
2979 }
2980 func (*IPSourceAndPortRangeCheckAddDelReply) GetCrcString() string { return "e8d4e804" }
2981 func (*IPSourceAndPortRangeCheckAddDelReply) GetMessageType() api.MessageType {
2982         return api.ReplyMessage
2983 }
2984
2985 func (m *IPSourceAndPortRangeCheckAddDelReply) Size() (size int) {
2986         if m == nil {
2987                 return 0
2988         }
2989         size += 4 // m.Retval
2990         return size
2991 }
2992 func (m *IPSourceAndPortRangeCheckAddDelReply) Marshal(b []byte) ([]byte, error) {
2993         if b == nil {
2994                 b = make([]byte, m.Size())
2995         }
2996         buf := codec.NewBuffer(b)
2997         buf.EncodeInt32(m.Retval)
2998         return buf.Bytes(), nil
2999 }
3000 func (m *IPSourceAndPortRangeCheckAddDelReply) Unmarshal(b []byte) error {
3001         buf := codec.NewBuffer(b)
3002         m.Retval = buf.DecodeInt32()
3003         return nil
3004 }
3005
3006 // IPSourceAndPortRangeCheckInterfaceAddDel defines message 'ip_source_and_port_range_check_interface_add_del'.
3007 type IPSourceAndPortRangeCheckInterfaceAddDel struct {
3008         IsAdd       bool           `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
3009         SwIfIndex   InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
3010         TCPInVrfID  uint32         `binapi:"u32,name=tcp_in_vrf_id" json:"tcp_in_vrf_id,omitempty"`
3011         TCPOutVrfID uint32         `binapi:"u32,name=tcp_out_vrf_id" json:"tcp_out_vrf_id,omitempty"`
3012         UDPInVrfID  uint32         `binapi:"u32,name=udp_in_vrf_id" json:"udp_in_vrf_id,omitempty"`
3013         UDPOutVrfID uint32         `binapi:"u32,name=udp_out_vrf_id" json:"udp_out_vrf_id,omitempty"`
3014 }
3015
3016 func (m *IPSourceAndPortRangeCheckInterfaceAddDel) Reset() {
3017         *m = IPSourceAndPortRangeCheckInterfaceAddDel{}
3018 }
3019 func (*IPSourceAndPortRangeCheckInterfaceAddDel) GetMessageName() string {
3020         return "ip_source_and_port_range_check_interface_add_del"
3021 }
3022 func (*IPSourceAndPortRangeCheckInterfaceAddDel) GetCrcString() string { return "e1ba8987" }
3023 func (*IPSourceAndPortRangeCheckInterfaceAddDel) GetMessageType() api.MessageType {
3024         return api.RequestMessage
3025 }
3026
3027 func (m *IPSourceAndPortRangeCheckInterfaceAddDel) Size() (size int) {
3028         if m == nil {
3029                 return 0
3030         }
3031         size += 1 // m.IsAdd
3032         size += 4 // m.SwIfIndex
3033         size += 4 // m.TCPInVrfID
3034         size += 4 // m.TCPOutVrfID
3035         size += 4 // m.UDPInVrfID
3036         size += 4 // m.UDPOutVrfID
3037         return size
3038 }
3039 func (m *IPSourceAndPortRangeCheckInterfaceAddDel) Marshal(b []byte) ([]byte, error) {
3040         if b == nil {
3041                 b = make([]byte, m.Size())
3042         }
3043         buf := codec.NewBuffer(b)
3044         buf.EncodeBool(m.IsAdd)
3045         buf.EncodeUint32(uint32(m.SwIfIndex))
3046         buf.EncodeUint32(m.TCPInVrfID)
3047         buf.EncodeUint32(m.TCPOutVrfID)
3048         buf.EncodeUint32(m.UDPInVrfID)
3049         buf.EncodeUint32(m.UDPOutVrfID)
3050         return buf.Bytes(), nil
3051 }
3052 func (m *IPSourceAndPortRangeCheckInterfaceAddDel) Unmarshal(b []byte) error {
3053         buf := codec.NewBuffer(b)
3054         m.IsAdd = buf.DecodeBool()
3055         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
3056         m.TCPInVrfID = buf.DecodeUint32()
3057         m.TCPOutVrfID = buf.DecodeUint32()
3058         m.UDPInVrfID = buf.DecodeUint32()
3059         m.UDPOutVrfID = buf.DecodeUint32()
3060         return nil
3061 }
3062
3063 // IPSourceAndPortRangeCheckInterfaceAddDelReply defines message 'ip_source_and_port_range_check_interface_add_del_reply'.
3064 type IPSourceAndPortRangeCheckInterfaceAddDelReply struct {
3065         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
3066 }
3067
3068 func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) Reset() {
3069         *m = IPSourceAndPortRangeCheckInterfaceAddDelReply{}
3070 }
3071 func (*IPSourceAndPortRangeCheckInterfaceAddDelReply) GetMessageName() string {
3072         return "ip_source_and_port_range_check_interface_add_del_reply"
3073 }
3074 func (*IPSourceAndPortRangeCheckInterfaceAddDelReply) GetCrcString() string { return "e8d4e804" }
3075 func (*IPSourceAndPortRangeCheckInterfaceAddDelReply) GetMessageType() api.MessageType {
3076         return api.ReplyMessage
3077 }
3078
3079 func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) Size() (size int) {
3080         if m == nil {
3081                 return 0
3082         }
3083         size += 4 // m.Retval
3084         return size
3085 }
3086 func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) Marshal(b []byte) ([]byte, error) {
3087         if b == nil {
3088                 b = make([]byte, m.Size())
3089         }
3090         buf := codec.NewBuffer(b)
3091         buf.EncodeInt32(m.Retval)
3092         return buf.Bytes(), nil
3093 }
3094 func (m *IPSourceAndPortRangeCheckInterfaceAddDelReply) Unmarshal(b []byte) error {
3095         buf := codec.NewBuffer(b)
3096         m.Retval = buf.DecodeInt32()
3097         return nil
3098 }
3099
3100 // IPSourceCheckInterfaceAddDel defines message 'ip_source_check_interface_add_del'.
3101 type IPSourceCheckInterfaceAddDel struct {
3102         IsAdd     bool           `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
3103         Loose     bool           `binapi:"bool,name=loose" json:"loose,omitempty"`
3104         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
3105 }
3106
3107 func (m *IPSourceCheckInterfaceAddDel) Reset() { *m = IPSourceCheckInterfaceAddDel{} }
3108 func (*IPSourceCheckInterfaceAddDel) GetMessageName() string {
3109         return "ip_source_check_interface_add_del"
3110 }
3111 func (*IPSourceCheckInterfaceAddDel) GetCrcString() string { return "6612356b" }
3112 func (*IPSourceCheckInterfaceAddDel) GetMessageType() api.MessageType {
3113         return api.RequestMessage
3114 }
3115
3116 func (m *IPSourceCheckInterfaceAddDel) Size() (size int) {
3117         if m == nil {
3118                 return 0
3119         }
3120         size += 1 // m.IsAdd
3121         size += 1 // m.Loose
3122         size += 4 // m.SwIfIndex
3123         return size
3124 }
3125 func (m *IPSourceCheckInterfaceAddDel) Marshal(b []byte) ([]byte, error) {
3126         if b == nil {
3127                 b = make([]byte, m.Size())
3128         }
3129         buf := codec.NewBuffer(b)
3130         buf.EncodeBool(m.IsAdd)
3131         buf.EncodeBool(m.Loose)
3132         buf.EncodeUint32(uint32(m.SwIfIndex))
3133         return buf.Bytes(), nil
3134 }
3135 func (m *IPSourceCheckInterfaceAddDel) Unmarshal(b []byte) error {
3136         buf := codec.NewBuffer(b)
3137         m.IsAdd = buf.DecodeBool()
3138         m.Loose = buf.DecodeBool()
3139         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
3140         return nil
3141 }
3142
3143 // IPSourceCheckInterfaceAddDelReply defines message 'ip_source_check_interface_add_del_reply'.
3144 type IPSourceCheckInterfaceAddDelReply struct {
3145         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
3146 }
3147
3148 func (m *IPSourceCheckInterfaceAddDelReply) Reset() { *m = IPSourceCheckInterfaceAddDelReply{} }
3149 func (*IPSourceCheckInterfaceAddDelReply) GetMessageName() string {
3150         return "ip_source_check_interface_add_del_reply"
3151 }
3152 func (*IPSourceCheckInterfaceAddDelReply) GetCrcString() string { return "e8d4e804" }
3153 func (*IPSourceCheckInterfaceAddDelReply) GetMessageType() api.MessageType {
3154         return api.ReplyMessage
3155 }
3156
3157 func (m *IPSourceCheckInterfaceAddDelReply) Size() (size int) {
3158         if m == nil {
3159                 return 0
3160         }
3161         size += 4 // m.Retval
3162         return size
3163 }
3164 func (m *IPSourceCheckInterfaceAddDelReply) Marshal(b []byte) ([]byte, error) {
3165         if b == nil {
3166                 b = make([]byte, m.Size())
3167         }
3168         buf := codec.NewBuffer(b)
3169         buf.EncodeInt32(m.Retval)
3170         return buf.Bytes(), nil
3171 }
3172 func (m *IPSourceCheckInterfaceAddDelReply) Unmarshal(b []byte) error {
3173         buf := codec.NewBuffer(b)
3174         m.Retval = buf.DecodeInt32()
3175         return nil
3176 }
3177
3178 // IPTableAddDel defines message 'ip_table_add_del'.
3179 type IPTableAddDel struct {
3180         IsAdd bool    `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
3181         Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
3182 }
3183
3184 func (m *IPTableAddDel) Reset()               { *m = IPTableAddDel{} }
3185 func (*IPTableAddDel) GetMessageName() string { return "ip_table_add_del" }
3186 func (*IPTableAddDel) GetCrcString() string   { return "0ffdaec0" }
3187 func (*IPTableAddDel) GetMessageType() api.MessageType {
3188         return api.RequestMessage
3189 }
3190
3191 func (m *IPTableAddDel) Size() (size int) {
3192         if m == nil {
3193                 return 0
3194         }
3195         size += 1  // m.IsAdd
3196         size += 4  // m.Table.TableID
3197         size += 1  // m.Table.IsIP6
3198         size += 64 // m.Table.Name
3199         return size
3200 }
3201 func (m *IPTableAddDel) Marshal(b []byte) ([]byte, error) {
3202         if b == nil {
3203                 b = make([]byte, m.Size())
3204         }
3205         buf := codec.NewBuffer(b)
3206         buf.EncodeBool(m.IsAdd)
3207         buf.EncodeUint32(m.Table.TableID)
3208         buf.EncodeBool(m.Table.IsIP6)
3209         buf.EncodeString(m.Table.Name, 64)
3210         return buf.Bytes(), nil
3211 }
3212 func (m *IPTableAddDel) Unmarshal(b []byte) error {
3213         buf := codec.NewBuffer(b)
3214         m.IsAdd = buf.DecodeBool()
3215         m.Table.TableID = buf.DecodeUint32()
3216         m.Table.IsIP6 = buf.DecodeBool()
3217         m.Table.Name = buf.DecodeString(64)
3218         return nil
3219 }
3220
3221 // IPTableAddDelReply defines message 'ip_table_add_del_reply'.
3222 type IPTableAddDelReply struct {
3223         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
3224 }
3225
3226 func (m *IPTableAddDelReply) Reset()               { *m = IPTableAddDelReply{} }
3227 func (*IPTableAddDelReply) GetMessageName() string { return "ip_table_add_del_reply" }
3228 func (*IPTableAddDelReply) GetCrcString() string   { return "e8d4e804" }
3229 func (*IPTableAddDelReply) GetMessageType() api.MessageType {
3230         return api.ReplyMessage
3231 }
3232
3233 func (m *IPTableAddDelReply) Size() (size int) {
3234         if m == nil {
3235                 return 0
3236         }
3237         size += 4 // m.Retval
3238         return size
3239 }
3240 func (m *IPTableAddDelReply) Marshal(b []byte) ([]byte, error) {
3241         if b == nil {
3242                 b = make([]byte, m.Size())
3243         }
3244         buf := codec.NewBuffer(b)
3245         buf.EncodeInt32(m.Retval)
3246         return buf.Bytes(), nil
3247 }
3248 func (m *IPTableAddDelReply) Unmarshal(b []byte) error {
3249         buf := codec.NewBuffer(b)
3250         m.Retval = buf.DecodeInt32()
3251         return nil
3252 }
3253
3254 // IPTableDetails defines message 'ip_table_details'.
3255 type IPTableDetails struct {
3256         Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
3257 }
3258
3259 func (m *IPTableDetails) Reset()               { *m = IPTableDetails{} }
3260 func (*IPTableDetails) GetMessageName() string { return "ip_table_details" }
3261 func (*IPTableDetails) GetCrcString() string   { return "c79fca0f" }
3262 func (*IPTableDetails) GetMessageType() api.MessageType {
3263         return api.ReplyMessage
3264 }
3265
3266 func (m *IPTableDetails) Size() (size int) {
3267         if m == nil {
3268                 return 0
3269         }
3270         size += 4  // m.Table.TableID
3271         size += 1  // m.Table.IsIP6
3272         size += 64 // m.Table.Name
3273         return size
3274 }
3275 func (m *IPTableDetails) Marshal(b []byte) ([]byte, error) {
3276         if b == nil {
3277                 b = make([]byte, m.Size())
3278         }
3279         buf := codec.NewBuffer(b)
3280         buf.EncodeUint32(m.Table.TableID)
3281         buf.EncodeBool(m.Table.IsIP6)
3282         buf.EncodeString(m.Table.Name, 64)
3283         return buf.Bytes(), nil
3284 }
3285 func (m *IPTableDetails) Unmarshal(b []byte) error {
3286         buf := codec.NewBuffer(b)
3287         m.Table.TableID = buf.DecodeUint32()
3288         m.Table.IsIP6 = buf.DecodeBool()
3289         m.Table.Name = buf.DecodeString(64)
3290         return nil
3291 }
3292
3293 // IPTableDump defines message 'ip_table_dump'.
3294 type IPTableDump struct{}
3295
3296 func (m *IPTableDump) Reset()               { *m = IPTableDump{} }
3297 func (*IPTableDump) GetMessageName() string { return "ip_table_dump" }
3298 func (*IPTableDump) GetCrcString() string   { return "51077d14" }
3299 func (*IPTableDump) GetMessageType() api.MessageType {
3300         return api.RequestMessage
3301 }
3302
3303 func (m *IPTableDump) Size() (size int) {
3304         if m == nil {
3305                 return 0
3306         }
3307         return size
3308 }
3309 func (m *IPTableDump) Marshal(b []byte) ([]byte, error) {
3310         if b == nil {
3311                 b = make([]byte, m.Size())
3312         }
3313         buf := codec.NewBuffer(b)
3314         return buf.Bytes(), nil
3315 }
3316 func (m *IPTableDump) Unmarshal(b []byte) error {
3317         return nil
3318 }
3319
3320 // IPTableFlush defines message 'ip_table_flush'.
3321 type IPTableFlush struct {
3322         Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
3323 }
3324
3325 func (m *IPTableFlush) Reset()               { *m = IPTableFlush{} }
3326 func (*IPTableFlush) GetMessageName() string { return "ip_table_flush" }
3327 func (*IPTableFlush) GetCrcString() string   { return "b9d2e09e" }
3328 func (*IPTableFlush) GetMessageType() api.MessageType {
3329         return api.RequestMessage
3330 }
3331
3332 func (m *IPTableFlush) Size() (size int) {
3333         if m == nil {
3334                 return 0
3335         }
3336         size += 4  // m.Table.TableID
3337         size += 1  // m.Table.IsIP6
3338         size += 64 // m.Table.Name
3339         return size
3340 }
3341 func (m *IPTableFlush) Marshal(b []byte) ([]byte, error) {
3342         if b == nil {
3343                 b = make([]byte, m.Size())
3344         }
3345         buf := codec.NewBuffer(b)
3346         buf.EncodeUint32(m.Table.TableID)
3347         buf.EncodeBool(m.Table.IsIP6)
3348         buf.EncodeString(m.Table.Name, 64)
3349         return buf.Bytes(), nil
3350 }
3351 func (m *IPTableFlush) Unmarshal(b []byte) error {
3352         buf := codec.NewBuffer(b)
3353         m.Table.TableID = buf.DecodeUint32()
3354         m.Table.IsIP6 = buf.DecodeBool()
3355         m.Table.Name = buf.DecodeString(64)
3356         return nil
3357 }
3358
3359 // IPTableFlushReply defines message 'ip_table_flush_reply'.
3360 type IPTableFlushReply struct {
3361         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
3362 }
3363
3364 func (m *IPTableFlushReply) Reset()               { *m = IPTableFlushReply{} }
3365 func (*IPTableFlushReply) GetMessageName() string { return "ip_table_flush_reply" }
3366 func (*IPTableFlushReply) GetCrcString() string   { return "e8d4e804" }
3367 func (*IPTableFlushReply) GetMessageType() api.MessageType {
3368         return api.ReplyMessage
3369 }
3370
3371 func (m *IPTableFlushReply) Size() (size int) {
3372         if m == nil {
3373                 return 0
3374         }
3375         size += 4 // m.Retval
3376         return size
3377 }
3378 func (m *IPTableFlushReply) Marshal(b []byte) ([]byte, error) {
3379         if b == nil {
3380                 b = make([]byte, m.Size())
3381         }
3382         buf := codec.NewBuffer(b)
3383         buf.EncodeInt32(m.Retval)
3384         return buf.Bytes(), nil
3385 }
3386 func (m *IPTableFlushReply) Unmarshal(b []byte) error {
3387         buf := codec.NewBuffer(b)
3388         m.Retval = buf.DecodeInt32()
3389         return nil
3390 }
3391
3392 // IPTableReplaceBegin defines message 'ip_table_replace_begin'.
3393 type IPTableReplaceBegin struct {
3394         Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
3395 }
3396
3397 func (m *IPTableReplaceBegin) Reset()               { *m = IPTableReplaceBegin{} }
3398 func (*IPTableReplaceBegin) GetMessageName() string { return "ip_table_replace_begin" }
3399 func (*IPTableReplaceBegin) GetCrcString() string   { return "b9d2e09e" }
3400 func (*IPTableReplaceBegin) GetMessageType() api.MessageType {
3401         return api.RequestMessage
3402 }
3403
3404 func (m *IPTableReplaceBegin) Size() (size int) {
3405         if m == nil {
3406                 return 0
3407         }
3408         size += 4  // m.Table.TableID
3409         size += 1  // m.Table.IsIP6
3410         size += 64 // m.Table.Name
3411         return size
3412 }
3413 func (m *IPTableReplaceBegin) Marshal(b []byte) ([]byte, error) {
3414         if b == nil {
3415                 b = make([]byte, m.Size())
3416         }
3417         buf := codec.NewBuffer(b)
3418         buf.EncodeUint32(m.Table.TableID)
3419         buf.EncodeBool(m.Table.IsIP6)
3420         buf.EncodeString(m.Table.Name, 64)
3421         return buf.Bytes(), nil
3422 }
3423 func (m *IPTableReplaceBegin) Unmarshal(b []byte) error {
3424         buf := codec.NewBuffer(b)
3425         m.Table.TableID = buf.DecodeUint32()
3426         m.Table.IsIP6 = buf.DecodeBool()
3427         m.Table.Name = buf.DecodeString(64)
3428         return nil
3429 }
3430
3431 // IPTableReplaceBeginReply defines message 'ip_table_replace_begin_reply'.
3432 type IPTableReplaceBeginReply struct {
3433         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
3434 }
3435
3436 func (m *IPTableReplaceBeginReply) Reset()               { *m = IPTableReplaceBeginReply{} }
3437 func (*IPTableReplaceBeginReply) GetMessageName() string { return "ip_table_replace_begin_reply" }
3438 func (*IPTableReplaceBeginReply) GetCrcString() string   { return "e8d4e804" }
3439 func (*IPTableReplaceBeginReply) GetMessageType() api.MessageType {
3440         return api.ReplyMessage
3441 }
3442
3443 func (m *IPTableReplaceBeginReply) Size() (size int) {
3444         if m == nil {
3445                 return 0
3446         }
3447         size += 4 // m.Retval
3448         return size
3449 }
3450 func (m *IPTableReplaceBeginReply) Marshal(b []byte) ([]byte, error) {
3451         if b == nil {
3452                 b = make([]byte, m.Size())
3453         }
3454         buf := codec.NewBuffer(b)
3455         buf.EncodeInt32(m.Retval)
3456         return buf.Bytes(), nil
3457 }
3458 func (m *IPTableReplaceBeginReply) Unmarshal(b []byte) error {
3459         buf := codec.NewBuffer(b)
3460         m.Retval = buf.DecodeInt32()
3461         return nil
3462 }
3463
3464 // IPTableReplaceEnd defines message 'ip_table_replace_end'.
3465 type IPTableReplaceEnd struct {
3466         Table IPTable `binapi:"ip_table,name=table" json:"table,omitempty"`
3467 }
3468
3469 func (m *IPTableReplaceEnd) Reset()               { *m = IPTableReplaceEnd{} }
3470 func (*IPTableReplaceEnd) GetMessageName() string { return "ip_table_replace_end" }
3471 func (*IPTableReplaceEnd) GetCrcString() string   { return "b9d2e09e" }
3472 func (*IPTableReplaceEnd) GetMessageType() api.MessageType {
3473         return api.RequestMessage
3474 }
3475
3476 func (m *IPTableReplaceEnd) Size() (size int) {
3477         if m == nil {
3478                 return 0
3479         }
3480         size += 4  // m.Table.TableID
3481         size += 1  // m.Table.IsIP6
3482         size += 64 // m.Table.Name
3483         return size
3484 }
3485 func (m *IPTableReplaceEnd) Marshal(b []byte) ([]byte, error) {
3486         if b == nil {
3487                 b = make([]byte, m.Size())
3488         }
3489         buf := codec.NewBuffer(b)
3490         buf.EncodeUint32(m.Table.TableID)
3491         buf.EncodeBool(m.Table.IsIP6)
3492         buf.EncodeString(m.Table.Name, 64)
3493         return buf.Bytes(), nil
3494 }
3495 func (m *IPTableReplaceEnd) Unmarshal(b []byte) error {
3496         buf := codec.NewBuffer(b)
3497         m.Table.TableID = buf.DecodeUint32()
3498         m.Table.IsIP6 = buf.DecodeBool()
3499         m.Table.Name = buf.DecodeString(64)
3500         return nil
3501 }
3502
3503 // IPTableReplaceEndReply defines message 'ip_table_replace_end_reply'.
3504 type IPTableReplaceEndReply struct {
3505         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
3506 }
3507
3508 func (m *IPTableReplaceEndReply) Reset()               { *m = IPTableReplaceEndReply{} }
3509 func (*IPTableReplaceEndReply) GetMessageName() string { return "ip_table_replace_end_reply" }
3510 func (*IPTableReplaceEndReply) GetCrcString() string   { return "e8d4e804" }
3511 func (*IPTableReplaceEndReply) GetMessageType() api.MessageType {
3512         return api.ReplyMessage
3513 }
3514
3515 func (m *IPTableReplaceEndReply) Size() (size int) {
3516         if m == nil {
3517                 return 0
3518         }
3519         size += 4 // m.Retval
3520         return size
3521 }
3522 func (m *IPTableReplaceEndReply) Marshal(b []byte) ([]byte, error) {
3523         if b == nil {
3524                 b = make([]byte, m.Size())
3525         }
3526         buf := codec.NewBuffer(b)
3527         buf.EncodeInt32(m.Retval)
3528         return buf.Bytes(), nil
3529 }
3530 func (m *IPTableReplaceEndReply) Unmarshal(b []byte) error {
3531         buf := codec.NewBuffer(b)
3532         m.Retval = buf.DecodeInt32()
3533         return nil
3534 }
3535
3536 // IPUnnumberedDetails defines message 'ip_unnumbered_details'.
3537 type IPUnnumberedDetails struct {
3538         SwIfIndex   InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
3539         IPSwIfIndex InterfaceIndex `binapi:"interface_index,name=ip_sw_if_index" json:"ip_sw_if_index,omitempty"`
3540 }
3541
3542 func (m *IPUnnumberedDetails) Reset()               { *m = IPUnnumberedDetails{} }
3543 func (*IPUnnumberedDetails) GetMessageName() string { return "ip_unnumbered_details" }
3544 func (*IPUnnumberedDetails) GetCrcString() string   { return "aa12a483" }
3545 func (*IPUnnumberedDetails) GetMessageType() api.MessageType {
3546         return api.ReplyMessage
3547 }
3548
3549 func (m *IPUnnumberedDetails) Size() (size int) {
3550         if m == nil {
3551                 return 0
3552         }
3553         size += 4 // m.SwIfIndex
3554         size += 4 // m.IPSwIfIndex
3555         return size
3556 }
3557 func (m *IPUnnumberedDetails) Marshal(b []byte) ([]byte, error) {
3558         if b == nil {
3559                 b = make([]byte, m.Size())
3560         }
3561         buf := codec.NewBuffer(b)
3562         buf.EncodeUint32(uint32(m.SwIfIndex))
3563         buf.EncodeUint32(uint32(m.IPSwIfIndex))
3564         return buf.Bytes(), nil
3565 }
3566 func (m *IPUnnumberedDetails) Unmarshal(b []byte) error {
3567         buf := codec.NewBuffer(b)
3568         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
3569         m.IPSwIfIndex = InterfaceIndex(buf.DecodeUint32())
3570         return nil
3571 }
3572
3573 // IPUnnumberedDump defines message 'ip_unnumbered_dump'.
3574 type IPUnnumberedDump struct {
3575         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
3576 }
3577
3578 func (m *IPUnnumberedDump) Reset()               { *m = IPUnnumberedDump{} }
3579 func (*IPUnnumberedDump) GetMessageName() string { return "ip_unnumbered_dump" }
3580 func (*IPUnnumberedDump) GetCrcString() string   { return "f9e6675e" }
3581 func (*IPUnnumberedDump) GetMessageType() api.MessageType {
3582         return api.RequestMessage
3583 }
3584
3585 func (m *IPUnnumberedDump) Size() (size int) {
3586         if m == nil {
3587                 return 0
3588         }
3589         size += 4 // m.SwIfIndex
3590         return size
3591 }
3592 func (m *IPUnnumberedDump) Marshal(b []byte) ([]byte, error) {
3593         if b == nil {
3594                 b = make([]byte, m.Size())
3595         }
3596         buf := codec.NewBuffer(b)
3597         buf.EncodeUint32(uint32(m.SwIfIndex))
3598         return buf.Bytes(), nil
3599 }
3600 func (m *IPUnnumberedDump) Unmarshal(b []byte) error {
3601         buf := codec.NewBuffer(b)
3602         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
3603         return nil
3604 }
3605
3606 // MfibSignalDetails defines message 'mfib_signal_details'.
3607 type MfibSignalDetails struct {
3608         SwIfIndex    InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
3609         TableID      uint32         `binapi:"u32,name=table_id" json:"table_id,omitempty"`
3610         Prefix       Mprefix        `binapi:"mprefix,name=prefix" json:"prefix,omitempty"`
3611         IPPacketLen  uint16         `binapi:"u16,name=ip_packet_len" json:"ip_packet_len,omitempty"`
3612         IPPacketData []byte         `binapi:"u8[256],name=ip_packet_data" json:"ip_packet_data,omitempty"`
3613 }
3614
3615 func (m *MfibSignalDetails) Reset()               { *m = MfibSignalDetails{} }
3616 func (*MfibSignalDetails) GetMessageName() string { return "mfib_signal_details" }
3617 func (*MfibSignalDetails) GetCrcString() string   { return "64398a9a" }
3618 func (*MfibSignalDetails) GetMessageType() api.MessageType {
3619         return api.ReplyMessage
3620 }
3621
3622 func (m *MfibSignalDetails) Size() (size int) {
3623         if m == nil {
3624                 return 0
3625         }
3626         size += 4       // m.SwIfIndex
3627         size += 4       // m.TableID
3628         size += 4       // m.Prefix.Af
3629         size += 2       // m.Prefix.GrpAddressLength
3630         size += 1 * 16  // m.Prefix.GrpAddress
3631         size += 1 * 16  // m.Prefix.SrcAddress
3632         size += 2       // m.IPPacketLen
3633         size += 1 * 256 // m.IPPacketData
3634         return size
3635 }
3636 func (m *MfibSignalDetails) Marshal(b []byte) ([]byte, error) {
3637         if b == nil {
3638                 b = make([]byte, m.Size())
3639         }
3640         buf := codec.NewBuffer(b)
3641         buf.EncodeUint32(uint32(m.SwIfIndex))
3642         buf.EncodeUint32(m.TableID)
3643         buf.EncodeUint32(uint32(m.Prefix.Af))
3644         buf.EncodeUint16(m.Prefix.GrpAddressLength)
3645         buf.EncodeBytes(m.Prefix.GrpAddress.XXX_UnionData[:], 16)
3646         buf.EncodeBytes(m.Prefix.SrcAddress.XXX_UnionData[:], 16)
3647         buf.EncodeUint16(m.IPPacketLen)
3648         buf.EncodeBytes(m.IPPacketData, 256)
3649         return buf.Bytes(), nil
3650 }
3651 func (m *MfibSignalDetails) Unmarshal(b []byte) error {
3652         buf := codec.NewBuffer(b)
3653         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
3654         m.TableID = buf.DecodeUint32()
3655         m.Prefix.Af = AddressFamily(buf.DecodeUint32())
3656         m.Prefix.GrpAddressLength = buf.DecodeUint16()
3657         copy(m.Prefix.GrpAddress.XXX_UnionData[:], buf.DecodeBytes(16))
3658         copy(m.Prefix.SrcAddress.XXX_UnionData[:], buf.DecodeBytes(16))
3659         m.IPPacketLen = buf.DecodeUint16()
3660         m.IPPacketData = make([]byte, 256)
3661         copy(m.IPPacketData, buf.DecodeBytes(len(m.IPPacketData)))
3662         return nil
3663 }
3664
3665 // MfibSignalDump defines message 'mfib_signal_dump'.
3666 type MfibSignalDump struct{}
3667
3668 func (m *MfibSignalDump) Reset()               { *m = MfibSignalDump{} }
3669 func (*MfibSignalDump) GetMessageName() string { return "mfib_signal_dump" }
3670 func (*MfibSignalDump) GetCrcString() string   { return "51077d14" }
3671 func (*MfibSignalDump) GetMessageType() api.MessageType {
3672         return api.RequestMessage
3673 }
3674
3675 func (m *MfibSignalDump) Size() (size int) {
3676         if m == nil {
3677                 return 0
3678         }
3679         return size
3680 }
3681 func (m *MfibSignalDump) Marshal(b []byte) ([]byte, error) {
3682         if b == nil {
3683                 b = make([]byte, m.Size())
3684         }
3685         buf := codec.NewBuffer(b)
3686         return buf.Bytes(), nil
3687 }
3688 func (m *MfibSignalDump) Unmarshal(b []byte) error {
3689         return nil
3690 }
3691
3692 // SetIPFlowHash defines message 'set_ip_flow_hash'.
3693 type SetIPFlowHash struct {
3694         VrfID     uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
3695         IsIPv6    bool   `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
3696         Src       bool   `binapi:"bool,name=src" json:"src,omitempty"`
3697         Dst       bool   `binapi:"bool,name=dst" json:"dst,omitempty"`
3698         Sport     bool   `binapi:"bool,name=sport" json:"sport,omitempty"`
3699         Dport     bool   `binapi:"bool,name=dport" json:"dport,omitempty"`
3700         Proto     bool   `binapi:"bool,name=proto" json:"proto,omitempty"`
3701         Reverse   bool   `binapi:"bool,name=reverse" json:"reverse,omitempty"`
3702         Symmetric bool   `binapi:"bool,name=symmetric" json:"symmetric,omitempty"`
3703 }
3704
3705 func (m *SetIPFlowHash) Reset()               { *m = SetIPFlowHash{} }
3706 func (*SetIPFlowHash) GetMessageName() string { return "set_ip_flow_hash" }
3707 func (*SetIPFlowHash) GetCrcString() string   { return "084ee09e" }
3708 func (*SetIPFlowHash) GetMessageType() api.MessageType {
3709         return api.RequestMessage
3710 }
3711
3712 func (m *SetIPFlowHash) Size() (size int) {
3713         if m == nil {
3714                 return 0
3715         }
3716         size += 4 // m.VrfID
3717         size += 1 // m.IsIPv6
3718         size += 1 // m.Src
3719         size += 1 // m.Dst
3720         size += 1 // m.Sport
3721         size += 1 // m.Dport
3722         size += 1 // m.Proto
3723         size += 1 // m.Reverse
3724         size += 1 // m.Symmetric
3725         return size
3726 }
3727 func (m *SetIPFlowHash) Marshal(b []byte) ([]byte, error) {
3728         if b == nil {
3729                 b = make([]byte, m.Size())
3730         }
3731         buf := codec.NewBuffer(b)
3732         buf.EncodeUint32(m.VrfID)
3733         buf.EncodeBool(m.IsIPv6)
3734         buf.EncodeBool(m.Src)
3735         buf.EncodeBool(m.Dst)
3736         buf.EncodeBool(m.Sport)
3737         buf.EncodeBool(m.Dport)
3738         buf.EncodeBool(m.Proto)
3739         buf.EncodeBool(m.Reverse)
3740         buf.EncodeBool(m.Symmetric)
3741         return buf.Bytes(), nil
3742 }
3743 func (m *SetIPFlowHash) Unmarshal(b []byte) error {
3744         buf := codec.NewBuffer(b)
3745         m.VrfID = buf.DecodeUint32()
3746         m.IsIPv6 = buf.DecodeBool()
3747         m.Src = buf.DecodeBool()
3748         m.Dst = buf.DecodeBool()
3749         m.Sport = buf.DecodeBool()
3750         m.Dport = buf.DecodeBool()
3751         m.Proto = buf.DecodeBool()
3752         m.Reverse = buf.DecodeBool()
3753         m.Symmetric = buf.DecodeBool()
3754         return nil
3755 }
3756
3757 // SetIPFlowHashReply defines message 'set_ip_flow_hash_reply'.
3758 type SetIPFlowHashReply struct {
3759         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
3760 }
3761
3762 func (m *SetIPFlowHashReply) Reset()               { *m = SetIPFlowHashReply{} }
3763 func (*SetIPFlowHashReply) GetMessageName() string { return "set_ip_flow_hash_reply" }
3764 func (*SetIPFlowHashReply) GetCrcString() string   { return "e8d4e804" }
3765 func (*SetIPFlowHashReply) GetMessageType() api.MessageType {
3766         return api.ReplyMessage
3767 }
3768
3769 func (m *SetIPFlowHashReply) Size() (size int) {
3770         if m == nil {
3771                 return 0
3772         }
3773         size += 4 // m.Retval
3774         return size
3775 }
3776 func (m *SetIPFlowHashReply) Marshal(b []byte) ([]byte, error) {
3777         if b == nil {
3778                 b = make([]byte, m.Size())
3779         }
3780         buf := codec.NewBuffer(b)
3781         buf.EncodeInt32(m.Retval)
3782         return buf.Bytes(), nil
3783 }
3784 func (m *SetIPFlowHashReply) Unmarshal(b []byte) error {
3785         buf := codec.NewBuffer(b)
3786         m.Retval = buf.DecodeInt32()
3787         return nil
3788 }
3789
3790 // SwInterfaceIP6EnableDisable defines message 'sw_interface_ip6_enable_disable'.
3791 type SwInterfaceIP6EnableDisable struct {
3792         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
3793         Enable    bool           `binapi:"bool,name=enable" json:"enable,omitempty"`
3794 }
3795
3796 func (m *SwInterfaceIP6EnableDisable) Reset()               { *m = SwInterfaceIP6EnableDisable{} }
3797 func (*SwInterfaceIP6EnableDisable) GetMessageName() string { return "sw_interface_ip6_enable_disable" }
3798 func (*SwInterfaceIP6EnableDisable) GetCrcString() string   { return "ae6cfcfb" }
3799 func (*SwInterfaceIP6EnableDisable) GetMessageType() api.MessageType {
3800         return api.RequestMessage
3801 }
3802
3803 func (m *SwInterfaceIP6EnableDisable) Size() (size int) {
3804         if m == nil {
3805                 return 0
3806         }
3807         size += 4 // m.SwIfIndex
3808         size += 1 // m.Enable
3809         return size
3810 }
3811 func (m *SwInterfaceIP6EnableDisable) Marshal(b []byte) ([]byte, error) {
3812         if b == nil {
3813                 b = make([]byte, m.Size())
3814         }
3815         buf := codec.NewBuffer(b)
3816         buf.EncodeUint32(uint32(m.SwIfIndex))
3817         buf.EncodeBool(m.Enable)
3818         return buf.Bytes(), nil
3819 }
3820 func (m *SwInterfaceIP6EnableDisable) Unmarshal(b []byte) error {
3821         buf := codec.NewBuffer(b)
3822         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
3823         m.Enable = buf.DecodeBool()
3824         return nil
3825 }
3826
3827 // SwInterfaceIP6EnableDisableReply defines message 'sw_interface_ip6_enable_disable_reply'.
3828 type SwInterfaceIP6EnableDisableReply struct {
3829         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
3830 }
3831
3832 func (m *SwInterfaceIP6EnableDisableReply) Reset() { *m = SwInterfaceIP6EnableDisableReply{} }
3833 func (*SwInterfaceIP6EnableDisableReply) GetMessageName() string {
3834         return "sw_interface_ip6_enable_disable_reply"
3835 }
3836 func (*SwInterfaceIP6EnableDisableReply) GetCrcString() string { return "e8d4e804" }
3837 func (*SwInterfaceIP6EnableDisableReply) GetMessageType() api.MessageType {
3838         return api.ReplyMessage
3839 }
3840
3841 func (m *SwInterfaceIP6EnableDisableReply) Size() (size int) {
3842         if m == nil {
3843                 return 0
3844         }
3845         size += 4 // m.Retval
3846         return size
3847 }
3848 func (m *SwInterfaceIP6EnableDisableReply) Marshal(b []byte) ([]byte, error) {
3849         if b == nil {
3850                 b = make([]byte, m.Size())
3851         }
3852         buf := codec.NewBuffer(b)
3853         buf.EncodeInt32(m.Retval)
3854         return buf.Bytes(), nil
3855 }
3856 func (m *SwInterfaceIP6EnableDisableReply) Unmarshal(b []byte) error {
3857         buf := codec.NewBuffer(b)
3858         m.Retval = buf.DecodeInt32()
3859         return nil
3860 }
3861
3862 // SwInterfaceIP6SetLinkLocalAddress defines message 'sw_interface_ip6_set_link_local_address'.
3863 type SwInterfaceIP6SetLinkLocalAddress struct {
3864         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
3865         IP        IP6Address     `binapi:"ip6_address,name=ip" json:"ip,omitempty"`
3866 }
3867
3868 func (m *SwInterfaceIP6SetLinkLocalAddress) Reset() { *m = SwInterfaceIP6SetLinkLocalAddress{} }
3869 func (*SwInterfaceIP6SetLinkLocalAddress) GetMessageName() string {
3870         return "sw_interface_ip6_set_link_local_address"
3871 }
3872 func (*SwInterfaceIP6SetLinkLocalAddress) GetCrcString() string { return "2931d9fa" }
3873 func (*SwInterfaceIP6SetLinkLocalAddress) GetMessageType() api.MessageType {
3874         return api.RequestMessage
3875 }
3876
3877 func (m *SwInterfaceIP6SetLinkLocalAddress) Size() (size int) {
3878         if m == nil {
3879                 return 0
3880         }
3881         size += 4      // m.SwIfIndex
3882         size += 1 * 16 // m.IP
3883         return size
3884 }
3885 func (m *SwInterfaceIP6SetLinkLocalAddress) Marshal(b []byte) ([]byte, error) {
3886         if b == nil {
3887                 b = make([]byte, m.Size())
3888         }
3889         buf := codec.NewBuffer(b)
3890         buf.EncodeUint32(uint32(m.SwIfIndex))
3891         buf.EncodeBytes(m.IP[:], 16)
3892         return buf.Bytes(), nil
3893 }
3894 func (m *SwInterfaceIP6SetLinkLocalAddress) Unmarshal(b []byte) error {
3895         buf := codec.NewBuffer(b)
3896         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
3897         copy(m.IP[:], buf.DecodeBytes(16))
3898         return nil
3899 }
3900
3901 // SwInterfaceIP6SetLinkLocalAddressReply defines message 'sw_interface_ip6_set_link_local_address_reply'.
3902 type SwInterfaceIP6SetLinkLocalAddressReply struct {
3903         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
3904 }
3905
3906 func (m *SwInterfaceIP6SetLinkLocalAddressReply) Reset() {
3907         *m = SwInterfaceIP6SetLinkLocalAddressReply{}
3908 }
3909 func (*SwInterfaceIP6SetLinkLocalAddressReply) GetMessageName() string {
3910         return "sw_interface_ip6_set_link_local_address_reply"
3911 }
3912 func (*SwInterfaceIP6SetLinkLocalAddressReply) GetCrcString() string { return "e8d4e804" }
3913 func (*SwInterfaceIP6SetLinkLocalAddressReply) GetMessageType() api.MessageType {
3914         return api.ReplyMessage
3915 }
3916
3917 func (m *SwInterfaceIP6SetLinkLocalAddressReply) Size() (size int) {
3918         if m == nil {
3919                 return 0
3920         }
3921         size += 4 // m.Retval
3922         return size
3923 }
3924 func (m *SwInterfaceIP6SetLinkLocalAddressReply) Marshal(b []byte) ([]byte, error) {
3925         if b == nil {
3926                 b = make([]byte, m.Size())
3927         }
3928         buf := codec.NewBuffer(b)
3929         buf.EncodeInt32(m.Retval)
3930         return buf.Bytes(), nil
3931 }
3932 func (m *SwInterfaceIP6SetLinkLocalAddressReply) Unmarshal(b []byte) error {
3933         buf := codec.NewBuffer(b)
3934         m.Retval = buf.DecodeInt32()
3935         return nil
3936 }
3937
3938 func init() { file_ip_binapi_init() }
3939 func file_ip_binapi_init() {
3940         api.RegisterMessage((*IoamDisable)(nil), "ioam_disable_6b16a45e")
3941         api.RegisterMessage((*IoamDisableReply)(nil), "ioam_disable_reply_e8d4e804")
3942         api.RegisterMessage((*IoamEnable)(nil), "ioam_enable_51ccd868")
3943         api.RegisterMessage((*IoamEnableReply)(nil), "ioam_enable_reply_e8d4e804")
3944         api.RegisterMessage((*IPAddressDetails)(nil), "ip_address_details_b1199745")
3945         api.RegisterMessage((*IPAddressDump)(nil), "ip_address_dump_2d033de4")
3946         api.RegisterMessage((*IPContainerProxyAddDel)(nil), "ip_container_proxy_add_del_91189f40")
3947         api.RegisterMessage((*IPContainerProxyAddDelReply)(nil), "ip_container_proxy_add_del_reply_e8d4e804")
3948         api.RegisterMessage((*IPContainerProxyDetails)(nil), "ip_container_proxy_details_0ee460e8")
3949         api.RegisterMessage((*IPContainerProxyDump)(nil), "ip_container_proxy_dump_51077d14")
3950         api.RegisterMessage((*IPDetails)(nil), "ip_details_eb152d07")
3951         api.RegisterMessage((*IPDump)(nil), "ip_dump_98d231ca")
3952         api.RegisterMessage((*IPMrouteAddDel)(nil), "ip_mroute_add_del_f6627d17")
3953         api.RegisterMessage((*IPMrouteAddDelReply)(nil), "ip_mroute_add_del_reply_1992deab")
3954         api.RegisterMessage((*IPMrouteDetails)(nil), "ip_mroute_details_c1cb4b44")
3955         api.RegisterMessage((*IPMrouteDump)(nil), "ip_mroute_dump_b9d2e09e")
3956         api.RegisterMessage((*IPMtableDetails)(nil), "ip_mtable_details_b9d2e09e")
3957         api.RegisterMessage((*IPMtableDump)(nil), "ip_mtable_dump_51077d14")
3958         api.RegisterMessage((*IPPuntPolice)(nil), "ip_punt_police_db867cea")
3959         api.RegisterMessage((*IPPuntPoliceReply)(nil), "ip_punt_police_reply_e8d4e804")
3960         api.RegisterMessage((*IPPuntRedirect)(nil), "ip_punt_redirect_a9a5592c")
3961         api.RegisterMessage((*IPPuntRedirectDetails)(nil), "ip_punt_redirect_details_3924f5d3")
3962         api.RegisterMessage((*IPPuntRedirectDump)(nil), "ip_punt_redirect_dump_2d033de4")
3963         api.RegisterMessage((*IPPuntRedirectReply)(nil), "ip_punt_redirect_reply_e8d4e804")
3964         api.RegisterMessage((*IPReassemblyEnableDisable)(nil), "ip_reassembly_enable_disable_885c85a6")
3965         api.RegisterMessage((*IPReassemblyEnableDisableReply)(nil), "ip_reassembly_enable_disable_reply_e8d4e804")
3966         api.RegisterMessage((*IPReassemblyGet)(nil), "ip_reassembly_get_ea13ff63")
3967         api.RegisterMessage((*IPReassemblyGetReply)(nil), "ip_reassembly_get_reply_d5eb8d34")
3968         api.RegisterMessage((*IPReassemblySet)(nil), "ip_reassembly_set_16467d25")
3969         api.RegisterMessage((*IPReassemblySetReply)(nil), "ip_reassembly_set_reply_e8d4e804")
3970         api.RegisterMessage((*IPRouteAddDel)(nil), "ip_route_add_del_c1ff832d")
3971         api.RegisterMessage((*IPRouteAddDelReply)(nil), "ip_route_add_del_reply_1992deab")
3972         api.RegisterMessage((*IPRouteDetails)(nil), "ip_route_details_d1ffaae1")
3973         api.RegisterMessage((*IPRouteDump)(nil), "ip_route_dump_b9d2e09e")
3974         api.RegisterMessage((*IPSourceAndPortRangeCheckAddDel)(nil), "ip_source_and_port_range_check_add_del_8bfc76f2")
3975         api.RegisterMessage((*IPSourceAndPortRangeCheckAddDelReply)(nil), "ip_source_and_port_range_check_add_del_reply_e8d4e804")
3976         api.RegisterMessage((*IPSourceAndPortRangeCheckInterfaceAddDel)(nil), "ip_source_and_port_range_check_interface_add_del_e1ba8987")
3977         api.RegisterMessage((*IPSourceAndPortRangeCheckInterfaceAddDelReply)(nil), "ip_source_and_port_range_check_interface_add_del_reply_e8d4e804")
3978         api.RegisterMessage((*IPSourceCheckInterfaceAddDel)(nil), "ip_source_check_interface_add_del_6612356b")
3979         api.RegisterMessage((*IPSourceCheckInterfaceAddDelReply)(nil), "ip_source_check_interface_add_del_reply_e8d4e804")
3980         api.RegisterMessage((*IPTableAddDel)(nil), "ip_table_add_del_0ffdaec0")
3981         api.RegisterMessage((*IPTableAddDelReply)(nil), "ip_table_add_del_reply_e8d4e804")
3982         api.RegisterMessage((*IPTableDetails)(nil), "ip_table_details_c79fca0f")
3983         api.RegisterMessage((*IPTableDump)(nil), "ip_table_dump_51077d14")
3984         api.RegisterMessage((*IPTableFlush)(nil), "ip_table_flush_b9d2e09e")
3985         api.RegisterMessage((*IPTableFlushReply)(nil), "ip_table_flush_reply_e8d4e804")
3986         api.RegisterMessage((*IPTableReplaceBegin)(nil), "ip_table_replace_begin_b9d2e09e")
3987         api.RegisterMessage((*IPTableReplaceBeginReply)(nil), "ip_table_replace_begin_reply_e8d4e804")
3988         api.RegisterMessage((*IPTableReplaceEnd)(nil), "ip_table_replace_end_b9d2e09e")
3989         api.RegisterMessage((*IPTableReplaceEndReply)(nil), "ip_table_replace_end_reply_e8d4e804")
3990         api.RegisterMessage((*IPUnnumberedDetails)(nil), "ip_unnumbered_details_aa12a483")
3991         api.RegisterMessage((*IPUnnumberedDump)(nil), "ip_unnumbered_dump_f9e6675e")
3992         api.RegisterMessage((*MfibSignalDetails)(nil), "mfib_signal_details_64398a9a")
3993         api.RegisterMessage((*MfibSignalDump)(nil), "mfib_signal_dump_51077d14")
3994         api.RegisterMessage((*SetIPFlowHash)(nil), "set_ip_flow_hash_084ee09e")
3995         api.RegisterMessage((*SetIPFlowHashReply)(nil), "set_ip_flow_hash_reply_e8d4e804")
3996         api.RegisterMessage((*SwInterfaceIP6EnableDisable)(nil), "sw_interface_ip6_enable_disable_ae6cfcfb")
3997         api.RegisterMessage((*SwInterfaceIP6EnableDisableReply)(nil), "sw_interface_ip6_enable_disable_reply_e8d4e804")
3998         api.RegisterMessage((*SwInterfaceIP6SetLinkLocalAddress)(nil), "sw_interface_ip6_set_link_local_address_2931d9fa")
3999         api.RegisterMessage((*SwInterfaceIP6SetLinkLocalAddressReply)(nil), "sw_interface_ip6_set_link_local_address_reply_e8d4e804")
4000 }
4001
4002 // Messages returns list of all messages in this module.
4003 func AllMessages() []api.Message {
4004         return []api.Message{
4005                 (*IoamDisable)(nil),
4006                 (*IoamDisableReply)(nil),
4007                 (*IoamEnable)(nil),
4008                 (*IoamEnableReply)(nil),
4009                 (*IPAddressDetails)(nil),
4010                 (*IPAddressDump)(nil),
4011                 (*IPContainerProxyAddDel)(nil),
4012                 (*IPContainerProxyAddDelReply)(nil),
4013                 (*IPContainerProxyDetails)(nil),
4014                 (*IPContainerProxyDump)(nil),
4015                 (*IPDetails)(nil),
4016                 (*IPDump)(nil),
4017                 (*IPMrouteAddDel)(nil),
4018                 (*IPMrouteAddDelReply)(nil),
4019                 (*IPMrouteDetails)(nil),
4020                 (*IPMrouteDump)(nil),
4021                 (*IPMtableDetails)(nil),
4022                 (*IPMtableDump)(nil),
4023                 (*IPPuntPolice)(nil),
4024                 (*IPPuntPoliceReply)(nil),
4025                 (*IPPuntRedirect)(nil),
4026                 (*IPPuntRedirectDetails)(nil),
4027                 (*IPPuntRedirectDump)(nil),
4028                 (*IPPuntRedirectReply)(nil),
4029                 (*IPReassemblyEnableDisable)(nil),
4030                 (*IPReassemblyEnableDisableReply)(nil),
4031                 (*IPReassemblyGet)(nil),
4032                 (*IPReassemblyGetReply)(nil),
4033                 (*IPReassemblySet)(nil),
4034                 (*IPReassemblySetReply)(nil),
4035                 (*IPRouteAddDel)(nil),
4036                 (*IPRouteAddDelReply)(nil),
4037                 (*IPRouteDetails)(nil),
4038                 (*IPRouteDump)(nil),
4039                 (*IPSourceAndPortRangeCheckAddDel)(nil),
4040                 (*IPSourceAndPortRangeCheckAddDelReply)(nil),
4041                 (*IPSourceAndPortRangeCheckInterfaceAddDel)(nil),
4042                 (*IPSourceAndPortRangeCheckInterfaceAddDelReply)(nil),
4043                 (*IPSourceCheckInterfaceAddDel)(nil),
4044                 (*IPSourceCheckInterfaceAddDelReply)(nil),
4045                 (*IPTableAddDel)(nil),
4046                 (*IPTableAddDelReply)(nil),
4047                 (*IPTableDetails)(nil),
4048                 (*IPTableDump)(nil),
4049                 (*IPTableFlush)(nil),
4050                 (*IPTableFlushReply)(nil),
4051                 (*IPTableReplaceBegin)(nil),
4052                 (*IPTableReplaceBeginReply)(nil),
4053                 (*IPTableReplaceEnd)(nil),
4054                 (*IPTableReplaceEndReply)(nil),
4055                 (*IPUnnumberedDetails)(nil),
4056                 (*IPUnnumberedDump)(nil),
4057                 (*MfibSignalDetails)(nil),
4058                 (*MfibSignalDump)(nil),
4059                 (*SetIPFlowHash)(nil),
4060                 (*SetIPFlowHashReply)(nil),
4061                 (*SwInterfaceIP6EnableDisable)(nil),
4062                 (*SwInterfaceIP6EnableDisableReply)(nil),
4063                 (*SwInterfaceIP6SetLinkLocalAddress)(nil),
4064                 (*SwInterfaceIP6SetLinkLocalAddressReply)(nil),
4065         }
4066 }