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