aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/vpp-oper/interface.cpp
diff options
context:
space:
mode:
authorYohanPipereau <ypiperea@cisco.com>2019-07-15 15:37:46 +0200
committerYohanPipereau <ypiperea@cisco.com>2019-07-26 15:29:05 +0200
commit18561adfde80d6665e24262d70d18f916e2662e5 (patch)
tree06683574ba18ee25012f77b18da7c0e35a5707aa /src/plugins/vpp-oper/interface.cpp
parentadc56bc5ddcdf947864d982cda809588b7ccd8bc (diff)
vom: migration from scvpp to vom
Change-Id: I79609f0bee9b8307da0d9bf704babe8ba06dba4d Signed-off-by: YohanPipereau <ypiperea@cisco.com> Co-authored-by: Pavel Kotucek <pavel.kotucek@pantheon.tech> Co-authored-by: Andrej Kozemcak <andrej.kozemcak@pantheon.tech>
Diffstat (limited to 'src/plugins/vpp-oper/interface.cpp')
-rw-r--r--src/plugins/vpp-oper/interface.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/plugins/vpp-oper/interface.cpp b/src/plugins/vpp-oper/interface.cpp
new file mode 100644
index 0000000..054ec6c
--- /dev/null
+++ b/src/plugins/vpp-oper/interface.cpp
@@ -0,0 +1,39 @@
+#include "interface.hpp"
+
+using namespace VOM;
+
+interface_dump::interface_dump()
+{
+}
+
+interface_dump::interface_dump(std::string interface_name)
+ : m_name(interface_name)
+{
+}
+
+rc_t
+interface_dump::issue(connection& con)
+{
+ m_dump.reset(new msg_t(con.ctx(), std::ref(*this)));
+
+ auto& payload = m_dump->get_request().get_payload();
+
+ if (m_name.empty()) {
+ payload.name_filter_valid = 0;
+ } else {
+ payload.name_filter_valid = 1;
+ strcpy((char*)payload.name_filter, m_name.c_str());
+ }
+
+ VAPI_CALL(m_dump->execute());
+
+ wait();
+
+ return rc_t::OK;
+}
+
+std::string
+interface_dump::to_string() const
+{
+ return ("itf-dump");
+}