A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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
#include "ns3/deprecated.h"
31
32
namespace
ns3 {
33
37
class
SimpleNetDeviceHelper
38
{
39
public
:
43
SimpleNetDeviceHelper
();
44
virtual
~SimpleNetDeviceHelper
() {}
45
64
void
SetQueue
(std::string type,
65
std::string n1 =
""
,
const
AttributeValue
&v1 =
EmptyAttributeValue
(),
66
std::string n2 =
""
,
const
AttributeValue
&v2 =
EmptyAttributeValue
(),
67
std::string n3 =
""
,
const
AttributeValue
&v3 =
EmptyAttributeValue
(),
68
std::string n4 =
""
,
const
AttributeValue
&v4 =
EmptyAttributeValue
());
69
88
void
SetChannel
(std::string type,
89
std::string n1 =
""
,
const
AttributeValue
&v1 =
EmptyAttributeValue
(),
90
std::string n2 =
""
,
const
AttributeValue
&v2 =
EmptyAttributeValue
(),
91
std::string n3 =
""
,
const
AttributeValue
&v3 =
EmptyAttributeValue
(),
92
std::string n4 =
""
,
const
AttributeValue
&v4 =
EmptyAttributeValue
());
93
94
102
void
SetDeviceAttribute
(std::string n1,
const
AttributeValue
&v1);
103
111
void
SetChannelAttribute
(std::string n1,
const
AttributeValue
&v1);
112
122
void
SetNetDevicePointToPointMode
(
bool
pointToPointMode);
123
133
NetDeviceContainer
Install
(
Ptr<Node>
node)
const
;
134
144
NetDeviceContainer
Install
(
Ptr<Node>
node,
Ptr<SimpleChannel>
channel)
const
;
145
156
NetDeviceContainer
Install
(
const
NodeContainer
&c)
const
;
157
168
NetDeviceContainer
Install
(
const
NodeContainer
&c,
Ptr<SimpleChannel>
channel)
const
;
169
170
private
:
180
Ptr<NetDevice>
InstallPriv
(
Ptr<Node>
node,
Ptr<SimpleChannel>
channel)
const
;
181
182
ObjectFactory
m_queueFactory
;
183
ObjectFactory
m_deviceFactory
;
184
ObjectFactory
m_channelFactory
;
185
bool
m_pointToPointMode
;
186
187
};
188
189
}
// namespace ns3
190
191
#endif
/* SIMPLE_NETDEVICE_HELPER_H */
ns3::SimpleNetDeviceHelper::m_deviceFactory
ObjectFactory m_deviceFactory
NetDevice factory.
Definition:
simple-net-device-helper.h:183
ns3::Ptr< Node >
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:96
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:56
ns3::SimpleNetDeviceHelper::SetChannelAttribute
void SetChannelAttribute(std::string n1, const AttributeValue &v1)
Definition:
simple-net-device-helper.cc:84
ns3::EmptyAttributeValue
A class for an empty attribute value.
Definition:
attribute.h:222
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:78
ns3::SimpleNetDeviceHelper::m_channelFactory
ObjectFactory m_channelFactory
Channel factory.
Definition:
simple-net-device-helper.h:184
ns3::SimpleNetDeviceHelper::~SimpleNetDeviceHelper
virtual ~SimpleNetDeviceHelper()
Definition:
simple-net-device-helper.h:44
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:41
ns3::SimpleNetDeviceHelper::m_queueFactory
ObjectFactory m_queueFactory
Queue factory.
Definition:
simple-net-device-helper.h:182
ns3::SimpleNetDeviceHelper::m_pointToPointMode
bool m_pointToPointMode
Install PointToPoint SimpleNetDevice or Broadcast ones.
Definition:
simple-net-device-helper.h:185
ns3::SimpleNetDeviceHelper::SetNetDevicePointToPointMode
void SetNetDevicePointToPointMode(bool pointToPointMode)
SimpleNetDevice is Broadcast capable and ARP needing.
Definition:
simple-net-device-helper.cc:90
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:130
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:50
ns3::ObjectFactory
instantiate subclasses of ns3::Object.
Definition:
object-factory.h:39
ns3::SimpleNetDeviceHelper
build a set of SimpleNetDevice objects
Definition:
simple-net-device-helper.h:37
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:64
src
network
helper
simple-net-device-helper.h
Generated on Wed Sep 17 2014 23:33:37 for ns-3 by
1.8.6