LEFT | RIGHT |
(no file at all) | |
| 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
| 2 /* |
| 3 * Copyright (c) 2006,2007 INRIA |
| 4 * Copyright (c) 2010 Network Security Lab, University of Washington, Seattle. |
| 5 * |
| 6 * This program is free software; you can redistribute it and/or modify |
| 7 * it under the terms of the GNU General Public License version 2 as |
| 8 * published by the Free Software Foundation; |
| 9 * |
| 10 * This program is distributed in the hope that it will be useful, |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 * GNU General Public License for more details. |
| 14 * |
| 15 * You should have received a copy of the GNU General Public License |
| 16 * along with this program; if not, write to the Free Software |
| 17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 18 * |
| 19 * Authors: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
| 20 * Sidharth Nabar <snabar@uw.edu>, He Wu <mdzz@u.washington.edu> |
| 21 */ |
| 22 |
| 23 #ifndef NSL_WIFI_CHANNEL_H |
| 24 #define NSL_WIFI_CHANNEL_H |
| 25 |
| 26 #include <vector> |
| 27 #include <stdint.h> |
| 28 #include "ns3/packet.h" |
| 29 #include "ns3/wifi-channel.h" |
| 30 #include "ns3/wifi-mode.h" |
| 31 #include "ns3/wifi-preamble.h" |
| 32 #include "ns3/propagation-loss-model.h" |
| 33 #include "ns3/propagation-delay-model.h" |
| 34 |
| 35 namespace ns3 { |
| 36 |
| 37 class NetDevice; |
| 38 class NslWifiPhy; |
| 39 |
| 40 /** |
| 41 * This class is almost identical to YansWifiChannel. It is introduced together |
| 42 * with NslWifiPhy. |
| 43 */ |
| 44 class NslWifiChannel : public WifiChannel |
| 45 { |
| 46 public: |
| 47 static TypeId GetTypeId (void); |
| 48 NslWifiChannel (); |
| 49 virtual ~NslWifiChannel (); |
| 50 |
| 51 // inherited from Channel. |
| 52 virtual uint32_t GetNDevices (void) const; |
| 53 virtual Ptr<NetDevice> GetDevice (uint32_t i) const; |
| 54 |
| 55 void Add (Ptr<NslWifiPhy> phy); |
| 56 |
| 57 /** |
| 58 * \param loss the new propagation loss model. |
| 59 */ |
| 60 void SetPropagationLossModel (Ptr<PropagationLossModel> loss); |
| 61 |
| 62 /** |
| 63 * \param delay the new propagation delay model. |
| 64 */ |
| 65 void SetPropagationDelayModel (Ptr<PropagationDelayModel> delay); |
| 66 |
| 67 /** |
| 68 * \param sender the device from which the packet is originating. |
| 69 * \param packet the packet to send |
| 70 * \param txPowerDbm the tx power associated to the packet |
| 71 * \param wifiMode the tx mode associated to the packet |
| 72 * \param preamble the preamble associated to the packet |
| 73 * |
| 74 * This method should not be invoked by normal users. It is currently invoked |
| 75 * only from WifiPhy::Send. NslWifiChannel delivers packets only between |
| 76 * PHYs with the same m_channelNumber, e.g. PHYs that are operating on the |
| 77 * same channel. |
| 78 */ |
| 79 void Send (Ptr<NslWifiPhy> sender, Ptr<const Packet> packet, |
| 80 double txPowerDbm, WifiMode wifiMode, WifiPreamble preamble) const; |
| 81 |
| 82 private: |
| 83 typedef std::vector<Ptr<NslWifiPhy> > PhyList; |
| 84 void Receive (uint32_t i, Ptr<Packet> packet, double rxPowerDbm, |
| 85 WifiMode txMode, WifiPreamble preamble) const; |
| 86 |
| 87 PhyList m_phyList; |
| 88 Ptr<PropagationLossModel> m_loss; |
| 89 Ptr<PropagationDelayModel> m_delay; |
| 90 }; |
| 91 |
| 92 } // namespace ns3 |
| 93 |
| 94 |
| 95 #endif /* NSL_WIFI_CHANNEL_H */ |
LEFT | RIGHT |