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

Implements IEEE 802.11 Enhanced Distributed Channel Access. More...

#include <Edca.h>

Inheritance diagram for inet::ieee80211::Edca:

Public Member Functions

virtual ~Edca ()
 
virtual AccessCategory classifyFrame (Ieee80211DataFrame *frame)
 
virtual EdcafgetChannelOwner ()
 
virtual std::vector< Edcaf * > getInternallyCollidedEdcafs ()
 
virtual void requestChannelAccess (AccessCategory ac, IChannelAccess::ICallback *callback)
 
virtual void releaseChannelAccess (AccessCategory ac, IChannelAccess::ICallback *callback)
 

Protected Member Functions

virtual int numInitStages () const override
 
virtual void initialize (int stage) override
 
virtual AccessCategory mapTidToAc (Tid tid)
 

Protected Attributes

int numEdcafs = -1
 
Edcaf ** edcafs = nullptr
 

Detailed Description

Implements IEEE 802.11 Enhanced Distributed Channel Access.

Constructor & Destructor Documentation

inet::ieee80211::Edca::~Edca ( )
virtual
81 {
82  for (int i = 0; i < numEdcafs; i++)
83  delete edcafs[i];
84  delete[] edcafs;
85 }
int numEdcafs
Definition: Edca.h:33
Edcaf ** edcafs
Definition: Edca.h:34

Member Function Documentation

AccessCategory inet::ieee80211::Edca::classifyFrame ( Ieee80211DataFrame frame)
virtual

Referenced by inet::ieee80211::Hcf::processUpperFrame().

37 {
38  return mapTidToAc(frame->getTid());
39 }
virtual AccessCategory mapTidToAc(Tid tid)
Definition: Edca.cc:41
virtual uint8_t getTid() const
std::vector< Edcaf * > inet::ieee80211::Edca::getInternallyCollidedEdcafs ( )
virtual

Referenced by inet::ieee80211::Hcf::channelGranted().

62 {
63  std::vector<Edcaf*> collidedEdcafs;
64  for (int ac = 0; ac < numEdcafs; ac++)
65  if (edcafs[ac]->isInternalCollision())
66  collidedEdcafs.push_back(edcafs[ac]);
67  return collidedEdcafs;
68 }
int numEdcafs
Definition: Edca.h:33
Edcaf ** edcafs
Definition: Edca.h:34
void inet::ieee80211::Edca::initialize ( int  stage)
overrideprotectedvirtual
26 {
27  if (stage == INITSTAGE_LINK_LAYER_2) {
28  numEdcafs = par("numEdcafs");
29  edcafs = new Edcaf*[numEdcafs];
30  for (int ac = 0; ac < numEdcafs; ac++) {
31  edcafs[ac] = check_and_cast<Edcaf*>(getSubmodule("edcaf", ac));
32  }
33  }
34 }
Implements IEEE 802.11 Enhanced Distributed Channel Access Function.
Definition: Edcaf.h:37
int numEdcafs
Definition: Edca.h:33
Edcaf ** edcafs
Definition: Edca.h:34
Additional link-layer initializations that depend on the previous stage.
Definition: InitStages.h:64
AccessCategory inet::ieee80211::Edca::mapTidToAc ( Tid  tid)
protectedvirtual

Referenced by classifyFrame().

42 {
43  // standard static mapping (see "UP-to-AC mappings" table in the 802.11 spec.)
44  switch (tid) {
45  case 1: case 2: return AC_BK;
46  case 0: case 3: return AC_BE;
47  case 4: case 5: return AC_VI;
48  case 6: case 7: return AC_VO;
49  default: throw cRuntimeError("No mapping from TID=%d to AccessCategory (must be in the range 0..7)", tid);
50  }
51 }
Definition: AccessCategory.h:31
Definition: AccessCategory.h:33
Definition: AccessCategory.h:34
Definition: AccessCategory.h:32
virtual int inet::ieee80211::Edca::numInitStages ( ) const
inlineoverrideprotectedvirtual
37 { return NUM_INIT_STAGES; }
The number of initialization stages.
Definition: InitStages.h:116
void inet::ieee80211::Edca::releaseChannelAccess ( AccessCategory  ac,
IChannelAccess::ICallback callback 
)
virtual
76 {
77  edcafs[ac]->releaseChannel(callback);
78 }
Edcaf ** edcafs
Definition: Edca.h:34
virtual void releaseChannel(IChannelAccess::ICallback *callback) override
Definition: Edcaf.cc:117
void inet::ieee80211::Edca::requestChannelAccess ( AccessCategory  ac,
IChannelAccess::ICallback callback 
)
virtual

Referenced by inet::ieee80211::Hcf::processUpperFrame().

71 {
72  edcafs[ac]->requestChannel(callback);
73 }
Edcaf ** edcafs
Definition: Edca.h:34
virtual void requestChannel(IChannelAccess::ICallback *callback) override
Definition: Edcaf.cc:126

Member Data Documentation

Edcaf** inet::ieee80211::Edca::edcafs = nullptr
protected
int inet::ieee80211::Edca::numEdcafs = -1
protected

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