From 8b4161a59f9e8b46148e091f8cbc2392b3e60e5e Mon Sep 17 00:00:00 2001 From: Guilherme Maciel Ferreira Date: Thu, 10 Nov 2011 05:07:20 -0200 Subject: [PATCH] Adjusting some comments --- src/icmp/icmpv6packet.h | 4 ++-- src/ip/ipv6header.h | 2 +- src/ip/pseudoipv4header.h | 3 +++ src/tcp/tcpipv4segment.cpp | 18 ++++++++++++++++-- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/icmp/icmpv6packet.h b/src/icmp/icmpv6packet.h index 2816b0b..5d0bd69 100644 --- a/src/icmp/icmpv6packet.h +++ b/src/icmp/icmpv6packet.h @@ -45,8 +45,8 @@ * | | | * | | | * | | | - * | source IPv6 address | | - * | | 320 bytes + * | source IPv6 address | IPv6 Header + * | | 40 bytes * | | | * | | | * | | | diff --git a/src/ip/ipv6header.h b/src/ip/ipv6header.h index 076bc8b..f71d752 100644 --- a/src/ip/ipv6header.h +++ b/src/ip/ipv6header.h @@ -39,7 +39,7 @@ * | | | * | | | * | source IPv6 address | | - * | | 320 bytes + * | | 40 bytes * | | | * | | | * | | | diff --git a/src/ip/pseudoipv4header.h b/src/ip/pseudoipv4header.h index 4dd00cf..d5cc7fe 100644 --- a/src/ip/pseudoipv4header.h +++ b/src/ip/pseudoipv4header.h @@ -29,6 +29,9 @@ on this file might be covered by the GNU General Public License. * @brief This class represents a Pseudo IP header used to compute checksum of * transport level protocols. * + * When TCP runs over IPv4, the method used to compute the checksum is defined + * in RFC 793. + * * Pseudo IPv4 header format used by TCP and UDP checksums: * * @code diff --git a/src/tcp/tcpipv4segment.cpp b/src/tcp/tcpipv4segment.cpp index 8902676..500421f 100644 --- a/src/tcp/tcpipv4segment.cpp +++ b/src/tcp/tcpipv4segment.cpp @@ -122,7 +122,14 @@ void TcpIpv4Segment::print_rst_reply( << endl; } -bool TcpIpv4Segment::read( std::istream &is ) +/** + * @brief Read the TCP Segment from the @c istream. + * + * @param is The input stream. + * + * @return @c true if the read was successful, or @c false if an error occured. + */ +bool TcpIpv4Segment::read( istream &is ) { is.clear(); @@ -131,7 +138,14 @@ bool TcpIpv4Segment::read( std::istream &is ) return is.fail(); } -bool TcpIpv4Segment::write( std::ostream &os ) const +/** + * @brief Write the TCP Segment to the @c ostream. + * + * @param os The output stream. + * + * @return @c true if the write was successful, or @c false if an error occured. + */ +bool TcpIpv4Segment::write( ostream &os ) const { os.clear(); -- 1.7.1