summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/publisher/trex_publisher.h6
-rw-r--r--src/stateless/cp/trex_stateless_port.cpp9
2 files changed, 12 insertions, 3 deletions
diff --git a/src/publisher/trex_publisher.h b/src/publisher/trex_publisher.h
index 89336735..8d1be064 100644
--- a/src/publisher/trex_publisher.h
+++ b/src/publisher/trex_publisher.h
@@ -39,8 +39,10 @@ public:
void publish_json(const std::string &s);
enum event_type_e {
- EVENT_PORT_STOPPED = 0,
- EVENT_SERVER_STOPPED = 1
+ EVENT_PORT_STARTED = 0,
+ EVENT_PORT_STOPPED = 1,
+ EVENT_SERVER_STOPPED = 2,
+ EVENT_PORT_FINISHED_TX = 3,
};
void publish_event(event_type_e type, const Json::Value &data = Json::nullValue);
diff --git a/src/stateless/cp/trex_stateless_port.cpp b/src/stateless/cp/trex_stateless_port.cpp
index 5f1a3bca..2fd948fd 100644
--- a/src/stateless/cp/trex_stateless_port.cpp
+++ b/src/stateless/cp/trex_stateless_port.cpp
@@ -139,6 +139,9 @@ TrexStatelessPort::start_traffic(double mul, double duration) {
send_message_to_dp(start_msg);
+ Json::Value data;
+ data["port_id"] = m_port_id;
+ get_stateless_obj()->get_publisher()->publish_event(TrexPublisher::EVENT_PORT_STARTED, data);
}
void
@@ -194,6 +197,10 @@ TrexStatelessPort::stop_traffic(void) {
change_state(PORT_STATE_STREAMS);
+ Json::Value data;
+ data["port_id"] = m_port_id;
+ get_stateless_obj()->get_publisher()->publish_event(TrexPublisher::EVENT_PORT_STOPPED, data);
+
}
void
@@ -366,7 +373,7 @@ TrexStatelessPort::on_dp_event_occured(TrexDpPortEvent::event_e event_type) {
/* send a ZMQ event */
data["port_id"] = m_port_id;
- get_stateless_obj()->get_publisher()->publish_event(TrexPublisher::EVENT_PORT_STOPPED, data);
+ get_stateless_obj()->get_publisher()->publish_event(TrexPublisher::EVENT_PORT_FINISHED_TX, data);
break;
default: