A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
network
helper
simple-net-device-helper.h
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2014 Universita' di Firenze
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: Tommaso Pecorella <tommaso.pecorella@unifi.it>
19
*/
20
#ifndef SIMPLE_NETDEVICE_HELPER_H
21
#define SIMPLE_NETDEVICE_HELPER_H
22
23
#include <string>
24
25
#include "ns3/attribute.h"
26
#include "ns3/object-factory.h"
27
#include "ns3/net-device-container.h"
28
#include "ns3/node-container.h"
29
#include "ns3/simple-channel.h"
30
31
namespace
ns3
{
32
36
class
SimpleNetDeviceHelper
37
{
38
public
:
42
SimpleNetDeviceHelper
();
43
virtual
~SimpleNetDeviceHelper
() {}
44
63
void
SetQueue
(std::string type,
64
std::string n1 =
""
,
const
AttributeValue
&v1 =
EmptyAttributeValue
(),
65
std::string n2 =
""
,
const
AttributeValue
&v2 =
EmptyAttributeValue
(),
66
std::string n3 =
""
,
const
AttributeValue
&v3 =
EmptyAttributeValue
(),
67
std::string n4 =
""
,
const
AttributeValue
&v4 =
EmptyAttributeValue
());
68
87
void
SetChannel
(std::string type,
88
std::string n1 =
""
,
const
AttributeValue
&v1 =
EmptyAttributeValue
(),
89
std::string n2 =
""
,
const
AttributeValue
&v2 =
EmptyAttributeValue
(),
90
std::string n3 =
""
,
const
AttributeValue
&v3 =
EmptyAttributeValue
(),
91
std::string n4 =
""
,
const
AttributeValue
&v4 =
EmptyAttributeValue
());
92
93
101
void
SetDeviceAttribute
(std::string n1,
const
AttributeValue
&v1);
102
110
void
SetChannelAttribute
(std::string n1,
const
AttributeValue
&v1);
111
121
void
SetNetDevicePointToPointMode
(
bool
pointToPointMode);
122
132
NetDeviceContainer
Install
(
Ptr<Node>
node)
const
;
133
143
NetDeviceContainer
Install
(
Ptr<Node>
node,
Ptr<SimpleChannel>
channel
)
const
;
144
155
NetDeviceContainer
Install
(
const
NodeContainer
&c)
const
;
156
167
NetDeviceContainer
Install
(
const
NodeContainer
&c,
Ptr<SimpleChannel>
channel
)
const
;
168
169
private
:
179
Ptr<NetDevice>
InstallPriv
(
Ptr<Node>
node,
Ptr<SimpleChannel>
channel
)
const
;
180
181
ObjectFactory
m_queueFactory
;
182
ObjectFactory
m_deviceFactory
;
183
ObjectFactory
m_channelFactory
;
184
bool
m_pointToPointMode
;
185
186
};
187
188
}
// namespace ns3
189
190
#endif
/* SIMPLE_NETDEVICE_HELPER_H */
ns3::SimpleNetDeviceHelper::m_deviceFactory
ObjectFactory m_deviceFactory
NetDevice factory.
Definition:
simple-net-device-helper.h:182
ns3::Ptr< Node >
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:68
ns3::SimpleNetDeviceHelper::SetChannelAttribute
void SetChannelAttribute(std::string n1, const AttributeValue &v1)
Definition:
simple-net-device-helper.cc:87
third.channel
channel
Definition:
third.py:85
ns3::EmptyAttributeValue
A class for an empty attribute value.
Definition:
attribute.h:232
ns3::NetDeviceContainer
holds a vector of ns3::NetDevice pointers
Definition:
net-device-container.h:41
ns3::SimpleNetDeviceHelper::SetDeviceAttribute
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
Definition:
simple-net-device-helper.cc:81
ns3::SimpleNetDeviceHelper::m_channelFactory
ObjectFactory m_channelFactory
Channel factory.
Definition:
simple-net-device-helper.h:183
ns3::SimpleNetDeviceHelper::~SimpleNetDeviceHelper
virtual ~SimpleNetDeviceHelper()
Definition:
simple-net-device-helper.h:43
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::NodeContainer
keep track of a set of node pointers.
Definition:
node-container.h:38
ns3::SimpleNetDeviceHelper::SimpleNetDeviceHelper
SimpleNetDeviceHelper()
Construct a SimpleNetDeviceHelper.
Definition:
simple-net-device-helper.cc:42
ns3::SimpleNetDeviceHelper::m_queueFactory
ObjectFactory m_queueFactory
Queue factory.
Definition:
simple-net-device-helper.h:181
ns3::SimpleNetDeviceHelper::m_pointToPointMode
bool m_pointToPointMode
Install PointToPoint SimpleNetDevice or Broadcast ones.
Definition:
simple-net-device-helper.h:184
ns3::SimpleNetDeviceHelper::SetNetDevicePointToPointMode
void SetNetDevicePointToPointMode(bool pointToPointMode)
SimpleNetDevice is Broadcast capable and ARP needing.
Definition:
simple-net-device-helper.cc:93
ns3::SimpleNetDeviceHelper::InstallPriv
Ptr< NetDevice > InstallPriv(Ptr< Node > node, Ptr< SimpleChannel > channel) const
This method creates an ns3::SimpleNetDevice with the attributes configured by SimpleNetDeviceHelper::...
Definition:
simple-net-device-helper.cc:133
ns3::SimpleNetDeviceHelper::SetQueue
void SetQueue(std::string type, 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())
Each net device must have a queue to pass packets through.
Definition:
simple-net-device-helper.cc:51
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition:
object-factory.h:47
ns3::SimpleNetDeviceHelper
build a set of SimpleNetDevice objects
Definition:
simple-net-device-helper.h:36
ns3::SimpleNetDeviceHelper::SetChannel
void SetChannel(std::string type, 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())
Each net device must have a channel to pass packets through.
Definition:
simple-net-device-helper.cc:67
ns3::SimpleNetDeviceHelper::Install
NetDeviceContainer Install(Ptr< Node > node) const
This method creates an ns3::SimpleChannel with the attributes configured by SimpleNetDeviceHelper::Se...
Definition:
simple-net-device-helper.cc:99
Generated on Wed Nov 7 2018 10:02:06 for ns-3 by
1.8.14