void set_options( const std::vector<std::string> &options );
private:
+ /// the address of the host
std::string Address;
+ /// the port of the host
uint16_t Port;
+ /// the interval between each ping to the host
int IntervalInSec;
+ /// options
std::vector<std::string> Options;
};
);
private:
+ /// the list of IPs available to the host DNS
std::list<HostAddress> ResolvedHostAddressList;
+ /// the DNS of the host
const std::string HostDnsAddress;
+ /// the address of the server which can resolve the host address
const std::string NameServer;
};
void set_ttl( const TimeToLive &ttl );
private:
+ /// IP address of the host
std::string Ip;
+ /// time-to-live of the host IP
TimeToLive Ttl;
};
int get_updated_value() const;
private:
+ /// the numeric time-to-live
int Ttl;
+ /// the time when the time-to-live was set, so it is possible to know the
+ /// elapsed time
boost::posix_time::ptime TtlSetTime;
};
);
private:
+ /// io service object, which has the loop event
boost::asio::io_service &IoService;
+ /// the destination host
boost::asio::ip::icmp::endpoint DestinationEndpoint;
+ /// the socket object
boost::asio::ip::icmp::socket Socket;
+ /// the timer of ICMP packet receive, triggers the timeout to avoid infinite
+ /// wait
boost::asio::deadline_timer IcmpPacketReceiveTimer;
+ /// ICMP packet sequence_number
uint16_t SequenceNumber;
+ /// the time when the last ICMP packet was sent
boost::posix_time::ptime TimeSent;
+ /// the buffer where the data received will be placed
boost::asio::streambuf ReplyBuffer;
+ /// number of replies to the ICMP echo request
int RepliesCount;
+ /// the amount of time to wait for the reply
int EchoReplyTimeoutInSec;
+ /// the status of the pinger
BoostPinger::PingStatus PingerStatus;
};
void analyze_ping_failed_count();
private:
+ /// the DNS address of the host to analyze
std::string HostAddress;
+ /// the object responsible to analyze the link
const boost::shared_ptr<LinkStatusAnalyzer> LinkAnalyzer;
+ /// the maximum amount of pings that can fail without warning
int PingFailPercentageLimit;
+ /// the amount of IPs that are aliases to the host DNS
int ResolvedIpCount;
+ /// the amount of pings sent until now
int PingsPerformedCount;
+ /// the amount of pings sent that failed until now
int PingsFailedCount;
+ /// boolean flag that indicate if the last set of failed pings exceed the
+ /// limit
bool ExceededPingFailedLimit;
};
bool can_speed_up() const;
private:
+ /// the original interval to ping, unchangeable
const PingIntervalType OriginalInterval;
+ /// the actual interval exported by this object
PingIntervalType Interval;
};
void update_ping_elapsed_time();
private:
+ /// service object, which has the event loop
boost::asio::io_service &IoService;
+ /// name of the network device used to send the packets
std::string LocalNetworkInterfaceName;
+ /// timer to trigger the next ping
boost::asio::deadline_timer NextPingTimer;
+ /// keeps track of the time when the last ping was send
boost::posix_time::ptime TimeSentLastPing;
+ /// interval between each ping to the same host
PingInterval PingIntervalInSec;
+ /// the list of IPs which are aliases to the host DNS
DnsResolver IpList;
+ /// object responsible to evaluate the status of the host
HostStatusAnalyzer HostAnalyzer;
};
std::ostream& write( std::ostream &os ) const;
private:
+ /// packet payload object
IcmpMessagePayload Payload;
};
std::ostream& write( std::ostream &os ) const;
private:
+ /// packet payload object
IcmpMessagePayload Payload;
};
std::ostream& write( std::ostream &os ) const;
private:
+ /// packet payload object
IcmpMessagePayload Payload;
};
);
private:
+ /// changeable pointer to different ICMP messages types
boost::shared_ptr<IcmpMessage> MessageFormat;
};
std::ostream& write( std::ostream &os ) const;
private:
+ /// the size of the payload buffer
const std::size_t PayloadSizeInBytes;
+ /// the payload buffer
boost::scoped_array<uint8_t> Payload;
NONCOPYABLE( IcmpMessagePayload )
);
private:
+ /// the IP header object
Ipv4Header IpHeader;
+ /// the ICMP header
IcmpHeader IcmpPayloadHeader;
+ /// the ICMP data
IcmpData IcmpPayloadData;
};
private:
/// the maximum amount of hosts which can be down before sound the alarm
const int HostsDownLimit;
- /// list of host down (obvious isn't it?)
+ /// list of hosts down (obvious isn't it?)
std::set<std::string> HostsDownList;
/// interval the link have to be stable in order to consider it is functional
const int LinkUpIntervalInMin;
/// keep track of the actual link status
LinkStatusAnalyzer::LinkStatus CurrentLinkStatus;
- /// indicates if was notified the last link status change
+ /// indicates if the last link status change was notified
LinkStatusAnalyzer::NotificationStatus CurrentNotificationStatus;
/// when was the last time the status changed
boost::posix_time::ptime TimeLinkStatusChanged;
- ///
+ /// command used to notify the status of the link
StatusNotifierCommand StatusNotifierCmd;
std::string get_arguments_string() const;
private:
+ /// the command string used to notify the status
std::string CommandStr;
};