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
ipv4-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 "
ipv4-global-routing-helper.h
"
9
10
#include "ns3/global-router-interface.h"
11
#include "ns3/ipv4-global-routing.h"
12
#include "ns3/ipv4-list-routing.h"
13
#include "ns3/log.h"
14
15
namespace
ns3
16
{
17
18
NS_LOG_COMPONENT_DEFINE
(
"GlobalRoutingHelper"
);
19
20
Ipv4GlobalRoutingHelper::Ipv4GlobalRoutingHelper
()
21
{
22
}
23
24
Ipv4GlobalRoutingHelper::Ipv4GlobalRoutingHelper
(
const
Ipv4GlobalRoutingHelper
& o)
25
{
26
}
27
28
Ipv4GlobalRoutingHelper
*
29
Ipv4GlobalRoutingHelper::Copy
()
const
30
{
31
return
new
Ipv4GlobalRoutingHelper
(*
this
);
32
}
33
34
Ptr<Ipv4RoutingProtocol>
35
Ipv4GlobalRoutingHelper::Create
(
Ptr<Node>
node)
const
36
{
37
NS_LOG_LOGIC
(
"Adding GlobalRouter interface to node "
<< node->GetId());
38
39
Ptr<GlobalRouter>
globalRouter =
CreateObject<GlobalRouter>
();
40
node->AggregateObject(globalRouter);
41
42
NS_LOG_LOGIC
(
"Adding GlobalRouting Protocol to node "
<< node->GetId());
43
Ptr<Ipv4GlobalRouting>
globalRouting =
CreateObject<Ipv4GlobalRouting>
();
44
globalRouter->SetRoutingProtocol(globalRouting);
45
46
return
globalRouting;
47
}
48
49
void
50
Ipv4GlobalRoutingHelper::PopulateRoutingTables
()
51
{
52
GlobalRouteManager::BuildGlobalRoutingDatabase
();
53
GlobalRouteManager::InitializeRoutes
();
54
}
55
56
void
57
Ipv4GlobalRoutingHelper::RecomputeRoutingTables
()
58
{
59
GlobalRouteManager::DeleteGlobalRoutes
();
60
GlobalRouteManager::BuildGlobalRoutingDatabase
();
61
GlobalRouteManager::InitializeRoutes
();
62
}
63
64
}
// namespace ns3
ns3::GlobalRouteManager::DeleteGlobalRoutes
static void DeleteGlobalRoutes()
Delete all static routes on all nodes that have a GlobalRouterInterface.
Definition
global-route-manager.cc:29
ns3::GlobalRouteManager::InitializeRoutes
static void InitializeRoutes()
Compute routes using a Dijkstra SPF computation and populate per-node forwarding tables.
Definition
global-route-manager.cc:43
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:36
ns3::Ipv4GlobalRoutingHelper
Helper class that adds ns3::Ipv4GlobalRouting objects.
Definition
ipv4-global-routing-helper.h:24
ns3::Ipv4GlobalRoutingHelper::PopulateRoutingTables
static void PopulateRoutingTables()
Build a routing database and initialize the routing tables of the nodes in the simulation.
Definition
ipv4-global-routing-helper.cc:50
ns3::Ipv4GlobalRoutingHelper::RecomputeRoutingTables
static void RecomputeRoutingTables()
Remove all routes that were previously installed in a prior call to either PopulateRoutingTables() or...
Definition
ipv4-global-routing-helper.cc:57
ns3::Ipv4GlobalRoutingHelper::Create
Ptr< Ipv4RoutingProtocol > Create(Ptr< Node > node) const override
Definition
ipv4-global-routing-helper.cc:35
ns3::Ipv4GlobalRoutingHelper::Ipv4GlobalRoutingHelper
Ipv4GlobalRoutingHelper()
Construct a GlobalRoutingHelper to make life easier for managing global routing tasks.
Definition
ipv4-global-routing-helper.cc:20
ns3::Ipv4GlobalRoutingHelper::Copy
Ipv4GlobalRoutingHelper * Copy() const override
Definition
ipv4-global-routing-helper.cc:29
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
NS_LOG_COMPONENT_DEFINE
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition
log.h:191
NS_LOG_LOGIC
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition
log.h:271
ns3::CreateObject
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition
object.h:619
ipv4-global-routing-helper.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
src
internet
helper
ipv4-global-routing-helper.cc
Generated on Fri Nov 8 2024 13:59:00 for ns-3 by
1.11.0