From 2510c825cd688ceb480e4742c5cd86b5c800ddbf Mon Sep 17 00:00:00 2001 From: Matias Fontanini Date: Tue, 23 Aug 2011 21:32:13 -0300 Subject: [PATCH] Fixed/added documentation to several classes. --- include/ethernetII.h | 2 +- include/icmp.h | 2 +- include/ip.h | 2 +- include/pdu.h | 12 ++++++------ include/tcp.h | 2 +- include/udp.h | 2 +- include/utils.h | 5 +++++ 7 files changed, 16 insertions(+), 11 deletions(-) diff --git a/include/ethernetII.h b/include/ethernetII.h index ca1adc0..dd3e30b 100644 --- a/include/ethernetII.h +++ b/include/ethernetII.h @@ -30,7 +30,7 @@ namespace Tins { /** - * \brief Class representing an Ethernet II packet + * \brief Class representing an Ethernet II PDU. */ class EthernetII : public PDU { diff --git a/include/icmp.h b/include/icmp.h index e63dcf6..28b30a8 100644 --- a/include/icmp.h +++ b/include/icmp.h @@ -28,7 +28,7 @@ namespace Tins { - /** \brief ICMP represents the ICMP PDU. + /** \brief Class that represents an ICMP PDU. * * ICMP is the representation of the ICMP PDU. Instances of this class * must be sent over a level 3 PDU, this will otherwise fail. diff --git a/include/ip.h b/include/ip.h index e8b09dd..5c0cb3b 100644 --- a/include/ip.h +++ b/include/ip.h @@ -34,7 +34,7 @@ namespace Tins { /** - * \brief IP represents IP PDU. + * \brief Class that represents an IP PDU. */ class IP : public PDU { public: diff --git a/include/pdu.h b/include/pdu.h index c1be273..47b3ea1 100644 --- a/include/pdu.h +++ b/include/pdu.h @@ -32,14 +32,14 @@ namespace Tins { class PacketSender; - /** \brief PDU is the base class for protocol data units. + /** \brief Base class for protocol data units. * * Every PDU implementation must inherit this one. PDUs can be serialized, - * therefore allowing a PacketSender to send them through sockets. PDUs - * are created upwards: upper layers will be children of the lower ones. - * Each PDU must provide its flag identifier. This will be most likely added - * to its parent's data, hence it should be a valid identifier. For example, - * IP should provide IPPROTO_IP. + * therefore allowing a PacketSender to send them through the corresponding + * sockets. PDUs are created upwards: upper layers will be children of the + * lower ones. Each PDU must provide its flag identifier. This will be most + * likely added to its parent's data, hence it should be a valid identifier. + * For example, IP should provide IPPROTO_IP. */ class PDU { public: diff --git a/include/tcp.h b/include/tcp.h index abf6a2f..16e8f39 100644 --- a/include/tcp.h +++ b/include/tcp.h @@ -35,7 +35,7 @@ namespace Tins { /** - * \brief TCP represents the TCP PDU. + * \brief Class that represents an TCP PDU. * * TCP is the representation of the TCP PDU. Instances of this class * must be sent over a level 3 PDU, this will otherwise fail. diff --git a/include/udp.h b/include/udp.h index 096d5b3..82d2405 100644 --- a/include/udp.h +++ b/include/udp.h @@ -27,7 +27,7 @@ namespace Tins { - /** \brief UDP represents the UDP PDU. + /** \brief Class that represents an UDP PDU. * * UDP is the representation of the UDP PDU. Instances of this class * must be sent over a level 3 PDU, this will otherwise fail. diff --git a/include/utils.h b/include/utils.h index ece8024..9c82b97 100644 --- a/include/utils.h +++ b/include/utils.h @@ -153,6 +153,11 @@ namespace Tins { ((data & 0x0000ff00) << 8) | ((data & 0x000000ff) << 24)); } + /** + * \brief Convert 64 bit integer into network byte order. + * + * \param data The data to convert. + */ inline uint64_t net_to_host_ll(uint64_t data) { return (((uint64_t)(net_to_host_l((uint32_t)((data << 32) >> 32))) << 32) | (net_to_host_l(((uint32_t)(data >> 32)))));