From 1becfcfff6b2db2110e81a8a96dd4b4c9573474b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Deronne?= Date: Tue, 31 Oct 2023 21:53:27 +0100 Subject: [PATCH] wifi: Add function to retrieve whether a GCR BAR shall be retransmitted --- src/wifi/model/block-ack-manager.cc | 9 +++++++++ src/wifi/model/block-ack-manager.h | 16 ++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/wifi/model/block-ack-manager.cc b/src/wifi/model/block-ack-manager.cc index a98859007..42903bd0a 100644 --- a/src/wifi/model/block-ack-manager.cc +++ b/src/wifi/model/block-ack-manager.cc @@ -1156,6 +1156,15 @@ BlockAckManager::NeedBarRetransmission(uint8_t tid, const Mac48Address& recipien return false; } +bool +BlockAckManager::NeedGcrBarRetransmission(const Mac48Address& gcrGroupAddress, + const Mac48Address& recipient, + uint8_t tid) const +{ + const auto it = GetOriginatorBaAgreement(recipient, tid, gcrGroupAddress); + return (it != m_originatorAgreements.cend() && it->second.first.IsEstablished()); +} + void BlockAckManager::SetBlockAckInactivityCallback( Callback> callback) diff --git a/src/wifi/model/block-ack-manager.h b/src/wifi/model/block-ack-manager.h index 73ecf4a28..e5848cfb9 100644 --- a/src/wifi/model/block-ack-manager.h +++ b/src/wifi/model/block-ack-manager.h @@ -359,6 +359,22 @@ class BlockAckManager : public Object * @returns true if BAR retransmission needed */ bool NeedBarRetransmission(uint8_t tid, const Mac48Address& recipient); + + /** + * This function returns true if a GCR block ack agreement is established with the given + * recipient, for the given TID, for the given GCR group address and there is at least an + * outstanding MPDU for such agreement whose lifetime is not expired. + * + * @param gcrGroupAddress the GCR group address + * @param tid Traffic ID + * @param recipient MAC address of the recipient + * + * @returns true if BAR retransmission needed + */ + bool NeedGcrBarRetransmission(const Mac48Address& gcrGroupAddress, + const Mac48Address& recipient, + uint8_t tid) const; + /** * This function returns the buffer size negotiated with the recipient. *