diff options
Diffstat (limited to 'apps/hiperf')
-rw-r--r-- | apps/hiperf/src/client.cc | 30 | ||||
-rw-r--r-- | apps/hiperf/src/common.h | 8 | ||||
-rw-r--r-- | apps/hiperf/src/main.cc | 43 |
3 files changed, 47 insertions, 34 deletions
diff --git a/apps/hiperf/src/client.cc b/apps/hiperf/src/client.cc index 319fa82ab..ba36cd20e 100644 --- a/apps/hiperf/src/client.cc +++ b/apps/hiperf/src/client.cc @@ -696,8 +696,11 @@ class HIperfClient::Impl : ForwarderInterface::ICallback { configuration_.interest_lifetime_); consumer_socket_->setSocketOption( - GeneralTransportOptions::MAX_UNVERIFIED_TIME, - configuration_.unverified_delay_); + GeneralTransportOptions::UNVERIFIED_INTERVAL, + configuration_.unverified_interval_); + + consumer_socket_->setSocketOption(GeneralTransportOptions::UNVERIFIED_RATIO, + configuration_.unverified_ratio_); if (consumer_socket_->setSocketOption( GeneralTransportOptions::PACKET_FORMAT, @@ -715,6 +718,20 @@ class HIperfClient::Impl : ForwarderInterface::ICallback { std::cout << "Signal SIGUSR1!" << std::endl; mtrace(); }); + + ret = consumer_socket_->setSocketOption( + ConsumerCallbacksOptions::FWD_STRATEGY_CHANGE, + [this](notification::Strategy strategy) { + std::cout << "Forwarder strategy callback" << std::endl; + }); + if (ret == SOCKET_OPTION_NOT_SET) return ERROR_SETUP; + + ret = consumer_socket_->setSocketOption( + ConsumerCallbacksOptions::REC_STRATEGY_CHANGE, + [this](notification::Strategy strategy) { + std::cout << "Recovery strategy callback" << std::endl; + }); + if (ret == SOCKET_OPTION_NOT_SET) return ERROR_SETUP; #endif if (consumer_socket_->setSocketOption(CURRENT_WINDOW_SIZE, @@ -856,15 +873,6 @@ class HIperfClient::Impl : ForwarderInterface::ICallback { } if (configuration_.rtc_) { - ret = consumer_socket_->setSocketOption(GeneralTransportOptions::FEC_TYPE, - configuration_.fec_type_); - - if (ret == SOCKET_OPTION_NOT_SET) { - return ERROR_SETUP; - } - } - - if (configuration_.rtc_) { std::shared_ptr<TransportStatistics> transport_stats; consumer_socket_->getSocketOption( OtherOptions::STATISTICS, (TransportStatistics **)&transport_stats); diff --git a/apps/hiperf/src/common.h b/apps/hiperf/src/common.h index 13c9dcc1d..3a90f3732 100644 --- a/apps/hiperf/src/common.h +++ b/apps/hiperf/src/common.h @@ -180,13 +180,13 @@ struct ClientConfiguration { secure_(false), producer_prefix_(), interest_lifetime_(500), - unverified_delay_(2000), + unverified_interval_(10000), + unverified_ratio_(0.2), relay_name_("c001::abcd/64"), output_stream_mode_(false), port_(0), recovery_strategy_(4), aggregated_data_(false), - fec_type_(""), packet_format_(default_values::packet_format), print_headers_(true), nb_iterations_(std::numeric_limits<decltype(nb_iterations_)>::max()) {} @@ -208,13 +208,13 @@ struct ClientConfiguration { bool secure_; Prefix producer_prefix_; uint32_t interest_lifetime_; - uint32_t unverified_delay_; + uint32_t unverified_interval_; + double unverified_ratio_; Prefix relay_name_; bool output_stream_mode_; uint16_t port_; uint32_t recovery_strategy_; bool aggregated_data_; - std::string fec_type_; Packet::Format packet_format_; bool print_headers_; std::uint32_t nb_iterations_; diff --git a/apps/hiperf/src/main.cc b/apps/hiperf/src/main.cc index b69392de8..9c0f0a140 100644 --- a/apps/hiperf/src/main.cc +++ b/apps/hiperf/src/main.cc @@ -146,7 +146,7 @@ void usage() { std::cerr << "-g\t<port>\t\t\t\t" << "Output stream to localhost at the specified port" << std::endl; std::cerr << "-e\t<strategy>\t\t\t" - << "Enance the network with a realiability strategy. Options 1:" + << "Enhance the network with a reliability strategy. Options 1:" << " unreliable, 2: rtx only, 3: fec only, " << "4: delay based, 5: low rate, 6: low rate and best path " << "7: low rate and replication, 8: low rate and best" @@ -187,9 +187,10 @@ int main(int argc, char *argv[]) { int opt; #ifndef _WIN32 + // Please keep in alphabetical order. while ((opt = getopt(argc, argv, - "DSCf:b:d:W:RM:c:vA:s:rm:lK:k:y:p:hi:xE:P:B:ItL:z:T:F:j:" - "g:G:e:awHn:X:u:")) != -1) { + "A:B:CDE:F:G:HIK:L:M:P:RST:U:W:X:ab:c:d:e:f:g:hi:j:k:lm:" + "n:p:rs:tu:vwxy:z:")) != -1) { switch (opt) { // Common case 'D': { @@ -222,11 +223,10 @@ int main(int argc, char *argv[]) { break; } #else - while ( - (opt = getopt( - argc, argv, - "SCf:b:d:W:RM:c:vA:s:rm:lK:k:y:p:hi:xB:E:P:tL:z:F:j:e:awHn:X:u:")) != - -1) { + // Please keep in alphabetical order. + while ((opt = getopt(argc, argv, + "A:B:CE:F:HK:L:M:P:RSU:W:X:ab:c:d:e:f:hi:j:k:lm:n:p:rs:" + "tu:vwxy:z:")) != -1) { switch (opt) { #endif case 'f': { @@ -243,16 +243,16 @@ int main(int argc, char *argv[]) { server_configuration.aggregated_data_ = true; break; } - case 'X': { - client_configuration.fec_type_ = std::string(optarg); - server_configuration.fec_type_ = std::string(optarg); - break; - } case 'w': { client_configuration.packet_format_ = Packet::Format::HF_INET6_UDP; server_configuration.packet_format_ = Packet::Format::HF_INET6_UDP; break; } + case 'k': { + server_configuration.passphrase = std::string(optarg); + client_configuration.passphrase = std::string(optarg); + break; + } case 'z': { config.name = optarg; break; @@ -271,11 +271,6 @@ int main(int argc, char *argv[]) { role += 1; break; } - case 'k': { - server_configuration.passphrase = std::string(optarg); - client_configuration.passphrase = std::string(optarg); - break; - } // Client specifc case 'b': { @@ -324,7 +319,12 @@ int main(int argc, char *argv[]) { break; } case 'u': { - client_configuration.unverified_delay_ = std::stoul(optarg); + client_configuration.unverified_interval_ = std::stoul(optarg); + options = 1; + break; + } + case 'U': { + client_configuration.unverified_ratio_ = std::stod(optarg); options = 1; break; } @@ -419,6 +419,11 @@ int main(int argc, char *argv[]) { options = 1; break; } + case 'X': { + server_configuration.fec_type_ = std::string(optarg); + options = -1; + break; + } case 'h': default: usage(); |