From bc334649a341a79dab79524213211b737ac7af41 Mon Sep 17 00:00:00 2001 From: Stefano Avallone Date: Wed, 1 Feb 2023 17:22:12 +0100 Subject: [PATCH] wifi: Add a StaWifiMac method to get the link ID as set by the AP --- src/wifi/model/sta-wifi-mac.cc | 6 ++++++ src/wifi/model/sta-wifi-mac.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/wifi/model/sta-wifi-mac.cc b/src/wifi/model/sta-wifi-mac.cc index 6ea2dc87c..81a6a7eb4 100644 --- a/src/wifi/model/sta-wifi-mac.cc +++ b/src/wifi/model/sta-wifi-mac.cc @@ -772,6 +772,12 @@ StaWifiMac::GetSetupLinkIds() const return linkIds; } +std::optional +StaWifiMac::GetApLinkId(uint8_t linkId) const +{ + return GetLink(linkId).apLinkId; +} + Mac48Address StaWifiMac::DoGetLocalAddress(const Mac48Address& remoteAddr) const { diff --git a/src/wifi/model/sta-wifi-mac.h b/src/wifi/model/sta-wifi-mac.h index 76f2d6132..78da1046a 100644 --- a/src/wifi/model/sta-wifi-mac.h +++ b/src/wifi/model/sta-wifi-mac.h @@ -233,6 +233,12 @@ class StaWifiMac : public WifiMac */ std::set GetSetupLinkIds() const; + /** + * \param linkId the IO of the given link + * \return the ID (as set by the AP) of the given link, if the given link has been setup + */ + std::optional GetApLinkId(uint8_t linkId) const; + /** * Return the association ID. *