wifi: Add functions to indicate whether GCR Block Agreement has been established with all group member
This commit is contained in:
@@ -2745,4 +2745,15 @@ ApWifiMac::GetMaxBufferStatus(Mac48Address address) const
|
||||
return 255;
|
||||
}
|
||||
|
||||
bool
|
||||
ApWifiMac::IsGcrBaAgreementEstablishedWithAllMembers(const Mac48Address& groupAddress,
|
||||
uint8_t tid) const
|
||||
{
|
||||
NS_ASSERT(m_gcrManager);
|
||||
return GetQosTxop(tid)->GetBaManager()->IsGcrAgreementEstablished(
|
||||
groupAddress,
|
||||
tid,
|
||||
m_gcrManager->GetMemberStasForGroupAddress(groupAddress));
|
||||
}
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
@@ -185,6 +185,18 @@ class ApWifiMac : public WifiMac
|
||||
*/
|
||||
bool UseGcr(const WifiMacHeader& hdr) const;
|
||||
|
||||
/**
|
||||
* Check if a GCR Block Ack agreement has been successfully established with all members of
|
||||
* its group.
|
||||
*
|
||||
* @param groupAddress the GCR group address.
|
||||
* @param tid the traffic ID.
|
||||
* @return true if a GCR Block Ack agreement has been successfully established with all members
|
||||
* of its group, false otherwise.
|
||||
*/
|
||||
bool IsGcrBaAgreementEstablishedWithAllMembers(const Mac48Address& groupAddress,
|
||||
uint8_t tid) const;
|
||||
|
||||
/// ACI-indexed map of access parameters of type unsigned integer (CWmin, CWmax and AIFSN)
|
||||
using UintAccessParamsMap = std::map<AcIndex, std::vector<uint64_t>>;
|
||||
|
||||
|
||||
@@ -1078,4 +1078,21 @@ BlockAckManager::GetGcrBufferSize(const Mac48Address& groupAddress, uint8_t tid)
|
||||
return gcrBufferSize;
|
||||
}
|
||||
|
||||
bool
|
||||
BlockAckManager::IsGcrAgreementEstablished(const Mac48Address& gcrGroupAddress,
|
||||
uint8_t tid,
|
||||
const GcrManager::GcrMembers& members) const
|
||||
{
|
||||
NS_ASSERT(!members.empty());
|
||||
for (const auto& member : members)
|
||||
{
|
||||
if (const auto agreement = GetAgreementAsOriginator(member, tid, gcrGroupAddress);
|
||||
!agreement || !agreement->get().IsEstablished())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace ns3
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#define BLOCK_ACK_MANAGER_H
|
||||
|
||||
#include "block-ack-type.h"
|
||||
#include "gcr-manager.h"
|
||||
#include "originator-block-ack-agreement.h"
|
||||
#include "recipient-block-ack-agreement.h"
|
||||
#include "wifi-mac-header.h"
|
||||
@@ -467,6 +468,20 @@ class BlockAckManager : public Object
|
||||
*/
|
||||
uint16_t GetGcrStartingSequence(const Mac48Address& groupAddress, uint8_t tid) const;
|
||||
|
||||
/**
|
||||
* Check if a GCR Block Ack agreement has been successfully established with all members of
|
||||
* the group.
|
||||
*
|
||||
* @param gcrGroupAddress the GCR Group Address.
|
||||
* @param tid the traffic ID.
|
||||
* @param members members of the group.
|
||||
* @return true if a GCR Block Ack agreement has been successfully established with all members
|
||||
* of the group, false otherwise.
|
||||
*/
|
||||
bool IsGcrAgreementEstablished(const Mac48Address& gcrGroupAddress,
|
||||
uint8_t tid,
|
||||
const GcrManager::GcrMembers& members) const;
|
||||
|
||||
protected:
|
||||
void DoDispose() override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user