summaryrefslogtreecommitdiffstats
path: root/src/rpc-server/trex_rpc_cmd.cpp
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2015-12-15 11:24:07 -0500
committerimarom <imarom@cisco.com>2015-12-15 11:36:46 -0500
commit419a25e989c47dcc5e94b9e3bc64252fb5197f10 (patch)
tree3224bdb70b648e3cbe9f26c429dee74d5d50aed2 /src/rpc-server/trex_rpc_cmd.cpp
parent96314dfde866a6b866464c9a91331a266ea137bc (diff)
VM: connected control plane to DP
Diffstat (limited to 'src/rpc-server/trex_rpc_cmd.cpp')
-rw-r--r--src/rpc-server/trex_rpc_cmd.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/rpc-server/trex_rpc_cmd.cpp b/src/rpc-server/trex_rpc_cmd.cpp
index d4eef1f7..fb31fa9d 100644
--- a/src/rpc-server/trex_rpc_cmd.cpp
+++ b/src/rpc-server/trex_rpc_cmd.cpp
@@ -98,6 +98,8 @@ TrexRpcCommand::type_to_str(field_type_e type) {
return "uint16";
case FIELD_TYPE_UINT32:
return "uint32";
+ case FIELD_TYPE_UINT64:
+ return "uint64";
case FIELD_TYPE_BOOL:
return "bool";
case FIELD_TYPE_INT:
@@ -179,6 +181,18 @@ TrexRpcCommand::parse_uint32(const Json::Value &parent, int index, Json::Value &
return parent[index].asUInt();
}
+uint64_t
+TrexRpcCommand::parse_uint64(const Json::Value &parent, const std::string &name, Json::Value &result) {
+ check_field_type(parent, name, FIELD_TYPE_UINT64, result);
+ return parent[name].asUInt64();
+}
+
+uint64_t
+TrexRpcCommand::parse_uint64(const Json::Value &parent, int index, Json::Value &result) {
+ check_field_type(parent, index, FIELD_TYPE_UINT64, result);
+ return parent[index].asUInt64();
+}
+
int
TrexRpcCommand::parse_int(const Json::Value &parent, const std::string &name, Json::Value &result) {
check_field_type(parent, name, FIELD_TYPE_INT, result);
@@ -274,6 +288,12 @@ TrexRpcCommand::check_field_type_common(const Json::Value &field, const std::str
}
break;
+ case FIELD_TYPE_UINT64:
+ if (!field.isInt64()) {
+ rc = false;
+ }
+ break;
+
case FIELD_TYPE_BOOL:
if (!field.isBool()) {
rc = false;