37 static TypeId tid =
TypeId (
"ns3::WifiDefaultProtectionManager")
39 .SetGroupName (
"Wifi")
55 std::unique_ptr<WifiProtection>
73 std::unique_ptr<WifiProtection> protection;
86 std::unique_ptr<WifiProtection>
103 std::unique_ptr<WifiProtection> protection;
117 std::unique_ptr<WifiProtection>
130 if (
m_mac->GetWifiRemoteStationManager ()->NeedRts (hdr, size))
136 return std::unique_ptr<WifiProtection> (protection);
140 if (
m_mac->GetWifiRemoteStationManager ()->GetUseNonErpProtection ()
141 &&
m_mac->GetWifiRemoteStationManager ()->NeedCtsToSelf (txVector))
144 protection->
ctsTxVector =
m_mac->GetWifiRemoteStationManager ()->GetCtsToSelfTxVector ();
145 return std::unique_ptr<WifiProtection> (protection);
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
virtual std::unique_ptr< WifiProtection > GetPsduProtection(const WifiMacHeader &hdr, uint32_t size, const WifiTxVector &txVector) const
Select the protection method for a single PSDU.
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
std::unique_ptr< WifiProtection > m_protection
protection method
#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.
WifiTxVector ctsTxVector
CTS TXVECTOR.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
WifiTxVector rtsTxVector
RTS TXVECTOR.
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...
WifiDefaultProtectionManager()
WifiDefaultProtectionManager is the default protection manager, which selects the protection method f...
virtual ~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.
WifiTxVector m_txVector
TXVECTOR of the frame being prepared.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TypeId GetTypeId(void)
Get the type ID.
WifiRtsCtsProtection specifies that RTS/CTS protection method is used.
WifiProtectionManager is an abstract base class.
uint32_t GetSizeIfAddMpdu(Ptr< const WifiMacQueueItem > mpdu) const
Get the size in bytes of the frame in case the given MPDU is added.
WifiTxVector ctsTxVector
CTS TXVECTOR.
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.
This class stores the TX parameters (TX vector, protection mechanism, acknowledgment mechanism...
Ptr< RegularWifiMac > m_mac
MAC which is using this Protection Manager.
WifiCtsToSelfProtection specifies that CTS-to-self protection method is used.
WifiNoProtection specifies that no protection method is used.
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...
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.