From 5d288cb14cbf8dbff628c5a52331b80ef5dc9008 Mon Sep 17 00:00:00 2001 From: Tommaso Pecorella Date: Thu, 7 Apr 2016 01:50:23 +0200 Subject: [PATCH] network: doxygen fixes --- src/network/model/byte-tag-list.h | 10 ++-- src/network/model/net-device.h | 17 ++++-- src/network/model/packet-tag-list.h | 2 +- src/network/model/packet.h | 6 ++ src/network/utils/ipv4-address.h | 23 ++++++++ src/network/utils/ipv6-address.h | 18 +++--- src/network/utils/pcap-file-wrapper.h | 4 +- src/network/utils/pcap-file.h | 6 +- src/network/utils/sll-header.h | 84 ++++++++++++++------------- 9 files changed, 107 insertions(+), 63 deletions(-) diff --git a/src/network/model/byte-tag-list.h b/src/network/model/byte-tag-list.h index df7d8e2b1..e7a0c82f0 100644 --- a/src/network/model/byte-tag-list.h +++ b/src/network/model/byte-tag-list.h @@ -122,7 +122,7 @@ private: * \param offsetEnd offset to the end of the tag from the virtual byte buffer * \param adjustment adjustment to byte tag offsets */ - Iterator (uint8_t *start, uint8_t *end, int32_t offsetStart, int32_t offsetEnd, int32_t m_adjustment); + Iterator (uint8_t *start, uint8_t *end, int32_t offsetStart, int32_t offsetEnd, int32_t adjustment); /** * \brief Prepare the iterator for the next tag @@ -201,7 +201,7 @@ private: */ ByteTagList::Iterator Begin (int32_t offsetStart, int32_t offsetEnd) const; - /* + /** * Adjust the offsets stored internally by the adjustment delta. * * \param adjustment value to change stored offsets by @@ -246,9 +246,9 @@ private: */ void Deallocate (struct ByteTagListData *data); - int32_t m_minStart; // !< minimal start offset - int32_t m_maxEnd; // !< maximal end offset - int32_t m_adjustment; // !< adjustment to byte tag offsets + int32_t m_minStart; //!< minimal start offset + int32_t m_maxEnd; //!< maximal end offset + int32_t m_adjustment; //!< adjustment to byte tag offsets uint16_t m_used; //!< the number of used bytes in the buffer struct ByteTagListData *m_data; //!< the ByteTagListData structure }; diff --git a/src/network/model/net-device.h b/src/network/model/net-device.h index 1a9c7749f..d3d9f513f 100644 --- a/src/network/model/net-device.h +++ b/src/network/model/net-device.h @@ -112,6 +112,9 @@ private: */ QueueItem &operator = (const QueueItem &); + /** + * The packet contained in the queue item. + */ Ptr m_packet; }; @@ -232,6 +235,8 @@ public: /** * \brief Get the i-th transmission queue of the device. + * + * \param i the index of the requested queue. * \return the i-th transmission queue of the device. * * The index of the first transmission queue is zero. @@ -259,17 +264,19 @@ public: typedef Callback< uint8_t, Ptr > SelectQueueCallback; /** - * \brief Set the select queue callback - * \param cb the callback to set + * \brief Set the select queue callback. + * \param cb the callback to set. * * Called by a device to set the select queue callback, i.e., the method used - * to select a device transmission queue for a given packet + * to select a device transmission queue for a given packet. */ void SetSelectQueueCallback (SelectQueueCallback cb); /** - * \brief Get the id of the transmission queue selected for the given packet - * \return the id of the transmission queue selected for the given packet + * \brief Get the id of the transmission queue selected for the given packet. + * + * \param item the packet. + * \return the id of the transmission queue selected for the given packet. * * Called by the traffic control when it needs to determine which device * transmission queue a given packet must be enqueued into. This function diff --git a/src/network/model/packet-tag-list.h b/src/network/model/packet-tag-list.h index a23983e31..9fbf19ecd 100644 --- a/src/network/model/packet-tag-list.h +++ b/src/network/model/packet-tag-list.h @@ -102,7 +102,7 @@ class Tag; * any other #PacketTagList's, hence this is a \c const function. * * - Copy constructor (PacketTagList(const PacketTagList & o)) - * and assignment (#operator=(const PacketTagList & o) + * and assignment (#operator=(const PacketTagList & o)) * simply join the tree at the same place as the original * PacketTagList \c o, incrementing the \c count. * For assignment, the old branch is deleted, up to diff --git a/src/network/model/packet.h b/src/network/model/packet.h index 6cf81a4f9..88c7e55d2 100644 --- a/src/network/model/packet.h +++ b/src/network/model/packet.h @@ -711,6 +711,12 @@ private: Packet (const Buffer &buffer, const ByteTagList &byteTagList, const PacketTagList &packetTagList, const PacketMetadata &metadata); + /** + * \brief Deserializes a packet. + * \param [in] buffer the input buffer. + * \param [in] size the buffer size. + * \returns the number of deserialized bytes. + */ uint32_t Deserialize (uint8_t const*buffer, uint32_t size); Buffer m_buffer; //!< the packet buffer (it's actual contents) diff --git a/src/network/utils/ipv4-address.h b/src/network/utils/ipv4-address.h index da6f936fa..08133a92e 100644 --- a/src/network/utils/ipv4-address.h +++ b/src/network/utils/ipv4-address.h @@ -215,8 +215,31 @@ private: static uint8_t GetType (void); uint32_t m_address; //!< IPv4 address + /** + * \brief Equal to operator. + * + * \param a the first operand. + * \param b the first operand. + * \returns true if the operands are equal. + */ friend bool operator == (Ipv4Address const &a, Ipv4Address const &b); + + /** + * \brief Not equal to operator. + * + * \param a the first operand. + * \param b the first operand. + * \returns true if the operands are not equal. + */ friend bool operator != (Ipv4Address const &a, Ipv4Address const &b); + + /** + * \brief Less than to operator. + * + * \param a the first operand. + * \param b the first operand. + * \returns true if the first operand is less than the second. + */ friend bool operator < (Ipv4Address const &a, Ipv4Address const &b); }; diff --git a/src/network/utils/ipv6-address.h b/src/network/utils/ipv6-address.h index 4332c6970..ab7aff6eb 100644 --- a/src/network/utils/ipv6-address.h +++ b/src/network/utils/ipv6-address.h @@ -358,27 +358,27 @@ private: /** * \brief Equal to operator. * - * \param a the first operand - * \param b the first operand - * \returns true if the operands are equal + * \param a the first operand. + * \param b the first operand. + * \returns true if the operands are equal. */ friend bool operator == (Ipv6Address const &a, Ipv6Address const &b); /** * \brief Not equal to operator. * - * \param a the first operand - * \param b the first operand - * \returns true if the operands are not equal + * \param a the first operand. + * \param b the first operand. + * \returns true if the operands are not equal. */ friend bool operator != (Ipv6Address const &a, Ipv6Address const &b); /** * \brief Less than to operator. * - * \param a the first operand - * \param b the first operand - * \returns true if the first operand is less than the second + * \param a the first operand. + * \param b the first operand. + * \returns true if the first operand is less than the second. */ friend bool operator < (Ipv6Address const &a, Ipv6Address const &b); }; diff --git a/src/network/utils/pcap-file-wrapper.h b/src/network/utils/pcap-file-wrapper.h index bb75a8b0d..254f3eadc 100644 --- a/src/network/utils/pcap-file-wrapper.h +++ b/src/network/utils/pcap-file-wrapper.h @@ -143,10 +143,10 @@ public: void Write (Time t, uint8_t const *buffer, uint32_t length); /** - * \brief Read the next packet from the file. Returns a pointer to ns3::Packet + * \brief Read the next packet from the file. * * \param t Reference to packet timestamp as ns3::Time. - * + * \returns a pointer to ns3::Packet. */ Ptr Read (Time &t); diff --git a/src/network/utils/pcap-file.h b/src/network/utils/pcap-file.h index 8ee835761..78b862bcf 100644 --- a/src/network/utils/pcap-file.h +++ b/src/network/utils/pcap-file.h @@ -108,6 +108,9 @@ public: * \param swapMode Flag indicating a difference in endianness of the * writing system. Defaults to false. * + * \param nanosecMode Flag indicating the time resolution of the writing + * system. Default to false. + * * \return false if the open succeeds, true otherwise. * * \warning Calling this method on an existing file will result in the loss @@ -195,7 +198,7 @@ public: /** * \brief Get the nanosecond mode of the file. * - * IsNanoSecMode returns true if the packet timestamps in the PCAP + * \returns true if the packet timestamps in the PCAP * file have nanosecond resolution. */ bool IsNanoSecMode (void); @@ -279,6 +282,7 @@ public: * \param f2 Second PCAP file name * \param sec [out] Time stamp of first different packet, seconds. Undefined if files doesn't differ. * \param usec [out] Time stamp of first different packet, microseconds. Undefined if files doesn't differ. + * \param packets [out] Number of first different packet. Total number of parsed packets if files doesn't differ. * \param snapLen Snap length (if used) */ static bool Diff (std::string const & f1, std::string const & f2, diff --git a/src/network/utils/sll-header.h b/src/network/utils/sll-header.h index dc43f0bbd..c47599448 100644 --- a/src/network/utils/sll-header.h +++ b/src/network/utils/sll-header.h @@ -38,32 +38,36 @@ namespace ns3 { * \see http://www.tcpdump.org/linktypes/LINKTYPE_LINUX_SLL.html * \see https://wiki.wireshark.org/SLL * - * \verbatim - * +---------------------------+ - * | Packet type | - * | (2 Octets) | - * +---------------------------+ - * | ARPHRD_ type | - * | (2 Octets) | - * +---------------------------+ - * | Link-layer address length | - * | (2 Octets) | - * +---------------------------+ - * | Link-layer address | - * | (8 Octets) | - * +---------------------------+ - * | Protocol type | - * | (2 Octets) | - * +---------------------------+ - * | Payload | - * . . - * . . - * . . - * \endverbatim + \verbatim + +---------------------------+ + | Packet type | + | (2 Octets) | + +---------------------------+ + | ARPHRD_ type | + | (2 Octets) | + +---------------------------+ + | Link-layer address length | + | (2 Octets) | + +---------------------------+ + | Link-layer address | + | (8 Octets) | + +---------------------------+ + | Protocol type | + | (2 Octets) | + +---------------------------+ + | Payload | + . . + . . + . . + \endverbatim */ class SllHeader : public Header { public: + + /** + * Type of the packet. + */ enum PacketType { UNICAST_FROM_PEER_TO_ME = 0, /**< the packet was specifically sent to us by somebody else */ @@ -74,33 +78,33 @@ public: }; /** - * \brief Get the type ID. - * \return the object TypeId - */ + * \brief Get the type ID. + * \return the object TypeId + */ static TypeId GetTypeId (void); SllHeader (); virtual ~SllHeader (); /** - * \return ARP header type field in network byte order - * The ARPHRD_ type field is in network byte order; it contains a Linux ARPHRD_ value for the link-layer device type. - */ + * \return ARP header type field in network byte order + * The ARPHRD_ type field is in network byte order; it contains a Linux ARPHRD_ value for the link-layer device type. + */ uint16_t GetArpType () const; /** - * \param arphw ARP protocol hardware identifier - */ + * \param arphdType ARP protocol hardware identifier + */ void SetArpType (uint16_t arphdType); - /** - * \return Packet type - */ + /** + * \return Packet type + */ enum PacketType GetPacketType () const; /** - * \param type Depends on source and address of the packet - */ + * \param type Depends on source and address of the packet + */ void SetPacketType (PacketType type); //! Inherited from ObjectBase @@ -113,11 +117,11 @@ public: protected: // declared in packet order - PacketType m_packetType; - uint16_t m_arphdType; /**< ARP protocol hardware identifier */ - uint16_t m_addressLength; - uint64_t m_address; - uint16_t m_protocolType; + PacketType m_packetType; /**< Packet type */ + uint16_t m_arphdType; /**< ARP protocol hardware identifier */ + uint16_t m_addressLength; /**< Address length */ + uint64_t m_address; /**< Address */ + uint16_t m_protocolType; /**< protocol type */ }; } // namespace ns3