A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
SixlowpanGhcUdpImplTest Class Reference

6LoWPAN GHC end-to-end UDP test. More...

Inheritance diagram for SixlowpanGhcUdpImplTest:
Collaboration diagram for SixlowpanGhcUdpImplTest:

Public Member Functions

 SixlowpanGhcUdpImplTest ()
void DoRun () override
 Implementation to actually run this TestCase.
void ReceivePacket (Ptr< Socket > socket, Ptr< Packet > packet, const Address &from)
 Receive data callback.
void ReceivePkt (Ptr< Socket > socket)
 Receive data from the socket's RX buffer.
Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 Caller graph was not generated because of its size.
virtual ~TestCase ()
 Destructor.
std::string GetName () const
TestCase & operator= (const TestCase &)=delete

Private Member Functions

void DoSendData (Ptr< Socket > socket, std::string to)
 Schedule-friendly wrapper that performs the actual send.
void SendData (Ptr< Socket > socket, std::string to)
 Schedule data to be sent through the socket.

Private Attributes

Ptr< Packet > m_receivedPacket
 The received packet.

Additional Inherited Members

Public Types inherited from ns3::TestCase
enum class  Duration { QUICK = 1 , EXTENSIVE = 2 , TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
Protected Member Functions inherited from ns3::TestCase
 TestCase (std::string name)
 Constructor.
void AddTestCase (TestCase *testCase, Duration duration=Duration::QUICK)
 Add an individual child TestCase to this test suite.
TestCase * GetParent () const
 Get the parent of this TestCase.
bool IsStatusFailure () const
 Check if any tests failed.
bool IsStatusSuccess () const
 Check if all tests passed.
void SetDataDir (std::string directory)
 Set the data directory where reference trace files can be found.
void ReportTestFailure (std::string cond, std::string actual, std::string limit, std::string message, std::string file, int32_t line)
 Log the failure of this TestCase.
bool MustAssertOnFailure () const
 Check if this run should assert on failure.
bool MustContinueOnFailure () const
 Check if this run should continue on failure.
std::string CreateDataDirFilename (std::string filename)
 Construct the full path to a file in the data directory.
std::string CreateTempDirFilename (std::string filename)
 Construct the full path to a file in a temporary directory.

Detailed Description

6LoWPAN GHC end-to-end UDP test.

Sends a UDP packet between two nodes with GHC enabled and verifies the packet arrives intact after compression + decompression.

Definition at line 481 of file sixlowpan-ghc-test.cc.

Constructor & Destructor Documentation

◆ SixlowpanGhcUdpImplTest()

SixlowpanGhcUdpImplTest::SixlowpanGhcUdpImplTest ( )

Definition at line 518 of file sixlowpan-ghc-test.cc.

References ns3::TestCase::TestCase().

Here is the call graph for this function:

Member Function Documentation

◆ DoRun()

void SixlowpanGhcUdpImplTest::DoRun ( )
overridevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 566 of file sixlowpan-ghc-test.cc.

References ns3::Mac48Address::Allocate(), ns3::Mac48Address::ConvertFrom(), ns3::CreateObject(), ns3::Simulator::Destroy(), ns3::SixLowPanNetDevice::GHC, m_receivedPacket, ns3::MakeCallback(), NS_TEST_EXPECT_MSG_EQ, ReceivePkt(), and SendData().

Here is the call graph for this function:

◆ DoSendData()

void SixlowpanGhcUdpImplTest::DoSendData ( Ptr< Socket > socket,
std::string to )
private

Schedule-friendly wrapper that performs the actual send.

Parameters
[in]SocketThe sending socket.
[in]toDestination address in text form.

Definition at line 538 of file sixlowpan-ghc-test.cc.

References ns3::Create(), and NS_TEST_EXPECT_MSG_EQ.

Referenced by SendData().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReceivePacket()

void SixlowpanGhcUdpImplTest::ReceivePacket ( Ptr< Socket > socket,
Ptr< Packet > packet,
const Address & from )

Receive data callback.

Parameters
[in]SocketThe receiving socket.
[in]PacketThe received packet.
[in]fromThe sender address.

Definition at line 524 of file sixlowpan-ghc-test.cc.

References m_receivedPacket.

◆ ReceivePkt()

void SixlowpanGhcUdpImplTest::ReceivePkt ( Ptr< Socket > socket)

Receive data from the socket's RX buffer.

Parameters
[in]SocketThe receiving socket.

Definition at line 530 of file sixlowpan-ghc-test.cc.

References m_receivedPacket, and NS_ASSERT.

Referenced by DoRun().

Here is the caller graph for this function:

◆ SendData()

void SixlowpanGhcUdpImplTest::SendData ( Ptr< Socket > socket,
std::string to )
private

Schedule data to be sent through the socket.

Parameters
[in]SocketThe sending socket.
[in]toDestination address in text form.

Definition at line 553 of file sixlowpan-ghc-test.cc.

References ns3::Create(), DoSendData(), m_receivedPacket, ns3::Simulator::Run(), ns3::Simulator::ScheduleWithContext(), and ns3::Seconds().

Referenced by DoRun().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_receivedPacket

Ptr<Packet> SixlowpanGhcUdpImplTest::m_receivedPacket
private

The received packet.

Definition at line 483 of file sixlowpan-ghc-test.cc.

Referenced by DoRun(), ReceivePacket(), ReceivePkt(), and SendData().


The documentation for this class was generated from the following file: