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

#include <CtsPolicy.h>

Inheritance diagram for inet::ieee80211::CtsPolicy:
inet::ieee80211::ModeSetListener inet::ieee80211::ICtsPolicy

Public Member Functions

virtual bool isCtsNeeded (Ieee80211RTSFrame *rtsFrame) const override
 
virtual simtime_t computeCtsDurationField (Ieee80211RTSFrame *frame) const override
 
- Public Member Functions inherited from inet::ieee80211::ICtsPolicy
virtual ~ICtsPolicy ()
 

Protected Member Functions

virtual int numInitStages () const override
 
virtual void initialize (int stage) override
 
virtual simtime_t computeCtsDuration (Ieee80211RTSFrame *rtsFrame) const
 
- Protected Member Functions inherited from inet::ieee80211::ModeSetListener
virtual void receiveSignal (cComponent *source, simsignal_t signalID, cObject *obj, cObject *details) override
 

Protected Attributes

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

Member Function Documentation

simtime_t inet::ieee80211::CtsPolicy::computeCtsDuration ( Ieee80211RTSFrame rtsFrame) const
protectedvirtual

Referenced by computeCtsDurationField().

36 {
38 }
IRateSelection * rateSelection
Definition: CtsPolicy.h:32
virtual const IIeee80211Mode * computeResponseCtsFrameMode(Ieee80211RTSFrame *rtsFrame)=0
virtual const simtime_t getDuration(int dataBitLength) const =0
const unsigned int LENGTH_CTS
Definition: Ieee80211Frame_m.h:42
simtime_t inet::ieee80211::CtsPolicy::computeCtsDurationField ( Ieee80211RTSFrame frame) const
overridevirtual

Implements inet::ieee80211::ICtsPolicy.

46 {
47  simtime_t duration = rtsFrame->getDuration() - modeSet->getSifsTime() - computeCtsDuration(rtsFrame);
48  return duration < 0 ? 0 : duration;
49 }
Ieee80211ModeSet * modeSet
Definition: ModeSetListener.h:31
virtual simtime_t computeCtsDuration(Ieee80211RTSFrame *rtsFrame) const
Definition: CtsPolicy.cc:35
simtime_t getSifsTime() const
Definition: Ieee80211ModeSet.h:77
void inet::ieee80211::CtsPolicy::initialize ( int  stage)
overrideprotectedvirtual

Reimplemented from inet::ieee80211::ModeSetListener.

27 {
29  if (stage == INITSTAGE_LOCAL) {
30  rx = check_and_cast<IRx *>(getModuleByPath(par("rxModule")));
31  rateSelection = check_and_cast<IRateSelection *>(getModuleByPath(par("rateSelectionModule")));
32  }
33 }
IRx * rx
Definition: CtsPolicy.h:33
IRateSelection * rateSelection
Definition: CtsPolicy.h:32
Abstract interface for Rx processes.
Definition: IRx.h:45
Abstract interface for rate selection.
Definition: IRateSelection.h:36
Local initializations.
Definition: InitStages.h:35
virtual void initialize(int stage) override
Definition: ModeSetListener.cc:25
bool inet::ieee80211::CtsPolicy::isCtsNeeded ( Ieee80211RTSFrame rtsFrame) const
overridevirtual

Implements inet::ieee80211::ICtsPolicy.

57 {
58  return rx->isMediumFree();
59 }
IRx * rx
Definition: CtsPolicy.h:33
virtual bool isMediumFree() const =0
virtual int inet::ieee80211::CtsPolicy::numInitStages ( ) const
inlineoverrideprotectedvirtual

Reimplemented from inet::ieee80211::ModeSetListener.

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

Member Data Documentation

IRateSelection* inet::ieee80211::CtsPolicy::rateSelection = nullptr
protected

Referenced by computeCtsDuration(), and initialize().

IRx* inet::ieee80211::CtsPolicy::rx = nullptr
protected

Referenced by initialize(), and isCtsNeeded().


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