A Discrete-Event Network Simulator
API
ns3::WScalingTestCase Class Reference
+ Inheritance diagram for ns3::WScalingTestCase:
+ Collaboration diagram for ns3::WScalingTestCase:

Public Types

enum  Configuration { DISABLED, ENABLED_CLIENT, ENABLED_SERVER, ENABLED }
 
- Public Types inherited from ns3::TestCase
enum  TestDuration { QUICK = 1, EXTENSIVE = 2, TAKES_FOREVER = 3 }
 How long the test takes to execute. More...
 

Public Member Functions

 WScalingTestCase (WScalingTestCase::Configuration conf, uint32_t maxServerBufferSize, uint32_t maxSourceBufferSize, std::string name)
 
- Public Member Functions inherited from ns3::TestCase
virtual ~TestCase ()
 Destructor. More...
 
std::string GetName (void) const
 

Private Member Functions

Ptr< SimpleNetDeviceAddSimpleNetDevice (Ptr< Node > node, const char *ipaddr, const char *netmask)
 
Ptr< SimpleNetDeviceAddSimpleNetDevice6 (Ptr< Node > node, Ipv6Address ipaddr, Ipv6Prefix prefix)
 
Ptr< NodeCreateInternetNode (void)
 
Ptr< NodeCreateInternetNode6 (void)
 
virtual void DoRun (void)
 Implementation to actually run this TestCase. More...
 
virtual void DoTeardown (void)
 Implementation to do any local setup required for this TestCase. More...
 
void ServerHandleConnectionCreated (Ptr< Socket > s, const Address &addr)
 
void ServerHandleRecv (Ptr< Socket > sock)
 
void ServerHandleSend (Ptr< Socket > sock, uint32_t sendB)
 
void SetupDefaultSim (void)
 
void SourceHandleConnectionCreated (Ptr< Socket > sock)
 
void SourceHandleRecv (Ptr< Socket > sock)
 
void SourceHandleSend (Ptr< Socket > sock, uint32_t available)
 

Private Attributes

Configuration m_configuration
 
uint32_t m_currentServerRxBytes
 
uint32_t m_currentServerTxBytes
 
uint32_t m_currentSourceRxBytes
 
uint32_t m_currentSourceTxBytes
 
uint32_t m_maxServerBufferSize
 
uint32_t m_maxSourceBufferSize
 
Ptr< TcpSocketBasem_server
 
uint32_t m_serverReadSize
 
uint32_t m_serverWriteSize
 
Ptr< TcpSocketBasem_source
 
uint32_t m_sourceReadSize
 
uint32_t m_sourceWriteSize
 
uint32_t m_totalBytes
 

Additional Inherited Members

- Protected Member Functions inherited from ns3::TestCase
 TestCase (std::string name)
 Constructor. More...
 
void AddTestCase (TestCase *testCase, enum TestDuration duration)
 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

Definition at line 56 of file tcp-wscaling-test.cc.

Member Enumeration Documentation

Enumerator
DISABLED 
ENABLED_CLIENT 
ENABLED_SERVER 
ENABLED 

Definition at line 59 of file tcp-wscaling-test.cc.

Constructor & Destructor Documentation

ns3::WScalingTestCase::WScalingTestCase ( WScalingTestCase::Configuration  conf,
uint32_t  maxServerBufferSize,
uint32_t  maxSourceBufferSize,
std::string  name 
)

Member Function Documentation

Ptr< SimpleNetDevice > ns3::WScalingTestCase::AddSimpleNetDevice ( Ptr< Node node,
const char *  ipaddr,
const char *  netmask 
)
private

Definition at line 327 of file tcp-wscaling-test.cc.

References ns3::Node::AddDevice(), ns3::Mac48Address::Allocate(), ns3::Mac48Address::ConvertFrom(), and ns3::Object::GetObject().

Referenced by SetupDefaultSim().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Ptr<SimpleNetDevice> ns3::WScalingTestCase::AddSimpleNetDevice6 ( Ptr< Node node,
Ipv6Address  ipaddr,
Ipv6Prefix  prefix 
)
private
Ptr< Node > ns3::WScalingTestCase::CreateInternetNode ( void  )
private

Definition at line 300 of file tcp-wscaling-test.cc.

References ns3::Object::AggregateObject().

Referenced by SetupDefaultSim().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Ptr<Node> ns3::WScalingTestCase::CreateInternetNode6 ( void  )
private
void ns3::WScalingTestCase::DoRun ( void  )
privatevirtual

Implementation to actually run this TestCase.

Subclasses should override this method to conduct their tests.

Implements ns3::TestCase.

Definition at line 127 of file tcp-wscaling-test.cc.

References m_currentServerRxBytes, m_currentServerTxBytes, m_currentSourceRxBytes, m_currentSourceTxBytes, m_totalBytes, NS_TEST_EXPECT_MSG_EQ, ns3::Simulator::Run(), and SetupDefaultSim().

+ Here is the call graph for this function:

void ns3::WScalingTestCase::DoTeardown ( void  )
privatevirtual

Implementation to do any local setup required for this TestCase.

Subclasses should override this method to perform any costly per-test teardown

Reimplemented from ns3::TestCase.

Definition at line 160 of file tcp-wscaling-test.cc.

References ns3::Simulator::Destroy().

+ Here is the call graph for this function:

void ns3::WScalingTestCase::ServerHandleConnectionCreated ( Ptr< Socket s,
const Address addr 
)
private

Definition at line 166 of file tcp-wscaling-test.cc.

References ENABLED, m_configuration, m_maxSourceBufferSize, m_source, ns3::MakeCallback(), NS_TEST_EXPECT_MSG_EQ, NS_TEST_EXPECT_MSG_LT_OR_EQ, ServerHandleRecv(), ServerHandleSend(), ns3::Socket::SetRecvCallback(), and ns3::Socket::SetSendCallback().

Referenced by SetupDefaultSim().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::WScalingTestCase::ServerHandleRecv ( Ptr< Socket sock)
private
void ns3::WScalingTestCase::ServerHandleSend ( Ptr< Socket sock,
uint32_t  sendB 
)
private

Definition at line 237 of file tcp-wscaling-test.cc.

References ns3::Socket::Close(), ns3::Socket::GetTxAvailable(), m_currentServerRxBytes, m_currentServerTxBytes, m_serverWriteSize, m_totalBytes, NS_TEST_EXPECT_MSG_EQ, and ns3::Socket::Send().

Referenced by ServerHandleConnectionCreated(), and ServerHandleRecv().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::WScalingTestCase::SourceHandleConnectionCreated ( Ptr< Socket sock)
private

Definition at line 213 of file tcp-wscaling-test.cc.

References ENABLED, m_configuration, m_maxServerBufferSize, m_server, NS_TEST_EXPECT_MSG_EQ, and NS_TEST_EXPECT_MSG_LT_OR_EQ.

Referenced by SetupDefaultSim().

+ Here is the caller graph for this function:

void ns3::WScalingTestCase::SourceHandleRecv ( Ptr< Socket sock)
private

Definition at line 278 of file tcp-wscaling-test.cc.

References ns3::Socket::Close(), ns3::Socket::ERROR_NOTERROR, ns3::Socket::GetErrno(), ns3::Socket::GetRxAvailable(), m_currentSourceRxBytes, m_sourceReadSize, m_totalBytes, NS_FATAL_ERROR, and ns3::Socket::Recv().

Referenced by SetupDefaultSim().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ns3::WScalingTestCase::SourceHandleSend ( Ptr< Socket sock,
uint32_t  available 
)
private

Definition at line 261 of file tcp-wscaling-test.cc.

References ns3::Socket::GetTxAvailable(), m_currentSourceTxBytes, m_sourceWriteSize, m_totalBytes, NS_TEST_EXPECT_MSG_EQ, and ns3::Socket::Send().

Referenced by SetupDefaultSim().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

Configuration ns3::WScalingTestCase::m_configuration
private
uint32_t ns3::WScalingTestCase::m_currentServerRxBytes
private

Definition at line 100 of file tcp-wscaling-test.cc.

Referenced by DoRun(), ServerHandleRecv(), and ServerHandleSend().

uint32_t ns3::WScalingTestCase::m_currentServerTxBytes
private

Definition at line 101 of file tcp-wscaling-test.cc.

Referenced by DoRun(), and ServerHandleSend().

uint32_t ns3::WScalingTestCase::m_currentSourceRxBytes
private

Definition at line 99 of file tcp-wscaling-test.cc.

Referenced by DoRun(), and SourceHandleRecv().

uint32_t ns3::WScalingTestCase::m_currentSourceTxBytes
private

Definition at line 98 of file tcp-wscaling-test.cc.

Referenced by DoRun(), and SourceHandleSend().

uint32_t ns3::WScalingTestCase::m_maxServerBufferSize
private
uint32_t ns3::WScalingTestCase::m_maxSourceBufferSize
private
Ptr<TcpSocketBase> ns3::WScalingTestCase::m_server
private

Definition at line 106 of file tcp-wscaling-test.cc.

Referenced by SetupDefaultSim(), and SourceHandleConnectionCreated().

uint32_t ns3::WScalingTestCase::m_serverReadSize
private

Definition at line 97 of file tcp-wscaling-test.cc.

Referenced by ServerHandleRecv(), and WScalingTestCase().

uint32_t ns3::WScalingTestCase::m_serverWriteSize
private

Definition at line 96 of file tcp-wscaling-test.cc.

Referenced by ServerHandleSend(), and WScalingTestCase().

Ptr<TcpSocketBase> ns3::WScalingTestCase::m_source
private

Definition at line 107 of file tcp-wscaling-test.cc.

Referenced by ServerHandleConnectionCreated(), and SetupDefaultSim().

uint32_t ns3::WScalingTestCase::m_sourceReadSize
private

Definition at line 95 of file tcp-wscaling-test.cc.

Referenced by SourceHandleRecv(), and WScalingTestCase().

uint32_t ns3::WScalingTestCase::m_sourceWriteSize
private

Definition at line 94 of file tcp-wscaling-test.cc.

Referenced by SourceHandleSend(), and WScalingTestCase().

uint32_t ns3::WScalingTestCase::m_totalBytes
private

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