wifi: Add a WifiPsdu method to check if a PSDU is setting the NAV
This commit is contained in:
@@ -1110,13 +1110,8 @@ FrameExchangeManager::UpdateNav(Ptr<const WifiPsdu> psdu, const WifiTxVector& tx
|
||||
{
|
||||
NS_LOG_FUNCTION(this << psdu << txVector);
|
||||
|
||||
if (psdu->GetHeader(0).GetRawDuration() > 32767)
|
||||
if (!psdu->HasNav())
|
||||
{
|
||||
// When the contents of a received Duration/ID field, treated as an unsigned
|
||||
// integer, are greater than 32 768, the contents are interpreted as appropriate
|
||||
// for the frame type and subtype or ignored if the receiving MAC entity does
|
||||
// not have a defined interpretation for that type and subtype (IEEE 802.11-2016
|
||||
// sec. 10.27.3)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -139,6 +139,16 @@ WifiPsdu::GetAddr2() const
|
||||
return ta;
|
||||
}
|
||||
|
||||
bool
|
||||
WifiPsdu::HasNav() const
|
||||
{
|
||||
// When the contents of a received Duration/ID field, treated as an unsigned integer,
|
||||
// are greater than 32 768, the contents are interpreted as appropriate for the frame
|
||||
// type and subtype or ignored if the receiving MAC entity does not have a defined
|
||||
// interpretation for that type and subtype (IEEE 802.11-2016 sec. 10.27.3)
|
||||
return (m_mpduList.at(0)->GetHeader().GetRawDuration() & 0x8000) == 0;
|
||||
}
|
||||
|
||||
Time
|
||||
WifiPsdu::GetDuration() const
|
||||
{
|
||||
|
||||
@@ -144,6 +144,11 @@ class WifiPsdu : public SimpleRefCount<WifiPsdu>
|
||||
*/
|
||||
Mac48Address GetAddr2() const;
|
||||
|
||||
/**
|
||||
* \return true if the Duration/ID field contains a value for setting the NAV
|
||||
*/
|
||||
bool HasNav() const;
|
||||
|
||||
/**
|
||||
* Get the duration from the Duration/ID field, which is common to all the MPDUs
|
||||
* \return the duration from the Duration/ID field.
|
||||
|
||||
Reference in New Issue
Block a user