OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2010 MIRKO BANCHI | 3 * Copyright (c) 2010 MIRKO BANCHI |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 void | 32 void |
33 BlockAckCache::Init (uint16_t winStart, uint16_t winSize) | 33 BlockAckCache::Init (uint16_t winStart, uint16_t winSize) |
34 { | 34 { |
35 NS_LOG_FUNCTION (this << winStart << winSize); | 35 NS_LOG_FUNCTION (this << winStart << winSize); |
36 m_winStart = winStart; | 36 m_winStart = winStart; |
37 m_winSize = winSize <= 64 ? winSize : 64; | 37 m_winSize = winSize <= 64 ? winSize : 64; |
38 m_winEnd = (m_winStart + m_winSize - 1) % 4096; | 38 m_winEnd = (m_winStart + m_winSize - 1) % 4096; |
39 memset (m_bitmap, 0, sizeof (m_bitmap)); | 39 memset (m_bitmap, 0, sizeof (m_bitmap)); |
40 } | 40 } |
| 41 uint16_t |
| 42 BlockAckCache::GetWinStart () |
| 43 { |
| 44 return m_winStart; |
| 45 } |
41 | 46 |
42 void | 47 void |
43 BlockAckCache::UpdateWithMpdu (const WifiMacHeader *hdr) | 48 BlockAckCache::UpdateWithMpdu (const WifiMacHeader *hdr) |
44 { | 49 { |
45 NS_LOG_FUNCTION (this << hdr); | 50 NS_LOG_FUNCTION (this << hdr); |
46 uint16_t seqNumber = hdr->GetSequenceNumber (); | 51 uint16_t seqNumber = hdr->GetSequenceNumber (); |
47 if (!QosUtilsIsOldPacket (m_winStart, seqNumber)) | 52 if (!QosUtilsIsOldPacket (m_winStart, seqNumber)) |
48 { | 53 { |
49 if (!IsInWindow (seqNumber)) | 54 if (!IsInWindow (seqNumber)) |
50 { | 55 { |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 blockAckHeader->SetReceivedPacket (i); | 139 blockAckHeader->SetReceivedPacket (i); |
135 } | 140 } |
136 } | 141 } |
137 else if (blockAckHeader->IsMultiTid ()) | 142 else if (blockAckHeader->IsMultiTid ()) |
138 { | 143 { |
139 NS_FATAL_ERROR ("Multi-tid block ack is not supported."); | 144 NS_FATAL_ERROR ("Multi-tid block ack is not supported."); |
140 } | 145 } |
141 } | 146 } |
142 | 147 |
143 } // namespace ns3 | 148 } // namespace ns3 |
OLD | NEW |