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

#include <EdcaTransmitLifetimeHandler.h>

Inheritance diagram for inet::ieee80211::EdcaTransmitLifetimeHandler:
inet::ieee80211::ITransmitLifetimeHandler

Public Member Functions

 EdcaTransmitLifetimeHandler (simtime_t bkLifetime, simtime_t beLifetime, simtime_t viLifetime, simtime_t voLifetime)
 
virtual void frameGotInProgess (Ieee80211DataFrame *frame)
 
virtual void frameTransmitted (Ieee80211DataFrame *frame)
 
virtual bool isLifetimeExpired (Ieee80211DataFrame *frame)
 
- Public Member Functions inherited from inet::ieee80211::ITransmitLifetimeHandler
virtual ~ITransmitLifetimeHandler ()
 

Public Attributes

simtime_t msduLifetime [4]
 
std::map< SequenceNumber, simtime_t > lifetimes
 

Protected Member Functions

AccessCategory mapTidToAc (int tid)
 

Constructor & Destructor Documentation

inet::ieee80211::EdcaTransmitLifetimeHandler::EdcaTransmitLifetimeHandler ( simtime_t  bkLifetime,
simtime_t  beLifetime,
simtime_t  viLifetime,
simtime_t  voLifetime 
)
24 {
25  msduLifetime[0] = bkLifetime;
26  msduLifetime[1] = beLifetime;
27  msduLifetime[2] = viLifetime;
28  msduLifetime[3] = voLifetime;
29 }
simtime_t msduLifetime[4]
Definition: EdcaTransmitLifetimeHandler.h:32

Member Function Documentation

void inet::ieee80211::EdcaTransmitLifetimeHandler::frameGotInProgess ( Ieee80211DataFrame frame)
virtual

Implements inet::ieee80211::ITransmitLifetimeHandler.

32 {
33  if (frame->getFragmentNumber() == 0)
34  lifetimes[frame->getSequenceNumber()] = simTime();
35 }
std::map< SequenceNumber, simtime_t > lifetimes
Definition: EdcaTransmitLifetimeHandler.h:33
void inet::ieee80211::EdcaTransmitLifetimeHandler::frameTransmitted ( Ieee80211DataFrame frame)
virtual

Implements inet::ieee80211::ITransmitLifetimeHandler.

38 {
39  // don't care
40 }
bool inet::ieee80211::EdcaTransmitLifetimeHandler::isLifetimeExpired ( Ieee80211DataFrame frame)
virtual

Implements inet::ieee80211::ITransmitLifetimeHandler.

43 {
44  ASSERT(frame->getType() == ST_DATA_WITH_QOS);
45  AccessCategory ac = mapTidToAc(frame->getTid());
46  auto it = lifetimes.find(frame->getSequenceNumber());
47  if (it == lifetimes.end())
48  throw cRuntimeError("There is no lifetime entry for frame = %s", frame->getName());
49  return (simTime() - it->second) >= msduLifetime[ac];
50 }
Definition: Ieee80211Frame_m.h:117
AccessCategory mapTidToAc(int tid)
Definition: EdcaTransmitLifetimeHandler.cc:53
std::map< SequenceNumber, simtime_t > lifetimes
Definition: EdcaTransmitLifetimeHandler.h:33
AccessCategory
IEEE 802.11e QoS (EDCA) access categories.
Definition: AccessCategory.h:29
simtime_t msduLifetime[4]
Definition: EdcaTransmitLifetimeHandler.h:32
AccessCategory inet::ieee80211::EdcaTransmitLifetimeHandler::mapTidToAc ( int  tid)
protected

Referenced by isLifetimeExpired().

54 {
55  // standard static mapping (see "UP-to-AC mappings" table in the 802.11 spec.)
56  switch (tid) {
57  case 1: case 2: return AC_BK;
58  case 0: case 3: return AC_BE;
59  case 4: case 5: return AC_VI;
60  case 6: case 7: return AC_VO;
61  default: throw cRuntimeError("No mapping from TID=%d to AccessCategory (must be in the range 0..7)", tid);
62  }
63 }
Definition: AccessCategory.h:31
Definition: AccessCategory.h:33
Definition: AccessCategory.h:34
Definition: AccessCategory.h:32

Member Data Documentation

std::map<SequenceNumber, simtime_t> inet::ieee80211::EdcaTransmitLifetimeHandler::lifetimes
simtime_t inet::ieee80211::EdcaTransmitLifetimeHandler::msduLifetime[4]

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