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

#include <TxOpFs.h>

Inheritance diagram for inet::ieee80211::TxOpFs:
inet::ieee80211::AlternativesFs inet::ieee80211::IFrameSequence

Public Member Functions

 TxOpFs ()
 
virtual ~TxOpFs ()
 
virtual int selectTxOpSequence (AlternativesFs *frameSequence, FrameSequenceContext *context)
 
virtual bool isRtsCtsNeeded (OptionalFs *frameSequence, FrameSequenceContext *context)
 
virtual bool isBlockAckReqRtsCtsNeeded (OptionalFs *frameSequence, FrameSequenceContext *context)
 
virtual int selectMgmtOrDataQap (AlternativesFs *frameSequence, FrameSequenceContext *context)
 
- Public Member Functions inherited from inet::ieee80211::AlternativesFs
virtual ~AlternativesFs ()
 
 AlternativesFs (std::vector< IFrameSequence * > elements, std::function< int(AlternativesFs *, FrameSequenceContext *)> selector)
 
virtual int getStep ()
 
virtual int selectSequence (FrameSequenceContext *context)
 
virtual void startSequence (FrameSequenceContext *context, int firstStep) override
 
virtual IFrameSequenceStepprepareStep (FrameSequenceContext *context) override
 
virtual bool completeStep (FrameSequenceContext *context) override
 
virtual std::string getHistory () override
 
- Public Member Functions inherited from inet::ieee80211::IFrameSequence
virtual ~IFrameSequence ()
 

Additional Inherited Members

- Protected Attributes inherited from inet::ieee80211::AlternativesFs
int firstStep = -1
 
int step = -1
 
int elementIndex = -1
 
std::vector< IFrameSequence * > elements
 
std::function< int(AlternativesFs *, FrameSequenceContext *)> selector
 

Constructor & Destructor Documentation

inet::ieee80211::TxOpFs::TxOpFs ( )
27  :
28  // Excerpt from G.3 EDCA and HCCA sequences
29  // txop-sequence =
30  // ( ( ( RTS CTS ) | CTS + self ) Data + individual + QoS +( block-ack | no-ack ) ) |
31  // [ RTS CTS ] (txop-part-requiring-ack txop-part-providing-ack )|
32  // [ RTS CTS ] (Management | ( Data + QAP )) + individual ACK |
33  // [ RTS CTS ] (BlockAckReq BlockAck ) |
34  // ht-txop-sequence;
36  new DataFs()}),
38  new DataFs(),
39  new AckFs()}), // TODO: should be in txop-part-requiring-ack
41  new BlockAckReqBlockAckFs()}),
44  /* TODO: DATA + QAP*/},
47 {
48 }
AlternativesFs(std::vector< IFrameSequence * > elements, std::function< int(AlternativesFs *, FrameSequenceContext *)> selector)
Definition: GenericFrameSequences.cc:170
virtual bool isBlockAckReqRtsCtsNeeded(OptionalFs *frameSequence, FrameSequenceContext *context)
Definition: TxOpFs.cc:83
Definition: PrimitiveFrameSequences.h:81
Definition: PrimitiveFrameSequences.h:41
Definition: GenericFrameSequences.h:34
#define ALTERNATIVESFS_SELECTOR(selector)
Definition: GenericFrameSequences.h:32
virtual int selectTxOpSequence(AlternativesFs *frameSequence, FrameSequenceContext *context)
Definition: TxOpFs.cc:55
Definition: PrimitiveFrameSequences.h:55
#define OPTIONALFS_PREDICATE(predicate)
Definition: GenericFrameSequences.h:30
virtual bool isRtsCtsNeeded(OptionalFs *frameSequence, FrameSequenceContext *context)
Definition: TxOpFs.cc:77
Definition: PrimitiveFrameSequences.h:162
virtual int selectMgmtOrDataQap(AlternativesFs *frameSequence, FrameSequenceContext *context)
Definition: TxOpFs.cc:50
Definition: PrimitiveFrameSequences.h:94
Definition: GenericFrameSequences.h:52
virtual inet::ieee80211::TxOpFs::~TxOpFs ( )
inlinevirtual
31 { }

Member Function Documentation

bool inet::ieee80211::TxOpFs::isBlockAckReqRtsCtsNeeded ( OptionalFs frameSequence,
FrameSequenceContext context 
)
virtual

Referenced by TxOpFs().

84 {
85  return false; // FIXME: QoSRtsPolicy should handle this case
86 }
bool inet::ieee80211::TxOpFs::isRtsCtsNeeded ( OptionalFs frameSequence,
FrameSequenceContext context 
)
virtual

Referenced by TxOpFs().

78 {
79  auto protectedFrame = context->getInProgressFrames()->getFrameToTransmit();
80  return context->getRtsPolicy()->isRtsNeeded(protectedFrame);
81 }
virtual Ieee80211DataOrMgmtFrame * getFrameToTransmit()
Definition: InProgressFrames.cc:52
virtual bool isRtsNeeded(Ieee80211Frame *protectedFrame) const =0
virtual InProgressFrames * getInProgressFrames() const
Definition: FrameSequenceContext.h:87
virtual IRtsPolicy * getRtsPolicy() const
Definition: FrameSequenceContext.h:89
int inet::ieee80211::TxOpFs::selectMgmtOrDataQap ( AlternativesFs frameSequence,
FrameSequenceContext context 
)
virtual

Referenced by TxOpFs().

51 {
52  return 0;
53 }
int inet::ieee80211::TxOpFs::selectTxOpSequence ( AlternativesFs frameSequence,
FrameSequenceContext context 
)
virtual

Referenced by TxOpFs().

56 {
57  auto frameToTransmit = context->getInProgressFrames()->getFrameToTransmit();
59  return 2;
60  if (dynamic_cast<Ieee80211ManagementFrame*>(frameToTransmit))
61  return 3;
62  else {
63  auto dataFrameToTransmit = check_and_cast<Ieee80211DataFrame*>(frameToTransmit);
64  OriginatorBlockAckAgreement* agreement = nullptr;
66  agreement = context->getQoSContext()->blockAckAgreementHandler->getAgreement(dataFrameToTransmit->getReceiverAddress(), dataFrameToTransmit->getTid());
67  auto ackPolicy = context->getQoSContext()->ackPolicy->computeAckPolicy(dataFrameToTransmit, agreement);
68  if (ackPolicy == AckPolicy::BLOCK_ACK)
69  return 0;
70  else if (ackPolicy == AckPolicy::NORMAL_ACK)
71  return 1;
72  else
73  throw cRuntimeError("Unknown AckPolicy");
74  }
75 }
virtual QoSContext * getQoSContext() const
Definition: FrameSequenceContext.h:92
Definition: OriginatorBlockAckAgreement.h:28
IOriginatorBlockAckAgreementHandler * blockAckAgreementHandler
Definition: FrameSequenceContext.h:49
virtual Ieee80211DataOrMgmtFrame * getFrameToTransmit()
Definition: InProgressFrames.cc:52
Definition: Ieee80211Frame_m.h:142
Definition: Ieee80211Frame_m.h:139
IOriginatorQoSAckPolicy * ackPolicy
Definition: FrameSequenceContext.h:47
Class generated from inet/linklayer/ieee80211/mac/Ieee80211Frame.msg:177 by nedtool.
Definition: Ieee80211Frame_m.h:509
virtual bool isBlockAckReqNeeded(InProgressFrames *inProgressFrames, TxopProcedure *txopProcedure) const =0
TxopProcedure * txopProcedure
Definition: FrameSequenceContext.h:50
virtual InProgressFrames * getInProgressFrames() const
Definition: FrameSequenceContext.h:87
virtual AckPolicy computeAckPolicy(Ieee80211DataFrame *frame, OriginatorBlockAckAgreement *agreement) const =0
virtual OriginatorBlockAckAgreement * getAgreement(MACAddress receiverAddr, Tid tid)=0

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