diff --git a/src/wifi/model/sta-wifi-mac.cc b/src/wifi/model/sta-wifi-mac.cc index defd2ca77..a7d640180 100644 --- a/src/wifi/model/sta-wifi-mac.cc +++ b/src/wifi/model/sta-wifi-mac.cc @@ -27,6 +27,8 @@ #include "ns3/random-variable-stream.h" #include "ns3/simulator.h" #include "ns3/string.h" +#include "channel-access-manager.h" +#include "frame-exchange-manager.h" #include "qos-txop.h" #include "sta-wifi-mac.h" #include "wifi-phy.h" @@ -134,6 +136,23 @@ StaWifiMac::~StaWifiMac () NS_LOG_FUNCTION (this); } +StaWifiMac::StaLinkEntity::~StaLinkEntity () +{ + NS_LOG_FUNCTION_NOARGS (); +} + +std::unique_ptr +StaWifiMac::CreateLinkEntity (void) const +{ + return std::make_unique (); +} + +StaWifiMac::StaLinkEntity& +StaWifiMac::GetLink (uint8_t linkId) const +{ + return static_cast (WifiMac::GetLink (linkId)); +} + int64_t StaWifiMac::AssignStreams (int64_t stream) { diff --git a/src/wifi/model/sta-wifi-mac.h b/src/wifi/model/sta-wifi-mac.h index 8b731525d..8edfc1b79 100644 --- a/src/wifi/model/sta-wifi-mac.h +++ b/src/wifi/model/sta-wifi-mac.h @@ -218,6 +218,29 @@ public: */ int64_t AssignStreams (int64_t stream); +protected: + /** + * Structure holding information specific to a single link. Here, the meaning of + * "link" is that of the 11be amendment which introduced multi-link devices. For + * previous amendments, only one link can be created. + */ + struct StaLinkEntity : public WifiMac::LinkEntity + { + /// Destructor (a virtual method is needed to make this struct polymorphic) + virtual ~StaLinkEntity (); + + std::optional apLinkId; //!< ID (as set by the AP) of the link we have + //!< setup or are setting up + }; + + /** + * Get a reference to the link associated with the given ID. + * + * \param linkId the given link ID + * \return a reference to the link associated with the given ID + */ + StaLinkEntity& GetLink (uint8_t linkId) const; + private: /** * The current MAC state of the STA. @@ -256,6 +279,7 @@ private: bool CheckSupportedRates (std::variant frame, uint8_t linkId); void Receive (Ptr mpdu, uint8_t linkId) override; + std::unique_ptr CreateLinkEntity (void) const override; /** * Process the Beacon frame received on the given link.