pingcheck
13 years agoAdjusting some comments
Guilherme Maciel Ferreira [Thu, 10 Nov 2011 07:07:20 +0000]
Adjusting some comments

13 years agoNew method to get the network interface IP address
Guilherme Maciel Ferreira [Tue, 8 Nov 2011 10:02:12 +0000]
New method to get the network interface IP address
- Using Boost.Asio objects instead of a primitive data type (under development).

13 years agoUsing Boost.Asio protocol type instead of the enumeration and adding ICMPv6 ping
Guilherme Maciel Ferreira [Tue, 8 Nov 2011 09:45:39 +0000]
Using Boost.Asio protocol type instead of the enumeration and adding ICMPv6 ping

13 years agoDelegating the segment creation and printing to more specialized classes
Guilherme Maciel Ferreira [Sun, 6 Nov 2011 21:58:40 +0000]
Delegating the segment creation and printing to more specialized classes

13 years agoEphemeral source port calculation moved to a method(), mirroring the destination...
Guilherme Maciel Ferreira [Sun, 6 Nov 2011 21:47:24 +0000]
Ephemeral source port calculation moved to a method(), mirroring the destination port.

13 years agoRenamed variable, most significant noun first
Guilherme Maciel Ferreira [Sun, 6 Nov 2011 21:38:10 +0000]
Renamed variable, most significant noun first

13 years agoThe IcmpPacket's write() method returns a boolean, mirroring the read() method.
Guilherme Maciel Ferreira [Sun, 6 Nov 2011 21:35:25 +0000]
The IcmpPacket's write() method returns a boolean, mirroring the read() method.

13 years agoBring aboard TCP segment factory.
Guilherme Maciel Ferreira [Sun, 6 Nov 2011 21:28:54 +0000]
Bring aboard TCP segment factory.
- This class handles the TCP segment creation for IPv4 and IPv6

13 years agoBring aboard TCP segment (IP and TCP headers)
Guilherme Maciel Ferreira [Sun, 6 Nov 2011 20:11:12 +0000]
Bring aboard TCP segment (IP and TCP headers)
- This allows to polymorphically change IPv4 and IPv6

13 years agoDocumentation for IPv4 header.
Guilherme Maciel Ferreira [Sun, 6 Nov 2011 14:03:27 +0000]
Documentation for IPv4 header.

13 years agoHigh Integrity CPP Rule 3.3.14: Declare the copy assignment operator protected in...
Guilherme Maciel Ferreira [Sat, 5 Nov 2011 17:35:09 +0000]
High Integrity CPP Rule 3.3.14: Declare the copy assignment operator protected in an abstract class.

13 years agoHigh Integrity CPP Rule 3.3.16: Explicitly declare polymorphic member functions virtu...
Guilherme Maciel Ferreira [Sat, 5 Nov 2011 14:51:01 +0000]
High Integrity CPP Rule 3.3.16: Explicitly declare polymorphic member functions virtual in a derived class.

13 years agoHigh Integrity CPP Guideline 3.2.4: An abstract class shall have no public constructors.
Guilherme Maciel Ferreira [Sat, 5 Nov 2011 14:24:46 +0000]
High Integrity CPP Guideline 3.2.4: An abstract class shall have no public constructors.

13 years agoAvoid 'unused variable' warning when compiling a non-debug version.
Guilherme Maciel Ferreira [Sat, 5 Nov 2011 14:16:38 +0000]
Avoid 'unused variable' warning when compiling a non-debug version.

13 years agoDelegating the ICMP packet creation to a specialized class and using a polymorphic...
Guilherme Maciel Ferreira [Fri, 4 Nov 2011 03:08:00 +0000]
Delegating the ICMP packet creation to a specialized class and using a polymorphic packet type

13 years agoBring aboard ICMP packet factory.
Guilherme Maciel Ferreira [Fri, 4 Nov 2011 02:51:50 +0000]
Bring aboard ICMP packet factory.
- This class handles the packet creation for ICMPv4 and ICMPv6

13 years agoProviding read() and write() methods, once operators >> and << does work properly...
Guilherme Maciel Ferreira [Fri, 4 Nov 2011 02:08:39 +0000]
Providing read() and write() methods, once operators >> and << does work properly with smart pointers

13 years agoRenamed methods, changed verb 'is' to 'match'
Guilherme Maciel Ferreira [Thu, 3 Nov 2011 00:03:59 +0000]
Renamed methods, changed verb 'is' to 'match'

13 years agoThe packet's type check is performed by methods in IcmpPacket
Guilherme Maciel Ferreira [Wed, 2 Nov 2011 05:02:14 +0000]
The packet's type check is performed by methods in IcmpPacket
- Because ICMP v4 and v6 have different values to echo reply

13 years agoThe packet printing is polymorphically performed by the IcmpPackets instead of the...
Guilherme Maciel Ferreira [Wed, 2 Nov 2011 04:36:11 +0000]
The packet printing is polymorphically performed by the IcmpPackets instead of the IcmpPinger
- Due to different fields, the printing methods were moved to the packet classes

13 years agoChanged assert(false) to assert(!"message") as recommended by C++ Coding Standards...
Guilherme Maciel Ferreira [Wed, 26 Oct 2011 21:46:36 +0000]
Changed assert(false) to assert(!"message") as recommended by C++ Coding Standards, chapter 68.

13 years agoIncreased the assertion check required to construct a PingScheduler object
Guilherme Maciel Ferreira [Wed, 26 Oct 2011 21:36:34 +0000]
Increased the assertion check required to construct a PingScheduler object

13 years agoDNS resolver now detects IPv6 IPs too.
Guilherme Maciel Ferreira [Wed, 26 Oct 2011 21:30:22 +0000]
DNS resolver now detects IPv6 IPs too.
- Also changed the detection mechanism from C fashioned to C++ boost style

13 years agoAdded const qualifier to some parameters
Guilherme Maciel Ferreira [Wed, 26 Oct 2011 17:06:05 +0000]
Added const qualifier to some parameters

13 years agoBring aboard ICMPv6 packet class
Guilherme Maciel Ferreira [Tue, 25 Oct 2011 00:31:20 +0000]
Bring aboard ICMPv6 packet class

13 years agoBring aboard ICMPv6 header class
Guilherme Maciel Ferreira [Tue, 25 Oct 2011 00:15:01 +0000]
Bring aboard ICMPv6 header class

13 years agoProviding different methods to set the types in ICMP v4 and v6
Guilherme Maciel Ferreira [Sat, 22 Oct 2011 18:29:18 +0000]
Providing different methods to set the types in ICMP v4 and v6
- it was not provided a polymorphic approach

13 years agoAdded ICMPv6 messages types, as defined at http://www.iana.org/assignments/icmpv6...
Guilherme Maciel Ferreira [Sat, 22 Oct 2011 17:54:29 +0000]
Added ICMPv6 messages types, as defined at iana.org/assignments/icmpv6-parameters

13 years agoRenamed IcmpType enumeration to Icmpv4Type, because ICMP type values differ between...
Guilherme Maciel Ferreira [Fri, 21 Oct 2011 01:23:36 +0000]
Renamed IcmpType enumeration to Icmpv4Type, because ICMP type values differ between v4 and v6 of the protocol

13 years agoUpdated classes comments
Guilherme Maciel Ferreira [Fri, 21 Oct 2011 00:57:15 +0000]
Updated classes comments

13 years agoRenamed IcmpPacket class to Icmpv4Packet, in order to distinguish from the ICMPv6...
Guilherme Maciel Ferreira [Wed, 19 Oct 2011 23:55:58 +0000]
Renamed IcmpPacket class to Icmpv4Packet, in order to distinguish from the ICMPv6 classes

13 years agoRenamed IcmpHeader class to Icmpv4Header, in order to distinguish from ICMP v6
Guilherme Maciel Ferreira [Tue, 18 Oct 2011 23:50:05 +0000]
Renamed IcmpHeader class to Icmpv4Header, in order to distinguish from ICMP v6

13 years agoSmall documentation change
Guilherme Maciel Ferreira [Tue, 18 Oct 2011 23:08:17 +0000]
Small documentation change

13 years agoBring aboard IPv6 header class (not tested yet)
Guilherme Maciel Ferreira [Tue, 18 Oct 2011 23:00:32 +0000]
Bring aboard IPv6 header class (not tested yet)

13 years agoSolved operator precedence mismatch reported by PC-lint, where the '|' has higher...
Guilherme Maciel Ferreira [Sun, 4 Sep 2011 12:20:16 +0000]
Solved operator precedence mismatch reported by PC-lint, where the '|' has higher precedence than ternary '?:'
- Warning 514: Unusual use of a Boolean expression

13 years agoImplementing the assignment operator, also checking for self-assignment reported...
Guilherme Maciel Ferreira [Sun, 4 Sep 2011 11:59:20 +0000]
Implementing the assignment operator, also checking for self-assignment reported by PC-lint
- Warning 1529: Symbol 'MessagePayload::operator=(const MessagePayload &)' not first checking for assignment to this
- Warning 1539: member 'MessagePayload::PayloadSizeInBytes' not assigned by assignment operator
- Warning 1539: member 'MessagePayload::Payload' not assigned by assignment operator

13 years agoSolving two issues reported by PC-lint
Guilherme Maciel Ferreira [Sun, 4 Sep 2011 11:50:48 +0000]
Solving two issues reported by PC-lint
- Ignoring return value of function 'sigfillset(__sigset_t *)'
- Declaration of symbol 'signal' hides symbol 'signal(int, void (*)(int))'

13 years agoRenamed parameter to avoid hiding symbol 'socket(int, int, int)' (issued by PC-lint)
Guilherme Maciel Ferreira [Sun, 4 Sep 2011 04:15:56 +0000]
Renamed parameter to avoid hiding symbol 'socket(int, int, int)' (issued by PC-lint)

13 years agoAdded a note about a TODO fix
Guilherme Maciel Ferreira [Thu, 1 Sep 2011 02:05:02 +0000]
Added a note about a TODO fix

13 years agoFixed broken assert in copy constructor
Guilherme Maciel Ferreira [Thu, 1 Sep 2011 02:00:02 +0000]
Fixed broken assert in copy constructor
- The Payload member was initialized in the initializer list, so asserting Payload.get() == NULL was wrong!

13 years agoImproved IcmpPacket documentation
Guilherme Maciel Ferreira [Sat, 27 Aug 2011 15:59:57 +0000]
Improved IcmpPacket documentation

13 years agoReordered DnsResolver::handle_ip_address method.
Guilherme Maciel Ferreira [Sat, 27 Aug 2011 15:10:40 +0000]
Reordered DnsResolver::handle_ip_address method.

13 years agoImproved DnsResolver documentation
Guilherme Maciel Ferreira [Sat, 27 Aug 2011 15:07:48 +0000]
Improved DnsResolver documentation

13 years agoRemove TCP ping from TODO, it's done
Thomas Jarosch [Sat, 27 Aug 2011 14:48:36 +0000]
Remove TCP ping from TODO, it's done

13 years agoMessage headers now have their wire format in Doxygen
Guilherme Maciel Ferreira [Sat, 27 Aug 2011 14:37:03 +0000]
Message headers now have their wire format in Doxygen

13 years agoUpdated Readme file with the TCP ping feature
Guilherme Maciel Ferreira [Sat, 27 Aug 2011 01:26:35 +0000]
Updated Readme file with the TCP ping feature

13 years agoFixed postconditions, the equal had wrong pointer interator
Guilherme Maciel Ferreira [Sat, 27 Aug 2011 01:21:35 +0000]
Fixed postconditions, the equal had wrong pointer interator

13 years agoReplced old-style C functions by C++ STL versions
Guilherme Maciel Ferreira [Sat, 27 Aug 2011 01:11:29 +0000]
Replced old-style C functions by C++ STL versions

13 years agoMerge branch 'tcpping' v1.1
Guilherme Maciel Ferreira [Fri, 26 Aug 2011 03:40:15 +0000]
Merge branch 'tcpping'

Conflicts:
src/icmp/icmppinger.cpp

13 years agoReplaced the raw byte array by a MessagePayload object, this class provides methods...
Guilherme Maciel Ferreira [Fri, 26 Aug 2011 01:07:17 +0000]
Replaced the raw byte array by a MessagePayload object, this class provides methods to handle decoding of network words

13 years agoAllows to add more data to the MessagePayload through append method.
Guilherme Maciel Ferreira [Fri, 26 Aug 2011 01:03:55 +0000]
Allows to add more data to the MessagePayload through append method.
Also fixed the read and write documentation.

13 years agoSmall code formatting
Guilherme Maciel Ferreira [Tue, 23 Aug 2011 03:58:31 +0000]
Small code formatting

13 years agoPings the host at a specific port (available only to TCP ping)
Guilherme Maciel Ferreira [Tue, 23 Aug 2011 03:33:07 +0000]
Pings the host at a specific port (available only to TCP ping)

13 years agoReads the host port from configuration file
Guilherme Maciel Ferreira [Tue, 23 Aug 2011 01:30:39 +0000]
Reads the host port from configuration file

13 years agoChanged the type of the header size variables from int to size_t, so it matches the...
Guilherme Maciel Ferreira [Sun, 21 Aug 2011 15:48:26 +0000]
Changed the type of the header size variables from int to size_t, so it matches the type where it is used

13 years agoThe class variable HeaderSizeInBytes was renamed to Ipv4HeaderSizeInBytes and made...
Guilherme Maciel Ferreira [Sun, 21 Aug 2011 15:43:55 +0000]
The class variable HeaderSizeInBytes was renamed to Ipv4HeaderSizeInBytes and made global only within file scope.

13 years agoTcpHeader class uses the MessagePayload class to handle network byte handling
Guilherme Maciel Ferreira [Sun, 21 Aug 2011 01:15:52 +0000]
TcpHeader class uses the MessagePayload class to handle network byte handling

13 years agoImplemented a method to access the inner array pointer, this is necessary for memory...
Guilherme Maciel Ferreira [Sun, 21 Aug 2011 01:07:06 +0000]
Implemented a method to access the inner array pointer, this is necessary for memory copies.

13 years agoFixing some asserts with wrong ranges and reworking some comments
Guilherme Maciel Ferreira [Sun, 21 Aug 2011 00:16:25 +0000]
Fixing some asserts with wrong ranges and reworking some comments

13 years agoRemoved select_source_network_interface() function, replace by simple call to Network...
Guilherme Maciel Ferreira [Sat, 20 Aug 2011 15:26:23 +0000]
Removed select_source_network_interface() function, replace by simple call to NetworkInterface::bind()

13 years agoThe C's low level socket handling functions were encapsulated in the NetworkInterface...
Guilherme Maciel Ferreira [Sat, 20 Aug 2011 15:19:13 +0000]
The C's low level socket handling functions were encapsulated in the NetworkInterface class

13 years agoBring aboard the Network Interface template class.
Guilherme Maciel Ferreira [Sat, 20 Aug 2011 04:16:50 +0000]
Bring aboard the Network Interface template class.
- It is a template because it uses the generic socket type, to avoid inheritances.
- This template class hides much of the low level socket handling.

13 years agoRenamed IcmpChecksumCalculator to IcmpChecksum
Guilherme Maciel Ferreira [Thu, 18 Aug 2011 02:21:57 +0000]
Renamed IcmpChecksumCalculator to IcmpChecksum

13 years agoRenamed ChecksumCalculation template to Checksum
Guilherme Maciel Ferreira [Thu, 18 Aug 2011 02:13:57 +0000]
Renamed ChecksumCalculation template to Checksum
- The name represents better an object
- Also changed the file extension from .h to .hpp, so keep templates with .hpp extension and classes with .h

13 years agoAllowing to copy the MessagePayload object, through implementation of Copy Constructo...
Guilherme Maciel Ferreira [Tue, 16 Aug 2011 10:40:11 +0000]
Allowing to copy the MessagePayload object, through implementation of Copy Constructor and Assignment Operator

13 years agoAdded the 32 bits version of encode and decode methods
Guilherme Maciel Ferreira [Sat, 13 Aug 2011 23:13:13 +0000]
Added the 32 bits version of encode and decode methods

13 years agoSmall code formatting
Guilherme Maciel Ferreira [Sat, 13 Aug 2011 22:58:04 +0000]
Small code formatting

13 years agoAsserted the encode16() and decode16() parameters, warning about off-by-one errors
Guilherme Maciel Ferreira [Sat, 13 Aug 2011 17:23:13 +0000]
Asserted the encode16() and decode16() parameters, warning about off-by-one errors

13 years agoRenamed IcmpMessagePayload to MessagePayload, so it can be used by other messages...
Guilherme Maciel Ferreira [Sat, 13 Aug 2011 16:39:36 +0000]
Renamed IcmpMessagePayload to MessagePayload, so it can be used by other messages types

13 years agoRenamed getters and setters
Guilherme Maciel Ferreira [Sat, 13 Aug 2011 11:39:49 +0000]
Renamed getters and setters

13 years agoMoved PingStatus enumeration to its own file, so it can be reused by both Pingers
Guilherme Maciel Ferreira [Sat, 13 Aug 2011 00:52:25 +0000]
Moved PingStatus enumeration to its own file, so it can be reused by both Pingers

13 years agoThe Include Guards must match the file's name
Guilherme Maciel Ferreira [Sat, 13 Aug 2011 00:49:07 +0000]
The Include Guards must match the file's name

13 years agoSurrounded the receive by a try..catch, so prepare to receive another packet only...
Guilherme Maciel Ferreira [Sat, 13 Aug 2011 00:42:05 +0000]
Surrounded the receive by a try..catch, so prepare to receive another packet only if the reply isn't a RST

13 years agoRemoving warning about conversion from 'int' to 'uint8_t'
Guilherme Maciel Ferreira [Tue, 9 Aug 2011 03:42:36 +0000]
Removing warning about conversion from 'int' to 'uint8_t'

13 years agoAdding a remark about sequence number from RST
Guilherme Maciel Ferreira [Tue, 9 Aug 2011 01:28:50 +0000]
Adding a remark about sequence number from RST

13 years agoAdding logging to ioctl fails, and replacing the nested if statements by guard clause...
Guilherme Maciel Ferreira [Tue, 9 Aug 2011 00:09:35 +0000]
Adding logging to ioctl fails, and replacing the nested if statements by guard clauses (early returns)

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 agoBring aboard Doxygen documentation support v1.0
Guilherme Maciel Ferreira [Sat, 30 Jul 2011 19:56:00 +0000]
Bring aboard Doxygen documentation support

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