diff options
author | 2020-07-17 10:36:28 +0200 | |
---|---|---|
committer | 2020-07-17 11:43:41 +0200 | |
commit | d1f24d37bd447b64e402298bb8eb2479681facf9 (patch) | |
tree | a3fc21ba730a91d8a402c7a5bf9c614e3677c4fc /binapi/l2 | |
parent | 1548c7e12531e3d055567d761c580a1c7ff0ac40 (diff) |
Improve binapi generator
- simplified Size/Marshal/Unmarshal methods
- replace struc in unions with custom marshal/unmarshal
- fix imports in generated files
- fix mock adapter
- generate rpc service using low-level stream API (dumps generate control ping or stream msg..)
- move examples/binapi to binapi and generate all API for latest release
- add binapigen.Plugin for developing custom generator plugins
- optionally generate HTTP handlers (REST API) for RPC services
- add govpp program for browsing VPP API
Change-Id: I092e9ed2b0c17972b3476463c3d4b14dd76ed42b
Signed-off-by: Ondrej Fabry <ofabry@cisco.com>
Diffstat (limited to 'binapi/l2')
-rw-r--r-- | binapi/l2/l2.ba.go | 2594 | ||||
-rw-r--r-- | binapi/l2/l2_rest.ba.go | 502 | ||||
-rw-r--r-- | binapi/l2/l2_rpc.ba.go | 403 |
3 files changed, 3499 insertions, 0 deletions
diff --git a/binapi/l2/l2.ba.go b/binapi/l2/l2.ba.go new file mode 100644 index 0000000..0eb75f2 --- /dev/null +++ b/binapi/l2/l2.ba.go @@ -0,0 +1,2594 @@ +// Code generated by GoVPP's binapi-generator. DO NOT EDIT. +// versions: +// binapi-generator: v0.4.0-dev +// VPP: 20.05-release +// source: /usr/share/vpp/api/core/l2.api.json + +// Package l2 contains generated bindings for API file l2.api. +// +// Contents: +// 3 enums +// 3 structs +// 54 messages +// +package l2 + +import ( + api "git.fd.io/govpp.git/api" + ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types" + interface_types "git.fd.io/govpp.git/binapi/interface_types" + ip_types "git.fd.io/govpp.git/binapi/ip_types" + codec "git.fd.io/govpp.git/codec" + "strconv" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the GoVPP api package it is being compiled against. +// A compilation error at this line likely means your copy of the +// GoVPP api package needs to be updated. +const _ = api.GoVppAPIPackageIsVersion2 + +const ( + APIFile = "l2" + APIVersion = "3.0.0" + VersionCrc = 0x58ce8a6b +) + +// BdFlags defines enum 'bd_flags'. +type BdFlags uint32 + +const ( + BRIDGE_API_FLAG_NONE BdFlags = 0 + BRIDGE_API_FLAG_LEARN BdFlags = 1 + BRIDGE_API_FLAG_FWD BdFlags = 2 + BRIDGE_API_FLAG_FLOOD BdFlags = 4 + BRIDGE_API_FLAG_UU_FLOOD BdFlags = 8 + BRIDGE_API_FLAG_ARP_TERM BdFlags = 16 + BRIDGE_API_FLAG_ARP_UFWD BdFlags = 32 +) + +var ( + BdFlags_name = map[uint32]string{ + 0: "BRIDGE_API_FLAG_NONE", + 1: "BRIDGE_API_FLAG_LEARN", + 2: "BRIDGE_API_FLAG_FWD", + 4: "BRIDGE_API_FLAG_FLOOD", + 8: "BRIDGE_API_FLAG_UU_FLOOD", + 16: "BRIDGE_API_FLAG_ARP_TERM", + 32: "BRIDGE_API_FLAG_ARP_UFWD", + } + BdFlags_value = map[string]uint32{ + "BRIDGE_API_FLAG_NONE": 0, + "BRIDGE_API_FLAG_LEARN": 1, + "BRIDGE_API_FLAG_FWD": 2, + "BRIDGE_API_FLAG_FLOOD": 4, + "BRIDGE_API_FLAG_UU_FLOOD": 8, + "BRIDGE_API_FLAG_ARP_TERM": 16, + "BRIDGE_API_FLAG_ARP_UFWD": 32, + } +) + +func (x BdFlags) String() string { + s, ok := BdFlags_name[uint32(x)] + if ok { + return s + } + str := func(n uint32) string { + s, ok := BdFlags_name[uint32(n)] + if ok { + return s + } + return "BdFlags(" + strconv.Itoa(int(n)) + ")" + } + for i := uint32(0); i <= 32; i++ { + val := uint32(x) + if val&(1<<i) != 0 { + if s != "" { + s += "|" + } + s += str(1 << i) + } + } + if s == "" { + return str(uint32(x)) + } + return s +} + +// L2PortType defines enum 'l2_port_type'. +type L2PortType uint32 + +const ( + L2_API_PORT_TYPE_NORMAL L2PortType = 0 + L2_API_PORT_TYPE_BVI L2PortType = 1 + L2_API_PORT_TYPE_UU_FWD L2PortType = 2 +) + +var ( + L2PortType_name = map[uint32]string{ + 0: "L2_API_PORT_TYPE_NORMAL", + 1: "L2_API_PORT_TYPE_BVI", + 2: "L2_API_PORT_TYPE_UU_FWD", + } + L2PortType_value = map[string]uint32{ + "L2_API_PORT_TYPE_NORMAL": 0, + "L2_API_PORT_TYPE_BVI": 1, + "L2_API_PORT_TYPE_UU_FWD": 2, + } +) + +func (x L2PortType) String() string { + s, ok := L2PortType_name[uint32(x)] + if ok { + return s + } + return "L2PortType(" + strconv.Itoa(int(x)) + ")" +} + +// MacEventAction defines enum 'mac_event_action'. +type MacEventAction uint32 + +const ( + MAC_EVENT_ACTION_API_ADD MacEventAction = 0 + MAC_EVENT_ACTION_API_DELETE MacEventAction = 1 + MAC_EVENT_ACTION_API_MOVE MacEventAction = 2 +) + +var ( + MacEventAction_name = map[uint32]string{ + 0: "MAC_EVENT_ACTION_API_ADD", + 1: "MAC_EVENT_ACTION_API_DELETE", + 2: "MAC_EVENT_ACTION_API_MOVE", + } + MacEventAction_value = map[string]uint32{ + "MAC_EVENT_ACTION_API_ADD": 0, + "MAC_EVENT_ACTION_API_DELETE": 1, + "MAC_EVENT_ACTION_API_MOVE": 2, + } +) + +func (x MacEventAction) String() string { + s, ok := MacEventAction_name[uint32(x)] + if ok { + return s + } + return "MacEventAction(" + strconv.Itoa(int(x)) + ")" +} + +// BdIPMac defines type 'bd_ip_mac'. +type BdIPMac struct { + BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` + IP ip_types.Address `binapi:"address,name=ip" json:"ip,omitempty"` + Mac ethernet_types.MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"` +} + +// BridgeDomainSwIf defines type 'bridge_domain_sw_if'. +type BridgeDomainSwIf struct { + Context uint32 `binapi:"u32,name=context" json:"context,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + Shg uint8 `binapi:"u8,name=shg" json:"shg,omitempty"` +} + +// MacEntry defines type 'mac_entry'. +type MacEntry struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + MacAddr ethernet_types.MacAddress `binapi:"mac_address,name=mac_addr" json:"mac_addr,omitempty"` + Action MacEventAction `binapi:"mac_event_action,name=action" json:"action,omitempty"` + Flags uint8 `binapi:"u8,name=flags" json:"flags,omitempty"` +} + +// BdIPMacAddDel defines message 'bd_ip_mac_add_del'. +type BdIPMacAddDel struct { + IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` + Entry BdIPMac `binapi:"bd_ip_mac,name=entry" json:"entry,omitempty"` +} + +func (m *BdIPMacAddDel) Reset() { *m = BdIPMacAddDel{} } +func (*BdIPMacAddDel) GetMessageName() string { return "bd_ip_mac_add_del" } +func (*BdIPMacAddDel) GetCrcString() string { return "5f2b84e2" } +func (*BdIPMacAddDel) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *BdIPMacAddDel) Size() int { + if m == nil { + return 0 + } + var size int + size += 1 // m.IsAdd + size += 4 // m.Entry.BdID + size += 1 // m.Entry.IP.Af + size += 1 * 16 // m.Entry.IP.Un + size += 1 * 6 // m.Entry.Mac + return size +} +func (m *BdIPMacAddDel) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeBool(m.IsAdd) + buf.EncodeUint32(uint32(m.Entry.BdID)) + buf.EncodeUint8(uint8(m.Entry.IP.Af)) + buf.EncodeBytes(m.Entry.IP.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Entry.Mac[:], 6) + return buf.Bytes(), nil +} +func (m *BdIPMacAddDel) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.IsAdd = buf.DecodeBool() + m.Entry.BdID = buf.DecodeUint32() + m.Entry.IP.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Entry.IP.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + copy(m.Entry.Mac[:], buf.DecodeBytes(6)) + return nil +} + +// BdIPMacAddDelReply defines message 'bd_ip_mac_add_del_reply'. +type BdIPMacAddDelReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *BdIPMacAddDelReply) Reset() { *m = BdIPMacAddDelReply{} } +func (*BdIPMacAddDelReply) GetMessageName() string { return "bd_ip_mac_add_del_reply" } +func (*BdIPMacAddDelReply) GetCrcString() string { return "e8d4e804" } +func (*BdIPMacAddDelReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *BdIPMacAddDelReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *BdIPMacAddDelReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *BdIPMacAddDelReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// BdIPMacDetails defines message 'bd_ip_mac_details'. +type BdIPMacDetails struct { + Entry BdIPMac `binapi:"bd_ip_mac,name=entry" json:"entry,omitempty"` +} + +func (m *BdIPMacDetails) Reset() { *m = BdIPMacDetails{} } +func (*BdIPMacDetails) GetMessageName() string { return "bd_ip_mac_details" } +func (*BdIPMacDetails) GetCrcString() string { return "a52f8044" } +func (*BdIPMacDetails) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *BdIPMacDetails) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Entry.BdID + size += 1 // m.Entry.IP.Af + size += 1 * 16 // m.Entry.IP.Un + size += 1 * 6 // m.Entry.Mac + return size +} +func (m *BdIPMacDetails) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Entry.BdID)) + buf.EncodeUint8(uint8(m.Entry.IP.Af)) + buf.EncodeBytes(m.Entry.IP.Un.XXX_UnionData[:], 0) + buf.EncodeBytes(m.Entry.Mac[:], 6) + return buf.Bytes(), nil +} +func (m *BdIPMacDetails) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Entry.BdID = buf.DecodeUint32() + m.Entry.IP.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.Entry.IP.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + copy(m.Entry.Mac[:], buf.DecodeBytes(6)) + return nil +} + +// BdIPMacDump defines message 'bd_ip_mac_dump'. +type BdIPMacDump struct { + BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` +} + +func (m *BdIPMacDump) Reset() { *m = BdIPMacDump{} } +func (*BdIPMacDump) GetMessageName() string { return "bd_ip_mac_dump" } +func (*BdIPMacDump) GetCrcString() string { return "c25fdce6" } +func (*BdIPMacDump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *BdIPMacDump) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.BdID + return size +} +func (m *BdIPMacDump) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.BdID)) + return buf.Bytes(), nil +} +func (m *BdIPMacDump) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.BdID = buf.DecodeUint32() + return nil +} + +// BdIPMacFlush defines message 'bd_ip_mac_flush'. +type BdIPMacFlush struct { + BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` +} + +func (m *BdIPMacFlush) Reset() { *m = BdIPMacFlush{} } +func (*BdIPMacFlush) GetMessageName() string { return "bd_ip_mac_flush" } +func (*BdIPMacFlush) GetCrcString() string { return "c25fdce6" } +func (*BdIPMacFlush) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *BdIPMacFlush) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.BdID + return size +} +func (m *BdIPMacFlush) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.BdID)) + return buf.Bytes(), nil +} +func (m *BdIPMacFlush) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.BdID = buf.DecodeUint32() + return nil +} + +// BdIPMacFlushReply defines message 'bd_ip_mac_flush_reply'. +type BdIPMacFlushReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *BdIPMacFlushReply) Reset() { *m = BdIPMacFlushReply{} } +func (*BdIPMacFlushReply) GetMessageName() string { return "bd_ip_mac_flush_reply" } +func (*BdIPMacFlushReply) GetCrcString() string { return "e8d4e804" } +func (*BdIPMacFlushReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *BdIPMacFlushReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *BdIPMacFlushReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *BdIPMacFlushReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// BridgeDomainAddDel defines message 'bridge_domain_add_del'. +type BridgeDomainAddDel struct { + BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` + Flood bool `binapi:"bool,name=flood" json:"flood,omitempty"` + UuFlood bool `binapi:"bool,name=uu_flood" json:"uu_flood,omitempty"` + Forward bool `binapi:"bool,name=forward" json:"forward,omitempty"` + Learn bool `binapi:"bool,name=learn" json:"learn,omitempty"` + ArpTerm bool `binapi:"bool,name=arp_term" json:"arp_term,omitempty"` + ArpUfwd bool `binapi:"bool,name=arp_ufwd" json:"arp_ufwd,omitempty"` + MacAge uint8 `binapi:"u8,name=mac_age" json:"mac_age,omitempty"` + BdTag string `binapi:"string[64],name=bd_tag" json:"bd_tag,omitempty"` + IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` +} + +func (m *BridgeDomainAddDel) Reset() { *m = BridgeDomainAddDel{} } +func (*BridgeDomainAddDel) GetMessageName() string { return "bridge_domain_add_del" } +func (*BridgeDomainAddDel) GetCrcString() string { return "600b7170" } +func (*BridgeDomainAddDel) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *BridgeDomainAddDel) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.BdID + size += 1 // m.Flood + size += 1 // m.UuFlood + size += 1 // m.Forward + size += 1 // m.Learn + size += 1 // m.ArpTerm + size += 1 // m.ArpUfwd + size += 1 // m.MacAge + size += 64 // m.BdTag + size += 1 // m.IsAdd + return size +} +func (m *BridgeDomainAddDel) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.BdID)) + buf.EncodeBool(m.Flood) + buf.EncodeBool(m.UuFlood) + buf.EncodeBool(m.Forward) + buf.EncodeBool(m.Learn) + buf.EncodeBool(m.ArpTerm) + buf.EncodeBool(m.ArpUfwd) + buf.EncodeUint8(uint8(m.MacAge)) + buf.EncodeString(m.BdTag, 64) + buf.EncodeBool(m.IsAdd) + return buf.Bytes(), nil +} +func (m *BridgeDomainAddDel) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.BdID = buf.DecodeUint32() + m.Flood = buf.DecodeBool() + m.UuFlood = buf.DecodeBool() + m.Forward = buf.DecodeBool() + m.Learn = buf.DecodeBool() + m.ArpTerm = buf.DecodeBool() + m.ArpUfwd = buf.DecodeBool() + m.MacAge = buf.DecodeUint8() + m.BdTag = buf.DecodeString(64) + m.IsAdd = buf.DecodeBool() + return nil +} + +// BridgeDomainAddDelReply defines message 'bridge_domain_add_del_reply'. +type BridgeDomainAddDelReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *BridgeDomainAddDelReply) Reset() { *m = BridgeDomainAddDelReply{} } +func (*BridgeDomainAddDelReply) GetMessageName() string { return "bridge_domain_add_del_reply" } +func (*BridgeDomainAddDelReply) GetCrcString() string { return "e8d4e804" } +func (*BridgeDomainAddDelReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *BridgeDomainAddDelReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *BridgeDomainAddDelReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *BridgeDomainAddDelReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// BridgeDomainDetails defines message 'bridge_domain_details'. +type BridgeDomainDetails struct { + BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` + Flood bool `binapi:"bool,name=flood" json:"flood,omitempty"` + UuFlood bool `binapi:"bool,name=uu_flood" json:"uu_flood,omitempty"` + Forward bool `binapi:"bool,name=forward" json:"forward,omitempty"` + Learn bool `binapi:"bool,name=learn" json:"learn,omitempty"` + ArpTerm bool `binapi:"bool,name=arp_term" json:"arp_term,omitempty"` + ArpUfwd bool `binapi:"bool,name=arp_ufwd" json:"arp_ufwd,omitempty"` + MacAge uint8 `binapi:"u8,name=mac_age" json:"mac_age,omitempty"` + BdTag string `binapi:"string[64],name=bd_tag" json:"bd_tag,omitempty"` + BviSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=bvi_sw_if_index" json:"bvi_sw_if_index,omitempty"` + UuFwdSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=uu_fwd_sw_if_index" json:"uu_fwd_sw_if_index,omitempty"` + NSwIfs uint32 `binapi:"u32,name=n_sw_ifs" json:"-"` + SwIfDetails []BridgeDomainSwIf `binapi:"bridge_domain_sw_if[n_sw_ifs],name=sw_if_details" json:"sw_if_details,omitempty"` +} + +func (m *BridgeDomainDetails) Reset() { *m = BridgeDomainDetails{} } +func (*BridgeDomainDetails) GetMessageName() string { return "bridge_domain_details" } +func (*BridgeDomainDetails) GetCrcString() string { return "979f549d" } +func (*BridgeDomainDetails) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *BridgeDomainDetails) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.BdID + size += 1 // m.Flood + size += 1 // m.UuFlood + size += 1 // m.Forward + size += 1 // m.Learn + size += 1 // m.ArpTerm + size += 1 // m.ArpUfwd + size += 1 // m.MacAge + size += 64 // m.BdTag + size += 4 // m.BviSwIfIndex + size += 4 // m.UuFwdSwIfIndex + size += 4 // m.NSwIfs + for j1 := 0; j1 < len(m.SwIfDetails); j1++ { + var s1 BridgeDomainSwIf + _ = s1 + if j1 < len(m.SwIfDetails) { + s1 = m.SwIfDetails[j1] + } + size += 4 // s1.Context + size += 4 // s1.SwIfIndex + size += 1 // s1.Shg + } + return size +} +func (m *BridgeDomainDetails) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.BdID)) + buf.EncodeBool(m.Flood) + buf.EncodeBool(m.UuFlood) + buf.EncodeBool(m.Forward) + buf.EncodeBool(m.Learn) + buf.EncodeBool(m.ArpTerm) + buf.EncodeBool(m.ArpUfwd) + buf.EncodeUint8(uint8(m.MacAge)) + buf.EncodeString(m.BdTag, 64) + buf.EncodeUint32(uint32(m.BviSwIfIndex)) + buf.EncodeUint32(uint32(m.UuFwdSwIfIndex)) + buf.EncodeUint32(uint32(len(m.SwIfDetails))) + for j0 := 0; j0 < len(m.SwIfDetails); j0++ { + var v0 BridgeDomainSwIf + if j0 < len(m.SwIfDetails) { + v0 = m.SwIfDetails[j0] + } + buf.EncodeUint32(uint32(v0.Context)) + buf.EncodeUint32(uint32(v0.SwIfIndex)) + buf.EncodeUint8(uint8(v0.Shg)) + } + return buf.Bytes(), nil +} +func (m *BridgeDomainDetails) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.BdID = buf.DecodeUint32() + m.Flood = buf.DecodeBool() + m.UuFlood = buf.DecodeBool() + m.Forward = buf.DecodeBool() + m.Learn = buf.DecodeBool() + m.ArpTerm = buf.DecodeBool() + m.ArpUfwd = buf.DecodeBool() + m.MacAge = buf.DecodeUint8() + m.BdTag = buf.DecodeString(64) + m.BviSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.UuFwdSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.NSwIfs = buf.DecodeUint32() + m.SwIfDetails = make([]BridgeDomainSwIf, int(m.NSwIfs)) + for j0 := 0; j0 < len(m.SwIfDetails); j0++ { + m.SwIfDetails[j0].Context = buf.DecodeUint32() + m.SwIfDetails[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.SwIfDetails[j0].Shg = buf.DecodeUint8() + } + return nil +} + +// BridgeDomainDump defines message 'bridge_domain_dump'. +type BridgeDomainDump struct { + BdID uint32 `binapi:"u32,name=bd_id,default=%!s(float64=4.294967295e+09)" json:"bd_id,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"` +} + +func (m *BridgeDomainDump) Reset() { *m = BridgeDomainDump{} } +func (*BridgeDomainDump) GetMessageName() string { return "bridge_domain_dump" } +func (*BridgeDomainDump) GetCrcString() string { return "74396a43" } +func (*BridgeDomainDump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *BridgeDomainDump) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.BdID + size += 4 // m.SwIfIndex + return size +} +func (m *BridgeDomainDump) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.BdID)) + buf.EncodeUint32(uint32(m.SwIfIndex)) + return buf.Bytes(), nil +} +func (m *BridgeDomainDump) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.BdID = buf.DecodeUint32() + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + return nil +} + +// BridgeDomainSetMacAge defines message 'bridge_domain_set_mac_age'. +type BridgeDomainSetMacAge struct { + BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` + MacAge uint8 `binapi:"u8,name=mac_age" json:"mac_age,omitempty"` +} + +func (m *BridgeDomainSetMacAge) Reset() { *m = BridgeDomainSetMacAge{} } +func (*BridgeDomainSetMacAge) GetMessageName() string { return "bridge_domain_set_mac_age" } +func (*BridgeDomainSetMacAge) GetCrcString() string { return "b537ad7b" } +func (*BridgeDomainSetMacAge) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *BridgeDomainSetMacAge) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.BdID + size += 1 // m.MacAge + return size +} +func (m *BridgeDomainSetMacAge) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.BdID)) + buf.EncodeUint8(uint8(m.MacAge)) + return buf.Bytes(), nil +} +func (m *BridgeDomainSetMacAge) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.BdID = buf.DecodeUint32() + m.MacAge = buf.DecodeUint8() + return nil +} + +// BridgeDomainSetMacAgeReply defines message 'bridge_domain_set_mac_age_reply'. +type BridgeDomainSetMacAgeReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *BridgeDomainSetMacAgeReply) Reset() { *m = BridgeDomainSetMacAgeReply{} } +func (*BridgeDomainSetMacAgeReply) GetMessageName() string { return "bridge_domain_set_mac_age_reply" } +func (*BridgeDomainSetMacAgeReply) GetCrcString() string { return "e8d4e804" } +func (*BridgeDomainSetMacAgeReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *BridgeDomainSetMacAgeReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *BridgeDomainSetMacAgeReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *BridgeDomainSetMacAgeReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// BridgeFlags defines message 'bridge_flags'. +type BridgeFlags struct { + BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` + IsSet bool `binapi:"bool,name=is_set" json:"is_set,omitempty"` + Flags BdFlags `binapi:"bd_flags,name=flags" json:"flags,omitempty"` +} + +func (m *BridgeFlags) Reset() { *m = BridgeFlags{} } +func (*BridgeFlags) GetMessageName() string { return "bridge_flags" } +func (*BridgeFlags) GetCrcString() string { return "1b0c5fbd" } +func (*BridgeFlags) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *BridgeFlags) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.BdID + size += 1 // m.IsSet + size += 4 // m.Flags + return size +} +func (m *BridgeFlags) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.BdID)) + buf.EncodeBool(m.IsSet) + buf.EncodeUint32(uint32(m.Flags)) + return buf.Bytes(), nil +} +func (m *BridgeFlags) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.BdID = buf.DecodeUint32() + m.IsSet = buf.DecodeBool() + m.Flags = BdFlags(buf.DecodeUint32()) + return nil +} + +// BridgeFlagsReply defines message 'bridge_flags_reply'. +type BridgeFlagsReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + ResultingFeatureBitmap uint32 `binapi:"u32,name=resulting_feature_bitmap" json:"resulting_feature_bitmap,omitempty"` +} + +func (m *BridgeFlagsReply) Reset() { *m = BridgeFlagsReply{} } +func (*BridgeFlagsReply) GetMessageName() string { return "bridge_flags_reply" } +func (*BridgeFlagsReply) GetCrcString() string { return "29b2a2b3" } +func (*BridgeFlagsReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *BridgeFlagsReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + size += 4 // m.ResultingFeatureBitmap + return size +} +func (m *BridgeFlagsReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + buf.EncodeUint32(uint32(m.ResultingFeatureBitmap)) + return buf.Bytes(), nil +} +func (m *BridgeFlagsReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + m.ResultingFeatureBitmap = buf.DecodeUint32() + return nil +} + +// BviCreate defines message 'bvi_create'. +type BviCreate struct { + Mac ethernet_types.MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"` + UserInstance uint32 `binapi:"u32,name=user_instance,default=%!s(float64=4.294967295e+09)" json:"user_instance,omitempty"` +} + +func (m *BviCreate) Reset() { *m = BviCreate{} } +func (*BviCreate) GetMessageName() string { return "bvi_create" } +func (*BviCreate) GetCrcString() string { return "f5398559" } +func (*BviCreate) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *BviCreate) Size() int { + if m == nil { + return 0 + } + var size int + size += 1 * 6 // m.Mac + size += 4 // m.UserInstance + return size +} +func (m *BviCreate) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeBytes(m.Mac[:], 6) + buf.EncodeUint32(uint32(m.UserInstance)) + return buf.Bytes(), nil +} +func (m *BviCreate) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + copy(m.Mac[:], buf.DecodeBytes(6)) + m.UserInstance = buf.DecodeUint32() + return nil +} + +// BviCreateReply defines message 'bvi_create_reply'. +type BviCreateReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` +} + +func (m *BviCreateReply) Reset() { *m = BviCreateReply{} } +func (*BviCreateReply) GetMessageName() string { return "bvi_create_reply" } +func (*BviCreateReply) GetCrcString() string { return "5383d31f" } +func (*BviCreateReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *BviCreateReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + size += 4 // m.SwIfIndex + return size +} +func (m *BviCreateReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + buf.EncodeUint32(uint32(m.SwIfIndex)) + return buf.Bytes(), nil +} +func (m *BviCreateReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + return nil +} + +// BviDelete defines message 'bvi_delete'. +type BviDelete struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` +} + +func (m *BviDelete) Reset() { *m = BviDelete{} } +func (*BviDelete) GetMessageName() string { return "bvi_delete" } +func (*BviDelete) GetCrcString() string { return "f9e6675e" } +func (*BviDelete) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *BviDelete) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.SwIfIndex + return size +} +func (m *BviDelete) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.SwIfIndex)) + return buf.Bytes(), nil +} +func (m *BviDelete) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + return nil +} + +// BviDeleteReply defines message 'bvi_delete_reply'. +type BviDeleteReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *BviDeleteReply) Reset() { *m = BviDeleteReply{} } +func (*BviDeleteReply) GetMessageName() string { return "bvi_delete_reply" } +func (*BviDeleteReply) GetCrcString() string { return "e8d4e804" } +func (*BviDeleteReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *BviDeleteReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *BviDeleteReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *BviDeleteReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// L2ArpTermEvent defines message 'l2_arp_term_event'. +type L2ArpTermEvent struct { + PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"` + IP ip_types.Address `binapi:"address,name=ip" json:"ip,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + Mac ethernet_types.MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"` +} + +func (m *L2ArpTermEvent) Reset() { *m = L2ArpTermEvent{} } +func (*L2ArpTermEvent) GetMessageName() string { return "l2_arp_term_event" } +func (*L2ArpTermEvent) GetCrcString() string { return "85ff71ea" } +func (*L2ArpTermEvent) GetMessageType() api.MessageType { + return api.EventMessage +} + +func (m *L2ArpTermEvent) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.PID + size += 1 // m.IP.Af + size += 1 * 16 // m.IP.Un + size += 4 // m.SwIfIndex + size += 1 * 6 // m.Mac + return size +} +func (m *L2ArpTermEvent) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.PID)) + buf.EncodeUint8(uint8(m.IP.Af)) + buf.EncodeBytes(m.IP.Un.XXX_UnionData[:], 0) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeBytes(m.Mac[:], 6) + return buf.Bytes(), nil +} +func (m *L2ArpTermEvent) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.PID = buf.DecodeUint32() + m.IP.Af = ip_types.AddressFamily(buf.DecodeUint8()) + copy(m.IP.Un.XXX_UnionData[:], buf.DecodeBytes(16)) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + copy(m.Mac[:], buf.DecodeBytes(6)) + return nil +} + +// L2FibClearTable defines message 'l2_fib_clear_table'. +type L2FibClearTable struct{} + +func (m *L2FibClearTable) Reset() { *m = L2FibClearTable{} } +func (*L2FibClearTable) GetMessageName() string { return "l2_fib_clear_table" } +func (*L2FibClearTable) GetCrcString() string { return "51077d14" } +func (*L2FibClearTable) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *L2FibClearTable) Size() int { + if m == nil { + return 0 + } + var size int + return size +} +func (m *L2FibClearTable) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + return buf.Bytes(), nil +} +func (m *L2FibClearTable) Unmarshal(b []byte) error { + return nil +} + +// L2FibClearTableReply defines message 'l2_fib_clear_table_reply'. +type L2FibClearTableReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *L2FibClearTableReply) Reset() { *m = L2FibClearTableReply{} } +func (*L2FibClearTableReply) GetMessageName() string { return "l2_fib_clear_table_reply" } +func (*L2FibClearTableReply) GetCrcString() string { return "e8d4e804" } +func (*L2FibClearTableReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *L2FibClearTableReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *L2FibClearTableReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *L2FibClearTableReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// L2FibTableDetails defines message 'l2_fib_table_details'. +type L2FibTableDetails struct { + BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` + Mac ethernet_types.MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + StaticMac bool `binapi:"bool,name=static_mac" json:"static_mac,omitempty"` + FilterMac bool `binapi:"bool,name=filter_mac" json:"filter_mac,omitempty"` + BviMac bool `binapi:"bool,name=bvi_mac" json:"bvi_mac,omitempty"` +} + +func (m *L2FibTableDetails) Reset() { *m = L2FibTableDetails{} } +func (*L2FibTableDetails) GetMessageName() string { return "l2_fib_table_details" } +func (*L2FibTableDetails) GetCrcString() string { return "e8d2fc72" } +func (*L2FibTableDetails) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *L2FibTableDetails) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.BdID + size += 1 * 6 // m.Mac + size += 4 // m.SwIfIndex + size += 1 // m.StaticMac + size += 1 // m.FilterMac + size += 1 // m.BviMac + return size +} +func (m *L2FibTableDetails) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.BdID)) + buf.EncodeBytes(m.Mac[:], 6) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeBool(m.StaticMac) + buf.EncodeBool(m.FilterMac) + buf.EncodeBool(m.BviMac) + return buf.Bytes(), nil +} +func (m *L2FibTableDetails) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.BdID = buf.DecodeUint32() + copy(m.Mac[:], buf.DecodeBytes(6)) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.StaticMac = buf.DecodeBool() + m.FilterMac = buf.DecodeBool() + m.BviMac = buf.DecodeBool() + return nil +} + +// L2FibTableDump defines message 'l2_fib_table_dump'. +type L2FibTableDump struct { + BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` +} + +func (m *L2FibTableDump) Reset() { *m = L2FibTableDump{} } +func (*L2FibTableDump) GetMessageName() string { return "l2_fib_table_dump" } +func (*L2FibTableDump) GetCrcString() string { return "c25fdce6" } +func (*L2FibTableDump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *L2FibTableDump) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.BdID + return size +} +func (m *L2FibTableDump) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.BdID)) + return buf.Bytes(), nil +} +func (m *L2FibTableDump) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.BdID = buf.DecodeUint32() + return nil +} + +// L2Flags defines message 'l2_flags'. +type L2Flags struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + IsSet bool `binapi:"bool,name=is_set" json:"is_set,omitempty"` + FeatureBitmap uint32 `binapi:"u32,name=feature_bitmap" json:"feature_bitmap,omitempty"` +} + +func (m *L2Flags) Reset() { *m = L2Flags{} } +func (*L2Flags) GetMessageName() string { return "l2_flags" } +func (*L2Flags) GetCrcString() string { return "fc41cfe8" } +func (*L2Flags) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *L2Flags) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.SwIfIndex + size += 1 // m.IsSet + size += 4 // m.FeatureBitmap + return size +} +func (m *L2Flags) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeBool(m.IsSet) + buf.EncodeUint32(uint32(m.FeatureBitmap)) + return buf.Bytes(), nil +} +func (m *L2Flags) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.IsSet = buf.DecodeBool() + m.FeatureBitmap = buf.DecodeUint32() + return nil +} + +// L2FlagsReply defines message 'l2_flags_reply'. +type L2FlagsReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` + ResultingFeatureBitmap uint32 `binapi:"u32,name=resulting_feature_bitmap" json:"resulting_feature_bitmap,omitempty"` +} + +func (m *L2FlagsReply) Reset() { *m = L2FlagsReply{} } +func (*L2FlagsReply) GetMessageName() string { return "l2_flags_reply" } +func (*L2FlagsReply) GetCrcString() string { return "29b2a2b3" } +func (*L2FlagsReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *L2FlagsReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + size += 4 // m.ResultingFeatureBitmap + return size +} +func (m *L2FlagsReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + buf.EncodeUint32(uint32(m.ResultingFeatureBitmap)) + return buf.Bytes(), nil +} +func (m *L2FlagsReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + m.ResultingFeatureBitmap = buf.DecodeUint32() + return nil +} + +// L2InterfaceEfpFilter defines message 'l2_interface_efp_filter'. +type L2InterfaceEfpFilter struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + EnableDisable bool `binapi:"bool,name=enable_disable,default=true" json:"enable_disable,omitempty"` +} + +func (m *L2InterfaceEfpFilter) Reset() { *m = L2InterfaceEfpFilter{} } +func (*L2InterfaceEfpFilter) GetMessageName() string { return "l2_interface_efp_filter" } +func (*L2InterfaceEfpFilter) GetCrcString() string { return "5501adee" } +func (*L2InterfaceEfpFilter) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *L2InterfaceEfpFilter) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.SwIfIndex + size += 1 // m.EnableDisable + return size +} +func (m *L2InterfaceEfpFilter) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeBool(m.EnableDisable) + return buf.Bytes(), nil +} +func (m *L2InterfaceEfpFilter) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.EnableDisable = buf.DecodeBool() + return nil +} + +// L2InterfaceEfpFilterReply defines message 'l2_interface_efp_filter_reply'. +type L2InterfaceEfpFilterReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *L2InterfaceEfpFilterReply) Reset() { *m = L2InterfaceEfpFilterReply{} } +func (*L2InterfaceEfpFilterReply) GetMessageName() string { return "l2_interface_efp_filter_reply" } +func (*L2InterfaceEfpFilterReply) GetCrcString() string { return "e8d4e804" } +func (*L2InterfaceEfpFilterReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *L2InterfaceEfpFilterReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *L2InterfaceEfpFilterReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *L2InterfaceEfpFilterReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// L2InterfacePbbTagRewrite defines message 'l2_interface_pbb_tag_rewrite'. +type L2InterfacePbbTagRewrite struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + VtrOp uint32 `binapi:"u32,name=vtr_op" json:"vtr_op,omitempty"` + OuterTag uint16 `binapi:"u16,name=outer_tag" json:"outer_tag,omitempty"` + BDmac ethernet_types.MacAddress `binapi:"mac_address,name=b_dmac" json:"b_dmac,omitempty"` + BSmac ethernet_types.MacAddress `binapi:"mac_address,name=b_smac" json:"b_smac,omitempty"` + BVlanid uint16 `binapi:"u16,name=b_vlanid" json:"b_vlanid,omitempty"` + ISid uint32 `binapi:"u32,name=i_sid" json:"i_sid,omitempty"` +} + +func (m *L2InterfacePbbTagRewrite) Reset() { *m = L2InterfacePbbTagRewrite{} } +func (*L2InterfacePbbTagRewrite) GetMessageName() string { return "l2_interface_pbb_tag_rewrite" } +func (*L2InterfacePbbTagRewrite) GetCrcString() string { return "612efa5a" } +func (*L2InterfacePbbTagRewrite) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *L2InterfacePbbTagRewrite) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.SwIfIndex + size += 4 // m.VtrOp + size += 2 // m.OuterTag + size += 1 * 6 // m.BDmac + size += 1 * 6 // m.BSmac + size += 2 // m.BVlanid + size += 4 // m.ISid + return size +} +func (m *L2InterfacePbbTagRewrite) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeUint32(uint32(m.VtrOp)) + buf.EncodeUint16(uint16(m.OuterTag)) + buf.EncodeBytes(m.BDmac[:], 6) + buf.EncodeBytes(m.BSmac[:], 6) + buf.EncodeUint16(uint16(m.BVlanid)) + buf.EncodeUint32(uint32(m.ISid)) + return buf.Bytes(), nil +} +func (m *L2InterfacePbbTagRewrite) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.VtrOp = buf.DecodeUint32() + m.OuterTag = buf.DecodeUint16() + copy(m.BDmac[:], buf.DecodeBytes(6)) + copy(m.BSmac[:], buf.DecodeBytes(6)) + m.BVlanid = buf.DecodeUint16() + m.ISid = buf.DecodeUint32() + return nil +} + +// L2InterfacePbbTagRewriteReply defines message 'l2_interface_pbb_tag_rewrite_reply'. +type L2InterfacePbbTagRewriteReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *L2InterfacePbbTagRewriteReply) Reset() { *m = L2InterfacePbbTagRewriteReply{} } +func (*L2InterfacePbbTagRewriteReply) GetMessageName() string { + return "l2_interface_pbb_tag_rewrite_reply" +} +func (*L2InterfacePbbTagRewriteReply) GetCrcString() string { return "e8d4e804" } +func (*L2InterfacePbbTagRewriteReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *L2InterfacePbbTagRewriteReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *L2InterfacePbbTagRewriteReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *L2InterfacePbbTagRewriteReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// L2InterfaceVlanTagRewrite defines message 'l2_interface_vlan_tag_rewrite'. +type L2InterfaceVlanTagRewrite struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + VtrOp uint32 `binapi:"u32,name=vtr_op" json:"vtr_op,omitempty"` + PushDot1q uint32 `binapi:"u32,name=push_dot1q" json:"push_dot1q,omitempty"` + Tag1 uint32 `binapi:"u32,name=tag1" json:"tag1,omitempty"` + Tag2 uint32 `binapi:"u32,name=tag2" json:"tag2,omitempty"` +} + +func (m *L2InterfaceVlanTagRewrite) Reset() { *m = L2InterfaceVlanTagRewrite{} } +func (*L2InterfaceVlanTagRewrite) GetMessageName() string { return "l2_interface_vlan_tag_rewrite" } +func (*L2InterfaceVlanTagRewrite) GetCrcString() string { return "62cc0bbc" } +func (*L2InterfaceVlanTagRewrite) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *L2InterfaceVlanTagRewrite) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.SwIfIndex + size += 4 // m.VtrOp + size += 4 // m.PushDot1q + size += 4 // m.Tag1 + size += 4 // m.Tag2 + return size +} +func (m *L2InterfaceVlanTagRewrite) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeUint32(uint32(m.VtrOp)) + buf.EncodeUint32(uint32(m.PushDot1q)) + buf.EncodeUint32(uint32(m.Tag1)) + buf.EncodeUint32(uint32(m.Tag2)) + return buf.Bytes(), nil +} +func (m *L2InterfaceVlanTagRewrite) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.VtrOp = buf.DecodeUint32() + m.PushDot1q = buf.DecodeUint32() + m.Tag1 = buf.DecodeUint32() + m.Tag2 = buf.DecodeUint32() + return nil +} + +// L2InterfaceVlanTagRewriteReply defines message 'l2_interface_vlan_tag_rewrite_reply'. +type L2InterfaceVlanTagRewriteReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *L2InterfaceVlanTagRewriteReply) Reset() { *m = L2InterfaceVlanTagRewriteReply{} } +func (*L2InterfaceVlanTagRewriteReply) GetMessageName() string { + return "l2_interface_vlan_tag_rewrite_reply" +} +func (*L2InterfaceVlanTagRewriteReply) GetCrcString() string { return "e8d4e804" } +func (*L2InterfaceVlanTagRewriteReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *L2InterfaceVlanTagRewriteReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *L2InterfaceVlanTagRewriteReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *L2InterfaceVlanTagRewriteReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// L2MacsEvent defines message 'l2_macs_event'. +type L2MacsEvent struct { + PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"` + NMacs uint32 `binapi:"u32,name=n_macs" json:"-"` + Mac []MacEntry `binapi:"mac_entry[n_macs],name=mac" json:"mac,omitempty"` +} + +func (m *L2MacsEvent) Reset() { *m = L2MacsEvent{} } +func (*L2MacsEvent) GetMessageName() string { return "l2_macs_event" } +func (*L2MacsEvent) GetCrcString() string { return "2eadfc8b" } +func (*L2MacsEvent) GetMessageType() api.MessageType { + return api.EventMessage +} + +func (m *L2MacsEvent) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.PID + size += 4 // m.NMacs + for j1 := 0; j1 < len(m.Mac); j1++ { + var s1 MacEntry + _ = s1 + if j1 < len(m.Mac) { + s1 = m.Mac[j1] + } + size += 4 // s1.SwIfIndex + size += 1 * 6 // s1.MacAddr + size += 4 // s1.Action + size += 1 // s1.Flags + } + return size +} +func (m *L2MacsEvent) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.PID)) + buf.EncodeUint32(uint32(len(m.Mac))) + for j0 := 0; j0 < len(m.Mac); j0++ { + var v0 MacEntry + if j0 < len(m.Mac) { + v0 = m.Mac[j0] + } + buf.EncodeUint32(uint32(v0.SwIfIndex)) + buf.EncodeBytes(v0.MacAddr[:], 6) + buf.EncodeUint32(uint32(v0.Action)) + buf.EncodeUint8(uint8(v0.Flags)) + } + return buf.Bytes(), nil +} +func (m *L2MacsEvent) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.PID = buf.DecodeUint32() + m.NMacs = buf.DecodeUint32() + m.Mac = make([]MacEntry, int(m.NMacs)) + for j0 := 0; j0 < len(m.Mac); j0++ { + m.Mac[j0].SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + copy(m.Mac[j0].MacAddr[:], buf.DecodeBytes(6)) + m.Mac[j0].Action = MacEventAction(buf.DecodeUint32()) + m.Mac[j0].Flags = buf.DecodeUint8() + } + return nil +} + +// L2PatchAddDel defines message 'l2_patch_add_del'. +type L2PatchAddDel struct { + RxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"` + TxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=tx_sw_if_index" json:"tx_sw_if_index,omitempty"` + IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` +} + +func (m *L2PatchAddDel) Reset() { *m = L2PatchAddDel{} } +func (*L2PatchAddDel) GetMessageName() string { return "l2_patch_add_del" } +func (*L2PatchAddDel) GetCrcString() string { return "522f3445" } +func (*L2PatchAddDel) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *L2PatchAddDel) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.RxSwIfIndex + size += 4 // m.TxSwIfIndex + size += 1 // m.IsAdd + return size +} +func (m *L2PatchAddDel) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.RxSwIfIndex)) + buf.EncodeUint32(uint32(m.TxSwIfIndex)) + buf.EncodeBool(m.IsAdd) + return buf.Bytes(), nil +} +func (m *L2PatchAddDel) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.RxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.TxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.IsAdd = buf.DecodeBool() + return nil +} + +// L2PatchAddDelReply defines message 'l2_patch_add_del_reply'. +type L2PatchAddDelReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *L2PatchAddDelReply) Reset() { *m = L2PatchAddDelReply{} } +func (*L2PatchAddDelReply) GetMessageName() string { return "l2_patch_add_del_reply" } +func (*L2PatchAddDelReply) GetCrcString() string { return "e8d4e804" } +func (*L2PatchAddDelReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *L2PatchAddDelReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *L2PatchAddDelReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *L2PatchAddDelReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// L2XconnectDetails defines message 'l2_xconnect_details'. +type L2XconnectDetails struct { + RxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"` + TxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=tx_sw_if_index" json:"tx_sw_if_index,omitempty"` +} + +func (m *L2XconnectDetails) Reset() { *m = L2XconnectDetails{} } +func (*L2XconnectDetails) GetMessageName() string { return "l2_xconnect_details" } +func (*L2XconnectDetails) GetCrcString() string { return "c8aa6b37" } +func (*L2XconnectDetails) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *L2XconnectDetails) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.RxSwIfIndex + size += 4 // m.TxSwIfIndex + return size +} +func (m *L2XconnectDetails) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.RxSwIfIndex)) + buf.EncodeUint32(uint32(m.TxSwIfIndex)) + return buf.Bytes(), nil +} +func (m *L2XconnectDetails) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.RxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.TxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + return nil +} + +// L2XconnectDump defines message 'l2_xconnect_dump'. +type L2XconnectDump struct{} + +func (m *L2XconnectDump) Reset() { *m = L2XconnectDump{} } +func (*L2XconnectDump) GetMessageName() string { return "l2_xconnect_dump" } +func (*L2XconnectDump) GetCrcString() string { return "51077d14" } +func (*L2XconnectDump) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *L2XconnectDump) Size() int { + if m == nil { + return 0 + } + var size int + return size +} +func (m *L2XconnectDump) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + return buf.Bytes(), nil +} +func (m *L2XconnectDump) Unmarshal(b []byte) error { + return nil +} + +// L2fibAddDel defines message 'l2fib_add_del'. +type L2fibAddDel struct { + Mac ethernet_types.MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"` + BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` + StaticMac bool `binapi:"bool,name=static_mac" json:"static_mac,omitempty"` + FilterMac bool `binapi:"bool,name=filter_mac" json:"filter_mac,omitempty"` + BviMac bool `binapi:"bool,name=bvi_mac" json:"bvi_mac,omitempty"` +} + +func (m *L2fibAddDel) Reset() { *m = L2fibAddDel{} } +func (*L2fibAddDel) GetMessageName() string { return "l2fib_add_del" } +func (*L2fibAddDel) GetCrcString() string { return "f29d796c" } +func (*L2fibAddDel) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *L2fibAddDel) Size() int { + if m == nil { + return 0 + } + var size int + size += 1 * 6 // m.Mac + size += 4 // m.BdID + size += 4 // m.SwIfIndex + size += 1 // m.IsAdd + size += 1 // m.StaticMac + size += 1 // m.FilterMac + size += 1 // m.BviMac + return size +} +func (m *L2fibAddDel) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeBytes(m.Mac[:], 6) + buf.EncodeUint32(uint32(m.BdID)) + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeBool(m.IsAdd) + buf.EncodeBool(m.StaticMac) + buf.EncodeBool(m.FilterMac) + buf.EncodeBool(m.BviMac) + return buf.Bytes(), nil +} +func (m *L2fibAddDel) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + copy(m.Mac[:], buf.DecodeBytes(6)) + m.BdID = buf.DecodeUint32() + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.IsAdd = buf.DecodeBool() + m.StaticMac = buf.DecodeBool() + m.FilterMac = buf.DecodeBool() + m.BviMac = buf.DecodeBool() + return nil +} + +// L2fibAddDelReply defines message 'l2fib_add_del_reply'. +type L2fibAddDelReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *L2fibAddDelReply) Reset() { *m = L2fibAddDelReply{} } +func (*L2fibAddDelReply) GetMessageName() string { return "l2fib_add_del_reply" } +func (*L2fibAddDelReply) GetCrcString() string { return "e8d4e804" } +func (*L2fibAddDelReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *L2fibAddDelReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *L2fibAddDelReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *L2fibAddDelReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// L2fibFlushAll defines message 'l2fib_flush_all'. +type L2fibFlushAll struct{} + +func (m *L2fibFlushAll) Reset() { *m = L2fibFlushAll{} } +func (*L2fibFlushAll) GetMessageName() string { return "l2fib_flush_all" } +func (*L2fibFlushAll) GetCrcString() string { return "51077d14" } +func (*L2fibFlushAll) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *L2fibFlushAll) Size() int { + if m == nil { + return 0 + } + var size int + return size +} +func (m *L2fibFlushAll) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + return buf.Bytes(), nil +} +func (m *L2fibFlushAll) Unmarshal(b []byte) error { + return nil +} + +// L2fibFlushAllReply defines message 'l2fib_flush_all_reply'. +type L2fibFlushAllReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *L2fibFlushAllReply) Reset() { *m = L2fibFlushAllReply{} } +func (*L2fibFlushAllReply) GetMessageName() string { return "l2fib_flush_all_reply" } +func (*L2fibFlushAllReply) GetCrcString() string { return "e8d4e804" } +func (*L2fibFlushAllReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *L2fibFlushAllReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *L2fibFlushAllReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *L2fibFlushAllReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// L2fibFlushBd defines message 'l2fib_flush_bd'. +type L2fibFlushBd struct { + BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` +} + +func (m *L2fibFlushBd) Reset() { *m = L2fibFlushBd{} } +func (*L2fibFlushBd) GetMessageName() string { return "l2fib_flush_bd" } +func (*L2fibFlushBd) GetCrcString() string { return "c25fdce6" } +func (*L2fibFlushBd) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *L2fibFlushBd) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.BdID + return size +} +func (m *L2fibFlushBd) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.BdID)) + return buf.Bytes(), nil +} +func (m *L2fibFlushBd) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.BdID = buf.DecodeUint32() + return nil +} + +// L2fibFlushBdReply defines message 'l2fib_flush_bd_reply'. +type L2fibFlushBdReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *L2fibFlushBdReply) Reset() { *m = L2fibFlushBdReply{} } +func (*L2fibFlushBdReply) GetMessageName() string { return "l2fib_flush_bd_reply" } +func (*L2fibFlushBdReply) GetCrcString() string { return "e8d4e804" } +func (*L2fibFlushBdReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *L2fibFlushBdReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *L2fibFlushBdReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *L2fibFlushBdReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// L2fibFlushInt defines message 'l2fib_flush_int'. +type L2fibFlushInt struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` +} + +func (m *L2fibFlushInt) Reset() { *m = L2fibFlushInt{} } +func (*L2fibFlushInt) GetMessageName() string { return "l2fib_flush_int" } +func (*L2fibFlushInt) GetCrcString() string { return "f9e6675e" } +func (*L2fibFlushInt) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *L2fibFlushInt) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.SwIfIndex + return size +} +func (m *L2fibFlushInt) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.SwIfIndex)) + return buf.Bytes(), nil +} +func (m *L2fibFlushInt) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + return nil +} + +// L2fibFlushIntReply defines message 'l2fib_flush_int_reply'. +type L2fibFlushIntReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *L2fibFlushIntReply) Reset() { *m = L2fibFlushIntReply{} } +func (*L2fibFlushIntReply) GetMessageName() string { return "l2fib_flush_int_reply" } +func (*L2fibFlushIntReply) GetCrcString() string { return "e8d4e804" } +func (*L2fibFlushIntReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *L2fibFlushIntReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *L2fibFlushIntReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *L2fibFlushIntReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// SwInterfaceSetL2Bridge defines message 'sw_interface_set_l2_bridge'. +type SwInterfaceSetL2Bridge struct { + RxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"` + BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` + PortType L2PortType `binapi:"l2_port_type,name=port_type" json:"port_type,omitempty"` + Shg uint8 `binapi:"u8,name=shg" json:"shg,omitempty"` + Enable bool `binapi:"bool,name=enable,default=true" json:"enable,omitempty"` +} + +func (m *SwInterfaceSetL2Bridge) Reset() { *m = SwInterfaceSetL2Bridge{} } +func (*SwInterfaceSetL2Bridge) GetMessageName() string { return "sw_interface_set_l2_bridge" } +func (*SwInterfaceSetL2Bridge) GetCrcString() string { return "2e483cd0" } +func (*SwInterfaceSetL2Bridge) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *SwInterfaceSetL2Bridge) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.RxSwIfIndex + size += 4 // m.BdID + size += 4 // m.PortType + size += 1 // m.Shg + size += 1 // m.Enable + return size +} +func (m *SwInterfaceSetL2Bridge) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.RxSwIfIndex)) + buf.EncodeUint32(uint32(m.BdID)) + buf.EncodeUint32(uint32(m.PortType)) + buf.EncodeUint8(uint8(m.Shg)) + buf.EncodeBool(m.Enable) + return buf.Bytes(), nil +} +func (m *SwInterfaceSetL2Bridge) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.RxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.BdID = buf.DecodeUint32() + m.PortType = L2PortType(buf.DecodeUint32()) + m.Shg = buf.DecodeUint8() + m.Enable = buf.DecodeBool() + return nil +} + +// SwInterfaceSetL2BridgeReply defines message 'sw_interface_set_l2_bridge_reply'. +type SwInterfaceSetL2BridgeReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *SwInterfaceSetL2BridgeReply) Reset() { *m = SwInterfaceSetL2BridgeReply{} } +func (*SwInterfaceSetL2BridgeReply) GetMessageName() string { + return "sw_interface_set_l2_bridge_reply" +} +func (*SwInterfaceSetL2BridgeReply) GetCrcString() string { return "e8d4e804" } +func (*SwInterfaceSetL2BridgeReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *SwInterfaceSetL2BridgeReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *SwInterfaceSetL2BridgeReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *SwInterfaceSetL2BridgeReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// SwInterfaceSetL2Xconnect defines message 'sw_interface_set_l2_xconnect'. +type SwInterfaceSetL2Xconnect struct { + RxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=rx_sw_if_index" json:"rx_sw_if_index,omitempty"` + TxSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=tx_sw_if_index" json:"tx_sw_if_index,omitempty"` + Enable bool `binapi:"bool,name=enable,default=true" json:"enable,omitempty"` +} + +func (m *SwInterfaceSetL2Xconnect) Reset() { *m = SwInterfaceSetL2Xconnect{} } +func (*SwInterfaceSetL2Xconnect) GetMessageName() string { return "sw_interface_set_l2_xconnect" } +func (*SwInterfaceSetL2Xconnect) GetCrcString() string { return "1aaa2dbb" } +func (*SwInterfaceSetL2Xconnect) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *SwInterfaceSetL2Xconnect) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.RxSwIfIndex + size += 4 // m.TxSwIfIndex + size += 1 // m.Enable + return size +} +func (m *SwInterfaceSetL2Xconnect) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.RxSwIfIndex)) + buf.EncodeUint32(uint32(m.TxSwIfIndex)) + buf.EncodeBool(m.Enable) + return buf.Bytes(), nil +} +func (m *SwInterfaceSetL2Xconnect) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.RxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.TxSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.Enable = buf.DecodeBool() + return nil +} + +// SwInterfaceSetL2XconnectReply defines message 'sw_interface_set_l2_xconnect_reply'. +type SwInterfaceSetL2XconnectReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *SwInterfaceSetL2XconnectReply) Reset() { *m = SwInterfaceSetL2XconnectReply{} } +func (*SwInterfaceSetL2XconnectReply) GetMessageName() string { + return "sw_interface_set_l2_xconnect_reply" +} +func (*SwInterfaceSetL2XconnectReply) GetCrcString() string { return "e8d4e804" } +func (*SwInterfaceSetL2XconnectReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *SwInterfaceSetL2XconnectReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *SwInterfaceSetL2XconnectReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *SwInterfaceSetL2XconnectReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// SwInterfaceSetVpath defines message 'sw_interface_set_vpath'. +type SwInterfaceSetVpath struct { + SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` + Enable bool `binapi:"bool,name=enable,default=%!s(float64=4.294967295e+09)" json:"enable,omitempty"` +} + +func (m *SwInterfaceSetVpath) Reset() { *m = SwInterfaceSetVpath{} } +func (*SwInterfaceSetVpath) GetMessageName() string { return "sw_interface_set_vpath" } +func (*SwInterfaceSetVpath) GetCrcString() string { return "ae6cfcfb" } +func (*SwInterfaceSetVpath) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *SwInterfaceSetVpath) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.SwIfIndex + size += 1 // m.Enable + return size +} +func (m *SwInterfaceSetVpath) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.SwIfIndex)) + buf.EncodeBool(m.Enable) + return buf.Bytes(), nil +} +func (m *SwInterfaceSetVpath) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) + m.Enable = buf.DecodeBool() + return nil +} + +// SwInterfaceSetVpathReply defines message 'sw_interface_set_vpath_reply'. +type SwInterfaceSetVpathReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *SwInterfaceSetVpathReply) Reset() { *m = SwInterfaceSetVpathReply{} } +func (*SwInterfaceSetVpathReply) GetMessageName() string { return "sw_interface_set_vpath_reply" } +func (*SwInterfaceSetVpathReply) GetCrcString() string { return "e8d4e804" } +func (*SwInterfaceSetVpathReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *SwInterfaceSetVpathReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *SwInterfaceSetVpathReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *SwInterfaceSetVpathReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// WantL2ArpTermEvents defines message 'want_l2_arp_term_events'. +type WantL2ArpTermEvents struct { + Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"` + PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"` +} + +func (m *WantL2ArpTermEvents) Reset() { *m = WantL2ArpTermEvents{} } +func (*WantL2ArpTermEvents) GetMessageName() string { return "want_l2_arp_term_events" } +func (*WantL2ArpTermEvents) GetCrcString() string { return "3ec6d6c2" } +func (*WantL2ArpTermEvents) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *WantL2ArpTermEvents) Size() int { + if m == nil { + return 0 + } + var size int + size += 1 // m.Enable + size += 4 // m.PID + return size +} +func (m *WantL2ArpTermEvents) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeBool(m.Enable) + buf.EncodeUint32(uint32(m.PID)) + return buf.Bytes(), nil +} +func (m *WantL2ArpTermEvents) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Enable = buf.DecodeBool() + m.PID = buf.DecodeUint32() + return nil +} + +// WantL2ArpTermEventsReply defines message 'want_l2_arp_term_events_reply'. +type WantL2ArpTermEventsReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *WantL2ArpTermEventsReply) Reset() { *m = WantL2ArpTermEventsReply{} } +func (*WantL2ArpTermEventsReply) GetMessageName() string { return "want_l2_arp_term_events_reply" } +func (*WantL2ArpTermEventsReply) GetCrcString() string { return "e8d4e804" } +func (*WantL2ArpTermEventsReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *WantL2ArpTermEventsReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *WantL2ArpTermEventsReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *WantL2ArpTermEventsReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +// WantL2MacsEvents defines message 'want_l2_macs_events'. +type WantL2MacsEvents struct { + LearnLimit uint32 `binapi:"u32,name=learn_limit,default=%!s(float64=1000)" json:"learn_limit,omitempty"` + ScanDelay uint8 `binapi:"u8,name=scan_delay,default=%!s(float64=10)" json:"scan_delay,omitempty"` + MaxMacsInEvent uint8 `binapi:"u8,name=max_macs_in_event,default=%!s(float64=10)" json:"max_macs_in_event,omitempty"` + EnableDisable bool `binapi:"bool,name=enable_disable,default=true" json:"enable_disable,omitempty"` + PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"` +} + +func (m *WantL2MacsEvents) Reset() { *m = WantL2MacsEvents{} } +func (*WantL2MacsEvents) GetMessageName() string { return "want_l2_macs_events" } +func (*WantL2MacsEvents) GetCrcString() string { return "9aabdfde" } +func (*WantL2MacsEvents) GetMessageType() api.MessageType { + return api.RequestMessage +} + +func (m *WantL2MacsEvents) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.LearnLimit + size += 1 // m.ScanDelay + size += 1 // m.MaxMacsInEvent + size += 1 // m.EnableDisable + size += 4 // m.PID + return size +} +func (m *WantL2MacsEvents) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.LearnLimit)) + buf.EncodeUint8(uint8(m.ScanDelay)) + buf.EncodeUint8(uint8(m.MaxMacsInEvent)) + buf.EncodeBool(m.EnableDisable) + buf.EncodeUint32(uint32(m.PID)) + return buf.Bytes(), nil +} +func (m *WantL2MacsEvents) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.LearnLimit = buf.DecodeUint32() + m.ScanDelay = buf.DecodeUint8() + m.MaxMacsInEvent = buf.DecodeUint8() + m.EnableDisable = buf.DecodeBool() + m.PID = buf.DecodeUint32() + return nil +} + +// WantL2MacsEventsReply defines message 'want_l2_macs_events_reply'. +type WantL2MacsEventsReply struct { + Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` +} + +func (m *WantL2MacsEventsReply) Reset() { *m = WantL2MacsEventsReply{} } +func (*WantL2MacsEventsReply) GetMessageName() string { return "want_l2_macs_events_reply" } +func (*WantL2MacsEventsReply) GetCrcString() string { return "e8d4e804" } +func (*WantL2MacsEventsReply) GetMessageType() api.MessageType { + return api.ReplyMessage +} + +func (m *WantL2MacsEventsReply) Size() int { + if m == nil { + return 0 + } + var size int + size += 4 // m.Retval + return size +} +func (m *WantL2MacsEventsReply) Marshal(b []byte) ([]byte, error) { + var buf *codec.Buffer + if b == nil { + buf = codec.NewBuffer(make([]byte, m.Size())) + } else { + buf = codec.NewBuffer(b) + } + buf.EncodeUint32(uint32(m.Retval)) + return buf.Bytes(), nil +} +func (m *WantL2MacsEventsReply) Unmarshal(b []byte) error { + buf := codec.NewBuffer(b) + m.Retval = int32(buf.DecodeUint32()) + return nil +} + +func init() { file_l2_binapi_init() } +func file_l2_binapi_init() { + api.RegisterMessage((*BdIPMacAddDel)(nil), "bd_ip_mac_add_del_5f2b84e2") + api.RegisterMessage((*BdIPMacAddDelReply)(nil), "bd_ip_mac_add_del_reply_e8d4e804") + api.RegisterMessage((*BdIPMacDetails)(nil), "bd_ip_mac_details_a52f8044") + api.RegisterMessage((*BdIPMacDump)(nil), "bd_ip_mac_dump_c25fdce6") + api.RegisterMessage((*BdIPMacFlush)(nil), "bd_ip_mac_flush_c25fdce6") + api.RegisterMessage((*BdIPMacFlushReply)(nil), "bd_ip_mac_flush_reply_e8d4e804") + api.RegisterMessage((*BridgeDomainAddDel)(nil), "bridge_domain_add_del_600b7170") + api.RegisterMessage((*BridgeDomainAddDelReply)(nil), "bridge_domain_add_del_reply_e8d4e804") + api.RegisterMessage((*BridgeDomainDetails)(nil), "bridge_domain_details_979f549d") + api.RegisterMessage((*BridgeDomainDump)(nil), "bridge_domain_dump_74396a43") + api.RegisterMessage((*BridgeDomainSetMacAge)(nil), "bridge_domain_set_mac_age_b537ad7b") + api.RegisterMessage((*BridgeDomainSetMacAgeReply)(nil), "bridge_domain_set_mac_age_reply_e8d4e804") + api.RegisterMessage((*BridgeFlags)(nil), "bridge_flags_1b0c5fbd") + api.RegisterMessage((*BridgeFlagsReply)(nil), "bridge_flags_reply_29b2a2b3") + api.RegisterMessage((*BviCreate)(nil), "bvi_create_f5398559") + api.RegisterMessage((*BviCreateReply)(nil), "bvi_create_reply_5383d31f") + api.RegisterMessage((*BviDelete)(nil), "bvi_delete_f9e6675e") + api.RegisterMessage((*BviDeleteReply)(nil), "bvi_delete_reply_e8d4e804") + api.RegisterMessage((*L2ArpTermEvent)(nil), "l2_arp_term_event_85ff71ea") + api.RegisterMessage((*L2FibClearTable)(nil), "l2_fib_clear_table_51077d14") + api.RegisterMessage((*L2FibClearTableReply)(nil), "l2_fib_clear_table_reply_e8d4e804") + api.RegisterMessage((*L2FibTableDetails)(nil), "l2_fib_table_details_e8d2fc72") + api.RegisterMessage((*L2FibTableDump)(nil), "l2_fib_table_dump_c25fdce6") + api.RegisterMessage((*L2Flags)(nil), "l2_flags_fc41cfe8") + api.RegisterMessage((*L2FlagsReply)(nil), "l2_flags_reply_29b2a2b3") + api.RegisterMessage((*L2InterfaceEfpFilter)(nil), "l2_interface_efp_filter_5501adee") + api.RegisterMessage((*L2InterfaceEfpFilterReply)(nil), "l2_interface_efp_filter_reply_e8d4e804") + api.RegisterMessage((*L2InterfacePbbTagRewrite)(nil), "l2_interface_pbb_tag_rewrite_612efa5a") + api.RegisterMessage((*L2InterfacePbbTagRewriteReply)(nil), "l2_interface_pbb_tag_rewrite_reply_e8d4e804") + api.RegisterMessage((*L2InterfaceVlanTagRewrite)(nil), "l2_interface_vlan_tag_rewrite_62cc0bbc") + api.RegisterMessage((*L2InterfaceVlanTagRewriteReply)(nil), "l2_interface_vlan_tag_rewrite_reply_e8d4e804") + api.RegisterMessage((*L2MacsEvent)(nil), "l2_macs_event_2eadfc8b") + api.RegisterMessage((*L2PatchAddDel)(nil), "l2_patch_add_del_522f3445") + api.RegisterMessage((*L2PatchAddDelReply)(nil), "l2_patch_add_del_reply_e8d4e804") + api.RegisterMessage((*L2XconnectDetails)(nil), "l2_xconnect_details_c8aa6b37") + api.RegisterMessage((*L2XconnectDump)(nil), "l2_xconnect_dump_51077d14") + api.RegisterMessage((*L2fibAddDel)(nil), "l2fib_add_del_f29d796c") + api.RegisterMessage((*L2fibAddDelReply)(nil), "l2fib_add_del_reply_e8d4e804") + api.RegisterMessage((*L2fibFlushAll)(nil), "l2fib_flush_all_51077d14") + api.RegisterMessage((*L2fibFlushAllReply)(nil), "l2fib_flush_all_reply_e8d4e804") + api.RegisterMessage((*L2fibFlushBd)(nil), "l2fib_flush_bd_c25fdce6") + api.RegisterMessage((*L2fibFlushBdReply)(nil), "l2fib_flush_bd_reply_e8d4e804") + api.RegisterMessage((*L2fibFlushInt)(nil), "l2fib_flush_int_f9e6675e") + api.RegisterMessage((*L2fibFlushIntReply)(nil), "l2fib_flush_int_reply_e8d4e804") + api.RegisterMessage((*SwInterfaceSetL2Bridge)(nil), "sw_interface_set_l2_bridge_2e483cd0") + api.RegisterMessage((*SwInterfaceSetL2BridgeReply)(nil), "sw_interface_set_l2_bridge_reply_e8d4e804") + api.RegisterMessage((*SwInterfaceSetL2Xconnect)(nil), "sw_interface_set_l2_xconnect_1aaa2dbb") + api.RegisterMessage((*SwInterfaceSetL2XconnectReply)(nil), "sw_interface_set_l2_xconnect_reply_e8d4e804") + api.RegisterMessage((*SwInterfaceSetVpath)(nil), "sw_interface_set_vpath_ae6cfcfb") + api.RegisterMessage((*SwInterfaceSetVpathReply)(nil), "sw_interface_set_vpath_reply_e8d4e804") + api.RegisterMessage((*WantL2ArpTermEvents)(nil), "want_l2_arp_term_events_3ec6d6c2") + api.RegisterMessage((*WantL2ArpTermEventsReply)(nil), "want_l2_arp_term_events_reply_e8d4e804") + api.RegisterMessage((*WantL2MacsEvents)(nil), "want_l2_macs_events_9aabdfde") + api.RegisterMessage((*WantL2MacsEventsReply)(nil), "want_l2_macs_events_reply_e8d4e804") +} + +// Messages returns list of all messages in this module. +func AllMessages() []api.Message { + return []api.Message{ + (*BdIPMacAddDel)(nil), + (*BdIPMacAddDelReply)(nil), + (*BdIPMacDetails)(nil), + (*BdIPMacDump)(nil), + (*BdIPMacFlush)(nil), + (*BdIPMacFlushReply)(nil), + (*BridgeDomainAddDel)(nil), + (*BridgeDomainAddDelReply)(nil), + (*BridgeDomainDetails)(nil), + (*BridgeDomainDump)(nil), + (*BridgeDomainSetMacAge)(nil), + (*BridgeDomainSetMacAgeReply)(nil), + (*BridgeFlags)(nil), + (*BridgeFlagsReply)(nil), + (*BviCreate)(nil), + (*BviCreateReply)(nil), + (*BviDelete)(nil), + (*BviDeleteReply)(nil), + (*L2ArpTermEvent)(nil), + (*L2FibClearTable)(nil), + (*L2FibClearTableReply)(nil), + (*L2FibTableDetails)(nil), + (*L2FibTableDump)(nil), + (*L2Flags)(nil), + (*L2FlagsReply)(nil), + (*L2InterfaceEfpFilter)(nil), + (*L2InterfaceEfpFilterReply)(nil), + (*L2InterfacePbbTagRewrite)(nil), + (*L2InterfacePbbTagRewriteReply)(nil), + (*L2InterfaceVlanTagRewrite)(nil), + (*L2InterfaceVlanTagRewriteReply)(nil), + (*L2MacsEvent)(nil), + (*L2PatchAddDel)(nil), + (*L2PatchAddDelReply)(nil), + (*L2XconnectDetails)(nil), + (*L2XconnectDump)(nil), + (*L2fibAddDel)(nil), + (*L2fibAddDelReply)(nil), + (*L2fibFlushAll)(nil), + (*L2fibFlushAllReply)(nil), + (*L2fibFlushBd)(nil), + (*L2fibFlushBdReply)(nil), + (*L2fibFlushInt)(nil), + (*L2fibFlushIntReply)(nil), + (*SwInterfaceSetL2Bridge)(nil), + (*SwInterfaceSetL2BridgeReply)(nil), + (*SwInterfaceSetL2Xconnect)(nil), + (*SwInterfaceSetL2XconnectReply)(nil), + (*SwInterfaceSetVpath)(nil), + (*SwInterfaceSetVpathReply)(nil), + (*WantL2ArpTermEvents)(nil), + (*WantL2ArpTermEventsReply)(nil), + (*WantL2MacsEvents)(nil), + (*WantL2MacsEventsReply)(nil), + } +} diff --git a/binapi/l2/l2_rest.ba.go b/binapi/l2/l2_rest.ba.go new file mode 100644 index 0000000..f12ab06 --- /dev/null +++ b/binapi/l2/l2_rest.ba.go @@ -0,0 +1,502 @@ +// Code generated by GoVPP's binapi-generator. DO NOT EDIT. + +package l2 + +import ( + "encoding/json" + "io/ioutil" + "net/http" +) + +func RESTHandler(rpc RPCService) http.Handler { + mux := http.NewServeMux() + mux.HandleFunc("/bd_ip_mac_add_del", func(w http.ResponseWriter, req *http.Request) { + var request = new(BdIPMacAddDel) + b, err := ioutil.ReadAll(req.Body) + if err != nil { + http.Error(w, "read body failed", http.StatusBadRequest) + return + } + if err := json.Unmarshal(b, request); err != nil { + http.Error(w, "unmarshal data failed", http.StatusBadRequest) + return + } + reply, err := rpc.BdIPMacAddDel(req.Context(), request) + if err != nil { + http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) + return + } + rep, err := json.MarshalIndent(reply, "", " ") + if err != nil { + http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) + return + } + w.Write(rep) + }) + mux.HandleFunc("/bd_ip_mac_flush", func(w http.ResponseWriter, req *http.Request) { + var request = new(BdIPMacFlush) + b, err := ioutil.ReadAll(req.Body) + if err != nil { + http.Error(w, "read body failed", http.StatusBadRequest) + return + } + if err := json.Unmarshal(b, request); err != nil { + http.Error(w, "unmarshal data failed", http.StatusBadRequest) + return + } + reply, err := rpc.BdIPMacFlush(req.Context(), request) + if err != nil { + http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) + return + } + rep, err := json.MarshalIndent(reply, "", " ") + if err != nil { + http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) + return + } + w.Write(rep) + }) + mux.HandleFunc("/bridge_domain_add_del", func(w http.ResponseWriter, req *http.Request) { + var request = new(BridgeDomainAddDel) + b, err := ioutil.ReadAll(req.Body) + if err != nil { + http.Error(w, "read body failed", http.StatusBadRequest) + return + } + if err := json.Unmarshal(b, request); err != nil { + http.Error(w, "unmarshal data failed", http.StatusBadRequest) + return + } + reply, err := rpc.BridgeDomainAddDel(req.Context(), request) + if err != nil { + http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) + return + } + rep, err := json.MarshalIndent(reply, "", " ") + if err != nil { + http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) + return + } + w.Write(rep) + }) + mux.HandleFunc("/bridge_domain_set_mac_age", func(w http.ResponseWriter, req *http.Request) { + var request = new(BridgeDomainSetMacAge) + b, err := ioutil.ReadAll(req.Body) + if err != nil { + http.Error(w, "read body failed", http.StatusBadRequest) + return + } + if err := json.Unmarshal(b, request); err != nil { + http.Error(w, "unmarshal data failed", http.StatusBadRequest) + return + } + reply, err := rpc.BridgeDomainSetMacAge(req.Context(), request) + if err != nil { + http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) + return + } + rep, err := json.MarshalIndent(reply, "", " ") + if err != nil { + http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) + return + } + w.Write(rep) + }) + mux.HandleFunc("/bridge_flags", func(w http.ResponseWriter, req *http.Request) { + var request = new(BridgeFlags) + b, err := ioutil.ReadAll(req.Body) + if err != nil { + http.Error(w, "read body failed", http.StatusBadRequest) + return + } + if err := json.Unmarshal(b, request); err != nil { + http.Error(w, "unmarshal data failed", http.StatusBadRequest) + return + } + reply, err := rpc.BridgeFlags(req.Context(), request) + if err != nil { + http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) + return + } + rep, err := json.MarshalIndent(reply, "", " ") + if err != nil { + http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) + return + } + w.Write(rep) + }) + mux.HandleFunc("/bvi_create", func(w http.ResponseWriter, req *http.Request) { + var request = new(BviCreate) + b, err := ioutil.ReadAll(req.Body) + if err != nil { + http.Error(w, "read body failed", http.StatusBadRequest) + return + } + if err := json.Unmarshal(b, request); err != nil { + http.Error(w, "unmarshal data failed", http.StatusBadRequest) + return + } + reply, err := rpc.BviCreate(req.Context(), request) + if err != nil { + http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) + return + } + rep, err := json.MarshalIndent(reply, "", " ") + if err != nil { + http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) + return + } + w.Write(rep) + }) + mux.HandleFunc("/bvi_delete", func(w http.ResponseWriter, req *http.Request) { + var request = new(BviDelete) + b, err := ioutil.ReadAll(req.Body) + if err != nil { + http.Error(w, "read body failed", http.StatusBadRequest) + return + } + if err := json.Unmarshal(b, request); err != nil { + http.Error(w, "unmarshal data failed", http.StatusBadRequest) + return + } + reply, err := rpc.BviDelete(req.Context(), request) + if err != nil { + http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) + return + } + rep, err := json.MarshalIndent(reply, "", " ") + if err != nil { + http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) + return + } + w.Write(rep) + }) + mux.HandleFunc("/l2_fib_clear_table", func(w http.ResponseWriter, req *http.Request) { + var request = new(L2FibClearTable) + reply, err := rpc.L2FibClearTable(req.Context(), request) + if err != nil { + http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) + return + } + rep, err := json.MarshalIndent(reply, "", " ") + if err != nil { + http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) + return + } + w.Write(rep) + }) + mux.HandleFunc("/l2_flags", func(w http.ResponseWriter, req *http.Request) { + var request = new(L2Flags) + b, err := ioutil.ReadAll(req.Body) + if err != nil { + http.Error(w, "read body failed", http.StatusBadRequest) + return + } + if err := json.Unmarshal(b, request); err != nil { + http.Error(w, "unmarshal data failed", http.StatusBadRequest) + return + } + reply, err := rpc.L2Flags(req.Context(), request) + if err != nil { + http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) + return + } + rep, err := json.MarshalIndent(reply, "", " ") + if err != nil { + http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) + return + } + w.Write(rep) + }) + mux.HandleFunc("/l2_interface_efp_filter", func(w http.ResponseWriter, req *http.Request) { + var request = new(L2InterfaceEfpFilter) + b, err := ioutil.ReadAll(req.Body) + if err != nil { + http.Error(w, "read body failed", http.StatusBadRequest) + return + } + if err := json.Unmarshal(b, request); err != nil { + http.Error(w, "unmarshal data failed", http.StatusBadRequest) + return + } + reply, err := rpc.L2InterfaceEfpFilter(req.Context(), request) + if err != nil { + http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) + return + } + rep, err := json.MarshalIndent(reply, "", " ") + if err != nil { + http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) + return + } + w.Write(rep) + }) + mux.HandleFunc("/l2_interface_pbb_tag_rewrite", func(w http.ResponseWriter, req *http.Request) { + var request = new(L2InterfacePbbTagRewrite) + b, err := ioutil.ReadAll(req.Body) + if err != nil { + http.Error(w, "read body failed", http.StatusBadRequest) + return + } + if err := json.Unmarshal(b, request); err != nil { + http.Error(w, "unmarshal data failed", http.StatusBadRequest) + return + } + reply, err := rpc.L2InterfacePbbTagRewrite(req.Context(), request) + if err != nil { + http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) + return + } + rep, err := json.MarshalIndent(reply, "", " ") + if err != nil { + http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) + return + } + w.Write(rep) + }) + mux.HandleFunc("/l2_interface_vlan_tag_rewrite", func(w http.ResponseWriter, req *http.Request) { + var request = new(L2InterfaceVlanTagRewrite) + b, err := ioutil.ReadAll(req.Body) + if err != nil { + http.Error(w, "read body failed", http.StatusBadRequest) + return + } + if err := json.Unmarshal(b, request); err != nil { + http.Error(w, "unmarshal data failed", http.StatusBadRequest) + return + } + reply, err := rpc.L2InterfaceVlanTagRewrite(req.Context(), request) + if err != nil { + http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) + return + } + rep, err := json.MarshalIndent(reply, "", " ") + if err != nil { + http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) + return + } + w.Write(rep) + }) + mux.HandleFunc("/l2_patch_add_del", func(w http.ResponseWriter, req *http.Request) { + var request = new(L2PatchAddDel) + b, err := ioutil.ReadAll(req.Body) + if err != nil { + http.Error(w, "read body failed", http.StatusBadRequest) + return + } + if err := json.Unmarshal(b, request); err != nil { + http.Error(w, "unmarshal data failed", http.StatusBadRequest) + return + } + reply, err := rpc.L2PatchAddDel(req.Context(), request) + if err != nil { + http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) + return + } + rep, err := json.MarshalIndent(reply, "", " ") + if err != nil { + http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) + return + } + w.Write(rep) + }) + mux.HandleFunc("/l2fib_add_del", func(w http.ResponseWriter, req *http.Request) { + var request = new(L2fibAddDel) + b, err := ioutil.ReadAll(req.Body) + if err != nil { + http.Error(w, "read body failed", http.StatusBadRequest) + return + } + if err := json.Unmarshal(b, request); err != nil { + http.Error(w, "unmarshal data failed", http.StatusBadRequest) + return + } + reply, err := rpc.L2fibAddDel(req.Context(), request) + if err != nil { + http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) + return + } + rep, err := json.MarshalIndent(reply, "", " ") + if err != nil { + http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) + return + } + w.Write(rep) + }) + mux.HandleFunc("/l2fib_flush_all", func(w http.ResponseWriter, req *http.Request) { + var request = new(L2fibFlushAll) + reply, err := rpc.L2fibFlushAll(req.Context(), request) + if err != nil { + http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) + return + } + rep, err := json.MarshalIndent(reply, "", " ") + if err != nil { + http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) + return + } + w.Write(rep) + }) + mux.HandleFunc("/l2fib_flush_bd", func(w http.ResponseWriter, req *http.Request) { + var request = new(L2fibFlushBd) + b, err := ioutil.ReadAll(req.Body) + if err != nil { + http.Error(w, "read body failed", http.StatusBadRequest) + return + } + if err := json.Unmarshal(b, request); err != nil { + http.Error(w, "unmarshal data failed", http.StatusBadRequest) + return + } + reply, err := rpc.L2fibFlushBd(req.Context(), request) + if err != nil { + http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) + return + } + rep, err := json.MarshalIndent(reply, "", " ") + if err != nil { + http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) + return + } + w.Write(rep) + }) + mux.HandleFunc("/l2fib_flush_int", func(w http.ResponseWriter, req *http.Request) { + var request = new(L2fibFlushInt) + b, err := ioutil.ReadAll(req.Body) + if err != nil { + http.Error(w, "read body failed", http.StatusBadRequest) + return + } + if err := json.Unmarshal(b, request); err != nil { + http.Error(w, "unmarshal data failed", http.StatusBadRequest) + return + } + reply, err := rpc.L2fibFlushInt(req.Context(), request) + if err != nil { + http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) + return + } + rep, err := json.MarshalIndent(reply, "", " ") + if err != nil { + http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) + return + } + w.Write(rep) + }) + mux.HandleFunc("/sw_interface_set_l2_bridge", func(w http.ResponseWriter, req *http.Request) { + var request = new(SwInterfaceSetL2Bridge) + b, err := ioutil.ReadAll(req.Body) + if err != nil { + http.Error(w, "read body failed", http.StatusBadRequest) + return + } + if err := json.Unmarshal(b, request); err != nil { + http.Error(w, "unmarshal data failed", http.StatusBadRequest) + return + } + reply, err := rpc.SwInterfaceSetL2Bridge(req.Context(), request) + if err != nil { + http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) + return + } + rep, err := json.MarshalIndent(reply, "", " ") + if err != nil { + http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) + return + } + w.Write(rep) + }) + mux.HandleFunc("/sw_interface_set_l2_xconnect", func(w http.ResponseWriter, req *http.Request) { + var request = new(SwInterfaceSetL2Xconnect) + b, err := ioutil.ReadAll(req.Body) + if err != nil { + http.Error(w, "read body failed", http.StatusBadRequest) + return + } + if err := json.Unmarshal(b, request); err != nil { + http.Error(w, "unmarshal data failed", http.StatusBadRequest) + return + } + reply, err := rpc.SwInterfaceSetL2Xconnect(req.Context(), request) + if err != nil { + http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) + return + } + rep, err := json.MarshalIndent(reply, "", " ") + if err != nil { + http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) + return + } + w.Write(rep) + }) + mux.HandleFunc("/sw_interface_set_vpath", func(w http.ResponseWriter, req *http.Request) { + var request = new(SwInterfaceSetVpath) + b, err := ioutil.ReadAll(req.Body) + if err != nil { + http.Error(w, "read body failed", http.StatusBadRequest) + return + } + if err := json.Unmarshal(b, request); err != nil { + http.Error(w, "unmarshal data failed", http.StatusBadRequest) + return + } + reply, err := rpc.SwInterfaceSetVpath(req.Context(), request) + if err != nil { + http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) + return + } + rep, err := json.MarshalIndent(reply, "", " ") + if err != nil { + http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) + return + } + w.Write(rep) + }) + mux.HandleFunc("/want_l2_arp_term_events", func(w http.ResponseWriter, req *http.Request) { + var request = new(WantL2ArpTermEvents) + b, err := ioutil.ReadAll(req.Body) + if err != nil { + http.Error(w, "read body failed", http.StatusBadRequest) + return + } + if err := json.Unmarshal(b, request); err != nil { + http.Error(w, "unmarshal data failed", http.StatusBadRequest) + return + } + reply, err := rpc.WantL2ArpTermEvents(req.Context(), request) + if err != nil { + http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) + return + } + rep, err := json.MarshalIndent(reply, "", " ") + if err != nil { + http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) + return + } + w.Write(rep) + }) + mux.HandleFunc("/want_l2_macs_events", func(w http.ResponseWriter, req *http.Request) { + var request = new(WantL2MacsEvents) + b, err := ioutil.ReadAll(req.Body) + if err != nil { + http.Error(w, "read body failed", http.StatusBadRequest) + return + } + if err := json.Unmarshal(b, request); err != nil { + http.Error(w, "unmarshal data failed", http.StatusBadRequest) + return + } + reply, err := rpc.WantL2MacsEvents(req.Context(), request) + if err != nil { + http.Error(w, "request failed: "+err.Error(), http.StatusInternalServerError) + return + } + rep, err := json.MarshalIndent(reply, "", " ") + if err != nil { + http.Error(w, "marshal failed: "+err.Error(), http.StatusInternalServerError) + return + } + w.Write(rep) + }) + return http.HandlerFunc(mux.ServeHTTP) +} diff --git a/binapi/l2/l2_rpc.ba.go b/binapi/l2/l2_rpc.ba.go new file mode 100644 index 0000000..b319c4e --- /dev/null +++ b/binapi/l2/l2_rpc.ba.go @@ -0,0 +1,403 @@ +// Code generated by GoVPP's binapi-generator. DO NOT EDIT. + +package l2 + +import ( + "context" + "fmt" + api "git.fd.io/govpp.git/api" + vpe "git.fd.io/govpp.git/binapi/vpe" + "io" +) + +// RPCService defines RPC service l2. +type RPCService interface { + BdIPMacAddDel(ctx context.Context, in *BdIPMacAddDel) (*BdIPMacAddDelReply, error) + BdIPMacDump(ctx context.Context, in *BdIPMacDump) (RPCService_BdIPMacDumpClient, error) + BdIPMacFlush(ctx context.Context, in *BdIPMacFlush) (*BdIPMacFlushReply, error) + BridgeDomainAddDel(ctx context.Context, in *BridgeDomainAddDel) (*BridgeDomainAddDelReply, error) + BridgeDomainDump(ctx context.Context, in *BridgeDomainDump) (RPCService_BridgeDomainDumpClient, error) + BridgeDomainSetMacAge(ctx context.Context, in *BridgeDomainSetMacAge) (*BridgeDomainSetMacAgeReply, error) + BridgeFlags(ctx context.Context, in *BridgeFlags) (*BridgeFlagsReply, error) + BviCreate(ctx context.Context, in *BviCreate) (*BviCreateReply, error) + BviDelete(ctx context.Context, in *BviDelete) (*BviDeleteReply, error) + L2FibClearTable(ctx context.Context, in *L2FibClearTable) (*L2FibClearTableReply, error) + L2FibTableDump(ctx context.Context, in *L2FibTableDump) (RPCService_L2FibTableDumpClient, error) + L2Flags(ctx context.Context, in *L2Flags) (*L2FlagsReply, error) + L2InterfaceEfpFilter(ctx context.Context, in *L2InterfaceEfpFilter) (*L2InterfaceEfpFilterReply, error) + L2InterfacePbbTagRewrite(ctx context.Context, in *L2InterfacePbbTagRewrite) (*L2InterfacePbbTagRewriteReply, error) + L2InterfaceVlanTagRewrite(ctx context.Context, in *L2InterfaceVlanTagRewrite) (*L2InterfaceVlanTagRewriteReply, error) + L2PatchAddDel(ctx context.Context, in *L2PatchAddDel) (*L2PatchAddDelReply, error) + L2XconnectDump(ctx context.Context, in *L2XconnectDump) (RPCService_L2XconnectDumpClient, error) + L2fibAddDel(ctx context.Context, in *L2fibAddDel) (*L2fibAddDelReply, error) + L2fibFlushAll(ctx context.Context, in *L2fibFlushAll) (*L2fibFlushAllReply, error) + L2fibFlushBd(ctx context.Context, in *L2fibFlushBd) (*L2fibFlushBdReply, error) + L2fibFlushInt(ctx context.Context, in *L2fibFlushInt) (*L2fibFlushIntReply, error) + SwInterfaceSetL2Bridge(ctx context.Context, in *SwInterfaceSetL2Bridge) (*SwInterfaceSetL2BridgeReply, error) + SwInterfaceSetL2Xconnect(ctx context.Context, in *SwInterfaceSetL2Xconnect) (*SwInterfaceSetL2XconnectReply, error) + SwInterfaceSetVpath(ctx context.Context, in *SwInterfaceSetVpath) (*SwInterfaceSetVpathReply, error) + WantL2ArpTermEvents(ctx context.Context, in *WantL2ArpTermEvents) (*WantL2ArpTermEventsReply, error) + WantL2MacsEvents(ctx context.Context, in *WantL2MacsEvents) (*WantL2MacsEventsReply, error) +} + +type serviceClient struct { + conn api.Connection +} + +func NewServiceClient(conn api.Connection) RPCService { + return &serviceClient{conn} +} + +func (c *serviceClient) BdIPMacAddDel(ctx context.Context, in *BdIPMacAddDel) (*BdIPMacAddDelReply, error) { + out := new(BdIPMacAddDelReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) BdIPMacDump(ctx context.Context, in *BdIPMacDump) (RPCService_BdIPMacDumpClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_BdIPMacDumpClient{stream} + if err := x.Stream.SendMsg(in); err != nil { + return nil, err + } + if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil { + return nil, err + } + return x, nil +} + +type RPCService_BdIPMacDumpClient interface { + Recv() (*BdIPMacDetails, error) + api.Stream +} + +type serviceClient_BdIPMacDumpClient struct { + api.Stream +} + +func (c *serviceClient_BdIPMacDumpClient) Recv() (*BdIPMacDetails, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *BdIPMacDetails: + return m, nil + case *vpe.ControlPingReply: + return nil, io.EOF + default: + return nil, fmt.Errorf("unexpected message: %T %v", m, m) + } +} + +func (c *serviceClient) BdIPMacFlush(ctx context.Context, in *BdIPMacFlush) (*BdIPMacFlushReply, error) { + out := new(BdIPMacFlushReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) BridgeDomainAddDel(ctx context.Context, in *BridgeDomainAddDel) (*BridgeDomainAddDelReply, error) { + out := new(BridgeDomainAddDelReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) BridgeDomainDump(ctx context.Context, in *BridgeDomainDump) (RPCService_BridgeDomainDumpClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_BridgeDomainDumpClient{stream} + if err := x.Stream.SendMsg(in); err != nil { + return nil, err + } + if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil { + return nil, err + } + return x, nil +} + +type RPCService_BridgeDomainDumpClient interface { + Recv() (*BridgeDomainDetails, error) + api.Stream +} + +type serviceClient_BridgeDomainDumpClient struct { + api.Stream +} + +func (c *serviceClient_BridgeDomainDumpClient) Recv() (*BridgeDomainDetails, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *BridgeDomainDetails: + return m, nil + case *vpe.ControlPingReply: + return nil, io.EOF + default: + return nil, fmt.Errorf("unexpected message: %T %v", m, m) + } +} + +func (c *serviceClient) BridgeDomainSetMacAge(ctx context.Context, in *BridgeDomainSetMacAge) (*BridgeDomainSetMacAgeReply, error) { + out := new(BridgeDomainSetMacAgeReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) BridgeFlags(ctx context.Context, in *BridgeFlags) (*BridgeFlagsReply, error) { + out := new(BridgeFlagsReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) BviCreate(ctx context.Context, in *BviCreate) (*BviCreateReply, error) { + out := new(BviCreateReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) BviDelete(ctx context.Context, in *BviDelete) (*BviDeleteReply, error) { + out := new(BviDeleteReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) L2FibClearTable(ctx context.Context, in *L2FibClearTable) (*L2FibClearTableReply, error) { + out := new(L2FibClearTableReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) L2FibTableDump(ctx context.Context, in *L2FibTableDump) (RPCService_L2FibTableDumpClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_L2FibTableDumpClient{stream} + if err := x.Stream.SendMsg(in); err != nil { + return nil, err + } + if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil { + return nil, err + } + return x, nil +} + +type RPCService_L2FibTableDumpClient interface { + Recv() (*L2FibTableDetails, error) + api.Stream +} + +type serviceClient_L2FibTableDumpClient struct { + api.Stream +} + +func (c *serviceClient_L2FibTableDumpClient) Recv() (*L2FibTableDetails, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *L2FibTableDetails: + return m, nil + case *vpe.ControlPingReply: + return nil, io.EOF + default: + return nil, fmt.Errorf("unexpected message: %T %v", m, m) + } +} + +func (c *serviceClient) L2Flags(ctx context.Context, in *L2Flags) (*L2FlagsReply, error) { + out := new(L2FlagsReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) L2InterfaceEfpFilter(ctx context.Context, in *L2InterfaceEfpFilter) (*L2InterfaceEfpFilterReply, error) { + out := new(L2InterfaceEfpFilterReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) L2InterfacePbbTagRewrite(ctx context.Context, in *L2InterfacePbbTagRewrite) (*L2InterfacePbbTagRewriteReply, error) { + out := new(L2InterfacePbbTagRewriteReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) L2InterfaceVlanTagRewrite(ctx context.Context, in *L2InterfaceVlanTagRewrite) (*L2InterfaceVlanTagRewriteReply, error) { + out := new(L2InterfaceVlanTagRewriteReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) L2PatchAddDel(ctx context.Context, in *L2PatchAddDel) (*L2PatchAddDelReply, error) { + out := new(L2PatchAddDelReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) L2XconnectDump(ctx context.Context, in *L2XconnectDump) (RPCService_L2XconnectDumpClient, error) { + stream, err := c.conn.NewStream(ctx) + if err != nil { + return nil, err + } + x := &serviceClient_L2XconnectDumpClient{stream} + if err := x.Stream.SendMsg(in); err != nil { + return nil, err + } + if err = x.Stream.SendMsg(&vpe.ControlPing{}); err != nil { + return nil, err + } + return x, nil +} + +type RPCService_L2XconnectDumpClient interface { + Recv() (*L2XconnectDetails, error) + api.Stream +} + +type serviceClient_L2XconnectDumpClient struct { + api.Stream +} + +func (c *serviceClient_L2XconnectDumpClient) Recv() (*L2XconnectDetails, error) { + msg, err := c.Stream.RecvMsg() + if err != nil { + return nil, err + } + switch m := msg.(type) { + case *L2XconnectDetails: + return m, nil + case *vpe.ControlPingReply: + return nil, io.EOF + default: + return nil, fmt.Errorf("unexpected message: %T %v", m, m) + } +} + +func (c *serviceClient) L2fibAddDel(ctx context.Context, in *L2fibAddDel) (*L2fibAddDelReply, error) { + out := new(L2fibAddDelReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) L2fibFlushAll(ctx context.Context, in *L2fibFlushAll) (*L2fibFlushAllReply, error) { + out := new(L2fibFlushAllReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) L2fibFlushBd(ctx context.Context, in *L2fibFlushBd) (*L2fibFlushBdReply, error) { + out := new(L2fibFlushBdReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) L2fibFlushInt(ctx context.Context, in *L2fibFlushInt) (*L2fibFlushIntReply, error) { + out := new(L2fibFlushIntReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) SwInterfaceSetL2Bridge(ctx context.Context, in *SwInterfaceSetL2Bridge) (*SwInterfaceSetL2BridgeReply, error) { + out := new(SwInterfaceSetL2BridgeReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) SwInterfaceSetL2Xconnect(ctx context.Context, in *SwInterfaceSetL2Xconnect) (*SwInterfaceSetL2XconnectReply, error) { + out := new(SwInterfaceSetL2XconnectReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) SwInterfaceSetVpath(ctx context.Context, in *SwInterfaceSetVpath) (*SwInterfaceSetVpathReply, error) { + out := new(SwInterfaceSetVpathReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) WantL2ArpTermEvents(ctx context.Context, in *WantL2ArpTermEvents) (*WantL2ArpTermEventsReply, error) { + out := new(WantL2ArpTermEventsReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *serviceClient) WantL2MacsEvents(ctx context.Context, in *WantL2MacsEvents) (*WantL2MacsEventsReply, error) { + out := new(WantL2MacsEventsReply) + err := c.conn.Invoke(ctx, in, out) + if err != nil { + return nil, err + } + return out, nil +} |