summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vom/interface.cpp
diff options
context:
space:
mode:
authorMohsin Kazmi <sykazmi@cisco.com>2017-11-20 10:23:47 +0100
committerNeale Ranns <nranns@cisco.com>2017-11-22 11:20:45 +0000
commit5a4f96a178b693ace8e736c30c949ced5928d824 (patch)
tree55109d1354c6fc3814282a9b9ba6e52fc19a43df /src/vpp-api/vom/interface.cpp
parent4878cbe276ec1131d0cf30ac5df18aa9ba699bc4 (diff)
VOM: stats: Associate stat obj to interface
Change-Id: Id8b159dd72b92798538a32fe570fb0038d742ef2 Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vpp-api/vom/interface.cpp')
-rw-r--r--src/vpp-api/vom/interface.cpp18
1 files changed, 18 insertions, 0 deletions
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<cmd*> 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>
interface::singular_i() const
{