summaryrefslogtreecommitdiffstats
path: root/src/stateless/trex_stateless.cpp
diff options
context:
space:
mode:
authorDan Klein <danklei@cisco.com>2015-10-06 02:40:42 +0300
committerDan Klein <danklei@cisco.com>2015-10-06 02:42:15 +0300
commit54fb5cd69e0166073acac1eec08bd29341dbd6be (patch)
treed49cee17f20d7013771a3570890a07c4c4859faf /src/stateless/trex_stateless.cpp
parent25c528e867b13d8ddaee19f208ddedd8a2e505ca (diff)
parentddad1117a1bdc616eb1a5fc4e4e5ef2b8dcf6938 (diff)
Merge branch 'master' into dan_stateless
Diffstat (limited to 'src/stateless/trex_stateless.cpp')
-rw-r--r--src/stateless/trex_stateless.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/stateless/trex_stateless.cpp b/src/stateless/trex_stateless.cpp
index 6a3169d4..0eb96f05 100644
--- a/src/stateless/trex_stateless.cpp
+++ b/src/stateless/trex_stateless.cpp
@@ -80,6 +80,7 @@ uint8_t TrexStateless::get_port_count() {
TrexStatelessPort::TrexStatelessPort(uint8_t port_id) : m_port_id(port_id) {
m_port_state = PORT_STATE_UP_IDLE;
clear_owner();
+ m_stats = {0};
}
@@ -121,12 +122,30 @@ TrexStreamTable * TrexStatelessPort::get_stream_table() {
return &m_stream_table;
}
+
+std::string
+TrexStatelessPort::get_state_as_string() {
+
+ switch (get_state()) {
+ case PORT_STATE_DOWN:
+ return "down";
+
+ case PORT_STATE_UP_IDLE:
+ return "idle";
+
+ case PORT_STATE_TRANSMITTING:
+ return "transmitting";
+ }
+
+ return "unknown";
+}
+
void
TrexStatelessPort::get_properties(string &driver, string &speed) {
/* take this from DPDK */
- driver = "Unknown Driver";
- speed = "Unknown Speed";
+ driver = "e1000";
+ speed = "1 Gbps";
}