summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vom/interface_cmds.hpp
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2017-11-28 22:29:13 -0800
committerNeale Ranns <nranns@cisco.com>2017-11-29 07:42:52 +0000
commita2ee029d0772e894911c84fb8a0cab5f253e145b (patch)
tree167d07ee3b3a482ef494f420ceef13a9657d4274 /src/vpp-api/vom/interface_cmds.hpp
parente80ae9ea8ed04c82c151a548916926b5dbfe8ecb (diff)
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 <neale.ranns@cisco.com>
Diffstat (limited to 'src/vpp-api/vom/interface_cmds.hpp')
-rw-r--r--src/vpp-api/vom/interface_cmds.hpp49
1 files changed, 45 insertions, 4 deletions
diff --git a/src/vpp-api/vom/interface_cmds.hpp b/src/vpp-api/vom/interface_cmds.hpp
index c86df92a4aa..f21a7f3b21c 100644
--- a/src/vpp-api/vom/interface_cmds.hpp
+++ b/src/vpp-api/vom/interface_cmds.hpp
@@ -370,14 +370,15 @@ private:
/**
* A command class represents our desire to recieve interface stats
*/
-class stats_cmd : public event_cmd<vapi::Want_per_interface_combined_stats,
- vapi::Vnet_per_interface_combined_counters>
+class stats_enable_cmd
+ : public event_cmd<vapi::Want_per_interface_combined_stats,
+ vapi::Vnet_per_interface_combined_counters>
{
public:
/**
* Constructor taking the listner to notify
*/
- stats_cmd(interface::stat_listener& el, const handle_t& handle);
+ stats_enable_cmd(interface::stat_listener& el, const handle_t& handle);
/**
* Issue the command to VPP/HW
@@ -397,7 +398,7 @@ public:
/**
* Comparison operator - only used for UT
*/
- bool operator==(const stats_cmd& i) const;
+ bool operator==(const stats_enable_cmd& i) const;
/**
* Called when it's time to poke the listeners
@@ -410,6 +411,46 @@ private:
*/
interface::stat_listener& m_listener;
+ /**
+ * The interface on which we are enabling states
+ */
+ handle_t m_swifindex;
+};
+
+/**
+ * A command class represents our desire to recieve interface stats
+ */
+class stats_disable_cmd
+ : public rpc_cmd<HW::item<bool>,
+ rc_t,
+ vapi::Want_per_interface_combined_stats>
+{
+public:
+ /**
+ * Constructor taking the listner to notify
+ */
+ stats_disable_cmd(const handle_t& handle);
+
+ /**
+ * Issue the command to VPP/HW
+ */
+ rc_t issue(connection& con);
+
+ /**
+ * convert to string format for debug purposes
+ */
+ std::string to_string() const;
+
+ /**
+ * Comparison operator - only used for UT
+ */
+ bool operator==(const stats_disable_cmd& i) const;
+
+private:
+ HW::item<bool> m_res;
+ /**
+ * The interface on which we are disabling states
+ */
handle_t m_swifindex;
};