21 #include "ns3/core-module.h"
22 #include "ns3/tcp-option.h"
23 #include "ns3/tcp-option-winscale.h"
24 #include "ns3/tcp-option-ts.h"
49 void TestSerialize ();
53 void TestDeserialize ();
56 virtual void DoRun (
void);
57 virtual void DoTeardown (
void);
96 uint8_t kind =
start.PeekU8 ();
137 virtual void DoRun (
void);
158 for (uint32_t i = 0; i < 1000; ++i)
189 uint8_t kind =
start.PeekU8 ();
216 for (uint8_t i = 0; i < 15; ++i)
TCP TimeStamp option Test.
void TestSerialize()
Serialization test.
uint32_t m_timestamp
TimeStamp.
uint32_t m_echo
Echoed TimeStamp.
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual void DoTeardown(void)
Implementation to do any local setup required for this TestCase.
void TestDeserialize()
Deserialization test.
TcpOptionTSTestCase(std::string name)
Constructor.
TCP Window Scaling option Test.
void TestSerialize()
Serialization test.
void TestDeserialize()
Deserialization test.
uint8_t m_scale
Window scaling.
TcpOptionWSTestCase(std::string name, uint8_t scale)
Constructor.
virtual void DoTeardown(void)
Implementation to do any local setup required for this TestCase.
virtual void DoRun(void)
Implementation to actually run this TestCase.
iterator in a Buffer instance
automatically resized byte buffer
void AddAtStart(uint32_t start)
Buffer::Iterator Begin(void) const
Defines the TCP option of kind 8 (timestamp option) as in RFC 1323
void SetTimestamp(uint32_t ts)
Set the timestamp stored in the Option.
virtual void Serialize(Buffer::Iterator start) const
Serialize the Option to a buffer iterator.
uint32_t GetEcho(void) const
Get the timestamp echo stored in the Option.
virtual uint32_t GetSerializedSize(void) const
Returns number of bytes required for Option serialization.
uint32_t GetTimestamp(void) const
Get the timestamp stored in the Option.
void SetEcho(uint32_t ts)
Set the timestamp echo stored in the Option.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the Option from a buffer iterator.
Defines the TCP option of kind 3 (window scale option) as in RFC 1323
virtual void Serialize(Buffer::Iterator start) const
Serialize the Option to a buffer iterator.
void SetScale(uint8_t scale)
Set the scale option.
virtual uint32_t GetSerializedSize(void) const
Returns number of bytes required for Option serialization.
virtual uint32_t Deserialize(Buffer::Iterator start)
Deserialize the Option from a buffer iterator.
uint8_t GetScale(void) const
Get the scale value (uint8_t)
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_TEST_EXPECT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report if not.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
list x
Random number samples.
ns3::StringValue attribute value declarations.
static TcpOptionTestSuite g_TcpOptionTestSuite
Static variable for test initialization.