diff options
author | imarom <imarom@cisco.com> | 2015-10-28 12:45:57 +0200 |
---|---|---|
committer | imarom <imarom@cisco.com> | 2015-10-28 12:45:57 +0200 |
commit | cb8bc9bda11c951b8b91a635d8d4d6df8d5a0ab8 (patch) | |
tree | cf63a7ec23094b48bcf59e5c0d95aa6d6aeb4e26 /src/stateless/messaging | |
parent | ea0b6efc3a41f425e46d81f4b6b8bbbf3238add1 (diff) |
support for multiple streams
Diffstat (limited to 'src/stateless/messaging')
-rw-r--r-- | src/stateless/messaging/trex_stateless_messaging.cpp | 17 | ||||
-rw-r--r-- | src/stateless/messaging/trex_stateless_messaging.h | 15 |
2 files changed, 8 insertions, 24 deletions
diff --git a/src/stateless/messaging/trex_stateless_messaging.cpp b/src/stateless/messaging/trex_stateless_messaging.cpp index 4cd5b416..4ef508fc 100644 --- a/src/stateless/messaging/trex_stateless_messaging.cpp +++ b/src/stateless/messaging/trex_stateless_messaging.cpp @@ -20,32 +20,25 @@ limitations under the License. */ #include <trex_stateless_messaging.h> #include <trex_stateless_dp_core.h> +#include <trex_stream.h> #include <string.h> /************************* start traffic message ************************/ -TrexStatelessDpStart::TrexStatelessDpStart(const uint8_t *pkt, uint16_t pkt_len, double pps) { - assert(pkt); - assert(pkt_len > 0); - - m_pkt = new uint8_t[pkt_len]; - memcpy(m_pkt, pkt, pkt_len); - m_pkt_len = pkt_len; - - m_pps = pps; +TrexStatelessDpStart::TrexStatelessDpStart(TrexStreamsCompiledObj *obj) : m_obj(obj) { } TrexStatelessDpStart::~TrexStatelessDpStart() { - if (m_pkt) { - delete m_pkt; + if (m_obj) { + delete m_obj; } } bool TrexStatelessDpStart::handle(TrexStatelessDpCore *dp_core) { - dp_core->start_const_traffic(m_pkt, m_pkt_len, m_pps); + dp_core->start_traffic(m_obj); return true; } diff --git a/src/stateless/messaging/trex_stateless_messaging.h b/src/stateless/messaging/trex_stateless_messaging.h index af05aa4c..13f6c05a 100644 --- a/src/stateless/messaging/trex_stateless_messaging.h +++ b/src/stateless/messaging/trex_stateless_messaging.h @@ -24,6 +24,7 @@ limitations under the License. #include <msg_manager.h> class TrexStatelessDpCore; +class TrexStreamsCompiledObj; /** * defines the base class for CP to DP messages @@ -54,24 +55,14 @@ public: class TrexStatelessDpStart : public TrexStatelessCpToDpMsgBase { public: - TrexStatelessDpStart(const uint8_t *pkt, uint16_t pkt_len, double pps); + TrexStatelessDpStart(TrexStreamsCompiledObj *obj); ~TrexStatelessDpStart(); - const uint8_t * get_pkt() { - return m_pkt; - } - - uint16_t get_pkt_len() { - return m_pkt_len; - } - virtual bool handle(TrexStatelessDpCore *dp_core); private: - uint8_t *m_pkt; - uint16_t m_pkt_len; - double m_pps; + TrexStreamsCompiledObj *m_obj; }; /** |