From d90f9549a45276f435c1b3617d57993a1e546b64 Mon Sep 17 00:00:00 2001 From: david Date: Fri, 3 May 2013 17:54:57 +0000 Subject: [PATCH] Remove unused/unimplemented host_timeout feature --- nping/ArgParser.cc | 8 -------- nping/NpingOps.cc | 32 -------------------------------- nping/NpingOps.h | 3 --- 3 files changed, 43 deletions(-) diff --git a/nping/ArgParser.cc b/nping/ArgParser.cc index b4a513a78..838d48c96 100644 --- a/nping/ArgParser.cc +++ b/nping/ArgParser.cc @@ -254,7 +254,6 @@ int ArgParser::parseArguments(int argc, char *argv[]) { /* Timing and performance */ {"delay", required_argument, 0, 0}, {"rate", required_argument, 0, 0}, - {"host-timeout", required_argument, 0, 0}, /* Misc */ {"help", no_argument, 0, 'h'}, @@ -922,13 +921,6 @@ int ArgParser::parseArguments(int argc, char *argv[]) { }else{ nping_fatal(QT_3,"Invalid rate supplied. Rate must be a valid, positive integer"); } - /* Host timeout */ - } else if (optcmp(long_options[option_index].name, "host-timeout") == 0 ){ - l = tval2msecs(optarg); - if (l >= 10000 * 1000 && tval_unit(optarg) == NULL) - nping_fatal(QT_3,"Since April 2010, the default unit for --host-timeout is seconds, so your time of \"%s\" is %.1f hours. Use \"%sms\" for %g milliseconds.", optarg, l / 1000.0 / 60 / 60, optarg, l / 1000.0); - o.setHostTimeout(l); - /* MISC OPTIONS **************************************************************/ } else if (optcmp(long_options[option_index].name, "privileged") == 0 ){ diff --git a/nping/NpingOps.cc b/nping/NpingOps.cc index ad8b598c4..13248d868 100644 --- a/nping/NpingOps.cc +++ b/nping/NpingOps.cc @@ -137,9 +137,6 @@ NpingOps::NpingOps() { send_eth=0; send_eth_set=false; - host_timeout=0; - host_timeout_set=false; - delay=0; delay_set=false; @@ -728,35 +725,6 @@ bool NpingOps::issetSendEth(){ } /* End of issetSendEth() */ -/** Sets host timeout. Supplied parameter must be a long integer greater than - * zero. - * @warning timeout is assumed to be in milliseconds. Use tval2msecs() from - * nbase to obtain a proper value. - * @return OP_SUCCESS on success and OP_FAILURE in case of error. */ -int NpingOps::setHostTimeout(long t){ - if( t < 0 ){ - nping_fatal(QT_3,"setHostTimeout(): Invalid time supplied\n"); - return OP_FAILURE; - }else{ - this->host_timeout=t; - } - this->host_timeout_set=true; - return OP_SUCCESS; -} /* End of setHostTimeout() */ - - -/** Returns value of attribute host_timeout */ -long NpingOps::getHostTimeout(){ - return this->host_timeout; -} /* End of getHostTimeout() */ - - -/* Returns true if option has been set */ -bool NpingOps::issetHostTimeout(){ - return this->host_timeout_set; -} /* End of issetHostTimeout() */ - - /** Sets inter-probe delay. Supplied parameter is assumed to be in milliseconds * and must be a long integer greater than zero. * @warning timeout is assumed to be in milliseconds. Use tval2msecs() from diff --git a/nping/NpingOps.h b/nping/NpingOps.h index 02c08a787..10d13c0e3 100644 --- a/nping/NpingOps.h +++ b/nping/NpingOps.h @@ -531,9 +531,6 @@ class NpingOps { bool send_eth; /**< True: send at raw ethernet level */ bool send_eth_set; - long host_timeout; /**< Timeout for host replies */ - bool host_timeout_set; - long delay; /**< Delay between each probe */ bool delay_set;