sixlowpan: doxygen updates (thanks to Robert Ammon)

This commit is contained in:
Tommaso Pecorella
2017-01-17 02:23:43 +01:00
parent ce1d59dd8c
commit 3a643012d7
3 changed files with 152 additions and 26 deletions

View File

@@ -44,19 +44,25 @@
using namespace ns3;
/**
* \ingroup sixlowpan-test
* \ingroup tests
*
* \brief 6LoWPAN Fragmentation Test
*/
class SixlowpanFragmentationTest : public TestCase
{
Ptr<Packet> m_sentPacketClient;
Ptr<Packet> m_receivedPacketClient;
Ptr<Packet> m_receivedPacketServer;
Ptr<Packet> m_sentPacketClient; //!< Packet sent by client.
Ptr<Packet> m_receivedPacketClient; //!< Packet received by the client.
Ptr<Packet> m_receivedPacketServer; //!< packet received by the server.
Ptr<Socket> m_socketServer;
Ptr<Socket> m_socketClient;
uint32_t m_dataSize;
uint8_t *m_data;
uint32_t m_size;
uint8_t m_icmpType;
uint8_t m_icmpCode;
Ptr<Socket> m_socketServer; //!< Socket on the server.
Ptr<Socket> m_socketClient; //!< Socket on the client.
uint32_t m_dataSize; //!< Size of the data (if any).
uint8_t *m_data; //!< Data to be carried in the packet
uint32_t m_size; //!< Size of the packet if no data has been provided.
uint8_t m_icmpType; //!< ICMP type.
uint8_t m_icmpCode; //!< ICMP code.
public:
virtual void DoRun (void);
@@ -64,16 +70,51 @@ public:
~SixlowpanFragmentationTest ();
// server part
void StartServer (Ptr<Node> ServerNode);
/**
* Start the server node.
* \param serverNode The server node.
*/
void StartServer (Ptr<Node> serverNode);
/**
* Handles incoming packets in the server.
* \param socket The receiving socket.
*/
void HandleReadServer (Ptr<Socket> socket);
// client part
void StartClient (Ptr<Node> ClientNode);
void HandleReadClient (Ptr<Socket> socket);
void HandleReadIcmpClient (Ipv6Address icmpSource, uint8_t icmpTtl, uint8_t icmpType,
uint8_t icmpCode,uint32_t icmpInfo);
/**
* Start the client node.
* \param clientNode The client node.
*/
void StartClient (Ptr<Node> clientNode);
/**
* Handles incoming packets in the client.
* \param socket The receiving socket.
*/
void HandleReadClient (Ptr<Socket> socket);
/**
* Handles incoming ICMP packets in the client.
* \param icmpSource ICMP sender address.
* \param icmpTtl ICMP TTL.
* \param icmpType ICMP type.
* \param icmpCode ICMP code.
* \param icmpInfo ICMP info.
*/
void HandleReadIcmpClient (Ipv6Address icmpSource, uint8_t icmpTtl, uint8_t icmpType,
uint8_t icmpCode, uint32_t icmpInfo);
/**
* Set the packet optional content.
* \param fill Pointer to an array of data.
* \param fillSize Size of the array of data.
* \param dataSize Size of the packet - if fillSize is less than dataSize, the data is repeated.
*/
void SetFill (uint8_t *fill, uint32_t fillSize, uint32_t dataSize);
/**
* Send a packet to the server.
* \returns The packet sent.
*/
Ptr<Packet> SendClient (void);
};
@@ -102,13 +143,13 @@ SixlowpanFragmentationTest::~SixlowpanFragmentationTest ()
void
SixlowpanFragmentationTest::StartServer (Ptr<Node> ServerNode)
SixlowpanFragmentationTest::StartServer (Ptr<Node> serverNode)
{
if (m_socketServer == 0)
{
TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
m_socketServer = Socket::CreateSocket (ServerNode, tid);
m_socketServer = Socket::CreateSocket (serverNode, tid);
Inet6SocketAddress local = Inet6SocketAddress (Ipv6Address ("2001:0100::1"), 9);
m_socketServer->Bind (local);
Ptr<UdpSocket> udpSocket = DynamicCast<UdpSocket> (m_socketServer);
@@ -135,13 +176,13 @@ SixlowpanFragmentationTest::HandleReadServer (Ptr<Socket> socket)
}
void
SixlowpanFragmentationTest::StartClient (Ptr<Node> ClientNode)
SixlowpanFragmentationTest::StartClient (Ptr<Node> clientNode)
{
if (m_socketClient == 0)
{
TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");
m_socketClient = Socket::CreateSocket (ClientNode, tid);
m_socketClient = Socket::CreateSocket (clientNode, tid);
m_socketClient->Bind (Inet6SocketAddress (Ipv6Address::GetAny (), 9));
m_socketClient->Connect (Inet6SocketAddress (Ipv6Address ("2001:0100::1"), 9));
CallbackValue cbValue = MakeCallback (&SixlowpanFragmentationTest::HandleReadIcmpClient, this);
@@ -416,11 +457,16 @@ SixlowpanFragmentationTest::DoRun (void)
// Note that a 6LoWPAN fragment timeout does NOT send any ICMPv6.
}
Simulator::Destroy ();
}
//-----------------------------------------------------------------------------
/**
* \ingroup sixlowpan-test
* \ingroup tests
*
* \brief 6LoWPAN Fragmentation TestSuite
*/
class SixlowpanFragmentationTestSuite : public TestSuite
{
public:

View File

@@ -39,17 +39,49 @@
using namespace ns3;
/**
* \ingroup sixlowpan-test
* \ingroup tests
*
* \brief 6LoWPAN HC1 Test
*/
class SixlowpanHc1ImplTest : public TestCase
{
Ptr<Packet> m_receivedPacket;
Ptr<Packet> m_receivedPacket; //!< received packet
/**
* Send data function.
*
* \param socket The sending socket.
* \param to The destination.
*/
void DoSendData (Ptr<Socket> socket, std::string to);
/**
* Send data function.
*
* \param socket The sending socket.
* \param to The destination.
*/
void SendData (Ptr<Socket> socket, std::string to);
public:
virtual void DoRun (void);
SixlowpanHc1ImplTest ();
/**
* Packet receive function.
*
* \param socket The receiving socket.
* \param packet The received packet.
* \param from The sender.
*/
void ReceivePacket (Ptr<Socket> socket, Ptr<Packet> packet, const Address &from);
/**
* Packet receive function.
*
* \param socket The receiving socket.
*/
void ReceivePkt (Ptr<Socket> socket);
};
@@ -178,7 +210,12 @@ SixlowpanHc1ImplTest::DoRun (void)
}
//-----------------------------------------------------------------------------
/**
* \ingroup sixlowpan-test
* \ingroup tests
*
* \brief 6LoWPAN HC1 TestSuite
*/
class SixlowpanHc1TestSuite : public TestSuite
{
public:

View File

@@ -39,17 +39,55 @@
using namespace ns3;
/**
* \ingroup sixlowpan
* \defgroup sixlowpan-test 6LoWPAN module tests
*/
/**
* \ingroup sixlowpan-test
* \ingroup tests
*
* \brief 6LoWPAN IPHC Test
*/
class SixlowpanIphcImplTest : public TestCase
{
Ptr<Packet> m_receivedPacket;
Ptr<Packet> m_receivedPacket; //!< received packet
/**
* Send data function.
*
* \param socket The sending socket.
* \param to The destination.
*/
void DoSendData (Ptr<Socket> socket, std::string to);
/**
* Send data function.
*
* \param socket The sending socket.
* \param to The destination.
*/
void SendData (Ptr<Socket> socket, std::string to);
public:
virtual void DoRun (void);
SixlowpanIphcImplTest ();
/**
* Packet receive function.
*
* \param socket The receiving socket.
* \param packet The received packet.
* \param from The sender.
*/
void ReceivePacket (Ptr<Socket> socket, Ptr<Packet> packet, const Address &from);
/**
* Packet receive function.
*
* \param socket The receiving socket.
*/
void ReceivePkt (Ptr<Socket> socket);
};
@@ -176,7 +214,12 @@ SixlowpanIphcImplTest::DoRun (void)
}
//-----------------------------------------------------------------------------
/**
* \ingroup sixlowpan-test
* \ingroup tests
*
* \brief 6LoWPAN IPHC TestSuite
*/
class SixlowpanIphcTestSuite : public TestSuite
{
public: