From 46e3c23efef1fa504543299bcd98b4bdd66b56b6 Mon Sep 17 00:00:00 2001 From: Guilherme Maciel Ferreira Date: Sat, 19 Nov 2011 10:04:40 -0200 Subject: [PATCH] Documentation for ICMP Packet Factory. --- src/icmp/icmppacketfactory.cpp | 33 ++++++++++++++++++++++++++++----- 1 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/icmp/icmppacketfactory.cpp b/src/icmp/icmppacketfactory.cpp index 37a3825..cbae2ec 100644 --- a/src/icmp/icmppacketfactory.cpp +++ b/src/icmp/icmppacketfactory.cpp @@ -41,7 +41,12 @@ using I2n::Logger::GlobalLogger; //----------------------------------------------------------------------------- /** - * @brief + * @brief Creates an ICMP packet from the input stream @c std::istream. + * + * @param protocol The packet's network layer protocol, IPv4 or IPv6. + * @param is The input stream. + * + * @return An ICMP Packet object. */ IcmpPacketItem IcmpPacketFactory::create_icmp_packet( const icmp::socket::protocol_type &protocol, @@ -69,7 +74,7 @@ IcmpPacketItem IcmpPacketFactory::create_icmp_packet( { GlobalLogger.notice() << "Could not read ICMP packet." << endl; - // TODO why good packets reports as bad? + // TODO why good packets are reports as bad? The read() has problems! //IcmpPacketItem icmp_packet_empty; //icmp_packet = icmp_packet_empty; } @@ -78,7 +83,15 @@ IcmpPacketItem IcmpPacketFactory::create_icmp_packet( } /** - * @brief + * @brief Creates an ICMP Echo Request packet. + * + * @param protocol The packet's network layer protocol, IPv4 or IPv6. + * @param identifier The packet's identifier number to aid in matching Echo + * Replies to this Echo Request. May be zero. + * @param sequence_number The packet's sequence number to aid in matching Echo + * Replies to this Echo Request. May be zero. + * + * @return An ICMP Echo Request packet object. */ IcmpPacketItem IcmpPacketFactory::create_icmp_packet_echo_request( const icmp::socket::protocol_type &protocol, @@ -107,7 +120,12 @@ IcmpPacketItem IcmpPacketFactory::create_icmp_packet_echo_request( } /** - * @brief + * @brief Creates an ICMPv4 Echo Request packet. + * + * @param identifier The packet's identifier number. + * @param sequence_number The packet's sequence number. + * + * @return An ICMPv4 Echo Request packet object. */ IcmpPacketItem IcmpPacketFactory::create_icmpv4_packet_echo_request( const uint16_t identifier, @@ -131,7 +149,12 @@ IcmpPacketItem IcmpPacketFactory::create_icmpv4_packet_echo_request( } /** - * @brief + * @brief Creates an ICMPv6 Echo Request packet. + * + * @param identifier The packet's identifier number. + * @param sequence_number The packet's sequence number. + * + * @return An ICMPv6 Echo Request packet object. */ IcmpPacketItem IcmpPacketFactory::create_icmpv6_packet_echo_request( const uint16_t identifier, -- 1.7.1