From a2ee029d0772e894911c84fb8a0cab5f253e145b Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Tue, 28 Nov 2017 22:29:13 -0800 Subject: 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 --- src/vpp-api/vom/interface_cmds.hpp | 49 ++++++++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 4 deletions(-) (limited to 'src/vpp-api/vom/interface_cmds.hpp') 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 +class stats_enable_cmd + : public event_cmd { 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, + 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 m_res; + /** + * The interface on which we are disabling states + */ handle_t m_swifindex; }; -- cgit 1.2.3-korg