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

#include <FrameSequenceContext.h>

Public Member Functions

 FrameSequenceContext (MACAddress address, Ieee80211ModeSet *modeSet, InProgressFrames *inProgressFrames, IRtsProcedure *rtsProcedure, IRtsPolicy *rtsPolicy, NonQoSContext *nonQosContext, QoSContext *qosContext)
 
virtual ~FrameSequenceContext ()
 
virtual void addStep (IFrameSequenceStep *step)
 
virtual int getNumSteps () const
 
virtual IFrameSequenceStepgetStep (int i) const
 
virtual IFrameSequenceStepgetLastStep () const
 
virtual IFrameSequenceStepgetStepBeforeLast () const
 
virtual InProgressFramesgetInProgressFrames () const
 
virtual IRtsProceduregetRtsProcedure () const
 
virtual IRtsPolicygetRtsPolicy () const
 
virtual NonQoSContextgetNonQoSContext () const
 
virtual QoSContextgetQoSContext () const
 
virtual simtime_t getAckTimeout (Ieee80211DataOrMgmtFrame *dataOrMgmtframe) const
 
virtual simtime_t getCtsTimeout (Ieee80211RTSFrame *rtsFrame) const
 
virtual simtime_t getIfs () const
 
virtual bool isForUs (Ieee80211Frame *frame) const
 
virtual bool isSentByUs (Ieee80211Frame *frame) const
 

Protected Attributes

MACAddress address = MACAddress::UNSPECIFIED_ADDRESS
 
Ieee80211ModeSetmodeSet = nullptr
 
InProgressFramesinProgressFrames = nullptr
 
std::vector< IFrameSequenceStep * > steps
 
IRtsProcedurertsProcedure = nullptr
 
IRtsPolicyrtsPolicy = nullptr
 
NonQoSContextnonQoSContext = nullptr
 
QoSContextqosContext = nullptr
 

Constructor & Destructor Documentation

inet::ieee80211::FrameSequenceContext::FrameSequenceContext ( MACAddress  address,
Ieee80211ModeSet modeSet,
InProgressFrames inProgressFrames,
IRtsProcedure rtsProcedure,
IRtsPolicy rtsPolicy,
NonQoSContext nonQosContext,
QoSContext qosContext 
)
23  :
25  modeSet(modeSet),
26  inProgressFrames(inProgressFrames),
27  rtsProcedure(rtsProcedure),
28  rtsPolicy(rtsPolicy),
30  qosContext(qosContext)
31 {
32 }
IRtsProcedure * rtsProcedure
Definition: FrameSequenceContext.h:71
NonQoSContext * nonQoSContext
Definition: FrameSequenceContext.h:74
MACAddress address
Definition: FrameSequenceContext.h:66
Ieee80211ModeSet * modeSet
Definition: FrameSequenceContext.h:67
IRtsPolicy * rtsPolicy
Definition: FrameSequenceContext.h:72
InProgressFrames * inProgressFrames
Definition: FrameSequenceContext.h:68
QoSContext * qosContext
Definition: FrameSequenceContext.h:75
inet::ieee80211::FrameSequenceContext::~FrameSequenceContext ( )
virtual
66 {
67  for (auto step : steps)
68  delete step;
69  delete nonQoSContext;
70  delete qosContext;
72 }
std::vector< IFrameSequenceStep * > steps
Definition: FrameSequenceContext.h:69
NonQoSContext * nonQoSContext
Definition: FrameSequenceContext.h:74
virtual void clearDroppedFrames()
Definition: InProgressFrames.cc:123
InProgressFrames * inProgressFrames
Definition: FrameSequenceContext.h:68
QoSContext * qosContext
Definition: FrameSequenceContext.h:75

Member Function Documentation

virtual void inet::ieee80211::FrameSequenceContext::addStep ( IFrameSequenceStep step)
inlinevirtual

Referenced by inet::ieee80211::FrameSequenceHandler::startFrameSequenceStep().

81 { steps.push_back(step); }
std::vector< IFrameSequenceStep * > steps
Definition: FrameSequenceContext.h:69
simtime_t inet::ieee80211::FrameSequenceContext::getAckTimeout ( Ieee80211DataOrMgmtFrame dataOrMgmtframe) const
virtual

Referenced by inet::ieee80211::ManagementAckFs::prepareStep(), inet::ieee80211::AckFs::prepareStep(), inet::ieee80211::FragFrameAckFs::prepareStep(), and inet::ieee80211::LastFrameAckFs::prepareStep().

40 {
41  return qosContext ? qosContext->ackPolicy->getAckTimeout(dataOrMgmtframe) : nonQoSContext->ackPolicy->getAckTimeout(dataOrMgmtframe);
42 }
virtual simtime_t getAckTimeout(Ieee80211DataOrMgmtFrame *frame) const =0
NonQoSContext * nonQoSContext
Definition: FrameSequenceContext.h:74
virtual simtime_t getAckTimeout(Ieee80211DataOrMgmtFrame *dataOrMgmtFrame) const =0
IOriginatorAckPolicy * ackPolicy
Definition: FrameSequenceContext.h:60
IOriginatorQoSAckPolicy * ackPolicy
Definition: FrameSequenceContext.h:47
QoSContext * qosContext
Definition: FrameSequenceContext.h:75
simtime_t inet::ieee80211::FrameSequenceContext::getCtsTimeout ( Ieee80211RTSFrame rtsFrame) const
virtual

Referenced by inet::ieee80211::RtsCtsFs::prepareStep(), and inet::ieee80211::CtsFs::prepareStep().

45 {
46  return rtsPolicy->getCtsTimeout(rtsFrame);
47 }
virtual simtime_t getCtsTimeout(Ieee80211RTSFrame *rtsFrame) const =0
IRtsPolicy * rtsPolicy
Definition: FrameSequenceContext.h:72
simtime_t inet::ieee80211::FrameSequenceContext::getIfs ( ) const
virtual
virtual NonQoSContext* inet::ieee80211::FrameSequenceContext::getNonQoSContext ( ) const
inlinevirtual
91 { return nonQoSContext; }
NonQoSContext * nonQoSContext
Definition: FrameSequenceContext.h:74
virtual int inet::ieee80211::FrameSequenceContext::getNumSteps ( ) const
inlinevirtual

Referenced by getIfs().

82 { return steps.size(); }
std::vector< IFrameSequenceStep * > steps
Definition: FrameSequenceContext.h:69
virtual QoSContext* inet::ieee80211::FrameSequenceContext::getQoSContext ( ) const
inlinevirtual
virtual IRtsPolicy* inet::ieee80211::FrameSequenceContext::getRtsPolicy ( ) const
inlinevirtual

Referenced by inet::ieee80211::TxOpFs::isRtsCtsNeeded(), and inet::ieee80211::DcfFs::isRtsCtsNeeded().

89 { return rtsPolicy; }
IRtsPolicy * rtsPolicy
Definition: FrameSequenceContext.h:72
virtual IRtsProcedure* inet::ieee80211::FrameSequenceContext::getRtsProcedure ( ) const
inlinevirtual

Referenced by inet::ieee80211::RtsCtsFs::prepareStep(), and inet::ieee80211::RtsFs::prepareStep().

88 { return rtsProcedure; }
IRtsProcedure * rtsProcedure
Definition: FrameSequenceContext.h:71
virtual IFrameSequenceStep* inet::ieee80211::FrameSequenceContext::getStepBeforeLast ( ) const
inlinevirtual

Referenced by inet::ieee80211::FrameSequenceHandler::abortFrameSequence(), and inet::ieee80211::FrameSequenceHandler::finishFrameSequenceStep().

85 { return steps.size() > 1 ? steps[steps.size() - 2] : nullptr; }
std::vector< IFrameSequenceStep * > steps
Definition: FrameSequenceContext.h:69
bool inet::ieee80211::FrameSequenceContext::isForUs ( Ieee80211Frame frame) const
virtual

Referenced by inet::ieee80211::ManagementAckFs::completeStep(), inet::ieee80211::AckFs::completeStep(), inet::ieee80211::RtsCtsFs::completeStep(), inet::ieee80211::CtsFs::completeStep(), inet::ieee80211::FragFrameAckFs::completeStep(), inet::ieee80211::LastFrameAckFs::completeStep(), and inet::ieee80211::BlockAckReqBlockAckFs::completeStep().

50 {
51  return frame->getReceiverAddress() == address || (frame->getReceiverAddress().isMulticast() && !isSentByUs(frame));
52 }
virtual MACAddress & getReceiverAddress()
virtual bool isSentByUs(Ieee80211Frame *frame) const
Definition: FrameSequenceContext.cc:54
bool isMulticast() const
Returns true if this is a multicast logical address (first byte&#39;s lsb is 1).
Definition: MACAddress.h:146
MACAddress address
Definition: FrameSequenceContext.h:66
bool inet::ieee80211::FrameSequenceContext::isSentByUs ( Ieee80211Frame frame) const
virtual

Referenced by isForUs().

55 {
56  // FIXME:
57  // Check the roles of the Addr3 field when aggregation is applied
58  // Table 8-19—Address field contents
59  if (auto dataOrMgmtFrame = dynamic_cast<Ieee80211DataOrMgmtFrame *>(frame))
60  return dataOrMgmtFrame->getAddress3() == address;
61  else
62  return false;
63 }
MACAddress address
Definition: FrameSequenceContext.h:66

Member Data Documentation

MACAddress inet::ieee80211::FrameSequenceContext::address = MACAddress::UNSPECIFIED_ADDRESS
protected

Referenced by isForUs(), and isSentByUs().

InProgressFrames* inet::ieee80211::FrameSequenceContext::inProgressFrames = nullptr
protected

Referenced by ~FrameSequenceContext().

Ieee80211ModeSet* inet::ieee80211::FrameSequenceContext::modeSet = nullptr
protected

Referenced by getIfs().

NonQoSContext* inet::ieee80211::FrameSequenceContext::nonQoSContext = nullptr
protected
QoSContext* inet::ieee80211::FrameSequenceContext::qosContext = nullptr
protected
IRtsPolicy* inet::ieee80211::FrameSequenceContext::rtsPolicy = nullptr
protected

Referenced by getCtsTimeout().

IRtsProcedure* inet::ieee80211::FrameSequenceContext::rtsProcedure = nullptr
protected
std::vector<IFrameSequenceStep *> inet::ieee80211::FrameSequenceContext::steps
protected

Referenced by ~FrameSequenceContext().


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