From 56367463cec9d3d2401cdc61ca7c620ad1329edc Mon Sep 17 00:00:00 2001 From: Guilherme Maciel Ferreira Date: Sun, 20 Nov 2011 17:18:30 -0200 Subject: [PATCH] Documentation for TCP Segment Factory. --- src/tcp/tcpsegmentfactory.cpp | 46 ++++++++++++++++++++++++++++++++++++++++- 1 files changed, 45 insertions(+), 1 deletions(-) diff --git a/src/tcp/tcpsegmentfactory.cpp b/src/tcp/tcpsegmentfactory.cpp index a7f754b..937c9e2 100644 --- a/src/tcp/tcpsegmentfactory.cpp +++ b/src/tcp/tcpsegmentfactory.cpp @@ -41,6 +41,14 @@ using I2n::Logger::GlobalLogger; // TcpSegmentFactory //----------------------------------------------------------------------------- +/** + * @brief Creates a TCP segment from the input stream @c std::istream. + * + * @param protocol The segment's network layer protocol, IPv4 or IPv6. + * @param is The input stream. + * + * @return A TCP Segment object. + */ TcpSegmentItem TcpSegmentFactory::create_tcp_segment( const tcp_raw_protocol::socket::protocol_type &protocol, std::istream &is @@ -73,7 +81,19 @@ TcpSegmentItem TcpSegmentFactory::create_tcp_segment( return tcp_segment; } - +/** + * @brief Creates a TCP ACK request segment. + * + * @param protocol The segment's network layer protocol, IPv4 or IPv6. + * @param source_address The local address originating the ping. + * @param destination_address The remote address where to ping. + * @param source_port The local TCP port. + * @param destination_port The remote TCP port. + * @param sequence_number The segment's sequence number to aid in matching RST + * replies to this ACK request. May be zero. + * + * @return A TCP ACK request segment object. + */ TcpSegmentItem TcpSegmentFactory::create_tcp_segment_ack_request( const tcp_raw_protocol::socket::protocol_type &protocol, const address &source_address, @@ -109,6 +129,18 @@ TcpSegmentItem TcpSegmentFactory::create_tcp_segment_ack_request( return tcp_segment; } +/** + * @brief Creates a TCP ACK request segment over IPv4. + * + * @param source_address The local address originating the ping. + * @param destination_address The remote address where to ping. + * @param source_port The local TCP port. + * @param destination_port The remote TCP port. + * @param sequence_number The segment's sequence number to aid in matching RST + * replies to this ACK request. May be zero. + * + * @return A TCP ACK request segment object. + */ TcpSegmentItem TcpSegmentFactory::create_tcp_ipv4_segment_ack_request( const address &source_address, const address &destination_address, @@ -146,6 +178,18 @@ TcpSegmentItem TcpSegmentFactory::create_tcp_ipv4_segment_ack_request( return tcp_segment; } +/** + * @brief Creates a TCP ACK request segment over IPv6. + * + * @param source_address The local address originating the ping. + * @param destination_address The remote address where to ping. + * @param source_port The local TCP port. + * @param destination_port The remote TCP port. + * @param sequence_number The segment's sequence number to aid in matching RST + * replies to this ACK request. May be zero. + * + * @return A TCP ACK request segment object. + */ TcpSegmentItem TcpSegmentFactory::create_tcp_ipv6_segment_ack_request( const address &source_address, const address &destination_address, -- 1.7.1