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

#include <QosDuplicateRemoval.h>

Inheritance diagram for inet::ieee80211::QoSDuplicateRemoval:
inet::ieee80211::IDuplicateRemoval

Public Member Functions

virtual bool isDuplicate (Ieee80211DataOrMgmtFrame *frame) override
 
- Public Member Functions inherited from inet::ieee80211::IDuplicateRemoval
virtual ~IDuplicateRemoval ()
 

Protected Types

typedef std::pair< MACAddress, TidKey
 
typedef std::map< Key, SequenceControlFieldKey2SeqValMap
 
typedef std::map< MACAddress, SequenceControlFieldMac2SeqValMap
 

Protected Attributes

Key2SeqValMap lastSeenSeqNumCache
 
Mac2SeqValMap lastSeenSharedSeqNumCache
 
Mac2SeqValMap lastSeenTimePriorityManagementSeqNumCache
 

Member Typedef Documentation

Member Function Documentation

bool inet::ieee80211::QoSDuplicateRemoval::isDuplicate ( Ieee80211DataOrMgmtFrame frame)
overridevirtual

Implements inet::ieee80211::IDuplicateRemoval.

25 {
26  SequenceControlField seqVal(frame);
27  bool isManagementFrame = dynamic_cast<Ieee80211ManagementFrame *>(frame);
28  bool isTimePriorityManagementFrame = isManagementFrame && false; // TODO: hack
29  if (isTimePriorityManagementFrame || isManagementFrame)
30  {
31  MACAddress transmitterAddr = frame->getTransmitterAddress();
33  auto it = cache.find(transmitterAddr);
34  if (it == cache.end()) {
35  cache.insert(std::pair<MACAddress, SequenceControlField>(transmitterAddr, seqVal));
36  return false;
37  }
38  else if (it->second.getSequenceNumber() == seqVal.getSequenceNumber() && it->second.getFragmentNumber() == seqVal.getFragmentNumber() && frame->getRetry())
39  return true;
40  else {
41  it->second = seqVal;
42  return false;
43  }
44  }
45  else
46  {
47  Ieee80211DataFrame *qosDataFrame = check_and_cast<Ieee80211DataFrame *>(frame);
48  Key key(frame->getTransmitterAddress(), qosDataFrame->getTid());
49  auto it = lastSeenSeqNumCache.find(key);
50  if (it == lastSeenSeqNumCache.end()) {
51  lastSeenSeqNumCache.insert(std::pair<Key, SequenceControlField>(key, seqVal));
52  return false;
53  }
54  else if (it->second.getSequenceNumber() == seqVal.getSequenceNumber() && it->second.getFragmentNumber() == seqVal.getFragmentNumber() && frame->getRetry())
55  return true;
56  else {
57  it->second = seqVal;
58  return false;
59  }
60  }
61 }
std::pair< MACAddress, Tid > Key
Definition: QosDuplicateRemoval.h:32
Mac2SeqValMap lastSeenTimePriorityManagementSeqNumCache
Definition: QosDuplicateRemoval.h:37
Mac2SeqValMap lastSeenSharedSeqNumCache
Definition: QosDuplicateRemoval.h:36
std::map< MACAddress, SequenceControlField > Mac2SeqValMap
Definition: QosDuplicateRemoval.h:34
Key2SeqValMap lastSeenSeqNumCache
Definition: QosDuplicateRemoval.h:35

Member Data Documentation

Key2SeqValMap inet::ieee80211::QoSDuplicateRemoval::lastSeenSeqNumCache
protected

Referenced by isDuplicate().

Mac2SeqValMap inet::ieee80211::QoSDuplicateRemoval::lastSeenSharedSeqNumCache
protected

Referenced by isDuplicate().

Mac2SeqValMap inet::ieee80211::QoSDuplicateRemoval::lastSeenTimePriorityManagementSeqNumCache
protected

Referenced by isDuplicate().


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