IPv6 Fragmentation Test. More...
Public Member Functions | |
Ipv6FragmentationTest () | |
~Ipv6FragmentationTest () | |
virtual void | DoRun (void) |
Implementation to actually run this TestCase. More... | |
void | HandleReadClient (Ptr< Socket > socket) |
Handle incoming packets. More... | |
void | HandleReadIcmpClient (Ipv6Address icmpSource, uint8_t icmpTtl, uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo) |
Handle incoming ICMP packets. More... | |
void | HandleReadServer (Ptr< Socket > socket) |
Handle incoming packets. More... | |
Ptr< Packet > | SendClient (void) |
Send a packet. More... | |
void | SetFill (uint8_t *fill, uint32_t fillSize, uint32_t dataSize) |
Set the packet fill. More... | |
void | StartClient (Ptr< Node > ClientNode) |
Start the client. More... | |
void | StartServer (Ptr< Node > ServerNode) |
Start the server. More... | |
Public Member Functions inherited from ns3::TestCase | |
virtual | ~TestCase () |
Destructor. More... | |
std::string | GetName (void) const |
Private Attributes | |
uint8_t * | m_data |
Data. More... | |
uint32_t | m_dataSize |
Data size. More... | |
uint8_t | m_icmpCode |
ICMP code. More... | |
uint8_t | m_icmpType |
ICMP type. More... | |
Ptr< Packet > | m_receivedPacketClient |
Packet received by client. More... | |
Ptr< Packet > | m_receivedPacketServer |
Packet received by server. More... | |
Ptr< Packet > | m_sentPacketClient |
Packet sent by client. More... | |
uint32_t | m_size |
packet size. More... | |
Ptr< Socket > | m_socketClient |
Client socket. More... | |
Ptr< Socket > | m_socketServer |
Server socket. 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... | |
IPv6 Fragmentation Test.
Definition at line 110 of file ipv6-fragmentation-test.cc.
Ipv6FragmentationTest::Ipv6FragmentationTest | ( | ) |
Definition at line 182 of file ipv6-fragmentation-test.cc.
References m_data, m_dataSize, m_icmpCode, m_icmpType, m_size, and m_socketServer.
Ipv6FragmentationTest::~Ipv6FragmentationTest | ( | ) |
Definition at line 193 of file ipv6-fragmentation-test.cc.
References m_data, and m_dataSize.
|
virtual |
Implementation to actually run this TestCase.
Subclasses should override this method to conduct their tests.
Implements ns3::TestCase.
Definition at line 324 of file ipv6-fragmentation-test.cc.
References ns3::Ipv6::AddAddress(), ns3::Node::AddDevice(), ns3::Ipv6::AddInterface(), third::channel, ns3::Packet::CopyData(), ns3::ErrorModel::Disable(), ns3::ErrorModel::Enable(), ns3::Packet::GetByteTagIterator(), ns3::TypeId::GetConstructor(), ns3::ByteTagIterator::Item::GetEnd(), ns3::Node::GetId(), ns3::TypeId::GetName(), ns3::Socket::GetNode(), ns3::Object::GetObject(), ns3::Packet::GetSize(), ns3::ByteTagIterator::Item::GetStart(), ns3::ByteTagIterator::Item::GetTag(), IPv6TestTag::GetToken(), ns3::ByteTagIterator::Item::GetTypeId(), ns3::InternetStackHelper::Install(), m_data, m_icmpCode, m_icmpType, m_receivedPacketServer, m_socketClient, NS_TEST_EXPECT_MSG_EQ, NS_TEST_EXPECT_MSG_NE, packetSize, ns3::Packet::PeekPacketTag(), ns3::ErrorModel::Reset(), ns3::Seconds(), SendClient(), ns3::SimpleNetDevice::SetAddress(), ns3::SimpleNetDevice::SetChannel(), SetFill(), ns3::InternetStackHelper::SetIpv4StackInstall(), ns3::SimpleNetDevice::SetMtu(), ns3::SimpleNetDevice::SetReceiveErrorModel(), ns3::Ipv6::SetUp(), StartClient(), and StartServer().
Handle incoming packets.
socket | The receiving socket. |
Definition at line 252 of file ipv6-fragmentation-test.cc.
References ns3::Packet::Copy(), m_receivedPacketClient, and ns3::Socket::RecvFrom().
Referenced by StartClient().
void Ipv6FragmentationTest::HandleReadIcmpClient | ( | Ipv6Address | icmpSource, |
uint8_t | icmpTtl, | ||
uint8_t | icmpType, | ||
uint8_t | icmpCode, | ||
uint32_t | icmpInfo | ||
) |
Handle incoming ICMP packets.
icmpSource | The ICMP sender. |
icmpTtl | The ICMP TTL. |
icmpType | The ICMP Type. |
icmpCode | The ICMP Code. |
icmpInfo | The ICMP Info. |
Definition at line 266 of file ipv6-fragmentation-test.cc.
References m_icmpCode, and m_icmpType.
Referenced by StartClient().
Handle incoming packets.
socket | The receiving socket. |
Definition at line 221 of file ipv6-fragmentation-test.cc.
References ns3::Packet::Copy(), m_receivedPacketServer, and ns3::Socket::RecvFrom().
Referenced by StartServer().
Send a packet.
Definition at line 302 of file ipv6-fragmentation-test.cc.
References ns3::Packet::AddByteTag(), ns3::Packet::AddPacketTag(), m_data, m_dataSize, m_size, m_socketClient, ns3::Socket::Send(), and IPv6TestTag::SetToken().
Referenced by DoRun().
void Ipv6FragmentationTest::SetFill | ( | uint8_t * | fill, |
uint32_t | fillSize, | ||
uint32_t | dataSize | ||
) |
Set the packet fill.
fill | The fill. |
fillSize | The fill size. |
dataSize | The packet size. |
Definition at line 275 of file ipv6-fragmentation-test.cc.
References m_data, m_dataSize, and m_size.
Referenced by DoRun().
Start the client.
ClientNode | The client. |
Definition at line 235 of file ipv6-fragmentation-test.cc.
References ns3::Socket::Bind(), ns3::Socket::Connect(), HandleReadClient(), HandleReadIcmpClient(), m_socketClient, ns3::MakeCallback(), ns3::ObjectBase::SetAttribute(), and ns3::Socket::SetRecvCallback().
Referenced by DoRun().
Start the server.
ServerNode | The server. |
Definition at line 205 of file ipv6-fragmentation-test.cc.
References ns3::Socket::Bind(), HandleReadServer(), m_socketServer, ns3::MakeCallback(), and ns3::Socket::SetRecvCallback().
Referenced by DoRun().
|
private |
Data.
Definition at line 120 of file ipv6-fragmentation-test.cc.
Referenced by DoRun(), Ipv6FragmentationTest(), SendClient(), SetFill(), and ~Ipv6FragmentationTest().
|
private |
Data size.
Definition at line 119 of file ipv6-fragmentation-test.cc.
Referenced by Ipv6FragmentationTest(), SendClient(), SetFill(), and ~Ipv6FragmentationTest().
|
private |
ICMP code.
Definition at line 123 of file ipv6-fragmentation-test.cc.
Referenced by DoRun(), HandleReadIcmpClient(), and Ipv6FragmentationTest().
|
private |
ICMP type.
Definition at line 122 of file ipv6-fragmentation-test.cc.
Referenced by DoRun(), HandleReadIcmpClient(), and Ipv6FragmentationTest().
Packet received by client.
Definition at line 113 of file ipv6-fragmentation-test.cc.
Referenced by HandleReadClient().
Packet received by server.
Definition at line 114 of file ipv6-fragmentation-test.cc.
Referenced by DoRun(), and HandleReadServer().
Packet sent by client.
Definition at line 112 of file ipv6-fragmentation-test.cc.
|
private |
packet size.
Definition at line 121 of file ipv6-fragmentation-test.cc.
Referenced by Ipv6FragmentationTest(), SendClient(), and SetFill().
Client socket.
Definition at line 118 of file ipv6-fragmentation-test.cc.
Referenced by DoRun(), SendClient(), and StartClient().
Server socket.
Definition at line 117 of file ipv6-fragmentation-test.cc.
Referenced by Ipv6FragmentationTest(), and StartServer().