VOM: stats: Associate stat obj to interface

Change-Id: Id8b159dd72b92798538a32fe570fb0038d742ef2
Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
diff --git a/src/vpp-api/vom/interface.cpp b/src/vpp-api/vom/interface.cpp
index 8f1023d..39ca074 100644
--- a/src/vpp-api/vom/interface.cpp
+++ b/src/vpp-api/vom/interface.cpp
@@ -163,11 +163,15 @@
       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 @@
   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
 {