A Discrete-Event Network Simulator
API
yans-wifi-channel.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2006,2007 INRIA
4  *
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
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Mathieu Lacage, <mathieu.lacage@sophia.inria.fr>
19  */
20 #ifndef YANS_WIFI_CHANNEL_H
21 #define YANS_WIFI_CHANNEL_H
22 
23 #include <vector>
24 #include <stdint.h>
25 #include "ns3/packet.h"
26 #include "wifi-channel.h"
27 #include "wifi-mode.h"
28 #include "wifi-preamble.h"
29 #include "wifi-tx-vector.h"
30 #include "ns3/nstime.h"
31 
32 namespace ns3 {
33 
34 class NetDevice;
35 class PropagationLossModel;
36 class PropagationDelayModel;
37 class YansWifiPhy;
38 
52 {
53 public:
54  static TypeId GetTypeId (void);
55 
56  YansWifiChannel ();
57  virtual ~YansWifiChannel ();
58 
59  // inherited from Channel.
60  virtual uint32_t GetNDevices (void) const;
61  virtual Ptr<NetDevice> GetDevice (uint32_t i) const;
62 
68  void Add (Ptr<YansWifiPhy> phy);
69 
78 
93  void Send (Ptr<YansWifiPhy> sender, Ptr<const Packet> packet, double txPowerDbm,
94  WifiTxVector txVector, WifiPreamble preamble, uint8_t packetType, Time duration) const;
95 
104  int64_t AssignStreams (int64_t stream);
105 
106 private:
107  //YansWifiChannel& operator = (const YansWifiChannel &);
108  //YansWifiChannel (const YansWifiChannel &);
109 
113  typedef std::vector<Ptr<YansWifiPhy> > PhyList;
125  void Receive (uint32_t i, Ptr<Packet> packet, double *atts,
126  WifiTxVector txVector, WifiPreamble preamble) const;
127 
128 
129  PhyList m_phyList;
132 };
133 
134 } // namespace ns3
135 
136 
137 #endif /* YANS_WIFI_CHANNEL_H */
Ptr< PropagationDelayModel > m_delay
Propagation delay model.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
This class mimics the TXVECTOR which is to be passed to the PHY in order to define the parameters whi...
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
void SetPropagationLossModel(Ptr< PropagationLossModel > loss)
void SetPropagationDelayModel(Ptr< PropagationDelayModel > delay)
WifiPreamble
The type of preamble to be used by an IEEE 802.11 transmission.
Definition: wifi-preamble.h:29
virtual Ptr< NetDevice > GetDevice(uint32_t i) const
virtual uint32_t GetNDevices(void) const
Ptr< PropagationLossModel > m_loss
Propagation loss model.
PhyList m_phyList
List of YansWifiPhys connected to this YansWifiChannel.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static TypeId GetTypeId(void)
void Send(Ptr< YansWifiPhy > sender, Ptr< const Packet > packet, double txPowerDbm, WifiTxVector txVector, WifiPreamble preamble, uint8_t packetType, Time duration) const
std::vector< Ptr< YansWifiPhy > > PhyList
A vector of pointers to YansWifiPhy.
Wifi Channel interface specificationThis class works in tandem with the ns3::WifiPhy class...
Definition: wifi-channel.h:42
void Add(Ptr< YansWifiPhy > phy)
Adds the given YansWifiPhy to the PHY list.
A Yans wifi channelThis wifi channel implements the propagation model described in "Yet Another Netwo...
void Receive(uint32_t i, Ptr< Packet > packet, double *atts, WifiTxVector txVector, WifiPreamble preamble) const
This method is scheduled by Send for each associated YansWifiPhy.
a unique identifier for an interface.
Definition: type-id.h:57