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