From 3a4404f9448d062a6941a5ca984dd45daf932aae Mon Sep 17 00:00:00 2001 From: Mirko Banchi Date: Wed, 3 Feb 2010 20:34:52 +0100 Subject: [PATCH] retrieve next sequence number without increment it --- src/devices/wifi/mac-tx-middle.cc | 13 +++++++++++++ src/devices/wifi/mac-tx-middle.h | 1 + 2 files changed, 14 insertions(+) diff --git a/src/devices/wifi/mac-tx-middle.cc b/src/devices/wifi/mac-tx-middle.cc index 74a5b6207..2b84d7d91 100644 --- a/src/devices/wifi/mac-tx-middle.cc +++ b/src/devices/wifi/mac-tx-middle.cc @@ -77,4 +77,17 @@ MacTxMiddle::GetNextSequenceNumberfor (const WifiMacHeader *hdr) return retval; } +uint16_t +MacTxMiddle::GetNextSeqNumberByTidAndAddress (uint8_t tid, Mac48Address addr) const +{ + NS_ASSERT (tid < 16); + uint16_t seq = 0; + std::map ::const_iterator it = m_qosSequences.find (addr); + if (it != m_qosSequences.end ()) + { + return it->second[tid]; + } + return seq; +} + } // namespace ns3 diff --git a/src/devices/wifi/mac-tx-middle.h b/src/devices/wifi/mac-tx-middle.h index a701a93eb..9bccfc779 100644 --- a/src/devices/wifi/mac-tx-middle.h +++ b/src/devices/wifi/mac-tx-middle.h @@ -37,6 +37,7 @@ public: ~MacTxMiddle (); uint16_t GetNextSequenceNumberfor (const WifiMacHeader *hdr); + uint16_t GetNextSeqNumberByTidAndAddress (uint8_t tid, Mac48Address addr) const; private: std::map m_qosSequences;