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

#include <InProgressFrames.h>

Public Member Functions

 InProgressFrames (PendingQueue *pendingQueue, IOriginatorMacDataService *dataService, IAckHandler *ackHandler)
 
virtual ~InProgressFrames ()
 
virtual Ieee80211DataOrMgmtFramegetFrameToTransmit ()
 
virtual Ieee80211DataOrMgmtFramegetPendingFrameFor (Ieee80211Frame *frame)
 
virtual void dropFrame (Ieee80211DataOrMgmtFrame *dataOrMgmtFrame)
 
virtual void dropFrames (std::set< std::pair< MACAddress, std::pair< Tid, SequenceControlField >>> seqAndFragNums)
 
virtual bool hasInProgressFrames ()
 
virtual std::vector< Ieee80211DataFrame * > getOutstandingFrames ()
 
virtual void clearDroppedFrames ()
 

Protected Member Functions

void ensureHasFrameToTransmit ()
 
bool hasEligibleFrameToTransmit ()
 

Protected Attributes

PendingQueuependingQueue = nullptr
 
IOriginatorMacDataServicedataService = nullptr
 
IAckHandlerackHandler = nullptr
 
std::list< Ieee80211DataOrMgmtFrame * > inProgressFrames
 
std::vector< Ieee80211DataOrMgmtFrame * > droppedFrames
 

Constructor & Destructor Documentation

inet::ieee80211::InProgressFrames::InProgressFrames ( PendingQueue pendingQueue,
IOriginatorMacDataService dataService,
IAckHandler ackHandler 
)
inline
44  :
48  { }
PendingQueue * pendingQueue
Definition: InProgressFrames.h:33
IOriginatorMacDataService * dataService
Definition: InProgressFrames.h:34
IAckHandler * ackHandler
Definition: InProgressFrames.h:35
inet::ieee80211::InProgressFrames::~InProgressFrames ( )
virtual
131 {
132  for (auto frame : inProgressFrames)
133  delete frame;
134  for (auto frame : droppedFrames)
135  delete frame;
136 }
std::list< Ieee80211DataOrMgmtFrame * > inProgressFrames
Definition: InProgressFrames.h:36
std::vector< Ieee80211DataOrMgmtFrame * > droppedFrames
Definition: InProgressFrames.h:37

Member Function Documentation

void inet::ieee80211::InProgressFrames::clearDroppedFrames ( )
virtual

Referenced by inet::ieee80211::FrameSequenceContext::~FrameSequenceContext().

124 {
125  for (auto frame : droppedFrames)
126  delete frame;
127  droppedFrames.clear();
128 }
std::vector< Ieee80211DataOrMgmtFrame * > droppedFrames
Definition: InProgressFrames.h:37
void inet::ieee80211::InProgressFrames::dropFrame ( Ieee80211DataOrMgmtFrame dataOrMgmtFrame)
virtual

Referenced by inet::ieee80211::Dcf::originatorProcessFailedFrame(), inet::ieee80211::Dcf::originatorProcessReceivedFrame(), inet::ieee80211::Dcf::originatorProcessRtsProtectionFailed(), and inet::ieee80211::Dcf::originatorProcessTransmittedFrame().

90 {
91  inProgressFrames.remove(frame);
92  droppedFrames.push_back(frame);
93 }
std::list< Ieee80211DataOrMgmtFrame * > inProgressFrames
Definition: InProgressFrames.h:36
std::vector< Ieee80211DataOrMgmtFrame * > droppedFrames
Definition: InProgressFrames.h:37
void inet::ieee80211::InProgressFrames::dropFrames ( std::set< std::pair< MACAddress, std::pair< Tid, SequenceControlField >>>  seqAndFragNums)
virtual
96 {
97  for (auto it = inProgressFrames.begin(); it != inProgressFrames.end();) {
98  auto frame = *it;
99  if (frame->getType() == ST_DATA_WITH_QOS) {
100  auto dataFrame = check_and_cast<const Ieee80211DataFrame*>(frame);
101  if (seqAndFragNums.count(std::make_pair(dataFrame->getReceiverAddress(), std::make_pair(dataFrame->getTid(), SequenceControlField(dataFrame->getSequenceNumber(), dataFrame->getFragmentNumber())))) != 0) {
102  it = inProgressFrames.erase(it);
103  droppedFrames.push_back(frame);
104  }
105  else
106  it++;
107  }
108  else
109  it++;
110  }
111 }
std::list< Ieee80211DataOrMgmtFrame * > inProgressFrames
Definition: InProgressFrames.h:36
Definition: Ieee80211Frame_m.h:117
std::vector< Ieee80211DataOrMgmtFrame * > droppedFrames
Definition: InProgressFrames.h:37
void inet::ieee80211::InProgressFrames::ensureHasFrameToTransmit ( )
protected

Referenced by getFrameToTransmit().

34 {
35 // TODO: delete old frames from inProgressFrames
36 // if (auto dataFrame = dynamic_cast<Ieee80211DataFrame*>(frame)) {
37 // if (transmitLifetimeHandler->isLifetimeExpired(dataFrame))
38 // return frame;
39 // }
42  if (frames) {
43  for (auto frame : *frames) {
45  inProgressFrames.push_back(frame);
46  }
47  delete frames;
48  }
49  }
50 }
std::list< Ieee80211DataOrMgmtFrame * > inProgressFrames
Definition: InProgressFrames.h:36
virtual void frameGotInProgress(Ieee80211DataOrMgmtFrame *dataOrMgmtFrame)=0
PendingQueue * pendingQueue
Definition: InProgressFrames.h:33
virtual Fragments * extractFramesToTransmit(PendingQueue *pendingQueue)=0
IOriginatorMacDataService * dataService
Definition: InProgressFrames.h:34
bool hasEligibleFrameToTransmit()
Definition: InProgressFrames.cc:24
IAckHandler * ackHandler
Definition: InProgressFrames.h:35
Ieee80211DataOrMgmtFrame * inet::ieee80211::InProgressFrames::getFrameToTransmit ( )
virtual

Referenced by getPendingFrameFor(), inet::ieee80211::DcfFs::hasMoreFragments(), inet::ieee80211::HcfFs::hasMoreTxOps(), inet::ieee80211::HcfFs::hasMoreTxOpsAndMulticast(), inet::ieee80211::DcfFs::isBroadcastManagementOrGroupDataSequenceNeeded(), inet::ieee80211::DcfFs::isFragFrameSequenceNeeded(), inet::ieee80211::TxOpFs::isRtsCtsNeeded(), inet::ieee80211::DcfFs::isRtsCtsNeeded(), inet::ieee80211::Dcf::originatorProcessTransmittedFrame(), inet::ieee80211::DataFs::prepareStep(), inet::ieee80211::ManagementAckFs::prepareStep(), inet::ieee80211::ManagementFs::prepareStep(), inet::ieee80211::RtsCtsFs::prepareStep(), inet::ieee80211::RtsFs::prepareStep(), inet::ieee80211::FragFrameAckFs::prepareStep(), inet::ieee80211::LastFrameAckFs::prepareStep(), inet::ieee80211::HcfFs::selectDataOrManagementSequence(), inet::ieee80211::HcfFs::selectHcfSequence(), inet::ieee80211::DcfFs::selectMulticastDataOrMgmt(), and inet::ieee80211::TxOpFs::selectTxOpSequence().

53 {
55  for (auto frame : inProgressFrames) {
56  if (ackHandler->isEligibleToTransmit(frame))
57  return frame;
58  }
59  return nullptr;
60 }
std::list< Ieee80211DataOrMgmtFrame * > inProgressFrames
Definition: InProgressFrames.h:36
virtual bool isEligibleToTransmit(Ieee80211DataOrMgmtFrame *frame)=0
IAckHandler * ackHandler
Definition: InProgressFrames.h:35
void ensureHasFrameToTransmit()
Definition: InProgressFrames.cc:33
std::vector< Ieee80211DataFrame * > inet::ieee80211::InProgressFrames::getOutstandingFrames ( )
virtual

Referenced by inet::ieee80211::OriginatorQoSAckPolicy::getOutstandingFramesPerReceiver().

114 {
115  std::vector<Ieee80211DataFrame*> outstandingFrames;
116  for (auto frame : inProgressFrames) {
117  if (ackHandler->isOutstandingFrame(frame))
118  outstandingFrames.push_back(check_and_cast<Ieee80211DataFrame*>(frame));
119  }
120  return outstandingFrames;
121 }
std::list< Ieee80211DataOrMgmtFrame * > inProgressFrames
Definition: InProgressFrames.h:36
IAckHandler * ackHandler
Definition: InProgressFrames.h:35
virtual bool isOutstandingFrame(Ieee80211DataOrMgmtFrame *frame)=0
Ieee80211DataOrMgmtFrame * inet::ieee80211::InProgressFrames::getPendingFrameFor ( Ieee80211Frame frame)
virtual

Referenced by inet::ieee80211::Dcf::transmitFrame().

63 {
64  auto frameToTransmit = getFrameToTransmit();
65  if (dynamic_cast<Ieee80211RTSFrame *>(frame))
66  return frameToTransmit;
67  else {
68  for (auto frame : inProgressFrames) {
69  if (ackHandler->isEligibleToTransmit(frame) && frameToTransmit != frame)
70  return frame;
71  }
73  if (frames) {
74  auto firstFrame = (*frames)[0];
75  for (auto frame : *frames) {
77  inProgressFrames.push_back(frame);
78  }
79  delete frames;
80  // FIXME: If the next Txop sequence were a BlockAckReqBlockAckFs then this would return
81  // a wrong pending frame.
82  return firstFrame;
83  }
84  else
85  return nullptr;
86  }
87 }
std::list< Ieee80211DataOrMgmtFrame * > inProgressFrames
Definition: InProgressFrames.h:36
virtual void frameGotInProgress(Ieee80211DataOrMgmtFrame *dataOrMgmtFrame)=0
PendingQueue * pendingQueue
Definition: InProgressFrames.h:33
virtual bool isEligibleToTransmit(Ieee80211DataOrMgmtFrame *frame)=0
virtual Ieee80211DataOrMgmtFrame * getFrameToTransmit()
Definition: InProgressFrames.cc:52
virtual Fragments * extractFramesToTransmit(PendingQueue *pendingQueue)=0
IOriginatorMacDataService * dataService
Definition: InProgressFrames.h:34
IAckHandler * ackHandler
Definition: InProgressFrames.h:35
bool inet::ieee80211::InProgressFrames::hasEligibleFrameToTransmit ( )
protected

Referenced by ensureHasFrameToTransmit().

25 {
26  for (auto frame : inProgressFrames) {
27  if (ackHandler->isEligibleToTransmit(frame))
28  return true;
29  }
30  return false;
31 }
std::list< Ieee80211DataOrMgmtFrame * > inProgressFrames
Definition: InProgressFrames.h:36
virtual bool isEligibleToTransmit(Ieee80211DataOrMgmtFrame *frame)=0
IAckHandler * ackHandler
Definition: InProgressFrames.h:35

Member Data Documentation

IAckHandler* inet::ieee80211::InProgressFrames::ackHandler = nullptr
protected
IOriginatorMacDataService* inet::ieee80211::InProgressFrames::dataService = nullptr
protected
std::vector<Ieee80211DataOrMgmtFrame *> inet::ieee80211::InProgressFrames::droppedFrames
protected
PendingQueue* inet::ieee80211::InProgressFrames::pendingQueue = nullptr
protected

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