67 int startingSequenceNumber = -1;
69 if (
auto basicReq = dynamic_cast<Ieee80211BasicBlockAckReq*>(frame)) {
70 tid = basicReq->getTidInfo();
71 startingSequenceNumber = basicReq->getStartingSequenceNumber();
73 else if (
auto compressedReq = dynamic_cast<Ieee80211CompressedBlockAck*>(frame)) {
74 tid = compressedReq->getTidInfo();
75 startingSequenceNumber = compressedReq->getStartingSequenceNumber();
78 throw cRuntimeError(
"Multi-Tid BlockAckReq is currently an unimplemented feature");
80 auto id = std::make_pair(tid, frame->getTransmitterAddress());
83 ReceiveBuffer *receiveBuffer = it->second;
97 int numOfMsdusToPassUp = completePrecedingMpdus.size() + consecutiveCompleteFollowingMpdus.size();
98 if (numOfMsdusToPassUp == 0 && isSequenceNumberLess(receiveBuffer->getNextExpectedSequenceNumber(), startingSequenceNumber, receiveBuffer->getNextExpectedSequenceNumber(), receiveBuffer->getBufferSize()))
99 receiveBuffer->setNextExpectedSequenceNumber(startingSequenceNumber);
105 completePrecedingMpdus.insert(consecutiveCompleteFollowingMpdus.begin(), consecutiveCompleteFollowingMpdus.end());
106 return completePrecedingMpdus;
int8_t Tid
Definition: Ieee80211Defs.h:28
ReorderBuffer collectConsecutiveCompleteFollowingMpdus(ReceiveBuffer *receiveBuffer, int startingSequenceNumber)
Definition: BlockAckReordering.cc:136
void releaseReceiveBuffer(ReceiveBuffer *receiveBuffer, const ReorderBuffer &reorderBuffer)
Definition: BlockAckReordering.cc:173
std::map< SequenceNumber, Fragments > ReorderBuffer
Definition: BlockAckReordering.h:36
std::map< std::pair< Tid, MACAddress >, ReceiveBuffer * > receiveBuffers
Definition: BlockAckReordering.h:39
ReorderBuffer collectCompletePrecedingMpdus(ReceiveBuffer *receiveBuffer, int startingSequenceNumber)
Definition: BlockAckReordering.cc:116