10#ifndef GLOBAL_ROUTE_MANAGER_H
11#define GLOBAL_ROUTE_MANAGER_H
15#include "ns3/ipv4-routing-helper.h"
16#include "ns3/ipv6-routing-helper.h"
54 static_assert(std::is_same_v<T, Ipv4Manager> || std::is_same_v<T, Ipv6Manager>,
55 "T must be either Ipv4Manager or Ipv6Manager when calling GlobalRouteManager");
57 static constexpr bool IsIpv4 = std::is_same_v<Ipv4Manager, T>;
60 using Ip =
typename std::conditional_t<IsIpv4, Ipv4, Ipv6>;
63 using IpAddress =
typename std::conditional_t<IsIpv4, Ipv4Address, Ipv6Address>;
66 using IpManager =
typename std::conditional_t<IsIpv4, Ipv4Manager, Ipv6Manager>;
123 bool nodeIdLookup =
true,
136 bool nodeIdLookup =
true,
151 bool nodeIdLookup =
true,
164 bool nodeIdLookup =
true,
static void PrintRoute(Ptr< Node > sourceNode, Ptr< Node > dest, Ptr< OutputStreamWrapper > stream, bool nodeIdLookup=true, Time::Unit unit=Time::S)
prints the path from this node to the destination node at a particular time.
typename std::conditional_t< IsIpv4, Ipv4Manager, Ipv6Manager > IpManager
Alias for Ipv4Manager and Ipv6Manager classes.
static constexpr bool IsIpv4
typename std::conditional_t< IsIpv4, Ipv4, Ipv6 > Ip
Alias for Ipv4 and Ipv6 classes.
typename std::conditional_t< IsIpv4, Ipv4Address, Ipv6Address > IpAddress
Alias for Ipv4Address and Ipv6Address classes.
static void ResetRouterId()
Reset the router ID counter to zero.
static void PrintRoute(Ptr< Node > sourceNode, Ptr< Node > dest, bool nodeIdLookup=true, Time::Unit unit=Time::S)
prints the path from this node to the destination node at a particular time.
GlobalRouteManager & operator=(const GlobalRouteManager< T > &)=delete
static void BuildGlobalRoutingDatabase()
Build the routing database by gathering Link State Advertisements from each node exporting a GlobalRo...
static void PrintRoute(Ptr< Node > sourceNode, IpAddress dest, Ptr< OutputStreamWrapper > stream, bool nodeIdLookup=true, Time::Unit unit=Time::S)
prints the path from this node to the destination node at a particular time.
static void PrintRoute(Ptr< Node > sourceNode, IpAddress dest, bool nodeIdLookup=true, Time::Unit unit=Time::S)
prints the path from this node to the destination node at a particular time.
static void InitializeRoutes()
Compute routes using a Dijkstra SPF computation and populate per-node forwarding tables.
static void DeleteGlobalRoutes()
Delete all static routes on all nodes that have a GlobalRouterInterface.
GlobalRouteManager(const GlobalRouteManager< T > &)=delete
static uint32_t AllocateRouterId()
Allocate a 32-bit router ID from monotonically increasing counter.
static void InitializeRouters()
initialize all nodes as routers.
Smart pointer class similar to boost::intrusive_ptr.
Unit
The unit to use to interpret a number representing time.
GlobalRouteManager< Ipv4Manager > Ipv4GlobalRouteManager
Create the typedef Ipv4GlobalRouting with T as Ipv4RoutingProtocol.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Empty struct used as a template parameter.
Empty struct used as a template parameter.