A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
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/trace-helper.h"
31
32
namespace
ns3
{
33
34
class
Packet;
35
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
219
Ptr<NetDevice>
InstallPriv
(
Ptr<Node>
node,
Ptr<CsmaChannel>
channel
)
const
;
220
232
virtual
void
EnablePcapInternal
(std::string prefix,
Ptr<NetDevice>
nd,
bool
promiscuous,
bool
explicitFilename);
233
245
virtual
void
EnableAsciiInternal
(
Ptr<OutputStreamWrapper>
stream,
246
std::string prefix,
247
Ptr<NetDevice>
nd,
248
bool
explicitFilename);
249
250
ObjectFactory
m_queueFactory
;
251
ObjectFactory
m_deviceFactory
;
252
ObjectFactory
m_channelFactory
;
253
};
254
255
}
// namespace ns3
256
257
#endif
/* CSMA_HELPER_H */
ns3::NetDeviceContainer
holds a vector of ns3::NetDevice pointers
Definition:
net-device-container.h:42
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::CsmaHelper::~CsmaHelper
virtual ~CsmaHelper()
Definition:
csma-helper.h:53
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:69
ns3::CsmaHelper::CsmaHelper
CsmaHelper()
Construct a CsmaHelper.
Definition:
csma-helper.cc:42
third.channel
channel
Definition:
third.py:92
ns3::CsmaHelper::Install
NetDeviceContainer Install(Ptr< Node > node) const
This method creates an ns3::CsmaChannel with the attributes configured by CsmaHelper::SetChannelAttri...
Definition:
csma-helper.cc:218
ns3::CsmaHelper::m_channelFactory
ObjectFactory m_channelFactory
factory for the channel
Definition:
csma-helper.h:252
ns3::CsmaHelper
build a set of CsmaNetDevice objects
Definition:
csma-helper.h:47
ns3::CsmaHelper::AssignStreams
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model.
Definition:
csma-helper.cc:288
ns3::Ptr< Node >
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:117
ns3::CsmaHelper::SetChannelAttribute
void SetChannelAttribute(std::string n1, const AttributeValue &v1)
Definition:
csma-helper.cc:72
ns3::ObjectFactory
Instantiate subclasses of ns3::Object.
Definition:
object-factory.h:48
ns3::CsmaHelper::m_queueFactory
ObjectFactory m_queueFactory
factory for the queues
Definition:
csma-helper.h:250
ns3::CsmaHelper::m_deviceFactory
ObjectFactory m_deviceFactory
factory for the NetDevices
Definition:
csma-helper.h:251
ns3::CsmaHelper::InstallPriv
Ptr< NetDevice > InstallPriv(Ptr< Node > node, Ptr< CsmaChannel > channel) const
This method creates an ns3::CsmaNetDevice with the attributes configured by CsmaHelper::SetDeviceAttr...
Definition:
csma-helper.cc:305
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:50
ns3::EmptyAttributeValue
A class for an empty attribute value.
Definition:
attribute.h:233
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:78
ns3::CsmaHelper::SetDeviceAttribute
void SetDeviceAttribute(std::string n1, const AttributeValue &v1)
Definition:
csma-helper.cc:66
ns3::NodeContainer
keep track of a set of node pointers.
Definition:
node-container.h:39
ns3::PcapHelperForDevice
Base class providing common user-level pcap operations for helpers representing net devices.
Definition:
trace-helper.h:554
ns3::AsciiTraceHelperForDevice
Base class providing common user-level ascii trace operations for helpers representing net devices.
Definition:
trace-helper.h:643
src
csma
helper
csma-helper.h
Generated on Fri Oct 1 2021 17:03:01 for ns-3 by
1.8.20