A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
ipv6-global-routing-helper.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2008 INRIA
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7
*/
8
#include "
ipv6-global-routing-helper.h
"
9
10
#include "ns3/global-router-interface.h"
11
#include "ns3/global-routing.h"
12
#include "ns3/ipv6-list-routing.h"
13
#include "ns3/log.h"
14
15
namespace
ns3
16
{
17
18
NS_LOG_COMPONENT_DEFINE
(
"Ipv6GlobalRoutingHelper"
);
19
20
Ipv6GlobalRoutingHelper::Ipv6GlobalRoutingHelper
()
21
{
22
}
23
24
Ipv6GlobalRoutingHelper::Ipv6GlobalRoutingHelper
(
const
Ipv6GlobalRoutingHelper
& o)
25
{
26
}
27
28
Ipv6GlobalRoutingHelper
*
29
Ipv6GlobalRoutingHelper::Copy
()
const
30
{
31
return
new
Ipv6GlobalRoutingHelper
(*
this
);
32
}
33
34
Ptr<Ipv6RoutingProtocol>
35
Ipv6GlobalRoutingHelper::Create
(
Ptr<Node>
node)
const
36
{
37
NS_LOG_LOGIC
(
"Adding GlobalRouter interface to node "
<< node->GetId());
38
39
Ptr<GlobalRouter<Ipv6Manager>
> globalRouter =
CreateObject<GlobalRouter<Ipv6Manager>
>();
40
node->AggregateObject(globalRouter);
41
42
NS_LOG_LOGIC
(
"Adding GlobalRouting Protocol to node "
<< node->GetId());
43
Ptr<GlobalRouting<Ipv6RoutingProtocol>
> globalRouting =
44
CreateObject<GlobalRouting<Ipv6RoutingProtocol>
>();
45
globalRouter->SetRoutingProtocol(globalRouting);
46
47
return
globalRouting;
48
}
49
50
void
51
Ipv6GlobalRoutingHelper::PopulateRoutingTables
()
52
{
53
GlobalRouteManager<Ipv6Manager>::InitializeRouters
();
54
GlobalRouteManager<Ipv6Manager>::BuildGlobalRoutingDatabase
();
55
GlobalRouteManager<Ipv6Manager>::InitializeRoutes
();
56
}
57
58
void
59
Ipv6GlobalRoutingHelper::RecomputeRoutingTables
()
60
{
61
GlobalRouteManager<Ipv6Manager>::DeleteGlobalRoutes
();
62
GlobalRouteManager<Ipv6Manager>::BuildGlobalRoutingDatabase
();
63
GlobalRouteManager<Ipv6Manager>::InitializeRoutes
();
64
}
65
66
}
// namespace ns3
ns3::GlobalRouteManager::BuildGlobalRoutingDatabase
static void BuildGlobalRoutingDatabase()
Build the routing database by gathering Link State Advertisements from each node exporting a GlobalRo...
Definition
global-route-manager.cc:44
ns3::GlobalRouteManager::InitializeRoutes
static void InitializeRoutes()
Compute routes using a Dijkstra SPF computation and populate per-node forwarding tables.
Definition
global-route-manager.cc:53
ns3::GlobalRouteManager::DeleteGlobalRoutes
static void DeleteGlobalRoutes()
Delete all static routes on all nodes that have a GlobalRouterInterface.
Definition
global-route-manager.cc:35
ns3::GlobalRouteManager::InitializeRouters
static void InitializeRouters()
initialize all nodes as routers.
Definition
global-route-manager.cc:147
ns3::Ipv6GlobalRoutingHelper
Helper class that adds ns3::Ipv4GlobalRouting objects.
Definition
ipv6-global-routing-helper.h:24
ns3::Ipv6GlobalRoutingHelper::Copy
Ipv6GlobalRoutingHelper * Copy() const override
Definition
ipv6-global-routing-helper.cc:29
ns3::Ipv6GlobalRoutingHelper::RecomputeRoutingTables
static void RecomputeRoutingTables()
Remove all routes that were previously installed in a prior call to either PopulateRoutingTables() or...
Definition
ipv6-global-routing-helper.cc:59
ns3::Ipv6GlobalRoutingHelper::Ipv6GlobalRoutingHelper
Ipv6GlobalRoutingHelper()
Construct a GlobalRoutingHelper to make life easier for managing global routing tasks.
Definition
ipv6-global-routing-helper.cc:20
ns3::Ipv6GlobalRoutingHelper::Create
Ptr< Ipv6RoutingProtocol > Create(Ptr< Node > node) const override
Definition
ipv6-global-routing-helper.cc:35
ns3::Ipv6GlobalRoutingHelper::PopulateRoutingTables
static void PopulateRoutingTables()
Build a routing database and initialize the routing tables of the nodes in the simulation.
Definition
ipv6-global-routing-helper.cc:51
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
ptr.h:70
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition
log.h:194
NS_LOG_LOGIC
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition
log.h:274
ns3::CreateObject
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition
object.h:627
ipv6-global-routing-helper.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
internet
helper
ipv6-global-routing-helper.cc
Generated on
for ns-3 by
1.15.0