X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvpp-api%2Fvom%2Finterface.cpp;h=39ca074920fe9024ee5afa493bc61972be168f53;hb=5a4f96a178b693ace8e736c30c949ced5928d824;hp=8f1023d2273b34915309c13e33366fe1d42393d6;hpb=4878cbe276ec1131d0cf30ac5df18aa9ba699bc4;p=vpp.git diff --git a/src/vpp-api/vom/interface.cpp b/src/vpp-api/vom/interface.cpp index 8f1023d2273..39ca074920f 100644 --- a/src/vpp-api/vom/interface.cpp +++ b/src/vpp-api/vom/interface.cpp @@ -163,11 +163,15 @@ interface::sweep() new interface_cmds::set_table_cmd(m_table_id, l3_proto_t::IPV6, m_hdl)); } + if (m_stats) + HW::dequeue(m_stats); + // If the interface is up, bring it down if (m_state && interface::admin_state_t::UP == m_state.data()) { m_state.data() = interface::admin_state_t::DOWN; HW::enqueue(new interface_cmds::state_change_cmd(m_state, m_hdl)); } + if (m_hdl) { std::queue cmds; HW::enqueue(mk_delete_cmd(cmds)); @@ -356,6 +360,20 @@ interface::set(const oper_state_t& state) m_oper = state; } +void +interface::enable_stats_i(interface::stat_listener& el) +{ + m_stats.reset(new interface_cmds::stats_cmd(el, handle_i())); + HW::enqueue(m_stats); + HW::write(); +} + +void +interface::enable_stats(interface::stat_listener& el) +{ + singular()->enable_stats_i(el); +} + std::shared_ptr interface::singular_i() const {