23 #include "ns3/core-module.h"
24 #include "ns3/network-module.h"
25 #include "ns3/internet-module.h"
51 virtual void DoRun ();
54 bool m_connectionFailed{
false};
55 bool m_useEcn {
false};
76 TypeId tid = TcpSocketFactory::GetTypeId ();
78 Ptr<Socket> socket = Socket::CreateSocket (node, tid);
82 tcpSocket->SetUseEcn (TcpSocketState::On);
90 Simulator::Destroy ();
Test that connection failed callback is called when SYN retransmission number is exceeded.
bool m_connectionFailed
Connection failure indicator.
virtual void DoRun()
Implementation to actually run this TestCase.
void HandleConnectionFailed(Ptr< Socket > socket)
Handle a connection failure.
bool m_useEcn
Use ECN (true or false)
TcpSynConnectionFailedTest(std::string desc, bool useEcn)
Constructor.
TcpSynConnectionFailedTestSuite()
aggregate IP/TCP/UDP functionality to existing Nodes.
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
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.
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 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, Ts... > MakeNullCallback(void)
#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, Ts... > MakeCallback(R(T::*memPtr)(Ts...), 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.