summaryrefslogtreecommitdiffstats
path: root/src/rpc-server
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2017-01-25 13:54:51 +0200
committerimarom <imarom@cisco.com>2017-01-25 13:54:51 +0200
commit3689edf311778c8cb921db61f293db6cd43a9b14 (patch)
treecf683e96d5de5cd1218060d6630f97c4052e1b62 /src/rpc-server
parent19df06349d311377ca1ef10f91ef1f786b41418b (diff)
capture - personal code review
Signed-off-by: imarom <imarom@cisco.com>
Diffstat (limited to 'src/rpc-server')
-rw-r--r--src/rpc-server/commands/trex_rpc_cmd_general.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/rpc-server/commands/trex_rpc_cmd_general.cpp b/src/rpc-server/commands/trex_rpc_cmd_general.cpp
index c20c77d4..54798abb 100644
--- a/src/rpc-server/commands/trex_rpc_cmd_general.cpp
+++ b/src/rpc-server/commands/trex_rpc_cmd_general.cpp
@@ -892,6 +892,12 @@ void
TrexRpcCmdCapture::parse_cmd_start(const Json::Value &params, Json::Value &result) {
uint32_t limit = parse_uint32(params, "limit", result);
+
+ /* parse mode type */
+ const std::string mode_str = parse_choice(params, "mode", {"fixed", "cyclic"}, result);
+ TrexPktBuffer::mode_e mode = ( (mode_str == "fixed") ? TrexPktBuffer::MODE_DROP_TAIL : TrexPktBuffer::MODE_DROP_HEAD);
+
+ /* parse filters */
const Json::Value &tx_json = parse_array(params, "tx", result);
const Json::Value &rx_json = parse_array(params, "rx", result);
CaptureFilter filter;
@@ -927,7 +933,7 @@ TrexRpcCmdCapture::parse_cmd_start(const Json::Value &params, Json::Value &resul
reply.reset();
/* send a start message to RX core */
- TrexStatelessRxCaptureStart *start_msg = new TrexStatelessRxCaptureStart(filter, limit, reply);
+ TrexStatelessRxCaptureStart *start_msg = new TrexStatelessRxCaptureStart(filter, limit, mode, reply);
get_stateless_obj()->send_msg_to_rx(start_msg);
TrexCaptureRCStart rc = reply.wait_for_reply();