User Manual, Developers Guide and API Documentation

BeaconCommand.hpp

Go to the documentation of this file.
00001 /******************************************************************************
00002  * WiMeMac                                                                    *
00003  * This file is part of openWNS (open Wireless Network Simulator)
00004  * _____________________________________________________________________________
00005  *
00006  * Copyright (C) 2004-2011
00007  * Chair of Communication Networks (ComNets)
00008  * Kopernikusstr. 5, 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 WIMEMAC_MANAGEMENT_BEACONCOMMAND_H
00030 #define WIMEMAC_MANAGEMENT_BEACONCOMMAND_H
00031 #include <WNS/ldk/Command.hpp>
00032 #include <WNS/service/dll/Address.hpp>
00033 #include <WNS/container/Registry.hpp>
00034 #include <WNS/PowerRatio.hpp>
00035 #include <vector>
00036 #include <queue>
00037 
00038 namespace wimemac {
00039 
00040 namespace convergence
00041 {
00042     class MCS;
00043 }
00044 
00045 namespace management {
00046 
00047 
00055 typedef std::vector<bool> Vector;
00056 
00057     class BeaconCommand:
00058         public wns::ldk::Command
00059     {
00060     public:
00061 
00062             BeaconCommand()
00063             {
00064                 peer.HasDRPIE = false;
00065                 peer.HasAvailabilityIE = false;
00066                 //default value is 1, as at least one device is a member of a beacon group
00067                 peer.BPOIE.BPsize = 0; 
00068                 
00069             }
00070 
00071 
00072             enum ReservationType {
00073                 Hard, Soft
00074             };
00075 
00076             enum ReasonCode{
00077             Accept, Conflict, Pending, Denied, Modified
00078             };
00079 
00080             enum DeviceType {
00081             Target, Owner
00082             };
00083 
00084             enum ProbeElementID {
00085             DRPAvailability
00086             };
00087             
00088                       
00089             struct DRP
00090             {
00091                 enum ReservationType reservationtype;
00092                 enum ReasonCode reasoncode;
00093                 enum DeviceType devicetype;
00094                 bool status;
00095                 wns::service::dll::UnicastAddress address;
00096                 Vector DRPAlloc;
00097                 bool isAdditionalDRPIE;
00098             };
00099             
00100             struct BPO
00101             {
00102                 int BPsize;
00103                 std::vector<wns::service::dll::UnicastAddress> IE;
00104                 
00105             };
00106 
00107 
00108             struct{} local;
00109 
00110             struct{
00111                 BPO BPOIE;
00112                 bool HasDRPIE;
00113                 bool HasAvailabilityIE;
00114                 
00115                 std::queue<DRP> drp;
00116                 Vector availabilityBitmap;
00117                 wns::container::Registry<wns::service::dll::UnicastAddress, std::queue<ProbeElementID> > probe;
00118             } peer;
00119 
00120             struct{} magic;
00121 
00122             bool HasDRPIE()
00123             {
00124                 return(peer.drp.size()!=0);
00125             }
00126 
00127             bool HasAvailabilityIE()
00128             {
00129                 return(peer.HasAvailabilityIE);
00130             }
00131 
00132             bool HasProbeIE(wns::service::dll::UnicastAddress address)
00133             {
00134                 return(peer.probe.knows(address));
00135             }
00136 
00137             bool HasProbeIE()
00138             {
00139                 return(peer.probe.size() != 0);
00140             }
00141             DRP GetDRPIE()
00142             {
00143                 DRP DRPIECommand;
00144                 DRPIECommand = peer.drp.front();
00145                 peer.drp.pop();
00146                 return(DRPIECommand);
00147             }
00148             void PutDRPIE(DRP drp)
00149             {
00150                 peer.drp.push(drp);
00151             }
00152 
00153             int GetDRPIESize()
00154             {
00155                 return(peer.drp.size());
00156             }
00157 
00158         private:
00159 
00160     };
00161 }
00162 
00163 }
00164 #endif

Generated on Mon May 21 03:32:18 2012 for openWNS by  doxygen 1.5.5