diff options
author | Hanoh Haim <hhaim@cisco.com> | 2015-09-17 21:46:17 +0300 |
---|---|---|
committer | Hanoh Haim <hhaim@cisco.com> | 2015-09-17 21:46:17 +0300 |
commit | a78680a896f65dd6733d27d99e9cd8440eb185e9 (patch) | |
tree | d7b9e514b413847944e39eb1dcc874b4c9044c42 /src/stateless/trex_stream_api.h | |
parent | f885ac59cebcf1e87b97b0e6ef6e9eb032f9f733 (diff) | |
parent | f61bbcca4ab21100068887b1a08bf9bdf250f14d (diff) |
Merge branch 'master' of csi-sceasr-b45:/auto/proj-pcube-b/apps/PL-b/tools/repo//trex-corev1.76
Diffstat (limited to 'src/stateless/trex_stream_api.h')
-rw-r--r-- | src/stateless/trex_stream_api.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/stateless/trex_stream_api.h b/src/stateless/trex_stream_api.h index 26999751..d3c0fb29 100644 --- a/src/stateless/trex_stream_api.h +++ b/src/stateless/trex_stream_api.h @@ -26,6 +26,8 @@ limitations under the License. #include <stdint.h> #include <string> +#include <json/json.h> + #include <trex_stream_vm.h> class TrexRpcCmdAddStream; @@ -48,7 +50,13 @@ public: static const uint32_t MIN_PKT_SIZE_BYTES = 1; static const uint32_t MAX_PKT_SIZE_BYTES = 9000; -private: + /* provides storage for the stream json*/ + void store_stream_json(const Json::Value &stream_json); + + /* access the stream json */ + const Json::Value & get_stream_json(); + +protected: /* basic */ uint8_t m_port_id; uint32_t m_stream_id; @@ -82,6 +90,8 @@ private: } m_rx_check; + /* original template provided by requester */ + Json::Value m_stream_json; }; /** @@ -90,15 +100,15 @@ private: */ class TrexStreamContinuous : public TrexStream { public: - TrexStreamContinuous(uint8_t port_id, uint32_t stream_id, uint32_t pps) : TrexStream(port_id, stream_id), m_pps(pps) { + TrexStreamContinuous(uint8_t port_id, uint32_t stream_id, double pps) : TrexStream(port_id, stream_id), m_pps(pps) { } - uint32_t get_pps() { + double get_pps() { return m_pps; } protected: - uint32_t m_pps; + double m_pps; }; /** @@ -107,7 +117,7 @@ protected: */ class TrexStreamBurst : public TrexStream { public: - TrexStreamBurst(uint8_t port_id, uint32_t stream_id, uint32_t total_pkts, uint32_t pps) : + TrexStreamBurst(uint8_t port_id, uint32_t stream_id, uint32_t total_pkts, double pps) : TrexStream(port_id, stream_id), m_total_pkts(total_pkts), m_pps(pps) { @@ -115,7 +125,7 @@ public: protected: uint32_t m_total_pkts; - uint32_t m_pps; + double m_pps; }; /** @@ -127,7 +137,7 @@ public: TrexStreamMultiBurst(uint8_t port_id, uint32_t stream_id, uint32_t pkts_per_burst, - uint32_t pps, + double pps, uint32_t num_bursts, double ibg_usec) : TrexStreamBurst(port_id, stream_id, pkts_per_burst, pps), m_num_bursts(num_bursts), m_ibg_usec(ibg_usec) { |