A Discrete-Event Network Simulator
API
Ipv6FragmentationTest Class Reference

IPv6 Fragmentation Test. More...

+ Inheritance diagram for Ipv6FragmentationTest:
+ Collaboration diagram for Ipv6FragmentationTest:

Public Member Functions

 Ipv6FragmentationTest ()
 
 ~Ipv6FragmentationTest ()
 
virtual void DoRun (void)
 Implementation to actually run this TestCase. More...
 
void HandleClientTx (Ptr< const Packet > packet, Ptr< Ipv6 > ipv6, uint32_t interface)
 Handle Client's transmitting packets. 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...
 
void HandleServerRx (Ptr< const Packet > packet, Ptr< Ipv6 > ipv6, uint32_t interface)
 Handle Server's incoming packets. More...
 
Ptr< PacketSendClient (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
 TestCase (const TestCase &)=delete
 
virtual ~TestCase ()
 Destructor. More...
 
std::string GetName (void) const
 
TestCaseoperator= (const TestCase &)=delete
 

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< Packetm_receivedPacketClient
 Packet received by client. More...
 
Ptr< Packetm_receivedPacketServer
 Packet received by server. More...
 
Ptr< Packetm_sentPacketClient
 Packet sent by client. More...
 
uint32_t m_size
 packet size. More...
 
Ptr< Socketm_socketClient
 Client socket. More...
 
Ptr< Socketm_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...
 
TestCaseGetParent () 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...
 

Detailed Description

IPv6 Fragmentation Test.

Definition at line 110 of file ipv6-fragmentation-test.cc.

Constructor & Destructor Documentation

◆ Ipv6FragmentationTest()

Ipv6FragmentationTest::Ipv6FragmentationTest ( )

Definition at line 202 of file ipv6-fragmentation-test.cc.

References m_data, m_dataSize, m_icmpCode, m_icmpType, m_size, and m_socketServer.

◆ ~Ipv6FragmentationTest()

Ipv6FragmentationTest::~Ipv6FragmentationTest ( )

Definition at line 213 of file ipv6-fragmentation-test.cc.

References m_data, and m_dataSize.

Member Function Documentation

◆ DoRun()

◆ HandleClientTx()

void Ipv6FragmentationTest::HandleClientTx ( Ptr< const Packet packet,
Ptr< Ipv6 ipv6,
uint32_t  interface 
)

Handle Client's transmitting packets.

Ensure no packet greater than MTU is transmitted

Parameters
packetthe packet.
ipv6the Ipv6 protocol.
interfacethe IP-level interface index.

Definition at line 348 of file ipv6-fragmentation-test.cc.

References ns3::Packet::GetSize(), and NS_TEST_EXPECT_MSG_LT_OR_EQ.

Referenced by DoRun().

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

◆ HandleReadClient()

void Ipv6FragmentationTest::HandleReadClient ( Ptr< Socket socket)

Handle incoming packets.

Parameters
socketThe receiving socket.

Definition at line 272 of file ipv6-fragmentation-test.cc.

References ns3::Packet::Copy(), m_receivedPacketClient, and ns3::Socket::RecvFrom().

Referenced by StartClient().

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

◆ HandleReadIcmpClient()

void Ipv6FragmentationTest::HandleReadIcmpClient ( Ipv6Address  icmpSource,
uint8_t  icmpTtl,
uint8_t  icmpType,
uint8_t  icmpCode,
uint32_t  icmpInfo 
)

Handle incoming ICMP packets.

Parameters
icmpSourceThe ICMP sender.
icmpTtlThe ICMP TTL.
icmpTypeThe ICMP Type.
icmpCodeThe ICMP Code.
icmpInfoThe ICMP Info.

Definition at line 286 of file ipv6-fragmentation-test.cc.

References m_icmpCode, and m_icmpType.

Referenced by StartClient().

+ Here is the caller graph for this function:

◆ HandleReadServer()

void Ipv6FragmentationTest::HandleReadServer ( Ptr< Socket socket)

Handle incoming packets.

Parameters
socketThe receiving socket.

Definition at line 241 of file ipv6-fragmentation-test.cc.

References ns3::Packet::Copy(), m_receivedPacketServer, and ns3::Socket::RecvFrom().

Referenced by StartServer().

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

◆ HandleServerRx()

void Ipv6FragmentationTest::HandleServerRx ( Ptr< const Packet packet,
Ptr< Ipv6 ipv6,
uint32_t  interface 
)

Handle Server's incoming packets.

Ensure no packet greater than MTU is received

Parameters
packetthe packet.
ipv6the Ipv6 protocol.
interfacethe IP-level interface index.

Definition at line 343 of file ipv6-fragmentation-test.cc.

References ns3::Packet::GetSize(), and NS_TEST_EXPECT_MSG_LT_OR_EQ.

Referenced by DoRun().

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

◆ SendClient()

Ptr< Packet > Ipv6FragmentationTest::SendClient ( void  )

Send a packet.

Returns
The sent packet.

Definition at line 322 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().

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

◆ SetFill()

void Ipv6FragmentationTest::SetFill ( uint8_t *  fill,
uint32_t  fillSize,
uint32_t  dataSize 
)

Set the packet fill.

Parameters
fillThe fill.
fillSizeThe fill size.
dataSizeThe packet size.

Definition at line 295 of file ipv6-fragmentation-test.cc.

References m_data, m_dataSize, and m_size.

Referenced by DoRun().

+ Here is the caller graph for this function:

◆ StartClient()

void Ipv6FragmentationTest::StartClient ( Ptr< Node ClientNode)

Start the client.

Parameters
ClientNodeThe client.

Definition at line 255 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().

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

◆ StartServer()

void Ipv6FragmentationTest::StartServer ( Ptr< Node ServerNode)

Start the server.

Parameters
ServerNodeThe server.

Definition at line 225 of file ipv6-fragmentation-test.cc.

References ns3::Socket::Bind(), HandleReadServer(), m_socketServer, ns3::MakeCallback(), and ns3::Socket::SetRecvCallback().

Referenced by DoRun().

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

Member Data Documentation

◆ m_data

uint8_t* Ipv6FragmentationTest::m_data
private

◆ m_dataSize

uint32_t Ipv6FragmentationTest::m_dataSize
private

Data size.

Definition at line 119 of file ipv6-fragmentation-test.cc.

Referenced by Ipv6FragmentationTest(), ~Ipv6FragmentationTest(), SendClient(), and SetFill().

◆ m_icmpCode

uint8_t Ipv6FragmentationTest::m_icmpCode
private

ICMP code.

Definition at line 123 of file ipv6-fragmentation-test.cc.

Referenced by Ipv6FragmentationTest(), DoRun(), and HandleReadIcmpClient().

◆ m_icmpType

uint8_t Ipv6FragmentationTest::m_icmpType
private

ICMP type.

Definition at line 122 of file ipv6-fragmentation-test.cc.

Referenced by Ipv6FragmentationTest(), DoRun(), and HandleReadIcmpClient().

◆ m_receivedPacketClient

Ptr<Packet> Ipv6FragmentationTest::m_receivedPacketClient
private

Packet received by client.

Definition at line 113 of file ipv6-fragmentation-test.cc.

Referenced by HandleReadClient().

◆ m_receivedPacketServer

Ptr<Packet> Ipv6FragmentationTest::m_receivedPacketServer
private

Packet received by server.

Definition at line 114 of file ipv6-fragmentation-test.cc.

Referenced by DoRun(), and HandleReadServer().

◆ m_sentPacketClient

Ptr<Packet> Ipv6FragmentationTest::m_sentPacketClient
private

Packet sent by client.

Definition at line 112 of file ipv6-fragmentation-test.cc.

◆ m_size

uint32_t Ipv6FragmentationTest::m_size
private

packet size.

Definition at line 121 of file ipv6-fragmentation-test.cc.

Referenced by Ipv6FragmentationTest(), SendClient(), and SetFill().

◆ m_socketClient

Ptr<Socket> Ipv6FragmentationTest::m_socketClient
private

Client socket.

Definition at line 118 of file ipv6-fragmentation-test.cc.

Referenced by DoRun(), SendClient(), and StartClient().

◆ m_socketServer

Ptr<Socket> Ipv6FragmentationTest::m_socketServer
private

Server socket.

Definition at line 117 of file ipv6-fragmentation-test.cc.

Referenced by Ipv6FragmentationTest(), and StartServer().


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