X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvpp-api%2Fvom%2Fvxlan_tunnel.cpp;h=3d5ed64c5e04f61bd07a18e6be18816e11d1c6b0;hb=756cd9441752fc8f84104c9ee19099506ba89f85;hp=896158939397bcfa0d2c4e59fb68943c4f91922a;hpb=1d781558da28f72f5233c09835663aa3b42e2d97;p=vpp.git diff --git a/src/vpp-api/vom/vxlan_tunnel.cpp b/src/vpp-api/vom/vxlan_tunnel.cpp index 89615893939..3d5ed64c5e0 100644 --- a/src/vpp-api/vom/vxlan_tunnel.cpp +++ b/src/vpp-api/vom/vxlan_tunnel.cpp @@ -15,6 +15,7 @@ #include "vom/vxlan_tunnel.hpp" #include "vom/logger.hpp" +#include "vom/singular_db_funcs.hpp" #include "vom/vxlan_tunnel_cmds.hpp" namespace VOM { @@ -106,19 +107,6 @@ vxlan_tunnel::vxlan_tunnel(const boost::asio::ip::address& src, { } -vxlan_tunnel::vxlan_tunnel(const handle_t& hdl, - const boost::asio::ip::address& src, - const boost::asio::ip::address& dst, - uint32_t vni) - : interface(hdl, - l2_address_t::ZERO, - mk_name(src, dst, vni), - interface::type_t::VXLAN, - interface::admin_state_t::UP) - , m_tep(src, dst, vni) -{ -} - vxlan_tunnel::vxlan_tunnel(const vxlan_tunnel& o) : interface(o) , m_tep(o.m_tep) @@ -210,7 +198,7 @@ vxlan_tunnel::singular_i() const void vxlan_tunnel::dump(std::ostream& os) { - m_db.dump(os); + db_dump(m_db, os); } void @@ -233,11 +221,13 @@ vxlan_tunnel::event_handler::handle_populate(const client_db::key_t& key) boost::asio::ip::address dst = from_bytes(payload.is_ipv6, payload.dst_address); - vxlan_tunnel vt(hdl, src, dst, payload.vni); + std::shared_ptr vt = + vxlan_tunnel(src, dst, payload.vni).singular(); + vt->set(hdl); - VOM_LOG(log_level_t::DEBUG) << "dump: " << vt.to_string(); + VOM_LOG(log_level_t::DEBUG) << "dump: " << vt->to_string(); - OM::commit(key, vt); + OM::commit(key, *vt); } }