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.cc
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
#include "ns3/node.h"
22
#include "ns3/node-list.h"
23
#include "ns3/simulator.h"
24
#include "ns3/ipv6-routing-protocol.h"
25
#include "
ipv6-routing-helper.h
"
26
27
namespace
ns3 {
28
29
Ipv6RoutingHelper::~Ipv6RoutingHelper
()
30
{
31
}
32
33
void
34
Ipv6RoutingHelper::PrintRoutingTableAllAt
(
Time
printTime,
Ptr<OutputStreamWrapper>
stream)
const
35
{
36
for
(uint32_t i = 0; i <
NodeList::GetNNodes
(); i++)
37
{
38
Ptr<Node>
node =
NodeList::GetNode
(i);
39
Simulator::Schedule
(printTime, &
Ipv6RoutingHelper::Print
,
this
, node, stream);
40
}
41
}
42
43
void
44
Ipv6RoutingHelper::PrintRoutingTableAllEvery
(
Time
printInterval,
Ptr<OutputStreamWrapper>
stream)
const
45
{
46
for
(uint32_t i = 0; i <
NodeList::GetNNodes
(); i++)
47
{
48
Ptr<Node>
node =
NodeList::GetNode
(i);
49
Simulator::Schedule
(printInterval, &
Ipv6RoutingHelper::PrintEvery
,
this
, printInterval, node, stream);
50
}
51
}
52
53
void
54
Ipv6RoutingHelper::PrintRoutingTableAt
(
Time
printTime,
Ptr<Node>
node,
Ptr<OutputStreamWrapper>
stream)
const
55
{
56
Simulator::Schedule
(printTime, &
Ipv6RoutingHelper::Print
,
this
, node, stream);
57
}
58
59
void
60
Ipv6RoutingHelper::PrintRoutingTableEvery
(
Time
printInterval,
Ptr<Node>
node,
Ptr<OutputStreamWrapper>
stream)
const
61
{
62
Simulator::Schedule
(printInterval, &
Ipv6RoutingHelper::PrintEvery
,
this
, printInterval, node, stream);
63
}
64
65
void
66
Ipv6RoutingHelper::Print
(
Ptr<Node>
node,
Ptr<OutputStreamWrapper>
stream)
const
67
{
68
Ptr<Ipv6>
ipv6 = node->
GetObject
<
Ipv6
> ();
69
Ptr<Ipv6RoutingProtocol>
rp = ipv6->
GetRoutingProtocol
();
70
NS_ASSERT
(rp);
71
rp->PrintRoutingTable (stream);
72
}
73
74
void
75
Ipv6RoutingHelper::PrintEvery
(
Time
printInterval,
Ptr<Node>
node,
Ptr<OutputStreamWrapper>
stream)
const
76
{
77
Ptr<Ipv6>
ipv6 = node->
GetObject
<
Ipv6
> ();
78
Ptr<Ipv6RoutingProtocol>
rp = ipv6->
GetRoutingProtocol
();
79
NS_ASSERT
(rp);
80
rp->PrintRoutingTable (stream);
81
Simulator::Schedule
(printInterval, &
Ipv6RoutingHelper::PrintEvery
,
this
, printInterval, node, stream);
82
}
83
84
}
// namespace ns3
src
internet
helper
ipv6-routing-helper.cc
Generated on Tue Nov 13 2012 10:32:13 for ns-3 by
1.8.1.2