summaryrefslogtreecommitdiffstats
path: root/src/vpp-api/vom/interface.hpp
diff options
context:
space:
mode:
authorNeale Ranns <neale.ranns@cisco.com>2018-02-20 08:10:44 -0800
committerDamjan Marion <dmarion.lists@gmail.com>2018-02-22 19:57:08 +0000
commit4ef4226282685a049aad439080ca5478da09ac06 (patch)
treed9cefcdd79d9d5195b3862e56924ce8abb9218e8 /src/vpp-api/vom/interface.hpp
parentde0203edd2177f627cc655b52ffdf921d94d5d26 (diff)
VOM: vhost-use interfaces
Change-Id: Iee1574d1f0f081ccc4a90fd9825a0b5e254aa642 Signed-off-by: Neale Ranns <neale.ranns@cisco.com> Signed-off-by: Mohsin Kazmi <sykazmi@cisco.com>
Diffstat (limited to 'src/vpp-api/vom/interface.hpp')
-rw-r--r--src/vpp-api/vom/interface.hpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/vpp-api/vom/interface.hpp b/src/vpp-api/vom/interface.hpp
index da0db409e62..5d2951007a2 100644
--- a/src/vpp-api/vom/interface.hpp
+++ b/src/vpp-api/vom/interface.hpp
@@ -91,6 +91,11 @@ public:
const static type_t TAP;
/**
+ * vhost-user interface type
+ */
+ const static type_t VHOST;
+
+ /**
* Convert VPP's name of the interface to a type
*/
static type_t from_string(const std::string& str);
@@ -157,7 +162,10 @@ public:
/**
* Construct a new object matching the desried state
*/
- interface(const std::string& name, type_t type, admin_state_t state);
+ interface(const std::string& name,
+ type_t type,
+ admin_state_t state,
+ const std::string& tag = "");
/**
* Construct a new object matching the desried state mapped
* to a specific route_domain
@@ -165,7 +173,8 @@ public:
interface(const std::string& name,
type_t type,
admin_state_t state,
- const route_domain& rd);
+ const route_domain& rd,
+ const std::string& tag = "");
/**
* Destructor
*/
@@ -215,6 +224,11 @@ public:
const l2_address_t& l2_address() const;
/**
+ * Set the admin state of the interface
+ */
+ void set(const admin_state_t& state);
+
+ /**
* Set the L2 Address
*/
void set(const l2_address_t& addr);
@@ -225,6 +239,11 @@ public:
void set(const oper_state_t& state);
/**
+ * Set the tag to the interface
+ */
+ void set(const std::string& tag);
+
+ /**
* Comparison operator - only used for UT
*/
virtual bool operator==(const interface& i) const;
@@ -581,6 +600,11 @@ private:
oper_state_t m_oper;
/**
+ * tag of the interface
+ */
+ std::string m_tag;
+
+ /**
* A map of all interfaces keyed against VPP's handle
*/
static std::map<handle_t, std::weak_ptr<interface>> m_hdl_db;