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