![]() |
User Manual, Developers Guide and API Documentation |
![]() |
00001 /****************************************************************************** 00002 * WiFiMac * 00003 * This file is part of openWNS (open Wireless Network Simulator) 00004 * _____________________________________________________________________________ 00005 * 00006 * Copyright (C) 2004-2007 00007 * Chair of Communication Networks (ComNets) 00008 * Kopernikusstr. 16, D-52074 Aachen, Germany 00009 * phone: ++49-241-80-27910, 00010 * fax: ++49-241-80-22242 00011 * email: info@openwns.org 00012 * www: http://www.openwns.org 00013 * _____________________________________________________________________________ 00014 * 00015 * openWNS is free software; you can redistribute it and/or modify it under the 00016 * terms of the GNU Lesser General Public License version 2 as published by the 00017 * Free Software Foundation; 00018 * 00019 * openWNS is distributed in the hope that it will be useful, but WITHOUT ANY 00020 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR 00021 * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00022 * details. 00023 * 00024 * You should have received a copy of the GNU Lesser General Public License 00025 * along with this program. If not, see <http://www.gnu.org/licenses/>. 00026 * 00027 ******************************************************************************/ 00028 00029 #ifndef WIFIMAC_DRAFTN_RECEPTIONQUEUE_HPP 00030 #define WIFIMAC_DRAFTN_RECEPTIONQUEUE_HPP 00031 00032 #include <WIFIMAC/draftn/BlockACKCommand.hpp> 00033 00034 #include <WNS/ldk/Compound.hpp> 00035 #include <WNS/service/dll/Address.hpp> 00036 00037 namespace wifimac { 00038 namespace draftn { 00039 00040 00041 class BlockACK; 00042 00056 class ReceptionQueue 00057 { 00061 typedef std::pair<wns::ldk::CompoundPtr, unsigned int> CompoundPtrWithSize; 00062 00063 public: 00064 ReceptionQueue(BlockACK* parent_, 00065 BlockACKCommand::SequenceNumber firstSN_, 00066 wns::service::dll::UnicastAddress adr_); 00067 ~ReceptionQueue(); 00068 00080 void 00081 processIncomingData(const wns::ldk::CompoundPtr& compound, 00082 const unsigned int size); 00083 00096 void 00097 processIncomingACKreq(const wns::ldk::CompoundPtr& compound); 00098 00100 const wns::ldk::CompoundPtr hasACK() const; 00101 00103 wns::ldk::CompoundPtr getACK(); 00104 00105 const size_t numPDUs() const 00106 { return rxStorage.size(); } 00107 const unsigned int storageSize() const; 00108 00109 private: 00110 void purgeRxStorage(); 00111 00112 const BlockACK* parent; 00113 const wns::service::dll::UnicastAddress adr; 00114 BlockACKCommand::SequenceNumber waitingForSN; 00115 std::map<BlockACKCommand::SequenceNumber, CompoundPtrWithSize> rxStorage; 00116 std::set<BlockACKCommand::SequenceNumber> rxSNs; 00117 wns::ldk::CompoundPtr blockACK; 00118 }; 00119 00120 } // draftn 00121 } // wifimac 00122 00123 #endif // WIFIMAC_DRAFTN_RECEPTIONQUEUE_HPP
1.5.5