SixLowPanNetDevice compression threshold test. More...
Public Member Functions | |
| SixLowPanCompressionThresholdTest () | |
| void | DoRun () override |
| Implementation to actually run this TestCase. | |
| 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 | |
| bool | ReceiveFromMockDevice (Ptr< NetDevice > device, Ptr< const Packet > packet, uint16_t protocol, const Address &source, const Address &destination, NetDevice::PacketType packetType) |
| Callback for frames handed to the underlying mock device. | |
| uint8_t | SendOnePacket (uint16_t paddingThreshold, uint32_t compressionThreshold, uint32_t payloadSize) |
| Send one packet over a SixLowPanNetDevice. | |
Private Attributes | |
| uint8_t | m_dispatch {0} |
| First byte of the last transmitted frame. | |
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. | |
SixLowPanNetDevice compression threshold test.
Packets whose compressed form is smaller than the underlying device padding threshold must be sent with the uncompressed IPv6 dispatch: link-layer padding is indistinguishable from data on such links, and it would corrupt the reconstruction of the elided IPv6 Payload Length (issue #1361).
Definition at line 35 of file sixlowpan-compression-threshold-test.cc.
| SixLowPanCompressionThresholdTest::SixLowPanCompressionThresholdTest | ( | ) |
Definition at line 74 of file sixlowpan-compression-threshold-test.cc.
References ns3::TestCase::TestCase().
|
overridevirtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 134 of file sixlowpan-compression-threshold-test.cc.
References ns3::SixLowPanDispatch::GetDispatchType(), ns3::SixLowPanDispatch::LOWPAN_IPHC, ns3::SixLowPanDispatch::LOWPAN_IPv6, NS_TEST_EXPECT_MSG_EQ, and SendOnePacket().
|
private |
Callback for frames handed to the underlying mock device.
| device | The mock device. |
| Packet | The transmitted packet. |
| protocol | The protocol number. |
| source | The source address. |
| destination | The destination address. |
| packetType | The packet type. |
Definition at line 80 of file sixlowpan-compression-threshold-test.cc.
References m_dispatch.
Referenced by SendOnePacket().
|
private |
Send one packet over a SixLowPanNetDevice.
| paddingThreshold | Padding threshold reported by the mock device. |
| compressionThreshold | Value for the CompressionThreshold attribute. |
| payloadSize | IPv6 payload size in bytes. |
Definition at line 92 of file sixlowpan-compression-threshold-test.cc.
References ns3::Create(), ns3::CreateObject(), ns3::Simulator::Destroy(), m_dispatch, ns3::MakeCallback(), ReceiveFromMockDevice(), ns3::Ipv6Header::SetDestination(), ns3::Ipv6Header::SetHopLimit(), ns3::Ipv6Header::SetNextHeader(), ns3::Ipv6Header::SetPayloadLength(), and ns3::Ipv6Header::SetSource().
Referenced by DoRun().
|
private |
First byte of the last transmitted frame.
Definition at line 37 of file sixlowpan-compression-threshold-test.cc.
Referenced by ReceiveFromMockDevice(), and SendOnePacket().