extended ICMP packet dumping to parts after packet creation
[pingcheck] / src / icmp / icmpdata_pingfailreply.cpp
index b7f07cf..91abf10 100644 (file)
@@ -66,7 +66,7 @@ uint16_t IcmpData_PingFailReply::get_icmp_request_data(
                                                 const int icmp_start_byte) const
 {
     // payload should be the original query, which is an IP packet.
-    // first check wheter that IP packet contains an ICMP message at all
+    // first check whether that IP packet contains an ICMP message at all
     int offset = get_icmp_data_offset();
 
     if (offset == -1)
@@ -85,6 +85,8 @@ uint16_t IcmpData_PingFailReply::get_icmp_request_data(
  *
  * Unfortunately, the value in packet is not the original one, but the one
  *   change en route to destination, so in case of TimeExceeded, it is always 1
+ *
+ * @throws boost assertion if data does not seem to start with an IP v4/6 header
  */
 uint8_t IcmpData_PingFailReply::get_ip_ttl() const
 {
@@ -107,9 +109,8 @@ uint8_t IcmpData_PingFailReply::get_ip_ttl() const
 
 /** @brief get byte index of start of ICMP request data after IP header
  *
- * @returns -1 if this data is not a
- * @throws boost assertion if data does not start with an IP header of version
- *   4 or 6
+ * @returns -1 if this data does not contain a ICMP request packet
+ * @throws boost assertion if data does not seem to start with an IP v4/6 header
  */
 int IcmpData_PingFailReply::get_icmp_data_offset() const
 {
@@ -130,9 +131,10 @@ int IcmpData_PingFailReply::get_icmp_data_offset() const
     }
     else
     {
-        GlobalLogger.error() << "Request IP header is neither IPv4 nor v6!"
-                             << std::endl;
-        BOOST_ASSERT( !"Source IP header is neither IPv4 nor v6!" );
+        GlobalLogger.error()
+            << "Icmp data does not seem to start with IPv4/6 header!"
+            << std::endl;
+        BOOST_ASSERT( !"Icmp data does not seem to start with IPv4/6 header!" );
     }
 
     if (is_icmp)