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
ipv6-routing-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
21
#ifndef IPV6_ROUTING_HELPER_H
22
#define IPV6_ROUTING_HELPER_H
23
24
#include "ns3/ptr.h"
25
#include "ns3/nstime.h"
26
#include "ns3/output-stream-wrapper.h"
27
#include "ns3/ipv6-list-routing.h"
28
29
namespace
ns3 {
30
31
class
Ipv6RoutingProtocol;
32
class
Node;
33
43
class
Ipv6RoutingHelper
44
{
45
public
:
46
51
virtual
~Ipv6RoutingHelper
();
52
60
virtual
Ipv6RoutingHelper
*
Copy
(
void
)
const
= 0;
61
66
virtual
Ptr<Ipv6RoutingProtocol>
Create
(
Ptr<Node>
node)
const
= 0;
67
77
void
PrintRoutingTableAllAt
(
Time
printTime,
Ptr<OutputStreamWrapper>
stream)
const
;
78
88
void
PrintRoutingTableAllEvery
(
Time
printInterval,
Ptr<OutputStreamWrapper>
stream)
const
;
89
100
void
PrintRoutingTableAt
(
Time
printTime,
Ptr<Node>
node,
Ptr<OutputStreamWrapper>
stream)
const
;
101
112
void
PrintRoutingTableEvery
(
Time
printInterval,
Ptr<Node>
node,
Ptr<OutputStreamWrapper>
stream)
const
;
113
123
template
<
class
T>
124
static
Ptr<T>
GetRouting
(
Ptr<Ipv6RoutingProtocol>
protocol);
125
126
private
:
138
void
Print
(
Ptr<Node>
node,
Ptr<OutputStreamWrapper>
stream)
const
;
139
152
void
PrintEvery
(
Time
printInterval,
Ptr<Node>
node,
Ptr<OutputStreamWrapper>
stream)
const
;
153
};
154
164
template
<
class
T>
165
Ptr<T>
Ipv6RoutingHelper::GetRouting
(
Ptr<Ipv6RoutingProtocol>
protocol)
166
{
167
Ptr<T>
ret = DynamicCast<T> (protocol);
168
if
(ret == 0)
169
{
170
// trying to check if protocol is a list routing
171
Ptr<Ipv6ListRouting>
lrp = DynamicCast<Ipv6ListRouting> (protocol);
172
if
(lrp != 0)
173
{
174
for
(uint32_t i = 0; i < lrp->GetNRoutingProtocols (); i++)
175
{
176
int16_t priority;
177
ret = GetRouting<T> (lrp->GetRoutingProtocol (i, priority));
// potential recursion, if inside ListRouting is ListRouting
178
if
(ret != 0)
179
break
;
180
}
181
}
182
}
183
184
return
ret;
185
}
186
187
}
// namespace ns3
188
189
190
#endif
/* IPV6_ROUTING_HELPER_H */
191
ns3::Ipv6RoutingHelper::~Ipv6RoutingHelper
virtual ~Ipv6RoutingHelper()
Destroy an Ipv6 Ipv6RoutingHelper.
Definition:
ipv6-routing-helper.cc:30
ns3::Time
keep track of time values and allow control of global simulation resolution
Definition:
nstime.h:81
ns3::Ptr
smart pointer class similar to boost::intrusive_ptr
Definition:
ptr.h:59
ns3::Ipv6RoutingHelper::Copy
virtual Ipv6RoutingHelper * Copy(void) const =0
virtual constructor
ns3::Ipv6RoutingHelper::GetRouting
static Ptr< T > GetRouting(Ptr< Ipv6RoutingProtocol > protocol)
Request a specified routing protocol
from Ipv6RoutingProtocol protocol.
Definition:
ipv6-routing-helper.h:165
ns3::Ipv6RoutingHelper::PrintRoutingTableAllEvery
void PrintRoutingTableAllEvery(Time printInterval, Ptr< OutputStreamWrapper > stream) const
prints the routing tables of all nodes at regular intervals specified by user.
Definition:
ipv6-routing-helper.cc:45
ns3::Ipv6RoutingHelper
A factory to create ns3::Ipv6RoutingProtocol objects.
Definition:
ipv6-routing-helper.h:43
ns3::Ipv6RoutingHelper::PrintRoutingTableAt
void PrintRoutingTableAt(Time printTime, Ptr< Node > node, Ptr< OutputStreamWrapper > stream) const
prints the routing tables of a node at a particular time.
Definition:
ipv6-routing-helper.cc:55
ns3::Ipv6RoutingHelper::Create
virtual Ptr< Ipv6RoutingProtocol > Create(Ptr< Node > node) const =0
ns3::Ipv6RoutingHelper::Print
void Print(Ptr< Node > node, Ptr< OutputStreamWrapper > stream) const
prints the routing tables of a node.
Definition:
ipv6-routing-helper.cc:67
ns3::Ipv6RoutingHelper::PrintEvery
void PrintEvery(Time printInterval, Ptr< Node > node, Ptr< OutputStreamWrapper > stream) const
prints the routing tables of a node at regular intervals specified by user.
Definition:
ipv6-routing-helper.cc:76
ns3::Ipv6RoutingHelper::PrintRoutingTableEvery
void PrintRoutingTableEvery(Time printInterval, Ptr< Node > node, Ptr< OutputStreamWrapper > stream) const
prints the routing tables of a node at regular intervals specified by user.
Definition:
ipv6-routing-helper.cc:61
ns3::Ipv6RoutingHelper::PrintRoutingTableAllAt
void PrintRoutingTableAllAt(Time printTime, Ptr< OutputStreamWrapper > stream) const
prints the routing tables of all nodes at a particular time.
Definition:
ipv6-routing-helper.cc:35
src
internet
helper
ipv6-routing-helper.h
Generated on Sat Apr 19 2014 14:06:55 for ns-3 by
1.8.6