X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=extras%2Fvom%2Fvom%2Fbridge_domain_arp_entry_cmds.cpp;h=da5c547bb3b93177bec80e4a0426e7bd5dc84885;hb=8c8acc027871f97370ee549306876690030c3bbb;hp=824dcadad02724bdf617874204aea2e54688d336;hpb=164e5f8c63652028ecb9c3570e1ea8618b163071;p=vpp.git diff --git a/extras/vom/vom/bridge_domain_arp_entry_cmds.cpp b/extras/vom/vom/bridge_domain_arp_entry_cmds.cpp index 824dcadad02..da5c547bb3b 100644 --- a/extras/vom/vom/bridge_domain_arp_entry_cmds.cpp +++ b/extras/vom/vom/bridge_domain_arp_entry_cmds.cpp @@ -14,6 +14,7 @@ */ #include "vom/bridge_domain_arp_entry_cmds.hpp" +#include "vom/api_types.hpp" namespace VOM { namespace bridge_domain_arp_entry_cmds { @@ -44,14 +45,12 @@ create_cmd::issue(connection& con) auto& payload = req.get_request().get_payload(); payload.bd_id = m_bd; payload.is_add = 1; - m_mac.to_bytes(payload.mac_address, 6); - to_bytes(m_ip_addr, &payload.is_ipv6, payload.ip_address); + payload.mac = to_api(m_mac); + to_api(m_ip_addr, payload.ip); VAPI_CALL(req.execute()); - m_hw_item.set(wait()); - - return rc_t::OK; + return (wait()); } std::string @@ -91,8 +90,8 @@ delete_cmd::issue(connection& con) auto& payload = req.get_request().get_payload(); payload.bd_id = m_bd; payload.is_add = 0; - m_mac.to_bytes(payload.mac_address, 6); - to_bytes(m_ip_addr, &payload.is_ipv6, payload.ip_address); + payload.mac = to_api(m_mac); + to_api(m_ip_addr, payload.ip); VAPI_CALL(req.execute()); @@ -113,6 +112,43 @@ delete_cmd::to_string() const return (s.str()); } +dump_cmd::dump_cmd(uint32_t bd_id) + : m_bd(bd_id) +{ +} + +dump_cmd::dump_cmd(const dump_cmd& d) + : m_bd(d.m_bd) +{ +} + +bool +dump_cmd::operator==(const dump_cmd& other) const +{ + return (true); +} + +rc_t +dump_cmd::issue(connection& con) +{ + m_dump.reset(new msg_t(con.ctx(), std::ref(*this))); + + auto& payload = m_dump->get_request().get_payload(); + payload.bd_id = m_bd; + + VAPI_CALL(m_dump->execute()); + + wait(); + + return rc_t::OK; +} + +std::string +dump_cmd::to_string() const +{ + return ("bridge-domain-arp-entry-dump"); +} + }; // namespace bridge_domain_arp_entry }; // namespace VOM