INET Framework for OMNeT++/OMNEST
inet::ieee80211::RecipientQoSAckPolicy Class Reference

#include <RecipientQoSAckPolicy.h>

Inheritance diagram for inet::ieee80211::RecipientQoSAckPolicy:
inet::ieee80211::ModeSetListener inet::ieee80211::IRecipientAckPolicy inet::ieee80211::IRecipientQoSAckPolicy

Public Member Functions

virtual bool isAckNeeded (Ieee80211DataOrMgmtFrame *frame) const override
 
virtual bool isBlockAckNeeded (Ieee80211BlockAckReq *blockAckReq, RecipientBlockAckAgreement *agreement) const override
 
virtual simtime_t computeAckDurationField (Ieee80211DataOrMgmtFrame *frame) const override
 
virtual simtime_t computeBasicBlockAckDurationField (Ieee80211BasicBlockAckReq *basicBlockAckReq) const override
 
- Public Member Functions inherited from inet::ieee80211::IRecipientAckPolicy
virtual ~IRecipientAckPolicy ()
 
- Public Member Functions inherited from inet::ieee80211::IRecipientQoSAckPolicy
virtual ~IRecipientQoSAckPolicy ()
 

Protected Member Functions

virtual int numInitStages () const override
 
virtual void initialize (int stage) override
 
simtime_t computeBasicBlockAckDuration (Ieee80211BlockAckReq *blockAckReq) const
 
simtime_t computeAckDuration (Ieee80211DataOrMgmtFrame *dataOrMgmtFrame) const
 
- Protected Member Functions inherited from inet::ieee80211::ModeSetListener
virtual void receiveSignal (cComponent *source, simsignal_t signalID, cObject *obj, cObject *details) override
 

Protected Attributes

IQoSRateSelectionrateSelection = nullptr
 
- Protected Attributes inherited from inet::ieee80211::ModeSetListener
Ieee80211ModeSetmodeSet = nullptr
 

Member Function Documentation

simtime_t inet::ieee80211::RecipientQoSAckPolicy::computeAckDuration ( Ieee80211DataOrMgmtFrame dataOrMgmtFrame) const
protected

Referenced by computeAckDurationField().

40 {
42 }
const unsigned int LENGTH_ACK
Definition: Ieee80211Frame_m.h:43
virtual const simtime_t getDuration(int dataBitLength) const =0
IQoSRateSelection * rateSelection
Definition: RecipientQoSAckPolicy.h:32
virtual const IIeee80211Mode * computeResponseAckFrameMode(Ieee80211DataOrMgmtFrame *dataOrMgmtFrame)=0
simtime_t inet::ieee80211::RecipientQoSAckPolicy::computeAckDurationField ( Ieee80211DataOrMgmtFrame frame) const
overridevirtual

Implements inet::ieee80211::IRecipientAckPolicy.

89 {
90  simtime_t duration = frame->getDuration() - modeSet->getSifsTime() - computeAckDuration(frame);
91  return duration < 0 ? 0 : duration;
92 }
simtime_t computeAckDuration(Ieee80211DataOrMgmtFrame *dataOrMgmtFrame) const
Definition: RecipientQoSAckPolicy.cc:39
virtual ::omnetpp::simtime_t getDuration() const
Ieee80211ModeSet * modeSet
Definition: ModeSetListener.h:31
simtime_t getSifsTime() const
Definition: Ieee80211ModeSet.h:77
simtime_t inet::ieee80211::RecipientQoSAckPolicy::computeBasicBlockAckDuration ( Ieee80211BlockAckReq blockAckReq) const
protected

Referenced by computeBasicBlockAckDurationField().

35 {
37 }
virtual const simtime_t getDuration(int dataBitLength) const =0
IQoSRateSelection * rateSelection
Definition: RecipientQoSAckPolicy.h:32
const unsigned int LENGTH_BASIC_BLOCKACK
Definition: Ieee80211Frame_m.h:46
virtual const IIeee80211Mode * computeResponseBlockAckFrameMode(Ieee80211BlockAckReq *blockAckReq)=0
simtime_t inet::ieee80211::RecipientQoSAckPolicy::computeBasicBlockAckDurationField ( Ieee80211BasicBlockAckReq basicBlockAckReq) const
overridevirtual

Implements inet::ieee80211::IRecipientQoSAckPolicy.

102 {
103  return basicBlockAckReq->getDuration() - modeSet->getSifsTime() - computeBasicBlockAckDuration(basicBlockAckReq);
104 }
virtual ::omnetpp::simtime_t getDuration() const
simtime_t computeBasicBlockAckDuration(Ieee80211BlockAckReq *blockAckReq) const
Definition: RecipientQoSAckPolicy.cc:34
Ieee80211ModeSet * modeSet
Definition: ModeSetListener.h:31
simtime_t getSifsTime() const
Definition: Ieee80211ModeSet.h:77
void inet::ieee80211::RecipientQoSAckPolicy::initialize ( int  stage)
overrideprotectedvirtual

Reimplemented from inet::ieee80211::ModeSetListener.

27 {
29  if (stage == INITSTAGE_LOCAL) {
30  rateSelection = check_and_cast<IQoSRateSelection*>(getModuleByPath(par("rateSelectionModule")));
31  }
32 }
Abstract interface for rate selection.
Definition: IQoSRateSelection.h:36
IQoSRateSelection * rateSelection
Definition: RecipientQoSAckPolicy.h:32
Local initializations.
Definition: InitStages.h:35
virtual void initialize(int stage) override
Definition: ModeSetListener.cc:25
bool inet::ieee80211::RecipientQoSAckPolicy::isAckNeeded ( Ieee80211DataOrMgmtFrame frame) const
overridevirtual

Implements inet::ieee80211::IRecipientAckPolicy.

50 {
51  // TODO: add mgmt frame NoAck check
52  if (auto dataFrame = dynamic_cast<Ieee80211DataFrame*>(frame))
53  if (dataFrame->getAckPolicy() != NORMAL_ACK)
54  return false;
55  return !frame->getReceiverAddress().isMulticast();
56 }
virtual MACAddress & getReceiverAddress()
Definition: Ieee80211Frame_m.h:139
bool isMulticast() const
Returns true if this is a multicast logical address (first byte&#39;s lsb is 1).
Definition: MACAddress.h:146
bool inet::ieee80211::RecipientQoSAckPolicy::isBlockAckNeeded ( Ieee80211BlockAckReq blockAckReq,
RecipientBlockAckAgreement agreement 
) const
overridevirtual

Implements inet::ieee80211::IRecipientQoSAckPolicy.

72 {
73  if (dynamic_cast<Ieee80211BasicBlockAckReq*>(blockAckReq)) {
74  return agreement != nullptr;
75  // TODO: The Basic BlockAckReq frame shall be discarded if all MSDUs referenced by this
76  // frame have been discarded from the transmit buffer due to expiry of their lifetime limit.
77  }
78  else
79  throw cRuntimeError("Unsupported BlockAckReq");
80 }
virtual int inet::ieee80211::RecipientQoSAckPolicy::numInitStages ( ) const
inlineoverrideprotectedvirtual

Reimplemented from inet::ieee80211::ModeSetListener.

35 { return NUM_INIT_STAGES; }
The number of initialization stages.
Definition: InitStages.h:116

Member Data Documentation

IQoSRateSelection* inet::ieee80211::RecipientQoSAckPolicy::rateSelection = nullptr
protected

The documentation for this class was generated from the following files: