Improve binapi generator
[govpp.git] / binapi / 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.05-release
5 // source: /usr/share/vpp/api/core/l2.api.json
6
7 // Package l2 contains generated bindings for API file l2.api.
8 //
9 // Contents:
10 //   3 enums
11 //   3 structs
12 //  54 messages
13 //
14 package l2
15
16 import (
17         api "git.fd.io/govpp.git/api"
18         ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
19         interface_types "git.fd.io/govpp.git/binapi/interface_types"
20         ip_types "git.fd.io/govpp.git/binapi/ip_types"
21         codec "git.fd.io/govpp.git/codec"
22         "strconv"
23 )
24
25 // This is a compile-time assertion to ensure that this generated file
26 // is compatible with the GoVPP api package it is being compiled against.
27 // A compilation error at this line likely means your copy of the
28 // GoVPP api package needs to be updated.
29 const _ = api.GoVppAPIPackageIsVersion2
30
31 const (
32         APIFile    = "l2"
33         APIVersion = "3.0.0"
34         VersionCrc = 0x58ce8a6b
35 )
36
37 // BdFlags defines enum 'bd_flags'.
38 type BdFlags uint32
39
40 const (
41         BRIDGE_API_FLAG_NONE     BdFlags = 0
42         BRIDGE_API_FLAG_LEARN    BdFlags = 1
43         BRIDGE_API_FLAG_FWD      BdFlags = 2
44         BRIDGE_API_FLAG_FLOOD    BdFlags = 4
45         BRIDGE_API_FLAG_UU_FLOOD BdFlags = 8
46         BRIDGE_API_FLAG_ARP_TERM BdFlags = 16
47         BRIDGE_API_FLAG_ARP_UFWD BdFlags = 32
48 )
49
50 var (
51         BdFlags_name = map[uint32]string{
52                 0:  "BRIDGE_API_FLAG_NONE",
53                 1:  "BRIDGE_API_FLAG_LEARN",
54                 2:  "BRIDGE_API_FLAG_FWD",
55                 4:  "BRIDGE_API_FLAG_FLOOD",
56                 8:  "BRIDGE_API_FLAG_UU_FLOOD",
57                 16: "BRIDGE_API_FLAG_ARP_TERM",
58                 32: "BRIDGE_API_FLAG_ARP_UFWD",
59         }
60         BdFlags_value = map[string]uint32{
61                 "BRIDGE_API_FLAG_NONE":     0,
62                 "BRIDGE_API_FLAG_LEARN":    1,
63                 "BRIDGE_API_FLAG_FWD":      2,
64                 "BRIDGE_API_FLAG_FLOOD":    4,
65                 "BRIDGE_API_FLAG_UU_FLOOD": 8,
66                 "BRIDGE_API_FLAG_ARP_TERM": 16,
67                 "BRIDGE_API_FLAG_ARP_UFWD": 32,
68         }
69 )
70
71 func (x BdFlags) String() string {
72         s, ok := BdFlags_name[uint32(x)]
73         if ok {
74                 return s
75         }
76         str := func(n uint32) string {
77                 s, ok := BdFlags_name[uint32(n)]
78                 if ok {
79                         return s
80                 }
81                 return "BdFlags(" + strconv.Itoa(int(n)) + ")"
82         }
83         for i := uint32(0); i <= 32; i++ {
84                 val := uint32(x)
85                 if val&(1<<i) != 0 {
86                         if s != "" {
87                                 s += "|"
88                         }
89                         s += str(1 << i)
90                 }
91         }
92         if s == "" {
93                 return str(uint32(x))
94         }
95         return s
96 }
97
98 // L2PortType defines enum 'l2_port_type'.
99 type L2PortType uint32
100
101 const (
102         L2_API_PORT_TYPE_NORMAL L2PortType = 0
103         L2_API_PORT_TYPE_BVI    L2PortType = 1
104         L2_API_PORT_TYPE_UU_FWD L2PortType = 2
105 )
106
107 var (
108         L2PortType_name = map[uint32]string{
109                 0: "L2_API_PORT_TYPE_NORMAL",
110                 1: "L2_API_PORT_TYPE_BVI",
111                 2: "L2_API_PORT_TYPE_UU_FWD",
112         }
113         L2PortType_value = map[string]uint32{
114                 "L2_API_PORT_TYPE_NORMAL": 0,
115                 "L2_API_PORT_TYPE_BVI":    1,
116                 "L2_API_PORT_TYPE_UU_FWD": 2,
117         }
118 )
119
120 func (x L2PortType) String() string {
121         s, ok := L2PortType_name[uint32(x)]
122         if ok {
123                 return s
124         }
125         return "L2PortType(" + strconv.Itoa(int(x)) + ")"
126 }
127
128 // MacEventAction defines enum 'mac_event_action'.
129 type MacEventAction uint32
130
131 const (
132         MAC_EVENT_ACTION_API_ADD    MacEventAction = 0
133         MAC_EVENT_ACTION_API_DELETE MacEventAction = 1
134         MAC_EVENT_ACTION_API_MOVE   MacEventAction = 2
135 )
136
137 var (
138         MacEventAction_name = map[uint32]string{
139                 0: "MAC_EVENT_ACTION_API_ADD",
140                 1: "MAC_EVENT_ACTION_API_DELETE",
141                 2: "MAC_EVENT_ACTION_API_MOVE",
142         }
143         MacEventAction_value = map[string]uint32{
144                 "MAC_EVENT_ACTION_API_ADD":    0,
145                 "MAC_EVENT_ACTION_API_DELETE": 1,
146                 "MAC_EVENT_ACTION_API_MOVE":   2,
147         }
148 )
149
150 func (x MacEventAction) String() string {
151         s, ok := MacEventAction_name[uint32(x)]
152         if ok {
153                 return s
154         }
155         return "MacEventAction(" + strconv.Itoa(int(x)) + ")"
156 }
157
158 // BdIPMac defines type 'bd_ip_mac'.
159 type BdIPMac struct {
160         BdID uint32                    `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
161         IP   ip_types.Address          `binapi:"address,name=ip" json:"ip,omitempty"`
162         Mac  ethernet_types.MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"`
163 }
164
165 // BridgeDomainSwIf defines type 'bridge_domain_sw_if'.
166 type BridgeDomainSwIf struct {
167         Context   uint32                         `binapi:"u32,name=context" json:"context,omitempty"`
168         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
169         Shg       uint8                          `binapi:"u8,name=shg" json:"shg,omitempty"`
170 }
171
172 // MacEntry defines type 'mac_entry'.
173 type MacEntry struct {
174         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
175         MacAddr   ethernet_types.MacAddress      `binapi:"mac_address,name=mac_addr" json:"mac_addr,omitempty"`
176         Action    MacEventAction                 `binapi:"mac_event_action,name=action" json:"action,omitempty"`
177         Flags     uint8                          `binapi:"u8,name=flags" json:"flags,omitempty"`
178 }
179
180 // BdIPMacAddDel defines message 'bd_ip_mac_add_del'.
181 type BdIPMacAddDel struct {
182         IsAdd bool    `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
183         Entry BdIPMac `binapi:"bd_ip_mac,name=entry" json:"entry,omitempty"`
184 }
185
186 func (m *BdIPMacAddDel) Reset()               { *m = BdIPMacAddDel{} }
187 func (*BdIPMacAddDel) GetMessageName() string { return "bd_ip_mac_add_del" }
188 func (*BdIPMacAddDel) GetCrcString() string   { return "5f2b84e2" }
189 func (*BdIPMacAddDel) GetMessageType() api.MessageType {
190         return api.RequestMessage
191 }
192
193 func (m *BdIPMacAddDel) Size() int {
194         if m == nil {
195                 return 0
196         }
197         var size int
198         size += 1      // m.IsAdd
199         size += 4      // m.Entry.BdID
200         size += 1      // m.Entry.IP.Af
201         size += 1 * 16 // m.Entry.IP.Un
202         size += 1 * 6  // m.Entry.Mac
203         return size
204 }
205 func (m *BdIPMacAddDel) Marshal(b []byte) ([]byte, error) {
206         var buf *codec.Buffer
207         if b == nil {
208                 buf = codec.NewBuffer(make([]byte, m.Size()))
209         } else {
210                 buf = codec.NewBuffer(b)
211         }
212         buf.EncodeBool(m.IsAdd)
213         buf.EncodeUint32(uint32(m.Entry.BdID))
214         buf.EncodeUint8(uint8(m.Entry.IP.Af))
215         buf.EncodeBytes(m.Entry.IP.Un.XXX_UnionData[:], 0)
216         buf.EncodeBytes(m.Entry.Mac[:], 6)
217         return buf.Bytes(), nil
218 }
219 func (m *BdIPMacAddDel) Unmarshal(b []byte) error {
220         buf := codec.NewBuffer(b)
221         m.IsAdd = buf.DecodeBool()
222         m.Entry.BdID = buf.DecodeUint32()
223         m.Entry.IP.Af = ip_types.AddressFamily(buf.DecodeUint8())
224         copy(m.Entry.IP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
225         copy(m.Entry.Mac[:], buf.DecodeBytes(6))
226         return nil
227 }
228
229 // BdIPMacAddDelReply defines message 'bd_ip_mac_add_del_reply'.
230 type BdIPMacAddDelReply struct {
231         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
232 }
233
234 func (m *BdIPMacAddDelReply) Reset()               { *m = BdIPMacAddDelReply{} }
235 func (*BdIPMacAddDelReply) GetMessageName() string { return "bd_ip_mac_add_del_reply" }
236 func (*BdIPMacAddDelReply) GetCrcString() string   { return "e8d4e804" }
237 func (*BdIPMacAddDelReply) GetMessageType() api.MessageType {
238         return api.ReplyMessage
239 }
240
241 func (m *BdIPMacAddDelReply) Size() int {
242         if m == nil {
243                 return 0
244         }
245         var size int
246         size += 4 // m.Retval
247         return size
248 }
249 func (m *BdIPMacAddDelReply) Marshal(b []byte) ([]byte, error) {
250         var buf *codec.Buffer
251         if b == nil {
252                 buf = codec.NewBuffer(make([]byte, m.Size()))
253         } else {
254                 buf = codec.NewBuffer(b)
255         }
256         buf.EncodeUint32(uint32(m.Retval))
257         return buf.Bytes(), nil
258 }
259 func (m *BdIPMacAddDelReply) Unmarshal(b []byte) error {
260         buf := codec.NewBuffer(b)
261         m.Retval = int32(buf.DecodeUint32())
262         return nil
263 }
264
265 // BdIPMacDetails defines message 'bd_ip_mac_details'.
266 type BdIPMacDetails struct {
267         Entry BdIPMac `binapi:"bd_ip_mac,name=entry" json:"entry,omitempty"`
268 }
269
270 func (m *BdIPMacDetails) Reset()               { *m = BdIPMacDetails{} }
271 func (*BdIPMacDetails) GetMessageName() string { return "bd_ip_mac_details" }
272 func (*BdIPMacDetails) GetCrcString() string   { return "a52f8044" }
273 func (*BdIPMacDetails) GetMessageType() api.MessageType {
274         return api.ReplyMessage
275 }
276
277 func (m *BdIPMacDetails) Size() int {
278         if m == nil {
279                 return 0
280         }
281         var size int
282         size += 4      // m.Entry.BdID
283         size += 1      // m.Entry.IP.Af
284         size += 1 * 16 // m.Entry.IP.Un
285         size += 1 * 6  // m.Entry.Mac
286         return size
287 }
288 func (m *BdIPMacDetails) Marshal(b []byte) ([]byte, error) {
289         var buf *codec.Buffer
290         if b == nil {
291                 buf = codec.NewBuffer(make([]byte, m.Size()))
292         } else {
293                 buf = codec.NewBuffer(b)
294         }
295         buf.EncodeUint32(uint32(m.Entry.BdID))
296         buf.EncodeUint8(uint8(m.Entry.IP.Af))
297         buf.EncodeBytes(m.Entry.IP.Un.XXX_UnionData[:], 0)
298         buf.EncodeBytes(m.Entry.Mac[:], 6)
299         return buf.Bytes(), nil
300 }
301 func (m *BdIPMacDetails) Unmarshal(b []byte) error {
302         buf := codec.NewBuffer(b)
303         m.Entry.BdID = buf.DecodeUint32()
304         m.Entry.IP.Af = ip_types.AddressFamily(buf.DecodeUint8())
305         copy(m.Entry.IP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
306         copy(m.Entry.Mac[:], buf.DecodeBytes(6))
307         return nil
308 }
309
310 // BdIPMacDump defines message 'bd_ip_mac_dump'.
311 type BdIPMacDump struct {
312         BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
313 }
314
315 func (m *BdIPMacDump) Reset()               { *m = BdIPMacDump{} }
316 func (*BdIPMacDump) GetMessageName() string { return "bd_ip_mac_dump" }
317 func (*BdIPMacDump) GetCrcString() string   { return "c25fdce6" }
318 func (*BdIPMacDump) GetMessageType() api.MessageType {
319         return api.RequestMessage
320 }
321
322 func (m *BdIPMacDump) Size() int {
323         if m == nil {
324                 return 0
325         }
326         var size int
327         size += 4 // m.BdID
328         return size
329 }
330 func (m *BdIPMacDump) Marshal(b []byte) ([]byte, error) {
331         var buf *codec.Buffer
332         if b == nil {
333                 buf = codec.NewBuffer(make([]byte, m.Size()))
334         } else {
335                 buf = codec.NewBuffer(b)
336         }
337         buf.EncodeUint32(uint32(m.BdID))
338         return buf.Bytes(), nil
339 }
340 func (m *BdIPMacDump) Unmarshal(b []byte) error {
341         buf := codec.NewBuffer(b)
342         m.BdID = buf.DecodeUint32()
343         return nil
344 }
345
346 // BdIPMacFlush defines message 'bd_ip_mac_flush'.
347 type BdIPMacFlush struct {
348         BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
349 }
350
351 func (m *BdIPMacFlush) Reset()               { *m = BdIPMacFlush{} }
352 func (*BdIPMacFlush) GetMessageName() string { return "bd_ip_mac_flush" }
353 func (*BdIPMacFlush) GetCrcString() string   { return "c25fdce6" }
354 func (*BdIPMacFlush) GetMessageType() api.MessageType {
355         return api.RequestMessage
356 }
357
358 func (m *BdIPMacFlush) Size() int {
359         if m == nil {
360                 return 0
361         }
362         var size int
363         size += 4 // m.BdID
364         return size
365 }
366 func (m *BdIPMacFlush) Marshal(b []byte) ([]byte, error) {
367         var buf *codec.Buffer
368         if b == nil {
369                 buf = codec.NewBuffer(make([]byte, m.Size()))
370         } else {
371                 buf = codec.NewBuffer(b)
372         }
373         buf.EncodeUint32(uint32(m.BdID))
374         return buf.Bytes(), nil
375 }
376 func (m *BdIPMacFlush) Unmarshal(b []byte) error {
377         buf := codec.NewBuffer(b)
378         m.BdID = buf.DecodeUint32()
379         return nil
380 }
381
382 // BdIPMacFlushReply defines message 'bd_ip_mac_flush_reply'.
383 type BdIPMacFlushReply struct {
384         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
385 }
386
387 func (m *BdIPMacFlushReply) Reset()               { *m = BdIPMacFlushReply{} }
388 func (*BdIPMacFlushReply) GetMessageName() string { return "bd_ip_mac_flush_reply" }
389 func (*BdIPMacFlushReply) GetCrcString() string   { return "e8d4e804" }
390 func (*BdIPMacFlushReply) GetMessageType() api.MessageType {
391         return api.ReplyMessage
392 }
393
394 func (m *BdIPMacFlushReply) Size() int {
395         if m == nil {
396                 return 0
397         }
398         var size int
399         size += 4 // m.Retval
400         return size
401 }
402 func (m *BdIPMacFlushReply) Marshal(b []byte) ([]byte, error) {
403         var buf *codec.Buffer
404         if b == nil {
405                 buf = codec.NewBuffer(make([]byte, m.Size()))
406         } else {
407                 buf = codec.NewBuffer(b)
408         }
409         buf.EncodeUint32(uint32(m.Retval))
410         return buf.Bytes(), nil
411 }
412 func (m *BdIPMacFlushReply) Unmarshal(b []byte) error {
413         buf := codec.NewBuffer(b)
414         m.Retval = int32(buf.DecodeUint32())
415         return nil
416 }
417
418 // BridgeDomainAddDel defines message 'bridge_domain_add_del'.
419 type BridgeDomainAddDel struct {
420         BdID    uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
421         Flood   bool   `binapi:"bool,name=flood" json:"flood,omitempty"`
422         UuFlood bool   `binapi:"bool,name=uu_flood" json:"uu_flood,omitempty"`
423         Forward bool   `binapi:"bool,name=forward" json:"forward,omitempty"`
424         Learn   bool   `binapi:"bool,name=learn" json:"learn,omitempty"`
425         ArpTerm bool   `binapi:"bool,name=arp_term" json:"arp_term,omitempty"`
426         ArpUfwd bool   `binapi:"bool,name=arp_ufwd" json:"arp_ufwd,omitempty"`
427         MacAge  uint8  `binapi:"u8,name=mac_age" json:"mac_age,omitempty"`
428         BdTag   string `binapi:"string[64],name=bd_tag" json:"bd_tag,omitempty"`
429         IsAdd   bool   `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
430 }
431
432 func (m *BridgeDomainAddDel) Reset()               { *m = BridgeDomainAddDel{} }
433 func (*BridgeDomainAddDel) GetMessageName() string { return "bridge_domain_add_del" }
434 func (*BridgeDomainAddDel) GetCrcString() string   { return "600b7170" }
435 func (*BridgeDomainAddDel) GetMessageType() api.MessageType {
436         return api.RequestMessage
437 }
438
439 func (m *BridgeDomainAddDel) Size() int {
440         if m == nil {
441                 return 0
442         }
443         var size int
444         size += 4  // m.BdID
445         size += 1  // m.Flood
446         size += 1  // m.UuFlood
447         size += 1  // m.Forward
448         size += 1  // m.Learn
449         size += 1  // m.ArpTerm
450         size += 1  // m.ArpUfwd
451         size += 1  // m.MacAge
452         size += 64 // m.BdTag
453         size += 1  // m.IsAdd
454         return size
455 }
456 func (m *BridgeDomainAddDel) Marshal(b []byte) ([]byte, error) {
457         var buf *codec.Buffer
458         if b == nil {
459                 buf = codec.NewBuffer(make([]byte, m.Size()))
460         } else {
461                 buf = codec.NewBuffer(b)
462         }
463         buf.EncodeUint32(uint32(m.BdID))
464         buf.EncodeBool(m.Flood)
465         buf.EncodeBool(m.UuFlood)
466         buf.EncodeBool(m.Forward)
467         buf.EncodeBool(m.Learn)
468         buf.EncodeBool(m.ArpTerm)
469         buf.EncodeBool(m.ArpUfwd)
470         buf.EncodeUint8(uint8(m.MacAge))
471         buf.EncodeString(m.BdTag, 64)
472         buf.EncodeBool(m.IsAdd)
473         return buf.Bytes(), nil
474 }
475 func (m *BridgeDomainAddDel) Unmarshal(b []byte) error {
476         buf := codec.NewBuffer(b)
477         m.BdID = buf.DecodeUint32()
478         m.Flood = buf.DecodeBool()
479         m.UuFlood = buf.DecodeBool()
480         m.Forward = buf.DecodeBool()
481         m.Learn = buf.DecodeBool()
482         m.ArpTerm = buf.DecodeBool()
483         m.ArpUfwd = buf.DecodeBool()
484         m.MacAge = buf.DecodeUint8()
485         m.BdTag = buf.DecodeString(64)
486         m.IsAdd = buf.DecodeBool()
487         return nil
488 }
489
490 // BridgeDomainAddDelReply defines message 'bridge_domain_add_del_reply'.
491 type BridgeDomainAddDelReply struct {
492         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
493 }
494
495 func (m *BridgeDomainAddDelReply) Reset()               { *m = BridgeDomainAddDelReply{} }
496 func (*BridgeDomainAddDelReply) GetMessageName() string { return "bridge_domain_add_del_reply" }
497 func (*BridgeDomainAddDelReply) GetCrcString() string   { return "e8d4e804" }
498 func (*BridgeDomainAddDelReply) GetMessageType() api.MessageType {
499         return api.ReplyMessage
500 }
501
502 func (m *BridgeDomainAddDelReply) Size() int {
503         if m == nil {
504                 return 0
505         }
506         var size int
507         size += 4 // m.Retval
508         return size
509 }
510 func (m *BridgeDomainAddDelReply) Marshal(b []byte) ([]byte, error) {
511         var buf *codec.Buffer
512         if b == nil {
513                 buf = codec.NewBuffer(make([]byte, m.Size()))
514         } else {
515                 buf = codec.NewBuffer(b)
516         }
517         buf.EncodeUint32(uint32(m.Retval))
518         return buf.Bytes(), nil
519 }
520 func (m *BridgeDomainAddDelReply) Unmarshal(b []byte) error {
521         buf := codec.NewBuffer(b)
522         m.Retval = int32(buf.DecodeUint32())
523         return nil
524 }
525
526 // BridgeDomainDetails defines message 'bridge_domain_details'.
527 type BridgeDomainDetails struct {
528         BdID           uint32                         `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
529         Flood          bool                           `binapi:"bool,name=flood" json:"flood,omitempty"`
530         UuFlood        bool                           `binapi:"bool,name=uu_flood" json:"uu_flood,omitempty"`
531         Forward        bool                           `binapi:"bool,name=forward" json:"forward,omitempty"`
532         Learn          bool                           `binapi:"bool,name=learn" json:"learn,omitempty"`
533         ArpTerm        bool                           `binapi:"bool,name=arp_term" json:"arp_term,omitempty"`
534         ArpUfwd        bool                           `binapi:"bool,name=arp_ufwd" json:"arp_ufwd,omitempty"`
535         MacAge         uint8                          `binapi:"u8,name=mac_age" json:"mac_age,omitempty"`
536         BdTag          string                         `binapi:"string[64],name=bd_tag" json:"bd_tag,omitempty"`
537         BviSwIfIndex   interface_types.InterfaceIndex `binapi:"interface_index,name=bvi_sw_if_index" json:"bvi_sw_if_index,omitempty"`
538         UuFwdSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=uu_fwd_sw_if_index" json:"uu_fwd_sw_if_index,omitempty"`
539         NSwIfs         uint32                         `binapi:"u32,name=n_sw_ifs" json:"-"`
540         SwIfDetails    []BridgeDomainSwIf             `binapi:"bridge_domain_sw_if[n_sw_ifs],name=sw_if_details" json:"sw_if_details,omitempty"`
541 }
542
543 func (m *BridgeDomainDetails) Reset()               { *m = BridgeDomainDetails{} }
544 func (*BridgeDomainDetails) GetMessageName() string { return "bridge_domain_details" }
545 func (*BridgeDomainDetails) GetCrcString() string   { return "979f549d" }
546 func (*BridgeDomainDetails) GetMessageType() api.MessageType {
547         return api.ReplyMessage
548 }
549
550 func (m *BridgeDomainDetails) Size() int {
551         if m == nil {
552                 return 0
553         }
554         var size int
555         size += 4  // m.BdID
556         size += 1  // m.Flood
557         size += 1  // m.UuFlood
558         size += 1  // m.Forward
559         size += 1  // m.Learn
560         size += 1  // m.ArpTerm
561         size += 1  // m.ArpUfwd
562         size += 1  // m.MacAge
563         size += 64 // m.BdTag
564         size += 4  // m.BviSwIfIndex
565         size += 4  // m.UuFwdSwIfIndex
566         size += 4  // m.NSwIfs
567         for j1 := 0; j1 < len(m.SwIfDetails); j1++ {
568                 var s1 BridgeDomainSwIf
569                 _ = s1
570                 if j1 < len(m.SwIfDetails) {
571                         s1 = m.SwIfDetails[j1]
572                 }
573                 size += 4 // s1.Context
574                 size += 4 // s1.SwIfIndex
575                 size += 1 // s1.Shg
576         }
577         return size
578 }
579 func (m *BridgeDomainDetails) Marshal(b []byte) ([]byte, error) {
580         var buf *codec.Buffer
581         if b == nil {
582                 buf = codec.NewBuffer(make([]byte, m.Size()))
583         } else {
584                 buf = codec.NewBuffer(b)
585         }
586         buf.EncodeUint32(uint32(m.BdID))
587         buf.EncodeBool(m.Flood)
588         buf.EncodeBool(m.UuFlood)
589         buf.EncodeBool(m.Forward)
590         buf.EncodeBool(m.Learn)
591         buf.EncodeBool(m.ArpTerm)
592         buf.EncodeBool(m.ArpUfwd)
593         buf.EncodeUint8(uint8(m.MacAge))
594         buf.EncodeString(m.BdTag, 64)
595         buf.EncodeUint32(uint32(m.BviSwIfIndex))
596         buf.EncodeUint32(uint32(m.UuFwdSwIfIndex))
597         buf.EncodeUint32(uint32(len(m.SwIfDetails)))
598         for j0 := 0; j0 < len(m.SwIfDetails); j0++ {
599                 var v0 BridgeDomainSwIf
600                 if j0 < len(m.SwIfDetails) {
601                         v0 = m.SwIfDetails[j0]
602                 }
603                 buf.EncodeUint32(uint32(v0.Context))
604                 buf.EncodeUint32(uint32(v0.SwIfIndex))
605                 buf.EncodeUint8(uint8(v0.Shg))
606         }
607         return buf.Bytes(), nil
608 }
609 func (m *BridgeDomainDetails) Unmarshal(b []byte) error {
610         buf := codec.NewBuffer(b)
611         m.BdID = buf.DecodeUint32()
612         m.Flood = buf.DecodeBool()
613         m.UuFlood = buf.DecodeBool()
614         m.Forward = buf.DecodeBool()
615         m.Learn = buf.DecodeBool()
616         m.ArpTerm = buf.DecodeBool()
617         m.ArpUfwd = buf.DecodeBool()
618         m.MacAge = buf.DecodeUint8()
619         m.BdTag = buf.DecodeString(64)
620         m.BviSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
621         m.UuFwdSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
622         m.NSwIfs = buf.DecodeUint32()
623         m.SwIfDetails = make([]BridgeDomainSwIf, int(m.NSwIfs))
624         for j0 := 0; j0 < len(m.SwIfDetails); j0++ {
625                 m.SwIfDetails[j0].Context = buf.DecodeUint32()
626                 m.SwIfDetails[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
627                 m.SwIfDetails[j0].Shg = buf.DecodeUint8()
628         }
629         return nil
630 }
631
632 // BridgeDomainDump defines message 'bridge_domain_dump'.
633 type BridgeDomainDump struct {
634         BdID      uint32                         `binapi:"u32,name=bd_id,default=%!s(float64=4.294967295e+09)" json:"bd_id,omitempty"`
635         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"`
636 }
637
638 func (m *BridgeDomainDump) Reset()               { *m = BridgeDomainDump{} }
639 func (*BridgeDomainDump) GetMessageName() string { return "bridge_domain_dump" }
640 func (*BridgeDomainDump) GetCrcString() string   { return "74396a43" }
641 func (*BridgeDomainDump) GetMessageType() api.MessageType {
642         return api.RequestMessage
643 }
644
645 func (m *BridgeDomainDump) Size() int {
646         if m == nil {
647                 return 0
648         }
649         var size int
650         size += 4 // m.BdID
651         size += 4 // m.SwIfIndex
652         return size
653 }
654 func (m *BridgeDomainDump) Marshal(b []byte) ([]byte, error) {
655         var buf *codec.Buffer
656         if b == nil {
657                 buf = codec.NewBuffer(make([]byte, m.Size()))
658         } else {
659                 buf = codec.NewBuffer(b)
660         }
661         buf.EncodeUint32(uint32(m.BdID))
662         buf.EncodeUint32(uint32(m.SwIfIndex))
663         return buf.Bytes(), nil
664 }
665 func (m *BridgeDomainDump) Unmarshal(b []byte) error {
666         buf := codec.NewBuffer(b)
667         m.BdID = buf.DecodeUint32()
668         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
669         return nil
670 }
671
672 // BridgeDomainSetMacAge defines message 'bridge_domain_set_mac_age'.
673 type BridgeDomainSetMacAge struct {
674         BdID   uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
675         MacAge uint8  `binapi:"u8,name=mac_age" json:"mac_age,omitempty"`
676 }
677
678 func (m *BridgeDomainSetMacAge) Reset()               { *m = BridgeDomainSetMacAge{} }
679 func (*BridgeDomainSetMacAge) GetMessageName() string { return "bridge_domain_set_mac_age" }
680 func (*BridgeDomainSetMacAge) GetCrcString() string   { return "b537ad7b" }
681 func (*BridgeDomainSetMacAge) GetMessageType() api.MessageType {
682         return api.RequestMessage
683 }
684
685 func (m *BridgeDomainSetMacAge) Size() int {
686         if m == nil {
687                 return 0
688         }
689         var size int
690         size += 4 // m.BdID
691         size += 1 // m.MacAge
692         return size
693 }
694 func (m *BridgeDomainSetMacAge) Marshal(b []byte) ([]byte, error) {
695         var buf *codec.Buffer
696         if b == nil {
697                 buf = codec.NewBuffer(make([]byte, m.Size()))
698         } else {
699                 buf = codec.NewBuffer(b)
700         }
701         buf.EncodeUint32(uint32(m.BdID))
702         buf.EncodeUint8(uint8(m.MacAge))
703         return buf.Bytes(), nil
704 }
705 func (m *BridgeDomainSetMacAge) Unmarshal(b []byte) error {
706         buf := codec.NewBuffer(b)
707         m.BdID = buf.DecodeUint32()
708         m.MacAge = buf.DecodeUint8()
709         return nil
710 }
711
712 // BridgeDomainSetMacAgeReply defines message 'bridge_domain_set_mac_age_reply'.
713 type BridgeDomainSetMacAgeReply struct {
714         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
715 }
716
717 func (m *BridgeDomainSetMacAgeReply) Reset()               { *m = BridgeDomainSetMacAgeReply{} }
718 func (*BridgeDomainSetMacAgeReply) GetMessageName() string { return "bridge_domain_set_mac_age_reply" }
719 func (*BridgeDomainSetMacAgeReply) GetCrcString() string   { return "e8d4e804" }
720 func (*BridgeDomainSetMacAgeReply) GetMessageType() api.MessageType {
721         return api.ReplyMessage
722 }
723
724 func (m *BridgeDomainSetMacAgeReply) Size() int {
725         if m == nil {
726                 return 0
727         }
728         var size int
729         size += 4 // m.Retval
730         return size
731 }
732 func (m *BridgeDomainSetMacAgeReply) Marshal(b []byte) ([]byte, error) {
733         var buf *codec.Buffer
734         if b == nil {
735                 buf = codec.NewBuffer(make([]byte, m.Size()))
736         } else {
737                 buf = codec.NewBuffer(b)
738         }
739         buf.EncodeUint32(uint32(m.Retval))
740         return buf.Bytes(), nil
741 }
742 func (m *BridgeDomainSetMacAgeReply) Unmarshal(b []byte) error {
743         buf := codec.NewBuffer(b)
744         m.Retval = int32(buf.DecodeUint32())
745         return nil
746 }
747
748 // BridgeFlags defines message 'bridge_flags'.
749 type BridgeFlags struct {
750         BdID  uint32  `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
751         IsSet bool    `binapi:"bool,name=is_set" json:"is_set,omitempty"`
752         Flags BdFlags `binapi:"bd_flags,name=flags" json:"flags,omitempty"`
753 }
754
755 func (m *BridgeFlags) Reset()               { *m = BridgeFlags{} }
756 func (*BridgeFlags) GetMessageName() string { return "bridge_flags" }
757 func (*BridgeFlags) GetCrcString() string   { return "1b0c5fbd" }
758 func (*BridgeFlags) GetMessageType() api.MessageType {
759         return api.RequestMessage
760 }
761
762 func (m *BridgeFlags) Size() int {
763         if m == nil {
764                 return 0
765         }
766         var size int
767         size += 4 // m.BdID
768         size += 1 // m.IsSet
769         size += 4 // m.Flags
770         return size
771 }
772 func (m *BridgeFlags) Marshal(b []byte) ([]byte, error) {
773         var buf *codec.Buffer
774         if b == nil {
775                 buf = codec.NewBuffer(make([]byte, m.Size()))
776         } else {
777                 buf = codec.NewBuffer(b)
778         }
779         buf.EncodeUint32(uint32(m.BdID))
780         buf.EncodeBool(m.IsSet)
781         buf.EncodeUint32(uint32(m.Flags))
782         return buf.Bytes(), nil
783 }
784 func (m *BridgeFlags) Unmarshal(b []byte) error {
785         buf := codec.NewBuffer(b)
786         m.BdID = buf.DecodeUint32()
787         m.IsSet = buf.DecodeBool()
788         m.Flags = BdFlags(buf.DecodeUint32())
789         return nil
790 }
791
792 // BridgeFlagsReply defines message 'bridge_flags_reply'.
793 type BridgeFlagsReply struct {
794         Retval                 int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
795         ResultingFeatureBitmap uint32 `binapi:"u32,name=resulting_feature_bitmap" json:"resulting_feature_bitmap,omitempty"`
796 }
797
798 func (m *BridgeFlagsReply) Reset()               { *m = BridgeFlagsReply{} }
799 func (*BridgeFlagsReply) GetMessageName() string { return "bridge_flags_reply" }
800 func (*BridgeFlagsReply) GetCrcString() string   { return "29b2a2b3" }
801 func (*BridgeFlagsReply) GetMessageType() api.MessageType {
802         return api.ReplyMessage
803 }
804
805 func (m *BridgeFlagsReply) Size() int {
806         if m == nil {
807                 return 0
808         }
809         var size int
810         size += 4 // m.Retval
811         size += 4 // m.ResultingFeatureBitmap
812         return size
813 }
814 func (m *BridgeFlagsReply) Marshal(b []byte) ([]byte, error) {
815         var buf *codec.Buffer
816         if b == nil {
817                 buf = codec.NewBuffer(make([]byte, m.Size()))
818         } else {
819                 buf = codec.NewBuffer(b)
820         }
821         buf.EncodeUint32(uint32(m.Retval))
822         buf.EncodeUint32(uint32(m.ResultingFeatureBitmap))
823         return buf.Bytes(), nil
824 }
825 func (m *BridgeFlagsReply) Unmarshal(b []byte) error {
826         buf := codec.NewBuffer(b)
827         m.Retval = int32(buf.DecodeUint32())
828         m.ResultingFeatureBitmap = buf.DecodeUint32()
829         return nil
830 }
831
832 // BviCreate defines message 'bvi_create'.
833 type BviCreate struct {
834         Mac          ethernet_types.MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"`
835         UserInstance uint32                    `binapi:"u32,name=user_instance,default=%!s(float64=4.294967295e+09)" json:"user_instance,omitempty"`
836 }
837
838 func (m *BviCreate) Reset()               { *m = BviCreate{} }
839 func (*BviCreate) GetMessageName() string { return "bvi_create" }
840 func (*BviCreate) GetCrcString() string   { return "f5398559" }
841 func (*BviCreate) GetMessageType() api.MessageType {
842         return api.RequestMessage
843 }
844
845 func (m *BviCreate) Size() int {
846         if m == nil {
847                 return 0
848         }
849         var size int
850         size += 1 * 6 // m.Mac
851         size += 4     // m.UserInstance
852         return size
853 }
854 func (m *BviCreate) Marshal(b []byte) ([]byte, error) {
855         var buf *codec.Buffer
856         if b == nil {
857                 buf = codec.NewBuffer(make([]byte, m.Size()))
858         } else {
859                 buf = codec.NewBuffer(b)
860         }
861         buf.EncodeBytes(m.Mac[:], 6)
862         buf.EncodeUint32(uint32(m.UserInstance))
863         return buf.Bytes(), nil
864 }
865 func (m *BviCreate) Unmarshal(b []byte) error {
866         buf := codec.NewBuffer(b)
867         copy(m.Mac[:], buf.DecodeBytes(6))
868         m.UserInstance = buf.DecodeUint32()
869         return nil
870 }
871
872 // BviCreateReply defines message 'bvi_create_reply'.
873 type BviCreateReply struct {
874         Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
875         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
876 }
877
878 func (m *BviCreateReply) Reset()               { *m = BviCreateReply{} }
879 func (*BviCreateReply) GetMessageName() string { return "bvi_create_reply" }
880 func (*BviCreateReply) GetCrcString() string   { return "5383d31f" }
881 func (*BviCreateReply) GetMessageType() api.MessageType {
882         return api.ReplyMessage
883 }
884
885 func (m *BviCreateReply) Size() int {
886         if m == nil {
887                 return 0
888         }
889         var size int
890         size += 4 // m.Retval
891         size += 4 // m.SwIfIndex
892         return size
893 }
894 func (m *BviCreateReply) Marshal(b []byte) ([]byte, error) {
895         var buf *codec.Buffer
896         if b == nil {
897                 buf = codec.NewBuffer(make([]byte, m.Size()))
898         } else {
899                 buf = codec.NewBuffer(b)
900         }
901         buf.EncodeUint32(uint32(m.Retval))
902         buf.EncodeUint32(uint32(m.SwIfIndex))
903         return buf.Bytes(), nil
904 }
905 func (m *BviCreateReply) Unmarshal(b []byte) error {
906         buf := codec.NewBuffer(b)
907         m.Retval = int32(buf.DecodeUint32())
908         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
909         return nil
910 }
911
912 // BviDelete defines message 'bvi_delete'.
913 type BviDelete struct {
914         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
915 }
916
917 func (m *BviDelete) Reset()               { *m = BviDelete{} }
918 func (*BviDelete) GetMessageName() string { return "bvi_delete" }
919 func (*BviDelete) GetCrcString() string   { return "f9e6675e" }
920 func (*BviDelete) GetMessageType() api.MessageType {
921         return api.RequestMessage
922 }
923
924 func (m *BviDelete) Size() int {
925         if m == nil {
926                 return 0
927         }
928         var size int
929         size += 4 // m.SwIfIndex
930         return size
931 }
932 func (m *BviDelete) Marshal(b []byte) ([]byte, error) {
933         var buf *codec.Buffer
934         if b == nil {
935                 buf = codec.NewBuffer(make([]byte, m.Size()))
936         } else {
937                 buf = codec.NewBuffer(b)
938         }
939         buf.EncodeUint32(uint32(m.SwIfIndex))
940         return buf.Bytes(), nil
941 }
942 func (m *BviDelete) Unmarshal(b []byte) error {
943         buf := codec.NewBuffer(b)
944         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
945         return nil
946 }
947
948 // BviDeleteReply defines message 'bvi_delete_reply'.
949 type BviDeleteReply struct {
950         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
951 }
952
953 func (m *BviDeleteReply) Reset()               { *m = BviDeleteReply{} }
954 func (*BviDeleteReply) GetMessageName() string { return "bvi_delete_reply" }
955 func (*BviDeleteReply) GetCrcString() string   { return "e8d4e804" }
956 func (*BviDeleteReply) GetMessageType() api.MessageType {
957         return api.ReplyMessage
958 }
959
960 func (m *BviDeleteReply) Size() int {
961         if m == nil {
962                 return 0
963         }
964         var size int
965         size += 4 // m.Retval
966         return size
967 }
968 func (m *BviDeleteReply) Marshal(b []byte) ([]byte, error) {
969         var buf *codec.Buffer
970         if b == nil {
971                 buf = codec.NewBuffer(make([]byte, m.Size()))
972         } else {
973                 buf = codec.NewBuffer(b)
974         }
975         buf.EncodeUint32(uint32(m.Retval))
976         return buf.Bytes(), nil
977 }
978 func (m *BviDeleteReply) Unmarshal(b []byte) error {
979         buf := codec.NewBuffer(b)
980         m.Retval = int32(buf.DecodeUint32())
981         return nil
982 }
983
984 // L2ArpTermEvent defines message 'l2_arp_term_event'.
985 type L2ArpTermEvent struct {
986         PID       uint32                         `binapi:"u32,name=pid" json:"pid,omitempty"`
987         IP        ip_types.Address               `binapi:"address,name=ip" json:"ip,omitempty"`
988         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
989         Mac       ethernet_types.MacAddress      `binapi:"mac_address,name=mac" json:"mac,omitempty"`
990 }
991
992 func (m *L2ArpTermEvent) Reset()               { *m = L2ArpTermEvent{} }
993 func (*L2ArpTermEvent) GetMessageName() string { return "l2_arp_term_event" }
994 func (*L2ArpTermEvent) GetCrcString() string   { return "85ff71ea" }
995 func (*L2ArpTermEvent) GetMessageType() api.MessageType {
996         return api.EventMessage
997 }
998
999 func (m *L2ArpTermEvent) Size() int {
1000         if m == nil {
1001                 return 0
1002         }
1003         var size int
1004         size += 4      // m.PID
1005         size += 1      // m.IP.Af
1006         size += 1 * 16 // m.IP.Un
1007         size += 4      // m.SwIfIndex
1008         size += 1 * 6  // m.Mac
1009         return size
1010 }
1011 func (m *L2ArpTermEvent) Marshal(b []byte) ([]byte, error) {
1012         var buf *codec.Buffer
1013         if b == nil {
1014                 buf = codec.NewBuffer(make([]byte, m.Size()))
1015         } else {
1016                 buf = codec.NewBuffer(b)
1017         }
1018         buf.EncodeUint32(uint32(m.PID))
1019         buf.EncodeUint8(uint8(m.IP.Af))
1020         buf.EncodeBytes(m.IP.Un.XXX_UnionData[:], 0)
1021         buf.EncodeUint32(uint32(m.SwIfIndex))
1022         buf.EncodeBytes(m.Mac[:], 6)
1023         return buf.Bytes(), nil
1024 }
1025 func (m *L2ArpTermEvent) Unmarshal(b []byte) error {
1026         buf := codec.NewBuffer(b)
1027         m.PID = buf.DecodeUint32()
1028         m.IP.Af = ip_types.AddressFamily(buf.DecodeUint8())
1029         copy(m.IP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1030         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1031         copy(m.Mac[:], buf.DecodeBytes(6))
1032         return nil
1033 }
1034
1035 // L2FibClearTable defines message 'l2_fib_clear_table'.
1036 type L2FibClearTable struct{}
1037
1038 func (m *L2FibClearTable) Reset()               { *m = L2FibClearTable{} }
1039 func (*L2FibClearTable) GetMessageName() string { return "l2_fib_clear_table" }
1040 func (*L2FibClearTable) GetCrcString() string   { return "51077d14" }
1041 func (*L2FibClearTable) GetMessageType() api.MessageType {
1042         return api.RequestMessage
1043 }
1044
1045 func (m *L2FibClearTable) Size() int {
1046         if m == nil {
1047                 return 0
1048         }
1049         var size int
1050         return size
1051 }
1052 func (m *L2FibClearTable) Marshal(b []byte) ([]byte, error) {
1053         var buf *codec.Buffer
1054         if b == nil {
1055                 buf = codec.NewBuffer(make([]byte, m.Size()))
1056         } else {
1057                 buf = codec.NewBuffer(b)
1058         }
1059         return buf.Bytes(), nil
1060 }
1061 func (m *L2FibClearTable) Unmarshal(b []byte) error {
1062         return nil
1063 }
1064
1065 // L2FibClearTableReply defines message 'l2_fib_clear_table_reply'.
1066 type L2FibClearTableReply struct {
1067         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1068 }
1069
1070 func (m *L2FibClearTableReply) Reset()               { *m = L2FibClearTableReply{} }
1071 func (*L2FibClearTableReply) GetMessageName() string { return "l2_fib_clear_table_reply" }
1072 func (*L2FibClearTableReply) GetCrcString() string   { return "e8d4e804" }
1073 func (*L2FibClearTableReply) GetMessageType() api.MessageType {
1074         return api.ReplyMessage
1075 }
1076
1077 func (m *L2FibClearTableReply) Size() int {
1078         if m == nil {
1079                 return 0
1080         }
1081         var size int
1082         size += 4 // m.Retval
1083         return size
1084 }
1085 func (m *L2FibClearTableReply) Marshal(b []byte) ([]byte, error) {
1086         var buf *codec.Buffer
1087         if b == nil {
1088                 buf = codec.NewBuffer(make([]byte, m.Size()))
1089         } else {
1090                 buf = codec.NewBuffer(b)
1091         }
1092         buf.EncodeUint32(uint32(m.Retval))
1093         return buf.Bytes(), nil
1094 }
1095 func (m *L2FibClearTableReply) Unmarshal(b []byte) error {
1096         buf := codec.NewBuffer(b)
1097         m.Retval = int32(buf.DecodeUint32())
1098         return nil
1099 }
1100
1101 // L2FibTableDetails defines message 'l2_fib_table_details'.
1102 type L2FibTableDetails struct {
1103         BdID      uint32                         `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
1104         Mac       ethernet_types.MacAddress      `binapi:"mac_address,name=mac" json:"mac,omitempty"`
1105         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1106         StaticMac bool                           `binapi:"bool,name=static_mac" json:"static_mac,omitempty"`
1107         FilterMac bool                           `binapi:"bool,name=filter_mac" json:"filter_mac,omitempty"`
1108         BviMac    bool                           `binapi:"bool,name=bvi_mac" json:"bvi_mac,omitempty"`
1109 }
1110
1111 func (m *L2FibTableDetails) Reset()               { *m = L2FibTableDetails{} }
1112 func (*L2FibTableDetails) GetMessageName() string { return "l2_fib_table_details" }
1113 func (*L2FibTableDetails) GetCrcString() string   { return "e8d2fc72" }
1114 func (*L2FibTableDetails) GetMessageType() api.MessageType {
1115         return api.ReplyMessage
1116 }
1117
1118 func (m *L2FibTableDetails) Size() int {
1119         if m == nil {
1120                 return 0
1121         }
1122         var size int
1123         size += 4     // m.BdID
1124         size += 1 * 6 // m.Mac
1125         size += 4     // m.SwIfIndex
1126         size += 1     // m.StaticMac
1127         size += 1     // m.FilterMac
1128         size += 1     // m.BviMac
1129         return size
1130 }
1131 func (m *L2FibTableDetails) Marshal(b []byte) ([]byte, error) {
1132         var buf *codec.Buffer
1133         if b == nil {
1134                 buf = codec.NewBuffer(make([]byte, m.Size()))
1135         } else {
1136                 buf = codec.NewBuffer(b)
1137         }
1138         buf.EncodeUint32(uint32(m.BdID))
1139         buf.EncodeBytes(m.Mac[:], 6)
1140         buf.EncodeUint32(uint32(m.SwIfIndex))
1141         buf.EncodeBool(m.StaticMac)
1142         buf.EncodeBool(m.FilterMac)
1143         buf.EncodeBool(m.BviMac)
1144         return buf.Bytes(), nil
1145 }
1146 func (m *L2FibTableDetails) Unmarshal(b []byte) error {
1147         buf := codec.NewBuffer(b)
1148         m.BdID = buf.DecodeUint32()
1149         copy(m.Mac[:], buf.DecodeBytes(6))
1150         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1151         m.StaticMac = buf.DecodeBool()
1152         m.FilterMac = buf.DecodeBool()
1153         m.BviMac = buf.DecodeBool()
1154         return nil
1155 }
1156
1157 // L2FibTableDump defines message 'l2_fib_table_dump'.
1158 type L2FibTableDump struct {
1159         BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
1160 }
1161
1162 func (m *L2FibTableDump) Reset()               { *m = L2FibTableDump{} }
1163 func (*L2FibTableDump) GetMessageName() string { return "l2_fib_table_dump" }
1164 func (*L2FibTableDump) GetCrcString() string   { return "c25fdce6" }
1165 func (*L2FibTableDump) GetMessageType() api.MessageType {
1166         return api.RequestMessage
1167 }
1168
1169 func (m *L2FibTableDump) Size() int {
1170         if m == nil {
1171                 return 0
1172         }
1173         var size int
1174         size += 4 // m.BdID
1175         return size
1176 }
1177 func (m *L2FibTableDump) Marshal(b []byte) ([]byte, error) {
1178         var buf *codec.Buffer
1179         if b == nil {
1180                 buf = codec.NewBuffer(make([]byte, m.Size()))
1181         } else {
1182                 buf = codec.NewBuffer(b)
1183         }
1184         buf.EncodeUint32(uint32(m.BdID))
1185         return buf.Bytes(), nil
1186 }
1187 func (m *L2FibTableDump) Unmarshal(b []byte) error {
1188         buf := codec.NewBuffer(b)
1189         m.BdID = buf.DecodeUint32()
1190         return nil
1191 }
1192
1193 // L2Flags defines message 'l2_flags'.
1194 type L2Flags struct {
1195         SwIfIndex     interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1196         IsSet         bool                           `binapi:"bool,name=is_set" json:"is_set,omitempty"`
1197         FeatureBitmap uint32                         `binapi:"u32,name=feature_bitmap" json:"feature_bitmap,omitempty"`
1198 }
1199
1200 func (m *L2Flags) Reset()               { *m = L2Flags{} }
1201 func (*L2Flags) GetMessageName() string { return "l2_flags" }
1202 func (*L2Flags) GetCrcString() string   { return "fc41cfe8" }
1203 func (*L2Flags) GetMessageType() api.MessageType {
1204         return api.RequestMessage
1205 }
1206
1207 func (m *L2Flags) Size() int {
1208         if m == nil {
1209                 return 0
1210         }
1211         var size int
1212         size += 4 // m.SwIfIndex
1213         size += 1 // m.IsSet
1214         size += 4 // m.FeatureBitmap
1215         return size
1216 }
1217 func (m *L2Flags) Marshal(b []byte) ([]byte, error) {
1218         var buf *codec.Buffer
1219         if b == nil {
1220                 buf = codec.NewBuffer(make([]byte, m.Size()))
1221         } else {
1222                 buf = codec.NewBuffer(b)
1223         }
1224         buf.EncodeUint32(uint32(m.SwIfIndex))
1225         buf.EncodeBool(m.IsSet)
1226         buf.EncodeUint32(uint32(m.FeatureBitmap))
1227         return buf.Bytes(), nil
1228 }
1229 func (m *L2Flags) Unmarshal(b []byte) error {
1230         buf := codec.NewBuffer(b)
1231         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1232         m.IsSet = buf.DecodeBool()
1233         m.FeatureBitmap = buf.DecodeUint32()
1234         return nil
1235 }
1236
1237 // L2FlagsReply defines message 'l2_flags_reply'.
1238 type L2FlagsReply struct {
1239         Retval                 int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
1240         ResultingFeatureBitmap uint32 `binapi:"u32,name=resulting_feature_bitmap" json:"resulting_feature_bitmap,omitempty"`
1241 }
1242
1243 func (m *L2FlagsReply) Reset()               { *m = L2FlagsReply{} }
1244 func (*L2FlagsReply) GetMessageName() string { return "l2_flags_reply" }
1245 func (*L2FlagsReply) GetCrcString() string   { return "29b2a2b3" }
1246 func (*L2FlagsReply) GetMessageType() api.MessageType {
1247         return api.ReplyMessage
1248 }
1249
1250 func (m *L2FlagsReply) Size() int {
1251         if m == nil {
1252                 return 0
1253         }
1254         var size int
1255         size += 4 // m.Retval
1256         size += 4 // m.ResultingFeatureBitmap
1257         return size
1258 }
1259 func (m *L2FlagsReply) Marshal(b []byte) ([]byte, error) {
1260         var buf *codec.Buffer
1261         if b == nil {
1262                 buf = codec.NewBuffer(make([]byte, m.Size()))
1263         } else {
1264                 buf = codec.NewBuffer(b)
1265         }
1266         buf.EncodeUint32(uint32(m.Retval))
1267         buf.EncodeUint32(uint32(m.ResultingFeatureBitmap))
1268         return buf.Bytes(), nil
1269 }
1270 func (m *L2FlagsReply) Unmarshal(b []byte) error {
1271         buf := codec.NewBuffer(b)
1272         m.Retval = int32(buf.DecodeUint32())
1273         m.ResultingFeatureBitmap = buf.DecodeUint32()
1274         return nil
1275 }
1276
1277 // L2InterfaceEfpFilter defines message 'l2_interface_efp_filter'.
1278 type L2InterfaceEfpFilter struct {
1279         SwIfIndex     interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1280         EnableDisable bool                           `binapi:"bool,name=enable_disable,default=true" json:"enable_disable,omitempty"`
1281 }
1282
1283 func (m *L2InterfaceEfpFilter) Reset()               { *m = L2InterfaceEfpFilter{} }
1284 func (*L2InterfaceEfpFilter) GetMessageName() string { return "l2_interface_efp_filter" }
1285 func (*L2InterfaceEfpFilter) GetCrcString() string   { return "5501adee" }
1286 func (*L2InterfaceEfpFilter) GetMessageType() api.MessageType {
1287         return api.RequestMessage
1288 }
1289
1290 func (m *L2InterfaceEfpFilter) Size() int {
1291         if m == nil {
1292                 return 0
1293         }
1294         var size int
1295         size += 4 // m.SwIfIndex
1296         size += 1 // m.EnableDisable
1297         return size
1298 }
1299 func (m *L2InterfaceEfpFilter) Marshal(b []byte) ([]byte, error) {
1300         var buf *codec.Buffer
1301         if b == nil {
1302                 buf = codec.NewBuffer(make([]byte, m.Size()))
1303         } else {
1304                 buf = codec.NewBuffer(b)
1305         }
1306         buf.EncodeUint32(uint32(m.SwIfIndex))
1307         buf.EncodeBool(m.EnableDisable)
1308         return buf.Bytes(), nil
1309 }
1310 func (m *L2InterfaceEfpFilter) Unmarshal(b []byte) error {
1311         buf := codec.NewBuffer(b)
1312         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1313         m.EnableDisable = buf.DecodeBool()
1314         return nil
1315 }
1316
1317 // L2InterfaceEfpFilterReply defines message 'l2_interface_efp_filter_reply'.
1318 type L2InterfaceEfpFilterReply struct {
1319         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1320 }
1321
1322 func (m *L2InterfaceEfpFilterReply) Reset()               { *m = L2InterfaceEfpFilterReply{} }
1323 func (*L2InterfaceEfpFilterReply) GetMessageName() string { return "l2_interface_efp_filter_reply" }
1324 func (*L2InterfaceEfpFilterReply) GetCrcString() string   { return "e8d4e804" }
1325 func (*L2InterfaceEfpFilterReply) GetMessageType() api.MessageType {
1326         return api.ReplyMessage
1327 }
1328
1329 func (m *L2InterfaceEfpFilterReply) Size() int {
1330         if m == nil {
1331                 return 0
1332         }
1333         var size int
1334         size += 4 // m.Retval
1335         return size
1336 }
1337 func (m *L2InterfaceEfpFilterReply) Marshal(b []byte) ([]byte, error) {
1338         var buf *codec.Buffer
1339         if b == nil {
1340                 buf = codec.NewBuffer(make([]byte, m.Size()))
1341         } else {
1342                 buf = codec.NewBuffer(b)
1343         }
1344         buf.EncodeUint32(uint32(m.Retval))
1345         return buf.Bytes(), nil
1346 }
1347 func (m *L2InterfaceEfpFilterReply) Unmarshal(b []byte) error {
1348         buf := codec.NewBuffer(b)
1349         m.Retval = int32(buf.DecodeUint32())
1350         return nil
1351 }
1352
1353 // L2InterfacePbbTagRewrite defines message 'l2_interface_pbb_tag_rewrite'.
1354 type L2InterfacePbbTagRewrite struct {
1355         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1356         VtrOp     uint32                         `binapi:"u32,name=vtr_op" json:"vtr_op,omitempty"`
1357         OuterTag  uint16                         `binapi:"u16,name=outer_tag" json:"outer_tag,omitempty"`
1358         BDmac     ethernet_types.MacAddress      `binapi:"mac_address,name=b_dmac" json:"b_dmac,omitempty"`
1359         BSmac     ethernet_types.MacAddress      `binapi:"mac_address,name=b_smac" json:"b_smac,omitempty"`
1360         BVlanid   uint16                         `binapi:"u16,name=b_vlanid" json:"b_vlanid,omitempty"`
1361         ISid      uint32                         `binapi:"u32,name=i_sid" json:"i_sid,omitempty"`
1362 }
1363
1364 func (m *L2InterfacePbbTagRewrite) Reset()               { *m = L2InterfacePbbTagRewrite{} }
1365 func (*L2InterfacePbbTagRewrite) GetMessageName() string { return "l2_interface_pbb_tag_rewrite" }
1366 func (*L2InterfacePbbTagRewrite) GetCrcString() string   { return "612efa5a" }
1367 func (*L2InterfacePbbTagRewrite) GetMessageType() api.MessageType {
1368         return api.RequestMessage
1369 }
1370
1371 func (m *L2InterfacePbbTagRewrite) Size() int {
1372         if m == nil {
1373                 return 0
1374         }
1375         var size int
1376         size += 4     // m.SwIfIndex
1377         size += 4     // m.VtrOp
1378         size += 2     // m.OuterTag
1379         size += 1 * 6 // m.BDmac
1380         size += 1 * 6 // m.BSmac
1381         size += 2     // m.BVlanid
1382         size += 4     // m.ISid
1383         return size
1384 }
1385 func (m *L2InterfacePbbTagRewrite) Marshal(b []byte) ([]byte, error) {
1386         var buf *codec.Buffer
1387         if b == nil {
1388                 buf = codec.NewBuffer(make([]byte, m.Size()))
1389         } else {
1390                 buf = codec.NewBuffer(b)
1391         }
1392         buf.EncodeUint32(uint32(m.SwIfIndex))
1393         buf.EncodeUint32(uint32(m.VtrOp))
1394         buf.EncodeUint16(uint16(m.OuterTag))
1395         buf.EncodeBytes(m.BDmac[:], 6)
1396         buf.EncodeBytes(m.BSmac[:], 6)
1397         buf.EncodeUint16(uint16(m.BVlanid))
1398         buf.EncodeUint32(uint32(m.ISid))
1399         return buf.Bytes(), nil
1400 }
1401 func (m *L2InterfacePbbTagRewrite) Unmarshal(b []byte) error {
1402         buf := codec.NewBuffer(b)
1403         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1404         m.VtrOp = buf.DecodeUint32()
1405         m.OuterTag = buf.DecodeUint16()
1406         copy(m.BDmac[:], buf.DecodeBytes(6))
1407         copy(m.BSmac[:], buf.DecodeBytes(6))
1408         m.BVlanid = buf.DecodeUint16()
1409         m.ISid = buf.DecodeUint32()
1410         return nil
1411 }
1412
1413 // L2InterfacePbbTagRewriteReply defines message 'l2_interface_pbb_tag_rewrite_reply'.
1414 type L2InterfacePbbTagRewriteReply struct {
1415         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1416 }
1417
1418 func (m *L2InterfacePbbTagRewriteReply) Reset() { *m = L2InterfacePbbTagRewriteReply{} }
1419 func (*L2InterfacePbbTagRewriteReply) GetMessageName() string {
1420         return "l2_interface_pbb_tag_rewrite_reply"
1421 }
1422 func (*L2InterfacePbbTagRewriteReply) GetCrcString() string { return "e8d4e804" }
1423 func (*L2InterfacePbbTagRewriteReply) GetMessageType() api.MessageType {
1424         return api.ReplyMessage
1425 }
1426
1427 func (m *L2InterfacePbbTagRewriteReply) Size() int {
1428         if m == nil {
1429                 return 0
1430         }
1431         var size int
1432         size += 4 // m.Retval
1433         return size
1434 }
1435 func (m *L2InterfacePbbTagRewriteReply) Marshal(b []byte) ([]byte, error) {
1436         var buf *codec.Buffer
1437         if b == nil {
1438                 buf = codec.NewBuffer(make([]byte, m.Size()))
1439         } else {
1440                 buf = codec.NewBuffer(b)
1441         }
1442         buf.EncodeUint32(uint32(m.Retval))
1443         return buf.Bytes(), nil
1444 }
1445 func (m *L2InterfacePbbTagRewriteReply) Unmarshal(b []byte) error {
1446         buf := codec.NewBuffer(b)
1447         m.Retval = int32(buf.DecodeUint32())
1448         return nil
1449 }
1450
1451 // L2InterfaceVlanTagRewrite defines message 'l2_interface_vlan_tag_rewrite'.
1452 type L2InterfaceVlanTagRewrite struct {
1453         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1454         VtrOp     uint32                         `binapi:"u32,name=vtr_op" json:"vtr_op,omitempty"`
1455         PushDot1q uint32                         `binapi:"u32,name=push_dot1q" json:"push_dot1q,omitempty"`
1456         Tag1      uint32                         `binapi:"u32,name=tag1" json:"tag1,omitempty"`
1457         Tag2      uint32                         `binapi:"u32,name=tag2" json:"tag2,omitempty"`
1458 }
1459
1460 func (m *L2InterfaceVlanTagRewrite) Reset()               { *m = L2InterfaceVlanTagRewrite{} }
1461 func (*L2InterfaceVlanTagRewrite) GetMessageName() string { return "l2_interface_vlan_tag_rewrite" }
1462 func (*L2InterfaceVlanTagRewrite) GetCrcString() string   { return "62cc0bbc" }
1463 func (*L2InterfaceVlanTagRewrite) GetMessageType() api.MessageType {
1464         return api.RequestMessage
1465 }
1466
1467 func (m *L2InterfaceVlanTagRewrite) Size() int {
1468         if m == nil {
1469                 return 0
1470         }
1471         var size int
1472         size += 4 // m.SwIfIndex
1473         size += 4 // m.VtrOp
1474         size += 4 // m.PushDot1q
1475         size += 4 // m.Tag1
1476         size += 4 // m.Tag2
1477         return size
1478 }
1479 func (m *L2InterfaceVlanTagRewrite) Marshal(b []byte) ([]byte, error) {
1480         var buf *codec.Buffer
1481         if b == nil {
1482                 buf = codec.NewBuffer(make([]byte, m.Size()))
1483         } else {
1484                 buf = codec.NewBuffer(b)
1485         }
1486         buf.EncodeUint32(uint32(m.SwIfIndex))
1487         buf.EncodeUint32(uint32(m.VtrOp))
1488         buf.EncodeUint32(uint32(m.PushDot1q))
1489         buf.EncodeUint32(uint32(m.Tag1))
1490         buf.EncodeUint32(uint32(m.Tag2))
1491         return buf.Bytes(), nil
1492 }
1493 func (m *L2InterfaceVlanTagRewrite) Unmarshal(b []byte) error {
1494         buf := codec.NewBuffer(b)
1495         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1496         m.VtrOp = buf.DecodeUint32()
1497         m.PushDot1q = buf.DecodeUint32()
1498         m.Tag1 = buf.DecodeUint32()
1499         m.Tag2 = buf.DecodeUint32()
1500         return nil
1501 }
1502
1503 // L2InterfaceVlanTagRewriteReply defines message 'l2_interface_vlan_tag_rewrite_reply'.
1504 type L2InterfaceVlanTagRewriteReply struct {
1505         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1506 }
1507
1508 func (m *L2InterfaceVlanTagRewriteReply) Reset() { *m = L2InterfaceVlanTagRewriteReply{} }
1509 func (*L2InterfaceVlanTagRewriteReply) GetMessageName() string {
1510         return "l2_interface_vlan_tag_rewrite_reply"
1511 }
1512 func (*L2InterfaceVlanTagRewriteReply) GetCrcString() string { return "e8d4e804" }
1513 func (*L2InterfaceVlanTagRewriteReply) GetMessageType() api.MessageType {
1514         return api.ReplyMessage
1515 }
1516
1517 func (m *L2InterfaceVlanTagRewriteReply) Size() int {
1518         if m == nil {
1519                 return 0
1520         }
1521         var size int
1522         size += 4 // m.Retval
1523         return size
1524 }
1525 func (m *L2InterfaceVlanTagRewriteReply) Marshal(b []byte) ([]byte, error) {
1526         var buf *codec.Buffer
1527         if b == nil {
1528                 buf = codec.NewBuffer(make([]byte, m.Size()))
1529         } else {
1530                 buf = codec.NewBuffer(b)
1531         }
1532         buf.EncodeUint32(uint32(m.Retval))
1533         return buf.Bytes(), nil
1534 }
1535 func (m *L2InterfaceVlanTagRewriteReply) Unmarshal(b []byte) error {
1536         buf := codec.NewBuffer(b)
1537         m.Retval = int32(buf.DecodeUint32())
1538         return nil
1539 }
1540
1541 // L2MacsEvent defines message 'l2_macs_event'.
1542 type L2MacsEvent struct {
1543         PID   uint32     `binapi:"u32,name=pid" json:"pid,omitempty"`
1544         NMacs uint32     `binapi:"u32,name=n_macs" json:"-"`
1545         Mac   []MacEntry `binapi:"mac_entry[n_macs],name=mac" json:"mac,omitempty"`
1546 }
1547
1548 func (m *L2MacsEvent) Reset()               { *m = L2MacsEvent{} }
1549 func (*L2MacsEvent) GetMessageName() string { return "l2_macs_event" }
1550 func (*L2MacsEvent) GetCrcString() string   { return "2eadfc8b" }
1551 func (*L2MacsEvent) GetMessageType() api.MessageType {
1552         return api.EventMessage
1553 }
1554
1555 func (m *L2MacsEvent) Size() int {
1556         if m == nil {
1557                 return 0
1558         }
1559         var size int
1560         size += 4 // m.PID
1561         size += 4 // m.NMacs
1562         for j1 := 0; j1 < len(m.Mac); j1++ {
1563                 var s1 MacEntry
1564                 _ = s1
1565                 if j1 < len(m.Mac) {
1566                         s1 = m.Mac[j1]
1567                 }
1568                 size += 4     // s1.SwIfIndex
1569                 size += 1 * 6 // s1.MacAddr
1570                 size += 4     // s1.Action
1571                 size += 1     // s1.Flags
1572         }
1573         return size
1574 }
1575 func (m *L2MacsEvent) Marshal(b []byte) ([]byte, error) {
1576         var buf *codec.Buffer
1577         if b == nil {
1578                 buf = codec.NewBuffer(make([]byte, m.Size()))
1579         } else {
1580                 buf = codec.NewBuffer(b)
1581         }
1582         buf.EncodeUint32(uint32(m.PID))
1583         buf.EncodeUint32(uint32(len(m.Mac)))
1584         for j0 := 0; j0 < len(m.Mac); j0++ {
1585                 var v0 MacEntry
1586                 if j0 < len(m.Mac) {
1587                         v0 = m.Mac[j0]
1588                 }
1589                 buf.EncodeUint32(uint32(v0.SwIfIndex))
1590                 buf.EncodeBytes(v0.MacAddr[:], 6)
1591                 buf.EncodeUint32(uint32(v0.Action))
1592                 buf.EncodeUint8(uint8(v0.Flags))
1593         }
1594         return buf.Bytes(), nil
1595 }
1596 func (m *L2MacsEvent) Unmarshal(b []byte) error {
1597         buf := codec.NewBuffer(b)
1598         m.PID = buf.DecodeUint32()
1599         m.NMacs = buf.DecodeUint32()
1600         m.Mac = make([]MacEntry, int(m.NMacs))
1601         for j0 := 0; j0 < len(m.Mac); j0++ {
1602                 m.Mac[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1603                 copy(m.Mac[j0].MacAddr[:], buf.DecodeBytes(6))
1604                 m.Mac[j0].Action = MacEventAction(buf.DecodeUint32())
1605                 m.Mac[j0].Flags = buf.DecodeUint8()
1606         }
1607         return nil
1608 }
1609
1610 // L2PatchAddDel defines message 'l2_patch_add_del'.
1611 type L2PatchAddDel struct {
1612         RxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
1613         TxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=tx_sw_if_index" json:"tx_sw_if_index,omitempty"`
1614         IsAdd       bool                           `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
1615 }
1616
1617 func (m *L2PatchAddDel) Reset()               { *m = L2PatchAddDel{} }
1618 func (*L2PatchAddDel) GetMessageName() string { return "l2_patch_add_del" }
1619 func (*L2PatchAddDel) GetCrcString() string   { return "522f3445" }
1620 func (*L2PatchAddDel) GetMessageType() api.MessageType {
1621         return api.RequestMessage
1622 }
1623
1624 func (m *L2PatchAddDel) Size() int {
1625         if m == nil {
1626                 return 0
1627         }
1628         var size int
1629         size += 4 // m.RxSwIfIndex
1630         size += 4 // m.TxSwIfIndex
1631         size += 1 // m.IsAdd
1632         return size
1633 }
1634 func (m *L2PatchAddDel) Marshal(b []byte) ([]byte, error) {
1635         var buf *codec.Buffer
1636         if b == nil {
1637                 buf = codec.NewBuffer(make([]byte, m.Size()))
1638         } else {
1639                 buf = codec.NewBuffer(b)
1640         }
1641         buf.EncodeUint32(uint32(m.RxSwIfIndex))
1642         buf.EncodeUint32(uint32(m.TxSwIfIndex))
1643         buf.EncodeBool(m.IsAdd)
1644         return buf.Bytes(), nil
1645 }
1646 func (m *L2PatchAddDel) Unmarshal(b []byte) error {
1647         buf := codec.NewBuffer(b)
1648         m.RxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1649         m.TxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1650         m.IsAdd = buf.DecodeBool()
1651         return nil
1652 }
1653
1654 // L2PatchAddDelReply defines message 'l2_patch_add_del_reply'.
1655 type L2PatchAddDelReply struct {
1656         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1657 }
1658
1659 func (m *L2PatchAddDelReply) Reset()               { *m = L2PatchAddDelReply{} }
1660 func (*L2PatchAddDelReply) GetMessageName() string { return "l2_patch_add_del_reply" }
1661 func (*L2PatchAddDelReply) GetCrcString() string   { return "e8d4e804" }
1662 func (*L2PatchAddDelReply) GetMessageType() api.MessageType {
1663         return api.ReplyMessage
1664 }
1665
1666 func (m *L2PatchAddDelReply) Size() int {
1667         if m == nil {
1668                 return 0
1669         }
1670         var size int
1671         size += 4 // m.Retval
1672         return size
1673 }
1674 func (m *L2PatchAddDelReply) Marshal(b []byte) ([]byte, error) {
1675         var buf *codec.Buffer
1676         if b == nil {
1677                 buf = codec.NewBuffer(make([]byte, m.Size()))
1678         } else {
1679                 buf = codec.NewBuffer(b)
1680         }
1681         buf.EncodeUint32(uint32(m.Retval))
1682         return buf.Bytes(), nil
1683 }
1684 func (m *L2PatchAddDelReply) Unmarshal(b []byte) error {
1685         buf := codec.NewBuffer(b)
1686         m.Retval = int32(buf.DecodeUint32())
1687         return nil
1688 }
1689
1690 // L2XconnectDetails defines message 'l2_xconnect_details'.
1691 type L2XconnectDetails struct {
1692         RxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
1693         TxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=tx_sw_if_index" json:"tx_sw_if_index,omitempty"`
1694 }
1695
1696 func (m *L2XconnectDetails) Reset()               { *m = L2XconnectDetails{} }
1697 func (*L2XconnectDetails) GetMessageName() string { return "l2_xconnect_details" }
1698 func (*L2XconnectDetails) GetCrcString() string   { return "c8aa6b37" }
1699 func (*L2XconnectDetails) GetMessageType() api.MessageType {
1700         return api.ReplyMessage
1701 }
1702
1703 func (m *L2XconnectDetails) Size() int {
1704         if m == nil {
1705                 return 0
1706         }
1707         var size int
1708         size += 4 // m.RxSwIfIndex
1709         size += 4 // m.TxSwIfIndex
1710         return size
1711 }
1712 func (m *L2XconnectDetails) Marshal(b []byte) ([]byte, error) {
1713         var buf *codec.Buffer
1714         if b == nil {
1715                 buf = codec.NewBuffer(make([]byte, m.Size()))
1716         } else {
1717                 buf = codec.NewBuffer(b)
1718         }
1719         buf.EncodeUint32(uint32(m.RxSwIfIndex))
1720         buf.EncodeUint32(uint32(m.TxSwIfIndex))
1721         return buf.Bytes(), nil
1722 }
1723 func (m *L2XconnectDetails) Unmarshal(b []byte) error {
1724         buf := codec.NewBuffer(b)
1725         m.RxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1726         m.TxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1727         return nil
1728 }
1729
1730 // L2XconnectDump defines message 'l2_xconnect_dump'.
1731 type L2XconnectDump struct{}
1732
1733 func (m *L2XconnectDump) Reset()               { *m = L2XconnectDump{} }
1734 func (*L2XconnectDump) GetMessageName() string { return "l2_xconnect_dump" }
1735 func (*L2XconnectDump) GetCrcString() string   { return "51077d14" }
1736 func (*L2XconnectDump) GetMessageType() api.MessageType {
1737         return api.RequestMessage
1738 }
1739
1740 func (m *L2XconnectDump) Size() int {
1741         if m == nil {
1742                 return 0
1743         }
1744         var size int
1745         return size
1746 }
1747 func (m *L2XconnectDump) Marshal(b []byte) ([]byte, error) {
1748         var buf *codec.Buffer
1749         if b == nil {
1750                 buf = codec.NewBuffer(make([]byte, m.Size()))
1751         } else {
1752                 buf = codec.NewBuffer(b)
1753         }
1754         return buf.Bytes(), nil
1755 }
1756 func (m *L2XconnectDump) Unmarshal(b []byte) error {
1757         return nil
1758 }
1759
1760 // L2fibAddDel defines message 'l2fib_add_del'.
1761 type L2fibAddDel struct {
1762         Mac       ethernet_types.MacAddress      `binapi:"mac_address,name=mac" json:"mac,omitempty"`
1763         BdID      uint32                         `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
1764         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1765         IsAdd     bool                           `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
1766         StaticMac bool                           `binapi:"bool,name=static_mac" json:"static_mac,omitempty"`
1767         FilterMac bool                           `binapi:"bool,name=filter_mac" json:"filter_mac,omitempty"`
1768         BviMac    bool                           `binapi:"bool,name=bvi_mac" json:"bvi_mac,omitempty"`
1769 }
1770
1771 func (m *L2fibAddDel) Reset()               { *m = L2fibAddDel{} }
1772 func (*L2fibAddDel) GetMessageName() string { return "l2fib_add_del" }
1773 func (*L2fibAddDel) GetCrcString() string   { return "f29d796c" }
1774 func (*L2fibAddDel) GetMessageType() api.MessageType {
1775         return api.RequestMessage
1776 }
1777
1778 func (m *L2fibAddDel) Size() int {
1779         if m == nil {
1780                 return 0
1781         }
1782         var size int
1783         size += 1 * 6 // m.Mac
1784         size += 4     // m.BdID
1785         size += 4     // m.SwIfIndex
1786         size += 1     // m.IsAdd
1787         size += 1     // m.StaticMac
1788         size += 1     // m.FilterMac
1789         size += 1     // m.BviMac
1790         return size
1791 }
1792 func (m *L2fibAddDel) Marshal(b []byte) ([]byte, error) {
1793         var buf *codec.Buffer
1794         if b == nil {
1795                 buf = codec.NewBuffer(make([]byte, m.Size()))
1796         } else {
1797                 buf = codec.NewBuffer(b)
1798         }
1799         buf.EncodeBytes(m.Mac[:], 6)
1800         buf.EncodeUint32(uint32(m.BdID))
1801         buf.EncodeUint32(uint32(m.SwIfIndex))
1802         buf.EncodeBool(m.IsAdd)
1803         buf.EncodeBool(m.StaticMac)
1804         buf.EncodeBool(m.FilterMac)
1805         buf.EncodeBool(m.BviMac)
1806         return buf.Bytes(), nil
1807 }
1808 func (m *L2fibAddDel) Unmarshal(b []byte) error {
1809         buf := codec.NewBuffer(b)
1810         copy(m.Mac[:], buf.DecodeBytes(6))
1811         m.BdID = buf.DecodeUint32()
1812         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1813         m.IsAdd = buf.DecodeBool()
1814         m.StaticMac = buf.DecodeBool()
1815         m.FilterMac = buf.DecodeBool()
1816         m.BviMac = buf.DecodeBool()
1817         return nil
1818 }
1819
1820 // L2fibAddDelReply defines message 'l2fib_add_del_reply'.
1821 type L2fibAddDelReply struct {
1822         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1823 }
1824
1825 func (m *L2fibAddDelReply) Reset()               { *m = L2fibAddDelReply{} }
1826 func (*L2fibAddDelReply) GetMessageName() string { return "l2fib_add_del_reply" }
1827 func (*L2fibAddDelReply) GetCrcString() string   { return "e8d4e804" }
1828 func (*L2fibAddDelReply) GetMessageType() api.MessageType {
1829         return api.ReplyMessage
1830 }
1831
1832 func (m *L2fibAddDelReply) Size() int {
1833         if m == nil {
1834                 return 0
1835         }
1836         var size int
1837         size += 4 // m.Retval
1838         return size
1839 }
1840 func (m *L2fibAddDelReply) Marshal(b []byte) ([]byte, error) {
1841         var buf *codec.Buffer
1842         if b == nil {
1843                 buf = codec.NewBuffer(make([]byte, m.Size()))
1844         } else {
1845                 buf = codec.NewBuffer(b)
1846         }
1847         buf.EncodeUint32(uint32(m.Retval))
1848         return buf.Bytes(), nil
1849 }
1850 func (m *L2fibAddDelReply) Unmarshal(b []byte) error {
1851         buf := codec.NewBuffer(b)
1852         m.Retval = int32(buf.DecodeUint32())
1853         return nil
1854 }
1855
1856 // L2fibFlushAll defines message 'l2fib_flush_all'.
1857 type L2fibFlushAll struct{}
1858
1859 func (m *L2fibFlushAll) Reset()               { *m = L2fibFlushAll{} }
1860 func (*L2fibFlushAll) GetMessageName() string { return "l2fib_flush_all" }
1861 func (*L2fibFlushAll) GetCrcString() string   { return "51077d14" }
1862 func (*L2fibFlushAll) GetMessageType() api.MessageType {
1863         return api.RequestMessage
1864 }
1865
1866 func (m *L2fibFlushAll) Size() int {
1867         if m == nil {
1868                 return 0
1869         }
1870         var size int
1871         return size
1872 }
1873 func (m *L2fibFlushAll) Marshal(b []byte) ([]byte, error) {
1874         var buf *codec.Buffer
1875         if b == nil {
1876                 buf = codec.NewBuffer(make([]byte, m.Size()))
1877         } else {
1878                 buf = codec.NewBuffer(b)
1879         }
1880         return buf.Bytes(), nil
1881 }
1882 func (m *L2fibFlushAll) Unmarshal(b []byte) error {
1883         return nil
1884 }
1885
1886 // L2fibFlushAllReply defines message 'l2fib_flush_all_reply'.
1887 type L2fibFlushAllReply struct {
1888         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1889 }
1890
1891 func (m *L2fibFlushAllReply) Reset()               { *m = L2fibFlushAllReply{} }
1892 func (*L2fibFlushAllReply) GetMessageName() string { return "l2fib_flush_all_reply" }
1893 func (*L2fibFlushAllReply) GetCrcString() string   { return "e8d4e804" }
1894 func (*L2fibFlushAllReply) GetMessageType() api.MessageType {
1895         return api.ReplyMessage
1896 }
1897
1898 func (m *L2fibFlushAllReply) Size() int {
1899         if m == nil {
1900                 return 0
1901         }
1902         var size int
1903         size += 4 // m.Retval
1904         return size
1905 }
1906 func (m *L2fibFlushAllReply) Marshal(b []byte) ([]byte, error) {
1907         var buf *codec.Buffer
1908         if b == nil {
1909                 buf = codec.NewBuffer(make([]byte, m.Size()))
1910         } else {
1911                 buf = codec.NewBuffer(b)
1912         }
1913         buf.EncodeUint32(uint32(m.Retval))
1914         return buf.Bytes(), nil
1915 }
1916 func (m *L2fibFlushAllReply) Unmarshal(b []byte) error {
1917         buf := codec.NewBuffer(b)
1918         m.Retval = int32(buf.DecodeUint32())
1919         return nil
1920 }
1921
1922 // L2fibFlushBd defines message 'l2fib_flush_bd'.
1923 type L2fibFlushBd struct {
1924         BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
1925 }
1926
1927 func (m *L2fibFlushBd) Reset()               { *m = L2fibFlushBd{} }
1928 func (*L2fibFlushBd) GetMessageName() string { return "l2fib_flush_bd" }
1929 func (*L2fibFlushBd) GetCrcString() string   { return "c25fdce6" }
1930 func (*L2fibFlushBd) GetMessageType() api.MessageType {
1931         return api.RequestMessage
1932 }
1933
1934 func (m *L2fibFlushBd) Size() int {
1935         if m == nil {
1936                 return 0
1937         }
1938         var size int
1939         size += 4 // m.BdID
1940         return size
1941 }
1942 func (m *L2fibFlushBd) Marshal(b []byte) ([]byte, error) {
1943         var buf *codec.Buffer
1944         if b == nil {
1945                 buf = codec.NewBuffer(make([]byte, m.Size()))
1946         } else {
1947                 buf = codec.NewBuffer(b)
1948         }
1949         buf.EncodeUint32(uint32(m.BdID))
1950         return buf.Bytes(), nil
1951 }
1952 func (m *L2fibFlushBd) Unmarshal(b []byte) error {
1953         buf := codec.NewBuffer(b)
1954         m.BdID = buf.DecodeUint32()
1955         return nil
1956 }
1957
1958 // L2fibFlushBdReply defines message 'l2fib_flush_bd_reply'.
1959 type L2fibFlushBdReply struct {
1960         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1961 }
1962
1963 func (m *L2fibFlushBdReply) Reset()               { *m = L2fibFlushBdReply{} }
1964 func (*L2fibFlushBdReply) GetMessageName() string { return "l2fib_flush_bd_reply" }
1965 func (*L2fibFlushBdReply) GetCrcString() string   { return "e8d4e804" }
1966 func (*L2fibFlushBdReply) GetMessageType() api.MessageType {
1967         return api.ReplyMessage
1968 }
1969
1970 func (m *L2fibFlushBdReply) Size() int {
1971         if m == nil {
1972                 return 0
1973         }
1974         var size int
1975         size += 4 // m.Retval
1976         return size
1977 }
1978 func (m *L2fibFlushBdReply) Marshal(b []byte) ([]byte, error) {
1979         var buf *codec.Buffer
1980         if b == nil {
1981                 buf = codec.NewBuffer(make([]byte, m.Size()))
1982         } else {
1983                 buf = codec.NewBuffer(b)
1984         }
1985         buf.EncodeUint32(uint32(m.Retval))
1986         return buf.Bytes(), nil
1987 }
1988 func (m *L2fibFlushBdReply) Unmarshal(b []byte) error {
1989         buf := codec.NewBuffer(b)
1990         m.Retval = int32(buf.DecodeUint32())
1991         return nil
1992 }
1993
1994 // L2fibFlushInt defines message 'l2fib_flush_int'.
1995 type L2fibFlushInt struct {
1996         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1997 }
1998
1999 func (m *L2fibFlushInt) Reset()               { *m = L2fibFlushInt{} }
2000 func (*L2fibFlushInt) GetMessageName() string { return "l2fib_flush_int" }
2001 func (*L2fibFlushInt) GetCrcString() string   { return "f9e6675e" }
2002 func (*L2fibFlushInt) GetMessageType() api.MessageType {
2003         return api.RequestMessage
2004 }
2005
2006 func (m *L2fibFlushInt) Size() int {
2007         if m == nil {
2008                 return 0
2009         }
2010         var size int
2011         size += 4 // m.SwIfIndex
2012         return size
2013 }
2014 func (m *L2fibFlushInt) Marshal(b []byte) ([]byte, error) {
2015         var buf *codec.Buffer
2016         if b == nil {
2017                 buf = codec.NewBuffer(make([]byte, m.Size()))
2018         } else {
2019                 buf = codec.NewBuffer(b)
2020         }
2021         buf.EncodeUint32(uint32(m.SwIfIndex))
2022         return buf.Bytes(), nil
2023 }
2024 func (m *L2fibFlushInt) Unmarshal(b []byte) error {
2025         buf := codec.NewBuffer(b)
2026         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
2027         return nil
2028 }
2029
2030 // L2fibFlushIntReply defines message 'l2fib_flush_int_reply'.
2031 type L2fibFlushIntReply struct {
2032         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2033 }
2034
2035 func (m *L2fibFlushIntReply) Reset()               { *m = L2fibFlushIntReply{} }
2036 func (*L2fibFlushIntReply) GetMessageName() string { return "l2fib_flush_int_reply" }
2037 func (*L2fibFlushIntReply) GetCrcString() string   { return "e8d4e804" }
2038 func (*L2fibFlushIntReply) GetMessageType() api.MessageType {
2039         return api.ReplyMessage
2040 }
2041
2042 func (m *L2fibFlushIntReply) Size() int {
2043         if m == nil {
2044                 return 0
2045         }
2046         var size int
2047         size += 4 // m.Retval
2048         return size
2049 }
2050 func (m *L2fibFlushIntReply) Marshal(b []byte) ([]byte, error) {
2051         var buf *codec.Buffer
2052         if b == nil {
2053                 buf = codec.NewBuffer(make([]byte, m.Size()))
2054         } else {
2055                 buf = codec.NewBuffer(b)
2056         }
2057         buf.EncodeUint32(uint32(m.Retval))
2058         return buf.Bytes(), nil
2059 }
2060 func (m *L2fibFlushIntReply) Unmarshal(b []byte) error {
2061         buf := codec.NewBuffer(b)
2062         m.Retval = int32(buf.DecodeUint32())
2063         return nil
2064 }
2065
2066 // SwInterfaceSetL2Bridge defines message 'sw_interface_set_l2_bridge'.
2067 type SwInterfaceSetL2Bridge struct {
2068         RxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
2069         BdID        uint32                         `binapi:"u32,name=bd_id" json:"bd_id,omitempty"`
2070         PortType    L2PortType                     `binapi:"l2_port_type,name=port_type" json:"port_type,omitempty"`
2071         Shg         uint8                          `binapi:"u8,name=shg" json:"shg,omitempty"`
2072         Enable      bool                           `binapi:"bool,name=enable,default=true" json:"enable,omitempty"`
2073 }
2074
2075 func (m *SwInterfaceSetL2Bridge) Reset()               { *m = SwInterfaceSetL2Bridge{} }
2076 func (*SwInterfaceSetL2Bridge) GetMessageName() string { return "sw_interface_set_l2_bridge" }
2077 func (*SwInterfaceSetL2Bridge) GetCrcString() string   { return "2e483cd0" }
2078 func (*SwInterfaceSetL2Bridge) GetMessageType() api.MessageType {
2079         return api.RequestMessage
2080 }
2081
2082 func (m *SwInterfaceSetL2Bridge) Size() int {
2083         if m == nil {
2084                 return 0
2085         }
2086         var size int
2087         size += 4 // m.RxSwIfIndex
2088         size += 4 // m.BdID
2089         size += 4 // m.PortType
2090         size += 1 // m.Shg
2091         size += 1 // m.Enable
2092         return size
2093 }
2094 func (m *SwInterfaceSetL2Bridge) Marshal(b []byte) ([]byte, error) {
2095         var buf *codec.Buffer
2096         if b == nil {
2097                 buf = codec.NewBuffer(make([]byte, m.Size()))
2098         } else {
2099                 buf = codec.NewBuffer(b)
2100         }
2101         buf.EncodeUint32(uint32(m.RxSwIfIndex))
2102         buf.EncodeUint32(uint32(m.BdID))
2103         buf.EncodeUint32(uint32(m.PortType))
2104         buf.EncodeUint8(uint8(m.Shg))
2105         buf.EncodeBool(m.Enable)
2106         return buf.Bytes(), nil
2107 }
2108 func (m *SwInterfaceSetL2Bridge) Unmarshal(b []byte) error {
2109         buf := codec.NewBuffer(b)
2110         m.RxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
2111         m.BdID = buf.DecodeUint32()
2112         m.PortType = L2PortType(buf.DecodeUint32())
2113         m.Shg = buf.DecodeUint8()
2114         m.Enable = buf.DecodeBool()
2115         return nil
2116 }
2117
2118 // SwInterfaceSetL2BridgeReply defines message 'sw_interface_set_l2_bridge_reply'.
2119 type SwInterfaceSetL2BridgeReply struct {
2120         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2121 }
2122
2123 func (m *SwInterfaceSetL2BridgeReply) Reset() { *m = SwInterfaceSetL2BridgeReply{} }
2124 func (*SwInterfaceSetL2BridgeReply) GetMessageName() string {
2125         return "sw_interface_set_l2_bridge_reply"
2126 }
2127 func (*SwInterfaceSetL2BridgeReply) GetCrcString() string { return "e8d4e804" }
2128 func (*SwInterfaceSetL2BridgeReply) GetMessageType() api.MessageType {
2129         return api.ReplyMessage
2130 }
2131
2132 func (m *SwInterfaceSetL2BridgeReply) Size() int {
2133         if m == nil {
2134                 return 0
2135         }
2136         var size int
2137         size += 4 // m.Retval
2138         return size
2139 }
2140 func (m *SwInterfaceSetL2BridgeReply) Marshal(b []byte) ([]byte, error) {
2141         var buf *codec.Buffer
2142         if b == nil {
2143                 buf = codec.NewBuffer(make([]byte, m.Size()))
2144         } else {
2145                 buf = codec.NewBuffer(b)
2146         }
2147         buf.EncodeUint32(uint32(m.Retval))
2148         return buf.Bytes(), nil
2149 }
2150 func (m *SwInterfaceSetL2BridgeReply) Unmarshal(b []byte) error {
2151         buf := codec.NewBuffer(b)
2152         m.Retval = int32(buf.DecodeUint32())
2153         return nil
2154 }
2155
2156 // SwInterfaceSetL2Xconnect defines message 'sw_interface_set_l2_xconnect'.
2157 type SwInterfaceSetL2Xconnect struct {
2158         RxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"`
2159         TxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=tx_sw_if_index" json:"tx_sw_if_index,omitempty"`
2160         Enable      bool                           `binapi:"bool,name=enable,default=true" json:"enable,omitempty"`
2161 }
2162
2163 func (m *SwInterfaceSetL2Xconnect) Reset()               { *m = SwInterfaceSetL2Xconnect{} }
2164 func (*SwInterfaceSetL2Xconnect) GetMessageName() string { return "sw_interface_set_l2_xconnect" }
2165 func (*SwInterfaceSetL2Xconnect) GetCrcString() string   { return "1aaa2dbb" }
2166 func (*SwInterfaceSetL2Xconnect) GetMessageType() api.MessageType {
2167         return api.RequestMessage
2168 }
2169
2170 func (m *SwInterfaceSetL2Xconnect) Size() int {
2171         if m == nil {
2172                 return 0
2173         }
2174         var size int
2175         size += 4 // m.RxSwIfIndex
2176         size += 4 // m.TxSwIfIndex
2177         size += 1 // m.Enable
2178         return size
2179 }
2180 func (m *SwInterfaceSetL2Xconnect) Marshal(b []byte) ([]byte, error) {
2181         var buf *codec.Buffer
2182         if b == nil {
2183                 buf = codec.NewBuffer(make([]byte, m.Size()))
2184         } else {
2185                 buf = codec.NewBuffer(b)
2186         }
2187         buf.EncodeUint32(uint32(m.RxSwIfIndex))
2188         buf.EncodeUint32(uint32(m.TxSwIfIndex))
2189         buf.EncodeBool(m.Enable)
2190         return buf.Bytes(), nil
2191 }
2192 func (m *SwInterfaceSetL2Xconnect) Unmarshal(b []byte) error {
2193         buf := codec.NewBuffer(b)
2194         m.RxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
2195         m.TxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
2196         m.Enable = buf.DecodeBool()
2197         return nil
2198 }
2199
2200 // SwInterfaceSetL2XconnectReply defines message 'sw_interface_set_l2_xconnect_reply'.
2201 type SwInterfaceSetL2XconnectReply struct {
2202         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2203 }
2204
2205 func (m *SwInterfaceSetL2XconnectReply) Reset() { *m = SwInterfaceSetL2XconnectReply{} }
2206 func (*SwInterfaceSetL2XconnectReply) GetMessageName() string {
2207         return "sw_interface_set_l2_xconnect_reply"
2208 }
2209 func (*SwInterfaceSetL2XconnectReply) GetCrcString() string { return "e8d4e804" }
2210 func (*SwInterfaceSetL2XconnectReply) GetMessageType() api.MessageType {
2211         return api.ReplyMessage
2212 }
2213
2214 func (m *SwInterfaceSetL2XconnectReply) Size() int {
2215         if m == nil {
2216                 return 0
2217         }
2218         var size int
2219         size += 4 // m.Retval
2220         return size
2221 }
2222 func (m *SwInterfaceSetL2XconnectReply) Marshal(b []byte) ([]byte, error) {
2223         var buf *codec.Buffer
2224         if b == nil {
2225                 buf = codec.NewBuffer(make([]byte, m.Size()))
2226         } else {
2227                 buf = codec.NewBuffer(b)
2228         }
2229         buf.EncodeUint32(uint32(m.Retval))
2230         return buf.Bytes(), nil
2231 }
2232 func (m *SwInterfaceSetL2XconnectReply) Unmarshal(b []byte) error {
2233         buf := codec.NewBuffer(b)
2234         m.Retval = int32(buf.DecodeUint32())
2235         return nil
2236 }
2237
2238 // SwInterfaceSetVpath defines message 'sw_interface_set_vpath'.
2239 type SwInterfaceSetVpath struct {
2240         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
2241         Enable    bool                           `binapi:"bool,name=enable,default=%!s(float64=4.294967295e+09)" json:"enable,omitempty"`
2242 }
2243
2244 func (m *SwInterfaceSetVpath) Reset()               { *m = SwInterfaceSetVpath{} }
2245 func (*SwInterfaceSetVpath) GetMessageName() string { return "sw_interface_set_vpath" }
2246 func (*SwInterfaceSetVpath) GetCrcString() string   { return "ae6cfcfb" }
2247 func (*SwInterfaceSetVpath) GetMessageType() api.MessageType {
2248         return api.RequestMessage
2249 }
2250
2251 func (m *SwInterfaceSetVpath) Size() int {
2252         if m == nil {
2253                 return 0
2254         }
2255         var size int
2256         size += 4 // m.SwIfIndex
2257         size += 1 // m.Enable
2258         return size
2259 }
2260 func (m *SwInterfaceSetVpath) Marshal(b []byte) ([]byte, error) {
2261         var buf *codec.Buffer
2262         if b == nil {
2263                 buf = codec.NewBuffer(make([]byte, m.Size()))
2264         } else {
2265                 buf = codec.NewBuffer(b)
2266         }
2267         buf.EncodeUint32(uint32(m.SwIfIndex))
2268         buf.EncodeBool(m.Enable)
2269         return buf.Bytes(), nil
2270 }
2271 func (m *SwInterfaceSetVpath) Unmarshal(b []byte) error {
2272         buf := codec.NewBuffer(b)
2273         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
2274         m.Enable = buf.DecodeBool()
2275         return nil
2276 }
2277
2278 // SwInterfaceSetVpathReply defines message 'sw_interface_set_vpath_reply'.
2279 type SwInterfaceSetVpathReply struct {
2280         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2281 }
2282
2283 func (m *SwInterfaceSetVpathReply) Reset()               { *m = SwInterfaceSetVpathReply{} }
2284 func (*SwInterfaceSetVpathReply) GetMessageName() string { return "sw_interface_set_vpath_reply" }
2285 func (*SwInterfaceSetVpathReply) GetCrcString() string   { return "e8d4e804" }
2286 func (*SwInterfaceSetVpathReply) GetMessageType() api.MessageType {
2287         return api.ReplyMessage
2288 }
2289
2290 func (m *SwInterfaceSetVpathReply) Size() int {
2291         if m == nil {
2292                 return 0
2293         }
2294         var size int
2295         size += 4 // m.Retval
2296         return size
2297 }
2298 func (m *SwInterfaceSetVpathReply) Marshal(b []byte) ([]byte, error) {
2299         var buf *codec.Buffer
2300         if b == nil {
2301                 buf = codec.NewBuffer(make([]byte, m.Size()))
2302         } else {
2303                 buf = codec.NewBuffer(b)
2304         }
2305         buf.EncodeUint32(uint32(m.Retval))
2306         return buf.Bytes(), nil
2307 }
2308 func (m *SwInterfaceSetVpathReply) Unmarshal(b []byte) error {
2309         buf := codec.NewBuffer(b)
2310         m.Retval = int32(buf.DecodeUint32())
2311         return nil
2312 }
2313
2314 // WantL2ArpTermEvents defines message 'want_l2_arp_term_events'.
2315 type WantL2ArpTermEvents struct {
2316         Enable bool   `binapi:"bool,name=enable" json:"enable,omitempty"`
2317         PID    uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
2318 }
2319
2320 func (m *WantL2ArpTermEvents) Reset()               { *m = WantL2ArpTermEvents{} }
2321 func (*WantL2ArpTermEvents) GetMessageName() string { return "want_l2_arp_term_events" }
2322 func (*WantL2ArpTermEvents) GetCrcString() string   { return "3ec6d6c2" }
2323 func (*WantL2ArpTermEvents) GetMessageType() api.MessageType {
2324         return api.RequestMessage
2325 }
2326
2327 func (m *WantL2ArpTermEvents) Size() int {
2328         if m == nil {
2329                 return 0
2330         }
2331         var size int
2332         size += 1 // m.Enable
2333         size += 4 // m.PID
2334         return size
2335 }
2336 func (m *WantL2ArpTermEvents) Marshal(b []byte) ([]byte, error) {
2337         var buf *codec.Buffer
2338         if b == nil {
2339                 buf = codec.NewBuffer(make([]byte, m.Size()))
2340         } else {
2341                 buf = codec.NewBuffer(b)
2342         }
2343         buf.EncodeBool(m.Enable)
2344         buf.EncodeUint32(uint32(m.PID))
2345         return buf.Bytes(), nil
2346 }
2347 func (m *WantL2ArpTermEvents) Unmarshal(b []byte) error {
2348         buf := codec.NewBuffer(b)
2349         m.Enable = buf.DecodeBool()
2350         m.PID = buf.DecodeUint32()
2351         return nil
2352 }
2353
2354 // WantL2ArpTermEventsReply defines message 'want_l2_arp_term_events_reply'.
2355 type WantL2ArpTermEventsReply struct {
2356         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2357 }
2358
2359 func (m *WantL2ArpTermEventsReply) Reset()               { *m = WantL2ArpTermEventsReply{} }
2360 func (*WantL2ArpTermEventsReply) GetMessageName() string { return "want_l2_arp_term_events_reply" }
2361 func (*WantL2ArpTermEventsReply) GetCrcString() string   { return "e8d4e804" }
2362 func (*WantL2ArpTermEventsReply) GetMessageType() api.MessageType {
2363         return api.ReplyMessage
2364 }
2365
2366 func (m *WantL2ArpTermEventsReply) Size() int {
2367         if m == nil {
2368                 return 0
2369         }
2370         var size int
2371         size += 4 // m.Retval
2372         return size
2373 }
2374 func (m *WantL2ArpTermEventsReply) Marshal(b []byte) ([]byte, error) {
2375         var buf *codec.Buffer
2376         if b == nil {
2377                 buf = codec.NewBuffer(make([]byte, m.Size()))
2378         } else {
2379                 buf = codec.NewBuffer(b)
2380         }
2381         buf.EncodeUint32(uint32(m.Retval))
2382         return buf.Bytes(), nil
2383 }
2384 func (m *WantL2ArpTermEventsReply) Unmarshal(b []byte) error {
2385         buf := codec.NewBuffer(b)
2386         m.Retval = int32(buf.DecodeUint32())
2387         return nil
2388 }
2389
2390 // WantL2MacsEvents defines message 'want_l2_macs_events'.
2391 type WantL2MacsEvents struct {
2392         LearnLimit     uint32 `binapi:"u32,name=learn_limit,default=%!s(float64=1000)" json:"learn_limit,omitempty"`
2393         ScanDelay      uint8  `binapi:"u8,name=scan_delay,default=%!s(float64=10)" json:"scan_delay,omitempty"`
2394         MaxMacsInEvent uint8  `binapi:"u8,name=max_macs_in_event,default=%!s(float64=10)" json:"max_macs_in_event,omitempty"`
2395         EnableDisable  bool   `binapi:"bool,name=enable_disable,default=true" json:"enable_disable,omitempty"`
2396         PID            uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
2397 }
2398
2399 func (m *WantL2MacsEvents) Reset()               { *m = WantL2MacsEvents{} }
2400 func (*WantL2MacsEvents) GetMessageName() string { return "want_l2_macs_events" }
2401 func (*WantL2MacsEvents) GetCrcString() string   { return "9aabdfde" }
2402 func (*WantL2MacsEvents) GetMessageType() api.MessageType {
2403         return api.RequestMessage
2404 }
2405
2406 func (m *WantL2MacsEvents) Size() int {
2407         if m == nil {
2408                 return 0
2409         }
2410         var size int
2411         size += 4 // m.LearnLimit
2412         size += 1 // m.ScanDelay
2413         size += 1 // m.MaxMacsInEvent
2414         size += 1 // m.EnableDisable
2415         size += 4 // m.PID
2416         return size
2417 }
2418 func (m *WantL2MacsEvents) Marshal(b []byte) ([]byte, error) {
2419         var buf *codec.Buffer
2420         if b == nil {
2421                 buf = codec.NewBuffer(make([]byte, m.Size()))
2422         } else {
2423                 buf = codec.NewBuffer(b)
2424         }
2425         buf.EncodeUint32(uint32(m.LearnLimit))
2426         buf.EncodeUint8(uint8(m.ScanDelay))
2427         buf.EncodeUint8(uint8(m.MaxMacsInEvent))
2428         buf.EncodeBool(m.EnableDisable)
2429         buf.EncodeUint32(uint32(m.PID))
2430         return buf.Bytes(), nil
2431 }
2432 func (m *WantL2MacsEvents) Unmarshal(b []byte) error {
2433         buf := codec.NewBuffer(b)
2434         m.LearnLimit = buf.DecodeUint32()
2435         m.ScanDelay = buf.DecodeUint8()
2436         m.MaxMacsInEvent = buf.DecodeUint8()
2437         m.EnableDisable = buf.DecodeBool()
2438         m.PID = buf.DecodeUint32()
2439         return nil
2440 }
2441
2442 // WantL2MacsEventsReply defines message 'want_l2_macs_events_reply'.
2443 type WantL2MacsEventsReply struct {
2444         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2445 }
2446
2447 func (m *WantL2MacsEventsReply) Reset()               { *m = WantL2MacsEventsReply{} }
2448 func (*WantL2MacsEventsReply) GetMessageName() string { return "want_l2_macs_events_reply" }
2449 func (*WantL2MacsEventsReply) GetCrcString() string   { return "e8d4e804" }
2450 func (*WantL2MacsEventsReply) GetMessageType() api.MessageType {
2451         return api.ReplyMessage
2452 }
2453
2454 func (m *WantL2MacsEventsReply) Size() int {
2455         if m == nil {
2456                 return 0
2457         }
2458         var size int
2459         size += 4 // m.Retval
2460         return size
2461 }
2462 func (m *WantL2MacsEventsReply) Marshal(b []byte) ([]byte, error) {
2463         var buf *codec.Buffer
2464         if b == nil {
2465                 buf = codec.NewBuffer(make([]byte, m.Size()))
2466         } else {
2467                 buf = codec.NewBuffer(b)
2468         }
2469         buf.EncodeUint32(uint32(m.Retval))
2470         return buf.Bytes(), nil
2471 }
2472 func (m *WantL2MacsEventsReply) Unmarshal(b []byte) error {
2473         buf := codec.NewBuffer(b)
2474         m.Retval = int32(buf.DecodeUint32())
2475         return nil
2476 }
2477
2478 func init() { file_l2_binapi_init() }
2479 func file_l2_binapi_init() {
2480         api.RegisterMessage((*BdIPMacAddDel)(nil), "bd_ip_mac_add_del_5f2b84e2")
2481         api.RegisterMessage((*BdIPMacAddDelReply)(nil), "bd_ip_mac_add_del_reply_e8d4e804")
2482         api.RegisterMessage((*BdIPMacDetails)(nil), "bd_ip_mac_details_a52f8044")
2483         api.RegisterMessage((*BdIPMacDump)(nil), "bd_ip_mac_dump_c25fdce6")
2484         api.RegisterMessage((*BdIPMacFlush)(nil), "bd_ip_mac_flush_c25fdce6")
2485         api.RegisterMessage((*BdIPMacFlushReply)(nil), "bd_ip_mac_flush_reply_e8d4e804")
2486         api.RegisterMessage((*BridgeDomainAddDel)(nil), "bridge_domain_add_del_600b7170")
2487         api.RegisterMessage((*BridgeDomainAddDelReply)(nil), "bridge_domain_add_del_reply_e8d4e804")
2488         api.RegisterMessage((*BridgeDomainDetails)(nil), "bridge_domain_details_979f549d")
2489         api.RegisterMessage((*BridgeDomainDump)(nil), "bridge_domain_dump_74396a43")
2490         api.RegisterMessage((*BridgeDomainSetMacAge)(nil), "bridge_domain_set_mac_age_b537ad7b")
2491         api.RegisterMessage((*BridgeDomainSetMacAgeReply)(nil), "bridge_domain_set_mac_age_reply_e8d4e804")
2492         api.RegisterMessage((*BridgeFlags)(nil), "bridge_flags_1b0c5fbd")
2493         api.RegisterMessage((*BridgeFlagsReply)(nil), "bridge_flags_reply_29b2a2b3")
2494         api.RegisterMessage((*BviCreate)(nil), "bvi_create_f5398559")
2495         api.RegisterMessage((*BviCreateReply)(nil), "bvi_create_reply_5383d31f")
2496         api.RegisterMessage((*BviDelete)(nil), "bvi_delete_f9e6675e")
2497         api.RegisterMessage((*BviDeleteReply)(nil), "bvi_delete_reply_e8d4e804")
2498         api.RegisterMessage((*L2ArpTermEvent)(nil), "l2_arp_term_event_85ff71ea")
2499         api.RegisterMessage((*L2FibClearTable)(nil), "l2_fib_clear_table_51077d14")
2500         api.RegisterMessage((*L2FibClearTableReply)(nil), "l2_fib_clear_table_reply_e8d4e804")
2501         api.RegisterMessage((*L2FibTableDetails)(nil), "l2_fib_table_details_e8d2fc72")
2502         api.RegisterMessage((*L2FibTableDump)(nil), "l2_fib_table_dump_c25fdce6")
2503         api.RegisterMessage((*L2Flags)(nil), "l2_flags_fc41cfe8")
2504         api.RegisterMessage((*L2FlagsReply)(nil), "l2_flags_reply_29b2a2b3")
2505         api.RegisterMessage((*L2InterfaceEfpFilter)(nil), "l2_interface_efp_filter_5501adee")
2506         api.RegisterMessage((*L2InterfaceEfpFilterReply)(nil), "l2_interface_efp_filter_reply_e8d4e804")
2507         api.RegisterMessage((*L2InterfacePbbTagRewrite)(nil), "l2_interface_pbb_tag_rewrite_612efa5a")
2508         api.RegisterMessage((*L2InterfacePbbTagRewriteReply)(nil), "l2_interface_pbb_tag_rewrite_reply_e8d4e804")
2509         api.RegisterMessage((*L2InterfaceVlanTagRewrite)(nil), "l2_interface_vlan_tag_rewrite_62cc0bbc")
2510         api.RegisterMessage((*L2InterfaceVlanTagRewriteReply)(nil), "l2_interface_vlan_tag_rewrite_reply_e8d4e804")
2511         api.RegisterMessage((*L2MacsEvent)(nil), "l2_macs_event_2eadfc8b")
2512         api.RegisterMessage((*L2PatchAddDel)(nil), "l2_patch_add_del_522f3445")
2513         api.RegisterMessage((*L2PatchAddDelReply)(nil), "l2_patch_add_del_reply_e8d4e804")
2514         api.RegisterMessage((*L2XconnectDetails)(nil), "l2_xconnect_details_c8aa6b37")
2515         api.RegisterMessage((*L2XconnectDump)(nil), "l2_xconnect_dump_51077d14")
2516         api.RegisterMessage((*L2fibAddDel)(nil), "l2fib_add_del_f29d796c")
2517         api.RegisterMessage((*L2fibAddDelReply)(nil), "l2fib_add_del_reply_e8d4e804")
2518         api.RegisterMessage((*L2fibFlushAll)(nil), "l2fib_flush_all_51077d14")
2519         api.RegisterMessage((*L2fibFlushAllReply)(nil), "l2fib_flush_all_reply_e8d4e804")
2520         api.RegisterMessage((*L2fibFlushBd)(nil), "l2fib_flush_bd_c25fdce6")
2521         api.RegisterMessage((*L2fibFlushBdReply)(nil), "l2fib_flush_bd_reply_e8d4e804")
2522         api.RegisterMessage((*L2fibFlushInt)(nil), "l2fib_flush_int_f9e6675e")
2523         api.RegisterMessage((*L2fibFlushIntReply)(nil), "l2fib_flush_int_reply_e8d4e804")
2524         api.RegisterMessage((*SwInterfaceSetL2Bridge)(nil), "sw_interface_set_l2_bridge_2e483cd0")
2525         api.RegisterMessage((*SwInterfaceSetL2BridgeReply)(nil), "sw_interface_set_l2_bridge_reply_e8d4e804")
2526         api.RegisterMessage((*SwInterfaceSetL2Xconnect)(nil), "sw_interface_set_l2_xconnect_1aaa2dbb")
2527         api.RegisterMessage((*SwInterfaceSetL2XconnectReply)(nil), "sw_interface_set_l2_xconnect_reply_e8d4e804")
2528         api.RegisterMessage((*SwInterfaceSetVpath)(nil), "sw_interface_set_vpath_ae6cfcfb")
2529         api.RegisterMessage((*SwInterfaceSetVpathReply)(nil), "sw_interface_set_vpath_reply_e8d4e804")
2530         api.RegisterMessage((*WantL2ArpTermEvents)(nil), "want_l2_arp_term_events_3ec6d6c2")
2531         api.RegisterMessage((*WantL2ArpTermEventsReply)(nil), "want_l2_arp_term_events_reply_e8d4e804")
2532         api.RegisterMessage((*WantL2MacsEvents)(nil), "want_l2_macs_events_9aabdfde")
2533         api.RegisterMessage((*WantL2MacsEventsReply)(nil), "want_l2_macs_events_reply_e8d4e804")
2534 }
2535
2536 // Messages returns list of all messages in this module.
2537 func AllMessages() []api.Message {
2538         return []api.Message{
2539                 (*BdIPMacAddDel)(nil),
2540                 (*BdIPMacAddDelReply)(nil),
2541                 (*BdIPMacDetails)(nil),
2542                 (*BdIPMacDump)(nil),
2543                 (*BdIPMacFlush)(nil),
2544                 (*BdIPMacFlushReply)(nil),
2545                 (*BridgeDomainAddDel)(nil),
2546                 (*BridgeDomainAddDelReply)(nil),
2547                 (*BridgeDomainDetails)(nil),
2548                 (*BridgeDomainDump)(nil),
2549                 (*BridgeDomainSetMacAge)(nil),
2550                 (*BridgeDomainSetMacAgeReply)(nil),
2551                 (*BridgeFlags)(nil),
2552                 (*BridgeFlagsReply)(nil),
2553                 (*BviCreate)(nil),
2554                 (*BviCreateReply)(nil),
2555                 (*BviDelete)(nil),
2556                 (*BviDeleteReply)(nil),
2557                 (*L2ArpTermEvent)(nil),
2558                 (*L2FibClearTable)(nil),
2559                 (*L2FibClearTableReply)(nil),
2560                 (*L2FibTableDetails)(nil),
2561                 (*L2FibTableDump)(nil),
2562                 (*L2Flags)(nil),
2563                 (*L2FlagsReply)(nil),
2564                 (*L2InterfaceEfpFilter)(nil),
2565                 (*L2InterfaceEfpFilterReply)(nil),
2566                 (*L2InterfacePbbTagRewrite)(nil),
2567                 (*L2InterfacePbbTagRewriteReply)(nil),
2568                 (*L2InterfaceVlanTagRewrite)(nil),
2569                 (*L2InterfaceVlanTagRewriteReply)(nil),
2570                 (*L2MacsEvent)(nil),
2571                 (*L2PatchAddDel)(nil),
2572                 (*L2PatchAddDelReply)(nil),
2573                 (*L2XconnectDetails)(nil),
2574                 (*L2XconnectDump)(nil),
2575                 (*L2fibAddDel)(nil),
2576                 (*L2fibAddDelReply)(nil),
2577                 (*L2fibFlushAll)(nil),
2578                 (*L2fibFlushAllReply)(nil),
2579                 (*L2fibFlushBd)(nil),
2580                 (*L2fibFlushBdReply)(nil),
2581                 (*L2fibFlushInt)(nil),
2582                 (*L2fibFlushIntReply)(nil),
2583                 (*SwInterfaceSetL2Bridge)(nil),
2584                 (*SwInterfaceSetL2BridgeReply)(nil),
2585                 (*SwInterfaceSetL2Xconnect)(nil),
2586                 (*SwInterfaceSetL2XconnectReply)(nil),
2587                 (*SwInterfaceSetVpath)(nil),
2588                 (*SwInterfaceSetVpathReply)(nil),
2589                 (*WantL2ArpTermEvents)(nil),
2590                 (*WantL2ArpTermEventsReply)(nil),
2591                 (*WantL2MacsEvents)(nil),
2592                 (*WantL2MacsEventsReply)(nil),
2593         }
2594 }