config/option/statusnotifiercmdoption.cpp
config/option/versionoption.cpp
config/option/ratiorandomhostsoption.cpp
+ config/option/pingreplytimeoutoption.cpp
+ config/option/maxaddressresolutionattemptsoption.cpp
+ config/option/resolvedipttlthresholdoption.cpp
dns/dnsresolver.cpp
dns/dnsresolverfactory.cpp
dns/hostaddress.cpp
LinkDownIntervalInMin( 0 ),
MinStableLinkIntervalInMin( 0 ),
MaxStableLinkIntervalInMin( 60 ),
+ PingReplyTimeout( 30 ),
+ MaxAddressResolutionAttempts( 10 ),
+ ResolvedIpTtlThreshold( 10 ),
Hosts(),
RatioRandomHosts( 1.0f ),
RandomNumberGenerator( boost::numeric_cast<unsigned int>(time(0)) )
LinkDownIntervalInMin = link_down_interval_in_min;
}
+int Configuration::get_ping_reply_timeout() const
+{
+ return PingReplyTimeout;
+}
+void Configuration::set_ping_reply_timeout( const int ping_reply_timeout )
+{
+ BOOST_ASSERT(ping_reply_timeout > 0 );
+ PingReplyTimeout = ping_reply_timeout;
+}
+
+int Configuration::get_max_address_resolution_attempts() const
+{
+ return MaxAddressResolutionAttempts;
+}
+void Configuration::set_max_address_resolution_attempts( const int max_address_resolution_attempts )
+{
+ BOOST_ASSERT(max_address_resolution_attempts > 0 );
+ MaxAddressResolutionAttempts = max_address_resolution_attempts;
+}
+
+int Configuration::get_resolved_ip_ttl_threshold() const
+{
+ return ResolvedIpTtlThreshold;
+}
+void Configuration::set_resolved_ip_ttl_threshold( const int resolved_ip_ttl_threshold )
+{
+ BOOST_ASSERT(resolved_ip_ttl_threshold > 0 );
+ ResolvedIpTtlThreshold = resolved_ip_ttl_threshold;
+}
+
float Configuration::get_ratio_random_hosts() const
{
return RatioRandomHosts;
int get_link_down_interval_in_min() const;
void set_link_down_interval_in_min( const int link_down_interval_in_min );
+ int get_ping_reply_timeout() const;
+ void set_ping_reply_timeout( const int ping_reply_timeout );
+
+ int get_max_address_resolution_attempts() const;
+ void set_max_address_resolution_attempts(
+ const int max_address_resolution_attempts );
+
+ int get_resolved_ip_ttl_threshold() const;
+ void set_resolved_ip_ttl_threshold(
+ const int resolved_ip_ttl_threshold );
+
float get_ratio_random_hosts() const;
void set_ratio_random_hosts( const float ratio );
HostList get_hosts() const;
void set_hosts( const HostList &hosts_list );
- bool randomize_hosts();
-
int get_random_number(const int lowest, const int highest);
+ bool randomize_hosts();
+
private:
bool Daemon;
I2n::Logger::LogLevel LoggingLevel;
int LinkDownIntervalInMin;
int MinStableLinkIntervalInMin;
int MaxStableLinkIntervalInMin;
- float RatioRandomHosts;
+ int PingReplyTimeout;
+ int MaxAddressResolutionAttempts;
+ int ResolvedIpTtlThreshold;
HostList Hosts;
+ float RatioRandomHosts;
rand_gen_type RandomNumberGenerator;
};
#include "config/option/statusnotifiercmdoption.h"
#include "config/option/versionoption.h"
#include "config/option/ratiorandomhostsoption.h"
+#include "config/option/pingreplytimeoutoption.h"
+#include "config/option/maxaddressresolutionattemptsoption.h"
+#include "config/option/resolvedipttlthresholdoption.h"
using namespace std;
using boost::program_options::option_description;
ConfigurationOptionItem status_notifier_cmd( new StatusNotifierCmdOption );
ConfigOptions.push_back( status_notifier_cmd );
+ PingReplyTimeoutOption();
+ ConfigurationOptionItem ping_reply_timeout( new PingReplyTimeoutOption );
+ ConfigOptions.push_back( ping_reply_timeout );
+
+ ConfigurationOptionItem max_address_resolution_attempts( new MaxAddressResolutionAttemptsOption );
+ ConfigOptions.push_back( max_address_resolution_attempts );
+
+ ConfigurationOptionItem resolved_ip_ttl_threshold( new ResolvedIpTtlThresholdOption );
+ ConfigOptions.push_back( resolved_ip_ttl_threshold );
+
ConfigurationOptionItem ratio_random_hosts( new RatioRandomHostsOption );
ConfigOptions.push_back( ratio_random_hosts );
--- /dev/null
+/*
+ The software in this package is distributed under the GNU General
+ Public License version 2 (with a special exception described below).
+
+ A copy of GNU General Public License (GPL) is included in this distribution,
+ in the file COPYING.GPL.
+
+ As a special exception, if other files instantiate templates or use macros
+ or inline functions from this file, or you compile this file and link it
+ with other works to produce a work based on this file, this file
+ does not by itself cause the resulting work to be covered
+ by the GNU General Public License.
+
+ However the source code for this file must still be made available
+ in accordance with section (3) of the GNU General Public License.
+
+ This exception does not invalidate any other reasons why a work based
+ on this file might be covered by the GNU General Public License.
+ */
+
+#include "config/option/maxaddressresolutionattemptsoption.h"
+
+#include <logfunc.hpp>
+
+using namespace std;
+using boost::program_options::value;
+using boost::program_options::variables_map;
+using I2n::Logger::GlobalLogger;
+
+//-----------------------------------------------------------------------------
+// MaxAddressResolutionAttemptsOption
+//-----------------------------------------------------------------------------
+
+MaxAddressResolutionAttemptsOption::MaxAddressResolutionAttemptsOption() :
+ ConfigurationOption(
+ "max-address-resolution-attempts",
+ value<int>()->default_value( 10 ),
+ "Number of attempts at DNS resolution until target is assumed offline"
+ )
+{
+}
+
+MaxAddressResolutionAttemptsOption::~MaxAddressResolutionAttemptsOption()
+{
+}
+
+bool MaxAddressResolutionAttemptsOption::parse(
+ const variables_map& vm,
+ Configuration *configuration
+)
+{
+ // default-source-network-interface
+ if ( 1 <= vm.count( get_command_string() ) )
+ {
+ int max_address_resolution_attempts = vm[ get_command_string() ].as<int> ();
+ configuration->set_max_address_resolution_attempts( max_address_resolution_attempts );
+
+ GlobalLogger.info() << get_command_string() << "="
+ << max_address_resolution_attempts << endl;
+
+ return true;
+ }
+
+ return false;
+}
--- /dev/null
+/*
+ The software in this package is distributed under the GNU General
+ Public License version 2 (with a special exception described below).
+
+ A copy of GNU General Public License (GPL) is included in this distribution,
+ in the file COPYING.GPL.
+
+ As a special exception, if other files instantiate templates or use macros
+ or inline functions from this file, or you compile this file and link it
+ with other works to produce a work based on this file, this file
+ does not by itself cause the resulting work to be covered
+ by the GNU General Public License.
+
+ However the source code for this file must still be made available
+ in accordance with section (3) of the GNU General Public License.
+
+ This exception does not invalidate any other reasons why a work based
+ on this file might be covered by the GNU General Public License.
+ */
+
+#ifndef MAX_ADDRESS_RESOLUTION_ATTEMPTS_H
+#define MAX_ADDRESS_RESOLUTION_ATTEMPTS_H
+
+#include <boost/program_options.hpp>
+
+#include "config/option/configurationoption.h"
+
+//-----------------------------------------------------------------------------
+// MaxAddressResolutionAttemptsOption
+//-----------------------------------------------------------------------------
+
+/**
+ * @brief This class represents the "max-address-resolution-attempts"
+ * configuration option.
+ */
+class MaxAddressResolutionAttemptsOption : public ConfigurationOption
+{
+public:
+ MaxAddressResolutionAttemptsOption();
+ virtual ~MaxAddressResolutionAttemptsOption();
+
+ virtual bool parse(
+ const boost::program_options::variables_map &vm,
+ Configuration *configuration
+ );
+
+};
+
+#endif // MAX_ADDRESS_RESOLUTION_ATTEMPTS_H
--- /dev/null
+/*
+ The software in this package is distributed under the GNU General
+ Public License version 2 (with a special exception described below).
+
+ A copy of GNU General Public License (GPL) is included in this distribution,
+ in the file COPYING.GPL.
+
+ As a special exception, if other files instantiate templates or use macros
+ or inline functions from this file, or you compile this file and link it
+ with other works to produce a work based on this file, this file
+ does not by itself cause the resulting work to be covered
+ by the GNU General Public License.
+
+ However the source code for this file must still be made available
+ in accordance with section (3) of the GNU General Public License.
+
+ This exception does not invalidate any other reasons why a work based
+ on this file might be covered by the GNU General Public License.
+ */
+
+#include "config/option/pingreplytimeoutoption.h"
+
+#include <logfunc.hpp>
+
+using namespace std;
+using boost::program_options::value;
+using boost::program_options::variables_map;
+using I2n::Logger::GlobalLogger;
+
+//-----------------------------------------------------------------------------
+// PingReplyTimeoutOption
+//-----------------------------------------------------------------------------
+
+PingReplyTimeoutOption::PingReplyTimeoutOption() :
+ ConfigurationOption(
+ "ping-reply-timeout",
+ value<int>()->default_value( 30 ),
+ "Time in seconds to wait for reply from pings"
+ )
+{
+}
+
+PingReplyTimeoutOption::~PingReplyTimeoutOption()
+{
+}
+
+bool PingReplyTimeoutOption::parse(
+ const variables_map& vm,
+ Configuration *configuration
+)
+{
+ // default-source-network-interface
+ if ( 1 <= vm.count( get_command_string() ) )
+ {
+ int ping_reply_timeout = vm[ get_command_string() ].as<int> ();
+ configuration->set_ping_reply_timeout( ping_reply_timeout );
+
+ GlobalLogger.info() << get_command_string() << "="
+ << ping_reply_timeout << endl;
+
+ return true;
+ }
+
+ return false;
+}
--- /dev/null
+/*
+ The software in this package is distributed under the GNU General
+ Public License version 2 (with a special exception described below).
+
+ A copy of GNU General Public License (GPL) is included in this distribution,
+ in the file COPYING.GPL.
+
+ As a special exception, if other files instantiate templates or use macros
+ or inline functions from this file, or you compile this file and link it
+ with other works to produce a work based on this file, this file
+ does not by itself cause the resulting work to be covered
+ by the GNU General Public License.
+
+ However the source code for this file must still be made available
+ in accordance with section (3) of the GNU General Public License.
+
+ This exception does not invalidate any other reasons why a work based
+ on this file might be covered by the GNU General Public License.
+ */
+
+#ifndef PING_REPLY_TIMEOUT_OPTION_H
+#define PING_REPLY_TIMEOUT_OPTION_H
+
+#include <boost/program_options.hpp>
+
+#include "config/option/configurationoption.h"
+
+//-----------------------------------------------------------------------------
+// PingReplyTimeoutOption
+//-----------------------------------------------------------------------------
+
+/**
+ * @brief This class represents the "ping-reply-timeout"
+ * configuration option.
+ */
+class PingReplyTimeoutOption : public ConfigurationOption
+{
+public:
+ PingReplyTimeoutOption();
+ virtual ~PingReplyTimeoutOption();
+
+ virtual bool parse(
+ const boost::program_options::variables_map &vm,
+ Configuration *configuration
+ );
+
+};
+
+#endif // PING_REPLY_TIMEOUT_OPTION_H
--- /dev/null
+/*
+ The software in this package is distributed under the GNU General
+ Public License version 2 (with a special exception described below).
+
+ A copy of GNU General Public License (GPL) is included in this distribution,
+ in the file COPYING.GPL.
+
+ As a special exception, if other files instantiate templates or use macros
+ or inline functions from this file, or you compile this file and link it
+ with other works to produce a work based on this file, this file
+ does not by itself cause the resulting work to be covered
+ by the GNU General Public License.
+
+ However the source code for this file must still be made available
+ in accordance with section (3) of the GNU General Public License.
+
+ This exception does not invalidate any other reasons why a work based
+ on this file might be covered by the GNU General Public License.
+ */
+
+#include "config/option/resolvedipttlthresholdoption.h"
+
+#include <logfunc.hpp>
+
+using namespace std;
+using boost::program_options::value;
+using boost::program_options::variables_map;
+using I2n::Logger::GlobalLogger;
+
+//-----------------------------------------------------------------------------
+// ResolvedIpTtlThresholdOption
+//-----------------------------------------------------------------------------
+
+ResolvedIpTtlThresholdOption::ResolvedIpTtlThresholdOption() :
+ ConfigurationOption(
+ "resolved-ip-ttl-threshold",
+ value<int>()->default_value( 10 ),
+ "Minimum time in milliseconds that IP has to be valid when testing for refresh"
+ )
+{
+}
+
+ResolvedIpTtlThresholdOption::~ResolvedIpTtlThresholdOption()
+{
+}
+
+bool ResolvedIpTtlThresholdOption::parse(
+ const variables_map& vm,
+ Configuration *configuration
+)
+{
+ // default-source-network-interface
+ if ( 1 <= vm.count( get_command_string() ) )
+ {
+ int resolved_ip_ttl_threshold = vm[ get_command_string() ].as<int> ();
+ configuration->set_resolved_ip_ttl_threshold( resolved_ip_ttl_threshold );
+
+ GlobalLogger.info() << get_command_string() << "="
+ << resolved_ip_ttl_threshold << endl;
+
+ return true;
+ }
+
+ return false;
+}
--- /dev/null
+/*
+ The software in this package is distributed under the GNU General
+ Public License version 2 (with a special exception described below).
+
+ A copy of GNU General Public License (GPL) is included in this distribution,
+ in the file COPYING.GPL.
+
+ As a special exception, if other files instantiate templates or use macros
+ or inline functions from this file, or you compile this file and link it
+ with other works to produce a work based on this file, this file
+ does not by itself cause the resulting work to be covered
+ by the GNU General Public License.
+
+ However the source code for this file must still be made available
+ in accordance with section (3) of the GNU General Public License.
+
+ This exception does not invalidate any other reasons why a work based
+ on this file might be covered by the GNU General Public License.
+ */
+
+#ifndef RESOLVED_IP_TTL_THRESHOLD_OPTION_H
+#define RESOLVED_IP_TTL_THRESHOLD_OPTION_H
+
+#include <boost/program_options.hpp>
+
+#include "config/option/configurationoption.h"
+
+//-----------------------------------------------------------------------------
+// ResolvedIpTtlThresholdOption
+//-----------------------------------------------------------------------------
+
+/**
+ * @brief This class represents the "resolved-ip-ttl-threshold"
+ * configuration option.
+ */
+class ResolvedIpTtlThresholdOption : public ConfigurationOption
+{
+public:
+ ResolvedIpTtlThresholdOption();
+ virtual ~ResolvedIpTtlThresholdOption();
+
+ virtual bool parse(
+ const boost::program_options::variables_map &vm,
+ Configuration *configuration
+ );
+
+};
+
+#endif // RESOLVED_IP_TTL_THRESHOLD_OPTION_H
DnsResolver::DnsResolver(
const string &dns_address,
const string &nameserver,
- const type_t address_resource_record_type
+ const type_t address_resource_record_type,
+ const int resolved_ip_ttl_threshold
) :
ResolvedHostAddressList(),
HostDnsAddress( dns_address ),
NameServer( nameserver ),
- AddressResourceRecord( address_resource_record_type )
+ AddressResourceRecord( address_resource_record_type ),
+ ResolvedIpTtlThreshold( resolved_ip_ttl_threshold )
{
}
*/
bool DnsResolver::expired_resolved_ip() const
{
- const uint32_t threshold = 10; // TODO configurable
-
BOOST_FOREACH( const HostAddress &host_address, ResolvedHostAddressList )
{
uint32_t ttl = host_address.get_ttl().get_updated_value();
- if ( ttl <= threshold )
+ if ( ttl <= ResolvedIpTtlThreshold )
{
return true;
}
DnsResolver(
const std::string &dns_address,
const std::string &nameserver,
- const boost::net::dns::type_t address_resource_record_type
+ const boost::net::dns::type_t address_resource_record_type,
+ const int resolved_ip_ttl_threshold
);
~DnsResolver();
const std::string NameServer;
/// 'A' resource records for the IPv4 addresses, or 'AAAA' resource records for the IPv6 addresses
boost::net::dns::type_t AddressResourceRecord;
+ /// Minimum time that IP has to be valid before creating new dns request
+ const int ResolvedIpTtlThreshold;
};
DnsResolverItem DnsResolverFactory::createResolver(
const string &destination_address,
const string &nameserver,
+ const int resolved_ip_ttl_threshold,
const PingProtocol ping_protocol
)
{
case PingProtocol_ICMP:
case PingProtocol_TCP:
return DnsResolverItem(
- new DnsResolver( destination_address, nameserver, boost::net::dns::type_a )
+ new DnsResolver( destination_address, nameserver, boost::net::dns::type_a,
+ resolved_ip_ttl_threshold)
);
case PingProtocol_ICMPv6:
case PingProtocol_TCP_IPv6:
return DnsResolverItem(
- new DnsResolver( destination_address, nameserver, boost::net::dns::type_a6 )
+ new DnsResolver( destination_address, nameserver, boost::net::dns::type_a6,
+ resolved_ip_ttl_threshold)
);
default:
BOOST_ASSERT( !"Try to create a DNS from an invalid address resource record" ); //lint !e506
static DnsResolverItem createResolver(
const std::string &destination_address,
const std::string &nameserver,
+ const int resolved_ip_ttl_threshold,
const PingProtocol ping_protocol
);
PingerItem PingerFactory::createPinger(
const PingProtocol protocol,
io_service &io_serv,
- const string &network_interface
+ const string &network_interface,
+ const int ping_reply_timeout
)
{
BOOST_ASSERT( /*( PingProtocol_First <= protocol ) && */( protocol <= PingProtocol_Last ) );
BOOST_ASSERT( !network_interface.empty() );
- // Ping reply timeout. Could be made a configuration variable
- const int ping_reply_timeout_in_sec = 30; // TODO
-
try
{
switch ( protocol )
{
case PingProtocol_ICMP:
return PingerItem(
- new IcmpPinger( io_serv, icmp::v4(), network_interface, ping_reply_timeout_in_sec )
+ new IcmpPinger( io_serv, icmp::v4(), network_interface, ping_reply_timeout )
);
case PingProtocol_ICMPv6:
return PingerItem(
- new IcmpPinger( io_serv, icmp::v6(), network_interface, ping_reply_timeout_in_sec )
+ new IcmpPinger( io_serv, icmp::v6(), network_interface, ping_reply_timeout )
);
case PingProtocol_TCP:
return PingerItem(
- new TcpPinger( io_serv, tcp_raw_protocol::v4(), network_interface, ping_reply_timeout_in_sec )
+ new TcpPinger( io_serv, tcp_raw_protocol::v4(), network_interface, ping_reply_timeout )
);
case PingProtocol_TCP_IPv6:
return PingerItem(
- new TcpPinger( io_serv, tcp_raw_protocol::v6(), network_interface, ping_reply_timeout_in_sec )
+ new TcpPinger( io_serv, tcp_raw_protocol::v6(), network_interface, ping_reply_timeout )
);
default:
BOOST_ASSERT( !"Try to create a pinger from an invalid protocol" ); //lint !e506
const string &network_interface,
const string &destination_address,
const uint16_t destination_port,
- const string &nameserver
+ const string &nameserver,
+ const int resolved_ip_ttl_threshold,
+ const int ping_reply_timeout
)
{
BOOST_ASSERT( 0 < protocol_list.size() );
destination_address,
destination_port,
nameserver,
+ resolved_ip_ttl_threshold,
+ ping_reply_timeout,
protocol_list
) );
}
static PingerItem createPinger(
const PingProtocol protocol,
boost::asio::io_service &io_serv,
- const std::string &network_interface
+ const std::string &network_interface,
+ const int ping_reply_timeout
);
static PingRotateItem createPinger(
const std::string &network_interface,
const std::string &destination_address,
const uint16_t destination_port,
- const std::string &nameserver
+ const std::string &nameserver,
+ const int resolved_ip_ttl_threshold,
+ const int ping_reply_timeout
);
private:
const string &destination_address,
const uint16_t destination_port,
const string &nameserver,
+ const int resolved_ip_ttl_threshold,
+ const int ping_reply_timeout,
const PingProtocolList &protocol_list
) :
IoService( io_serv ),
DestinationAddess( destination_address ),
DestinationPort( destination_port ),
Nameserver( nameserver ),
+ ResolvedIpTtlThreshold( resolved_ip_ttl_threshold ),
+ PingReplyTimeout( ping_reply_timeout ),
ProtocolList( protocol_list ),
Ping(),
PingDoneCallback()
ProtocolList.pop_front();
- Ping = PingerFactory::createPinger( ping_protocol, IoService, NetworkInterfaceName );
+ Ping = PingerFactory::createPinger( ping_protocol, IoService, NetworkInterfaceName, PingReplyTimeout );
update_dns_resolver( ping_protocol );
}
void PingRotate::update_dns_resolver( PingProtocol current_protocol )
{
- IpList = DnsResolverFactory::createResolver( DestinationAddess, Nameserver, current_protocol );
+ IpList = DnsResolverFactory::createResolver( DestinationAddess, Nameserver, ResolvedIpTtlThreshold, current_protocol );
// when the protocol change, there is a chance that the IP version required by the new
// protocol differ from the previous one, thus it is required to resolve the address again.
const std::string &destination_address,
const uint16_t destination_port,
const std::string &nameserver,
+ const int resolved_ip_ttl_threshold,
+ const int ping_reply_timeout,
const PingProtocolList &protocol_list
);
virtual ~PingRotate();
uint16_t DestinationPort;
/// Server to resolve the addresses
std::string Nameserver;
+ /// time threshold for address resolution
+ int ResolvedIpTtlThreshold;
+ /// timeout for ping reply
+ const int PingReplyTimeout;
/// The list of protocols to ping
PingProtocolList ProtocolList;
/// Internal boost pinger object
const long ping_interval_in_sec,
const int ping_fail_percentage_limit,
const string &nameserver,
+ const int max_address_resolution_attempts,
+ const int ping_reply_timeout,
+ const int resolved_ip_ttl_threshold,
LinkStatusItem link_analyzer,
const int first_delay
HostAnalyzer( destination_address, ping_fail_percentage_limit, link_analyzer ),
FirstDelay( first_delay ),
AddressResolutionAttempts( 0 ),
+ MaxAddressResolutionAttempts( max_address_resolution_attempts ),
EverHadAnyIP( false ),
Ping(),
Thread()
network_interface,
destination_address,
destination_port,
- nameserver
+ nameserver,
+ resolved_ip_ttl_threshold,
+ ping_reply_timeout
);
}
else
{ // no IPs --> try again later, possibly report offline before
AddressResolutionAttempts++;
- if (AddressResolutionAttempts >= MAX_ADDRESS_RESOLUTION_ATTEMPTS)
+ if (AddressResolutionAttempts >= MaxAddressResolutionAttempts)
{
GlobalLogger.notice() << "No IPs after " << AddressResolutionAttempts << " DNS queries!";
HostAnalyzer.report_dns_resolution_failure();
void PingScheduler::ping_done_handler( const bool ping_success )
{
// post-processing
- // TODO you must call these 3 methods exactly in this order
- // Fix this method, once it has a semantic dependency with the
+ // You must call these 3 methods exactly in this order
+ // TODO Fix this method, once it has a semantic dependency with the
// update_ping_statistics method, because it depends on the PingAnalyzer
// statistics to update the exceeded_ping_failed_limit
HostAnalyzer.update_ping_statistics( ping_success );
// PingScheduler
//-----------------------------------------------------------------------------
-const int MAX_ADDRESS_RESOLUTION_ATTEMPTS = 3;
-
/**
* @brief This class is responsible to control whether to ping a host. It
* schedules periodic pings to a host.
const long ping_interval_in_sec,
const int ping_fail_percentage_limit,
const std::string &nameserver,
+ const int max_address_resolution_attempts,
+ const int ping_reply_timeout,
+ const int resolved_ip_ttl_threshold,
LinkStatusItem link_analyzer,
const int first_delay
);
PingInterval AddressResolveIntervalInSec;
/// Object responsible to evaluate the status of the host
HostStatus HostAnalyzer;
- /// Internal boost pinger object
- PingRotateItem Ping;
- /// Thread object
- boost::thread Thread;
/// delay for very first ping to avoid lots of simultaneous pings
int FirstDelay;
/// number of attempts at Address Resolution
int AddressResolutionAttempts;
- /// flat whether any DNS lookup succeeded
+ int MaxAddressResolutionAttempts;
+ /// flag whether any DNS lookup succeeded
// (comparing get_ip_count to 0 might violate assertion in dnsresolver.cpp)
bool EverHadAnyIP;
-
+ /// Internal boost pinger object
+ PingRotateItem Ping;
+ /// Thread object
+ boost::thread Thread;
};
//-----------------------------------------------------------------------------
string default_network_interface = configuration->get_source_network_interface();
string nameserver = configuration->get_nameserver();
int ping_fail_limit = configuration->get_ping_fail_limit();
+ int max_address_resolution_attempts = configuration->get_max_address_resolution_attempts();
+ int ping_reply_timeout = configuration->get_ping_reply_timeout();
+ int resolved_ip_ttl_threshold = configuration->get_resolved_ip_ttl_threshold();
// remove some hosts at random
configuration->randomize_hosts();
ping_interval_in_sec,
ping_fail_limit,
nameserver,
+ max_address_resolution_attempts,
+ ping_reply_timeout,
+ resolved_ip_ttl_threshold,
status_notifier,
current_delay
)
${CMAKE_SOURCE_DIR}/src/config/option/statusnotifiercmdoption.cpp
${CMAKE_SOURCE_DIR}/src/config/option/versionoption.cpp
${CMAKE_SOURCE_DIR}/src/config/option/ratiorandomhostsoption.cpp
+ ${CMAKE_SOURCE_DIR}/src/config/option/pingreplytimeoutoption.cpp
+ ${CMAKE_SOURCE_DIR}/src/config/option/maxaddressresolutionattemptsoption.cpp
+ ${CMAKE_SOURCE_DIR}/src/config/option/resolvedipttlthresholdoption.cpp
${CMAKE_SOURCE_DIR}/src/host/loglevel.cpp
${CMAKE_SOURCE_DIR}/src/host/logoutput.cpp
${CMAKE_SOURCE_DIR}/src/host/pingprotocol.cpp
${CMAKE_SOURCE_DIR}/src/config/option/statusnotifiercmdoption.cpp
${CMAKE_SOURCE_DIR}/src/config/option/versionoption.cpp
${CMAKE_SOURCE_DIR}/src/config/option/ratiorandomhostsoption.cpp
+ ${CMAKE_SOURCE_DIR}/src/config/option/pingreplytimeoutoption.cpp
+ ${CMAKE_SOURCE_DIR}/src/config/option/maxaddressresolutionattemptsoption.cpp
+ ${CMAKE_SOURCE_DIR}/src/config/option/resolvedipttlthresholdoption.cpp
${CMAKE_SOURCE_DIR}/src/host/loglevel.cpp
${CMAKE_SOURCE_DIR}/src/host/logoutput.cpp
${CMAKE_SOURCE_DIR}/src/host/pingprotocol.cpp
${CMAKE_SOURCE_DIR}/src/config/option/statusnotifiercmdoption.cpp
${CMAKE_SOURCE_DIR}/src/config/option/versionoption.cpp
${CMAKE_SOURCE_DIR}/src/config/option/ratiorandomhostsoption.cpp
+ ${CMAKE_SOURCE_DIR}/src/config/option/pingreplytimeoutoption.cpp
+ ${CMAKE_SOURCE_DIR}/src/config/option/maxaddressresolutionattemptsoption.cpp
+ ${CMAKE_SOURCE_DIR}/src/config/option/resolvedipttlthresholdoption.cpp
${CMAKE_SOURCE_DIR}/src/host/loglevel.cpp
${CMAKE_SOURCE_DIR}/src/host/logoutput.cpp
${CMAKE_SOURCE_DIR}/src/host/pingprotocol.cpp