A Discrete-Event Network Simulator
API
yans-wifi-helper.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2008 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_HELPER_H
21 #define YANS_WIFI_HELPER_H
22 
23 #include "wifi-helper.h"
24 #include "ns3/trace-helper.h"
25 #include "ns3/yans-wifi-channel.h"
26 
27 namespace ns3 {
28 
37 {
38 public:
44 
51  static YansWifiChannelHelper Default (void);
52 
81  void AddPropagationLoss (std::string name,
82  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
83  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
84  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
85  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
86  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
87  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
88  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
89  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
111  void SetPropagationDelay (std::string name,
112  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
113  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
114  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
115  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
116  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
117  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
118  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
119  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
120 
126  Ptr<YansWifiChannel> Create (void) const;
127 
139  int64_t AssignStreams (Ptr<YansWifiChannel> c, int64_t stream);
140 
141 
142 private:
143  std::vector<ObjectFactory> m_propagationLoss;
145 };
146 
158  public PcapHelperForDevice,
160 {
161 public:
167 
171  static YansWifiPhyHelper Default (void);
172 
178  void SetChannel (Ptr<YansWifiChannel> channel);
184  void SetChannel (std::string channelName);
191  void Set (std::string name, const AttributeValue &v);
213  void SetErrorRateModel (std::string name,
214  std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
215  std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
216  std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
217  std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
218  std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
219  std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
220  std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
221  std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
222 
229  {
233  };
234 
245 
253  uint32_t GetPcapDataLinkType (void) const;
254 
255 private:
263  virtual Ptr<WifiPhy> Create (Ptr<Node> node, Ptr<NetDevice> device) const;
264 
276  virtual void EnablePcapInternal (std::string prefix,
277  Ptr<NetDevice> nd,
278  bool promiscuous,
279  bool explicitFilename);
280 
292  virtual void EnableAsciiInternal (Ptr<OutputStreamWrapper> stream,
293  std::string prefix,
294  Ptr<NetDevice> nd,
295  bool explicitFilename);
296 
300  uint32_t m_pcapDlt;
301 };
302 
303 } // namespace ns3
304 
305 #endif /* YANS_WIFI_HELPER_H */
Base class providing common user-level ascii trace operations for helpers representing net devices...
Definition: trace-helper.h:621
void AddPropagationLoss(std::string name, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
uint32_t GetPcapDataLinkType(void) const
Get the data link type of PCAP traces to be used.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
void SetErrorRateModel(std::string name, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
Ptr< YansWifiChannel > Create(void) const
Make it easy to create and manage PHY objects for the yans model.
static YansWifiChannelHelper Default(void)
Create a channel helper in a default working state.
Hold a value for an Attribute.
Definition: attribute.h:68
create PHY objects
Definition: wifi-helper.h:46
Include Prism monitor mode information.
Base class providing common user-level pcap operations for helpers representing net devices...
Definition: trace-helper.h:532
void SetPcapDataLinkType(enum SupportedPcapDataLinkTypes dlt)
Set the data link type of PCAP traces to be used.
virtual void EnableAsciiInternal(Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< NetDevice > nd, bool explicitFilename)
Enable ascii trace output on the indicated net device.
void Set(std::string name, const AttributeValue &v)
static YansWifiPhyHelper Default(void)
Create a phy helper in a default working state.
YansWifiChannelHelper()
Create a channel helper without any parameter set.
Include Radiotap link layer information.
IEEE 802.11 Wireless LAN headers on packets.
void SetChannel(Ptr< YansWifiChannel > channel)
A class for an empty attribute value.
Definition: attribute.h:234
YansWifiPhyHelper()
Create a phy helper without any parameter set.
ObjectFactory m_errorRateModel
Every class exported by the ns3 library is enclosed in the ns3 namespace.
virtual void EnablePcapInternal(std::string prefix, Ptr< NetDevice > nd, bool promiscuous, bool explicitFilename)
Enable pcap output the indicated net device.
Ptr< YansWifiChannel > m_channel
manage and create wifi channel objects for the yans model.
Instantiate subclasses of ns3::Object.
virtual Ptr< WifiPhy > Create(Ptr< Node > node, Ptr< NetDevice > device) const
void SetPropagationDelay(std::string name, std::string n0="", const AttributeValue &v0=EmptyAttributeValue(), std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue())
std::vector< ObjectFactory > m_propagationLoss
SupportedPcapDataLinkTypes
An enumeration of the pcap data link types (DLTs) which this helper supports.
int64_t AssignStreams(Ptr< YansWifiChannel > c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by the channel.