diff options
Diffstat (limited to 'extras')
-rw-r--r-- | extras/vom/vom/gbp_contract.cpp | 35 | ||||
-rw-r--r-- | extras/vom/vom/gbp_contract.hpp | 10 | ||||
-rw-r--r-- | extras/vom/vom/gbp_contract_cmds.cpp | 37 | ||||
-rw-r--r-- | extras/vom/vom/gbp_contract_cmds.hpp | 14 | ||||
-rw-r--r-- | extras/vom/vom/gbp_endpoint.cpp | 8 | ||||
-rw-r--r-- | extras/vom/vom/gbp_endpoint_cmds.cpp | 10 | ||||
-rw-r--r-- | extras/vom/vom/gbp_endpoint_cmds.hpp | 8 | ||||
-rw-r--r-- | extras/vom/vom/gbp_endpoint_group.cpp | 64 | ||||
-rw-r--r-- | extras/vom/vom/gbp_endpoint_group.hpp | 24 | ||||
-rw-r--r-- | extras/vom/vom/gbp_endpoint_group_cmds.cpp | 20 | ||||
-rw-r--r-- | extras/vom/vom/gbp_endpoint_group_cmds.hpp | 8 | ||||
-rw-r--r-- | extras/vom/vom/gbp_recirc.cpp | 8 | ||||
-rw-r--r-- | extras/vom/vom/gbp_recirc_cmds.cpp | 12 | ||||
-rw-r--r-- | extras/vom/vom/gbp_recirc_cmds.hpp | 4 | ||||
-rw-r--r-- | extras/vom/vom/gbp_subnet.cpp | 10 | ||||
-rw-r--r-- | extras/vom/vom/gbp_subnet_cmds.cpp | 10 | ||||
-rw-r--r-- | extras/vom/vom/gbp_subnet_cmds.hpp | 8 |
17 files changed, 137 insertions, 153 deletions
diff --git a/extras/vom/vom/gbp_contract.cpp b/extras/vom/vom/gbp_contract.cpp index 0ef50ad5535..c95c2e8008e 100644 --- a/extras/vom/vom/gbp_contract.cpp +++ b/extras/vom/vom/gbp_contract.cpp @@ -24,14 +24,14 @@ singular_db<gbp_contract::key_t, gbp_contract> gbp_contract::m_db; gbp_contract::event_handler gbp_contract::m_evh; -gbp_contract::gbp_contract(epg_id_t src_epg_id, - epg_id_t dst_epg_id, +gbp_contract::gbp_contract(sclass_t sclass, + sclass_t dclass, const ACL::l3_list& acl, const gbp_rules_t& rules, const ethertype_set_t& allowed_ethertypes) : m_hw(false) - , m_src_epg_id(src_epg_id) - , m_dst_epg_id(dst_epg_id) + , m_sclass(sclass) + , m_dclass(dclass) , m_acl(acl.singular()) , m_gbp_rules(rules) , m_allowed_ethertypes(allowed_ethertypes) @@ -40,8 +40,8 @@ gbp_contract::gbp_contract(epg_id_t src_epg_id, gbp_contract::gbp_contract(const gbp_contract& gbpc) : m_hw(gbpc.m_hw) - , m_src_epg_id(gbpc.m_src_epg_id) - , m_dst_epg_id(gbpc.m_dst_epg_id) + , m_sclass(gbpc.m_sclass) + , m_dclass(gbpc.m_dclass) , m_acl(gbpc.m_acl) , m_gbp_rules(gbpc.m_gbp_rules) , m_allowed_ethertypes(gbpc.m_allowed_ethertypes) @@ -59,7 +59,7 @@ gbp_contract::~gbp_contract() const gbp_contract::key_t gbp_contract::key() const { - return (std::make_pair(m_src_epg_id, m_dst_epg_id)); + return (std::make_pair(m_sclass, m_dclass)); } bool @@ -72,8 +72,7 @@ void gbp_contract::sweep() { if (m_hw) { - HW::enqueue( - new gbp_contract_cmds::delete_cmd(m_hw, m_src_epg_id, m_dst_epg_id)); + HW::enqueue(new gbp_contract_cmds::delete_cmd(m_hw, m_sclass, m_dclass)); } HW::write(); } @@ -82,9 +81,9 @@ void gbp_contract::replay() { if (m_hw) { - HW::enqueue(new gbp_contract_cmds::create_cmd( - m_hw, m_src_epg_id, m_dst_epg_id, m_acl->handle(), m_gbp_rules, - m_allowed_ethertypes)); + HW::enqueue(new gbp_contract_cmds::create_cmd(m_hw, m_sclass, m_dclass, + m_acl->handle(), m_gbp_rules, + m_allowed_ethertypes)); } } @@ -92,7 +91,7 @@ std::string gbp_contract::to_string() const { std::ostringstream s; - s << "gbp-contract:[{" << m_src_epg_id << ", " << m_dst_epg_id << "}, " + s << "gbp-contract:[{" << m_sclass << ", " << m_dclass << "}, " << m_acl->to_string(); if (m_gbp_rules.size()) { auto it = m_gbp_rules.cbegin(); @@ -116,9 +115,9 @@ gbp_contract::update(const gbp_contract& r) * create the table if it is not yet created */ if (rc_t::OK != m_hw.rc()) { - HW::enqueue(new gbp_contract_cmds::create_cmd( - m_hw, m_src_epg_id, m_dst_epg_id, m_acl->handle(), m_gbp_rules, - m_allowed_ethertypes)); + HW::enqueue(new gbp_contract_cmds::create_cmd(m_hw, m_sclass, m_dclass, + m_acl->handle(), m_gbp_rules, + m_allowed_ethertypes)); } } @@ -208,8 +207,8 @@ gbp_contract::event_handler::handle_populate(const client_db::key_t& key) allowed_ethertypes.insert(ethertype_t::from_numeric_val(et[i])); } - gbp_contract gbpc(payload.contract.src_epg, payload.contract.dst_epg, - *acl, rules, allowed_ethertypes); + gbp_contract gbpc(payload.contract.sclass, payload.contract.dclass, *acl, + rules, allowed_ethertypes); OM::commit(key, gbpc); VOM_LOG(log_level_t::DEBUG) << "read: " << gbpc.to_string(); diff --git a/extras/vom/vom/gbp_contract.hpp b/extras/vom/vom/gbp_contract.hpp index 2f1c3c5a950..7775638bb9f 100644 --- a/extras/vom/vom/gbp_contract.hpp +++ b/extras/vom/vom/gbp_contract.hpp @@ -39,7 +39,7 @@ public: /** * The key for a contract is the pari of EPG-IDs */ - typedef std::pair<epg_id_t, epg_id_t> key_t; + typedef std::pair<sclass_t, sclass_t> key_t; /** * A set of allowed ethertypes @@ -49,8 +49,8 @@ public: /** * Construct a GBP contract */ - gbp_contract(epg_id_t src_epg_id, - epg_id_t dst_epg_id, + gbp_contract(sclass_t sclass, + sclass_t dclass, const ACL::l3_list& acl, const gbp_rules_t& gpb_rules, const ethertype_set_t& allowed_ethertypes); @@ -169,12 +169,12 @@ private: /** * The source EPG ID */ - epg_id_t m_src_epg_id; + sclass_t m_sclass; /** * The destination EPG ID */ - epg_id_t m_dst_epg_id; + sclass_t m_dclass; /** * The ACL applied to traffic between the gourps diff --git a/extras/vom/vom/gbp_contract_cmds.cpp b/extras/vom/vom/gbp_contract_cmds.cpp index 5cdd885f304..9e8a177422b 100644 --- a/extras/vom/vom/gbp_contract_cmds.cpp +++ b/extras/vom/vom/gbp_contract_cmds.cpp @@ -20,14 +20,14 @@ namespace VOM { namespace gbp_contract_cmds { create_cmd::create_cmd(HW::item<bool>& item, - epg_id_t src_epg_id, - epg_id_t dst_epg_id, + sclass_t sclass, + sclass_t dclass, const handle_t& acl, const gbp_contract::gbp_rules_t& gbp_rules, const gbp_contract::ethertype_set_t& allowed_ethertypes) : rpc_cmd(item) - , m_src_epg_id(src_epg_id) - , m_dst_epg_id(dst_epg_id) + , m_sclass(sclass) + , m_dclass(dclass) , m_acl(acl) , m_gbp_rules(gbp_rules) , m_allowed_ethertypes(allowed_ethertypes) @@ -37,9 +37,8 @@ create_cmd::create_cmd(HW::item<bool>& item, bool create_cmd::operator==(const create_cmd& other) const { - return ((m_acl == other.m_acl) && (m_src_epg_id == other.m_src_epg_id) && - (m_dst_epg_id == other.m_dst_epg_id) && - (m_gbp_rules == other.m_gbp_rules) && + return ((m_acl == other.m_acl) && (m_sclass == other.m_sclass) && + (m_dclass == other.m_dclass) && (m_gbp_rules == other.m_gbp_rules) && (m_allowed_ethertypes == other.m_allowed_ethertypes)); } @@ -54,8 +53,8 @@ create_cmd::issue(connection& con) auto& payload = req.get_request().get_payload(); payload.is_add = 1; payload.contract.acl_index = m_acl.value(); - payload.contract.src_epg = m_src_epg_id; - payload.contract.dst_epg = m_dst_epg_id; + payload.contract.sclass = m_sclass; + payload.contract.dclass = m_dclass; uint32_t ii = 0; payload.contract.n_rules = n_rules; @@ -112,8 +111,7 @@ create_cmd::to_string() const { std::ostringstream s; s << "gbp-contract-create: " << m_hw_item.to_string() - << " src-epg-id:" << m_src_epg_id << " dst-epg-id:" << m_dst_epg_id - << " acl:" << m_acl; + << " sclass:" << m_sclass << " dclass:" << m_dclass << " acl:" << m_acl; s << "[ethertype:"; for (auto e : m_allowed_ethertypes) s << " " << e; @@ -122,20 +120,17 @@ create_cmd::to_string() const return (s.str()); } -delete_cmd::delete_cmd(HW::item<bool>& item, - epg_id_t src_epg_id, - epg_id_t dst_epg_id) +delete_cmd::delete_cmd(HW::item<bool>& item, sclass_t sclass, sclass_t dclass) : rpc_cmd(item) - , m_src_epg_id(src_epg_id) - , m_dst_epg_id(dst_epg_id) + , m_sclass(sclass) + , m_dclass(dclass) { } bool delete_cmd::operator==(const delete_cmd& other) const { - return ((m_src_epg_id == other.m_src_epg_id) && - (m_dst_epg_id == other.m_dst_epg_id)); + return ((m_sclass == other.m_sclass) && (m_dclass == other.m_dclass)); } rc_t @@ -146,8 +141,8 @@ delete_cmd::issue(connection& con) auto& payload = req.get_request().get_payload(); payload.is_add = 0; payload.contract.acl_index = ~0; - payload.contract.src_epg = m_src_epg_id; - payload.contract.dst_epg = m_dst_epg_id; + payload.contract.sclass = m_sclass; + payload.contract.dclass = m_dclass; VAPI_CALL(req.execute()); @@ -159,7 +154,7 @@ delete_cmd::to_string() const { std::ostringstream s; s << "gbp-contract-delete: " << m_hw_item.to_string() - << " src-epg-id:" << m_src_epg_id << " dst-epg-id:" << m_dst_epg_id; + << " src-epg-id:" << m_sclass << " dst-epg-id:" << m_dclass; return (s.str()); } diff --git a/extras/vom/vom/gbp_contract_cmds.hpp b/extras/vom/vom/gbp_contract_cmds.hpp index 476a594ae3e..7108c53f77b 100644 --- a/extras/vom/vom/gbp_contract_cmds.hpp +++ b/extras/vom/vom/gbp_contract_cmds.hpp @@ -34,8 +34,8 @@ public: * Constructor */ create_cmd(HW::item<bool>& item, - epg_id_t src_epg_id, - epg_id_t dst_epg_id, + sclass_t sclass, + sclass_t dclass, const handle_t& acl, const gbp_contract::gbp_rules_t& gbp_rules, const gbp_contract::ethertype_set_t& allowed_ethertypes); @@ -56,8 +56,8 @@ public: bool operator==(const create_cmd& i) const; private: - const epg_id_t m_src_epg_id; - const epg_id_t m_dst_epg_id; + const sclass_t m_sclass; + const sclass_t m_dclass; const handle_t m_acl; const gbp_contract::gbp_rules_t& m_gbp_rules; const gbp_contract::ethertype_set_t& m_allowed_ethertypes; @@ -72,7 +72,7 @@ public: /** * Constructor */ - delete_cmd(HW::item<bool>& item, epg_id_t src_epg_id, epg_id_t dst_epg_id); + delete_cmd(HW::item<bool>& item, sclass_t sclass, sclass_t dclass); /** * Issue the command to VPP/HW @@ -90,8 +90,8 @@ public: bool operator==(const delete_cmd& i) const; private: - const epg_id_t m_src_epg_id; - const epg_id_t m_dst_epg_id; + const sclass_t m_sclass; + const sclass_t m_dclass; }; /** diff --git a/extras/vom/vom/gbp_endpoint.cpp b/extras/vom/vom/gbp_endpoint.cpp index b39e9f934e6..20f966cfb20 100644 --- a/extras/vom/vom/gbp_endpoint.cpp +++ b/extras/vom/vom/gbp_endpoint.cpp @@ -78,7 +78,7 @@ gbp_endpoint::replay() { if (m_hdl) { HW::enqueue(new gbp_endpoint_cmds::create_cmd(m_hdl, m_itf->handle(), m_ips, - m_mac, m_epg->id())); + m_mac, m_epg->sclass())); } } @@ -101,7 +101,7 @@ gbp_endpoint::update(const gbp_endpoint& r) { if (rc_t::OK != m_hdl.rc()) { HW::enqueue(new gbp_endpoint_cmds::create_cmd(m_hdl, m_itf->handle(), m_ips, - m_mac, m_epg->id())); + m_mac, m_epg->sclass())); } } @@ -160,7 +160,7 @@ gbp_endpoint::event_handler::handle_populate(const client_db::key_t& key) std::shared_ptr<interface> itf = interface::find(payload.endpoint.sw_if_index); std::shared_ptr<gbp_endpoint_group> epg = - gbp_endpoint_group::find(payload.endpoint.epg_id); + gbp_endpoint_group::find(payload.endpoint.sclass); mac_address_t mac = from_api(payload.endpoint.mac); VOM_LOG(log_level_t::DEBUG) << "data: " << payload.endpoint.sw_if_index; @@ -173,7 +173,7 @@ gbp_endpoint::event_handler::handle_populate(const client_db::key_t& key) } else { VOM_LOG(log_level_t::ERROR) << "no interface:" << payload.endpoint.sw_if_index - << "or epg:" << payload.endpoint.epg_id; + << "or sclass:" << payload.endpoint.sclass; } } } diff --git a/extras/vom/vom/gbp_endpoint_cmds.cpp b/extras/vom/vom/gbp_endpoint_cmds.cpp index 2732d1cc297..77c75488099 100644 --- a/extras/vom/vom/gbp_endpoint_cmds.cpp +++ b/extras/vom/vom/gbp_endpoint_cmds.cpp @@ -25,12 +25,12 @@ create_cmd::create_cmd(HW::item<handle_t>& item, const handle_t& itf, const std::vector<boost::asio::ip::address>& ip_addrs, const mac_address_t& mac, - epg_id_t epg_id) + sclass_t sclass) : rpc_cmd(item) , m_itf(itf) , m_ip_addrs(ip_addrs) , m_mac(mac) - , m_epg_id(epg_id) + , m_sclass(sclass) { } @@ -38,7 +38,7 @@ bool create_cmd::operator==(const create_cmd& other) const { return ((m_itf == other.m_itf) && (m_ip_addrs == other.m_ip_addrs) && - (m_mac == other.m_mac) && (m_epg_id == other.m_epg_id)); + (m_mac == other.m_mac) && (m_sclass == other.m_sclass)); } rc_t @@ -50,7 +50,7 @@ create_cmd::issue(connection& con) auto& payload = req.get_request().get_payload(); payload.endpoint.sw_if_index = m_itf.value(); - payload.endpoint.epg_id = m_epg_id; + payload.endpoint.sclass = m_sclass; payload.endpoint.n_ips = m_ip_addrs.size(); for (n = 0; n < payload.endpoint.n_ips; n++) { @@ -93,7 +93,7 @@ create_cmd::to_string() const s << ip.to_string(); s << "] mac:" << m_mac; - s << " epg-id:" << m_epg_id; + s << " slcass:" << m_sclass; return (s.str()); } diff --git a/extras/vom/vom/gbp_endpoint_cmds.hpp b/extras/vom/vom/gbp_endpoint_cmds.hpp index e90fb66f04a..2aa56f8312e 100644 --- a/extras/vom/vom/gbp_endpoint_cmds.hpp +++ b/extras/vom/vom/gbp_endpoint_cmds.hpp @@ -25,8 +25,8 @@ namespace VOM { namespace gbp_endpoint_cmds { /** -* A command class that creates or updates the GBP endpoint -*/ + * A command class that creates or updates the GBP endpoint + */ class create_cmd : public rpc_cmd<HW::item<handle_t>, vapi::Gbp_endpoint_add> { public: @@ -37,7 +37,7 @@ public: const handle_t& itf, const std::vector<boost::asio::ip::address>& ip_addrs, const mac_address_t& mac, - epg_id_t epg_id); + sclass_t sclass); /** * Issue the command to VPP/HW @@ -60,7 +60,7 @@ private: const handle_t m_itf; const std::vector<boost::asio::ip::address> m_ip_addrs; const mac_address_t m_mac; - const epg_id_t m_epg_id; + const sclass_t m_sclass; }; /** diff --git a/extras/vom/vom/gbp_endpoint_group.cpp b/extras/vom/vom/gbp_endpoint_group.cpp index d549a067e67..abec585c744 100644 --- a/extras/vom/vom/gbp_endpoint_group.cpp +++ b/extras/vom/vom/gbp_endpoint_group.cpp @@ -45,13 +45,14 @@ gbp_endpoint_group::retention_t::to_string() const return std::to_string(remote_ep_timeout); } -gbp_endpoint_group::gbp_endpoint_group(epg_id_t epg_id, +gbp_endpoint_group::gbp_endpoint_group(vnid_t vnid, + sclass_t sclass, const interface& itf, const gbp_route_domain& rd, const gbp_bridge_domain& bd) : m_hw(false) - , m_epg_id(epg_id) - , m_sclass(0xffff) + , m_vnid(vnid) + , m_sclass(sclass) , m_itf(itf.singular()) , m_rd(rd.singular()) , m_bd(bd.singular()) @@ -59,40 +60,25 @@ gbp_endpoint_group::gbp_endpoint_group(epg_id_t epg_id, { } -gbp_endpoint_group::gbp_endpoint_group(epg_id_t epg_id, +gbp_endpoint_group::gbp_endpoint_group(vnid_t vnid, + sclass_t sclass, const gbp_route_domain& rd, const gbp_bridge_domain& bd) : m_hw(false) - , m_epg_id(epg_id) - , m_sclass(0xffff) - , m_itf() - , m_rd(rd.singular()) - , m_bd(bd.singular()) - , m_retention() -{ -} - -gbp_endpoint_group::gbp_endpoint_group(epg_id_t epg_id, - uint16_t sclass, - const interface& itf, - const gbp_route_domain& rd, - const gbp_bridge_domain& bd) - : m_hw(false) - , m_epg_id(epg_id) + , m_vnid(vnid) , m_sclass(sclass) - , m_itf(itf.singular()) + , m_itf() , m_rd(rd.singular()) , m_bd(bd.singular()) , m_retention() { } -gbp_endpoint_group::gbp_endpoint_group(epg_id_t epg_id, - uint16_t sclass, +gbp_endpoint_group::gbp_endpoint_group(sclass_t sclass, const gbp_route_domain& rd, const gbp_bridge_domain& bd) : m_hw(false) - , m_epg_id(epg_id) + , m_vnid(~0) , m_sclass(sclass) , m_itf() , m_rd(rd.singular()) @@ -103,7 +89,7 @@ gbp_endpoint_group::gbp_endpoint_group(epg_id_t epg_id, gbp_endpoint_group::gbp_endpoint_group(const gbp_endpoint_group& epg) : m_hw(epg.m_hw) - , m_epg_id(epg.m_epg_id) + , m_vnid(epg.m_vnid) , m_sclass(epg.m_sclass) , m_itf(epg.m_itf) , m_rd(epg.m_rd) @@ -121,13 +107,13 @@ gbp_endpoint_group::~gbp_endpoint_group() const gbp_endpoint_group::key_t gbp_endpoint_group::key() const { - return (m_epg_id); + return (m_sclass); } -epg_id_t -gbp_endpoint_group::id() const +vnid_t +gbp_endpoint_group::vnid() const { - return (m_epg_id); + return (m_vnid); } void @@ -136,10 +122,16 @@ gbp_endpoint_group::set(const retention_t& retention) m_retention = retention; } +sclass_t +gbp_endpoint_group::sclass() const +{ + return (m_sclass); +} + bool gbp_endpoint_group::operator==(const gbp_endpoint_group& gg) const { - return (key() == gg.key() && (m_sclass == gg.m_sclass) && + return (key() == gg.key() && (m_vnid == gg.m_vnid) && (m_retention == gg.m_retention) && (m_itf == gg.m_itf) && (m_rd == gg.m_rd) && (m_bd == gg.m_bd)); } @@ -148,7 +140,7 @@ void gbp_endpoint_group::sweep() { if (m_hw) { - HW::enqueue(new gbp_endpoint_group_cmds::delete_cmd(m_hw, m_epg_id)); + HW::enqueue(new gbp_endpoint_group_cmds::delete_cmd(m_hw, m_vnid)); } HW::write(); } @@ -158,7 +150,7 @@ gbp_endpoint_group::replay() { if (m_hw) { HW::enqueue(new gbp_endpoint_group_cmds::create_cmd( - m_hw, m_epg_id, m_sclass, m_bd->id(), m_rd->id(), m_retention, + m_hw, m_vnid, m_sclass, m_bd->id(), m_rd->id(), m_retention, (m_itf ? m_itf->handle() : handle_t::INVALID))); } } @@ -168,7 +160,7 @@ gbp_endpoint_group::to_string() const { std::ostringstream s; s << "gbp-endpoint-group:[" - << "epg:" << m_epg_id << ", sclass:" << m_sclass << ", " + << "vnid:" << m_vnid << ", sclass:" << m_sclass << ", " << "retention:[" << m_retention.to_string() << "], " << (m_itf ? m_itf->to_string() : "NULL") << ", " << m_bd->to_string() << ", " << m_rd->to_string() << "]"; @@ -181,7 +173,7 @@ gbp_endpoint_group::update(const gbp_endpoint_group& r) { if (rc_t::OK != m_hw.rc()) { HW::enqueue(new gbp_endpoint_group_cmds::create_cmd( - m_hw, m_epg_id, m_sclass, m_bd->id(), m_rd->id(), m_retention, + m_hw, m_vnid, m_sclass, m_bd->id(), m_rd->id(), m_retention, (m_itf ? m_itf->handle() : handle_t::INVALID))); } } @@ -259,13 +251,13 @@ gbp_endpoint_group::event_handler::handle_populate(const client_db::key_t& key) << payload.epg.bd_id << "]"; if (itf && bd && rd) { - gbp_endpoint_group gbpe(payload.epg.epg_id, payload.epg.sclass, *itf, *rd, + gbp_endpoint_group gbpe(payload.epg.vnid, payload.epg.sclass, *itf, *rd, *bd); OM::commit(key, gbpe); VOM_LOG(log_level_t::DEBUG) << "read: " << gbpe.to_string(); } else if (bd && rd) { - gbp_endpoint_group gbpe(payload.epg.epg_id, payload.epg.sclass, *rd, *bd); + gbp_endpoint_group gbpe(payload.epg.sclass, *rd, *bd); OM::commit(key, gbpe); VOM_LOG(log_level_t::DEBUG) << "read: " << gbpe.to_string(); diff --git a/extras/vom/vom/gbp_endpoint_group.hpp b/extras/vom/vom/gbp_endpoint_group.hpp index d6af570b7a9..5c061a900b3 100644 --- a/extras/vom/vom/gbp_endpoint_group.hpp +++ b/extras/vom/vom/gbp_endpoint_group.hpp @@ -28,7 +28,8 @@ namespace VOM { /** * EPG IDs are 32 bit integers */ -typedef uint32_t epg_id_t; +typedef uint32_t vnid_t; +typedef uint16_t sclass_t; /** * A entry in the ARP termination table of a Bridge Domain @@ -59,25 +60,21 @@ public: /** * The key for a GBP endpoint group is its ID */ - typedef epg_id_t key_t; + typedef sclass_t key_t; /** * Construct a GBP endpoint_group */ - gbp_endpoint_group(epg_id_t epg_id, + gbp_endpoint_group(vnid_t vnid, + sclass_t sclass, const interface& itf, const gbp_route_domain& rd, const gbp_bridge_domain& bd); - gbp_endpoint_group(epg_id_t epg_id, + gbp_endpoint_group(vnid_t vnid, + sclass_t sclass, const gbp_route_domain& rd, const gbp_bridge_domain& bd); - gbp_endpoint_group(epg_id_t epg_id, - uint16_t sclass, - const interface& itf, - const gbp_route_domain& rd, - const gbp_bridge_domain& bd); - gbp_endpoint_group(epg_id_t epg_id, - uint16_t sclass, + gbp_endpoint_group(sclass_t sclass, const gbp_route_domain& rd, const gbp_bridge_domain& bd); @@ -129,7 +126,8 @@ public: /** * Get the ID of the EPG */ - epg_id_t id() const; + vnid_t vnid() const; + sclass_t sclass() const; const std::shared_ptr<gbp_route_domain> get_route_domain() const; const std::shared_ptr<gbp_bridge_domain> get_bridge_domain() const; @@ -206,7 +204,7 @@ private: /** * The EPG ID */ - epg_id_t m_epg_id; + vnid_t m_vnid; /** * The SClass on the wire diff --git a/extras/vom/vom/gbp_endpoint_group_cmds.cpp b/extras/vom/vom/gbp_endpoint_group_cmds.cpp index a4f86603cb8..c5618602550 100644 --- a/extras/vom/vom/gbp_endpoint_group_cmds.cpp +++ b/extras/vom/vom/gbp_endpoint_group_cmds.cpp @@ -19,14 +19,14 @@ namespace VOM { namespace gbp_endpoint_group_cmds { create_cmd::create_cmd(HW::item<bool>& item, - epg_id_t epg_id, + vnid_t vnid, uint16_t sclass, uint32_t bd_id, route::table_id_t rd_id, const gbp_endpoint_group::retention_t& retention, const handle_t& itf) : rpc_cmd(item) - , m_epg_id(epg_id) + , m_vnid(vnid) , m_sclass(sclass) , m_bd_id(bd_id) , m_rd_id(rd_id) @@ -39,7 +39,7 @@ bool create_cmd::operator==(const create_cmd& other) const { return ((m_itf == other.m_itf) && (m_bd_id == other.m_bd_id) && - (m_rd_id == other.m_rd_id) && (m_epg_id == other.m_epg_id) && + (m_rd_id == other.m_rd_id) && (m_vnid == other.m_vnid) && (m_retention == other.m_retention)); } @@ -50,7 +50,7 @@ create_cmd::issue(connection& con) auto& payload = req.get_request().get_payload(); payload.epg.uplink_sw_if_index = m_itf.value(); - payload.epg.epg_id = m_epg_id; + payload.epg.vnid = m_vnid; payload.epg.sclass = m_sclass; payload.epg.bd_id = m_bd_id; payload.epg.rd_id = m_rd_id; @@ -66,22 +66,22 @@ create_cmd::to_string() const { std::ostringstream s; s << "gbp-endpoint-group-create: " << m_hw_item.to_string() - << " epg-id:" << m_epg_id << " bd-id:" << m_bd_id << " rd-id:" << m_rd_id + << " vnid:" << m_vnid << " bd-id:" << m_bd_id << " rd-id:" << m_rd_id << " itf:" << m_itf; return (s.str()); } -delete_cmd::delete_cmd(HW::item<bool>& item, epg_id_t epg_id) +delete_cmd::delete_cmd(HW::item<bool>& item, sclass_t sclass) : rpc_cmd(item) - , m_epg_id(epg_id) + , m_sclass(sclass) { } bool delete_cmd::operator==(const delete_cmd& other) const { - return (m_epg_id == other.m_epg_id); + return (m_sclass == other.m_sclass); } rc_t @@ -90,7 +90,7 @@ delete_cmd::issue(connection& con) msg_t req(con.ctx(), std::ref(*this)); auto& payload = req.get_request().get_payload(); - payload.epg_id = m_epg_id; + payload.sclass = m_sclass; VAPI_CALL(req.execute()); @@ -102,7 +102,7 @@ delete_cmd::to_string() const { std::ostringstream s; s << "gbp-endpoint-group-delete: " << m_hw_item.to_string() - << " epg:" << m_epg_id; + << " sclass:" << m_sclass; return (s.str()); } diff --git a/extras/vom/vom/gbp_endpoint_group_cmds.hpp b/extras/vom/vom/gbp_endpoint_group_cmds.hpp index b735b5c132d..fa892726bf3 100644 --- a/extras/vom/vom/gbp_endpoint_group_cmds.hpp +++ b/extras/vom/vom/gbp_endpoint_group_cmds.hpp @@ -34,7 +34,7 @@ public: * Constructor */ create_cmd(HW::item<bool>& item, - epg_id_t epg_id, + vnid_t vnid, uint16_t sclass, uint32_t bd_id, route::table_id_t rd_id, @@ -57,7 +57,7 @@ public: bool operator==(const create_cmd& i) const; private: - const epg_id_t m_epg_id; + const vnid_t m_vnid; const uint16_t m_sclass; const uint32_t m_bd_id; const route::table_id_t m_rd_id; @@ -74,7 +74,7 @@ public: /** * Constructor */ - delete_cmd(HW::item<bool>& item, epg_id_t epg_id); + delete_cmd(HW::item<bool>& item, sclass_t sclass); /** * Issue the command to VPP/HW @@ -92,7 +92,7 @@ public: bool operator==(const delete_cmd& i) const; private: - const epg_id_t m_epg_id; + const sclass_t m_sclass; }; /** diff --git a/extras/vom/vom/gbp_recirc.cpp b/extras/vom/vom/gbp_recirc.cpp index 250e3048f8a..19cb2da60e2 100644 --- a/extras/vom/vom/gbp_recirc.cpp +++ b/extras/vom/vom/gbp_recirc.cpp @@ -88,7 +88,7 @@ gbp_recirc::replay() { if (m_hw) { HW::enqueue(new gbp_recirc_cmds::create_cmd( - m_hw, m_itf->handle(), (m_type == type_t::EXTERNAL), m_epg->id())); + m_hw, m_itf->handle(), (m_type == type_t::EXTERNAL), m_epg->sclass())); } } @@ -107,7 +107,7 @@ gbp_recirc::update(const gbp_recirc& r) { if (rc_t::OK != m_hw.rc()) { HW::enqueue(new gbp_recirc_cmds::create_cmd( - m_hw, m_itf->handle(), (m_type == type_t::EXTERNAL), m_epg->id())); + m_hw, m_itf->handle(), (m_type == type_t::EXTERNAL), m_epg->sclass())); } } @@ -162,10 +162,10 @@ gbp_recirc::event_handler::handle_populate(const client_db::key_t& key) std::shared_ptr<interface> itf = interface::find(payload.recirc.sw_if_index); std::shared_ptr<gbp_endpoint_group> epg = - gbp_endpoint_group::find(payload.recirc.epg_id); + gbp_endpoint_group::find(payload.recirc.sclass); VOM_LOG(log_level_t::DEBUG) << "data: [" << payload.recirc.sw_if_index - << ", " << payload.recirc.epg_id << "]"; + << ", " << payload.recirc.sclass << "]"; if (itf && epg) { gbp_recirc recirc( diff --git a/extras/vom/vom/gbp_recirc_cmds.cpp b/extras/vom/vom/gbp_recirc_cmds.cpp index b14697c9f6f..90b931c0ced 100644 --- a/extras/vom/vom/gbp_recirc_cmds.cpp +++ b/extras/vom/vom/gbp_recirc_cmds.cpp @@ -21,11 +21,11 @@ namespace gbp_recirc_cmds { create_cmd::create_cmd(HW::item<bool>& item, const handle_t& itf, bool is_ext, - epg_id_t epg_id) + sclass_t sclass) : rpc_cmd(item) , m_itf(itf) , m_is_ext(is_ext) - , m_epg_id(epg_id) + , m_sclass(sclass) { } @@ -33,7 +33,7 @@ bool create_cmd::operator==(const create_cmd& other) const { return ((m_itf == other.m_itf) && (m_is_ext == other.m_is_ext) && - (m_epg_id == other.m_epg_id)); + (m_sclass == other.m_sclass)); } rc_t @@ -44,7 +44,7 @@ create_cmd::issue(connection& con) auto& payload = req.get_request().get_payload(); payload.is_add = 1; payload.recirc.sw_if_index = m_itf.value(); - payload.recirc.epg_id = m_epg_id; + payload.recirc.sclass = m_sclass; payload.recirc.is_ext = m_is_ext; VAPI_CALL(req.execute()); @@ -57,7 +57,7 @@ create_cmd::to_string() const { std::ostringstream s; s << "gbp-recirc-create: " << m_hw_item.to_string() << " itf:" << m_itf - << " ext:" << m_is_ext << " epg-id:" << m_epg_id; + << " ext:" << m_is_ext << " sclass:" << m_sclass; return (s.str()); } @@ -82,7 +82,7 @@ delete_cmd::issue(connection& con) auto& payload = req.get_request().get_payload(); payload.is_add = 0; payload.recirc.sw_if_index = m_itf.value(); - payload.recirc.epg_id = ~0; + payload.recirc.sclass = ~0; VAPI_CALL(req.execute()); diff --git a/extras/vom/vom/gbp_recirc_cmds.hpp b/extras/vom/vom/gbp_recirc_cmds.hpp index 3c25d4495ca..9d95bf16195 100644 --- a/extras/vom/vom/gbp_recirc_cmds.hpp +++ b/extras/vom/vom/gbp_recirc_cmds.hpp @@ -36,7 +36,7 @@ public: create_cmd(HW::item<bool>& item, const handle_t& itf, bool is_ext, - epg_id_t epg_id); + sclass_t sclass); /** * Issue the command to VPP/HW @@ -56,7 +56,7 @@ public: private: const handle_t m_itf; bool m_is_ext; - const epg_id_t m_epg_id; + const sclass_t m_sclass; }; /** diff --git a/extras/vom/vom/gbp_subnet.cpp b/extras/vom/vom/gbp_subnet.cpp index a6bb55071e9..304da3ef496 100644 --- a/extras/vom/vom/gbp_subnet.cpp +++ b/extras/vom/vom/gbp_subnet.cpp @@ -120,7 +120,7 @@ gbp_subnet::replay() HW::enqueue(new gbp_subnet_cmds::create_cmd( m_hw, m_rd->id(), m_prefix, m_type, (m_recirc ? m_recirc->handle() : handle_t::INVALID), - (m_epg ? m_epg->id() : ~0))); + (m_epg ? m_epg->sclass() : ~0))); } } @@ -147,7 +147,7 @@ gbp_subnet::update(const gbp_subnet& r) HW::enqueue(new gbp_subnet_cmds::create_cmd( m_hw, m_rd->id(), m_prefix, m_type, (m_recirc ? m_recirc->handle() : handle_t::INVALID), - (m_epg ? m_epg->id() : ~0))); + (m_epg ? m_epg->sclass() : ~0))); } else { if (m_type != r.m_type) { m_epg = r.m_epg; @@ -157,7 +157,7 @@ gbp_subnet::update(const gbp_subnet& r) HW::enqueue(new gbp_subnet_cmds::create_cmd( m_hw, m_rd->id(), m_prefix, m_type, (m_recirc ? m_recirc->handle() : handle_t::INVALID), - (m_epg ? m_epg->id() : ~0))); + (m_epg ? m_epg->sclass() : ~0))); } } } @@ -230,7 +230,7 @@ gbp_subnet::event_handler::handle_populate(const client_db::key_t& key) } case GBP_API_SUBNET_L3_OUT: { std::shared_ptr<gbp_endpoint_group> epg = - gbp_endpoint_group::find(payload.subnet.epg_id); + gbp_endpoint_group::find(payload.subnet.sclass); gbp_subnet gs(*rd, pfx, *epg); OM::commit(key, gs); @@ -241,7 +241,7 @@ gbp_subnet::event_handler::handle_populate(const client_db::key_t& key) std::shared_ptr<interface> itf = interface::find(payload.subnet.sw_if_index); std::shared_ptr<gbp_endpoint_group> epg = - gbp_endpoint_group::find(payload.subnet.epg_id); + gbp_endpoint_group::find(payload.subnet.sclass); if (itf && epg) { std::shared_ptr<gbp_recirc> recirc = gbp_recirc::find(itf->key()); diff --git a/extras/vom/vom/gbp_subnet_cmds.cpp b/extras/vom/vom/gbp_subnet_cmds.cpp index 3dcd652dd19..cf2801c8d63 100644 --- a/extras/vom/vom/gbp_subnet_cmds.cpp +++ b/extras/vom/vom/gbp_subnet_cmds.cpp @@ -24,13 +24,13 @@ create_cmd::create_cmd(HW::item<bool>& item, const route::prefix_t& prefix, const gbp_subnet::type_t& type, const handle_t& itf, - epg_id_t epg_id) + sclass_t sclass) : rpc_cmd(item) , m_rd(rd) , m_prefix(prefix) , m_type(type) , m_itf(itf) - , m_epg_id(epg_id) + , m_sclass(sclass) { } @@ -39,7 +39,7 @@ create_cmd::operator==(const create_cmd& other) const { return ((m_itf == other.m_itf) && (m_rd == other.m_rd) && (m_prefix == other.m_prefix) && (m_type == other.m_type) && - (m_itf == other.m_itf) && (m_epg_id == other.m_epg_id)); + (m_itf == other.m_itf) && (m_sclass == other.m_sclass)); } static vapi_enum_gbp_subnet_type @@ -65,7 +65,7 @@ create_cmd::issue(connection& con) payload.subnet.type = gbp_subnet_type_to_api(m_type); payload.subnet.rd_id = m_rd; payload.subnet.sw_if_index = m_itf.value(); - payload.subnet.epg_id = m_epg_id; + payload.subnet.sclass = m_sclass; payload.subnet.prefix = to_api(m_prefix); VAPI_CALL(req.execute()); @@ -79,7 +79,7 @@ create_cmd::to_string() const std::ostringstream s; s << "gbp-subnet-create: " << m_hw_item.to_string() << "type:" << m_type << ", " << m_rd << ":" << m_prefix.to_string() << " itf:" << m_itf - << " epg-id:" << m_epg_id; + << " sclass:" << m_sclass; return (s.str()); } diff --git a/extras/vom/vom/gbp_subnet_cmds.hpp b/extras/vom/vom/gbp_subnet_cmds.hpp index da2a4c509d1..b78699e5bf5 100644 --- a/extras/vom/vom/gbp_subnet_cmds.hpp +++ b/extras/vom/vom/gbp_subnet_cmds.hpp @@ -25,8 +25,8 @@ namespace VOM { namespace gbp_subnet_cmds { /** -* A command class that creates or updates the GBP subnet -*/ + * A command class that creates or updates the GBP subnet + */ class create_cmd : public rpc_cmd<HW::item<bool>, vapi::Gbp_subnet_add_del> { public: @@ -38,7 +38,7 @@ public: const route::prefix_t& prefix, const gbp_subnet::type_t& type, const handle_t& itf, - epg_id_t epg_id); + sclass_t sclass); /** * Issue the command to VPP/HW @@ -60,7 +60,7 @@ private: const route::prefix_t m_prefix; const gbp_subnet::type_t& m_type; const handle_t m_itf; - const epg_id_t m_epg_id; + const sclass_t m_sclass; }; /** |