diff options
author | 2015-11-16 21:02:43 +0200 | |
---|---|---|
committer | 2015-11-16 21:02:43 +0200 | |
commit | aa9bf54e6f892168482ed647a0e67ab10b1cf34a (patch) | |
tree | 679211e3d4bfbaba46e38970b0c49f768f69e188 /src/rpc-server/commands/trex_rpc_cmd_stream.cpp | |
parent | 3b8eb91e17f8f4647b4ba9a78ba485f5c490bfac (diff) | |
parent | d16ebf0b67ae8e339fd9367c313a786a8172b1b0 (diff) |
Merge from master
Diffstat (limited to 'src/rpc-server/commands/trex_rpc_cmd_stream.cpp')
-rw-r--r-- | src/rpc-server/commands/trex_rpc_cmd_stream.cpp | 13 |
1 files changed, 9 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 e32073b0..cdd13ed6 100644 --- a/src/rpc-server/commands/trex_rpc_cmd_stream.cpp +++ b/src/rpc-server/commands/trex_rpc_cmd_stream.cpp @@ -143,6 +143,10 @@ TrexRpcCmdAddStream::allocate_new_stream(const Json::Value §ion, uint8_t por stream = new TrexStream( TrexStream::stCONTINUOUS, port_id, stream_id); stream->set_pps(pps); + if (stream->m_next_stream_id != -1) { + generate_parse_err(result, "continious stream cannot provide next stream id - only -1 is valid"); + } + } else if (type == "single_burst") { uint32_t total_pkts = parse_int(mode, "total_pkts", result); @@ -150,7 +154,7 @@ TrexRpcCmdAddStream::allocate_new_stream(const Json::Value §ion, uint8_t por stream = new TrexStream(TrexStream::stSINGLE_BURST,port_id, stream_id); stream->set_pps(pps); - stream->set_signle_burtst(total_pkts); + stream->set_single_burst(total_pkts); } else if (type == "multi_burst") { @@ -458,8 +462,9 @@ TrexRpcCmdGetStream::_run(const Json::Value ¶ms, Json::Value &result) { trex_rpc_cmd_rc_e TrexRpcCmdStartTraffic::_run(const Json::Value ¶ms, Json::Value &result) { - uint8_t port_id = parse_byte(params, "port_id", result); - double mul = parse_double(params, "mul", result); + uint8_t port_id = parse_byte(params, "port_id", result); + double mul = parse_double(params, "mul", result); + double duration = parse_double(params, "duration", result); if (port_id >= get_stateless_obj()->get_port_count()) { std::stringstream ss; @@ -470,7 +475,7 @@ TrexRpcCmdStartTraffic::_run(const Json::Value ¶ms, Json::Value &result) { TrexStatelessPort *port = get_stateless_obj()->get_port_by_id(port_id); try { - port->start_traffic(mul); + port->start_traffic(mul, duration); } catch (const TrexRpcException &ex) { generate_execute_err(result, ex.what()); } |