X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=extras%2Fvom%2Fvom%2Fneighbour_cmds.cpp;h=758147c49c5550fc69a255a50e87e79061063afb;hb=097fa66b986f06281f603767d321ab13ab6c88c3;hp=9bd32923379b225e08637a01b337e19e766491a2;hpb=208c29aac523231af2420a95ba7e5d361698780b;p=vpp.git diff --git a/extras/vom/vom/neighbour_cmds.cpp b/extras/vom/vom/neighbour_cmds.cpp index 9bd32923379..758147c49c5 100644 --- a/extras/vom/vom/neighbour_cmds.cpp +++ b/extras/vom/vom/neighbour_cmds.cpp @@ -14,17 +14,20 @@ */ #include "vom/neighbour_cmds.hpp" +#include "vom/api_types.hpp" namespace VOM { namespace neighbour_cmds { -create_cmd::create_cmd(HW::item& item, +create_cmd::create_cmd(HW::item& item, handle_t itf, const mac_address_t& mac, - const boost::asio::ip::address& ip_addr) - : rpc_cmd(item) + const boost::asio::ip::address& ip_addr, + const neighbour::flags_t& flags) + : srpc_cmd(item) , m_itf(itf) , m_mac(mac) , m_ip_addr(ip_addr) + , m_flags(flags) { } @@ -32,7 +35,7 @@ bool create_cmd::operator==(const create_cmd& other) const { return ((m_mac == other.m_mac) && (m_ip_addr == other.m_ip_addr) && - (m_itf == other.m_itf)); + (m_itf == other.m_itf) && (m_flags == other.m_flags)); } rc_t @@ -41,11 +44,12 @@ create_cmd::issue(connection& con) msg_t req(con.ctx(), std::ref(*this)); auto& payload = req.get_request().get_payload(); - payload.sw_if_index = m_itf.value(); payload.is_add = 1; - payload.is_static = 1; - m_mac.to_bytes(payload.mac_address, 6); - to_bytes(m_ip_addr, &payload.is_ipv6, payload.dst_address); + payload.neighbor.sw_if_index = m_itf.value(); + + to_api(m_mac, payload.neighbor.mac_address); + to_api(m_ip_addr, payload.neighbor.ip_address); + payload.neighbor.flags = to_api(m_flags); VAPI_CALL(req.execute()); @@ -63,14 +67,16 @@ create_cmd::to_string() const return (s.str()); } -delete_cmd::delete_cmd(HW::item& item, +delete_cmd::delete_cmd(HW::item& item, handle_t itf, const mac_address_t& mac, - const boost::asio::ip::address& ip_addr) - : rpc_cmd(item) + const boost::asio::ip::address& ip_addr, + const neighbour::flags_t& flags) + : srpc_cmd(item) , m_itf(itf) , m_mac(mac) , m_ip_addr(ip_addr) + , m_flags(flags) { } @@ -87,11 +93,12 @@ delete_cmd::issue(connection& con) msg_t req(con.ctx(), std::ref(*this)); auto& payload = req.get_request().get_payload(); - payload.sw_if_index = m_itf.value(); payload.is_add = 0; - payload.is_static = 1; - m_mac.to_bytes(payload.mac_address, 6); - to_bytes(m_ip_addr, &payload.is_ipv6, payload.dst_address); + payload.neighbor.sw_if_index = m_itf.value(); + + to_api(m_mac, payload.neighbor.mac_address); + to_api(m_ip_addr, payload.neighbor.ip_address); + payload.neighbor.flags = to_api(m_flags); VAPI_CALL(req.execute());