22#include "ns3/buffer.h"
26#include "ns3/packet.h"
27#include "ns3/pointer.h"
28#include "ns3/simulator.h"
39 m_maxDsaReqRetries(100),
42 m_currentTransactionId(0),
43 m_transactionIdIndex(1),
45 m_pendingServiceFlow(nullptr)
98 sf->CopyParametersFrom(serviceFlow);
113 serviceFlow !=
nullptr,
114 "Error while initiating a new service flow: All service flows have been initiated");
141 p->AddHeader(dsaAck);
156 p->AddHeader(dsaReq);
167 NS_LOG_DEBUG(
"Service flows could not be initialized!");
208 (*m_pendingServiceFlow) = sf;
216 ss->GetConnectionManager()->AddConnection(transportConnection,
Cid::TRANSPORT);
221 if (serviceFlow ==
nullptr)
223 ss->SetAreServiceFlowsAllocated(
true);
This class implements the DSA-ACK message described by "IEEE Standard forLocal and metropolitan area ...
void SetConfirmationCode(uint16_t confirmationCode)
Set confirmation code field.
void SetTransactionId(uint16_t transactionId)
Set transaction ID field.
This class implements the DSA-REQ message described by "IEEE Standard forLocal and metropolitan area ...
void SetTransactionId(uint16_t transactionId)
set the transaction ID
uint16_t GetTransactionId() const
void SetServiceFlow(ServiceFlow sf)
specify a service flow to be requested by this message
This class implements the DSA-RSP message described by "IEEE Standard forLocal and metropolitan area ...
ServiceFlow GetServiceFlow() const
uint16_t GetTransactionId() const
An identifier for simulation events.
bool IsPending() const
This method is syntactic sugar for !IsExpired().
Mac Management messages Section 6.3.2.3 MAC Management messages page 42, Table 14 page 43.
Smart pointer class similar to boost::intrusive_ptr.
This class implements service flows as described by the IEEE-802.16 standard.
uint16_t GetCid() const
Get CID.
void SetUnsolicitedGrantInterval(uint16_t unsolicitedGrantInterval)
Set unsolicited grant interval.
void SetUnsolicitedPollingInterval(uint16_t unsolicitedPollingInterval)
Set unsolicited polling interval.
void SetConnection(Ptr< WimaxConnection > connection)
Set connection.
void SetIsEnabled(bool isEnabled)
Set is enabled flag.
The same service flow manager class serves both for BS and SS though some functions are exclusive to ...
ServiceFlow * GetNextServiceFlowToAllocate()
void AddServiceFlow(ServiceFlow *serviceFlow)
Add service flow function.
void DoDispose() override
Destructor implementation.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static void Cancel(const EventId &id)
Set the cancel bit on this event: the event's associated function will not be invoked when it expires...
void ScheduleDsaReq(const ServiceFlow *serviceFlow)
Schedule DSA response.
void ProcessDsaRsp(const DsaRsp &dsaRsp)
Process DSA response.
uint16_t m_currentTransactionId
current transaction ID
EventId GetDsaRspTimeoutEvent() const
Get DSA response timeout event.
uint8_t m_dsaReqRetries
DSA request retries.
EventId m_dsaAckTimeoutEvent
DSA ack timeout event.
ServiceFlow * m_pendingServiceFlow
pending service flow
EventId GetDsaAckTimeoutEvent() const
Get DSA ack timeout event.
void InitiateServiceFlows()
Initiate service flows.
@ CONFIRMATION_CODE_SUCCESS
EventId m_dsaRspTimeoutEvent
DSA response timeout event.
DsaReq CreateDsaReq(const ServiceFlow *serviceFlow)
Create DSA request.
void AddServiceFlow(ServiceFlow *serviceFlow)
add a service flow to the list
SsServiceFlowManager(Ptr< SubscriberStationNetDevice > device)
Constructor.
Ptr< SubscriberStationNetDevice > m_device
the device
DsaReq m_dsaReq
DSA request.
uint16_t m_transactionIdIndex
transaction ID index
uint8_t m_maxDsaReqRetries
maximum DSA request retries
static TypeId GetTypeId()
Register this type.
void DoDispose() override
Destructor implementation.
~SsServiceFlowManager() override
void SetMaxDsaReqRetries(uint8_t maxDsaReqRetries)
sets the maximum retries on DSA request message
uint8_t GetMaxDsaReqRetries() const
Ptr< Packet > CreateDsaAck()
Create DSA ack.
SubscriberStationNetDevice subclass of WimaxNetDevice.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Every class exported by the ns3 library is enclosed in the ns3 namespace.