pingcheck
13 years agoReplaced shift operations on IP addresses to an endian-safer approach
Guilherme Maciel Ferreira [Sat, 6 Aug 2011 19:33:09 +0000]
Replaced shift operations on IP addresses to an endian-safer approach
- Instead of shifts on sockaddr.sa_data, uses a cast to sockaddr_in.sin_addr.s_addr.
  And as long as the two structures have the same memory layout, the cast is safe.
- Reinterpret four chars (8 bits) as one integer (32 bits), and make it endian safe.

13 years agoValidates the ifr.ifr_name buffer size before copy (Thomas's advice)
Guilherme Maciel Ferreira [Sat, 6 Aug 2011 17:52:07 +0000]
Validates the ifr.ifr_name buffer size before copy (Thomas's advice)

13 years agoPinger factory provides only static (class) methods, thus do not require public const...
Guilherme Maciel Ferreira [Thu, 4 Aug 2011 00:57:07 +0000]
Pinger factory provides only static (class) methods, thus do not require public constructor and destructor.

13 years agoSet the received status as successful when the RST match what was expected.
Guilherme Maciel Ferreira [Thu, 4 Aug 2011 01:16:28 +0000]
Set the received status as successful when the RST match what was expected.

13 years agoLittle code format detail
Guilherme Maciel Ferreira [Thu, 4 Aug 2011 01:13:59 +0000]
Little code format detail

13 years agoPlaced start_receive() method closer to the schedule_timeout_echo_reply(), where...
Guilherme Maciel Ferreira [Tue, 2 Aug 2011 10:40:33 +0000]
Placed start_receive() method closer to the schedule_timeout_echo_reply(), where it gets called.

13 years agoChanged the handle_timeout() method to handle_ping_done()
Guilherme Maciel Ferreira [Tue, 2 Aug 2011 10:33:05 +0000]
Changed the handle_timeout() method to handle_ping_done()
- now it calls the ping call back function
- and do not schedule the next ping anymore, let it to the callback responsability

13 years agoRenamed create_tcp_header() method to create_ack_request()
Guilherme Maciel Ferreira [Tue, 2 Aug 2011 10:19:29 +0000]
Renamed create_tcp_header() method to create_ack_request()

13 years agoMove the ACK segment send functionality to the send_ack_request() method
Guilherme Maciel Ferreira [Tue, 2 Aug 2011 10:12:57 +0000]
Move the ACK segment send functionality to the send_ack_request() method

13 years agoSplit the method, separated some functionality in schedule_timeout_rst_reply()
Guilherme Maciel Ferreira [Tue, 2 Aug 2011 09:58:07 +0000]
Split the method, separated some functionality in schedule_timeout_rst_reply()

13 years agoRenamed timeout variable to the context of TCP instead of ICMP
Guilherme Maciel Ferreira [Tue, 2 Aug 2011 01:20:36 +0000]
Renamed timeout variable to the context of TCP instead of ICMP

13 years agoSequence number does not identify a particular segment, it is always the same
Guilherme Maciel Ferreira [Tue, 2 Aug 2011 01:01:54 +0000]
Sequence number does not identify a particular segment, it is always the same

13 years agoMissing header files and identation
Guilherme Maciel Ferreira [Mon, 1 Aug 2011 00:15:26 +0000]
Missing header files and identation

13 years agoRetrieve the local IP address from the interface using the low level ioctl, plus...
Guilherme Maciel Ferreira [Mon, 1 Aug 2011 00:12:48 +0000]
Retrieve the local IP address from the interface using the low level ioctl, plus some code enhancements

13 years agoAdded and formatted some error messages
Guilherme Maciel Ferreira [Thu, 9 Jun 2011 19:41:34 +0000]
Added and formatted some error messages

13 years agoSplit methods
Guilherme Maciel Ferreira [Sun, 24 Jul 2011 00:18:34 +0000]
Split methods
- create_tcp_header() to create the TCP header for ACK ping
- print_rst_reply() to print the TCP header for RST reply

13 years agoCosmetic changes
Guilherme Maciel Ferreira [Sun, 24 Jul 2011 00:12:49 +0000]
Cosmetic changes
- improved variable names
- added "Warning" to some logs

13 years agoRemoved commentted code
Guilherme Maciel Ferreira [Sun, 24 Jul 2011 00:11:18 +0000]
Removed commentted code

13 years agoFormatting log messages
Guilherme Maciel Ferreira [Fri, 22 Jul 2011 03:49:19 +0000]
Formatting log messages

13 years agoWorking TCP pinger
Guilherme Maciel Ferreira [Fri, 22 Jul 2011 03:47:22 +0000]
Working TCP pinger
- Needs to fix the source IP address used in the pseudo IP header

13 years agoSplit the TcpHeader implementation and header
Guilherme Maciel Ferreira [Fri, 22 Jul 2011 02:16:37 +0000]
Split the TcpHeader implementation and header

13 years agoRemoved the unused get_identifier() method
Guilherme Maciel Ferreira [Fri, 22 Jul 2011 02:09:28 +0000]
Removed the unused get_identifier() method

13 years agoSmall code formatting
Guilherme Maciel Ferreira [Fri, 22 Jul 2011 02:08:19 +0000]
Small code formatting

13 years agoFixed socket typedef, it is a raw socket, not stream socket
Guilherme Maciel Ferreira [Fri, 22 Jul 2011 02:05:55 +0000]
Fixed socket typedef, it is a raw socket, not stream socket

13 years agoAdded the default protocol to use in the config file
Guilherme Maciel Ferreira [Thu, 21 Jul 2011 00:27:47 +0000]
Added the default protocol to use in the config file

13 years agoBetter comment description
Guilherme Maciel Ferreira [Thu, 21 Jul 2011 00:26:43 +0000]
Better comment description

13 years agoFixed the return statement, the method has the return statement in the correct place
Guilherme Maciel Ferreira [Thu, 21 Jul 2011 00:13:29 +0000]
Fixed the return statement, the method has the return statement in the correct place

13 years agoFully functional pinger factory
Guilherme Maciel Ferreira [Tue, 19 Jul 2011 01:26:01 +0000]
Fully functional pinger factory

13 years agoAdded the remaining TCP pinger arguments
Guilherme Maciel Ferreira [Tue, 19 Jul 2011 01:22:22 +0000]
Added the remaining TCP pinger arguments
- still not working, but the skeleton is done

13 years agoCode formatting
Guilherme Maciel Ferreira [Tue, 19 Jul 2011 01:19:28 +0000]
Code formatting

13 years agoSolving some conversion and variable shadow warnings
Guilherme Maciel Ferreira [Sat, 16 Jul 2011 22:36:20 +0000]
Solving some conversion and variable shadow warnings

13 years agoAdding the ping protocol configuration option
Guilherme Maciel Ferreira [Fri, 15 Jul 2011 02:38:29 +0000]
Adding the ping protocol configuration option

13 years agoMoving the PingProtocol enumeration from PingerFactory to its own file
Guilherme Maciel Ferreira [Fri, 15 Jul 2011 02:36:08 +0000]
Moving the PingProtocol enumeration from PingerFactory to its own file
- Added a method to convert from string to the enumeration

13 years agoThe "using namespace std" exempt the use of "std::" qualifier
Guilherme Maciel Ferreira [Thu, 14 Jul 2011 03:27:00 +0000]
The "using namespace std" exempt the use of "std::" qualifier

13 years agoNote to myself: rework the checksum to use it also in the TCP stuff
Guilherme Maciel Ferreira [Sun, 10 Jul 2011 03:28:16 +0000]
Note to myself: rework the checksum to use it also in the TCP stuff

13 years agoFixed include guards name
Guilherme Maciel Ferreira [Sun, 10 Jul 2011 03:27:28 +0000]
Fixed include guards name

13 years agoBring aboard the TCP header and support classes
Guilherme Maciel Ferreira [Sun, 10 Jul 2011 03:20:30 +0000]
Bring aboard the TCP header and support classes
- Tested with a TCP ping prototype, solved the checksum issue
- Needs to be polished

13 years agoBring aboard a aternative version of Boost's TCP protocol
Guilherme Maciel Ferreira [Sun, 10 Jul 2011 02:33:29 +0000]
Bring aboard a aternative version of Boost's TCP protocol
- This version allows low level socket manipulation of TCP segments, whereas the SOCK_STREAM doesn't allow.

13 years agoMoved the IP classes to its own directory.
Guilherme Maciel Ferreira [Sun, 10 Jul 2011 01:57:00 +0000]
Moved the IP classes to its own directory.

13 years agoComment to avoid warning
Guilherme Maciel Ferreira [Tue, 28 Jun 2011 00:41:38 +0000]
Comment to avoid warning

13 years agoCalling set_ping_status() in ping function and added some documentation
Guilherme Maciel Ferreira [Thu, 23 Jun 2011 18:26:14 +0000]
Calling set_ping_status() in ping function and added some documentation

13 years agoBring aboard the Ping factory
Guilherme Maciel Ferreira [Thu, 23 Jun 2011 18:32:22 +0000]
Bring aboard the Ping factory

13 years agoUsing inheritance to commute between pingers
Guilherme Maciel Ferreira [Thu, 23 Jun 2011 18:40:43 +0000]
Using inheritance to commute between pingers

13 years agoModified configuration file
Guilherme Maciel Ferreira [Thu, 23 Jun 2011 16:22:32 +0000]
Modified configuration file

14 years agoRenamed encode/decode to encode16/decode16
Guilherme Maciel Ferreira [Mon, 6 Jun 2011 17:55:05 +0000]
Renamed encode/decode to encode16/decode16
- specify the number of bits it encodes/decodes
- planning support for encode/decode of 32 bits used by TCP header

14 years agoReplaced the assert by a conditional
Guilherme Maciel Ferreira [Fri, 3 Jun 2011 20:00:41 +0000]
Replaced the assert by a conditional
- because the amount of data received can differ from the amount we expect, but this cannot make the application to abort.

14 years agoBring aboard TCP pinger class
Guilherme Maciel Ferreira [Sun, 29 May 2011 20:37:24 +0000]
Bring aboard TCP pinger class

14 years agoMoved the icmppinger from host to icmp folder
Guilherme Maciel Ferreira [Sun, 29 May 2011 15:21:29 +0000]
Moved the icmppinger from host to icmp folder

14 years agoIncluded a precondition to DnsResolver::handle_ip_address()
Guilherme Maciel Ferreira [Thu, 19 May 2011 23:49:54 +0000]
Included a precondition to DnsResolver::handle_ip_address()

14 years agoAdded a tip in the Readme
Guilherme Maciel Ferreira [Thu, 19 May 2011 23:48:28 +0000]
Added a tip in the Readme

14 years agoRenamed BoostPinger to IcmpPinger
Guilherme Maciel Ferreira [Thu, 19 May 2011 23:46:50 +0000]
Renamed BoostPinger to IcmpPinger
- the TCP pinger will be another class to avoid overloading this one with TCP stuff
- the name looks better =)

14 years agoMinimum version required of Boost is 1.44
Guilherme Maciel Ferreira [Fri, 13 May 2011 23:17:37 +0000]
Minimum version required of Boost is 1.44

14 years agoFirst public commit
Thomas Jarosch [Fri, 13 May 2011 09:36:56 +0000]
First public commit

14 years agoDon't package files from kdevelop
Thomas Jarosch [Thu, 12 May 2011 08:39:07 +0000]
Don't package files from kdevelop

14 years agoStarted PC-Lint settings file
Thomas Jarosch [Thu, 12 May 2011 08:38:46 +0000]
Started PC-Lint settings file

14 years agoImprove packaging: Include correct license files
Thomas Jarosch [Thu, 12 May 2011 08:37:10 +0000]
Improve packaging: Include correct license files

14 years agoAdd GPLv2 + linking exception to the source
Thomas Jarosch [Thu, 12 May 2011 08:36:06 +0000]
Add GPLv2 + linking exception to the source

14 years agoRemove t2n call stuff
Thomas Jarosch [Thu, 12 May 2011 08:19:34 +0000]
Remove t2n call stuff

14 years agoAdd boost license + proper copyright were needed
Thomas Jarosch [Thu, 12 May 2011 08:18:14 +0000]
Add boost license + proper copyright were needed

14 years agoUpdate TODO list
Thomas Jarosch [Wed, 11 May 2011 15:22:20 +0000]
Update TODO list

14 years agoProperly handle ICMP packet replies: The kernel sends us a copy of all incoming ICMP...
Thomas Jarosch [Wed, 11 May 2011 15:04:44 +0000]
Properly handle ICMP packet replies: The kernel sends us a copy of all incoming ICMP messages on every ICMP socket

14 years agoTurn RepliesCount into ReceivedReply flag
Thomas Jarosch [Thu, 5 May 2011 07:36:44 +0000]
Turn RepliesCount into ReceivedReply flag

14 years agoUpdate TODO file
Thomas Jarosch [Thu, 5 May 2011 07:24:27 +0000]
Update TODO file

14 years agoAdded doxygen comments in the most important places.
Guilherme Maciel Ferreira [Wed, 4 May 2011 16:26:27 +0000]
Added doxygen comments in the most important places.

14 years agoTurn BoostPinger into true async operation
Thomas Jarosch [Wed, 4 May 2011 16:10:38 +0000]
Turn BoostPinger into true async operation

14 years agoNo rescheduling in BoostPinger
Thomas Jarosch [Wed, 4 May 2011 15:01:15 +0000]
No rescheduling in BoostPinger

14 years agoImplemented the feature:
Guilherme Maciel Ferreira [Wed, 4 May 2011 13:29:20 +0000]
Implemented the feature:
- Make the link down interval also configurable. Today it is possible just to
  configure the amount of time the link must to be up to notify. Do another
  configuration to allow the time of link down.

14 years agoTwo TODO entrys solved
Thomas Jarosch [Wed, 4 May 2011 13:40:14 +0000]
Two TODO entrys solved

14 years agoReuse BoostPinger object
Thomas Jarosch [Wed, 4 May 2011 13:39:50 +0000]
Reuse BoostPinger object

14 years agoFix ping of IP addresses (don't do DNS lookup)
Thomas Jarosch [Wed, 4 May 2011 09:59:43 +0000]
Fix ping of IP addresses (don't do DNS lookup)

14 years agoSolved the item:
Guilherme Maciel Ferreira [Wed, 4 May 2011 09:41:06 +0000]
Solved the item:
- Perform a better treatment of missing configuration items, actually the
  application just crashes.

All items that are strictly required have default values, or are checked against
valid values. The last item missing was nameserver, which has a default value now.

14 years agoAlternative approach to solve:
Guilherme Maciel Ferreira [Wed, 4 May 2011 08:50:49 +0000]
Alternative approach to solve:
- If one of the "[host]" in the configuration file omit the "interval" entry,
  the application uses the next "[host]"'s "interval" entry, instead of a
  default value. The problem is specific to the configuration read classes
  that are not smart enough to verify which "[host]" have this entry and which
  don't.
  Example:
     [host]
     name=A
     [host]
     name=B
     interval=1
     [host]
     name=C
     interval=3
  Thus, the tuples will be (A,1) , (B,3), (C,?), but A should have a default
  value, instead of borrow B's value.

The approach consists of ensure the program only runs if there is an interval
for every single host.

14 years agoAllowing unknown options and changed the default host down limit to 0
Guilherme Maciel Ferreira [Wed, 4 May 2011 08:22:45 +0000]
Allowing unknown options and changed the default host down limit to 0

14 years agoClean thread shutdown
Thomas Jarosch [Tue, 3 May 2011 13:30:03 +0000]
Clean thread shutdown

14 years agoRemove boost signal handler: It's overdesigned for our use case and creates another...
Thomas Jarosch [Tue, 3 May 2011 12:55:40 +0000]
Remove boost signal handler: It's overdesigned for our use case and creates another thread just to wait for signals

14 years agoHandle signals in a thread safe way
Thomas Jarosch [Tue, 3 May 2011 12:53:35 +0000]
Handle signals in a thread safe way

14 years agoConvert signal handler library to unix line endings
Thomas Jarosch [Tue, 3 May 2011 11:37:37 +0000]
Convert signal handler library to unix line endings

14 years agoCreate unique identifier for every ping
Thomas Jarosch [Tue, 3 May 2011 09:56:41 +0000]
Create unique identifier for every ping

14 years agoMoved the boost signal handler library
Guilherme Maciel Ferreira [Tue, 3 May 2011 09:06:06 +0000]
Moved the boost signal handler library

14 years agoUpdated TODO
Guilherme Maciel Ferreira [Tue, 3 May 2011 09:04:44 +0000]
Updated TODO

14 years agoThe multi-threading approach solves the blocking
Guilherme Maciel Ferreira [Tue, 3 May 2011 08:34:09 +0000]
The multi-threading approach solves the blocking

14 years agoMerge branch 'pingcheck' of ssh://aqua.m.i2n/data/git/intranator/source into pingcheck
Guilherme Maciel Ferreira [Tue, 3 May 2011 08:26:30 +0000]
Merge branch 'pingcheck' of ssh://aqua.m.i2n/data/git/intranator/source into pingcheck

14 years agoTODO changes
Guilherme Maciel Ferreira [Tue, 3 May 2011 08:12:34 +0000]
TODO changes

14 years agoworking signal handler
Guilherme Maciel Ferreira [Tue, 3 May 2011 08:10:15 +0000]
working signal handler

14 years agoRenamed project from libpingcheck to pingcheck
Thomas Jarosch [Tue, 3 May 2011 08:04:15 +0000]
Renamed project from libpingcheck to pingcheck

14 years agoUpdate TODO
Thomas Jarosch [Tue, 3 May 2011 08:01:53 +0000]
Update TODO

14 years agoModularization of the main.cpp
Guilherme Maciel Ferreira [Mon, 2 May 2011 16:16:43 +0000]
Modularization of the main.cpp
- semantic order enforced by parameters
- less spaghetti code
- code more readable
- can be moved to a class more easily

14 years agoDefining the LinkStatusAnalyzerItem
Guilherme Maciel Ferreira [Mon, 2 May 2011 16:00:03 +0000]
Defining the LinkStatusAnalyzerItem
- to keep the standard
- to provide the same benefits as the other Item types

14 years agoDefining the type PingSchedulerList as a vector of PingSchedulerItem
Guilherme Maciel Ferreira [Mon, 2 May 2011 15:58:01 +0000]
Defining the type PingSchedulerList as a vector of PingSchedulerItem
- to keep the standard
- same benefits as HostList

14 years agoDefining the type HostList as a vector of HostItem
Guilherme Maciel Ferreira [Mon, 2 May 2011 15:56:16 +0000]
Defining the type HostList as a vector of HostItem
- provides a central point to change the container type
- makes the code more readable
- reduces the amount of code to read

14 years agoStarts pinging immediately, instead of schedule to start "interval" seconds later
Guilherme Maciel Ferreira [Mon, 2 May 2011 12:39:54 +0000]
Starts pinging immediately, instead of schedule to start "interval" seconds later

14 years agoRenamed handle_timeout_echo_reply() to handle_timeout_icmp_packet()
Guilherme Maciel Ferreira [Mon, 2 May 2011 12:17:11 +0000]
Renamed handle_timeout_echo_reply() to handle_timeout_icmp_packet()
- the name is more appropriate once the timeout is not triggered if any kind of ICMP packet arrive, not just echo reply

14 years agoUsing lock_guard to handle mutex locking/unlocking through RAII
Guilherme Maciel Ferreira [Mon, 2 May 2011 11:00:47 +0000]
Using lock_guard to handle mutex locking/unlocking through RAII

14 years agoThe BoostPinger is more picky about received packets, because when running in
Guilherme Maciel Ferreira [Mon, 2 May 2011 10:30:42 +0000]
The BoostPinger is more picky about received packets, because when running in
parallel with other BoostPingers, it could receive echo replies from any host,
leading to things like:
    26 bytes from 209.85.149.104: icmp_seq=1 ttl=54 time=24 ms   <-- pinger A received packet from host A
    26 bytes from 209.85.149.104: icmp_seq=1 ttl=54 time=1999 ms <-- pinger B received packet from host A??
     - Host up: www.postbank.de                                  <-- what? You didn't receive any packet from the host you had ping
     - Stick to the original ping interval: 10s
     - Time elapsed since last ping: 12s                         <-- OK, pinger A parsed the packet from host A
     - Stick to the original ping interval: 5s
     - Time elapsed since last ping: 6s                          <-- WRONG, pinger B should not parse the packet from host A

14 years agoRunning the BoostPingers in parallel (multi-thread approach instead of assynchronous)
Guilherme Maciel Ferreira [Mon, 2 May 2011 10:21:46 +0000]
Running the BoostPingers in parallel (multi-thread approach instead of assynchronous)

14 years agoRemoved fixed bugs
Guilherme Maciel Ferreira [Mon, 2 May 2011 09:58:57 +0000]
Removed fixed bugs

14 years agoAdded a mutex to avoid data race conditions in the shared link status object
Guilherme Maciel Ferreira [Mon, 2 May 2011 07:37:37 +0000]
Added a mutex to avoid data race conditions in the shared link status object

14 years agoBetter comments
Guilherme Maciel Ferreira [Fri, 29 Apr 2011 13:41:25 +0000]
Better comments

14 years agoIntroduce connd pingcheck subsystem based upon NTP subsystem
Thomas Jarosch [Fri, 29 Apr 2011 14:08:53 +0000]
Introduce connd pingcheck subsystem based upon NTP subsystem

fooo

14 years agoSeparated the endpoint creation in a method
Guilherme Maciel Ferreira [Fri, 29 Apr 2011 11:46:38 +0000]
Separated the endpoint creation in a method