24 #include "ns3/ipcs-classifier-record.h"
26 #include "ns3/packet.h"
27 #include "ns3/wimax-helper.h"
28 #include "ns3/wimax-tlv.h"
29 #include "ns3/service-flow.h"
30 #include "ns3/cs-parameters.h"
47 virtual void DoRun (
void);
52 :
TestCase (
"Test the CS parameters tlv implementation.")
85 sfVectorTlvValue.
Add (csParam.
ToTlv ());
92 packet->RemoveHeader (tlvReceived);
93 if (tlvReceived.
GetType () == Tlv::UPLINK_SERVICE_FLOW)
97 for (std::vector<Tlv*>::const_iterator iter = sfVecValue->
Begin (); iter
98 != sfVecValue->
End (); ++iter)
100 if ((*iter)->GetType () == SfVectorTlvValue::IPV4_CS_Parameters)
110 17),
false,
"The classifier address did not match.");
115 6),
false,
"The classifier address did not match.");
120 17),
false,
"The classifier addresses matched.");
125 8),
false,
"The classifier addresses matched.");
144 virtual void DoRun (
void);
149 :
TestCase (
"Test the service flow tlv implementation.")
Test the wimax tlv implementation.
uint32_t RemoveHeader(Header &header)
Deserialize and remove the header from the internal buffer.
uint32_t GetMinTolerableTrafficRate(void) const
Get minimum tolerable traffic rate.
uint32_t GetMaxTrafficBurst(void) const
Get max traffic burst.
a class to represent an Ipv4 address mask
Test the service flow tlv implementation.
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
uint32_t GetSfid(void) const
Get SFID.
virtual uint32_t GetSerializedSize(void) const
Get serialized size in bytes.
static Ns3WimaxTlvTestSuite ns3WimaxTlvTestSuite
the test suite
This class implements the Type-Len-Value structure channel encodings as described by "IEEE Standard f...
IpcsClassifierRecord class.
void SetMinReservedTrafficRate(uint32_t minResvRate)
Set minimum reserved traffic rate.
virtual void DoRun(void)
Implementation to actually run this TestCase.
uint32_t GetMinReservedTrafficRate(void) const
Get minimum reserved traffic rate.
void Add(const Tlv &val)
Add a TLV.
void AddSrcAddr(Ipv4Address srcAddress, Ipv4Mask srcMask)
add a new source ip address to the classifier
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
#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.
void AddSrcPortRange(uint16_t srcPortLow, uint16_t srcPortHigh)
add a range of source port to the classifier
virtual ~Ns3WimaxCsParamTlvTestCase()
virtual void DoRun(void)
Implementation to actually run this TestCase.
Tlv ToTlv(void) const
creates a tlv from the classifier record
enum CsSpecification GetCsSpecification(void) const
Get CS specification.
void AddDstAddr(Ipv4Address dstAddress, Ipv4Mask dstMask)
add a new destination ip address to the classifier
uint8_t GetType(void) const
Get type value.
uint32_t GetMaximumLatency(void) const
Get maximum latency.
void SetMaximumLatency(uint32_t MaximumLatency)
Set maximum latency.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetConvergenceSublayerParam(CsParameters csparam)
Set convergence sublayer parameters.
uint8_t GetTrafficPriority(void) const
Get traffic priority.
Ns3 Wimax Tlv Test Suite.
TlvValue * PeekValue(void)
Peek value.
This class implements service flows as described by the IEEE-802.16 standard.
void AddDstPortRange(uint16_t dstPortLow, uint16_t dstPortHigh)
add a range of destination port to the classifier
virtual ~Ns3WimaxSfTlvTestCase()
void SetMinTolerableTrafficRate(uint32_t minJitter)
Set minimum tolerable traffic rate.
Ipv4 addresses are stored in host order in this class.
enum Direction GetDirection(void) const
Get direction.
void AddProtocol(uint8_t proto)
add a protocol to the classifier
Iterator Begin() const
Begin iterator.
void SetIndex(uint16_t index)
Set the index of the classifier.
void SetMaxTrafficBurst(uint32_t maxTrafficBurst)
Set maximum traffic burst.
void SetSfid(uint32_t sfid)
Set SFID.
void SetTrafficPriority(uint8_t priority)
Set traffic priority.
uint32_t GetMaxSustainedTrafficRate(void) const
Get max sustained traffic rate.
void SetCsSpecification(enum CsSpecification spec)
Set CS specification.
void SetMaxSustainedTrafficRate(uint32_t maxSustainedRate)
Set max sustained traffic rate.
Tlv ToTlv(void) const
creates a TLV from this service flow
void SetServiceSchedulingType(enum ServiceFlow::SchedulingType schedType)
Set service scheduling type.
IpcsClassifierRecord GetPacketClassifierRule(void) const
enum ServiceFlow::SchedulingType GetServiceSchedulingType(void) const
Get service scheduling type.
void AddHeader(const Header &header)
Add header to this packet.
Ns3WimaxCsParamTlvTestCase()
Iterator End() const
End iterator.