summaryrefslogtreecommitdiffstats
path: root/src/rpc-server/commands
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2015-11-12 15:33:30 +0200
committerHanoh Haim <hhaim@cisco.com>2015-11-12 15:33:30 +0200
commit45b71cff9d0465b77f82e4cd40b64a9f3183c1c7 (patch)
tree131242205381140fffeab0e7c2e05618efcc39ce /src/rpc-server/commands
parent12aa72196b6ccac1b335fa7f06e9351c28c79158 (diff)
refactor stream object
Diffstat (limited to 'src/rpc-server/commands')
-rw-r--r--src/rpc-server/commands/trex_rpc_cmd_stream.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/rpc-server/commands/trex_rpc_cmd_stream.cpp b/src/rpc-server/commands/trex_rpc_cmd_stream.cpp
index fffc800a..e32073b0 100644
--- a/src/rpc-server/commands/trex_rpc_cmd_stream.cpp
+++ b/src/rpc-server/commands/trex_rpc_cmd_stream.cpp
@@ -140,14 +140,18 @@ TrexRpcCmdAddStream::allocate_new_stream(const Json::Value &section, uint8_t por
if (type == "continuous") {
double pps = parse_double(mode, "pps", result);
- stream = new TrexStreamContinuous(port_id, stream_id, pps);
+ stream = new TrexStream( TrexStream::stCONTINUOUS, port_id, stream_id);
+ stream->set_pps(pps);
} else if (type == "single_burst") {
uint32_t total_pkts = parse_int(mode, "total_pkts", result);
double pps = parse_double(mode, "pps", result);
- stream = new TrexStreamBurst(port_id, stream_id, total_pkts, pps);
+ stream = new TrexStream(TrexStream::stSINGLE_BURST,port_id, stream_id);
+ stream->set_pps(pps);
+ stream->set_signle_burtst(total_pkts);
+
} else if (type == "multi_burst") {
@@ -156,8 +160,10 @@ TrexRpcCmdAddStream::allocate_new_stream(const Json::Value &section, uint8_t por
uint32_t num_bursts = parse_int(mode, "number_of_bursts", result);
uint32_t pkts_per_burst = parse_int(mode, "pkts_per_burst", result);
- stream = new TrexStreamMultiBurst(port_id, stream_id, pkts_per_burst, pps, num_bursts, ibg_usec);
-
+ stream = new TrexStream(TrexStream::stMULTI_BURST,port_id, stream_id );
+ stream->set_pps(pps);
+ stream->set_multi_burst(pkts_per_burst,num_bursts,ibg_usec);
+
} else {
generate_parse_err(result, "bad stream type provided: '" + type + "'");