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

#include <NonQoSSequenceNumberAssignment.h>

Inheritance diagram for inet::ieee80211::NonQoSSequenceNumberAssignment:
inet::ieee80211::LegacySequenceNumberAssigment inet::ieee80211::ISequenceNumberAssignment

Public Member Functions

virtual void assignSequenceNumber (Ieee80211DataOrMgmtFrame *frame) override
 
- Public Member Functions inherited from inet::ieee80211::ISequenceNumberAssignment
virtual ~ISequenceNumberAssignment ()
 

Protected Attributes

std::map< MACAddress, SequenceNumberlastSentSeqNums
 
- Protected Attributes inherited from inet::ieee80211::LegacySequenceNumberAssigment
SequenceNumber lastSeqNum = 0
 

Member Function Documentation

void inet::ieee80211::NonQoSSequenceNumberAssignment::assignSequenceNumber ( Ieee80211DataOrMgmtFrame frame)
overridevirtual

Reimplemented from inet::ieee80211::LegacySequenceNumberAssigment.

24 {
25  ASSERT(frame->getType() != ST_DATA_WITH_QOS);
26  lastSeqNum = (lastSeqNum + 1) % 4096;
27  const MACAddress& address = frame->getReceiverAddress();
28  auto it = lastSentSeqNums.find(address);
29  if (it == lastSentSeqNums.end())
30  lastSentSeqNums[address] = lastSeqNum;
31  else {
32  if (it->second == lastSeqNum)
33  lastSeqNum = (lastSeqNum + 1) % 4096; // make it different from the last sequence number sent to that RA (spec: "add 2")
34  it->second = lastSeqNum;
35  }
36  frame->setSequenceNumber(lastSeqNum);
37 }
Definition: Ieee80211Frame_m.h:117
std::map< MACAddress, SequenceNumber > lastSentSeqNums
Definition: NonQoSSequenceNumberAssignment.h:29
SequenceNumber lastSeqNum
Definition: LegacySequenceNumberAssigment.h:30

Member Data Documentation

std::map<MACAddress, SequenceNumber> inet::ieee80211::NonQoSSequenceNumberAssignment::lastSentSeqNums
protected

Referenced by assignSequenceNumber().


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