The topology is of the form: More...
Public Member Functions | |
NixVectorRoutingTest () | |
void | DoRun () override |
Implementation to actually run this TestCase. More... | |
void | ReceivePkt (Ptr< Socket > socket) |
Receive data. More... | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName () const |
TestCase & | operator= (const TestCase &)=delete |
Public Attributes | |
std::vector< uint32_t > | m_receivedPacketSizes |
Received packet sizes. More... | |
Private Member Functions | |
void | DoSendDatav4 (Ptr< Socket > socket, Ipv4Address to) |
Send data immediately after being called. More... | |
void | DoSendDatav6 (Ptr< Socket > socket, Ipv6Address to) |
Send data immediately after being called. More... | |
void | SendData (Time delay, Ptr< Socket > socket, Ipv4Address to) |
Schedules the DoSendData () function to send the data. More... | |
void | SendData (Time delay, Ptr< Socket > socket, Ipv6Address to) |
Schedules the DoSendData () function to send the data. More... | |
Private Attributes | |
Ptr< Packet > | m_receivedPacket |
Received packet. More... | |
Additional Inherited Members | |
Public Types inherited from ns3::TestCase | |
enum | TestDuration { 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. More... | |
void | AddTestCase (TestCase *testCase, TestDuration duration=QUICK) |
Add an individual child TestCase to this test suite. More... | |
TestCase * | GetParent () const |
Get the parent of this TestCase. More... | |
bool | IsStatusFailure () const |
Check if any tests failed. More... | |
bool | IsStatusSuccess () const |
Check if all tests passed. More... | |
void | SetDataDir (std::string directory) |
Set the data directory where reference trace files can be found. More... | |
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. More... | |
bool | MustAssertOnFailure () const |
Check if this run should assert on failure. More... | |
bool | MustContinueOnFailure () const |
Check if this run should continue on failure. More... | |
std::string | CreateDataDirFilename (std::string filename) |
Construct the full path to a file in the data directory. More... | |
std::string | CreateTempDirFilename (std::string filename) |
Construct the full path to a file in a temporary directory. More... | |
The topology is of the form:
__________ / \ nSrc -- nA -- nB -- nC -- nDst
Following are the tests in this test case:
IPv4 Nix-Vector Routing Test
Definition at line 65 of file nix-test.cc.
NixVectorRoutingTest::NixVectorRoutingTest | ( | ) |
Definition at line 112 of file nix-test.cc.
|
overridevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 167 of file nix-test.cc.
References ns3::NodeContainer::Add(), ns3::Ipv4AddressHelper::Assign(), ns3::Ipv6AddressHelper::Assign(), ns3::Socket::Bind(), ns3::NodeContainer::Create(), ns3::NetDeviceContainer::Get(), ns3::NodeContainer::Get(), ns3::Ipv6InterfaceContainer::GetAddress(), ns3::Ipv4InterfaceContainer::GetAddress(), ns3::Object::GetObject(), ns3::SimpleNetDeviceHelper::Install(), nsclick-simple-lan::ipv4, m_receivedPacketSizes, ns3::MakeCallback(), NS_TEST_EXPECT_MSG_EQ, ns3::NixVectorHelper< T >::PrintRoutingPathAt(), ReceivePkt(), ns3::Seconds(), SendData(), ns3::Ipv4AddressHelper::SetBase(), ns3::Ipv6AddressHelper::SetBase(), ns3::SimpleNetDeviceHelper::SetNetDevicePointToPointMode(), ns3::Socket::SetRecvCallback(), and first::stack.
|
private |
Send data immediately after being called.
socket | The sending socket. |
to | IPv4 Destination address. |
Definition at line 129 of file nix-test.cc.
References ns3::Socket::SendTo().
Referenced by SendData().
|
private |
Send data immediately after being called.
socket | The sending socket. |
to | IPv6 Destination address. |
Definition at line 136 of file nix-test.cc.
References ns3::Socket::SendTo().
Referenced by SendData().
Receive data.
socket | The receiving socket. |
Definition at line 118 of file nix-test.cc.
References ns3::Socket::GetRxAvailable(), ns3::Packet::GetSize(), m_receivedPacket, m_receivedPacketSizes, max, NS_TEST_ASSERT_MSG_EQ, and ns3::Socket::Recv().
Referenced by DoRun().
|
private |
Schedules the DoSendData () function to send the data.
delay | The scheduled time to send data. |
socket | The sending socket. |
to | IPv4 Destination address. |
Definition at line 143 of file nix-test.cc.
References DoSendDatav4(), ns3::Node::GetId(), ns3::Socket::GetNode(), and m_receivedPacket.
Referenced by DoRun().
|
private |
Schedules the DoSendData () function to send the data.
delay | The scheduled time to send data. |
socket | The sending socket. |
to | IPv6 Destination address. |
Definition at line 155 of file nix-test.cc.
References DoSendDatav6(), ns3::Node::GetId(), ns3::Socket::GetNode(), and m_receivedPacket.
Received packet.
Definition at line 67 of file nix-test.cc.
Referenced by ReceivePkt(), and SendData().
std::vector<uint32_t> NixVectorRoutingTest::m_receivedPacketSizes |
Received packet sizes.
Definition at line 109 of file nix-test.cc.
Referenced by DoRun(), and ReceivePkt().