21 #include "ns3/cs-parameters.h"
22 #include "ns3/ipcs-classifier-record.h"
24 #include "ns3/packet.h"
26 #include "ns3/service-flow.h"
28 #include "ns3/wimax-helper.h"
29 #include "ns3/wimax-tlv.h"
46 void DoRun()
override;
50 :
TestCase(
"Test the CS parameters tlv implementation.")
82 sfVectorTlvValue.
Add(csParam.
ToTlv());
90 if (tlvReceived.
GetType() == Tlv::UPLINK_SERVICE_FLOW)
93 for (
auto iter = sfVecValue->Begin(); iter != sfVecValue->End(); ++iter)
95 if ((*iter)->GetType() == SfVectorTlvValue::IPV4_CS_Parameters)
106 "The classifier address did not match.");
113 "The classifier address did not match.");
120 "The classifier addresses matched.");
127 "The classifier addresses matched.");
146 void DoRun()
override;
150 :
TestCase(
"Test the service flow tlv implementation.")
185 ServiceFlow::SF_DIRECTION_DOWN,
186 "The sfRecv had the wrong direction.");
190 "The sfRecv had the wrong cs specification.");
192 ServiceFlow::SF_TYPE_UGS,
193 "The sfRecv had the wrong service scheduling type.");
196 "The sfRecv had the wrong maximum sustained traffic rate.");
199 "The sfRecv had the wrong minimum reserved traffic rate.");
202 "The sfRecv had the wrong minimum tolerable traffic rate.");
205 "The sfRecv had the wrong maximum latency.");
208 "The sfRecv had the wrong maximum traffic burst.");
211 "The sfRecv had the wrong traffic priority.");
Test the wimax tlv implementation.
Ns3WimaxCsParamTlvTestCase()
void DoRun() override
Implementation to actually run this TestCase.
~Ns3WimaxCsParamTlvTestCase() override
Test the service flow tlv implementation.
~Ns3WimaxSfTlvTestCase() override
void DoRun() override
Implementation to actually run this TestCase.
Ns3 Wimax Tlv Test Suite.
Tlv ToTlv() const
creates a tlv from the classifier record
IpcsClassifierRecord GetPacketClassifierRule() const
IpcsClassifierRecord class.
void SetIndex(uint16_t index)
Set the index of the classifier.
void AddDstAddr(Ipv4Address dstAddress, Ipv4Mask dstMask)
add a new destination ip address to the classifier
void AddSrcPortRange(uint16_t srcPortLow, uint16_t srcPortHigh)
add a range of source port to the classifier
bool CheckMatch(Ipv4Address srcAddress, Ipv4Address dstAddress, uint16_t srcPort, uint16_t dstPort, uint8_t proto) const
check if a packets can be used with this classifier
void AddDstPortRange(uint16_t dstPortLow, uint16_t dstPortHigh)
add a range of destination port to the classifier
void AddSrcAddr(Ipv4Address srcAddress, Ipv4Mask srcMask)
add a new source ip address to the classifier
void AddProtocol(uint8_t proto)
add a protocol to the classifier
Ipv4 addresses are stored in host order in this class.
a class to represent an Ipv4 address mask
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
void AddHeader(const Header &header)
Add header to this packet.
This class implements service flows as described by the IEEE-802.16 standard.
void SetSfid(uint32_t sfid)
Set SFID.
void SetCsSpecification(CsSpecification spec)
Set CS specification.
ServiceFlow::SchedulingType GetServiceSchedulingType() const
Get service scheduling type.
uint32_t GetMaxSustainedTrafficRate() const
Get max sustained traffic rate.
uint32_t GetMaxTrafficBurst() const
Get max traffic burst.
uint32_t GetSfid() const
Get SFID.
uint32_t GetMaximumLatency() const
Get maximum latency.
void SetMaxTrafficBurst(uint32_t maxTrafficBurst)
Set maximum traffic burst.
void SetServiceSchedulingType(ServiceFlow::SchedulingType schedType)
Set service scheduling type.
Tlv ToTlv() const
creates a TLV from this service flow
void SetMaximumLatency(uint32_t MaximumLatency)
Set maximum latency.
void SetConvergenceSublayerParam(CsParameters csparam)
Set convergence sublayer parameters.
uint8_t GetTrafficPriority() const
Get traffic priority.
uint32_t GetMinReservedTrafficRate() const
Get minimum reserved traffic rate.
void SetTrafficPriority(uint8_t priority)
Set traffic priority.
CsSpecification GetCsSpecification() const
Get CS specification.
void SetMinTolerableTrafficRate(uint32_t minJitter)
Set minimum tolerable traffic rate.
uint32_t GetMinTolerableTrafficRate() const
Get minimum tolerable traffic rate.
void SetMinReservedTrafficRate(uint32_t minResvRate)
Set minimum reserved traffic rate.
Direction GetDirection() const
Get direction.
void SetMaxSustainedTrafficRate(uint32_t maxSustainedRate)
Set max sustained traffic rate.
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
This class implements the Type-Len-Value structure channel encodings as described by "IEEE Standard f...
uint8_t GetType() const
Get type value.
TlvValue * PeekValue()
Peek value.
uint32_t GetSerializedSize() const override
Get serialized size in bytes.
void Add(const Tlv &val)
Add a TLV.
#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.
static Ns3WimaxTlvTestSuite ns3WimaxTlvTestSuite
the test suite