00001 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ 00002 /* 00003 * Copyright (c) 2005,2006 INRIA 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License version 2 as 00007 * published by the Free Software Foundation; 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 * 00018 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> 00019 */ 00020 #ifndef CONSTANT_RATE_WIFI_MANAGER_H 00021 #define CONSTANT_RATE_WIFI_MANAGER_H 00022 00023 #include <stdint.h> 00024 00025 #include "wifi-remote-station-manager.h" 00026 00027 namespace ns3 { 00028 00029 /** 00030 * \brief use constant rates for data and control transmissions 00031 * 00032 * This class uses always the same transmission rate for every 00033 * packet sent. 00034 */ 00035 class ConstantRateWifiManager : public WifiRemoteStationManager 00036 { 00037 public: 00038 static TypeId GetTypeId (void); 00039 ConstantRateWifiManager (); 00040 virtual ~ConstantRateWifiManager (); 00041 00042 WifiMode GetDataMode (void) const; 00043 WifiMode GetCtlMode (void) const; 00044 private: 00045 virtual class WifiRemoteStation *CreateStation (void); 00046 00047 WifiMode m_dataMode; 00048 WifiMode m_ctlMode; 00049 }; 00050 00051 00052 class ConstantRateWifiRemoteStation : public WifiRemoteStation 00053 { 00054 public: 00055 ConstantRateWifiRemoteStation (Ptr<ConstantRateWifiManager> stations); 00056 virtual ~ConstantRateWifiRemoteStation (); 00057 00058 protected: 00059 virtual void DoReportRxOk (double rxSnr, WifiMode txMode); 00060 virtual void DoReportRtsFailed (void); 00061 virtual void DoReportDataFailed (void); 00062 virtual void DoReportRtsOk (double ctsSnr, WifiMode ctsMode, double rtsSnr); 00063 virtual void DoReportDataOk (double ackSnr, WifiMode ackMode, double dataSnr); 00064 virtual void DoReportFinalRtsFailed (void); 00065 virtual void DoReportFinalDataFailed (void); 00066 00067 private: 00068 virtual Ptr<WifiRemoteStationManager> GetManager (void) const; 00069 virtual WifiMode DoGetDataMode (uint32_t size); 00070 virtual WifiMode DoGetRtsMode (void); 00071 Ptr<ConstantRateWifiManager> m_manager; 00072 }; 00073 00074 } // namespace ns3 00075 00076 00077 00078 #endif /* CONSTANT_RATE_WIFI_MANAGER_H */