From 722073c025bb6e2e0389a71ea6c45f388634309c Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Mon, 15 Apr 2019 15:29:58 +0200 Subject: [PATCH] wifi: BlockAckManager uses the WifiMacQueue::Expired trace --- src/wifi/model/block-ack-manager.cc | 40 +---------------------------- src/wifi/model/block-ack-manager.h | 4 --- 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/src/wifi/model/block-ack-manager.cc b/src/wifi/model/block-ack-manager.cc index 6be5d1027..90b014664 100644 --- a/src/wifi/model/block-ack-manager.cc +++ b/src/wifi/model/block-ack-manager.cc @@ -67,6 +67,7 @@ BlockAckManager::BlockAckManager () { NS_LOG_FUNCTION (this); m_retryPackets = CreateObject (); + m_retryPackets->TraceConnectWithoutContext ("Expired", MakeCallback (&BlockAckManager::NotifyDiscardedMpdu, this)); } BlockAckManager::~BlockAckManager () @@ -276,7 +277,6 @@ BlockAckManager::StorePacket (Ptr mpdu) bool BlockAckManager::HasBar (Bar &bar, bool remove) { - CleanupBuffers (); if (m_bars.size () > 0) { bar = m_bars.front (); @@ -712,7 +712,6 @@ bool BlockAckManager::NeedBarRetransmission (uint8_t tid, uint16_t seqNumber, Ma //The standard says the BAR gets discarded when all MSDUs lifetime expires AgreementsI it = m_agreements.find (std::make_pair (recipient, tid)); NS_ASSERT (it != m_agreements.end ()); - CleanupBuffers (); if (QosUtilsIsOldPacket (it->second.first.GetStartingSequence (), seqNumber)) { return false; @@ -815,43 +814,6 @@ BlockAckManager::SetStartingSequence (Mac48Address recipient, uint8_t tid, uint1 agreementIt->second.first.SetStartingSequence (startingSeq); } -void -BlockAckManager::CleanupBuffers (void) -{ - NS_LOG_FUNCTION (this); - for (AgreementsI j = m_agreements.begin (); j != m_agreements.end (); j++) - { - bool removed = false; - if (j->second.second.empty ()) - { - continue; - } - Time now = Simulator::Now (); - for (PacketQueueI i = j->second.second.begin (); i != j->second.second.end (); ) - { - if ((*i)->GetTimeStamp () + m_maxDelay > now) - { - break; - } - else - { - RemoveFromRetryQueue (j->second.first.GetPeer (), - j->second.first.GetTid (), - (*i)->GetHeader ().GetSequenceNumber ()); - j->second.first.SetStartingSequence (((*i)->GetHeader ().GetSequenceNumber () + 1) % 4096); - i = j->second.second.erase (i); - removed = true; - continue; - } - i++; - } - if (removed) - { - ScheduleBlockAckReq (j->second.first.GetPeer (), j->second.first.GetTid ()); - } - } -} - void BlockAckManager::SetMaxPacketDelay (Time maxDelay) { diff --git a/src/wifi/model/block-ack-manager.h b/src/wifi/model/block-ack-manager.h index 409a6e977..8dee23882 100644 --- a/src/wifi/model/block-ack-manager.h +++ b/src/wifi/model/block-ack-manager.h @@ -429,10 +429,6 @@ public: private: - /** - * This method removes packets whose lifetime was exceeded. - */ - void CleanupBuffers (void); /** * Inactivity timeout function * \param recipient the recipient MAC address