From 4ef4226282685a049aad439080ca5478da09ac06 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Tue, 20 Feb 2018 08:10:44 -0800 Subject: VOM: vhost-use interfaces Change-Id: Iee1574d1f0f081ccc4a90fd9825a0b5e254aa642 Signed-off-by: Neale Ranns Signed-off-by: Mohsin Kazmi --- src/vpp-api/vom/interface_cmds.hpp | 70 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) (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 f21a7f3b21c..62762ef7c41 100644 --- a/src/vpp-api/vom/interface_cmds.hpp +++ b/src/vpp-api/vom/interface_cmds.hpp @@ -27,6 +27,7 @@ #include #include #include +#include #include namespace VOM { @@ -109,6 +110,30 @@ public: std::string to_string() const; }; +/** + * A functor class that creates an interface + */ +class vhost_create_cmd + : public interface::create_cmd +{ +public: + vhost_create_cmd(HW::item& item, + const std::string& name, + const std::string& tag); + + /** + * Issue the command to VPP/HW + */ + rc_t issue(connection& con); + /** + * convert to string format for debug purposes + */ + std::string to_string() const; + +private: + const std::string m_tag; +}; + /** * A command class to delete loopback interfaces in VPP */ @@ -174,6 +199,25 @@ public: std::string to_string() const; }; +/** + * A functor class that deletes a Vhost interface + */ +class vhost_delete_cmd + : public interface::delete_cmd +{ +public: + vhost_delete_cmd(HW::item& item, const std::string& name); + + /** + * Issue the command to VPP/HW + */ + rc_t issue(connection& con); + /** + * convert to string format for debug purposes + */ + std::string to_string() const; +}; + /** * A command class to set tag on interfaces */ @@ -479,6 +523,32 @@ public: */ bool operator==(const dump_cmd& i) const; }; + +/** + * A cmd class that Dumps all the Vpp Interfaces + */ +class vhost_dump_cmd : public VOM::dump_cmd +{ +public: + /** + * Default Constructor + */ + vhost_dump_cmd(); + + /** + * 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 vhost_dump_cmd& i) const; +}; }; }; /* -- cgit 1.2.3-korg