6LoWPAN IPHC stateful compression Test More...
Classes | |
struct | Data |
Structure to hold the Rx/Tx packets. More... | |
Public Member Functions | |
SixlowpanIphcStatefulImplTest () | |
virtual void | DoRun (void) |
Implementation to actually run this TestCase. More... | |
Public Member Functions inherited from ns3::TestCase | |
TestCase (const TestCase &)=delete | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName (void) const |
TestCase & | operator= (const TestCase &)=delete |
Private Member Functions | |
bool | PromiscReceiveFromSixLowPanDevice (Ptr< NetDevice > device, Ptr< const Packet > packet, uint16_t protocol, Address const &source, Address const &destination, NetDevice::PacketType packetType) |
Promiscuous receive from a SixLowPanNetDevice. More... | |
bool | ReceiveFromMockDevice (Ptr< NetDevice > device, Ptr< const Packet > packet, uint16_t protocol, Address const &source, Address const &destination, NetDevice::PacketType packetType) |
Receive from a MockDevice. More... | |
void | SendOnePacket (Ptr< NetDevice > device, Ipv6Address from, Ipv6Address to) |
Send one packet. More... | |
Private Attributes | |
NetDeviceContainer | m_mockDevices |
MockNetDevice container. More... | |
std::vector< Data > | m_rxPackets |
Received packets. More... | |
NetDeviceContainer | m_sixDevices |
SixLowPanNetDevice container. More... | |
std::vector< Data > | m_txPackets |
Transmitted packets. 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 TestCsse. More... | |
bool | IsStatusFailure (void) const |
Check if any tests failed. More... | |
bool | IsStatusSuccess (void) 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 (void) const |
Check if this run should assert on failure. More... | |
bool | MustContinueOnFailure (void) 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... | |
6LoWPAN IPHC stateful compression Test
Definition at line 50 of file sixlowpan-iphc-stateful-test.cc.
SixlowpanIphcStatefulImplTest::SixlowpanIphcStatefulImplTest | ( | ) |
Definition at line 108 of file sixlowpan-iphc-stateful-test.cc.
|
virtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 161 of file sixlowpan-iphc-stateful-test.cc.
References ns3::NetDeviceContainer::Add(), ns3::SixLowPanHelper::AddContext(), ns3::Ipv6AddressHelper::Assign(), ns3::NetDeviceContainer::Get(), ns3::Ipv6InterfaceContainer::GetAddress(), ns3::SixLowPanIphc::GetCid(), ns3::SixLowPanIphc::GetDac(), ns3::SixLowPanIphc::GetDam(), ns3::Ipv6Header::GetDestination(), ns3::SixLowPanIphc::GetDstContextId(), ns3::SixLowPanIphc::GetM(), ns3::SixLowPanIphc::GetSac(), ns3::SixLowPanIphc::GetSam(), ns3::Ipv6Header::GetSource(), ns3::SixLowPanIphc::GetSrcContextId(), ns3::SixLowPanHelper::Install(), ns3::InternetStackHelper::Install(), m_mockDevices, m_rxPackets, m_sixDevices, m_txPackets, ns3::MakeCallback(), ns3::Minutes(), first::nodes, NS_TEST_EXPECT_MSG_EQ, PromiscReceiveFromSixLowPanDevice(), ReceiveFromMockDevice(), ns3::Seconds(), SendOnePacket(), ns3::Ipv6AddressHelper::SetBase(), and ns3::NetDevice::SetPromiscReceiveCallback().
|
private |
Promiscuous receive from a SixLowPanNetDevice.
device | a pointer to the net device which is calling this function |
packet | the packet received |
protocol | the 16 bit protocol number associated with this packet. |
source | the address of the sender |
destination | the address of the receiver |
packetType | type of packet received (broadcast/multicast/unicast/otherhost) |
Definition at line 133 of file sixlowpan-iphc-stateful-test.cc.
References ns3::Packet::Copy(), SixlowpanIphcStatefulImplTest::Data::dst, m_rxPackets, SixlowpanIphcStatefulImplTest::Data::packet, and SixlowpanIphcStatefulImplTest::Data::src.
Referenced by DoRun().
|
private |
Receive from a MockDevice.
device | a pointer to the net device which is calling this function |
packet | the packet received |
protocol | the 16 bit protocol number associated with this packet. |
source | the address of the sender |
destination | the address of the receiver |
packetType | type of packet received (broadcast/multicast/unicast/otherhost) |
Definition at line 114 of file sixlowpan-iphc-stateful-test.cc.
References ns3::Packet::Copy(), SixlowpanIphcStatefulImplTest::Data::dst, ns3::NetDeviceContainer::Get(), m_mockDevices, m_txPackets, SixlowpanIphcStatefulImplTest::Data::packet, and SixlowpanIphcStatefulImplTest::Data::src.
Referenced by DoRun().
|
private |
Send one packet.
device | the device to send from |
from | sender address |
to | destination address |
Definition at line 146 of file sixlowpan-iphc-stateful-test.cc.
References ns3::Packet::AddHeader(), ns3::NetDevice::Send(), ns3::Ipv6Header::SetDestination(), ns3::Ipv6Header::SetHopLimit(), ns3::Ipv6Header::SetNextHeader(), ns3::Ipv6Header::SetPayloadLength(), and ns3::Ipv6Header::SetSource().
Referenced by DoRun().
|
private |
MockNetDevice container.
Definition at line 100 of file sixlowpan-iphc-stateful-test.cc.
Referenced by DoRun(), and ReceiveFromMockDevice().
|
private |
Received packets.
Definition at line 64 of file sixlowpan-iphc-stateful-test.cc.
Referenced by DoRun(), and PromiscReceiveFromSixLowPanDevice().
|
private |
SixLowPanNetDevice container.
Definition at line 101 of file sixlowpan-iphc-stateful-test.cc.
Referenced by DoRun().
|
private |
Transmitted packets.
Definition at line 63 of file sixlowpan-iphc-stateful-test.cc.
Referenced by DoRun(), and ReceiveFromMockDevice().