diff --git a/src/wifi/model/wifi-mac-queue.cc b/src/wifi/model/wifi-mac-queue.cc index 369c434b2..43fbbba24 100644 --- a/src/wifi/model/wifi-mac-queue.cc +++ b/src/wifi/model/wifi-mac-queue.cc @@ -99,6 +99,21 @@ WifiMacQueue::GetOriginal(Ptr mpdu) return GetIt(mpdu)->mpdu; } +Ptr +WifiMacQueue::GetAlias(Ptr 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 { diff --git a/src/wifi/model/wifi-mac-queue.h b/src/wifi/model/wifi-mac-queue.h index 844ccbb35..7f564c69c 100644 --- a/src/wifi/model/wifi-mac-queue.h +++ b/src/wifi/model/wifi-mac-queue.h @@ -285,6 +285,14 @@ class WifiMacQueue : public Queue */ Ptr GetOriginal(Ptr 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 GetAlias(Ptr mpdu, uint8_t linkId); + protected: using Queue::GetContainer;