Message headers now have their wire format in Doxygen
authorGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
Sat, 27 Aug 2011 14:37:03 +0000 (11:37 -0300)
committerGuilherme Maciel Ferreira <guilherme.maciel.ferreira@gmail.com>
Sat, 27 Aug 2011 14:37:03 +0000 (11:37 -0300)
src/icmp/icmpheader.h
src/ip/ipv4header.h
src/ip/pseudoipv4header.h
src/tcp/tcpheader.h

index 7552375..d4dd221 100644 (file)
 //-----------------------------------------------------------------------------
 // IcmpHeader
 //-----------------------------------------------------------------------------
-//
-// ICMP Generic Header Format
-//
-// 0               8               16                             31
-// +---------------+---------------+------------------------------+     ---
-// |               |               |                              |      ^
-// |     type      |     code      |          checksum            |   4 bytes
-// |               |               |                              |      v
-// +---------------+---------------+------------------------------+     ---
-// |                                                              |
-// |                     specific to each message                 |
-// |                                                              |
-// +-------------------------------+------------------------------+
-//
-//-----------------------------------------------------------------------------
 
+/**
+ * @brief This class represents the ICMP Packet Header.
+ *
+ * The ICMP Generic Header Format is:
+ *
+ * @code
+ * 0               8               16                             31
+ * +---------------+---------------+------------------------------+     ---
+ * |               |               |                              |      ^
+ * |     type      |     code      |          checksum            |   4 bytes
+ * |               |               |                              |      v
+ * +---------------+---------------+------------------------------+     ---
+ * |                                                              |
+ * |                     specific to each message                 |
+ * |                                                              |
+ * +-------------------------------+------------------------------+
+ * @endcode
+ */
 class IcmpHeader
 {
 public:
@@ -77,7 +80,7 @@ public:
     );
 
 private:
-    /// changeable pointer to different ICMP messages types
+    /// Changeable pointer to different ICMP messages types.
     boost::shared_ptr<IcmpMessage> MessageFormat;
 
 };
index f7811c5..0dbab02 100644 (file)
 //-----------------------------------------------------------------------------
 // Ipv4Header
 //-----------------------------------------------------------------------------
-// IPv4 header format:
-//
-// 0               8               16                             31
-// +-------+-------+---------------+------------------------------+      ---
-// |       |       |               |                              |       ^
-// |version|header |    type of    |    total length in bytes     |       |
-// |  (4)  | length|    service    |                              |       |
-// +-------+-------+---------------+-+-+-+------------------------+       |
-// |                               | | | |                        |       |
-// |        identification         |0|D|M|    fragment offset     |       |
-// |                               | |F|F|                        |       |
-// +---------------+---------------+-+-+-+------------------------+       |
-// |               |               |                              |       |
-// | time to live  |   protocol    |       header checksum        |   20 bytes
-// |               |               |                              |       |
-// +---------------+---------------+------------------------------+       |
-// |                                                              |       |
-// |                      source IPv4 address                     |       |
-// |                                                              |       |
-// +--------------------------------------------------------------+       |
-// |                                                              |       |
-// |                   destination IPv4 address                   |       |
-// |                                                              |       v
-// +--------------------------------------------------------------+      ---
-// |                                                              |       ^
-// |                                                              |       |
-// /                        options (if any)                      /    0 - 40
-// /                                                              /     bytes
-// |                                                              |       |
-// |                                                              |       v
-// +--------------------------------------------------------------+      ---
-//
-//-----------------------------------------------------------------------------
 
+/**
+ * @brief This class represents the IP version 4 Packet Header.
+ *
+ * The IPv4 header format is:
+ *
+ * @code
+ * 0               8               16                             31
+ * +-------+-------+---------------+------------------------------+      ---
+ * |       |       |               |                              |       ^
+ * |version|header |    type of    |    total length in bytes     |       |
+ * |  (4)  | length|    service    |                              |       |
+ * +-------+-------+---------------+-+-+-+------------------------+       |
+ * |                               | | | |                        |       |
+ * |        identification         |0|D|M|    fragment offset     |       |
+ * |                               | |F|F|                        |       |
+ * +---------------+---------------+-+-+-+------------------------+       |
+ * |               |               |                              |       |
+ * | time to live  |   protocol    |       header checksum        |   20 bytes
+ * |               |               |                              |       |
+ * +---------------+---------------+------------------------------+       |
+ * |                                                              |       |
+ * |                      source IPv4 address                     |       |
+ * |                                                              |       |
+ * +--------------------------------------------------------------+       |
+ * |                                                              |       |
+ * |                   destination IPv4 address                   |       |
+ * |                                                              |       v
+ * +--------------------------------------------------------------+      ---
+ * |                                                              |       ^
+ * |                                                              |       |
+ * /                        options (if any)                      /    0 - 40
+ * /                                                              /     bytes
+ * |                                                              |       |
+ * |                                                              |       v
+ * +--------------------------------------------------------------+      ---
+ * @endcode
+ */
 class Ipv4Header
 {
 public:
index 52745b1..6238059 100644 (file)
@@ -24,33 +24,43 @@ on this file might be covered by the GNU General Public License.
 //-----------------------------------------------------------------------------
 // PseudoIpv4Header
 //-----------------------------------------------------------------------------
-// Pseudo IPv4 header format used by TCP and UDP checksums:
-//
-// 0               8               16                             31
-// +--------------------------------------------------------------+      ---
-// |                                                              |       ^
-// |                      source IPv4 address                     |       |
-// |                                                              |       |
-// +--------------------------------------------------------------+       |
-// |                                                              |       |
-// |                   destination IPv4 address                   |   12 bytes
-// |                                                              |       |
-// +---------------+---------------+------------------------------+       |
-// |               |               |                              |       |
-// |      zero     |   protocol    |        header length         |       |
-// |               |               |                              |       v
-// +---------------+---------------+------------------------------+      ---
-//
-//-----------------------------------------------------------------------------
 
+/**
+ * @brief This class represents a Pseudo IP header used to compute checksum of
+ * transport level protocols.
+ *
+ * Pseudo IPv4 header format used by TCP and UDP checksums:
+ *
+ * @code
+ * 0               8               16                             31
+ * +--------------------------------------------------------------+      ---
+ * |                                                              |       ^
+ * |                      source IPv4 address                     |       |
+ * |                                                              |       |
+ * +--------------------------------------------------------------+       |
+ * |                                                              |       |
+ * |                   destination IPv4 address                   |   12 bytes
+ * |                                                              |       |
+ * +---------------+---------------+------------------------------+       |
+ * |               |               |                              |       |
+ * |      zero     |   protocol    |        header length         |       |
+ * |               |               |                              |       v
+ * +---------------+---------------+------------------------------+      ---
+ * @endcode
+ */
 class PseudoIpv4Header
 {
 public:
+    /// Source IPv4 address
     uint32_t source_address;
+    /// Destination IPv4 address
     uint32_t destination_address;
+    /// Zero
     uint8_t zero_byte;
-    uint8_t protocol; // protocol
-    uint16_t header_length; // TCP or UDP header length
+    /// Transport layer protocol
+    uint8_t protocol;
+    /// TCP or UDP header length
+    uint16_t header_length;
 };
 
 #endif /* PSEUDO_IPV4_HEADER_H */
index 2c2fa52..a25ac19 100644 (file)
@@ -30,43 +30,44 @@ on this file might be covered by the GNU General Public License.
 //-----------------------------------------------------------------------------
 // TcpHeader
 //-----------------------------------------------------------------------------
-//
-// TCP Segment header.
-//
-// The wire format of a TCP header is:
-//
-// 0        4       8              16               24           31
-// +-------------------------------+------------------------------+      ---
-// |                               |                              |       ^
-// |         source port           |     destination port         |       |
-// |                               |                              |       |
-// +--------------------------------------------------------------+       |
-// |                                                              |       |
-// |                        sequence number                       |       |
-// |                                                              |       |
-// +--------------------------------------------------------------+       |
-// |                                                              |       |
-// |              acknowledgment number (if ACK set)              |   20 bytes
-// |                                                              |       |
-// +-------+-------+-+-+-+-+-+-+-+-+------------------------------+       |
-// | data  | reser-|C|E|U|A|P|R|S|F|                              |       |
-// |offset | ved   |W|C|R|C|S|S|Y|I|        window size           |       |
-// |       |       |R|E|G|K|H|T|N|N|                              |       |
-// +---------------+-+-+-+-+-+-+-+-+------------------------------+       |
-// |                               |                              |       |
-// |          checksum             | urgent pointer (if URG set)  |       |
-// |                               |                              |       v
-// +-----------------------------------------------+--------------+      ---
-// |                                               |              |       ^
-// |                                               |              |       |
-// |          options (if Data Offset > 5)         |   padding    /    0 - 40
-// |                                               |              /     bytes
-// |                                               |              |       |
-// |                                               |              |       v
-// +-----------------------------------------------+--------------+      ---
-//
-//-----------------------------------------------------------------------------
 
+/**
+ * @brief This class represents the TCP Segment Header.
+ *
+ * The wire format of a TCP header is:
+ *
+ * @code
+ * 0        4       8              16               24           31
+ * +-------------------------------+------------------------------+      ---
+ * |                               |                              |       ^
+ * |         source port           |     destination port         |       |
+ * |                               |                              |       |
+ * +--------------------------------------------------------------+       |
+ * |                                                              |       |
+ * |                        sequence number                       |       |
+ * |                                                              |       |
+ * +--------------------------------------------------------------+       |
+ * |                                                              |       |
+ * |              acknowledgment number (if ACK set)              |   20 bytes
+ * |                                                              |       |
+ * +-------+-------+-+-+-+-+-+-+-+-+------------------------------+       |
+ * | data  | reser-|C|E|U|A|P|R|S|F|                              |       |
+ * |offset | ved   |W|C|R|C|S|S|Y|I|        window size           |       |
+ * |       |       |R|E|G|K|H|T|N|N|                              |       |
+ * +---------------+-+-+-+-+-+-+-+-+------------------------------+       |
+ * |                               |                              |       |
+ * |          checksum             | urgent pointer (if URG set)  |       |
+ * |                               |                              |       v
+ * +-----------------------------------------------+--------------+      ---
+ * |                                               |              |       ^
+ * |                                               |              |       |
+ * |          options (if Data Offset > 5)         |   padding    /    0 - 40
+ * |                                               |              /     bytes
+ * |                                               |              |       |
+ * |                                               |              |       v
+ * +-----------------------------------------------+--------------+      ---
+ * @endcode
+ */
 class TcpHeader
 {
 public: