37 static TypeId tid =
TypeId (
"ns3::WifiDefaultProtectionManager")
39 .SetGroupName (
"Wifi")
55 std::unique_ptr<WifiProtection>
66 || mpdu->GetHeader ().IsTrigger ()
80 && txParams.
GetPsduInfo (mpdu->GetHeader ().GetAddr1 ()) ==
nullptr)
97 std::unique_ptr<WifiProtection> protection;
110 std::unique_ptr<WifiProtection>
134 std::unique_ptr<WifiProtection> protection;
148 std::unique_ptr<WifiProtection>
161 if (
m_mac->GetWifiRemoteStationManager ()->NeedRts (hdr, size))
167 return std::unique_ptr<WifiProtection> (protection);
171 if (
m_mac->GetWifiRemoteStationManager ()->GetUseNonErpProtection ()
172 &&
m_mac->GetWifiRemoteStationManager ()->NeedCtsToSelf (txVector))
175 protection->
ctsTxVector =
m_mac->GetWifiRemoteStationManager ()->GetCtsToSelfTxVector ();
176 return std::unique_ptr<WifiProtection> (protection);
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
WifiDefaultProtectionManager is the default protection manager, which selects the protection method f...
virtual std::unique_ptr< WifiProtection > TryAggregateMsdu(Ptr< const WifiMacQueueItem > msdu, const WifiTxParameters &txParams) override
Determine the protection method to use if the given MSDU is aggregated to the current frame.
static TypeId GetTypeId(void)
Get the type ID.
WifiDefaultProtectionManager()
virtual std::unique_ptr< WifiProtection > TryAddMpdu(Ptr< const WifiMacQueueItem > mpdu, const WifiTxParameters &txParams) override
Determine the protection method to use if the given MPDU is added to the current frame.
virtual std::unique_ptr< WifiProtection > GetPsduProtection(const WifiMacHeader &hdr, uint32_t size, const WifiTxVector &txVector) const
Select the protection method for a single PSDU.
virtual ~WifiDefaultProtectionManager()
WifiProtectionManager is an abstract base class.
Ptr< WifiMac > m_mac
MAC which is using this Protection Manager.
This class stores the TX parameters (TX vector, protection mechanism, acknowledgment mechanism,...
std::pair< uint32_t, uint32_t > GetSizeIfAggregateMsdu(Ptr< const WifiMacQueueItem > msdu) const
Get the size in bytes of the frame in case the given MSDU is aggregated.
const PsduInfoMap & GetPsduInfoMap(void) const
Get a const reference to the map containing information about PSDUs.
std::unique_ptr< WifiProtection > m_protection
protection method
uint32_t GetSizeIfAddMpdu(Ptr< const WifiMacQueueItem > mpdu) const
Get the size in bytes of the frame in case the given MPDU is added.
const PsduInfo * GetPsduInfo(Mac48Address receiver) const
Get a pointer to the information about the PSDU addressed to the given receiver, if present,...
WifiTxVector m_txVector
TXVECTOR of the frame being prepared.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
bool IsDlMu(void) const
Return true if this TX vector is used for a downlink multi-user transmission.
WifiMode GetMode(uint16_t staId=SU_STA_ID) const
If this TX vector is associated with an SU PPDU, return the selected payload transmission mode.
bool IsUlMu(void) const
Return true if this TX vector is used for an uplink multi-user transmission.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
WifiCtsToSelfProtection specifies that CTS-to-self protection method is used.
WifiTxVector ctsTxVector
CTS TXVECTOR.
WifiNoProtection specifies that no protection method is used.
WifiRtsCtsProtection specifies that RTS/CTS protection method is used.
WifiTxVector ctsTxVector
CTS TXVECTOR.
WifiTxVector rtsTxVector
RTS TXVECTOR.