From a2ee029d0772e894911c84fb8a0cab5f253e145b Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Tue, 28 Nov 2017 22:29:13 -0800 Subject: VOM: logging, populate and stats fixes logging: allow a client to register a callback handler to recieve log messages that way the client can maintain a correctly sequenced log populate: fix the creation of interface and the setting of the handle stats: the reset promise idea is not defined behaviour. Use an eanble/disable command pair Change-Id: I347720bb65df2874c7619e722d593bc863ee2bf1 Signed-off-by: Neale Ranns --- src/vpp-api/vom/vxlan_tunnel.cpp | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'src/vpp-api/vom/vxlan_tunnel.cpp') diff --git a/src/vpp-api/vom/vxlan_tunnel.cpp b/src/vpp-api/vom/vxlan_tunnel.cpp index 89615893939..f6f3cf586e1 100644 --- a/src/vpp-api/vom/vxlan_tunnel.cpp +++ b/src/vpp-api/vom/vxlan_tunnel.cpp @@ -106,19 +106,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) @@ -233,11 +220,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); } } -- cgit 1.2.3-korg