From d3e8a9f928bf7731ed189d4d10994ec6cf56f859 Mon Sep 17 00:00:00 2001 From: Guilherme Maciel Ferreira Date: Thu, 28 Apr 2011 16:24:01 +0200 Subject: [PATCH] Included doxygen comments to member variables. --- src/config/host.h | 4 ++++ src/dns/dnsresolver.h | 3 +++ src/dns/hostaddress.h | 2 ++ src/dns/timetolive.h | 3 +++ src/host/boostpinger.h | 11 +++++++++++ src/host/hoststatusanalyzer.h | 8 ++++++++ src/host/pinginterval.h | 2 ++ src/host/pingscheduler.h | 7 +++++++ src/icmp/icmpdestinationunreachablemessage.h | 1 + src/icmp/icmpechoreplymessage.h | 1 + src/icmp/icmpechorequestmessage.h | 1 + src/icmp/icmpheader.h | 1 + src/icmp/icmpmessagepayload.h | 2 ++ src/icmp/icmppacket.h | 3 +++ src/link/linkstatusanalyzer.h | 6 +++--- src/link/statusnotifiercommand.h | 1 + 16 files changed, 53 insertions(+), 3 deletions(-) diff --git a/src/config/host.h b/src/config/host.h index ef0adf0..c6f7ff7 100644 --- a/src/config/host.h +++ b/src/config/host.h @@ -31,9 +31,13 @@ public: void set_options( const std::vector &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 Options; }; diff --git a/src/dns/dnsresolver.h b/src/dns/dnsresolver.h index 4b61f18..6c46218 100644 --- a/src/dns/dnsresolver.h +++ b/src/dns/dnsresolver.h @@ -38,8 +38,11 @@ private: ); private: + /// the list of IPs available to the host DNS std::list 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; }; diff --git a/src/dns/hostaddress.h b/src/dns/hostaddress.h index 7ffd031..8dd8967 100644 --- a/src/dns/hostaddress.h +++ b/src/dns/hostaddress.h @@ -26,7 +26,9 @@ public: void set_ttl( const TimeToLive &ttl ); private: + /// IP address of the host std::string Ip; + /// time-to-live of the host IP TimeToLive Ttl; }; diff --git a/src/dns/timetolive.h b/src/dns/timetolive.h index 4f17302..e82f40c 100644 --- a/src/dns/timetolive.h +++ b/src/dns/timetolive.h @@ -19,7 +19,10 @@ public: 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; }; diff --git a/src/host/boostpinger.h b/src/host/boostpinger.h index 1ed7233..d5b902a 100644 --- a/src/host/boostpinger.h +++ b/src/host/boostpinger.h @@ -66,15 +66,26 @@ private: ); 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; }; diff --git a/src/host/hoststatusanalyzer.h b/src/host/hoststatusanalyzer.h index 884a8b5..6de848a 100644 --- a/src/host/hoststatusanalyzer.h +++ b/src/host/hoststatusanalyzer.h @@ -39,12 +39,20 @@ private: 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 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; }; diff --git a/src/host/pinginterval.h b/src/host/pinginterval.h index 1fe84e0..badf77f 100644 --- a/src/host/pinginterval.h +++ b/src/host/pinginterval.h @@ -31,7 +31,9 @@ private: bool can_speed_up() const; private: + /// the original interval to ping, unchangeable const PingIntervalType OriginalInterval; + /// the actual interval exported by this object PingIntervalType Interval; }; diff --git a/src/host/pingscheduler.h b/src/host/pingscheduler.h index 345e995..5ca1a0b 100644 --- a/src/host/pingscheduler.h +++ b/src/host/pingscheduler.h @@ -46,12 +46,19 @@ private: 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; }; diff --git a/src/icmp/icmpdestinationunreachablemessage.h b/src/icmp/icmpdestinationunreachablemessage.h index cc7ef09..093b97c 100644 --- a/src/icmp/icmpdestinationunreachablemessage.h +++ b/src/icmp/icmpdestinationunreachablemessage.h @@ -61,6 +61,7 @@ public: std::ostream& write( std::ostream &os ) const; private: + /// packet payload object IcmpMessagePayload Payload; }; diff --git a/src/icmp/icmpechoreplymessage.h b/src/icmp/icmpechoreplymessage.h index d136de9..880d580 100644 --- a/src/icmp/icmpechoreplymessage.h +++ b/src/icmp/icmpechoreplymessage.h @@ -57,6 +57,7 @@ public: std::ostream& write( std::ostream &os ) const; private: + /// packet payload object IcmpMessagePayload Payload; }; diff --git a/src/icmp/icmpechorequestmessage.h b/src/icmp/icmpechorequestmessage.h index 4e96fe9..92f2f4a 100644 --- a/src/icmp/icmpechorequestmessage.h +++ b/src/icmp/icmpechorequestmessage.h @@ -57,6 +57,7 @@ public: std::ostream& write( std::ostream &os ) const; private: + /// packet payload object IcmpMessagePayload Payload; }; diff --git a/src/icmp/icmpheader.h b/src/icmp/icmpheader.h index 035b736..43203a5 100644 --- a/src/icmp/icmpheader.h +++ b/src/icmp/icmpheader.h @@ -71,6 +71,7 @@ public: ); private: + /// changeable pointer to different ICMP messages types boost::shared_ptr MessageFormat; }; diff --git a/src/icmp/icmpmessagepayload.h b/src/icmp/icmpmessagepayload.h index eed2e52..3e77fa4 100644 --- a/src/icmp/icmpmessagepayload.h +++ b/src/icmp/icmpmessagepayload.h @@ -41,7 +41,9 @@ public: 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 Payload; NONCOPYABLE( IcmpMessagePayload ) diff --git a/src/icmp/icmppacket.h b/src/icmp/icmppacket.h index 43e470b..b232fee 100644 --- a/src/icmp/icmppacket.h +++ b/src/icmp/icmppacket.h @@ -83,8 +83,11 @@ public: ); private: + /// the IP header object Ipv4Header IpHeader; + /// the ICMP header IcmpHeader IcmpPayloadHeader; + /// the ICMP data IcmpData IcmpPayloadData; }; diff --git a/src/link/linkstatusanalyzer.h b/src/link/linkstatusanalyzer.h index 3414bc7..b08f376 100644 --- a/src/link/linkstatusanalyzer.h +++ b/src/link/linkstatusanalyzer.h @@ -62,17 +62,17 @@ private: 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 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; diff --git a/src/link/statusnotifiercommand.h b/src/link/statusnotifiercommand.h index 06e0870..ac7d34b 100644 --- a/src/link/statusnotifiercommand.h +++ b/src/link/statusnotifiercommand.h @@ -32,6 +32,7 @@ private: std::string get_arguments_string() const; private: + /// the command string used to notify the status std::string CommandStr; }; -- 1.7.1