Guilherme Maciel Ferreira [Tue, 12 Apr 2011 12:10:07 +0000]
Renamed packages to more appropriate names
- ping to host, because it contains classes to deal with host
- notify to link, contains classes that deal with many hosts, on link basis
Guilherme Maciel Ferreira [Tue, 12 Apr 2011 08:43:25 +0000]
Encapsulated the encode, decode, read and write methods within the IcmpMessagePayload class
- simplify the message classes
Guilherme Maciel Ferreira [Mon, 11 Apr 2011 13:56:15 +0000]
Fixed more problems issued by PC-lint
- alternative initialization to avoid calling virtual methods from constructor
Guilherme Maciel Ferreira [Mon, 11 Apr 2011 13:51:42 +0000]
Fixed more problems issued by PC-lint (3 times now, bad programmer!)
Guilherme Maciel Ferreira [Fri, 8 Apr 2011 15:44:49 +0000]
Increment the replies count when receiving a destination unreachable, avoiding the request timeout message
Guilherme Maciel Ferreira [Fri, 8 Apr 2011 15:39:19 +0000]
Separate method to print the timeout of a echo request
Guilherme Maciel Ferreira [Fri, 8 Apr 2011 15:21:03 +0000]
Found an issue with sequence number
Guilherme Maciel Ferreira [Fri, 8 Apr 2011 14:34:53 +0000]
Pinger now handles ICMP Destination Unreachable messages
- handle_receive_echo_reply rename to handle_receive_icmp_packet, once it handles not just echo replies
- timer member variable has a more meaningful name
Guilherme Maciel Ferreira [Fri, 8 Apr 2011 13:25:27 +0000]
Refactoring the ICMP message parsing
- IcmpType enum separated from the IcmpHeader class, thus it has its own header without requiring to add the IcmpHeader's header file
- the IcmpHeader class delegates the parsing polymorphically to specialized IcmpMessage classes (i.e. allowing the parsing of Destination unreachable messages)
- IcmpHeader class does not requires the Payload member variable anymore, once it delegates the parsing to IcmpMessage classes
Guilherme Maciel Ferreira [Fri, 8 Apr 2011 11:35:29 +0000]
More meaningful name for timer objects.
Guilherme Maciel Ferreira [Thu, 7 Apr 2011 13:50:35 +0000]
Given more meaningful names to the variables
Guilherme Maciel Ferreira [Thu, 7 Apr 2011 10:57:01 +0000]
More wish list items
Guilherme Maciel Ferreira [Thu, 7 Apr 2011 10:54:37 +0000]
Implemented the requirement "Support selection of the source network interface, so we can change the source ip address when ping"
- unfortunately, I couldn't find a way to bind to an interface through Bosst Asio. So it was required to rely on native Unix Socket interface.
Guilherme Maciel Ferreira [Thu, 7 Apr 2011 10:47:17 +0000]
Reading the network interface from the configuration file.
Guilherme Maciel Ferreira [Tue, 5 Apr 2011 09:58:47 +0000]
Fixed more problems issued by PC-lint.
Guilherme Maciel Ferreira [Tue, 5 Apr 2011 07:23:21 +0000]
Message aesthetical improvement
Guilherme Maciel Ferreira [Mon, 4 Apr 2011 10:14:30 +0000]
Removed the address resolution from the pinger.
- There is a special class to translate DNS to IP, thus makes no sense to keep this feature here, which simplify this class.
Guilherme Maciel Ferreira [Fri, 1 Apr 2011 07:31:42 +0000]
Fixed problems issued by PC-lint.
Guilherme Maciel Ferreira [Thu, 31 Mar 2011 10:13:06 +0000]
Included the unit in the variable names
- states clear that we expect seconds, minutes or whatever
Guilherme Maciel Ferreira [Wed, 30 Mar 2011 10:12:21 +0000]
Implemented the requirement "If we notified an external system that a link is down, also notify it if the link is back up (=stable for a configurable period of time)"
- the status of the link is reported only once, when it changes from down to up, or vice versa
- allows to configure the minimum amount of time the link must stays stable in order to report its status
Guilherme Maciel Ferreira [Wed, 30 Mar 2011 10:06:24 +0000]
Found another BUG (its capitalization gives a hint about the severity of this one)
Guilherme Maciel Ferreira [Tue, 29 Mar 2011 14:24:57 +0000]
Standardizing the enumerations
Guilherme Maciel Ferreira [Tue, 29 Mar 2011 08:03:52 +0000]
Renamed stable-link-up-interval to link-up-interval
Guilherme Maciel Ferreira [Mon, 28 Mar 2011 11:50:28 +0000]
Fixed return value, should be string, not boolean
Guilherme Maciel Ferreira [Mon, 28 Mar 2011 09:19:39 +0000]
Included boost system to the required libraries
Guilherme Maciel Ferreira [Fri, 25 Mar 2011 16:45:06 +0000]
Renamed StatusNotifier to LinkStatusAnalyzer
- the main purpose of this class is to decide whether the link is down or up, by keeping track the amount of hosts down.
- renamed the variable Analyzer to HostAnalyzer to avoid confusion with the LinkAnalyzer
Guilherme Maciel Ferreira [Fri, 25 Mar 2011 15:58:20 +0000]
Renamed PingAnalyzer to HostStatusAnalyzer
- this describes better what the class is suppode to do, analyze the status of the host, using the pings.
Thomas Jarosch [Mon, 28 Mar 2011 09:27:33 +0000]
Add TODO entry
Guilherme Maciel Ferreira [Fri, 25 Mar 2011 14:30:22 +0000]
Read the configured interval that a link must be up to notify
Guilherme Maciel Ferreira [Fri, 25 Mar 2011 13:53:30 +0000]
Placed limit qualifier in the end of variables names (i.e. xxx_limit instead of limit_xxx)
- this keeps a pleasing symmetry with other qualifiers, for example xxx_count, xxx_limit, xxx_index
Guilherme Maciel Ferreira [Fri, 25 Mar 2011 09:02:51 +0000]
Renamed PingAnalyzer's update_ping_failed_statistics() to analyze_ping_failed_count()
Guilherme Maciel Ferreira [Fri, 25 Mar 2011 09:37:45 +0000]
Improved asserts
Guilherme Maciel Ferreira [Thu, 24 Mar 2011 13:51:47 +0000]
Implemented the requirement "Intelligently retry if a host doesn't reply: Try it more often"
- PingAnalyzer::exceeded_ping_failed_count_limit() made public, thus the Analyzer can check when is required to speed up the ping (or back to the original interval)
- Included a PingInterval template class to hide the computation logic of interval speed up and slow down
Guilherme Maciel Ferreira [Thu, 24 Mar 2011 13:46:10 +0000]
Attributes names according to the company's coding style.
Guilherme Maciel Ferreira [Thu, 24 Mar 2011 10:35:15 +0000]
Renamed PingStatusNotifier to StatusNotifier
- the class scope is not restricted to ping status notification, it is
responsible to notify the system when certain amount of hosts are down,
independently of the number of pings given to that host.
Guilherme Maciel Ferreira [Wed, 23 Mar 2011 16:53:00 +0000]
Included script to notify when system is down or up
Guilherme Maciel Ferreira [Wed, 23 Mar 2011 16:11:04 +0000]
Added the requirement "If XX servers don't reply, it has to notify another system (e.g. execute a script)"
- moved the class PingStatusNotifier from ping to notify directory.
- included a new class that encapsulate the process of system notification
Guilherme Maciel Ferreira [Wed, 23 Mar 2011 12:48:53 +0000]
Linking against libi2ncommon
Guilherme Maciel Ferreira [Wed, 23 Mar 2011 10:42:49 +0000]
Renamed PingStatusNotifier::alert_host_up/down() methods to notify_host_up/down()
Guilherme Maciel Ferreira [Wed, 23 Mar 2011 10:37:30 +0000]
Added intelligence to know how many hosts are down
Guilherme Maciel Ferreira [Wed, 23 Mar 2011 10:38:29 +0000]
Const-ification
Guilherme Maciel Ferreira [Wed, 23 Mar 2011 09:39:25 +0000]
Reorganization of cmake files
- included package build
- layout change (don't know why package system was complaining about white spaces in the commands)
- redistribuition of the commands across the files
Guilherme Maciel Ferreira [Wed, 23 Mar 2011 09:37:31 +0000]
Included spec file to build the RPM package
Guilherme Maciel Ferreira [Tue, 22 Mar 2011 10:02:39 +0000]
Removed UML file, because it is out-dated and is not longer required.
Guilherme Maciel Ferreira [Tue, 22 Mar 2011 09:40:55 +0000]
Removed Pinger abstract class, thus avoiding the "design ahead" issue
- BoostPinger do not inherit form Pinger anymore
- reference from Code Complete 2nd edition, page 146, item "Be suspicious of base classes of which there is only one derived class"
Guilherme Maciel Ferreira [Tue, 22 Mar 2011 09:31:58 +0000]
Changed PingStatusNotifier interface, it is now an object shared among N hosts
- this shared property allows to know how many hosts are down, once we can keep track of all hosts
- only one PingStatusNotifier instance for all PingAnalyzers objects, they pass the host to identify themselves within the notifier object
Guilherme Maciel Ferreira [Tue, 22 Mar 2011 08:49:21 +0000]
Added status-notifier-cmd options to indicate which command to call when the system is down/up.
Guilherme Maciel Ferreira [Mon, 21 Mar 2011 14:58:20 +0000]
The limit-ping-fail option is available (and read) from the configuration file
- this option sets the threshold of pings to a host that must fail in order to mark the host as down.
Guilherme Maciel Ferreira [Mon, 21 Mar 2011 09:51:09 +0000]
Renamed the limit-to-notify configuration option to limit-hosts-down, because it is a better description of the intention.
Guilherme Maciel Ferreira [Fri, 18 Mar 2011 16:50:04 +0000]
Replaced uint by int.
- documented that a integer is non-negative using assertions, not unsigned int (uint).
Guilherme Maciel Ferreira [Fri, 18 Mar 2011 11:39:53 +0000]
Handle the error when a host cannot be resolved
- reorganization of PingScheduler to do not ping a host that was not resolved
- from now, the DnsResolver::resolve() method must be explicitly called by the client of the class
Guilherme Maciel Ferreira [Fri, 18 Mar 2011 11:30:55 +0000]
Errors flushed through cerr not cout.
Guilherme Maciel Ferreira [Fri, 18 Mar 2011 11:29:40 +0000]
Included an invalid host and a host that does not reply.
Guilherme Maciel Ferreira [Fri, 18 Mar 2011 09:47:50 +0000]
More bugs discovered and annotated
Guilherme Maciel Ferreira [Tue, 15 Mar 2011 10:55:50 +0000]
Uses the ping analyzer to evaluate the ping statistics after each ping.
Guilherme Maciel Ferreira [Tue, 15 Mar 2011 11:26:59 +0000]
Returns the amount of IPs that were resolved for the DNSResolver host.
Guilherme Maciel Ferreira [Tue, 15 Mar 2011 11:25:35 +0000]
Returns a boolean indicating if the ping was successful or not.
Guilherme Maciel Ferreira [Tue, 15 Mar 2011 10:48:05 +0000]
Bring aboard the ping analyze and notification classes.
- PingAnalyzer implements the requirement to analyze if there are multiple dns entries for a host, only call this host "failed" if can't reach any of these multiple entries.
- PingStatusNotifier implements the requirement to notify an external system that a link is down, also notify it if the link is back up.But needs improvements.
Guilherme Maciel Ferreira [Mon, 14 Mar 2011 14:44:25 +0000]
Replaced the times-to-ping parameter to simplify the code, now it pings just one time and uses a status on/off approach to check if the ping was performed.
- also BoostPinger::create_echo_request() method is const and self sufficient, use parameter instead of changing the SequenceNumber member variable
Guilherme Maciel Ferreira [Mon, 14 Mar 2011 12:42:55 +0000]
Re-organizing the headers files in order to...
- avoid hidden dependencies, by including the class header file first.
- keep a inclusion order of C headers, C++ headers, Boost headers and Project headers.
- be relative to the source directory, this keeps clear which package the source file belongs.
Guilherme Maciel Ferreira [Mon, 14 Mar 2011 12:44:52 +0000]
Explicit constructor to avoid implicit constructor-conversions-calls
Guilherme Maciel Ferreira [Fri, 11 Mar 2011 10:02:15 +0000]
PingScheduler now pings hosts IPs cyclically
- included a DNS resolver member variable to keep track of resolved IPs
- PingScheduler's constructor takes specific arguments instead of a generic Host object, this states clear which data the PingScheduler needs
Guilherme Maciel Ferreira [Fri, 11 Mar 2011 09:26:59 +0000]
Bring aboard the first scratch of a DNS resolver
- given a host DNS, this class resolves and keeps a list of IPs for that host
Guilherme Maciel Ferreira [Fri, 11 Mar 2011 09:48:39 +0000]
Aesthetic change to header files according to the project standard
Guilherme Maciel Ferreira [Thu, 10 Mar 2011 10:22:43 +0000]
Code improvements on BoostPinger
- included an assert to make sure a non-empty address is sent to the socket
- better names for the handlers methods
Guilherme Maciel Ferreira [Thu, 10 Mar 2011 14:34:25 +0000]
Moved Host class from ping directory to config directory, because it is a configuration item
Guilherme Maciel Ferreira [Thu, 10 Mar 2011 10:26:09 +0000]
Added TODO file, including known bugs report
Guilherme Maciel Ferreira [Thu, 10 Mar 2011 10:21:00 +0000]
More descriptions of the configuration in the Readme file
Guilherme Maciel Ferreira [Wed, 9 Mar 2011 09:40:34 +0000]
The echo reply timeout can be configured through parameter to BoostPinger
Guilherme Maciel Ferreira [Wed, 9 Mar 2011 08:47:23 +0000]
Renamed PingCheck class to PingScheduler.
- this name describes better the main purpose behind this class, which is to call the pinger in configured intervals
Guilherme Maciel Ferreira [Tue, 8 Mar 2011 17:56:29 +0000]
The application now pings many hosts in parallel
- uses an asynchronous approach, based on boost::asio::io_service::run() loop and asynchronous timers
Guilherme Maciel Ferreira [Tue, 8 Mar 2011 17:52:14 +0000]
Attribute renamed according to the code conventions
Guilherme Maciel Ferreira [Tue, 8 Mar 2011 17:51:37 +0000]
Included a section explaining the basics of the code
Guilherme Maciel Ferreira [Tue, 8 Mar 2011 10:14:28 +0000]
Code improvements
- stratified some functionalities into other methods;
- const-correctness
- added variables to clarify code
Guilherme Maciel Ferreira [Tue, 8 Mar 2011 09:01:53 +0000]
Removed unused class: PingManager
Guilherme Maciel Ferreira [Mon, 7 Mar 2011 15:35:45 +0000]
Removed unused header files
Guilherme Maciel Ferreira [Mon, 7 Mar 2011 14:30:28 +0000]
Fixed assertion range on times_to_ping
Guilherme Maciel Ferreira [Mon, 7 Mar 2011 09:17:18 +0000]
Changed integer types from std::size_t to uint, where it is required ordinary numbers
Guilherme Maciel Ferreira [Fri, 4 Mar 2011 16:22:51 +0000]
More information in the Readme file
Guilherme Maciel Ferreira [Fri, 4 Mar 2011 15:14:59 +0000]
The app reads a list of hosts instead of just one
Caveat: it pings the host sequentially, this is not the desirable behavior
Guilherme Maciel Ferreira [Thu, 3 Mar 2011 16:33:11 +0000]
Removed all namespace's "using" from header files (check C++ Coding Standards #59)
- writing headers with full namespace qualifiers to avoid type collision
- writing "using" only in implementation files to save namespace qualifier writing
Guilherme Maciel Ferreira [Thu, 3 Mar 2011 16:30:11 +0000]
Renamed config directory to conf, in order to avoid confusion with the directory name inside src
Guilherme Maciel Ferreira [Thu, 3 Mar 2011 15:15:10 +0000]
Moved ICMP abstraction classes to the icmp directory, leaving the ping directory only for ping classes
Guilherme Maciel Ferreira [Thu, 3 Mar 2011 10:38:24 +0000]
Moved PingCheck class to its own file, replaced the old one with a new semantic.
Guilherme Maciel Ferreira [Wed, 2 Mar 2011 16:53:00 +0000]
The program now pings in configured intervals
- the code is functional, but requires improvements!
Guilherme Maciel Ferreira [Wed, 2 Mar 2011 16:51:47 +0000]
Organizing the member functions according to the IPv4 header description
Guilherme Maciel Ferreira [Wed, 2 Mar 2011 16:50:32 +0000]
Avoiding unamed variables (they kill readability)
Guilherme Maciel Ferreira [Tue, 1 Mar 2011 15:01:57 +0000]
Pinger interface now allows to specify the number of pings to perform
Guilherme Maciel Ferreira [Tue, 1 Mar 2011 14:58:00 +0000]
Defined a rule for variable and constant numeric types
- using std::size_t for ordinary integers, those that do not impose size constraints
- using uint32_t, uint16_t or uint_8_t for integers which require specific sizes
Guilherme Maciel Ferreira [Mon, 28 Feb 2011 13:59:17 +0000]
Created an ICMP packet class abstraction and modularizing the BoostPinger
- Hide the ICMP packet management from BoostPinger class
- Split functionality in other methods (e.g send_echo_request() and print_echo_reply()
Guilherme Maciel Ferreira [Mon, 28 Feb 2011 10:49:31 +0000]
The method BoostPinger::get_identifier() is not static anymore, this allows to have more than one BoostPinger object at the same time
Guilherme Maciel Ferreira [Mon, 28 Feb 2011 10:30:47 +0000]
Renamed IcmpBody to IcmpData according to the RFC 792 (Echo or Echo Reply Message section)
Guilherme Maciel Ferreira [Mon, 28 Feb 2011 09:06:00 +0000]
Changed the ping() method interface, which requires just a destination string instead of a whole Host object
Guilherme Maciel Ferreira [Mon, 28 Feb 2011 08:31:09 +0000]
The BoostPinger now pings N times, instead of infinite pinging
- moved the io_service calls to inside the BoostPinger
- splited the BoostPinger::start_send(), the code responsible to send is inside BoostPinger::send()
Guilherme Maciel Ferreira [Fri, 25 Feb 2011 11:10:30 +0000]
Renamed the ipv4_header files to ipv4header, removed the '_' to keep the project standard
Guilherme Maciel Ferreira [Fri, 25 Feb 2011 11:10:30 +0000]
Renamed the ipv4_header files to ipv4header, removed the '_' to keep the project standard
Guilherme Maciel Ferreira [Fri, 25 Feb 2011 11:01:05 +0000]
Read the interval between each ping to the host
Guilherme Maciel Ferreira [Fri, 25 Feb 2011 10:56:32 +0000]
Refactored the checksum calculation and IcmpHeader class
- Included the checksum in the IcmpHeader constructor
- Created a type for ICMP package body, namely Icmpbody
- Transformed the compute_checksum template function into a template class, ChecksumCalculator, and defined an specialization type, namely IcmpChecksumCalculator
Guilherme Maciel Ferreira [Fri, 25 Feb 2011 10:32:02 +0000]
Renamed the icmp_header files to icmpheader, removed the '_' to keep the project standard
Guilherme Maciel Ferreira [Thu, 24 Feb 2011 15:13:33 +0000]
Added a constructor with arguments and reinforce the "ICMP type" variable's type