summaryrefslogtreecommitdiffstats
path: root/src/rpc-server/trex_rpc_cmd.cpp
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2015-12-15 11:40:35 -0500
committerimarom <imarom@cisco.com>2015-12-15 11:40:35 -0500
commit68bf754b96a84c8a2a32bffab30189f8c8e9ad1b (patch)
tree03ed30251c1cc611d888bf62d5c4a8d36566dfd7 /src/rpc-server/trex_rpc_cmd.cpp
parent419a25e989c47dcc5e94b9e3bc64252fb5197f10 (diff)
parent7b1796d823b38f7c8c801e19c51a4044bc39b17c (diff)
Merging lastest 'master' to side branch 'vm'
Conflicts: scripts/automation/trex_control_plane/console/trex_console.py
Diffstat (limited to 'src/rpc-server/trex_rpc_cmd.cpp')
-rw-r--r--src/rpc-server/trex_rpc_cmd.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/rpc-server/trex_rpc_cmd.cpp b/src/rpc-server/trex_rpc_cmd.cpp
index fb31fa9d..b5dd121c 100644
--- a/src/rpc-server/trex_rpc_cmd.cpp
+++ b/src/rpc-server/trex_rpc_cmd.cpp
@@ -217,12 +217,24 @@ TrexRpcCommand::parse_string(const Json::Value &parent, const std::string &name,
return parent[name].asString();
}
+/**
+ * object version
+ */
const Json::Value &
TrexRpcCommand::parse_object(const Json::Value &parent, const std::string &name, Json::Value &result) {
check_field_type(parent, name, FIELD_TYPE_OBJ, result);
return parent[name];
}
+/**
+ * index version
+ */
+const Json::Value &
+TrexRpcCommand::parse_object(const Json::Value &parent, int index, Json::Value &result) {
+ check_field_type(parent, index, FIELD_TYPE_OBJ, result);
+ return parent[index];
+}
+
const Json::Value &
TrexRpcCommand::parse_array(const Json::Value &parent, const std::string &name, Json::Value &result) {
check_field_type(parent, name, FIELD_TYPE_ARRAY, result);