diff --git a/src/wifi/model/ap-wifi-mac.cc b/src/wifi/model/ap-wifi-mac.cc index 4dc8ee1d3..df5e2ca7f 100644 --- a/src/wifi/model/ap-wifi-mac.cc +++ b/src/wifi/model/ap-wifi-mac.cc @@ -1456,6 +1456,25 @@ ApWifiMac::GetNextAssociationId (void) return 0; } +const std::map& +ApWifiMac::GetStaList (void) const +{ + return m_staList; +} + +uint16_t +ApWifiMac::GetAssociationId (Mac48Address addr) const +{ + for (auto & it : m_staList) + { + if (it.second == addr) + { + return it.first; + } + } + return SU_STA_ID; +} + uint8_t ApWifiMac::GetBufferStatus (uint8_t tid, Mac48Address address) const { diff --git a/src/wifi/model/ap-wifi-mac.h b/src/wifi/model/ap-wifi-mac.h index b28408c3a..3dfbf6f5b 100644 --- a/src/wifi/model/ap-wifi-mac.h +++ b/src/wifi/model/ap-wifi-mac.h @@ -108,6 +108,20 @@ public: */ int64_t AssignStreams (int64_t stream); + /** + * Get a const reference to the map of associated stations. Each station is + * specified by an (association ID, MAC address) pair. Make sure not to use + * the returned reference after that this object has been deallocated. + * + * \return a const reference to the map of associated stations + */ + const std::map& GetStaList (void) const; + /** + * \param addr the address of the associated station + * \return the Association ID allocated by the AP to the station, SU_STA_ID if unallocated + */ + uint16_t GetAssociationId (Mac48Address addr) const; + /** * Return the value of the Queue Size subfield of the last QoS Data or QoS Null * frame received from the station with the given MAC address and belonging to