mirror of
https://github.com/mfontanini/libtins
synced 2026-01-23 02:35:57 +01:00
Fixed/added documentation to several classes.
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
namespace Tins {
|
||||
|
||||
/**
|
||||
* \brief Class representing an Ethernet II packet
|
||||
* \brief Class representing an Ethernet II PDU.
|
||||
*/
|
||||
class EthernetII : public PDU {
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
namespace Tins {
|
||||
|
||||
/**
|
||||
* \brief IP represents IP PDU.
|
||||
* \brief Class that represents an IP PDU.
|
||||
*/
|
||||
class IP : public PDU {
|
||||
public:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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)))));
|
||||
|
||||
Reference in New Issue
Block a user