summaryrefslogtreecommitdiffstats
path: root/src/rpc-server
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2016-02-16 16:08:23 +0200
committerHanoh Haim <hhaim@cisco.com>2016-02-16 16:08:23 +0200
commit47c865838678444c0075aab94267972a3a3cbfff (patch)
tree3551714c2b6e2f3c71374754732ab0e01c7d83f1 /src/rpc-server
parent75c84998813a359cb8619e80507e04f21d71de89 (diff)
step instruction support
Diffstat (limited to 'src/rpc-server')
-rw-r--r--src/rpc-server/commands/trex_rpc_cmd_stream.cpp11
1 files changed, 7 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 0262fd7c..508967b9 100644
--- a/src/rpc-server/commands/trex_rpc_cmd_stream.cpp
+++ b/src/rpc-server/commands/trex_rpc_cmd_stream.cpp
@@ -249,6 +249,7 @@ TrexRpcCmdAddStream::parse_vm_instr_flow_var(const Json::Value &inst, TrexStream
uint64_t init_value = parse_uint64(inst, "init_value", result);
uint64_t min_value = parse_uint64(inst, "min_value", result);
uint64_t max_value = parse_uint64(inst, "max_value", result);
+ uint64_t step = parse_uint64(inst, "step", result);
if (max_value < min_value ) {
std::stringstream ss;
@@ -257,7 +258,7 @@ TrexRpcCmdAddStream::parse_vm_instr_flow_var(const Json::Value &inst, TrexStream
}
if (flow_var_size == 1 ) {
- if ( (init_value > UINT8_MAX) || (min_value > UINT8_MAX) || (max_value > UINT8_MAX)) {
+ if ( (init_value > UINT8_MAX) || (min_value > UINT8_MAX) || (max_value > UINT8_MAX) || (step >UINT8_MAX) ) {
std::stringstream ss;
ss << "VM: request val is bigger than " << UINT8_MAX;
generate_parse_err(result, ss.str());
@@ -265,7 +266,7 @@ TrexRpcCmdAddStream::parse_vm_instr_flow_var(const Json::Value &inst, TrexStream
}
if (flow_var_size == 2 ) {
- if ( (init_value > UINT16_MAX) || (min_value > UINT16_MAX) || (max_value > UINT16_MAX)) {
+ if ( (init_value > UINT16_MAX) || (min_value > UINT16_MAX) || (max_value > UINT16_MAX) || (step > UINT16_MAX) ) {
std::stringstream ss;
ss << "VM: request val is bigger than " << UINT16_MAX;
generate_parse_err(result, ss.str());
@@ -273,7 +274,7 @@ TrexRpcCmdAddStream::parse_vm_instr_flow_var(const Json::Value &inst, TrexStream
}
if (flow_var_size == 4 ) {
- if ( (init_value > UINT32_MAX) || (min_value > UINT32_MAX) || (max_value > UINT32_MAX)) {
+ if ( (init_value > UINT32_MAX) || (min_value > UINT32_MAX) || (max_value > UINT32_MAX) || (step > UINT32_MAX) ) {
std::stringstream ss;
ss << "VM: request val is bigger than " << UINT32_MAX;
generate_parse_err(result, ss.str());
@@ -286,7 +287,9 @@ TrexRpcCmdAddStream::parse_vm_instr_flow_var(const Json::Value &inst, TrexStream
op_type,
init_value,
min_value,
- max_value));
+ max_value,
+ step)
+ );
}
void