Update generated binapi to v22.02 & makefile changes
[govpp.git] / internal / testbinapi / binapi2001 / interface / interface.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.5.0-dev
4 //  VPP:              20.01
5 // source: .vppapi/core/interface.api.json
6
7 // Package interfaces contains generated bindings for API file interface.api.
8 //
9 // Contents:
10 //   7 aliases
11 //  10 enums
12 //   6 structs
13 //   1 union
14 //  53 messages
15 //
16 package interfaces
17
18 import (
19         "fmt"
20         "net"
21         "strconv"
22         "strings"
23
24         api "git.fd.io/govpp.git/api"
25         codec "git.fd.io/govpp.git/codec"
26 )
27
28 // This is a compile-time assertion to ensure that this generated file
29 // is compatible with the GoVPP api package it is being compiled against.
30 // A compilation error at this line likely means your copy of the
31 // GoVPP api package needs to be updated.
32 const _ = api.GoVppAPIPackageIsVersion2
33
34 const (
35         APIFile    = "interface"
36         APIVersion = "3.2.2"
37         VersionCrc = 0xfebc3ffa
38 )
39
40 // AddressFamily defines enum 'address_family'.
41 type AddressFamily uint32
42
43 const (
44         ADDRESS_IP4 AddressFamily = 0
45         ADDRESS_IP6 AddressFamily = 1
46 )
47
48 var (
49         AddressFamily_name = map[uint32]string{
50                 0: "ADDRESS_IP4",
51                 1: "ADDRESS_IP6",
52         }
53         AddressFamily_value = map[string]uint32{
54                 "ADDRESS_IP4": 0,
55                 "ADDRESS_IP6": 1,
56         }
57 )
58
59 func (x AddressFamily) String() string {
60         s, ok := AddressFamily_name[uint32(x)]
61         if ok {
62                 return s
63         }
64         return "AddressFamily(" + strconv.Itoa(int(x)) + ")"
65 }
66
67 // IfStatusFlags defines enum 'if_status_flags'.
68 type IfStatusFlags uint32
69
70 const (
71         IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
72         IF_STATUS_API_FLAG_LINK_UP  IfStatusFlags = 2
73 )
74
75 var (
76         IfStatusFlags_name = map[uint32]string{
77                 1: "IF_STATUS_API_FLAG_ADMIN_UP",
78                 2: "IF_STATUS_API_FLAG_LINK_UP",
79         }
80         IfStatusFlags_value = map[string]uint32{
81                 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
82                 "IF_STATUS_API_FLAG_LINK_UP":  2,
83         }
84 )
85
86 func (x IfStatusFlags) String() string {
87         s, ok := IfStatusFlags_name[uint32(x)]
88         if ok {
89                 return s
90         }
91         str := func(n uint32) string {
92                 s, ok := IfStatusFlags_name[uint32(n)]
93                 if ok {
94                         return s
95                 }
96                 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
97         }
98         for i := uint32(0); i <= 32; i++ {
99                 val := uint32(x)
100                 if val&(1<<i) != 0 {
101                         if s != "" {
102                                 s += "|"
103                         }
104                         s += str(1 << i)
105                 }
106         }
107         if s == "" {
108                 return str(uint32(x))
109         }
110         return s
111 }
112
113 // IfType defines enum 'if_type'.
114 type IfType uint32
115
116 const (
117         IF_API_TYPE_HARDWARE IfType = 1
118         IF_API_TYPE_SUB      IfType = 2
119         IF_API_TYPE_P2P      IfType = 3
120         IF_API_TYPE_PIPE     IfType = 4
121 )
122
123 var (
124         IfType_name = map[uint32]string{
125                 1: "IF_API_TYPE_HARDWARE",
126                 2: "IF_API_TYPE_SUB",
127                 3: "IF_API_TYPE_P2P",
128                 4: "IF_API_TYPE_PIPE",
129         }
130         IfType_value = map[string]uint32{
131                 "IF_API_TYPE_HARDWARE": 1,
132                 "IF_API_TYPE_SUB":      2,
133                 "IF_API_TYPE_P2P":      3,
134                 "IF_API_TYPE_PIPE":     4,
135         }
136 )
137
138 func (x IfType) String() string {
139         s, ok := IfType_name[uint32(x)]
140         if ok {
141                 return s
142         }
143         return "IfType(" + strconv.Itoa(int(x)) + ")"
144 }
145
146 // IPDscp defines enum 'ip_dscp'.
147 type IPDscp uint8
148
149 const (
150         IP_API_DSCP_CS0  IPDscp = 0
151         IP_API_DSCP_CS1  IPDscp = 8
152         IP_API_DSCP_AF11 IPDscp = 10
153         IP_API_DSCP_AF12 IPDscp = 12
154         IP_API_DSCP_AF13 IPDscp = 14
155         IP_API_DSCP_CS2  IPDscp = 16
156         IP_API_DSCP_AF21 IPDscp = 18
157         IP_API_DSCP_AF22 IPDscp = 20
158         IP_API_DSCP_AF23 IPDscp = 22
159         IP_API_DSCP_CS3  IPDscp = 24
160         IP_API_DSCP_AF31 IPDscp = 26
161         IP_API_DSCP_AF32 IPDscp = 28
162         IP_API_DSCP_AF33 IPDscp = 30
163         IP_API_DSCP_CS4  IPDscp = 32
164         IP_API_DSCP_AF41 IPDscp = 34
165         IP_API_DSCP_AF42 IPDscp = 36
166         IP_API_DSCP_AF43 IPDscp = 38
167         IP_API_DSCP_CS5  IPDscp = 40
168         IP_API_DSCP_EF   IPDscp = 46
169         IP_API_DSCP_CS6  IPDscp = 48
170         IP_API_DSCP_CS7  IPDscp = 50
171 )
172
173 var (
174         IPDscp_name = map[uint8]string{
175                 0:  "IP_API_DSCP_CS0",
176                 8:  "IP_API_DSCP_CS1",
177                 10: "IP_API_DSCP_AF11",
178                 12: "IP_API_DSCP_AF12",
179                 14: "IP_API_DSCP_AF13",
180                 16: "IP_API_DSCP_CS2",
181                 18: "IP_API_DSCP_AF21",
182                 20: "IP_API_DSCP_AF22",
183                 22: "IP_API_DSCP_AF23",
184                 24: "IP_API_DSCP_CS3",
185                 26: "IP_API_DSCP_AF31",
186                 28: "IP_API_DSCP_AF32",
187                 30: "IP_API_DSCP_AF33",
188                 32: "IP_API_DSCP_CS4",
189                 34: "IP_API_DSCP_AF41",
190                 36: "IP_API_DSCP_AF42",
191                 38: "IP_API_DSCP_AF43",
192                 40: "IP_API_DSCP_CS5",
193                 46: "IP_API_DSCP_EF",
194                 48: "IP_API_DSCP_CS6",
195                 50: "IP_API_DSCP_CS7",
196         }
197         IPDscp_value = map[string]uint8{
198                 "IP_API_DSCP_CS0":  0,
199                 "IP_API_DSCP_CS1":  8,
200                 "IP_API_DSCP_AF11": 10,
201                 "IP_API_DSCP_AF12": 12,
202                 "IP_API_DSCP_AF13": 14,
203                 "IP_API_DSCP_CS2":  16,
204                 "IP_API_DSCP_AF21": 18,
205                 "IP_API_DSCP_AF22": 20,
206                 "IP_API_DSCP_AF23": 22,
207                 "IP_API_DSCP_CS3":  24,
208                 "IP_API_DSCP_AF31": 26,
209                 "IP_API_DSCP_AF32": 28,
210                 "IP_API_DSCP_AF33": 30,
211                 "IP_API_DSCP_CS4":  32,
212                 "IP_API_DSCP_AF41": 34,
213                 "IP_API_DSCP_AF42": 36,
214                 "IP_API_DSCP_AF43": 38,
215                 "IP_API_DSCP_CS5":  40,
216                 "IP_API_DSCP_EF":   46,
217                 "IP_API_DSCP_CS6":  48,
218                 "IP_API_DSCP_CS7":  50,
219         }
220 )
221
222 func (x IPDscp) String() string {
223         s, ok := IPDscp_name[uint8(x)]
224         if ok {
225                 return s
226         }
227         return "IPDscp(" + strconv.Itoa(int(x)) + ")"
228 }
229
230 // IPEcn defines enum 'ip_ecn'.
231 type IPEcn uint8
232
233 const (
234         IP_API_ECN_NONE IPEcn = 0
235         IP_API_ECN_ECT0 IPEcn = 1
236         IP_API_ECN_ECT1 IPEcn = 2
237         IP_API_ECN_CE   IPEcn = 3
238 )
239
240 var (
241         IPEcn_name = map[uint8]string{
242                 0: "IP_API_ECN_NONE",
243                 1: "IP_API_ECN_ECT0",
244                 2: "IP_API_ECN_ECT1",
245                 3: "IP_API_ECN_CE",
246         }
247         IPEcn_value = map[string]uint8{
248                 "IP_API_ECN_NONE": 0,
249                 "IP_API_ECN_ECT0": 1,
250                 "IP_API_ECN_ECT1": 2,
251                 "IP_API_ECN_CE":   3,
252         }
253 )
254
255 func (x IPEcn) String() string {
256         s, ok := IPEcn_name[uint8(x)]
257         if ok {
258                 return s
259         }
260         return "IPEcn(" + strconv.Itoa(int(x)) + ")"
261 }
262
263 // IPProto defines enum 'ip_proto'.
264 type IPProto uint32
265
266 const (
267         IP_API_PROTO_HOPOPT   IPProto = 0
268         IP_API_PROTO_ICMP     IPProto = 1
269         IP_API_PROTO_IGMP     IPProto = 2
270         IP_API_PROTO_TCP      IPProto = 6
271         IP_API_PROTO_UDP      IPProto = 17
272         IP_API_PROTO_GRE      IPProto = 47
273         IP_API_PROTO_AH       IPProto = 50
274         IP_API_PROTO_ESP      IPProto = 51
275         IP_API_PROTO_EIGRP    IPProto = 88
276         IP_API_PROTO_OSPF     IPProto = 89
277         IP_API_PROTO_SCTP     IPProto = 132
278         IP_API_PROTO_RESERVED IPProto = 255
279 )
280
281 var (
282         IPProto_name = map[uint32]string{
283                 0:   "IP_API_PROTO_HOPOPT",
284                 1:   "IP_API_PROTO_ICMP",
285                 2:   "IP_API_PROTO_IGMP",
286                 6:   "IP_API_PROTO_TCP",
287                 17:  "IP_API_PROTO_UDP",
288                 47:  "IP_API_PROTO_GRE",
289                 50:  "IP_API_PROTO_AH",
290                 51:  "IP_API_PROTO_ESP",
291                 88:  "IP_API_PROTO_EIGRP",
292                 89:  "IP_API_PROTO_OSPF",
293                 132: "IP_API_PROTO_SCTP",
294                 255: "IP_API_PROTO_RESERVED",
295         }
296         IPProto_value = map[string]uint32{
297                 "IP_API_PROTO_HOPOPT":   0,
298                 "IP_API_PROTO_ICMP":     1,
299                 "IP_API_PROTO_IGMP":     2,
300                 "IP_API_PROTO_TCP":      6,
301                 "IP_API_PROTO_UDP":      17,
302                 "IP_API_PROTO_GRE":      47,
303                 "IP_API_PROTO_AH":       50,
304                 "IP_API_PROTO_ESP":      51,
305                 "IP_API_PROTO_EIGRP":    88,
306                 "IP_API_PROTO_OSPF":     89,
307                 "IP_API_PROTO_SCTP":     132,
308                 "IP_API_PROTO_RESERVED": 255,
309         }
310 )
311
312 func (x IPProto) String() string {
313         s, ok := IPProto_name[uint32(x)]
314         if ok {
315                 return s
316         }
317         return "IPProto(" + strconv.Itoa(int(x)) + ")"
318 }
319
320 // LinkDuplex defines enum 'link_duplex'.
321 type LinkDuplex uint32
322
323 const (
324         LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
325         LINK_DUPLEX_API_HALF    LinkDuplex = 1
326         LINK_DUPLEX_API_FULL    LinkDuplex = 2
327 )
328
329 var (
330         LinkDuplex_name = map[uint32]string{
331                 0: "LINK_DUPLEX_API_UNKNOWN",
332                 1: "LINK_DUPLEX_API_HALF",
333                 2: "LINK_DUPLEX_API_FULL",
334         }
335         LinkDuplex_value = map[string]uint32{
336                 "LINK_DUPLEX_API_UNKNOWN": 0,
337                 "LINK_DUPLEX_API_HALF":    1,
338                 "LINK_DUPLEX_API_FULL":    2,
339         }
340 )
341
342 func (x LinkDuplex) String() string {
343         s, ok := LinkDuplex_name[uint32(x)]
344         if ok {
345                 return s
346         }
347         return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
348 }
349
350 // MtuProto defines enum 'mtu_proto'.
351 type MtuProto uint32
352
353 const (
354         MTU_PROTO_API_L3   MtuProto = 1
355         MTU_PROTO_API_IP4  MtuProto = 2
356         MTU_PROTO_API_IP6  MtuProto = 3
357         MTU_PROTO_API_MPLS MtuProto = 4
358         MTU_PROTO_API_N    MtuProto = 5
359 )
360
361 var (
362         MtuProto_name = map[uint32]string{
363                 1: "MTU_PROTO_API_L3",
364                 2: "MTU_PROTO_API_IP4",
365                 3: "MTU_PROTO_API_IP6",
366                 4: "MTU_PROTO_API_MPLS",
367                 5: "MTU_PROTO_API_N",
368         }
369         MtuProto_value = map[string]uint32{
370                 "MTU_PROTO_API_L3":   1,
371                 "MTU_PROTO_API_IP4":  2,
372                 "MTU_PROTO_API_IP6":  3,
373                 "MTU_PROTO_API_MPLS": 4,
374                 "MTU_PROTO_API_N":    5,
375         }
376 )
377
378 func (x MtuProto) String() string {
379         s, ok := MtuProto_name[uint32(x)]
380         if ok {
381                 return s
382         }
383         return "MtuProto(" + strconv.Itoa(int(x)) + ")"
384 }
385
386 // RxMode defines enum 'rx_mode'.
387 type RxMode uint32
388
389 const (
390         RX_MODE_API_UNKNOWN   RxMode = 0
391         RX_MODE_API_POLLING   RxMode = 1
392         RX_MODE_API_INTERRUPT RxMode = 2
393         RX_MODE_API_ADAPTIVE  RxMode = 3
394         RX_MODE_API_DEFAULT   RxMode = 4
395 )
396
397 var (
398         RxMode_name = map[uint32]string{
399                 0: "RX_MODE_API_UNKNOWN",
400                 1: "RX_MODE_API_POLLING",
401                 2: "RX_MODE_API_INTERRUPT",
402                 3: "RX_MODE_API_ADAPTIVE",
403                 4: "RX_MODE_API_DEFAULT",
404         }
405         RxMode_value = map[string]uint32{
406                 "RX_MODE_API_UNKNOWN":   0,
407                 "RX_MODE_API_POLLING":   1,
408                 "RX_MODE_API_INTERRUPT": 2,
409                 "RX_MODE_API_ADAPTIVE":  3,
410                 "RX_MODE_API_DEFAULT":   4,
411         }
412 )
413
414 func (x RxMode) String() string {
415         s, ok := RxMode_name[uint32(x)]
416         if ok {
417                 return s
418         }
419         return "RxMode(" + strconv.Itoa(int(x)) + ")"
420 }
421
422 // SubIfFlags defines enum 'sub_if_flags'.
423 type SubIfFlags uint32
424
425 const (
426         SUB_IF_API_FLAG_NO_TAGS           SubIfFlags = 1
427         SUB_IF_API_FLAG_ONE_TAG           SubIfFlags = 2
428         SUB_IF_API_FLAG_TWO_TAGS          SubIfFlags = 4
429         SUB_IF_API_FLAG_DOT1AD            SubIfFlags = 8
430         SUB_IF_API_FLAG_EXACT_MATCH       SubIfFlags = 16
431         SUB_IF_API_FLAG_DEFAULT           SubIfFlags = 32
432         SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
433         SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
434         SUB_IF_API_FLAG_MASK_VNET         SubIfFlags = 254
435         SUB_IF_API_FLAG_DOT1AH            SubIfFlags = 256
436 )
437
438 var (
439         SubIfFlags_name = map[uint32]string{
440                 1:   "SUB_IF_API_FLAG_NO_TAGS",
441                 2:   "SUB_IF_API_FLAG_ONE_TAG",
442                 4:   "SUB_IF_API_FLAG_TWO_TAGS",
443                 8:   "SUB_IF_API_FLAG_DOT1AD",
444                 16:  "SUB_IF_API_FLAG_EXACT_MATCH",
445                 32:  "SUB_IF_API_FLAG_DEFAULT",
446                 64:  "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
447                 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
448                 254: "SUB_IF_API_FLAG_MASK_VNET",
449                 256: "SUB_IF_API_FLAG_DOT1AH",
450         }
451         SubIfFlags_value = map[string]uint32{
452                 "SUB_IF_API_FLAG_NO_TAGS":           1,
453                 "SUB_IF_API_FLAG_ONE_TAG":           2,
454                 "SUB_IF_API_FLAG_TWO_TAGS":          4,
455                 "SUB_IF_API_FLAG_DOT1AD":            8,
456                 "SUB_IF_API_FLAG_EXACT_MATCH":       16,
457                 "SUB_IF_API_FLAG_DEFAULT":           32,
458                 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
459                 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
460                 "SUB_IF_API_FLAG_MASK_VNET":         254,
461                 "SUB_IF_API_FLAG_DOT1AH":            256,
462         }
463 )
464
465 func (x SubIfFlags) String() string {
466         s, ok := SubIfFlags_name[uint32(x)]
467         if ok {
468                 return s
469         }
470         str := func(n uint32) string {
471                 s, ok := SubIfFlags_name[uint32(n)]
472                 if ok {
473                         return s
474                 }
475                 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
476         }
477         for i := uint32(0); i <= 32; i++ {
478                 val := uint32(x)
479                 if val&(1<<i) != 0 {
480                         if s != "" {
481                                 s += "|"
482                         }
483                         s += str(1 << i)
484                 }
485         }
486         if s == "" {
487                 return str(uint32(x))
488         }
489         return s
490 }
491
492 // AddressWithPrefix defines alias 'address_with_prefix'.
493 type AddressWithPrefix Prefix
494
495 func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
496         prefix, err := ParsePrefix(s)
497         if err != nil {
498                 return AddressWithPrefix{}, err
499         }
500         return AddressWithPrefix(prefix), nil
501 }
502
503 func (x AddressWithPrefix) String() string {
504         return Prefix(x).String()
505 }
506
507 func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
508         return []byte(x.String()), nil
509 }
510
511 func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
512         prefix, err := ParseAddressWithPrefix(string(text))
513         if err != nil {
514                 return err
515         }
516         *x = prefix
517         return nil
518 }
519
520 // InterfaceIndex defines alias 'interface_index'.
521 type InterfaceIndex uint32
522
523 // IP4Address defines alias 'ip4_address'.
524 type IP4Address [4]uint8
525
526 func ParseIP4Address(s string) (IP4Address, error) {
527         ip := net.ParseIP(s).To4()
528         if ip == nil {
529                 return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
530         }
531         var ipaddr IP4Address
532         copy(ipaddr[:], ip.To4())
533         return ipaddr, nil
534 }
535
536 func (x IP4Address) ToIP() net.IP {
537         return net.IP(x[:]).To4()
538 }
539
540 func (x IP4Address) String() string {
541         return x.ToIP().String()
542 }
543
544 func (x *IP4Address) MarshalText() ([]byte, error) {
545         return []byte(x.String()), nil
546 }
547
548 func (x *IP4Address) UnmarshalText(text []byte) error {
549         ipaddr, err := ParseIP4Address(string(text))
550         if err != nil {
551                 return err
552         }
553         *x = ipaddr
554         return nil
555 }
556
557 // IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
558 type IP4AddressWithPrefix IP4Prefix
559
560 // IP6Address defines alias 'ip6_address'.
561 type IP6Address [16]uint8
562
563 func ParseIP6Address(s string) (IP6Address, error) {
564         ip := net.ParseIP(s).To16()
565         if ip == nil {
566                 return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
567         }
568         var ipaddr IP6Address
569         copy(ipaddr[:], ip.To16())
570         return ipaddr, nil
571 }
572
573 func (x IP6Address) ToIP() net.IP {
574         return net.IP(x[:]).To16()
575 }
576
577 func (x IP6Address) String() string {
578         return x.ToIP().String()
579 }
580
581 func (x *IP6Address) MarshalText() ([]byte, error) {
582         return []byte(x.String()), nil
583 }
584
585 func (x *IP6Address) UnmarshalText(text []byte) error {
586         ipaddr, err := ParseIP6Address(string(text))
587         if err != nil {
588                 return err
589         }
590         *x = ipaddr
591         return nil
592 }
593
594 // IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
595 type IP6AddressWithPrefix IP6Prefix
596
597 // MacAddress defines alias 'mac_address'.
598 type MacAddress [6]uint8
599
600 func ParseMacAddress(s string) (MacAddress, error) {
601         var macaddr MacAddress
602         mac, err := net.ParseMAC(s)
603         if err != nil {
604                 return macaddr, err
605         }
606         copy(macaddr[:], mac[:])
607         return macaddr, nil
608 }
609
610 func (x MacAddress) ToMAC() net.HardwareAddr {
611         return net.HardwareAddr(x[:])
612 }
613
614 func (x MacAddress) String() string {
615         return x.ToMAC().String()
616 }
617
618 func (x *MacAddress) MarshalText() ([]byte, error) {
619         return []byte(x.String()), nil
620 }
621
622 func (x *MacAddress) UnmarshalText(text []byte) error {
623         mac, err := ParseMacAddress(string(text))
624         if err != nil {
625                 return err
626         }
627         *x = mac
628         return nil
629 }
630
631 // Address defines type 'address'.
632 type Address struct {
633         Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
634         Un AddressUnion  `binapi:"address_union,name=un" json:"un,omitempty"`
635 }
636
637 func ParseAddress(s string) (Address, error) {
638         ip := net.ParseIP(s)
639         if ip == nil {
640                 return Address{}, fmt.Errorf("invalid address: %s", s)
641         }
642         return AddressFromIP(ip), nil
643 }
644
645 func AddressFromIP(ip net.IP) Address {
646         var addr Address
647         if ip.To4() == nil {
648                 addr.Af = ADDRESS_IP6
649                 var ip6 IP6Address
650                 copy(ip6[:], ip.To16())
651                 addr.Un.SetIP6(ip6)
652         } else {
653                 addr.Af = ADDRESS_IP4
654                 var ip4 IP4Address
655                 copy(ip4[:], ip.To4())
656                 addr.Un.SetIP4(ip4)
657         }
658         return addr
659 }
660
661 func (x Address) ToIP() net.IP {
662         if x.Af == ADDRESS_IP6 {
663                 ip6 := x.Un.GetIP6()
664                 return net.IP(ip6[:]).To16()
665         } else {
666                 ip4 := x.Un.GetIP4()
667                 return net.IP(ip4[:]).To4()
668         }
669 }
670
671 func (x Address) String() string {
672         return x.ToIP().String()
673 }
674
675 func (x *Address) MarshalText() ([]byte, error) {
676         return []byte(x.String()), nil
677 }
678
679 func (x *Address) UnmarshalText(text []byte) error {
680         addr, err := ParseAddress(string(text))
681         if err != nil {
682                 return err
683         }
684         *x = addr
685         return nil
686 }
687
688 // IP4Prefix defines type 'ip4_prefix'.
689 type IP4Prefix struct {
690         Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
691         Len     uint8      `binapi:"u8,name=len" json:"len,omitempty"`
692 }
693
694 func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
695         hasPrefix := strings.Contains(s, "/")
696         if hasPrefix {
697                 ip, network, err := net.ParseCIDR(s)
698                 if err != nil {
699                         return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
700                 }
701                 maskSize, _ := network.Mask.Size()
702                 prefix.Len = byte(maskSize)
703                 prefix.Address, err = ParseIP4Address(ip.String())
704                 if err != nil {
705                         return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
706                 }
707         } else {
708                 ip := net.ParseIP(s)
709                 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
710                 if ip.To4() == nil {
711                         defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
712                 }
713                 prefix.Len = byte(defaultMaskSize)
714                 prefix.Address, err = ParseIP4Address(ip.String())
715                 if err != nil {
716                         return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
717                 }
718         }
719         return prefix, nil
720 }
721
722 func (x IP4Prefix) ToIPNet() *net.IPNet {
723         mask := net.CIDRMask(int(x.Len), 32)
724         ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
725         return ipnet
726 }
727
728 func (x IP4Prefix) String() string {
729         ip := x.Address.String()
730         return ip + "/" + strconv.Itoa(int(x.Len))
731 }
732
733 func (x *IP4Prefix) MarshalText() ([]byte, error) {
734         return []byte(x.String()), nil
735 }
736
737 func (x *IP4Prefix) UnmarshalText(text []byte) error {
738         prefix, err := ParseIP4Prefix(string(text))
739         if err != nil {
740                 return err
741         }
742         *x = prefix
743         return nil
744 }
745
746 // IP6Prefix defines type 'ip6_prefix'.
747 type IP6Prefix struct {
748         Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
749         Len     uint8      `binapi:"u8,name=len" json:"len,omitempty"`
750 }
751
752 func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
753         hasPrefix := strings.Contains(s, "/")
754         if hasPrefix {
755                 ip, network, err := net.ParseCIDR(s)
756                 if err != nil {
757                         return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
758                 }
759                 maskSize, _ := network.Mask.Size()
760                 prefix.Len = byte(maskSize)
761                 prefix.Address, err = ParseIP6Address(ip.String())
762                 if err != nil {
763                         return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
764                 }
765         } else {
766                 ip := net.ParseIP(s)
767                 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
768                 if ip.To4() == nil {
769                         defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
770                 }
771                 prefix.Len = byte(defaultMaskSize)
772                 prefix.Address, err = ParseIP6Address(ip.String())
773                 if err != nil {
774                         return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
775                 }
776         }
777         return prefix, nil
778 }
779
780 func (x IP6Prefix) ToIPNet() *net.IPNet {
781         mask := net.CIDRMask(int(x.Len), 128)
782         ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
783         return ipnet
784 }
785
786 func (x IP6Prefix) String() string {
787         ip := x.Address.String()
788         return ip + "/" + strconv.Itoa(int(x.Len))
789 }
790
791 func (x *IP6Prefix) MarshalText() ([]byte, error) {
792         return []byte(x.String()), nil
793 }
794
795 func (x *IP6Prefix) UnmarshalText(text []byte) error {
796         prefix, err := ParseIP6Prefix(string(text))
797         if err != nil {
798                 return err
799         }
800         *x = prefix
801         return nil
802 }
803
804 // Mprefix defines type 'mprefix'.
805 type Mprefix struct {
806         Af               AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
807         GrpAddressLength uint16        `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
808         GrpAddress       AddressUnion  `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
809         SrcAddress       AddressUnion  `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
810 }
811
812 // Prefix defines type 'prefix'.
813 type Prefix struct {
814         Address Address `binapi:"address,name=address" json:"address,omitempty"`
815         Len     uint8   `binapi:"u8,name=len" json:"len,omitempty"`
816 }
817
818 func ParsePrefix(ip string) (prefix Prefix, err error) {
819         hasPrefix := strings.Contains(ip, "/")
820         if hasPrefix {
821                 netIP, network, err := net.ParseCIDR(ip)
822                 if err != nil {
823                         return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
824                 }
825                 maskSize, _ := network.Mask.Size()
826                 prefix.Len = byte(maskSize)
827                 prefix.Address, err = ParseAddress(netIP.String())
828                 if err != nil {
829                         return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
830                 }
831         } else {
832                 netIP := net.ParseIP(ip)
833                 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
834                 if netIP.To4() == nil {
835                         defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
836                 }
837                 prefix.Len = byte(defaultMaskSize)
838                 prefix.Address, err = ParseAddress(netIP.String())
839                 if err != nil {
840                         return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
841                 }
842         }
843         return prefix, nil
844 }
845
846 func (x Prefix) ToIPNet() *net.IPNet {
847         var mask net.IPMask
848         if x.Address.Af == ADDRESS_IP4 {
849                 mask = net.CIDRMask(int(x.Len), 32)
850         } else {
851                 mask = net.CIDRMask(int(x.Len), 128)
852         }
853         ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
854         return ipnet
855 }
856
857 func (x Prefix) String() string {
858         ip := x.Address.String()
859         return ip + "/" + strconv.Itoa(int(x.Len))
860 }
861
862 func (x *Prefix) MarshalText() ([]byte, error) {
863         return []byte(x.String()), nil
864 }
865
866 func (x *Prefix) UnmarshalText(text []byte) error {
867         prefix, err := ParsePrefix(string(text))
868         if err != nil {
869                 return err
870         }
871         *x = prefix
872         return nil
873 }
874
875 // PrefixMatcher defines type 'prefix_matcher'.
876 type PrefixMatcher struct {
877         Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
878         Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
879 }
880
881 // AddressUnion defines union 'address_union'.
882 type AddressUnion struct {
883         // AddressUnion can be one of:
884         // - IP4 *IP4Address
885         // - IP6 *IP6Address
886         XXX_UnionData [16]byte
887 }
888
889 func AddressUnionIP4(a IP4Address) (u AddressUnion) {
890         u.SetIP4(a)
891         return
892 }
893 func (u *AddressUnion) SetIP4(a IP4Address) {
894         buf := codec.NewBuffer(u.XXX_UnionData[:])
895         buf.EncodeBytes(a[:], 4)
896 }
897 func (u *AddressUnion) GetIP4() (a IP4Address) {
898         buf := codec.NewBuffer(u.XXX_UnionData[:])
899         copy(a[:], buf.DecodeBytes(4))
900         return
901 }
902
903 func AddressUnionIP6(a IP6Address) (u AddressUnion) {
904         u.SetIP6(a)
905         return
906 }
907 func (u *AddressUnion) SetIP6(a IP6Address) {
908         buf := codec.NewBuffer(u.XXX_UnionData[:])
909         buf.EncodeBytes(a[:], 16)
910 }
911 func (u *AddressUnion) GetIP6() (a IP6Address) {
912         buf := codec.NewBuffer(u.XXX_UnionData[:])
913         copy(a[:], buf.DecodeBytes(16))
914         return
915 }
916
917 // CollectDetailedInterfaceStats defines message 'collect_detailed_interface_stats'.
918 type CollectDetailedInterfaceStats struct {
919         SwIfIndex     InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
920         EnableDisable bool           `binapi:"bool,name=enable_disable" json:"enable_disable,omitempty"`
921 }
922
923 func (m *CollectDetailedInterfaceStats) Reset() { *m = CollectDetailedInterfaceStats{} }
924 func (*CollectDetailedInterfaceStats) GetMessageName() string {
925         return "collect_detailed_interface_stats"
926 }
927 func (*CollectDetailedInterfaceStats) GetCrcString() string { return "5501adee" }
928 func (*CollectDetailedInterfaceStats) GetMessageType() api.MessageType {
929         return api.RequestMessage
930 }
931
932 func (m *CollectDetailedInterfaceStats) Size() (size int) {
933         if m == nil {
934                 return 0
935         }
936         size += 4 // m.SwIfIndex
937         size += 1 // m.EnableDisable
938         return size
939 }
940 func (m *CollectDetailedInterfaceStats) Marshal(b []byte) ([]byte, error) {
941         if b == nil {
942                 b = make([]byte, m.Size())
943         }
944         buf := codec.NewBuffer(b)
945         buf.EncodeUint32(uint32(m.SwIfIndex))
946         buf.EncodeBool(m.EnableDisable)
947         return buf.Bytes(), nil
948 }
949 func (m *CollectDetailedInterfaceStats) Unmarshal(b []byte) error {
950         buf := codec.NewBuffer(b)
951         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
952         m.EnableDisable = buf.DecodeBool()
953         return nil
954 }
955
956 // CollectDetailedInterfaceStatsReply defines message 'collect_detailed_interface_stats_reply'.
957 type CollectDetailedInterfaceStatsReply struct {
958         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
959 }
960
961 func (m *CollectDetailedInterfaceStatsReply) Reset() { *m = CollectDetailedInterfaceStatsReply{} }
962 func (*CollectDetailedInterfaceStatsReply) GetMessageName() string {
963         return "collect_detailed_interface_stats_reply"
964 }
965 func (*CollectDetailedInterfaceStatsReply) GetCrcString() string { return "e8d4e804" }
966 func (*CollectDetailedInterfaceStatsReply) GetMessageType() api.MessageType {
967         return api.ReplyMessage
968 }
969
970 func (m *CollectDetailedInterfaceStatsReply) Size() (size int) {
971         if m == nil {
972                 return 0
973         }
974         size += 4 // m.Retval
975         return size
976 }
977 func (m *CollectDetailedInterfaceStatsReply) Marshal(b []byte) ([]byte, error) {
978         if b == nil {
979                 b = make([]byte, m.Size())
980         }
981         buf := codec.NewBuffer(b)
982         buf.EncodeInt32(m.Retval)
983         return buf.Bytes(), nil
984 }
985 func (m *CollectDetailedInterfaceStatsReply) Unmarshal(b []byte) error {
986         buf := codec.NewBuffer(b)
987         m.Retval = buf.DecodeInt32()
988         return nil
989 }
990
991 // CreateLoopback defines message 'create_loopback'.
992 type CreateLoopback struct {
993         MacAddress MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
994 }
995
996 func (m *CreateLoopback) Reset()               { *m = CreateLoopback{} }
997 func (*CreateLoopback) GetMessageName() string { return "create_loopback" }
998 func (*CreateLoopback) GetCrcString() string   { return "42bb5d22" }
999 func (*CreateLoopback) GetMessageType() api.MessageType {
1000         return api.RequestMessage
1001 }
1002
1003 func (m *CreateLoopback) Size() (size int) {
1004         if m == nil {
1005                 return 0
1006         }
1007         size += 1 * 6 // m.MacAddress
1008         return size
1009 }
1010 func (m *CreateLoopback) Marshal(b []byte) ([]byte, error) {
1011         if b == nil {
1012                 b = make([]byte, m.Size())
1013         }
1014         buf := codec.NewBuffer(b)
1015         buf.EncodeBytes(m.MacAddress[:], 6)
1016         return buf.Bytes(), nil
1017 }
1018 func (m *CreateLoopback) Unmarshal(b []byte) error {
1019         buf := codec.NewBuffer(b)
1020         copy(m.MacAddress[:], buf.DecodeBytes(6))
1021         return nil
1022 }
1023
1024 // CreateLoopbackInstance defines message 'create_loopback_instance'.
1025 type CreateLoopbackInstance struct {
1026         MacAddress   MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
1027         IsSpecified  bool       `binapi:"bool,name=is_specified" json:"is_specified,omitempty"`
1028         UserInstance uint32     `binapi:"u32,name=user_instance" json:"user_instance,omitempty"`
1029 }
1030
1031 func (m *CreateLoopbackInstance) Reset()               { *m = CreateLoopbackInstance{} }
1032 func (*CreateLoopbackInstance) GetMessageName() string { return "create_loopback_instance" }
1033 func (*CreateLoopbackInstance) GetCrcString() string   { return "d36a3ee2" }
1034 func (*CreateLoopbackInstance) GetMessageType() api.MessageType {
1035         return api.RequestMessage
1036 }
1037
1038 func (m *CreateLoopbackInstance) Size() (size int) {
1039         if m == nil {
1040                 return 0
1041         }
1042         size += 1 * 6 // m.MacAddress
1043         size += 1     // m.IsSpecified
1044         size += 4     // m.UserInstance
1045         return size
1046 }
1047 func (m *CreateLoopbackInstance) Marshal(b []byte) ([]byte, error) {
1048         if b == nil {
1049                 b = make([]byte, m.Size())
1050         }
1051         buf := codec.NewBuffer(b)
1052         buf.EncodeBytes(m.MacAddress[:], 6)
1053         buf.EncodeBool(m.IsSpecified)
1054         buf.EncodeUint32(m.UserInstance)
1055         return buf.Bytes(), nil
1056 }
1057 func (m *CreateLoopbackInstance) Unmarshal(b []byte) error {
1058         buf := codec.NewBuffer(b)
1059         copy(m.MacAddress[:], buf.DecodeBytes(6))
1060         m.IsSpecified = buf.DecodeBool()
1061         m.UserInstance = buf.DecodeUint32()
1062         return nil
1063 }
1064
1065 // CreateLoopbackInstanceReply defines message 'create_loopback_instance_reply'.
1066 type CreateLoopbackInstanceReply struct {
1067         Retval    int32          `binapi:"i32,name=retval" json:"retval,omitempty"`
1068         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1069 }
1070
1071 func (m *CreateLoopbackInstanceReply) Reset()               { *m = CreateLoopbackInstanceReply{} }
1072 func (*CreateLoopbackInstanceReply) GetMessageName() string { return "create_loopback_instance_reply" }
1073 func (*CreateLoopbackInstanceReply) GetCrcString() string   { return "5383d31f" }
1074 func (*CreateLoopbackInstanceReply) GetMessageType() api.MessageType {
1075         return api.ReplyMessage
1076 }
1077
1078 func (m *CreateLoopbackInstanceReply) Size() (size int) {
1079         if m == nil {
1080                 return 0
1081         }
1082         size += 4 // m.Retval
1083         size += 4 // m.SwIfIndex
1084         return size
1085 }
1086 func (m *CreateLoopbackInstanceReply) Marshal(b []byte) ([]byte, error) {
1087         if b == nil {
1088                 b = make([]byte, m.Size())
1089         }
1090         buf := codec.NewBuffer(b)
1091         buf.EncodeInt32(m.Retval)
1092         buf.EncodeUint32(uint32(m.SwIfIndex))
1093         return buf.Bytes(), nil
1094 }
1095 func (m *CreateLoopbackInstanceReply) Unmarshal(b []byte) error {
1096         buf := codec.NewBuffer(b)
1097         m.Retval = buf.DecodeInt32()
1098         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1099         return nil
1100 }
1101
1102 // CreateLoopbackReply defines message 'create_loopback_reply'.
1103 type CreateLoopbackReply struct {
1104         Retval    int32          `binapi:"i32,name=retval" json:"retval,omitempty"`
1105         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1106 }
1107
1108 func (m *CreateLoopbackReply) Reset()               { *m = CreateLoopbackReply{} }
1109 func (*CreateLoopbackReply) GetMessageName() string { return "create_loopback_reply" }
1110 func (*CreateLoopbackReply) GetCrcString() string   { return "5383d31f" }
1111 func (*CreateLoopbackReply) GetMessageType() api.MessageType {
1112         return api.ReplyMessage
1113 }
1114
1115 func (m *CreateLoopbackReply) Size() (size int) {
1116         if m == nil {
1117                 return 0
1118         }
1119         size += 4 // m.Retval
1120         size += 4 // m.SwIfIndex
1121         return size
1122 }
1123 func (m *CreateLoopbackReply) Marshal(b []byte) ([]byte, error) {
1124         if b == nil {
1125                 b = make([]byte, m.Size())
1126         }
1127         buf := codec.NewBuffer(b)
1128         buf.EncodeInt32(m.Retval)
1129         buf.EncodeUint32(uint32(m.SwIfIndex))
1130         return buf.Bytes(), nil
1131 }
1132 func (m *CreateLoopbackReply) Unmarshal(b []byte) error {
1133         buf := codec.NewBuffer(b)
1134         m.Retval = buf.DecodeInt32()
1135         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1136         return nil
1137 }
1138
1139 // CreateSubif defines message 'create_subif'.
1140 type CreateSubif struct {
1141         SwIfIndex   InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1142         SubID       uint32         `binapi:"u32,name=sub_id" json:"sub_id,omitempty"`
1143         SubIfFlags  SubIfFlags     `binapi:"sub_if_flags,name=sub_if_flags" json:"sub_if_flags,omitempty"`
1144         OuterVlanID uint16         `binapi:"u16,name=outer_vlan_id" json:"outer_vlan_id,omitempty"`
1145         InnerVlanID uint16         `binapi:"u16,name=inner_vlan_id" json:"inner_vlan_id,omitempty"`
1146 }
1147
1148 func (m *CreateSubif) Reset()               { *m = CreateSubif{} }
1149 func (*CreateSubif) GetMessageName() string { return "create_subif" }
1150 func (*CreateSubif) GetCrcString() string   { return "cb371063" }
1151 func (*CreateSubif) GetMessageType() api.MessageType {
1152         return api.RequestMessage
1153 }
1154
1155 func (m *CreateSubif) Size() (size int) {
1156         if m == nil {
1157                 return 0
1158         }
1159         size += 4 // m.SwIfIndex
1160         size += 4 // m.SubID
1161         size += 4 // m.SubIfFlags
1162         size += 2 // m.OuterVlanID
1163         size += 2 // m.InnerVlanID
1164         return size
1165 }
1166 func (m *CreateSubif) Marshal(b []byte) ([]byte, error) {
1167         if b == nil {
1168                 b = make([]byte, m.Size())
1169         }
1170         buf := codec.NewBuffer(b)
1171         buf.EncodeUint32(uint32(m.SwIfIndex))
1172         buf.EncodeUint32(m.SubID)
1173         buf.EncodeUint32(uint32(m.SubIfFlags))
1174         buf.EncodeUint16(m.OuterVlanID)
1175         buf.EncodeUint16(m.InnerVlanID)
1176         return buf.Bytes(), nil
1177 }
1178 func (m *CreateSubif) Unmarshal(b []byte) error {
1179         buf := codec.NewBuffer(b)
1180         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1181         m.SubID = buf.DecodeUint32()
1182         m.SubIfFlags = SubIfFlags(buf.DecodeUint32())
1183         m.OuterVlanID = buf.DecodeUint16()
1184         m.InnerVlanID = buf.DecodeUint16()
1185         return nil
1186 }
1187
1188 // CreateSubifReply defines message 'create_subif_reply'.
1189 type CreateSubifReply struct {
1190         Retval    int32          `binapi:"i32,name=retval" json:"retval,omitempty"`
1191         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1192 }
1193
1194 func (m *CreateSubifReply) Reset()               { *m = CreateSubifReply{} }
1195 func (*CreateSubifReply) GetMessageName() string { return "create_subif_reply" }
1196 func (*CreateSubifReply) GetCrcString() string   { return "5383d31f" }
1197 func (*CreateSubifReply) GetMessageType() api.MessageType {
1198         return api.ReplyMessage
1199 }
1200
1201 func (m *CreateSubifReply) Size() (size int) {
1202         if m == nil {
1203                 return 0
1204         }
1205         size += 4 // m.Retval
1206         size += 4 // m.SwIfIndex
1207         return size
1208 }
1209 func (m *CreateSubifReply) Marshal(b []byte) ([]byte, error) {
1210         if b == nil {
1211                 b = make([]byte, m.Size())
1212         }
1213         buf := codec.NewBuffer(b)
1214         buf.EncodeInt32(m.Retval)
1215         buf.EncodeUint32(uint32(m.SwIfIndex))
1216         return buf.Bytes(), nil
1217 }
1218 func (m *CreateSubifReply) Unmarshal(b []byte) error {
1219         buf := codec.NewBuffer(b)
1220         m.Retval = buf.DecodeInt32()
1221         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1222         return nil
1223 }
1224
1225 // CreateVlanSubif defines message 'create_vlan_subif'.
1226 type CreateVlanSubif struct {
1227         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1228         VlanID    uint32         `binapi:"u32,name=vlan_id" json:"vlan_id,omitempty"`
1229 }
1230
1231 func (m *CreateVlanSubif) Reset()               { *m = CreateVlanSubif{} }
1232 func (*CreateVlanSubif) GetMessageName() string { return "create_vlan_subif" }
1233 func (*CreateVlanSubif) GetCrcString() string   { return "af34ac8b" }
1234 func (*CreateVlanSubif) GetMessageType() api.MessageType {
1235         return api.RequestMessage
1236 }
1237
1238 func (m *CreateVlanSubif) Size() (size int) {
1239         if m == nil {
1240                 return 0
1241         }
1242         size += 4 // m.SwIfIndex
1243         size += 4 // m.VlanID
1244         return size
1245 }
1246 func (m *CreateVlanSubif) Marshal(b []byte) ([]byte, error) {
1247         if b == nil {
1248                 b = make([]byte, m.Size())
1249         }
1250         buf := codec.NewBuffer(b)
1251         buf.EncodeUint32(uint32(m.SwIfIndex))
1252         buf.EncodeUint32(m.VlanID)
1253         return buf.Bytes(), nil
1254 }
1255 func (m *CreateVlanSubif) Unmarshal(b []byte) error {
1256         buf := codec.NewBuffer(b)
1257         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1258         m.VlanID = buf.DecodeUint32()
1259         return nil
1260 }
1261
1262 // CreateVlanSubifReply defines message 'create_vlan_subif_reply'.
1263 type CreateVlanSubifReply struct {
1264         Retval    int32          `binapi:"i32,name=retval" json:"retval,omitempty"`
1265         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1266 }
1267
1268 func (m *CreateVlanSubifReply) Reset()               { *m = CreateVlanSubifReply{} }
1269 func (*CreateVlanSubifReply) GetMessageName() string { return "create_vlan_subif_reply" }
1270 func (*CreateVlanSubifReply) GetCrcString() string   { return "5383d31f" }
1271 func (*CreateVlanSubifReply) GetMessageType() api.MessageType {
1272         return api.ReplyMessage
1273 }
1274
1275 func (m *CreateVlanSubifReply) Size() (size int) {
1276         if m == nil {
1277                 return 0
1278         }
1279         size += 4 // m.Retval
1280         size += 4 // m.SwIfIndex
1281         return size
1282 }
1283 func (m *CreateVlanSubifReply) Marshal(b []byte) ([]byte, error) {
1284         if b == nil {
1285                 b = make([]byte, m.Size())
1286         }
1287         buf := codec.NewBuffer(b)
1288         buf.EncodeInt32(m.Retval)
1289         buf.EncodeUint32(uint32(m.SwIfIndex))
1290         return buf.Bytes(), nil
1291 }
1292 func (m *CreateVlanSubifReply) Unmarshal(b []byte) error {
1293         buf := codec.NewBuffer(b)
1294         m.Retval = buf.DecodeInt32()
1295         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1296         return nil
1297 }
1298
1299 // DeleteLoopback defines message 'delete_loopback'.
1300 type DeleteLoopback struct {
1301         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1302 }
1303
1304 func (m *DeleteLoopback) Reset()               { *m = DeleteLoopback{} }
1305 func (*DeleteLoopback) GetMessageName() string { return "delete_loopback" }
1306 func (*DeleteLoopback) GetCrcString() string   { return "f9e6675e" }
1307 func (*DeleteLoopback) GetMessageType() api.MessageType {
1308         return api.RequestMessage
1309 }
1310
1311 func (m *DeleteLoopback) Size() (size int) {
1312         if m == nil {
1313                 return 0
1314         }
1315         size += 4 // m.SwIfIndex
1316         return size
1317 }
1318 func (m *DeleteLoopback) Marshal(b []byte) ([]byte, error) {
1319         if b == nil {
1320                 b = make([]byte, m.Size())
1321         }
1322         buf := codec.NewBuffer(b)
1323         buf.EncodeUint32(uint32(m.SwIfIndex))
1324         return buf.Bytes(), nil
1325 }
1326 func (m *DeleteLoopback) Unmarshal(b []byte) error {
1327         buf := codec.NewBuffer(b)
1328         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1329         return nil
1330 }
1331
1332 // DeleteLoopbackReply defines message 'delete_loopback_reply'.
1333 type DeleteLoopbackReply struct {
1334         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1335 }
1336
1337 func (m *DeleteLoopbackReply) Reset()               { *m = DeleteLoopbackReply{} }
1338 func (*DeleteLoopbackReply) GetMessageName() string { return "delete_loopback_reply" }
1339 func (*DeleteLoopbackReply) GetCrcString() string   { return "e8d4e804" }
1340 func (*DeleteLoopbackReply) GetMessageType() api.MessageType {
1341         return api.ReplyMessage
1342 }
1343
1344 func (m *DeleteLoopbackReply) Size() (size int) {
1345         if m == nil {
1346                 return 0
1347         }
1348         size += 4 // m.Retval
1349         return size
1350 }
1351 func (m *DeleteLoopbackReply) Marshal(b []byte) ([]byte, error) {
1352         if b == nil {
1353                 b = make([]byte, m.Size())
1354         }
1355         buf := codec.NewBuffer(b)
1356         buf.EncodeInt32(m.Retval)
1357         return buf.Bytes(), nil
1358 }
1359 func (m *DeleteLoopbackReply) Unmarshal(b []byte) error {
1360         buf := codec.NewBuffer(b)
1361         m.Retval = buf.DecodeInt32()
1362         return nil
1363 }
1364
1365 // DeleteSubif defines message 'delete_subif'.
1366 type DeleteSubif struct {
1367         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1368 }
1369
1370 func (m *DeleteSubif) Reset()               { *m = DeleteSubif{} }
1371 func (*DeleteSubif) GetMessageName() string { return "delete_subif" }
1372 func (*DeleteSubif) GetCrcString() string   { return "f9e6675e" }
1373 func (*DeleteSubif) GetMessageType() api.MessageType {
1374         return api.RequestMessage
1375 }
1376
1377 func (m *DeleteSubif) Size() (size int) {
1378         if m == nil {
1379                 return 0
1380         }
1381         size += 4 // m.SwIfIndex
1382         return size
1383 }
1384 func (m *DeleteSubif) Marshal(b []byte) ([]byte, error) {
1385         if b == nil {
1386                 b = make([]byte, m.Size())
1387         }
1388         buf := codec.NewBuffer(b)
1389         buf.EncodeUint32(uint32(m.SwIfIndex))
1390         return buf.Bytes(), nil
1391 }
1392 func (m *DeleteSubif) Unmarshal(b []byte) error {
1393         buf := codec.NewBuffer(b)
1394         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1395         return nil
1396 }
1397
1398 // DeleteSubifReply defines message 'delete_subif_reply'.
1399 type DeleteSubifReply struct {
1400         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1401 }
1402
1403 func (m *DeleteSubifReply) Reset()               { *m = DeleteSubifReply{} }
1404 func (*DeleteSubifReply) GetMessageName() string { return "delete_subif_reply" }
1405 func (*DeleteSubifReply) GetCrcString() string   { return "e8d4e804" }
1406 func (*DeleteSubifReply) GetMessageType() api.MessageType {
1407         return api.ReplyMessage
1408 }
1409
1410 func (m *DeleteSubifReply) Size() (size int) {
1411         if m == nil {
1412                 return 0
1413         }
1414         size += 4 // m.Retval
1415         return size
1416 }
1417 func (m *DeleteSubifReply) Marshal(b []byte) ([]byte, error) {
1418         if b == nil {
1419                 b = make([]byte, m.Size())
1420         }
1421         buf := codec.NewBuffer(b)
1422         buf.EncodeInt32(m.Retval)
1423         return buf.Bytes(), nil
1424 }
1425 func (m *DeleteSubifReply) Unmarshal(b []byte) error {
1426         buf := codec.NewBuffer(b)
1427         m.Retval = buf.DecodeInt32()
1428         return nil
1429 }
1430
1431 // HwInterfaceSetMtu defines message 'hw_interface_set_mtu'.
1432 type HwInterfaceSetMtu struct {
1433         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1434         Mtu       uint16         `binapi:"u16,name=mtu" json:"mtu,omitempty"`
1435 }
1436
1437 func (m *HwInterfaceSetMtu) Reset()               { *m = HwInterfaceSetMtu{} }
1438 func (*HwInterfaceSetMtu) GetMessageName() string { return "hw_interface_set_mtu" }
1439 func (*HwInterfaceSetMtu) GetCrcString() string   { return "e6746899" }
1440 func (*HwInterfaceSetMtu) GetMessageType() api.MessageType {
1441         return api.RequestMessage
1442 }
1443
1444 func (m *HwInterfaceSetMtu) Size() (size int) {
1445         if m == nil {
1446                 return 0
1447         }
1448         size += 4 // m.SwIfIndex
1449         size += 2 // m.Mtu
1450         return size
1451 }
1452 func (m *HwInterfaceSetMtu) Marshal(b []byte) ([]byte, error) {
1453         if b == nil {
1454                 b = make([]byte, m.Size())
1455         }
1456         buf := codec.NewBuffer(b)
1457         buf.EncodeUint32(uint32(m.SwIfIndex))
1458         buf.EncodeUint16(m.Mtu)
1459         return buf.Bytes(), nil
1460 }
1461 func (m *HwInterfaceSetMtu) Unmarshal(b []byte) error {
1462         buf := codec.NewBuffer(b)
1463         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1464         m.Mtu = buf.DecodeUint16()
1465         return nil
1466 }
1467
1468 // HwInterfaceSetMtuReply defines message 'hw_interface_set_mtu_reply'.
1469 type HwInterfaceSetMtuReply struct {
1470         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1471 }
1472
1473 func (m *HwInterfaceSetMtuReply) Reset()               { *m = HwInterfaceSetMtuReply{} }
1474 func (*HwInterfaceSetMtuReply) GetMessageName() string { return "hw_interface_set_mtu_reply" }
1475 func (*HwInterfaceSetMtuReply) GetCrcString() string   { return "e8d4e804" }
1476 func (*HwInterfaceSetMtuReply) GetMessageType() api.MessageType {
1477         return api.ReplyMessage
1478 }
1479
1480 func (m *HwInterfaceSetMtuReply) Size() (size int) {
1481         if m == nil {
1482                 return 0
1483         }
1484         size += 4 // m.Retval
1485         return size
1486 }
1487 func (m *HwInterfaceSetMtuReply) Marshal(b []byte) ([]byte, error) {
1488         if b == nil {
1489                 b = make([]byte, m.Size())
1490         }
1491         buf := codec.NewBuffer(b)
1492         buf.EncodeInt32(m.Retval)
1493         return buf.Bytes(), nil
1494 }
1495 func (m *HwInterfaceSetMtuReply) Unmarshal(b []byte) error {
1496         buf := codec.NewBuffer(b)
1497         m.Retval = buf.DecodeInt32()
1498         return nil
1499 }
1500
1501 // InterfaceNameRenumber defines message 'interface_name_renumber'.
1502 type InterfaceNameRenumber struct {
1503         SwIfIndex          InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1504         NewShowDevInstance uint32         `binapi:"u32,name=new_show_dev_instance" json:"new_show_dev_instance,omitempty"`
1505 }
1506
1507 func (m *InterfaceNameRenumber) Reset()               { *m = InterfaceNameRenumber{} }
1508 func (*InterfaceNameRenumber) GetMessageName() string { return "interface_name_renumber" }
1509 func (*InterfaceNameRenumber) GetCrcString() string   { return "2b8858b8" }
1510 func (*InterfaceNameRenumber) GetMessageType() api.MessageType {
1511         return api.RequestMessage
1512 }
1513
1514 func (m *InterfaceNameRenumber) Size() (size int) {
1515         if m == nil {
1516                 return 0
1517         }
1518         size += 4 // m.SwIfIndex
1519         size += 4 // m.NewShowDevInstance
1520         return size
1521 }
1522 func (m *InterfaceNameRenumber) Marshal(b []byte) ([]byte, error) {
1523         if b == nil {
1524                 b = make([]byte, m.Size())
1525         }
1526         buf := codec.NewBuffer(b)
1527         buf.EncodeUint32(uint32(m.SwIfIndex))
1528         buf.EncodeUint32(m.NewShowDevInstance)
1529         return buf.Bytes(), nil
1530 }
1531 func (m *InterfaceNameRenumber) Unmarshal(b []byte) error {
1532         buf := codec.NewBuffer(b)
1533         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1534         m.NewShowDevInstance = buf.DecodeUint32()
1535         return nil
1536 }
1537
1538 // InterfaceNameRenumberReply defines message 'interface_name_renumber_reply'.
1539 type InterfaceNameRenumberReply struct {
1540         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1541 }
1542
1543 func (m *InterfaceNameRenumberReply) Reset()               { *m = InterfaceNameRenumberReply{} }
1544 func (*InterfaceNameRenumberReply) GetMessageName() string { return "interface_name_renumber_reply" }
1545 func (*InterfaceNameRenumberReply) GetCrcString() string   { return "e8d4e804" }
1546 func (*InterfaceNameRenumberReply) GetMessageType() api.MessageType {
1547         return api.ReplyMessage
1548 }
1549
1550 func (m *InterfaceNameRenumberReply) Size() (size int) {
1551         if m == nil {
1552                 return 0
1553         }
1554         size += 4 // m.Retval
1555         return size
1556 }
1557 func (m *InterfaceNameRenumberReply) Marshal(b []byte) ([]byte, error) {
1558         if b == nil {
1559                 b = make([]byte, m.Size())
1560         }
1561         buf := codec.NewBuffer(b)
1562         buf.EncodeInt32(m.Retval)
1563         return buf.Bytes(), nil
1564 }
1565 func (m *InterfaceNameRenumberReply) Unmarshal(b []byte) error {
1566         buf := codec.NewBuffer(b)
1567         m.Retval = buf.DecodeInt32()
1568         return nil
1569 }
1570
1571 // SwInterfaceAddDelAddress defines message 'sw_interface_add_del_address'.
1572 type SwInterfaceAddDelAddress struct {
1573         SwIfIndex InterfaceIndex    `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1574         IsAdd     bool              `binapi:"bool,name=is_add" json:"is_add,omitempty"`
1575         DelAll    bool              `binapi:"bool,name=del_all" json:"del_all,omitempty"`
1576         Prefix    AddressWithPrefix `binapi:"address_with_prefix,name=prefix" json:"prefix,omitempty"`
1577 }
1578
1579 func (m *SwInterfaceAddDelAddress) Reset()               { *m = SwInterfaceAddDelAddress{} }
1580 func (*SwInterfaceAddDelAddress) GetMessageName() string { return "sw_interface_add_del_address" }
1581 func (*SwInterfaceAddDelAddress) GetCrcString() string   { return "5803d5c4" }
1582 func (*SwInterfaceAddDelAddress) GetMessageType() api.MessageType {
1583         return api.RequestMessage
1584 }
1585
1586 func (m *SwInterfaceAddDelAddress) Size() (size int) {
1587         if m == nil {
1588                 return 0
1589         }
1590         size += 4      // m.SwIfIndex
1591         size += 1      // m.IsAdd
1592         size += 1      // m.DelAll
1593         size += 4      // m.Prefix.Address.Af
1594         size += 1 * 16 // m.Prefix.Address.Un
1595         size += 1      // m.Prefix.Len
1596         return size
1597 }
1598 func (m *SwInterfaceAddDelAddress) Marshal(b []byte) ([]byte, error) {
1599         if b == nil {
1600                 b = make([]byte, m.Size())
1601         }
1602         buf := codec.NewBuffer(b)
1603         buf.EncodeUint32(uint32(m.SwIfIndex))
1604         buf.EncodeBool(m.IsAdd)
1605         buf.EncodeBool(m.DelAll)
1606         buf.EncodeUint32(uint32(m.Prefix.Address.Af))
1607         buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16)
1608         buf.EncodeUint8(m.Prefix.Len)
1609         return buf.Bytes(), nil
1610 }
1611 func (m *SwInterfaceAddDelAddress) Unmarshal(b []byte) error {
1612         buf := codec.NewBuffer(b)
1613         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1614         m.IsAdd = buf.DecodeBool()
1615         m.DelAll = buf.DecodeBool()
1616         m.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
1617         copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1618         m.Prefix.Len = buf.DecodeUint8()
1619         return nil
1620 }
1621
1622 // SwInterfaceAddDelAddressReply defines message 'sw_interface_add_del_address_reply'.
1623 type SwInterfaceAddDelAddressReply struct {
1624         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1625 }
1626
1627 func (m *SwInterfaceAddDelAddressReply) Reset() { *m = SwInterfaceAddDelAddressReply{} }
1628 func (*SwInterfaceAddDelAddressReply) GetMessageName() string {
1629         return "sw_interface_add_del_address_reply"
1630 }
1631 func (*SwInterfaceAddDelAddressReply) GetCrcString() string { return "e8d4e804" }
1632 func (*SwInterfaceAddDelAddressReply) GetMessageType() api.MessageType {
1633         return api.ReplyMessage
1634 }
1635
1636 func (m *SwInterfaceAddDelAddressReply) Size() (size int) {
1637         if m == nil {
1638                 return 0
1639         }
1640         size += 4 // m.Retval
1641         return size
1642 }
1643 func (m *SwInterfaceAddDelAddressReply) Marshal(b []byte) ([]byte, error) {
1644         if b == nil {
1645                 b = make([]byte, m.Size())
1646         }
1647         buf := codec.NewBuffer(b)
1648         buf.EncodeInt32(m.Retval)
1649         return buf.Bytes(), nil
1650 }
1651 func (m *SwInterfaceAddDelAddressReply) Unmarshal(b []byte) error {
1652         buf := codec.NewBuffer(b)
1653         m.Retval = buf.DecodeInt32()
1654         return nil
1655 }
1656
1657 // SwInterfaceAddDelMacAddress defines message 'sw_interface_add_del_mac_address'.
1658 type SwInterfaceAddDelMacAddress struct {
1659         SwIfIndex uint32     `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
1660         Addr      MacAddress `binapi:"mac_address,name=addr" json:"addr,omitempty"`
1661         IsAdd     uint8      `binapi:"u8,name=is_add" json:"is_add,omitempty"`
1662 }
1663
1664 func (m *SwInterfaceAddDelMacAddress) Reset() { *m = SwInterfaceAddDelMacAddress{} }
1665 func (*SwInterfaceAddDelMacAddress) GetMessageName() string {
1666         return "sw_interface_add_del_mac_address"
1667 }
1668 func (*SwInterfaceAddDelMacAddress) GetCrcString() string { return "638bb9f4" }
1669 func (*SwInterfaceAddDelMacAddress) GetMessageType() api.MessageType {
1670         return api.RequestMessage
1671 }
1672
1673 func (m *SwInterfaceAddDelMacAddress) Size() (size int) {
1674         if m == nil {
1675                 return 0
1676         }
1677         size += 4     // m.SwIfIndex
1678         size += 1 * 6 // m.Addr
1679         size += 1     // m.IsAdd
1680         return size
1681 }
1682 func (m *SwInterfaceAddDelMacAddress) Marshal(b []byte) ([]byte, error) {
1683         if b == nil {
1684                 b = make([]byte, m.Size())
1685         }
1686         buf := codec.NewBuffer(b)
1687         buf.EncodeUint32(m.SwIfIndex)
1688         buf.EncodeBytes(m.Addr[:], 6)
1689         buf.EncodeUint8(m.IsAdd)
1690         return buf.Bytes(), nil
1691 }
1692 func (m *SwInterfaceAddDelMacAddress) Unmarshal(b []byte) error {
1693         buf := codec.NewBuffer(b)
1694         m.SwIfIndex = buf.DecodeUint32()
1695         copy(m.Addr[:], buf.DecodeBytes(6))
1696         m.IsAdd = buf.DecodeUint8()
1697         return nil
1698 }
1699
1700 // SwInterfaceAddDelMacAddressReply defines message 'sw_interface_add_del_mac_address_reply'.
1701 type SwInterfaceAddDelMacAddressReply struct {
1702         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1703 }
1704
1705 func (m *SwInterfaceAddDelMacAddressReply) Reset() { *m = SwInterfaceAddDelMacAddressReply{} }
1706 func (*SwInterfaceAddDelMacAddressReply) GetMessageName() string {
1707         return "sw_interface_add_del_mac_address_reply"
1708 }
1709 func (*SwInterfaceAddDelMacAddressReply) GetCrcString() string { return "e8d4e804" }
1710 func (*SwInterfaceAddDelMacAddressReply) GetMessageType() api.MessageType {
1711         return api.ReplyMessage
1712 }
1713
1714 func (m *SwInterfaceAddDelMacAddressReply) Size() (size int) {
1715         if m == nil {
1716                 return 0
1717         }
1718         size += 4 // m.Retval
1719         return size
1720 }
1721 func (m *SwInterfaceAddDelMacAddressReply) Marshal(b []byte) ([]byte, error) {
1722         if b == nil {
1723                 b = make([]byte, m.Size())
1724         }
1725         buf := codec.NewBuffer(b)
1726         buf.EncodeInt32(m.Retval)
1727         return buf.Bytes(), nil
1728 }
1729 func (m *SwInterfaceAddDelMacAddressReply) Unmarshal(b []byte) error {
1730         buf := codec.NewBuffer(b)
1731         m.Retval = buf.DecodeInt32()
1732         return nil
1733 }
1734
1735 // SwInterfaceClearStats defines message 'sw_interface_clear_stats'.
1736 type SwInterfaceClearStats struct {
1737         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1738 }
1739
1740 func (m *SwInterfaceClearStats) Reset()               { *m = SwInterfaceClearStats{} }
1741 func (*SwInterfaceClearStats) GetMessageName() string { return "sw_interface_clear_stats" }
1742 func (*SwInterfaceClearStats) GetCrcString() string   { return "f9e6675e" }
1743 func (*SwInterfaceClearStats) GetMessageType() api.MessageType {
1744         return api.RequestMessage
1745 }
1746
1747 func (m *SwInterfaceClearStats) Size() (size int) {
1748         if m == nil {
1749                 return 0
1750         }
1751         size += 4 // m.SwIfIndex
1752         return size
1753 }
1754 func (m *SwInterfaceClearStats) Marshal(b []byte) ([]byte, error) {
1755         if b == nil {
1756                 b = make([]byte, m.Size())
1757         }
1758         buf := codec.NewBuffer(b)
1759         buf.EncodeUint32(uint32(m.SwIfIndex))
1760         return buf.Bytes(), nil
1761 }
1762 func (m *SwInterfaceClearStats) Unmarshal(b []byte) error {
1763         buf := codec.NewBuffer(b)
1764         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1765         return nil
1766 }
1767
1768 // SwInterfaceClearStatsReply defines message 'sw_interface_clear_stats_reply'.
1769 type SwInterfaceClearStatsReply struct {
1770         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1771 }
1772
1773 func (m *SwInterfaceClearStatsReply) Reset()               { *m = SwInterfaceClearStatsReply{} }
1774 func (*SwInterfaceClearStatsReply) GetMessageName() string { return "sw_interface_clear_stats_reply" }
1775 func (*SwInterfaceClearStatsReply) GetCrcString() string   { return "e8d4e804" }
1776 func (*SwInterfaceClearStatsReply) GetMessageType() api.MessageType {
1777         return api.ReplyMessage
1778 }
1779
1780 func (m *SwInterfaceClearStatsReply) Size() (size int) {
1781         if m == nil {
1782                 return 0
1783         }
1784         size += 4 // m.Retval
1785         return size
1786 }
1787 func (m *SwInterfaceClearStatsReply) Marshal(b []byte) ([]byte, error) {
1788         if b == nil {
1789                 b = make([]byte, m.Size())
1790         }
1791         buf := codec.NewBuffer(b)
1792         buf.EncodeInt32(m.Retval)
1793         return buf.Bytes(), nil
1794 }
1795 func (m *SwInterfaceClearStatsReply) Unmarshal(b []byte) error {
1796         buf := codec.NewBuffer(b)
1797         m.Retval = buf.DecodeInt32()
1798         return nil
1799 }
1800
1801 // SwInterfaceDetails defines message 'sw_interface_details'.
1802 type SwInterfaceDetails struct {
1803         SwIfIndex        InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1804         SupSwIfIndex     uint32         `binapi:"u32,name=sup_sw_if_index" json:"sup_sw_if_index,omitempty"`
1805         L2Address        MacAddress     `binapi:"mac_address,name=l2_address" json:"l2_address,omitempty"`
1806         Flags            IfStatusFlags  `binapi:"if_status_flags,name=flags" json:"flags,omitempty"`
1807         Type             IfType         `binapi:"if_type,name=type" json:"type,omitempty"`
1808         LinkDuplex       LinkDuplex     `binapi:"link_duplex,name=link_duplex" json:"link_duplex,omitempty"`
1809         LinkSpeed        uint32         `binapi:"u32,name=link_speed" json:"link_speed,omitempty"`
1810         LinkMtu          uint16         `binapi:"u16,name=link_mtu" json:"link_mtu,omitempty"`
1811         Mtu              []uint32       `binapi:"u32[4],name=mtu" json:"mtu,omitempty"`
1812         SubID            uint32         `binapi:"u32,name=sub_id" json:"sub_id,omitempty"`
1813         SubNumberOfTags  uint8          `binapi:"u8,name=sub_number_of_tags" json:"sub_number_of_tags,omitempty"`
1814         SubOuterVlanID   uint16         `binapi:"u16,name=sub_outer_vlan_id" json:"sub_outer_vlan_id,omitempty"`
1815         SubInnerVlanID   uint16         `binapi:"u16,name=sub_inner_vlan_id" json:"sub_inner_vlan_id,omitempty"`
1816         SubIfFlags       SubIfFlags     `binapi:"sub_if_flags,name=sub_if_flags" json:"sub_if_flags,omitempty"`
1817         VtrOp            uint32         `binapi:"u32,name=vtr_op" json:"vtr_op,omitempty"`
1818         VtrPushDot1q     uint32         `binapi:"u32,name=vtr_push_dot1q" json:"vtr_push_dot1q,omitempty"`
1819         VtrTag1          uint32         `binapi:"u32,name=vtr_tag1" json:"vtr_tag1,omitempty"`
1820         VtrTag2          uint32         `binapi:"u32,name=vtr_tag2" json:"vtr_tag2,omitempty"`
1821         OuterTag         uint16         `binapi:"u16,name=outer_tag" json:"outer_tag,omitempty"`
1822         BDmac            MacAddress     `binapi:"mac_address,name=b_dmac" json:"b_dmac,omitempty"`
1823         BSmac            MacAddress     `binapi:"mac_address,name=b_smac" json:"b_smac,omitempty"`
1824         BVlanid          uint16         `binapi:"u16,name=b_vlanid" json:"b_vlanid,omitempty"`
1825         ISid             uint32         `binapi:"u32,name=i_sid" json:"i_sid,omitempty"`
1826         InterfaceName    string         `binapi:"string[64],name=interface_name" json:"interface_name,omitempty"`
1827         InterfaceDevType string         `binapi:"string[64],name=interface_dev_type" json:"interface_dev_type,omitempty"`
1828         Tag              string         `binapi:"string[64],name=tag" json:"tag,omitempty"`
1829 }
1830
1831 func (m *SwInterfaceDetails) Reset()               { *m = SwInterfaceDetails{} }
1832 func (*SwInterfaceDetails) GetMessageName() string { return "sw_interface_details" }
1833 func (*SwInterfaceDetails) GetCrcString() string   { return "17b69fa2" }
1834 func (*SwInterfaceDetails) GetMessageType() api.MessageType {
1835         return api.ReplyMessage
1836 }
1837
1838 func (m *SwInterfaceDetails) Size() (size int) {
1839         if m == nil {
1840                 return 0
1841         }
1842         size += 4     // m.SwIfIndex
1843         size += 4     // m.SupSwIfIndex
1844         size += 1 * 6 // m.L2Address
1845         size += 4     // m.Flags
1846         size += 4     // m.Type
1847         size += 4     // m.LinkDuplex
1848         size += 4     // m.LinkSpeed
1849         size += 2     // m.LinkMtu
1850         size += 4 * 4 // m.Mtu
1851         size += 4     // m.SubID
1852         size += 1     // m.SubNumberOfTags
1853         size += 2     // m.SubOuterVlanID
1854         size += 2     // m.SubInnerVlanID
1855         size += 4     // m.SubIfFlags
1856         size += 4     // m.VtrOp
1857         size += 4     // m.VtrPushDot1q
1858         size += 4     // m.VtrTag1
1859         size += 4     // m.VtrTag2
1860         size += 2     // m.OuterTag
1861         size += 1 * 6 // m.BDmac
1862         size += 1 * 6 // m.BSmac
1863         size += 2     // m.BVlanid
1864         size += 4     // m.ISid
1865         size += 64    // m.InterfaceName
1866         size += 64    // m.InterfaceDevType
1867         size += 64    // m.Tag
1868         return size
1869 }
1870 func (m *SwInterfaceDetails) Marshal(b []byte) ([]byte, error) {
1871         if b == nil {
1872                 b = make([]byte, m.Size())
1873         }
1874         buf := codec.NewBuffer(b)
1875         buf.EncodeUint32(uint32(m.SwIfIndex))
1876         buf.EncodeUint32(m.SupSwIfIndex)
1877         buf.EncodeBytes(m.L2Address[:], 6)
1878         buf.EncodeUint32(uint32(m.Flags))
1879         buf.EncodeUint32(uint32(m.Type))
1880         buf.EncodeUint32(uint32(m.LinkDuplex))
1881         buf.EncodeUint32(m.LinkSpeed)
1882         buf.EncodeUint16(m.LinkMtu)
1883         for i := 0; i < 4; i++ {
1884                 var x uint32
1885                 if i < len(m.Mtu) {
1886                         x = uint32(m.Mtu[i])
1887                 }
1888                 buf.EncodeUint32(x)
1889         }
1890         buf.EncodeUint32(m.SubID)
1891         buf.EncodeUint8(m.SubNumberOfTags)
1892         buf.EncodeUint16(m.SubOuterVlanID)
1893         buf.EncodeUint16(m.SubInnerVlanID)
1894         buf.EncodeUint32(uint32(m.SubIfFlags))
1895         buf.EncodeUint32(m.VtrOp)
1896         buf.EncodeUint32(m.VtrPushDot1q)
1897         buf.EncodeUint32(m.VtrTag1)
1898         buf.EncodeUint32(m.VtrTag2)
1899         buf.EncodeUint16(m.OuterTag)
1900         buf.EncodeBytes(m.BDmac[:], 6)
1901         buf.EncodeBytes(m.BSmac[:], 6)
1902         buf.EncodeUint16(m.BVlanid)
1903         buf.EncodeUint32(m.ISid)
1904         buf.EncodeString(m.InterfaceName, 64)
1905         buf.EncodeString(m.InterfaceDevType, 64)
1906         buf.EncodeString(m.Tag, 64)
1907         return buf.Bytes(), nil
1908 }
1909 func (m *SwInterfaceDetails) Unmarshal(b []byte) error {
1910         buf := codec.NewBuffer(b)
1911         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1912         m.SupSwIfIndex = buf.DecodeUint32()
1913         copy(m.L2Address[:], buf.DecodeBytes(6))
1914         m.Flags = IfStatusFlags(buf.DecodeUint32())
1915         m.Type = IfType(buf.DecodeUint32())
1916         m.LinkDuplex = LinkDuplex(buf.DecodeUint32())
1917         m.LinkSpeed = buf.DecodeUint32()
1918         m.LinkMtu = buf.DecodeUint16()
1919         m.Mtu = make([]uint32, 4)
1920         for i := 0; i < len(m.Mtu); i++ {
1921                 m.Mtu[i] = buf.DecodeUint32()
1922         }
1923         m.SubID = buf.DecodeUint32()
1924         m.SubNumberOfTags = buf.DecodeUint8()
1925         m.SubOuterVlanID = buf.DecodeUint16()
1926         m.SubInnerVlanID = buf.DecodeUint16()
1927         m.SubIfFlags = SubIfFlags(buf.DecodeUint32())
1928         m.VtrOp = buf.DecodeUint32()
1929         m.VtrPushDot1q = buf.DecodeUint32()
1930         m.VtrTag1 = buf.DecodeUint32()
1931         m.VtrTag2 = buf.DecodeUint32()
1932         m.OuterTag = buf.DecodeUint16()
1933         copy(m.BDmac[:], buf.DecodeBytes(6))
1934         copy(m.BSmac[:], buf.DecodeBytes(6))
1935         m.BVlanid = buf.DecodeUint16()
1936         m.ISid = buf.DecodeUint32()
1937         m.InterfaceName = buf.DecodeString(64)
1938         m.InterfaceDevType = buf.DecodeString(64)
1939         m.Tag = buf.DecodeString(64)
1940         return nil
1941 }
1942
1943 // SwInterfaceDump defines message 'sw_interface_dump'.
1944 type SwInterfaceDump struct {
1945         SwIfIndex       InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=4294967295" json:"sw_if_index,omitempty"`
1946         NameFilterValid bool           `binapi:"bool,name=name_filter_valid" json:"name_filter_valid,omitempty"`
1947         NameFilter      string         `binapi:"string[],name=name_filter" json:"name_filter,omitempty"`
1948 }
1949
1950 func (m *SwInterfaceDump) Reset()               { *m = SwInterfaceDump{} }
1951 func (*SwInterfaceDump) GetMessageName() string { return "sw_interface_dump" }
1952 func (*SwInterfaceDump) GetCrcString() string   { return "aa610c27" }
1953 func (*SwInterfaceDump) GetMessageType() api.MessageType {
1954         return api.RequestMessage
1955 }
1956
1957 func (m *SwInterfaceDump) Size() (size int) {
1958         if m == nil {
1959                 return 0
1960         }
1961         size += 4                     // m.SwIfIndex
1962         size += 1                     // m.NameFilterValid
1963         size += 4 + len(m.NameFilter) // m.NameFilter
1964         return size
1965 }
1966 func (m *SwInterfaceDump) Marshal(b []byte) ([]byte, error) {
1967         if b == nil {
1968                 b = make([]byte, m.Size())
1969         }
1970         buf := codec.NewBuffer(b)
1971         buf.EncodeUint32(uint32(m.SwIfIndex))
1972         buf.EncodeBool(m.NameFilterValid)
1973         buf.EncodeString(m.NameFilter, 0)
1974         return buf.Bytes(), nil
1975 }
1976 func (m *SwInterfaceDump) Unmarshal(b []byte) error {
1977         buf := codec.NewBuffer(b)
1978         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1979         m.NameFilterValid = buf.DecodeBool()
1980         m.NameFilter = buf.DecodeString(0)
1981         return nil
1982 }
1983
1984 // SwInterfaceEvent defines message 'sw_interface_event'.
1985 type SwInterfaceEvent struct {
1986         PID       uint32         `binapi:"u32,name=pid" json:"pid,omitempty"`
1987         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1988         Flags     IfStatusFlags  `binapi:"if_status_flags,name=flags" json:"flags,omitempty"`
1989         Deleted   bool           `binapi:"bool,name=deleted" json:"deleted,omitempty"`
1990 }
1991
1992 func (m *SwInterfaceEvent) Reset()               { *m = SwInterfaceEvent{} }
1993 func (*SwInterfaceEvent) GetMessageName() string { return "sw_interface_event" }
1994 func (*SwInterfaceEvent) GetCrcString() string   { return "f709f78d" }
1995 func (*SwInterfaceEvent) GetMessageType() api.MessageType {
1996         return api.EventMessage
1997 }
1998
1999 func (m *SwInterfaceEvent) Size() (size int) {
2000         if m == nil {
2001                 return 0
2002         }
2003         size += 4 // m.PID
2004         size += 4 // m.SwIfIndex
2005         size += 4 // m.Flags
2006         size += 1 // m.Deleted
2007         return size
2008 }
2009 func (m *SwInterfaceEvent) Marshal(b []byte) ([]byte, error) {
2010         if b == nil {
2011                 b = make([]byte, m.Size())
2012         }
2013         buf := codec.NewBuffer(b)
2014         buf.EncodeUint32(m.PID)
2015         buf.EncodeUint32(uint32(m.SwIfIndex))
2016         buf.EncodeUint32(uint32(m.Flags))
2017         buf.EncodeBool(m.Deleted)
2018         return buf.Bytes(), nil
2019 }
2020 func (m *SwInterfaceEvent) Unmarshal(b []byte) error {
2021         buf := codec.NewBuffer(b)
2022         m.PID = buf.DecodeUint32()
2023         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2024         m.Flags = IfStatusFlags(buf.DecodeUint32())
2025         m.Deleted = buf.DecodeBool()
2026         return nil
2027 }
2028
2029 // SwInterfaceGetMacAddress defines message 'sw_interface_get_mac_address'.
2030 type SwInterfaceGetMacAddress struct {
2031         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
2032 }
2033
2034 func (m *SwInterfaceGetMacAddress) Reset()               { *m = SwInterfaceGetMacAddress{} }
2035 func (*SwInterfaceGetMacAddress) GetMessageName() string { return "sw_interface_get_mac_address" }
2036 func (*SwInterfaceGetMacAddress) GetCrcString() string   { return "f9e6675e" }
2037 func (*SwInterfaceGetMacAddress) GetMessageType() api.MessageType {
2038         return api.RequestMessage
2039 }
2040
2041 func (m *SwInterfaceGetMacAddress) Size() (size int) {
2042         if m == nil {
2043                 return 0
2044         }
2045         size += 4 // m.SwIfIndex
2046         return size
2047 }
2048 func (m *SwInterfaceGetMacAddress) Marshal(b []byte) ([]byte, error) {
2049         if b == nil {
2050                 b = make([]byte, m.Size())
2051         }
2052         buf := codec.NewBuffer(b)
2053         buf.EncodeUint32(uint32(m.SwIfIndex))
2054         return buf.Bytes(), nil
2055 }
2056 func (m *SwInterfaceGetMacAddress) Unmarshal(b []byte) error {
2057         buf := codec.NewBuffer(b)
2058         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2059         return nil
2060 }
2061
2062 // SwInterfaceGetMacAddressReply defines message 'sw_interface_get_mac_address_reply'.
2063 type SwInterfaceGetMacAddressReply struct {
2064         Retval     int32      `binapi:"i32,name=retval" json:"retval,omitempty"`
2065         MacAddress MacAddress `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
2066 }
2067
2068 func (m *SwInterfaceGetMacAddressReply) Reset() { *m = SwInterfaceGetMacAddressReply{} }
2069 func (*SwInterfaceGetMacAddressReply) GetMessageName() string {
2070         return "sw_interface_get_mac_address_reply"
2071 }
2072 func (*SwInterfaceGetMacAddressReply) GetCrcString() string { return "40ef2c08" }
2073 func (*SwInterfaceGetMacAddressReply) GetMessageType() api.MessageType {
2074         return api.ReplyMessage
2075 }
2076
2077 func (m *SwInterfaceGetMacAddressReply) Size() (size int) {
2078         if m == nil {
2079                 return 0
2080         }
2081         size += 4     // m.Retval
2082         size += 1 * 6 // m.MacAddress
2083         return size
2084 }
2085 func (m *SwInterfaceGetMacAddressReply) Marshal(b []byte) ([]byte, error) {
2086         if b == nil {
2087                 b = make([]byte, m.Size())
2088         }
2089         buf := codec.NewBuffer(b)
2090         buf.EncodeInt32(m.Retval)
2091         buf.EncodeBytes(m.MacAddress[:], 6)
2092         return buf.Bytes(), nil
2093 }
2094 func (m *SwInterfaceGetMacAddressReply) Unmarshal(b []byte) error {
2095         buf := codec.NewBuffer(b)
2096         m.Retval = buf.DecodeInt32()
2097         copy(m.MacAddress[:], buf.DecodeBytes(6))
2098         return nil
2099 }
2100
2101 // SwInterfaceGetTable defines message 'sw_interface_get_table'.
2102 type SwInterfaceGetTable struct {
2103         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
2104         IsIPv6    bool           `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
2105 }
2106
2107 func (m *SwInterfaceGetTable) Reset()               { *m = SwInterfaceGetTable{} }
2108 func (*SwInterfaceGetTable) GetMessageName() string { return "sw_interface_get_table" }
2109 func (*SwInterfaceGetTable) GetCrcString() string   { return "2d033de4" }
2110 func (*SwInterfaceGetTable) GetMessageType() api.MessageType {
2111         return api.RequestMessage
2112 }
2113
2114 func (m *SwInterfaceGetTable) Size() (size int) {
2115         if m == nil {
2116                 return 0
2117         }
2118         size += 4 // m.SwIfIndex
2119         size += 1 // m.IsIPv6
2120         return size
2121 }
2122 func (m *SwInterfaceGetTable) Marshal(b []byte) ([]byte, error) {
2123         if b == nil {
2124                 b = make([]byte, m.Size())
2125         }
2126         buf := codec.NewBuffer(b)
2127         buf.EncodeUint32(uint32(m.SwIfIndex))
2128         buf.EncodeBool(m.IsIPv6)
2129         return buf.Bytes(), nil
2130 }
2131 func (m *SwInterfaceGetTable) Unmarshal(b []byte) error {
2132         buf := codec.NewBuffer(b)
2133         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2134         m.IsIPv6 = buf.DecodeBool()
2135         return nil
2136 }
2137
2138 // SwInterfaceGetTableReply defines message 'sw_interface_get_table_reply'.
2139 type SwInterfaceGetTableReply struct {
2140         Retval int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
2141         VrfID  uint32 `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
2142 }
2143
2144 func (m *SwInterfaceGetTableReply) Reset()               { *m = SwInterfaceGetTableReply{} }
2145 func (*SwInterfaceGetTableReply) GetMessageName() string { return "sw_interface_get_table_reply" }
2146 func (*SwInterfaceGetTableReply) GetCrcString() string   { return "a6eb0109" }
2147 func (*SwInterfaceGetTableReply) GetMessageType() api.MessageType {
2148         return api.ReplyMessage
2149 }
2150
2151 func (m *SwInterfaceGetTableReply) Size() (size int) {
2152         if m == nil {
2153                 return 0
2154         }
2155         size += 4 // m.Retval
2156         size += 4 // m.VrfID
2157         return size
2158 }
2159 func (m *SwInterfaceGetTableReply) Marshal(b []byte) ([]byte, error) {
2160         if b == nil {
2161                 b = make([]byte, m.Size())
2162         }
2163         buf := codec.NewBuffer(b)
2164         buf.EncodeInt32(m.Retval)
2165         buf.EncodeUint32(m.VrfID)
2166         return buf.Bytes(), nil
2167 }
2168 func (m *SwInterfaceGetTableReply) Unmarshal(b []byte) error {
2169         buf := codec.NewBuffer(b)
2170         m.Retval = buf.DecodeInt32()
2171         m.VrfID = buf.DecodeUint32()
2172         return nil
2173 }
2174
2175 // SwInterfaceRxPlacementDetails defines message 'sw_interface_rx_placement_details'.
2176 type SwInterfaceRxPlacementDetails struct {
2177         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
2178         QueueID   uint32         `binapi:"u32,name=queue_id" json:"queue_id,omitempty"`
2179         WorkerID  uint32         `binapi:"u32,name=worker_id" json:"worker_id,omitempty"`
2180         Mode      RxMode         `binapi:"rx_mode,name=mode" json:"mode,omitempty"`
2181 }
2182
2183 func (m *SwInterfaceRxPlacementDetails) Reset() { *m = SwInterfaceRxPlacementDetails{} }
2184 func (*SwInterfaceRxPlacementDetails) GetMessageName() string {
2185         return "sw_interface_rx_placement_details"
2186 }
2187 func (*SwInterfaceRxPlacementDetails) GetCrcString() string { return "f6d7d024" }
2188 func (*SwInterfaceRxPlacementDetails) GetMessageType() api.MessageType {
2189         return api.RequestMessage
2190 }
2191
2192 func (m *SwInterfaceRxPlacementDetails) Size() (size int) {
2193         if m == nil {
2194                 return 0
2195         }
2196         size += 4 // m.SwIfIndex
2197         size += 4 // m.QueueID
2198         size += 4 // m.WorkerID
2199         size += 4 // m.Mode
2200         return size
2201 }
2202 func (m *SwInterfaceRxPlacementDetails) Marshal(b []byte) ([]byte, error) {
2203         if b == nil {
2204                 b = make([]byte, m.Size())
2205         }
2206         buf := codec.NewBuffer(b)
2207         buf.EncodeUint32(uint32(m.SwIfIndex))
2208         buf.EncodeUint32(m.QueueID)
2209         buf.EncodeUint32(m.WorkerID)
2210         buf.EncodeUint32(uint32(m.Mode))
2211         return buf.Bytes(), nil
2212 }
2213 func (m *SwInterfaceRxPlacementDetails) Unmarshal(b []byte) error {
2214         buf := codec.NewBuffer(b)
2215         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2216         m.QueueID = buf.DecodeUint32()
2217         m.WorkerID = buf.DecodeUint32()
2218         m.Mode = RxMode(buf.DecodeUint32())
2219         return nil
2220 }
2221
2222 // SwInterfaceRxPlacementDump defines message 'sw_interface_rx_placement_dump'.
2223 type SwInterfaceRxPlacementDump struct {
2224         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
2225 }
2226
2227 func (m *SwInterfaceRxPlacementDump) Reset()               { *m = SwInterfaceRxPlacementDump{} }
2228 func (*SwInterfaceRxPlacementDump) GetMessageName() string { return "sw_interface_rx_placement_dump" }
2229 func (*SwInterfaceRxPlacementDump) GetCrcString() string   { return "f9e6675e" }
2230 func (*SwInterfaceRxPlacementDump) GetMessageType() api.MessageType {
2231         return api.RequestMessage
2232 }
2233
2234 func (m *SwInterfaceRxPlacementDump) Size() (size int) {
2235         if m == nil {
2236                 return 0
2237         }
2238         size += 4 // m.SwIfIndex
2239         return size
2240 }
2241 func (m *SwInterfaceRxPlacementDump) Marshal(b []byte) ([]byte, error) {
2242         if b == nil {
2243                 b = make([]byte, m.Size())
2244         }
2245         buf := codec.NewBuffer(b)
2246         buf.EncodeUint32(uint32(m.SwIfIndex))
2247         return buf.Bytes(), nil
2248 }
2249 func (m *SwInterfaceRxPlacementDump) Unmarshal(b []byte) error {
2250         buf := codec.NewBuffer(b)
2251         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2252         return nil
2253 }
2254
2255 // SwInterfaceSetFlags defines message 'sw_interface_set_flags'.
2256 type SwInterfaceSetFlags struct {
2257         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
2258         Flags     IfStatusFlags  `binapi:"if_status_flags,name=flags" json:"flags,omitempty"`
2259 }
2260
2261 func (m *SwInterfaceSetFlags) Reset()               { *m = SwInterfaceSetFlags{} }
2262 func (*SwInterfaceSetFlags) GetMessageName() string { return "sw_interface_set_flags" }
2263 func (*SwInterfaceSetFlags) GetCrcString() string   { return "6a2b491a" }
2264 func (*SwInterfaceSetFlags) GetMessageType() api.MessageType {
2265         return api.RequestMessage
2266 }
2267
2268 func (m *SwInterfaceSetFlags) Size() (size int) {
2269         if m == nil {
2270                 return 0
2271         }
2272         size += 4 // m.SwIfIndex
2273         size += 4 // m.Flags
2274         return size
2275 }
2276 func (m *SwInterfaceSetFlags) Marshal(b []byte) ([]byte, error) {
2277         if b == nil {
2278                 b = make([]byte, m.Size())
2279         }
2280         buf := codec.NewBuffer(b)
2281         buf.EncodeUint32(uint32(m.SwIfIndex))
2282         buf.EncodeUint32(uint32(m.Flags))
2283         return buf.Bytes(), nil
2284 }
2285 func (m *SwInterfaceSetFlags) Unmarshal(b []byte) error {
2286         buf := codec.NewBuffer(b)
2287         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2288         m.Flags = IfStatusFlags(buf.DecodeUint32())
2289         return nil
2290 }
2291
2292 // SwInterfaceSetFlagsReply defines message 'sw_interface_set_flags_reply'.
2293 type SwInterfaceSetFlagsReply struct {
2294         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2295 }
2296
2297 func (m *SwInterfaceSetFlagsReply) Reset()               { *m = SwInterfaceSetFlagsReply{} }
2298 func (*SwInterfaceSetFlagsReply) GetMessageName() string { return "sw_interface_set_flags_reply" }
2299 func (*SwInterfaceSetFlagsReply) GetCrcString() string   { return "e8d4e804" }
2300 func (*SwInterfaceSetFlagsReply) GetMessageType() api.MessageType {
2301         return api.ReplyMessage
2302 }
2303
2304 func (m *SwInterfaceSetFlagsReply) Size() (size int) {
2305         if m == nil {
2306                 return 0
2307         }
2308         size += 4 // m.Retval
2309         return size
2310 }
2311 func (m *SwInterfaceSetFlagsReply) Marshal(b []byte) ([]byte, error) {
2312         if b == nil {
2313                 b = make([]byte, m.Size())
2314         }
2315         buf := codec.NewBuffer(b)
2316         buf.EncodeInt32(m.Retval)
2317         return buf.Bytes(), nil
2318 }
2319 func (m *SwInterfaceSetFlagsReply) Unmarshal(b []byte) error {
2320         buf := codec.NewBuffer(b)
2321         m.Retval = buf.DecodeInt32()
2322         return nil
2323 }
2324
2325 // SwInterfaceSetIPDirectedBroadcast defines message 'sw_interface_set_ip_directed_broadcast'.
2326 type SwInterfaceSetIPDirectedBroadcast struct {
2327         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
2328         Enable    bool           `binapi:"bool,name=enable" json:"enable,omitempty"`
2329 }
2330
2331 func (m *SwInterfaceSetIPDirectedBroadcast) Reset() { *m = SwInterfaceSetIPDirectedBroadcast{} }
2332 func (*SwInterfaceSetIPDirectedBroadcast) GetMessageName() string {
2333         return "sw_interface_set_ip_directed_broadcast"
2334 }
2335 func (*SwInterfaceSetIPDirectedBroadcast) GetCrcString() string { return "ae6cfcfb" }
2336 func (*SwInterfaceSetIPDirectedBroadcast) GetMessageType() api.MessageType {
2337         return api.RequestMessage
2338 }
2339
2340 func (m *SwInterfaceSetIPDirectedBroadcast) Size() (size int) {
2341         if m == nil {
2342                 return 0
2343         }
2344         size += 4 // m.SwIfIndex
2345         size += 1 // m.Enable
2346         return size
2347 }
2348 func (m *SwInterfaceSetIPDirectedBroadcast) Marshal(b []byte) ([]byte, error) {
2349         if b == nil {
2350                 b = make([]byte, m.Size())
2351         }
2352         buf := codec.NewBuffer(b)
2353         buf.EncodeUint32(uint32(m.SwIfIndex))
2354         buf.EncodeBool(m.Enable)
2355         return buf.Bytes(), nil
2356 }
2357 func (m *SwInterfaceSetIPDirectedBroadcast) Unmarshal(b []byte) error {
2358         buf := codec.NewBuffer(b)
2359         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2360         m.Enable = buf.DecodeBool()
2361         return nil
2362 }
2363
2364 // SwInterfaceSetIPDirectedBroadcastReply defines message 'sw_interface_set_ip_directed_broadcast_reply'.
2365 type SwInterfaceSetIPDirectedBroadcastReply struct {
2366         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2367 }
2368
2369 func (m *SwInterfaceSetIPDirectedBroadcastReply) Reset() {
2370         *m = SwInterfaceSetIPDirectedBroadcastReply{}
2371 }
2372 func (*SwInterfaceSetIPDirectedBroadcastReply) GetMessageName() string {
2373         return "sw_interface_set_ip_directed_broadcast_reply"
2374 }
2375 func (*SwInterfaceSetIPDirectedBroadcastReply) GetCrcString() string { return "e8d4e804" }
2376 func (*SwInterfaceSetIPDirectedBroadcastReply) GetMessageType() api.MessageType {
2377         return api.ReplyMessage
2378 }
2379
2380 func (m *SwInterfaceSetIPDirectedBroadcastReply) Size() (size int) {
2381         if m == nil {
2382                 return 0
2383         }
2384         size += 4 // m.Retval
2385         return size
2386 }
2387 func (m *SwInterfaceSetIPDirectedBroadcastReply) Marshal(b []byte) ([]byte, error) {
2388         if b == nil {
2389                 b = make([]byte, m.Size())
2390         }
2391         buf := codec.NewBuffer(b)
2392         buf.EncodeInt32(m.Retval)
2393         return buf.Bytes(), nil
2394 }
2395 func (m *SwInterfaceSetIPDirectedBroadcastReply) Unmarshal(b []byte) error {
2396         buf := codec.NewBuffer(b)
2397         m.Retval = buf.DecodeInt32()
2398         return nil
2399 }
2400
2401 // SwInterfaceSetMacAddress defines message 'sw_interface_set_mac_address'.
2402 type SwInterfaceSetMacAddress struct {
2403         SwIfIndex  InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
2404         MacAddress MacAddress     `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
2405 }
2406
2407 func (m *SwInterfaceSetMacAddress) Reset()               { *m = SwInterfaceSetMacAddress{} }
2408 func (*SwInterfaceSetMacAddress) GetMessageName() string { return "sw_interface_set_mac_address" }
2409 func (*SwInterfaceSetMacAddress) GetCrcString() string   { return "6aca746a" }
2410 func (*SwInterfaceSetMacAddress) GetMessageType() api.MessageType {
2411         return api.RequestMessage
2412 }
2413
2414 func (m *SwInterfaceSetMacAddress) Size() (size int) {
2415         if m == nil {
2416                 return 0
2417         }
2418         size += 4     // m.SwIfIndex
2419         size += 1 * 6 // m.MacAddress
2420         return size
2421 }
2422 func (m *SwInterfaceSetMacAddress) Marshal(b []byte) ([]byte, error) {
2423         if b == nil {
2424                 b = make([]byte, m.Size())
2425         }
2426         buf := codec.NewBuffer(b)
2427         buf.EncodeUint32(uint32(m.SwIfIndex))
2428         buf.EncodeBytes(m.MacAddress[:], 6)
2429         return buf.Bytes(), nil
2430 }
2431 func (m *SwInterfaceSetMacAddress) Unmarshal(b []byte) error {
2432         buf := codec.NewBuffer(b)
2433         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2434         copy(m.MacAddress[:], buf.DecodeBytes(6))
2435         return nil
2436 }
2437
2438 // SwInterfaceSetMacAddressReply defines message 'sw_interface_set_mac_address_reply'.
2439 type SwInterfaceSetMacAddressReply struct {
2440         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2441 }
2442
2443 func (m *SwInterfaceSetMacAddressReply) Reset() { *m = SwInterfaceSetMacAddressReply{} }
2444 func (*SwInterfaceSetMacAddressReply) GetMessageName() string {
2445         return "sw_interface_set_mac_address_reply"
2446 }
2447 func (*SwInterfaceSetMacAddressReply) GetCrcString() string { return "e8d4e804" }
2448 func (*SwInterfaceSetMacAddressReply) GetMessageType() api.MessageType {
2449         return api.ReplyMessage
2450 }
2451
2452 func (m *SwInterfaceSetMacAddressReply) Size() (size int) {
2453         if m == nil {
2454                 return 0
2455         }
2456         size += 4 // m.Retval
2457         return size
2458 }
2459 func (m *SwInterfaceSetMacAddressReply) Marshal(b []byte) ([]byte, error) {
2460         if b == nil {
2461                 b = make([]byte, m.Size())
2462         }
2463         buf := codec.NewBuffer(b)
2464         buf.EncodeInt32(m.Retval)
2465         return buf.Bytes(), nil
2466 }
2467 func (m *SwInterfaceSetMacAddressReply) Unmarshal(b []byte) error {
2468         buf := codec.NewBuffer(b)
2469         m.Retval = buf.DecodeInt32()
2470         return nil
2471 }
2472
2473 // SwInterfaceSetMtu defines message 'sw_interface_set_mtu'.
2474 type SwInterfaceSetMtu struct {
2475         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
2476         Mtu       []uint32       `binapi:"u32[4],name=mtu" json:"mtu,omitempty"`
2477 }
2478
2479 func (m *SwInterfaceSetMtu) Reset()               { *m = SwInterfaceSetMtu{} }
2480 func (*SwInterfaceSetMtu) GetMessageName() string { return "sw_interface_set_mtu" }
2481 func (*SwInterfaceSetMtu) GetCrcString() string   { return "5cbe85e5" }
2482 func (*SwInterfaceSetMtu) GetMessageType() api.MessageType {
2483         return api.RequestMessage
2484 }
2485
2486 func (m *SwInterfaceSetMtu) Size() (size int) {
2487         if m == nil {
2488                 return 0
2489         }
2490         size += 4     // m.SwIfIndex
2491         size += 4 * 4 // m.Mtu
2492         return size
2493 }
2494 func (m *SwInterfaceSetMtu) Marshal(b []byte) ([]byte, error) {
2495         if b == nil {
2496                 b = make([]byte, m.Size())
2497         }
2498         buf := codec.NewBuffer(b)
2499         buf.EncodeUint32(uint32(m.SwIfIndex))
2500         for i := 0; i < 4; i++ {
2501                 var x uint32
2502                 if i < len(m.Mtu) {
2503                         x = uint32(m.Mtu[i])
2504                 }
2505                 buf.EncodeUint32(x)
2506         }
2507         return buf.Bytes(), nil
2508 }
2509 func (m *SwInterfaceSetMtu) Unmarshal(b []byte) error {
2510         buf := codec.NewBuffer(b)
2511         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2512         m.Mtu = make([]uint32, 4)
2513         for i := 0; i < len(m.Mtu); i++ {
2514                 m.Mtu[i] = buf.DecodeUint32()
2515         }
2516         return nil
2517 }
2518
2519 // SwInterfaceSetMtuReply defines message 'sw_interface_set_mtu_reply'.
2520 type SwInterfaceSetMtuReply struct {
2521         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2522 }
2523
2524 func (m *SwInterfaceSetMtuReply) Reset()               { *m = SwInterfaceSetMtuReply{} }
2525 func (*SwInterfaceSetMtuReply) GetMessageName() string { return "sw_interface_set_mtu_reply" }
2526 func (*SwInterfaceSetMtuReply) GetCrcString() string   { return "e8d4e804" }
2527 func (*SwInterfaceSetMtuReply) GetMessageType() api.MessageType {
2528         return api.ReplyMessage
2529 }
2530
2531 func (m *SwInterfaceSetMtuReply) Size() (size int) {
2532         if m == nil {
2533                 return 0
2534         }
2535         size += 4 // m.Retval
2536         return size
2537 }
2538 func (m *SwInterfaceSetMtuReply) Marshal(b []byte) ([]byte, error) {
2539         if b == nil {
2540                 b = make([]byte, m.Size())
2541         }
2542         buf := codec.NewBuffer(b)
2543         buf.EncodeInt32(m.Retval)
2544         return buf.Bytes(), nil
2545 }
2546 func (m *SwInterfaceSetMtuReply) Unmarshal(b []byte) error {
2547         buf := codec.NewBuffer(b)
2548         m.Retval = buf.DecodeInt32()
2549         return nil
2550 }
2551
2552 // SwInterfaceSetRxMode defines message 'sw_interface_set_rx_mode'.
2553 type SwInterfaceSetRxMode struct {
2554         SwIfIndex    InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
2555         QueueIDValid bool           `binapi:"bool,name=queue_id_valid" json:"queue_id_valid,omitempty"`
2556         QueueID      uint32         `binapi:"u32,name=queue_id" json:"queue_id,omitempty"`
2557         Mode         RxMode         `binapi:"rx_mode,name=mode" json:"mode,omitempty"`
2558 }
2559
2560 func (m *SwInterfaceSetRxMode) Reset()               { *m = SwInterfaceSetRxMode{} }
2561 func (*SwInterfaceSetRxMode) GetMessageName() string { return "sw_interface_set_rx_mode" }
2562 func (*SwInterfaceSetRxMode) GetCrcString() string   { return "780f5cee" }
2563 func (*SwInterfaceSetRxMode) GetMessageType() api.MessageType {
2564         return api.RequestMessage
2565 }
2566
2567 func (m *SwInterfaceSetRxMode) Size() (size int) {
2568         if m == nil {
2569                 return 0
2570         }
2571         size += 4 // m.SwIfIndex
2572         size += 1 // m.QueueIDValid
2573         size += 4 // m.QueueID
2574         size += 4 // m.Mode
2575         return size
2576 }
2577 func (m *SwInterfaceSetRxMode) Marshal(b []byte) ([]byte, error) {
2578         if b == nil {
2579                 b = make([]byte, m.Size())
2580         }
2581         buf := codec.NewBuffer(b)
2582         buf.EncodeUint32(uint32(m.SwIfIndex))
2583         buf.EncodeBool(m.QueueIDValid)
2584         buf.EncodeUint32(m.QueueID)
2585         buf.EncodeUint32(uint32(m.Mode))
2586         return buf.Bytes(), nil
2587 }
2588 func (m *SwInterfaceSetRxMode) Unmarshal(b []byte) error {
2589         buf := codec.NewBuffer(b)
2590         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2591         m.QueueIDValid = buf.DecodeBool()
2592         m.QueueID = buf.DecodeUint32()
2593         m.Mode = RxMode(buf.DecodeUint32())
2594         return nil
2595 }
2596
2597 // SwInterfaceSetRxModeReply defines message 'sw_interface_set_rx_mode_reply'.
2598 type SwInterfaceSetRxModeReply struct {
2599         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2600 }
2601
2602 func (m *SwInterfaceSetRxModeReply) Reset()               { *m = SwInterfaceSetRxModeReply{} }
2603 func (*SwInterfaceSetRxModeReply) GetMessageName() string { return "sw_interface_set_rx_mode_reply" }
2604 func (*SwInterfaceSetRxModeReply) GetCrcString() string   { return "e8d4e804" }
2605 func (*SwInterfaceSetRxModeReply) GetMessageType() api.MessageType {
2606         return api.ReplyMessage
2607 }
2608
2609 func (m *SwInterfaceSetRxModeReply) Size() (size int) {
2610         if m == nil {
2611                 return 0
2612         }
2613         size += 4 // m.Retval
2614         return size
2615 }
2616 func (m *SwInterfaceSetRxModeReply) Marshal(b []byte) ([]byte, error) {
2617         if b == nil {
2618                 b = make([]byte, m.Size())
2619         }
2620         buf := codec.NewBuffer(b)
2621         buf.EncodeInt32(m.Retval)
2622         return buf.Bytes(), nil
2623 }
2624 func (m *SwInterfaceSetRxModeReply) Unmarshal(b []byte) error {
2625         buf := codec.NewBuffer(b)
2626         m.Retval = buf.DecodeInt32()
2627         return nil
2628 }
2629
2630 // SwInterfaceSetRxPlacement defines message 'sw_interface_set_rx_placement'.
2631 type SwInterfaceSetRxPlacement struct {
2632         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
2633         QueueID   uint32         `binapi:"u32,name=queue_id" json:"queue_id,omitempty"`
2634         WorkerID  uint32         `binapi:"u32,name=worker_id" json:"worker_id,omitempty"`
2635         IsMain    bool           `binapi:"bool,name=is_main" json:"is_main,omitempty"`
2636 }
2637
2638 func (m *SwInterfaceSetRxPlacement) Reset()               { *m = SwInterfaceSetRxPlacement{} }
2639 func (*SwInterfaceSetRxPlacement) GetMessageName() string { return "sw_interface_set_rx_placement" }
2640 func (*SwInterfaceSetRxPlacement) GetCrcString() string   { return "db65f3c9" }
2641 func (*SwInterfaceSetRxPlacement) GetMessageType() api.MessageType {
2642         return api.RequestMessage
2643 }
2644
2645 func (m *SwInterfaceSetRxPlacement) Size() (size int) {
2646         if m == nil {
2647                 return 0
2648         }
2649         size += 4 // m.SwIfIndex
2650         size += 4 // m.QueueID
2651         size += 4 // m.WorkerID
2652         size += 1 // m.IsMain
2653         return size
2654 }
2655 func (m *SwInterfaceSetRxPlacement) Marshal(b []byte) ([]byte, error) {
2656         if b == nil {
2657                 b = make([]byte, m.Size())
2658         }
2659         buf := codec.NewBuffer(b)
2660         buf.EncodeUint32(uint32(m.SwIfIndex))
2661         buf.EncodeUint32(m.QueueID)
2662         buf.EncodeUint32(m.WorkerID)
2663         buf.EncodeBool(m.IsMain)
2664         return buf.Bytes(), nil
2665 }
2666 func (m *SwInterfaceSetRxPlacement) Unmarshal(b []byte) error {
2667         buf := codec.NewBuffer(b)
2668         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2669         m.QueueID = buf.DecodeUint32()
2670         m.WorkerID = buf.DecodeUint32()
2671         m.IsMain = buf.DecodeBool()
2672         return nil
2673 }
2674
2675 // SwInterfaceSetRxPlacementReply defines message 'sw_interface_set_rx_placement_reply'.
2676 type SwInterfaceSetRxPlacementReply struct {
2677         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2678 }
2679
2680 func (m *SwInterfaceSetRxPlacementReply) Reset() { *m = SwInterfaceSetRxPlacementReply{} }
2681 func (*SwInterfaceSetRxPlacementReply) GetMessageName() string {
2682         return "sw_interface_set_rx_placement_reply"
2683 }
2684 func (*SwInterfaceSetRxPlacementReply) GetCrcString() string { return "e8d4e804" }
2685 func (*SwInterfaceSetRxPlacementReply) GetMessageType() api.MessageType {
2686         return api.ReplyMessage
2687 }
2688
2689 func (m *SwInterfaceSetRxPlacementReply) Size() (size int) {
2690         if m == nil {
2691                 return 0
2692         }
2693         size += 4 // m.Retval
2694         return size
2695 }
2696 func (m *SwInterfaceSetRxPlacementReply) Marshal(b []byte) ([]byte, error) {
2697         if b == nil {
2698                 b = make([]byte, m.Size())
2699         }
2700         buf := codec.NewBuffer(b)
2701         buf.EncodeInt32(m.Retval)
2702         return buf.Bytes(), nil
2703 }
2704 func (m *SwInterfaceSetRxPlacementReply) Unmarshal(b []byte) error {
2705         buf := codec.NewBuffer(b)
2706         m.Retval = buf.DecodeInt32()
2707         return nil
2708 }
2709
2710 // SwInterfaceSetTable defines message 'sw_interface_set_table'.
2711 type SwInterfaceSetTable struct {
2712         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
2713         IsIPv6    bool           `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
2714         VrfID     uint32         `binapi:"u32,name=vrf_id" json:"vrf_id,omitempty"`
2715 }
2716
2717 func (m *SwInterfaceSetTable) Reset()               { *m = SwInterfaceSetTable{} }
2718 func (*SwInterfaceSetTable) GetMessageName() string { return "sw_interface_set_table" }
2719 func (*SwInterfaceSetTable) GetCrcString() string   { return "df42a577" }
2720 func (*SwInterfaceSetTable) GetMessageType() api.MessageType {
2721         return api.RequestMessage
2722 }
2723
2724 func (m *SwInterfaceSetTable) Size() (size int) {
2725         if m == nil {
2726                 return 0
2727         }
2728         size += 4 // m.SwIfIndex
2729         size += 1 // m.IsIPv6
2730         size += 4 // m.VrfID
2731         return size
2732 }
2733 func (m *SwInterfaceSetTable) Marshal(b []byte) ([]byte, error) {
2734         if b == nil {
2735                 b = make([]byte, m.Size())
2736         }
2737         buf := codec.NewBuffer(b)
2738         buf.EncodeUint32(uint32(m.SwIfIndex))
2739         buf.EncodeBool(m.IsIPv6)
2740         buf.EncodeUint32(m.VrfID)
2741         return buf.Bytes(), nil
2742 }
2743 func (m *SwInterfaceSetTable) Unmarshal(b []byte) error {
2744         buf := codec.NewBuffer(b)
2745         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2746         m.IsIPv6 = buf.DecodeBool()
2747         m.VrfID = buf.DecodeUint32()
2748         return nil
2749 }
2750
2751 // SwInterfaceSetTableReply defines message 'sw_interface_set_table_reply'.
2752 type SwInterfaceSetTableReply struct {
2753         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2754 }
2755
2756 func (m *SwInterfaceSetTableReply) Reset()               { *m = SwInterfaceSetTableReply{} }
2757 func (*SwInterfaceSetTableReply) GetMessageName() string { return "sw_interface_set_table_reply" }
2758 func (*SwInterfaceSetTableReply) GetCrcString() string   { return "e8d4e804" }
2759 func (*SwInterfaceSetTableReply) GetMessageType() api.MessageType {
2760         return api.ReplyMessage
2761 }
2762
2763 func (m *SwInterfaceSetTableReply) Size() (size int) {
2764         if m == nil {
2765                 return 0
2766         }
2767         size += 4 // m.Retval
2768         return size
2769 }
2770 func (m *SwInterfaceSetTableReply) Marshal(b []byte) ([]byte, error) {
2771         if b == nil {
2772                 b = make([]byte, m.Size())
2773         }
2774         buf := codec.NewBuffer(b)
2775         buf.EncodeInt32(m.Retval)
2776         return buf.Bytes(), nil
2777 }
2778 func (m *SwInterfaceSetTableReply) Unmarshal(b []byte) error {
2779         buf := codec.NewBuffer(b)
2780         m.Retval = buf.DecodeInt32()
2781         return nil
2782 }
2783
2784 // SwInterfaceSetUnnumbered defines message 'sw_interface_set_unnumbered'.
2785 type SwInterfaceSetUnnumbered struct {
2786         SwIfIndex           InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
2787         UnnumberedSwIfIndex InterfaceIndex `binapi:"interface_index,name=unnumbered_sw_if_index" json:"unnumbered_sw_if_index,omitempty"`
2788         IsAdd               bool           `binapi:"bool,name=is_add" json:"is_add,omitempty"`
2789 }
2790
2791 func (m *SwInterfaceSetUnnumbered) Reset()               { *m = SwInterfaceSetUnnumbered{} }
2792 func (*SwInterfaceSetUnnumbered) GetMessageName() string { return "sw_interface_set_unnumbered" }
2793 func (*SwInterfaceSetUnnumbered) GetCrcString() string   { return "938ef33b" }
2794 func (*SwInterfaceSetUnnumbered) GetMessageType() api.MessageType {
2795         return api.RequestMessage
2796 }
2797
2798 func (m *SwInterfaceSetUnnumbered) Size() (size int) {
2799         if m == nil {
2800                 return 0
2801         }
2802         size += 4 // m.SwIfIndex
2803         size += 4 // m.UnnumberedSwIfIndex
2804         size += 1 // m.IsAdd
2805         return size
2806 }
2807 func (m *SwInterfaceSetUnnumbered) Marshal(b []byte) ([]byte, error) {
2808         if b == nil {
2809                 b = make([]byte, m.Size())
2810         }
2811         buf := codec.NewBuffer(b)
2812         buf.EncodeUint32(uint32(m.SwIfIndex))
2813         buf.EncodeUint32(uint32(m.UnnumberedSwIfIndex))
2814         buf.EncodeBool(m.IsAdd)
2815         return buf.Bytes(), nil
2816 }
2817 func (m *SwInterfaceSetUnnumbered) Unmarshal(b []byte) error {
2818         buf := codec.NewBuffer(b)
2819         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2820         m.UnnumberedSwIfIndex = InterfaceIndex(buf.DecodeUint32())
2821         m.IsAdd = buf.DecodeBool()
2822         return nil
2823 }
2824
2825 // SwInterfaceSetUnnumberedReply defines message 'sw_interface_set_unnumbered_reply'.
2826 type SwInterfaceSetUnnumberedReply struct {
2827         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2828 }
2829
2830 func (m *SwInterfaceSetUnnumberedReply) Reset() { *m = SwInterfaceSetUnnumberedReply{} }
2831 func (*SwInterfaceSetUnnumberedReply) GetMessageName() string {
2832         return "sw_interface_set_unnumbered_reply"
2833 }
2834 func (*SwInterfaceSetUnnumberedReply) GetCrcString() string { return "e8d4e804" }
2835 func (*SwInterfaceSetUnnumberedReply) GetMessageType() api.MessageType {
2836         return api.ReplyMessage
2837 }
2838
2839 func (m *SwInterfaceSetUnnumberedReply) Size() (size int) {
2840         if m == nil {
2841                 return 0
2842         }
2843         size += 4 // m.Retval
2844         return size
2845 }
2846 func (m *SwInterfaceSetUnnumberedReply) Marshal(b []byte) ([]byte, error) {
2847         if b == nil {
2848                 b = make([]byte, m.Size())
2849         }
2850         buf := codec.NewBuffer(b)
2851         buf.EncodeInt32(m.Retval)
2852         return buf.Bytes(), nil
2853 }
2854 func (m *SwInterfaceSetUnnumberedReply) Unmarshal(b []byte) error {
2855         buf := codec.NewBuffer(b)
2856         m.Retval = buf.DecodeInt32()
2857         return nil
2858 }
2859
2860 // SwInterfaceTagAddDel defines message 'sw_interface_tag_add_del'.
2861 type SwInterfaceTagAddDel struct {
2862         IsAdd     bool           `binapi:"bool,name=is_add" json:"is_add,omitempty"`
2863         SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
2864         Tag       string         `binapi:"string[64],name=tag" json:"tag,omitempty"`
2865 }
2866
2867 func (m *SwInterfaceTagAddDel) Reset()               { *m = SwInterfaceTagAddDel{} }
2868 func (*SwInterfaceTagAddDel) GetMessageName() string { return "sw_interface_tag_add_del" }
2869 func (*SwInterfaceTagAddDel) GetCrcString() string   { return "426f8bc1" }
2870 func (*SwInterfaceTagAddDel) GetMessageType() api.MessageType {
2871         return api.RequestMessage
2872 }
2873
2874 func (m *SwInterfaceTagAddDel) Size() (size int) {
2875         if m == nil {
2876                 return 0
2877         }
2878         size += 1  // m.IsAdd
2879         size += 4  // m.SwIfIndex
2880         size += 64 // m.Tag
2881         return size
2882 }
2883 func (m *SwInterfaceTagAddDel) Marshal(b []byte) ([]byte, error) {
2884         if b == nil {
2885                 b = make([]byte, m.Size())
2886         }
2887         buf := codec.NewBuffer(b)
2888         buf.EncodeBool(m.IsAdd)
2889         buf.EncodeUint32(uint32(m.SwIfIndex))
2890         buf.EncodeString(m.Tag, 64)
2891         return buf.Bytes(), nil
2892 }
2893 func (m *SwInterfaceTagAddDel) Unmarshal(b []byte) error {
2894         buf := codec.NewBuffer(b)
2895         m.IsAdd = buf.DecodeBool()
2896         m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2897         m.Tag = buf.DecodeString(64)
2898         return nil
2899 }
2900
2901 // SwInterfaceTagAddDelReply defines message 'sw_interface_tag_add_del_reply'.
2902 type SwInterfaceTagAddDelReply struct {
2903         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2904 }
2905
2906 func (m *SwInterfaceTagAddDelReply) Reset()               { *m = SwInterfaceTagAddDelReply{} }
2907 func (*SwInterfaceTagAddDelReply) GetMessageName() string { return "sw_interface_tag_add_del_reply" }
2908 func (*SwInterfaceTagAddDelReply) GetCrcString() string   { return "e8d4e804" }
2909 func (*SwInterfaceTagAddDelReply) GetMessageType() api.MessageType {
2910         return api.ReplyMessage
2911 }
2912
2913 func (m *SwInterfaceTagAddDelReply) Size() (size int) {
2914         if m == nil {
2915                 return 0
2916         }
2917         size += 4 // m.Retval
2918         return size
2919 }
2920 func (m *SwInterfaceTagAddDelReply) Marshal(b []byte) ([]byte, error) {
2921         if b == nil {
2922                 b = make([]byte, m.Size())
2923         }
2924         buf := codec.NewBuffer(b)
2925         buf.EncodeInt32(m.Retval)
2926         return buf.Bytes(), nil
2927 }
2928 func (m *SwInterfaceTagAddDelReply) Unmarshal(b []byte) error {
2929         buf := codec.NewBuffer(b)
2930         m.Retval = buf.DecodeInt32()
2931         return nil
2932 }
2933
2934 // WantInterfaceEvents defines message 'want_interface_events'.
2935 type WantInterfaceEvents struct {
2936         EnableDisable uint32 `binapi:"u32,name=enable_disable" json:"enable_disable,omitempty"`
2937         PID           uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
2938 }
2939
2940 func (m *WantInterfaceEvents) Reset()               { *m = WantInterfaceEvents{} }
2941 func (*WantInterfaceEvents) GetMessageName() string { return "want_interface_events" }
2942 func (*WantInterfaceEvents) GetCrcString() string   { return "476f5a08" }
2943 func (*WantInterfaceEvents) GetMessageType() api.MessageType {
2944         return api.RequestMessage
2945 }
2946
2947 func (m *WantInterfaceEvents) Size() (size int) {
2948         if m == nil {
2949                 return 0
2950         }
2951         size += 4 // m.EnableDisable
2952         size += 4 // m.PID
2953         return size
2954 }
2955 func (m *WantInterfaceEvents) Marshal(b []byte) ([]byte, error) {
2956         if b == nil {
2957                 b = make([]byte, m.Size())
2958         }
2959         buf := codec.NewBuffer(b)
2960         buf.EncodeUint32(m.EnableDisable)
2961         buf.EncodeUint32(m.PID)
2962         return buf.Bytes(), nil
2963 }
2964 func (m *WantInterfaceEvents) Unmarshal(b []byte) error {
2965         buf := codec.NewBuffer(b)
2966         m.EnableDisable = buf.DecodeUint32()
2967         m.PID = buf.DecodeUint32()
2968         return nil
2969 }
2970
2971 // WantInterfaceEventsReply defines message 'want_interface_events_reply'.
2972 type WantInterfaceEventsReply struct {
2973         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2974 }
2975
2976 func (m *WantInterfaceEventsReply) Reset()               { *m = WantInterfaceEventsReply{} }
2977 func (*WantInterfaceEventsReply) GetMessageName() string { return "want_interface_events_reply" }
2978 func (*WantInterfaceEventsReply) GetCrcString() string   { return "e8d4e804" }
2979 func (*WantInterfaceEventsReply) GetMessageType() api.MessageType {
2980         return api.ReplyMessage
2981 }
2982
2983 func (m *WantInterfaceEventsReply) Size() (size int) {
2984         if m == nil {
2985                 return 0
2986         }
2987         size += 4 // m.Retval
2988         return size
2989 }
2990 func (m *WantInterfaceEventsReply) Marshal(b []byte) ([]byte, error) {
2991         if b == nil {
2992                 b = make([]byte, m.Size())
2993         }
2994         buf := codec.NewBuffer(b)
2995         buf.EncodeInt32(m.Retval)
2996         return buf.Bytes(), nil
2997 }
2998 func (m *WantInterfaceEventsReply) Unmarshal(b []byte) error {
2999         buf := codec.NewBuffer(b)
3000         m.Retval = buf.DecodeInt32()
3001         return nil
3002 }
3003
3004 func init() { file_interfaces_binapi_init() }
3005 func file_interfaces_binapi_init() {
3006         api.RegisterMessage((*CollectDetailedInterfaceStats)(nil), "collect_detailed_interface_stats_5501adee")
3007         api.RegisterMessage((*CollectDetailedInterfaceStatsReply)(nil), "collect_detailed_interface_stats_reply_e8d4e804")
3008         api.RegisterMessage((*CreateLoopback)(nil), "create_loopback_42bb5d22")
3009         api.RegisterMessage((*CreateLoopbackInstance)(nil), "create_loopback_instance_d36a3ee2")
3010         api.RegisterMessage((*CreateLoopbackInstanceReply)(nil), "create_loopback_instance_reply_5383d31f")
3011         api.RegisterMessage((*CreateLoopbackReply)(nil), "create_loopback_reply_5383d31f")
3012         api.RegisterMessage((*CreateSubif)(nil), "create_subif_cb371063")
3013         api.RegisterMessage((*CreateSubifReply)(nil), "create_subif_reply_5383d31f")
3014         api.RegisterMessage((*CreateVlanSubif)(nil), "create_vlan_subif_af34ac8b")
3015         api.RegisterMessage((*CreateVlanSubifReply)(nil), "create_vlan_subif_reply_5383d31f")
3016         api.RegisterMessage((*DeleteLoopback)(nil), "delete_loopback_f9e6675e")
3017         api.RegisterMessage((*DeleteLoopbackReply)(nil), "delete_loopback_reply_e8d4e804")
3018         api.RegisterMessage((*DeleteSubif)(nil), "delete_subif_f9e6675e")
3019         api.RegisterMessage((*DeleteSubifReply)(nil), "delete_subif_reply_e8d4e804")
3020         api.RegisterMessage((*HwInterfaceSetMtu)(nil), "hw_interface_set_mtu_e6746899")
3021         api.RegisterMessage((*HwInterfaceSetMtuReply)(nil), "hw_interface_set_mtu_reply_e8d4e804")
3022         api.RegisterMessage((*InterfaceNameRenumber)(nil), "interface_name_renumber_2b8858b8")
3023         api.RegisterMessage((*InterfaceNameRenumberReply)(nil), "interface_name_renumber_reply_e8d4e804")
3024         api.RegisterMessage((*SwInterfaceAddDelAddress)(nil), "sw_interface_add_del_address_5803d5c4")
3025         api.RegisterMessage((*SwInterfaceAddDelAddressReply)(nil), "sw_interface_add_del_address_reply_e8d4e804")
3026         api.RegisterMessage((*SwInterfaceAddDelMacAddress)(nil), "sw_interface_add_del_mac_address_638bb9f4")
3027         api.RegisterMessage((*SwInterfaceAddDelMacAddressReply)(nil), "sw_interface_add_del_mac_address_reply_e8d4e804")
3028         api.RegisterMessage((*SwInterfaceClearStats)(nil), "sw_interface_clear_stats_f9e6675e")
3029         api.RegisterMessage((*SwInterfaceClearStatsReply)(nil), "sw_interface_clear_stats_reply_e8d4e804")
3030         api.RegisterMessage((*SwInterfaceDetails)(nil), "sw_interface_details_17b69fa2")
3031         api.RegisterMessage((*SwInterfaceDump)(nil), "sw_interface_dump_aa610c27")
3032         api.RegisterMessage((*SwInterfaceEvent)(nil), "sw_interface_event_f709f78d")
3033         api.RegisterMessage((*SwInterfaceGetMacAddress)(nil), "sw_interface_get_mac_address_f9e6675e")
3034         api.RegisterMessage((*SwInterfaceGetMacAddressReply)(nil), "sw_interface_get_mac_address_reply_40ef2c08")
3035         api.RegisterMessage((*SwInterfaceGetTable)(nil), "sw_interface_get_table_2d033de4")
3036         api.RegisterMessage((*SwInterfaceGetTableReply)(nil), "sw_interface_get_table_reply_a6eb0109")
3037         api.RegisterMessage((*SwInterfaceRxPlacementDetails)(nil), "sw_interface_rx_placement_details_f6d7d024")
3038         api.RegisterMessage((*SwInterfaceRxPlacementDump)(nil), "sw_interface_rx_placement_dump_f9e6675e")
3039         api.RegisterMessage((*SwInterfaceSetFlags)(nil), "sw_interface_set_flags_6a2b491a")
3040         api.RegisterMessage((*SwInterfaceSetFlagsReply)(nil), "sw_interface_set_flags_reply_e8d4e804")
3041         api.RegisterMessage((*SwInterfaceSetIPDirectedBroadcast)(nil), "sw_interface_set_ip_directed_broadcast_ae6cfcfb")
3042         api.RegisterMessage((*SwInterfaceSetIPDirectedBroadcastReply)(nil), "sw_interface_set_ip_directed_broadcast_reply_e8d4e804")
3043         api.RegisterMessage((*SwInterfaceSetMacAddress)(nil), "sw_interface_set_mac_address_6aca746a")
3044         api.RegisterMessage((*SwInterfaceSetMacAddressReply)(nil), "sw_interface_set_mac_address_reply_e8d4e804")
3045         api.RegisterMessage((*SwInterfaceSetMtu)(nil), "sw_interface_set_mtu_5cbe85e5")
3046         api.RegisterMessage((*SwInterfaceSetMtuReply)(nil), "sw_interface_set_mtu_reply_e8d4e804")
3047         api.RegisterMessage((*SwInterfaceSetRxMode)(nil), "sw_interface_set_rx_mode_780f5cee")
3048         api.RegisterMessage((*SwInterfaceSetRxModeReply)(nil), "sw_interface_set_rx_mode_reply_e8d4e804")
3049         api.RegisterMessage((*SwInterfaceSetRxPlacement)(nil), "sw_interface_set_rx_placement_db65f3c9")
3050         api.RegisterMessage((*SwInterfaceSetRxPlacementReply)(nil), "sw_interface_set_rx_placement_reply_e8d4e804")
3051         api.RegisterMessage((*SwInterfaceSetTable)(nil), "sw_interface_set_table_df42a577")
3052         api.RegisterMessage((*SwInterfaceSetTableReply)(nil), "sw_interface_set_table_reply_e8d4e804")
3053         api.RegisterMessage((*SwInterfaceSetUnnumbered)(nil), "sw_interface_set_unnumbered_938ef33b")
3054         api.RegisterMessage((*SwInterfaceSetUnnumberedReply)(nil), "sw_interface_set_unnumbered_reply_e8d4e804")
3055         api.RegisterMessage((*SwInterfaceTagAddDel)(nil), "sw_interface_tag_add_del_426f8bc1")
3056         api.RegisterMessage((*SwInterfaceTagAddDelReply)(nil), "sw_interface_tag_add_del_reply_e8d4e804")
3057         api.RegisterMessage((*WantInterfaceEvents)(nil), "want_interface_events_476f5a08")
3058         api.RegisterMessage((*WantInterfaceEventsReply)(nil), "want_interface_events_reply_e8d4e804")
3059 }
3060
3061 // Messages returns list of all messages in this module.
3062 func AllMessages() []api.Message {
3063         return []api.Message{
3064                 (*CollectDetailedInterfaceStats)(nil),
3065                 (*CollectDetailedInterfaceStatsReply)(nil),
3066                 (*CreateLoopback)(nil),
3067                 (*CreateLoopbackInstance)(nil),
3068                 (*CreateLoopbackInstanceReply)(nil),
3069                 (*CreateLoopbackReply)(nil),
3070                 (*CreateSubif)(nil),
3071                 (*CreateSubifReply)(nil),
3072                 (*CreateVlanSubif)(nil),
3073                 (*CreateVlanSubifReply)(nil),
3074                 (*DeleteLoopback)(nil),
3075                 (*DeleteLoopbackReply)(nil),
3076                 (*DeleteSubif)(nil),
3077                 (*DeleteSubifReply)(nil),
3078                 (*HwInterfaceSetMtu)(nil),
3079                 (*HwInterfaceSetMtuReply)(nil),
3080                 (*InterfaceNameRenumber)(nil),
3081                 (*InterfaceNameRenumberReply)(nil),
3082                 (*SwInterfaceAddDelAddress)(nil),
3083                 (*SwInterfaceAddDelAddressReply)(nil),
3084                 (*SwInterfaceAddDelMacAddress)(nil),
3085                 (*SwInterfaceAddDelMacAddressReply)(nil),
3086                 (*SwInterfaceClearStats)(nil),
3087                 (*SwInterfaceClearStatsReply)(nil),
3088                 (*SwInterfaceDetails)(nil),
3089                 (*SwInterfaceDump)(nil),
3090                 (*SwInterfaceEvent)(nil),
3091                 (*SwInterfaceGetMacAddress)(nil),
3092                 (*SwInterfaceGetMacAddressReply)(nil),
3093                 (*SwInterfaceGetTable)(nil),
3094                 (*SwInterfaceGetTableReply)(nil),
3095                 (*SwInterfaceRxPlacementDetails)(nil),
3096                 (*SwInterfaceRxPlacementDump)(nil),
3097                 (*SwInterfaceSetFlags)(nil),
3098                 (*SwInterfaceSetFlagsReply)(nil),
3099                 (*SwInterfaceSetIPDirectedBroadcast)(nil),
3100                 (*SwInterfaceSetIPDirectedBroadcastReply)(nil),
3101                 (*SwInterfaceSetMacAddress)(nil),
3102                 (*SwInterfaceSetMacAddressReply)(nil),
3103                 (*SwInterfaceSetMtu)(nil),
3104                 (*SwInterfaceSetMtuReply)(nil),
3105                 (*SwInterfaceSetRxMode)(nil),
3106                 (*SwInterfaceSetRxModeReply)(nil),
3107                 (*SwInterfaceSetRxPlacement)(nil),
3108                 (*SwInterfaceSetRxPlacementReply)(nil),
3109                 (*SwInterfaceSetTable)(nil),
3110                 (*SwInterfaceSetTableReply)(nil),
3111                 (*SwInterfaceSetUnnumbered)(nil),
3112                 (*SwInterfaceSetUnnumberedReply)(nil),
3113                 (*SwInterfaceTagAddDel)(nil),
3114                 (*SwInterfaceTagAddDelReply)(nil),
3115                 (*WantInterfaceEvents)(nil),
3116                 (*WantInterfaceEventsReply)(nil),
3117         }
3118 }