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
csma-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 CSMA_HELPER_H
21
#define CSMA_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/csma-channel.h"
30
#include "ns3/deprecated.h"
31
#include "ns3/trace-helper.h"
32
33
namespace
ns3 {
34
35
class
Packet;
36
46
class
CsmaHelper
:
public
PcapHelperForDevice
,
public
AsciiTraceHelperForDevice
47
{
48
public
:
52
CsmaHelper
();
53
virtual
~CsmaHelper
() {}
54
69
void
SetQueue
(std::string type,
70
std::string n1 =
""
,
const
AttributeValue
&v1 =
EmptyAttributeValue
(),
71
std::string n2 =
""
,
const
AttributeValue
&v2 =
EmptyAttributeValue
(),
72
std::string n3 =
""
,
const
AttributeValue
&v3 =
EmptyAttributeValue
(),
73
std::string n4 =
""
,
const
AttributeValue
&v4 =
EmptyAttributeValue
());
74
82
void
SetDeviceAttribute
(std::string n1,
const
AttributeValue
&v1);
83
91
void
SetChannelAttribute
(std::string n1,
const
AttributeValue
&v1);
92
102
NetDeviceContainer
Install
(
Ptr<Node>
node)
const
;
103
113
NetDeviceContainer
Install
(std::string name)
const
;
114
124
NetDeviceContainer
Install
(
Ptr<Node>
node,
Ptr<CsmaChannel>
channel)
const
;
125
135
NetDeviceContainer
Install
(
Ptr<Node>
node, std::string channelName)
const
;
136
146
NetDeviceContainer
Install
(std::string nodeName,
Ptr<CsmaChannel>
channel)
const
;
147
157
NetDeviceContainer
Install
(std::string nodeName, std::string channelName)
const
;
158
169
NetDeviceContainer
Install
(
const
NodeContainer
&c)
const
;
170
181
NetDeviceContainer
Install
(
const
NodeContainer
&c,
Ptr<CsmaChannel>
channel)
const
;
182
193
NetDeviceContainer
Install
(
const
NodeContainer
&c, std::string channelName)
const
;
194
206
int64_t
AssignStreams
(
NetDeviceContainer
c, int64_t stream);
207
208
private
:
209
/*
210
* \internal
211
*/
212
Ptr<NetDevice>
InstallPriv
(
Ptr<Node>
node,
Ptr<CsmaChannel>
channel)
const
;
213
226
virtual
void
EnablePcapInternal
(std::string prefix,
Ptr<NetDevice>
nd,
bool
promiscuous,
bool
explicitFilename);
227
240
virtual
void
EnableAsciiInternal
(
Ptr<OutputStreamWrapper>
stream,
241
std::string prefix,
242
Ptr<NetDevice>
nd,
243
bool
explicitFilename);
244
245
ObjectFactory
m_queueFactory
;
246
ObjectFactory
m_deviceFactory
;
247
ObjectFactory
m_channelFactory
;
248
};
249
250
}
// namespace ns3
251
252
#endif
/* CSMA_HELPER_H */
ns3::AsciiTraceHelperForDevice
Base class providing common user-level ascii trace operations for helpers representing net devices...
Definition:
trace-helper.h:413
ns3::Ptr< Node >
ns3::CsmaHelper::SetChannelAttribute
void SetChannelAttribute(std::string n1, const AttributeValue &v1)
Definition:
csma-helper.cc:69
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:56
ns3::PcapHelperForDevice
Base class providing common user-level pcap operations for helpers representing net devices...
Definition:
trace-helper.h:323
ns3::CsmaHelper::EnablePcapInternal
virtual void EnablePcapInternal(std::string prefix, Ptr< NetDevice > nd, bool promiscuous, bool explicitFilename)
Enable pcap output on the indicated net device.
Definition:
csma-helper.cc:75
ns3::CsmaHelper::Install
NetDeviceContainer Install(Ptr< Node > node) const
Definition:
csma-helper.cc:215
ns3::CsmaHelper::CsmaHelper
CsmaHelper()
Definition:
csma-helper.cc:41
ns3::EmptyAttributeValue
A class for an empty attribute value.
Definition:
attribute.h:222
ns3::CsmaHelper::m_deviceFactory
ObjectFactory m_deviceFactory
Definition:
csma-helper.h:246
ns3::NetDeviceContainer
holds a vector of ns3::NetDevice pointers
Definition:
net-device-container.h:41
ns3::CsmaHelper::m_channelFactory
ObjectFactory m_channelFactory
Definition:
csma-helper.h:247
ns3::NodeContainer
keep track of a set of node pointers.
Definition:
node-container.h:38
ns3::CsmaHelper
build a set of CsmaNetDevice objects
Definition:
csma-helper.h:46
ns3::CsmaHelper::m_queueFactory
ObjectFactory m_queueFactory
Definition:
csma-helper.h:245
ns3::CsmaHelper::SetDeviceAttribute
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
Definition:
csma-helper.cc:63
ns3::CsmaHelper::EnableAsciiInternal
virtual void EnableAsciiInternal(Ptr< OutputStreamWrapper > stream, std::string prefix, Ptr< NetDevice > nd, bool explicitFilename)
Enable ascii trace output on the indicated net device.
Definition:
csma-helper.cc:114
ns3::CsmaHelper::AssignStreams
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Definition:
csma-helper.cc:285
ns3::ObjectFactory
instantiate subclasses of ns3::Object.
Definition:
object-factory.h:39
ns3::CsmaHelper::~CsmaHelper
virtual ~CsmaHelper()
Definition:
csma-helper.h:53
ns3::CsmaHelper::InstallPriv
Ptr< NetDevice > InstallPriv(Ptr< Node > node, Ptr< CsmaChannel > channel) const
Definition:
csma-helper.cc:302
ns3::CsmaHelper::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())
Definition:
csma-helper.cc:49
src
csma
helper
csma-helper.h
Generated on Sat Nov 16 2013 16:17:38 for ns-3 by
1.8.5