aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vom/interface_cmds.cpp
diff options
context:
space:
mode:
authorNeale Ranns <nranns@cisco.com>2018-03-29 01:28:09 -0700
committerDave Barach <openvpp@barachs.net>2018-04-04 13:40:39 +0000
commit871dc4287d8c05ff76106dba4f5f8654c24347fe (patch)
tree97f6026e284f8cb570855f47512b22a0b58112d1 /src/vpp-api/vom/interface_cmds.cpp
parent6df19030f2bf986f1876c2c46b44c046b9b2c686 (diff)
Detailed stats collection feature
Use device-input and interface-output feautre arcs to collect unicast, multicast and broadcast states for RX and TX resp. Since these feature arcs are present only for 'physical' interfaces (i.e. not su-interfaces) counter collection is supported only on parent interface types. Change-Id: I915c235e336b0fc3a3c3de918f95dd674e4e0e4e Signed-off-by: Neale Ranns <nranns@cisco.com> Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vpp-api/vom/interface_cmds.cpp')
-rw-r--r--src/vpp-api/vom/interface_cmds.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/vpp-api/vom/interface_cmds.cpp b/src/vpp-api/vom/interface_cmds.cpp
index 084d6d5cb08..b1decd2bf7c 100644
--- a/src/vpp-api/vom/interface_cmds.cpp
+++ b/src/vpp-api/vom/interface_cmds.cpp
@@ -412,6 +412,48 @@ set_mac_cmd::to_string() const
return (s.str());
}
+collect_detail_stats_change_cmd::collect_detail_stats_change_cmd(
+ HW::item<interface::stats_type_t>& item,
+ const handle_t& hdl,
+ bool enable)
+ : rpc_cmd(item)
+ , m_hdl(hdl)
+ , m_enable(enable)
+{
+}
+
+bool
+collect_detail_stats_change_cmd::operator==(
+ const collect_detail_stats_change_cmd& other) const
+{
+ return ((m_hdl == other.m_hdl) && (m_hw_item == other.m_hw_item) &&
+ (m_enable == other.m_enable));
+}
+
+rc_t
+collect_detail_stats_change_cmd::issue(connection& con)
+{
+ msg_t req(con.ctx(), std::ref(*this));
+
+ auto& payload = req.get_request().get_payload();
+ payload.sw_if_index = m_hdl.value();
+ payload.enable_disable = m_enable;
+
+ VAPI_CALL(req.execute());
+
+ m_hw_item.set(wait());
+
+ return (rc_t::OK);
+}
+
+std::string
+collect_detail_stats_change_cmd::to_string() const
+{
+ std::ostringstream s;
+ s << "itf-stats: " << m_hw_item.to_string() << " hdl:" << m_hdl.to_string();
+ return (s.str());
+}
+
events_cmd::events_cmd(interface::event_listener& el)
: event_cmd(el.status())
, m_listener(el)