19 #include "ns3/core-module.h"
20 #include "ns3/internet-module.h"
21 #include "ns3/network-module.h"
49 void DoRun()
override;
52 bool m_connectionFailed{
false};
76 TypeId tid = TcpSocketFactory::GetTypeId();
78 Ptr<Socket> socket = Socket::CreateSocket(node, tid);
82 tcpSocket->SetUseEcn(TcpSocketState::On);
Test that connection failed callback is called when SYN retransmission number is exceeded.
bool m_connectionFailed
Connection failure indicator.
void HandleConnectionFailed(Ptr< Socket > socket)
Handle a connection failure.
void DoRun() override
Implementation to actually run this TestCase.
bool m_useEcn
Use ECN (true or false)
TcpSynConnectionFailedTest(std::string desc, bool useEcn)
Constructor.
TcpSynConnectionFailedTestSuite()
aggregate IP/TCP/UDP functionality to existing Nodes.
virtual int Connect(const Address &address)=0
Initiate a connection to a remote host.
virtual int Bind(const Address &address)=0
Allocate a local endpoint for this socket.
void SetConnectCallback(Callback< void, Ptr< Socket >> connectionSucceeded, Callback< void, Ptr< Socket >> connectionFailed)
Specify callbacks to allow the caller to determine if the connection succeeds of fails.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
@ UNIT
This test suite implements a Unit Test.
a unique identifier for an interface.
Callback< R, Args... > MakeNullCallback()
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
static TcpSynConnectionFailedTestSuite g_TcpSynConnectionFailedTestSuite
Static variable for test initialization.