wifi: Add a method to get the aliases of an inflight MPDU
This commit is contained in:
committed by
Stefano Avallone
parent
014a706f59
commit
8d5feb06b0
@@ -99,6 +99,21 @@ WifiMacQueue::GetOriginal(Ptr<WifiMpdu> mpdu)
|
||||
return GetIt(mpdu)->mpdu;
|
||||
}
|
||||
|
||||
Ptr<WifiMpdu>
|
||||
WifiMacQueue::GetAlias(Ptr<const WifiMpdu> mpdu, uint8_t linkId)
|
||||
{
|
||||
if (!mpdu->IsQueued())
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
if (auto aliasIt = GetIt(mpdu)->inflights.find(linkId);
|
||||
aliasIt != GetIt(mpdu)->inflights.cend())
|
||||
{
|
||||
return aliasIt->second;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void
|
||||
WifiMacQueue::ExtractExpiredMpdus(const WifiContainerQueueId& queueId) const
|
||||
{
|
||||
|
||||
@@ -285,6 +285,14 @@ class WifiMacQueue : public Queue<WifiMpdu, ns3::WifiMacQueueContainer>
|
||||
*/
|
||||
Ptr<WifiMpdu> GetOriginal(Ptr<WifiMpdu> mpdu);
|
||||
|
||||
/**
|
||||
* \param mpdu the given MPDU
|
||||
* \param linkId the ID of the given link
|
||||
* \return the alias of the given MPDU that is inflight on the given link, if any, or
|
||||
* a null pointer, otherwise
|
||||
*/
|
||||
Ptr<WifiMpdu> GetAlias(Ptr<const WifiMpdu> mpdu, uint8_t linkId);
|
||||
|
||||
protected:
|
||||
using Queue<WifiMpdu, WifiMacQueueContainer>::GetContainer;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user