A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
dsdv-helper.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2010 Hemanth Narra
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Authors: Hemanth Narra <hemanth@ittc.ku.com>, written after OlsrHelper by Mathieu Lacage
18
* <mathieu.lacage@sophia.inria.fr>
19
*
20
* James P.G. Sterbenz <jpgs@ittc.ku.edu>, director
21
* ResiliNets Research Group https://resilinets.org/
22
* Information and Telecommunication Technology Center (ITTC)
23
* and Department of Electrical Engineering and Computer Science
24
* The University of Kansas Lawrence, KS USA.
25
*
26
* Work supported in part by NSF FIND (Future Internet Design) Program
27
* under grant CNS-0626918 (Postmodern Internet Architecture),
28
* NSF grant CNS-1050226 (Multilayer Network Resilience Analysis and Experimentation on GENI),
29
* US Department of Defense (DoD), and ITTC at The University of Kansas.
30
*/
31
#include "
dsdv-helper.h
"
32
33
#include "ns3/dsdv-routing-protocol.h"
34
#include "ns3/ipv4-list-routing.h"
35
#include "ns3/names.h"
36
#include "ns3/node-list.h"
37
38
namespace
ns3
39
{
40
DsdvHelper::~DsdvHelper
()
41
{
42
}
43
44
DsdvHelper::DsdvHelper
()
45
:
Ipv4RoutingHelper
()
46
{
47
m_agentFactory
.
SetTypeId
(
"ns3::dsdv::RoutingProtocol"
);
48
}
49
50
DsdvHelper
*
51
DsdvHelper::Copy
()
const
52
{
53
return
new
DsdvHelper
(*
this
);
54
}
55
56
Ptr<Ipv4RoutingProtocol>
57
DsdvHelper::Create
(
Ptr<Node>
node)
const
58
{
59
Ptr<dsdv::RoutingProtocol>
agent =
m_agentFactory
.
Create
<
dsdv::RoutingProtocol
>();
60
node->
AggregateObject
(agent);
61
return
agent;
62
}
63
64
void
65
DsdvHelper::Set
(std::string name,
const
AttributeValue
& value)
66
{
67
m_agentFactory
.
Set
(name, value);
68
}
69
70
}
// namespace ns3
ns3::AttributeValue
Hold a value for an Attribute.
Definition:
attribute.h:70
ns3::DsdvHelper
Helper class that adds DSDV routing to nodes.
Definition:
dsdv-helper.h:47
ns3::DsdvHelper::m_agentFactory
ObjectFactory m_agentFactory
Object factory.
Definition:
dsdv-helper.h:76
ns3::DsdvHelper::DsdvHelper
DsdvHelper()
Definition:
dsdv-helper.cc:44
ns3::DsdvHelper::Copy
DsdvHelper * Copy() const override
Definition:
dsdv-helper.cc:51
ns3::DsdvHelper::Set
void Set(std::string name, const AttributeValue &value)
Definition:
dsdv-helper.cc:65
ns3::DsdvHelper::~DsdvHelper
~DsdvHelper() override
Definition:
dsdv-helper.cc:40
ns3::DsdvHelper::Create
Ptr< Ipv4RoutingProtocol > Create(Ptr< Node > node) const override
Definition:
dsdv-helper.cc:57
ns3::Ipv4RoutingHelper
a factory to create ns3::Ipv4RoutingProtocol objects
Definition:
ipv4-routing-helper.h:46
ns3::ObjectFactory::Create
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
Definition:
object-factory.cc:93
ns3::ObjectFactory::Set
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
Definition:
object-factory.h:220
ns3::ObjectFactory::SetTypeId
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Definition:
object-factory.cc:42
ns3::Object::AggregateObject
void AggregateObject(Ptr< Object > other)
Aggregate two Objects together.
Definition:
object.cc:259
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::dsdv::RoutingProtocol
DSDV routing protocol.
Definition:
dsdv-routing-protocol.h:56
dsdv-helper.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
dsdv
helper
dsdv-helper.cc
Generated on Sun Mar 3 2024 17:10:56 for ns-3 by
1.9.1