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