本文整理汇总了C++中TrexStatelessPort::push_remote方法的典型用法代码示例。如果您正苦于以下问题:C++ TrexStatelessPort::push_remote方法的具体用法?C++ TrexStatelessPort::push_remote怎么用?C++ TrexStatelessPort::push_remote使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TrexStatelessPort
的用法示例。
在下文中一共展示了TrexStatelessPort::push_remote方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: catch
/**
* push a remote PCAP on a port
*
*/
trex_rpc_cmd_rc_e
TrexRpcCmdPushRemote::_run(const Json::Value ¶ms, Json::Value &result) {
uint8_t port_id = parse_port(params, result);
std::string pcap_filename = parse_string(params, "pcap_filename", result);
double ipg_usec = parse_double(params, "ipg_usec", result);
double speedup = parse_double(params, "speedup", result);
uint32_t count = parse_uint32(params, "count", result);
double duration = parse_double(params, "duration", result);
bool is_dual = parse_bool(params, "is_dual", result, false);
std::string slave_handler = parse_string(params, "slave_handler", result, "");
TrexStatelessPort *port = get_stateless_obj()->get_port_by_id(port_id);
/* for dual mode - make sure slave_handler matches */
if (is_dual) {
TrexStatelessPort *slave = get_stateless_obj()->get_port_by_id(port_id ^ 0x1);
if (!slave->get_owner().verify(slave_handler)) {
generate_execute_err(result, "incorrect or missing slave port handler");
}
}
try {
port->push_remote(pcap_filename, ipg_usec, speedup, count, duration, is_dual);
} catch (const TrexException &ex) {
generate_execute_err(result, ex.what());
}
result["result"] = Json::objectValue;
return (TREX_RPC_CMD_OK);
}