summaryrefslogtreecommitdiffstats
path: root/src/rpc-server/commands/trex_rpc_cmd_stream.cpp
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2015-09-01 15:14:27 +0300
committerimarom <imarom@cisco.com>2015-09-01 15:14:27 +0300
commit166e1b639a8cb3d95a6ebae325a4156c6df6c595 (patch)
tree28add5311782054d5977db4f1826652fb25a5344 /src/rpc-server/commands/trex_rpc_cmd_stream.cpp
parent580a81e3476d2f316fa263adceb136a178fb5f1a (diff)
draft
Diffstat (limited to 'src/rpc-server/commands/trex_rpc_cmd_stream.cpp')
-rw-r--r--src/rpc-server/commands/trex_rpc_cmd_stream.cpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/rpc-server/commands/trex_rpc_cmd_stream.cpp b/src/rpc-server/commands/trex_rpc_cmd_stream.cpp
index 25dee501..57fa23d4 100644
--- a/src/rpc-server/commands/trex_rpc_cmd_stream.cpp
+++ b/src/rpc-server/commands/trex_rpc_cmd_stream.cpp
@@ -41,14 +41,17 @@ TrexRpcCmdAddStream::_run(const Json::Value &params, Json::Value &result) {
const Json::Value &mode = parse_object(section, "mode", result);
string type = parse_string(mode, "type", result);
+ /* allocate a new stream based on the type */
TrexStream *stream = allocate_new_stream(section, result);
- /* create a new steram and populate it */
-
+ /* some fields */
+ stream->m_enabled = parse_bool(section, "enabled", result);
+ stream->m_self_start = parse_bool(section, "self_start", result);
+
+ /* inter stream gap */
stream->m_isg_usec = parse_double(section, "Is", result);
stream->m_next_stream_id = parse_int(section, "next_stream_id", result);
- stream->m_loop_count = parse_int(section, "loop_count", result);
const Json::Value &pkt = parse_array(section, "packet", result);
@@ -95,19 +98,19 @@ TrexRpcCmdAddStream::allocate_new_stream(const Json::Value &section, Json::Value
} else if (type == "single_burst") {
- uint32_t pps = parse_int(mode, "pps", result);
- uint32_t packets = parse_int(type, "packets", result);
+ uint32_t total_pkts = parse_int(mode, "total_pkts", result);
+ uint32_t pps = parse_int(mode, "pps", result);
- stream = new TrexStreamSingleBurst(port_id, stream_id, pps, packets);
+ stream = new TrexStreamBurst(port_id, stream_id, total_pkts, pps);
} else if (type == "multi_burst") {
- uint32_t pps = parse_int(mode, "pps", result);
- double ibg_usec = parse_double(mode, "ibg", result);
- uint32_t num_bursts = parse_int(mode, "number_of_bursts", result);
- uint32_t pkt_per_burst = parse_int(mode, "pkt_per_burst", result);
+ uint32_t pps = parse_int(mode, "pps", result);
+ double ibg_usec = parse_double(mode, "ibg", result);
+ 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, pps, ibg_usec, num_bursts, pkt_per_burst);
+ stream = new TrexStreamMultiBurst(port_id, stream_id, pkts_per_burst, pps, num_bursts, ibg_usec);
} else {