wifi: BlockAckManager uses the WifiMacQueue::Expired trace

This commit is contained in:
Stefano Avallone
2019-04-15 15:29:58 +02:00
parent fb82040208
commit 722073c025
2 changed files with 1 additions and 43 deletions

View File

@@ -67,6 +67,7 @@ BlockAckManager::BlockAckManager ()
{
NS_LOG_FUNCTION (this);
m_retryPackets = CreateObject<WifiMacQueue> ();
m_retryPackets->TraceConnectWithoutContext ("Expired", MakeCallback (&BlockAckManager::NotifyDiscardedMpdu, this));
}
BlockAckManager::~BlockAckManager ()
@@ -276,7 +277,6 @@ BlockAckManager::StorePacket (Ptr<WifiMacQueueItem> 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)
{

View File

@@ -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