A Discrete-Event Network Simulator
API
wave-helper.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 as
5 * published by the Free Software Foundation;
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15 *
16 * Author: Junling Bu <linlinjavaer@gmail.com>
17 */
18
19#ifndef WAVE_HELPER_H
20#define WAVE_HELPER_H
21
22#include <string>
23#include "ns3/attribute.h"
24#include "ns3/object-factory.h"
25#include "ns3/node-container.h"
26#include "ns3/net-device-container.h"
27#include "ns3/trace-helper.h"
28#include "ns3/yans-wifi-helper.h"
29
30namespace ns3 {
31
32class WaveNetDevice;
33class Node;
34
41{
42public:
47 static YansWavePhyHelper Default (void);
48
49private:
61 virtual void EnablePcapInternal (std::string prefix,
63 bool promiscuous,
64 bool explicitFilename);
65
79 std::string prefix,
81 bool explicitFilename);
82};
83
114{
115public:
116 WaveHelper ();
117 virtual ~WaveHelper ();
118
127 static WaveHelper Default (void);
128
132 void CreateMacForChannel (std::vector<uint32_t> channelNumbers);
136 void CreatePhys (uint32_t phys);
137
160 void SetRemoteStationManager (std::string type,
161 std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
162 std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
163 std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
164 std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
165 std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
166 std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
167 std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
168 std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
191 void SetChannelScheduler (std::string type,
192 std::string n0 = "", const AttributeValue &v0 = EmptyAttributeValue (),
193 std::string n1 = "", const AttributeValue &v1 = EmptyAttributeValue (),
194 std::string n2 = "", const AttributeValue &v2 = EmptyAttributeValue (),
195 std::string n3 = "", const AttributeValue &v3 = EmptyAttributeValue (),
196 std::string n4 = "", const AttributeValue &v4 = EmptyAttributeValue (),
197 std::string n5 = "", const AttributeValue &v5 = EmptyAttributeValue (),
198 std::string n6 = "", const AttributeValue &v6 = EmptyAttributeValue (),
199 std::string n7 = "", const AttributeValue &v7 = EmptyAttributeValue ());
200
208 const WifiMacHelper &mac, NodeContainer c) const;
216 const WifiMacHelper &mac, Ptr<Node> node) const;
224 const WifiMacHelper &mac, std::string nodeName) const;
225
229 static void EnableLogComponents (void);
230
245 int64_t AssignStreams (NetDeviceContainer c, int64_t stream);
246
247protected:
250 std::vector<uint32_t> m_macsForChannelNumber;
252};
253}
254#endif /* WAVE_HELPER_H */
Hold a value for an Attribute.
Definition: attribute.h:69
A class for an empty attribute value.
Definition: attribute.h:233
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
Instantiate subclasses of ns3::Object.
helps to create WaveNetDevice objects
Definition: wave-helper.h:114
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by the Phy and Mac aspects ...
Definition: wave-helper.cc:441
virtual ~WaveHelper()
Definition: wave-helper.cc:264
std::vector< uint32_t > m_macsForChannelNumber
MACs for channel number.
Definition: wave-helper.h:250
virtual NetDeviceContainer Install(const WifiPhyHelper &phy, const WifiMacHelper &mac, NodeContainer c) const
Definition: wave-helper.cc:361
uint32_t m_physNumber
Phy number.
Definition: wave-helper.h:251
void CreateMacForChannel(std::vector< uint32_t > channelNumbers)
Definition: wave-helper.cc:284
static void EnableLogComponents(void)
Helper to enable all WaveNetDevice log components with one statement.
Definition: wave-helper.cc:424
static WaveHelper Default(void)
Definition: wave-helper.cc:269
ObjectFactory m_channelScheduler
channel scheduler
Definition: wave-helper.h:249
ObjectFactory m_stationManager
station manager
Definition: wave-helper.h:248
void SetRemoteStationManager(std::string type, 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())
Definition: wave-helper.cc:315
void CreatePhys(uint32_t phys)
Definition: wave-helper.cc:301
void SetChannelScheduler(std::string type, 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())
Definition: wave-helper.cc:338
create MAC layers for a ns3::WifiNetDevice.
create PHY objects
Definition: wifi-helper.h:48
To trace WaveNetDevice, we have to overwrite the trace functions of class YansWifiPhyHelper.
Definition: wave-helper.h:41
static YansWavePhyHelper Default(void)
Create a phy helper in a default working state.
Definition: wave-helper.cc:123
virtual void EnablePcapInternal(std::string prefix, Ptr< NetDevice > nd, bool promiscuous, bool explicitFilename)
Enable pcap output the indicated net device.
Definition: wave-helper.cc:131
virtual void EnableAsciiInternal(Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< NetDevice > nd, bool explicitFilename)
Enable ascii trace output on the indicated net device.
Definition: wave-helper.cc:172
Make it easy to create and manage PHY objects for the YANS model.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
mac
Definition: third.py:96
phy
Definition: third.py:93