simplified dns (no self-made recursion); merge PingScheduler and PingRotate; make...
[pingcheck] / src / host / pingscheduler.h
index 75598b9..250bf85 100644 (file)
@@ -77,6 +77,16 @@ private:
     void update_ping_interval();
     void update_ping_elapsed_time();
 
+    void init_ping_protocol();
+    void update_ping_protocol();
+    void get_next_ping_protocol();
+    bool can_change_ping_protocol() const;
+
+    void update_dns_resolver( PingProtocol current_protocol );
+
+    void try_to_ping();
+    void dns_resolve_callback(const bool was_success, const int cname_count);
+
     //
     // Attributes
     //
@@ -94,14 +104,27 @@ private:
     /// Object responsible to evaluate the status of the host
     HostStatus HostAnalyzer;
     /// delay for very first ping to avoid lots of simultaneous pings
-    int  FirstDelay;
-    /// number of attempts at Address Resolution
-    int AddressResolutionAttempts;
-    /// flag whether any DNS lookup succeeded
-    //  (comparing get_ip_count to 0 might violate assertion in dnsresolver.cpp)
-    bool EverHadAnyIP;
+    int FirstDelay;
+    /// The IO service object, which has the loop event
+    IoServiceItem IoService;
+    /// The network interface name
+    std::string NetworkInterfaceName;
+    /// The Dns resolver
+    ResolverItem Resolver;
+    /// The address to ping
+    std::string DestinationAddress;
+    /// The port to ping at destination host (same port to all protocols in the list)
+    uint16_t DestinationPort;
+    /// time threshold for address resolution
+    int ResolvedIpTtlThreshold;
+    /// timeout for ping reply
+    const int PingReplyTimeout;
+    /// The list of protocols to ping
+    CircularProtocolList ProtocolRotate;
     /// Internal boost pinger object
-    PingRotateItem Ping;
+    PingerItem Ping;
+    /// a flag whether we should ping as soon as dns is ready
+    bool WantToPing;
 };
 
 //-----------------------------------------------------------------------------