summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vom/interface_cmds.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/vpp-api/vom/interface_cmds.hpp')
-rw-r--r--src/vpp-api/vom/interface_cmds.hpp70
1 files changed, 70 insertions, 0 deletions
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 <vapi/interface.api.vapi.hpp>
#include <vapi/stats.api.vapi.hpp>
#include <vapi/tap.api.vapi.hpp>
+#include <vapi/vhost_user.api.vapi.hpp>
#include <vapi/vpe.api.vapi.hpp>
namespace VOM {
@@ -110,6 +111,30 @@ public:
};
/**
+ * A functor class that creates an interface
+ */
+class vhost_create_cmd
+ : public interface::create_cmd<vapi::Create_vhost_user_if>
+{
+public:
+ vhost_create_cmd(HW::item<handle_t>& 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
*/
class loopback_delete_cmd : public interface::delete_cmd<vapi::Delete_loopback>
@@ -175,6 +200,25 @@ public:
};
/**
+ * A functor class that deletes a Vhost interface
+ */
+class vhost_delete_cmd
+ : public interface::delete_cmd<vapi::Delete_vhost_user_if>
+{
+public:
+ vhost_delete_cmd(HW::item<handle_t>& 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
*/
class set_tag
@@ -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<vapi::Sw_interface_vhost_user_dump>
+{
+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;
+};
};
};
/*