summaryrefslogtreecommitdiffstats
path: root/src/rpc-server/commands/trex_rpc_cmd_general.cpp
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-12-19 08:52:08 +0200
committerimarom <imarom@cisco.com>2016-12-19 08:52:37 +0200
commitf51c210af7b067a36e6750d94b48ae366a48dd5c (patch)
tree4d72169f38e0dc4a91dda8a678aa67ca1cf112c9 /src/rpc-server/commands/trex_rpc_cmd_general.cpp
parent3859a48b255bf4254f7897b5525a330a856bfad4 (diff)
verify L2/L3 configuration cannot be done under traffic
also ping and arp Signed-off-by: imarom <imarom@cisco.com>
Diffstat (limited to 'src/rpc-server/commands/trex_rpc_cmd_general.cpp')
-rw-r--r--src/rpc-server/commands/trex_rpc_cmd_general.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/rpc-server/commands/trex_rpc_cmd_general.cpp b/src/rpc-server/commands/trex_rpc_cmd_general.cpp
index c8b4841a..f936f946 100644
--- a/src/rpc-server/commands/trex_rpc_cmd_general.cpp
+++ b/src/rpc-server/commands/trex_rpc_cmd_general.cpp
@@ -799,7 +799,11 @@ TrexRpcCmdSetL2::_run(const Json::Value &params, Json::Value &result) {
generate_parse_err(result, ss.str());
}
- port->set_l2_mode(dst_mac);
+ try {
+ port->set_l2_mode(dst_mac);
+ } catch (const TrexException &ex) {
+ generate_execute_err(result, ex.what());
+ }
return (TREX_RPC_CMD_OK);
}
@@ -844,11 +848,19 @@ TrexRpcCmdSetL3::_run(const Json::Value &params, Json::Value &result) {
generate_parse_err(result, ss.str());
}
- port->set_l3_mode(src_ipv4, dst_ipv4, mac);
+ try {
+ port->set_l3_mode(src_ipv4, dst_ipv4, mac);
+ } catch (const TrexException &ex) {
+ generate_execute_err(result, ex.what());
+ }
} else {
+ try {
+ port->set_l3_mode(src_ipv4, dst_ipv4);
+ } catch (const TrexException &ex) {
+ generate_execute_err(result, ex.what());
+ }
- port->set_l3_mode(src_ipv4, dst_ipv4);
}
return (TREX_RPC_CMD_OK);