A Discrete-Event Network Simulator
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 */
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
15namespace ns3
16{
17
18NS_LOG_COMPONENT_DEFINE("GlobalRoutingHelper");
19
23
27
30{
31 return new Ipv4GlobalRoutingHelper(*this);
32}
33
36{
37 NS_LOG_LOGIC("Adding GlobalRouter interface to node " << node->GetId());
38
40 node->AggregateObject(globalRouter);
41
42 NS_LOG_LOGIC("Adding GlobalRouting Protocol to node " << node->GetId());
44 globalRouter->SetRoutingProtocol(globalRouting);
45
46 return globalRouting;
47}
48
49void
55
56void
63
64} // namespace ns3
static void DeleteGlobalRoutes()
Delete all static routes on all nodes that have a GlobalRouterInterface.
static void InitializeRoutes()
Compute routes using a Dijkstra SPF computation and populate per-node forwarding tables.
static void BuildGlobalRoutingDatabase()
Build the routing database by gathering Link State Advertisements from each node exporting a GlobalRo...
Helper class that adds ns3::Ipv4GlobalRouting objects.
static void PopulateRoutingTables()
Build a routing database and initialize the routing tables of the nodes in the simulation.
static void RecomputeRoutingTables()
Remove all routes that were previously installed in a prior call to either PopulateRoutingTables() or...
Ptr< Ipv4RoutingProtocol > Create(Ptr< Node > node) const override
Ipv4GlobalRoutingHelper()
Construct a GlobalRoutingHelper to make life easier for managing global routing tasks.
Ipv4GlobalRoutingHelper * Copy() const override
Smart pointer class similar to boost::intrusive_ptr.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition log.h:271
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:619
Every class exported by the ns3 library is enclosed in the ns3 namespace.