23 #include "ns3/tcp-option-ts.h"
24 #include "ns3/tcp-header.h"
80 socket->SetAttribute (
"Timestamp",
BooleanValue (
false));
88 socket->SetAttribute (
"Timestamp",
BooleanValue (
false));
107 socket->SetAttribute (
"Timestamp",
BooleanValue (
false));
111 socket->SetAttribute (
"Timestamp",
BooleanValue (
false));
115 socket->SetAttribute (
"Timestamp",
BooleanValue (
true));
119 socket->SetAttribute (
"Timestamp",
BooleanValue (
true));
132 "timestamp disabled but option enabled");
137 "timestamp enabled but option disabled");
148 "timestamp disabled but option enabled");
153 "timestamp enabled but option disabled");
161 "timestamp disabled but option enabled");
173 "sender has not ts, but receiver sent anyway");
178 "receiver has not ts enabled but sent anyway");
186 "timestamp disabled but option enabled");
224 virtual void DoRun (
void);
264 Simulator::Destroy ();
276 uint32_t lastValue = TcpOptionTS::NowToTsValue ();
TCP TimeStamp enabling Test.
virtual void Tx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet transmitted down to IP layer.
virtual Ptr< TcpSocketMsgBase > CreateSenderSocket(Ptr< Node > node)
Create and install the socket to install on the sender.
Configuration m_configuration
Test configuration.
virtual Ptr< TcpSocketMsgBase > CreateReceiverSocket(Ptr< Node > node)
Create and install the socket to install on the receiver.
TimestampTestCase(TimestampTestCase::Configuration conf)
Constructor.
Configuration
TimeStamp configuration.
virtual void Rx(const Ptr< const Packet > p, const TcpHeader &h, SocketWho who)
Packet received from IP layer.
TCP TimeStamp values Test.
TimestampValueTestCase(double startTime, double timeToWait, std::string name)
Constructor.
double m_timeToWait
Time to wait (Seconds).
virtual void DoRun(void)
Implementation to actually run this TestCase.
double m_startTime
Start time (Seconds).
void Check()
Perform the test checks.
void Init()
Test initialization.
virtual void DoTeardown(void)
Implementation to do any local setup required for this TestCase.
double m_initValue
Initialization value (Seconds).
AttributeValue implementation for Boolean.
Smart pointer class similar to boost::intrusive_ptr.
General infrastructure for TCP testing.
SocketWho
Used as parameter of methods, specifies on what node the caller is interested (e.g.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
@ UNIT
This test suite implements a Unit Test.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#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.
#define NS_TEST_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report and...
Time Seconds(double value)
Construct a Time in the indicated unit.
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TcpTimestampTestSuite g_tcpTimestampTestSuite
Static variable for test initialization.