A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::aodv::LoopbackTestCase Class Reference

AODV loopback UDP echo test case. More...

+ Inheritance diagram for ns3::aodv::LoopbackTestCase:
+ Collaboration diagram for ns3::aodv::LoopbackTestCase:

Public Member Functions

 LoopbackTestCase ()
 
void DoRun () override
 Implementation to actually run this TestCase.
 
- Public Member Functions inherited from ns3::TestCase
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor.
 
std::string GetName () const
 
TestCaseoperator= (const TestCase &)=delete
 

Private Member Functions

void EchoData (Ptr< Socket > socket) const
 Echo data function.
 
void ReceivePkt (Ptr< Socket > socket)
 Receive packet function.
 
void SendData (Ptr< Socket > socket)
 Send data function.
 

Private Attributes

uint32_t m_count
 number of packet received;
 
uint16_t m_echoReplyPort
 echo reply port;
 
uint16_t m_echoSendPort
 echo send port;
 
Ptr< Socketm_echoSocket
 echo socket;
 
Ptr< Socketm_rxSocket
 receive socket;
 
Ptr< Socketm_txSocket
 transmit socket;
 

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...
 
- Static Public Attributes inherited from ns3::TestCase
static constexpr auto QUICK = Duration::QUICK
 Deprecated test duration simple enums.
 
static constexpr auto EXTENSIVE = Duration::EXTENSIVE
 
static constexpr auto TAKES_FOREVER = Duration::TAKES_FOREVER
 
- 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.
 
TestCaseGetParent () 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

AODV loopback UDP echo test case.

Definition at line 42 of file loopback.cc.

Constructor & Destructor Documentation

◆ LoopbackTestCase()

ns3::aodv::LoopbackTestCase::LoopbackTestCase ( )

Definition at line 72 of file loopback.cc.

References m_echoReplyPort, and m_echoSendPort.

Member Function Documentation

◆ DoRun()

◆ EchoData()

void ns3::aodv::LoopbackTestCase::EchoData ( Ptr< Socket > socket) const
private

Echo data function.

Parameters
socketThe socket to echo data

Definition at line 89 of file loopback.cc.

References ns3::InetSocketAddress::ConvertFrom(), ns3::InetSocketAddress::GetIpv4(), and m_echoReplyPort.

Referenced by DoRun().

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

◆ ReceivePkt()

void ns3::aodv::LoopbackTestCase::ReceivePkt ( Ptr< Socket > socket)
private

Receive packet function.

Parameters
socketThe socket to receive data

Definition at line 81 of file loopback.cc.

References m_count.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ SendData()

void ns3::aodv::LoopbackTestCase::SendData ( Ptr< Socket > socket)
private

Send data function.

Parameters
socketThe socket to send data

Definition at line 104 of file loopback.cc.

References ns3::Create(), ns3::Ipv4Address::GetLoopback(), m_echoSendPort, ns3::Simulator::ScheduleWithContext(), ns3::Seconds(), and SendData().

Referenced by DoRun(), and SendData().

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

Member Data Documentation

◆ m_count

uint32_t ns3::aodv::LoopbackTestCase::m_count
private

number of packet received;

Definition at line 44 of file loopback.cc.

Referenced by DoRun(), and ReceivePkt().

◆ m_echoReplyPort

uint16_t ns3::aodv::LoopbackTestCase::m_echoReplyPort
private

echo reply port;

Definition at line 49 of file loopback.cc.

Referenced by LoopbackTestCase(), DoRun(), and EchoData().

◆ m_echoSendPort

uint16_t ns3::aodv::LoopbackTestCase::m_echoSendPort
private

echo send port;

Definition at line 48 of file loopback.cc.

Referenced by LoopbackTestCase(), DoRun(), and SendData().

◆ m_echoSocket

Ptr<Socket> ns3::aodv::LoopbackTestCase::m_echoSocket
private

echo socket;

Definition at line 46 of file loopback.cc.

Referenced by DoRun().

◆ m_rxSocket

Ptr<Socket> ns3::aodv::LoopbackTestCase::m_rxSocket
private

receive socket;

Definition at line 47 of file loopback.cc.

Referenced by DoRun().

◆ m_txSocket

Ptr<Socket> ns3::aodv::LoopbackTestCase::m_txSocket
private

transmit socket;

Definition at line 45 of file loopback.cc.

Referenced by DoRun().


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