10#include "ns3/cs-parameters.h"
11#include "ns3/ipcs-classifier-record.h"
13#include "ns3/packet.h"
15#include "ns3/service-flow.h"
17#include "ns3/wimax-helper.h"
18#include "ns3/wimax-tlv.h"
35 void DoRun()
override;
39 :
TestCase(
"Test the CS parameters tlv implementation.")
71 sfVectorTlvValue.
Add(csParam.
ToTlv());
75 packet->AddHeader(tlvSent);
78 packet->RemoveHeader(tlvReceived);
82 for (
auto iter = sfVecValue->Begin(); iter != sfVecValue->End(); ++iter)
95 "The classifier address did not match.");
102 "The classifier address did not match.");
109 "The classifier addresses matched.");
116 "The classifier addresses matched.");
135 void DoRun()
override;
139 :
TestCase(
"Test the service flow tlv implementation.")
166 packet->AddHeader(sf.
ToTlv());
169 packet->RemoveHeader(tlvReceived);
175 "The sfRecv had the wrong direction.");
179 "The sfRecv had the wrong cs specification.");
182 "The sfRecv had the wrong service scheduling type.");
185 "The sfRecv had the wrong maximum sustained traffic rate.");
188 "The sfRecv had the wrong minimum reserved traffic rate.");
191 "The sfRecv had the wrong minimum tolerable traffic rate.");
194 "The sfRecv had the wrong maximum latency.");
197 "The sfRecv had the wrong maximum traffic burst.");
200 "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
Smart pointer class similar to boost::intrusive_ptr.
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, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
This class implements the Type-Len-Value structure channel encodings as described by "IEEEStandard fo...
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.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
#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