A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::Ipv6RoutingTableEntry Class Reference

A record of an IPv6 route. More...

#include "ipv6-routing-table-entry.h"

+ Inheritance diagram for ns3::Ipv6RoutingTableEntry:
+ Collaboration diagram for ns3::Ipv6RoutingTableEntry:

Public Member Functions

 Ipv6RoutingTableEntry ()
 Constructor.
 
 Ipv6RoutingTableEntry (const Ipv6RoutingTableEntry &route)
 Copy constructor.
 
 Ipv6RoutingTableEntry (const Ipv6RoutingTableEntry *route)
 Copy constructor.
 
virtual ~Ipv6RoutingTableEntry ()
 Destructor.
 
Ipv6Address GetDest () const
 Get the destination.
 
Ipv6Address GetDestNetwork () const
 Get the destination network.
 
Ipv6Prefix GetDestNetworkPrefix () const
 Get the destination prefix.
 
Ipv6Address GetGateway () const
 Get the gateway.
 
uint32_t GetInterface () const
 Get the interface index.
 
Ipv6Address GetPrefixToUse () const
 Get the prefix to use (for multihomed link).
 
bool IsDefault () const
 Is it the default route ?
 
bool IsGateway () const
 Is it the gateway ?
 
bool IsHost () const
 Is the route entry correspond to a host ?
 
bool IsNetwork () const
 Is the route entry correspond to a network ?
 
void SetPrefixToUse (Ipv6Address prefix)
 Set the prefix to use.
 

Static Public Member Functions

static Ipv6RoutingTableEntry CreateDefaultRoute (Ipv6Address nextHop, uint32_t interface)
 Create a default route.
 
static Ipv6RoutingTableEntry CreateHostRouteTo (Ipv6Address dest, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse=Ipv6Address())
 Create a route to a host.
 
static Ipv6RoutingTableEntry CreateHostRouteTo (Ipv6Address dest, uint32_t interface)
 Create a route to a host.
 
static Ipv6RoutingTableEntry CreateNetworkRouteTo (Ipv6Address network, Ipv6Prefix networkPrefix, Ipv6Address nextHop, uint32_t interface)
 Create a route to a network.
 
static Ipv6RoutingTableEntry CreateNetworkRouteTo (Ipv6Address network, Ipv6Prefix networkPrefix, Ipv6Address nextHop, uint32_t interface, Ipv6Address prefixToUse)
 Create a route to a network.
 
static Ipv6RoutingTableEntry CreateNetworkRouteTo (Ipv6Address network, Ipv6Prefix networkPrefix, uint32_t interface)
 Create a route to a network.
 

Private Member Functions

 Ipv6RoutingTableEntry (Ipv6Address dest, Ipv6Address gateway, uint32_t interface)
 Constructor.
 
 Ipv6RoutingTableEntry (Ipv6Address dest, Ipv6Prefix prefix, uint32_t interface)
 Constructor.
 
 Ipv6RoutingTableEntry (Ipv6Address dest, uint32_t interface)
 Constructor.
 
 Ipv6RoutingTableEntry (Ipv6Address network, Ipv6Prefix prefix, Ipv6Address gateway, uint32_t interface)
 Constructor.
 
 Ipv6RoutingTableEntry (Ipv6Address network, Ipv6Prefix prefix, Ipv6Address gateway, uint32_t interface, Ipv6Address prefixToUse)
 Constructor.
 
 Ipv6RoutingTableEntry (Ipv6Address network, Ipv6Prefix prefix, uint32_t interface, Ipv6Address prefixToUse)
 Constructor.
 

Private Attributes

Ipv6Address m_dest
 IPv6 address of the destination.
 
Ipv6Prefix m_destNetworkPrefix
 IPv6 prefix of the destination.
 
Ipv6Address m_gateway
 IPv6 address of the gateway.
 
uint32_t m_interface
 The interface index.
 
Ipv6Address m_prefixToUse
 Prefix to use.
 

Detailed Description

A record of an IPv6 route.

Definition at line 37 of file ipv6-routing-table-entry.h.

Constructor & Destructor Documentation

◆ Ipv6RoutingTableEntry() [1/9]

ns3::Ipv6RoutingTableEntry::Ipv6RoutingTableEntry ( )

Constructor.

Definition at line 27 of file ipv6-routing-table-entry.cc.

Referenced by CreateDefaultRoute(), CreateHostRouteTo(), and CreateNetworkRouteTo().

+ Here is the caller graph for this function:

◆ Ipv6RoutingTableEntry() [2/9]

ns3::Ipv6RoutingTableEntry::Ipv6RoutingTableEntry ( const Ipv6RoutingTableEntry route)

Copy constructor.

Parameters
routethe route to copy

Definition at line 31 of file ipv6-routing-table-entry.cc.

◆ Ipv6RoutingTableEntry() [3/9]

ns3::Ipv6RoutingTableEntry::Ipv6RoutingTableEntry ( const Ipv6RoutingTableEntry route)

Copy constructor.

Parameters
routethe route to copy

Definition at line 40 of file ipv6-routing-table-entry.cc.

◆ ~Ipv6RoutingTableEntry()

ns3::Ipv6RoutingTableEntry::~Ipv6RoutingTableEntry ( )
virtual

Destructor.

Definition at line 117 of file ipv6-routing-table-entry.cc.

◆ Ipv6RoutingTableEntry() [4/9]

ns3::Ipv6RoutingTableEntry::Ipv6RoutingTableEntry ( Ipv6Address  network,
Ipv6Prefix  prefix,
Ipv6Address  gateway,
uint32_t  interface 
)
private

Constructor.

Parameters
networknetwork address
prefixnetwork prefix
gatewaythe gateway
interfacethe interface index

Definition at line 82 of file ipv6-routing-table-entry.cc.

◆ Ipv6RoutingTableEntry() [5/9]

ns3::Ipv6RoutingTableEntry::Ipv6RoutingTableEntry ( Ipv6Address  network,
Ipv6Prefix  prefix,
uint32_t  interface,
Ipv6Address  prefixToUse 
)
private

Constructor.

Parameters
networknetwork address
prefixnetwork prefix
interfacethe interface index
prefixToUseprefix to use

Definition at line 94 of file ipv6-routing-table-entry.cc.

◆ Ipv6RoutingTableEntry() [6/9]

ns3::Ipv6RoutingTableEntry::Ipv6RoutingTableEntry ( Ipv6Address  network,
Ipv6Prefix  prefix,
Ipv6Address  gateway,
uint32_t  interface,
Ipv6Address  prefixToUse 
)
private

Constructor.

Parameters
networknetwork address
prefixnetwork prefix
gatewaythe gateway
interfacethe interface index
prefixToUseprefix to use

Definition at line 69 of file ipv6-routing-table-entry.cc.

◆ Ipv6RoutingTableEntry() [7/9]

ns3::Ipv6RoutingTableEntry::Ipv6RoutingTableEntry ( Ipv6Address  dest,
Ipv6Prefix  prefix,
uint32_t  interface 
)
private

Constructor.

Parameters
destdestination address
prefixdestination prefix
interfaceinterface index

Definition at line 106 of file ipv6-routing-table-entry.cc.

◆ Ipv6RoutingTableEntry() [8/9]

ns3::Ipv6RoutingTableEntry::Ipv6RoutingTableEntry ( Ipv6Address  dest,
Ipv6Address  gateway,
uint32_t  interface 
)
private

Constructor.

Parameters
destdestination address
gatewaythe gateway
interfaceinterface index

Definition at line 49 of file ipv6-routing-table-entry.cc.

◆ Ipv6RoutingTableEntry() [9/9]

ns3::Ipv6RoutingTableEntry::Ipv6RoutingTableEntry ( Ipv6Address  dest,
uint32_t  interface 
)
private

Constructor.

Parameters
destdestination address
interfaceinterface index

Definition at line 60 of file ipv6-routing-table-entry.cc.

Member Function Documentation

◆ CreateDefaultRoute()

Ipv6RoutingTableEntry ns3::Ipv6RoutingTableEntry::CreateDefaultRoute ( Ipv6Address  nextHop,
uint32_t  interface 
)
static

Create a default route.

Parameters
nextHopnext hop address to route the packet
interfaceinterface index
Returns
IPv6Route object

Definition at line 224 of file ipv6-routing-table-entry.cc.

References Ipv6RoutingTableEntry(), and ns3::Ipv6Address::GetZero().

+ Here is the call graph for this function:

◆ CreateHostRouteTo() [1/2]

Ipv6RoutingTableEntry ns3::Ipv6RoutingTableEntry::CreateHostRouteTo ( Ipv6Address  dest,
Ipv6Address  nextHop,
uint32_t  interface,
Ipv6Address  prefixToUse = Ipv6Address() 
)
static

Create a route to a host.

Parameters
destdestination address
nextHopnext hop address to route the packet
interfaceinterface index
prefixToUseprefix that should be used for source address for this destination
Returns
IPv6Route object

Definition at line 182 of file ipv6-routing-table-entry.cc.

References Ipv6RoutingTableEntry(), and ns3::Ipv6Prefix::GetOnes().

+ Here is the call graph for this function:

◆ CreateHostRouteTo() [2/2]

Ipv6RoutingTableEntry ns3::Ipv6RoutingTableEntry::CreateHostRouteTo ( Ipv6Address  dest,
uint32_t  interface 
)
static

Create a route to a host.

Parameters
destdestination address
interfaceinterface index
Returns
IPv6Route object

Definition at line 191 of file ipv6-routing-table-entry.cc.

References Ipv6RoutingTableEntry().

+ Here is the call graph for this function:

◆ CreateNetworkRouteTo() [1/3]

Ipv6RoutingTableEntry ns3::Ipv6RoutingTableEntry::CreateNetworkRouteTo ( Ipv6Address  network,
Ipv6Prefix  networkPrefix,
Ipv6Address  nextHop,
uint32_t  interface 
)
static

Create a route to a network.

Parameters
networknetwork address
networkPrefixnetwork prefix
nextHopnext hop address to route the packet
interfaceinterface index
Returns
IPv6Route object

Definition at line 197 of file ipv6-routing-table-entry.cc.

References Ipv6RoutingTableEntry().

Referenced by ns3::Ipv6StaticRouting::AddNetworkRouteTo(), and ns3::Ipv6StaticRouting::SetDefaultMulticastRoute().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CreateNetworkRouteTo() [2/3]

Ipv6RoutingTableEntry ns3::Ipv6RoutingTableEntry::CreateNetworkRouteTo ( Ipv6Address  network,
Ipv6Prefix  networkPrefix,
Ipv6Address  nextHop,
uint32_t  interface,
Ipv6Address  prefixToUse 
)
static

Create a route to a network.

Parameters
networknetwork address
networkPrefixnetwork prefix
nextHopnext hop address to route the packet
interfaceinterface index
prefixToUseprefix that should be used for source address for this destination
Returns
IPv6Route object

Definition at line 206 of file ipv6-routing-table-entry.cc.

References Ipv6RoutingTableEntry().

+ Here is the call graph for this function:

◆ CreateNetworkRouteTo() [3/3]

Ipv6RoutingTableEntry ns3::Ipv6RoutingTableEntry::CreateNetworkRouteTo ( Ipv6Address  network,
Ipv6Prefix  networkPrefix,
uint32_t  interface 
)
static

Create a route to a network.

Parameters
networknetwork address
networkPrefixnetwork prefix
interfaceinterface index
Returns
IPv6Route object

Definition at line 216 of file ipv6-routing-table-entry.cc.

References Ipv6RoutingTableEntry().

+ Here is the call graph for this function:

◆ GetDest()

Ipv6Address ns3::Ipv6RoutingTableEntry::GetDest ( ) const

Get the destination.

Returns
the IPv6 address of the destination of this route

Definition at line 128 of file ipv6-routing-table-entry.cc.

References m_dest.

Referenced by ns3::RipNg::Lookup(), ns3::Ipv6StaticRouting::LookupRoute(), ns3::Ipv6StaticRouting::LookupStatic(), ns3::operator<<(), StackHelper::PrintRoutingTable(), ns3::Ipv6StaticRouting::PrintRoutingTable(), ns3::RipNg::PrintRoutingTable(), and ns3::Ipv6StaticRouting::RemoveRoute().

+ Here is the caller graph for this function:

◆ GetDestNetwork()

Ipv6Address ns3::Ipv6RoutingTableEntry::GetDestNetwork ( ) const

Get the destination network.

Returns
the destination network

Definition at line 158 of file ipv6-routing-table-entry.cc.

References m_dest.

Referenced by ns3::Ipv6StaticRouting::GetDefaultRoute(), ns3::Ipv6StaticRouting::HasNetworkDest(), ns3::RipNg::Lookup(), ns3::Ipv6StaticRouting::LookupStatic(), ns3::Ipv6StaticRouting::NotifyRemoveRoute(), and ns3::operator<<().

+ Here is the caller graph for this function:

◆ GetDestNetworkPrefix()

Ipv6Prefix ns3::Ipv6RoutingTableEntry::GetDestNetworkPrefix ( ) const

Get the destination prefix.

Returns
the destination prefix

Definition at line 164 of file ipv6-routing-table-entry.cc.

References m_destNetworkPrefix.

Referenced by ns3::Ipv6StaticRouting::GetDefaultRoute(), ns3::Ipv6StaticRouting::HasNetworkDest(), ns3::RipNg::Lookup(), ns3::Ipv6StaticRouting::LookupRoute(), ns3::Ipv6StaticRouting::LookupStatic(), ns3::Ipv6StaticRouting::NotifyRemoveRoute(), ns3::operator<<(), ns3::Ipv6StaticRouting::PrintRoutingTable(), and ns3::RipNg::PrintRoutingTable().

+ Here is the caller graph for this function:

◆ GetGateway()

Ipv6Address ns3::Ipv6RoutingTableEntry::GetGateway ( ) const

Get the gateway.

Returns
the IPv6 address of the gateway

Definition at line 176 of file ipv6-routing-table-entry.cc.

References m_gateway.

Referenced by ns3::RipNg::Lookup(), ns3::Ipv6StaticRouting::LookupRoute(), ns3::Ipv6StaticRouting::LookupStatic(), ns3::operator<<(), StackHelper::PrintRoutingTable(), ns3::Ipv6StaticRouting::PrintRoutingTable(), and ns3::RipNg::PrintRoutingTable().

+ Here is the caller graph for this function:

◆ GetInterface()

uint32_t ns3::Ipv6RoutingTableEntry::GetInterface ( ) const

Get the interface index.

Returns
the index of the interface

Definition at line 230 of file ipv6-routing-table-entry.cc.

References m_interface.

Referenced by ns3::Ipv6StaticRouting::HasNetworkDest(), ns3::RipNg::Lookup(), ns3::Ipv6StaticRouting::LookupRoute(), ns3::Ipv6StaticRouting::LookupStatic(), ns3::Ipv6StaticRouting::NotifyRemoveRoute(), ns3::operator<<(), StackHelper::PrintRoutingTable(), ns3::Ipv6StaticRouting::PrintRoutingTable(), ns3::RipNg::PrintRoutingTable(), and ns3::Ipv6StaticRouting::RemoveRoute().

+ Here is the caller graph for this function:

◆ GetPrefixToUse()

Ipv6Address ns3::Ipv6RoutingTableEntry::GetPrefixToUse ( ) const

Get the prefix to use (for multihomed link).

Returns
prefix address to use

Definition at line 134 of file ipv6-routing-table-entry.cc.

References m_prefixToUse.

Referenced by ns3::RipNg::Lookup(), ns3::Ipv6StaticRouting::LookupRoute(), ns3::Ipv6StaticRouting::LookupStatic(), StackHelper::PrintRoutingTable(), and ns3::Ipv6StaticRouting::RemoveRoute().

+ Here is the caller graph for this function:

◆ IsDefault()

bool ns3::Ipv6RoutingTableEntry::IsDefault ( ) const

Is it the default route ?

Returns
true if this route is a default route, false otherwise

Definition at line 152 of file ipv6-routing-table-entry.cc.

References ns3::Ipv6Address::GetZero(), and m_dest.

Referenced by ns3::operator<<().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsGateway()

bool ns3::Ipv6RoutingTableEntry::IsGateway ( ) const

Is it the gateway ?

Returns
true if this route is a gateway, false otherwise

Definition at line 170 of file ipv6-routing-table-entry.cc.

References ns3::Ipv6Address::GetZero(), and m_gateway.

Referenced by ns3::operator<<(), ns3::Ipv6StaticRouting::PrintRoutingTable(), and ns3::RipNg::PrintRoutingTable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsHost()

bool ns3::Ipv6RoutingTableEntry::IsHost ( ) const

Is the route entry correspond to a host ?

Returns
true if the route is a host, false otherwise

Definition at line 122 of file ipv6-routing-table-entry.cc.

References ns3::Ipv6Prefix::GetOnes(), and m_destNetworkPrefix.

Referenced by IsNetwork(), ns3::operator<<(), ns3::Ipv6StaticRouting::PrintRoutingTable(), and ns3::RipNg::PrintRoutingTable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsNetwork()

bool ns3::Ipv6RoutingTableEntry::IsNetwork ( ) const

Is the route entry correspond to a network ?

Returns
true if the route is a network, false otherwise

Definition at line 146 of file ipv6-routing-table-entry.cc.

References IsHost().

Referenced by ns3::operator<<().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetPrefixToUse()

void ns3::Ipv6RoutingTableEntry::SetPrefixToUse ( Ipv6Address  prefix)

Set the prefix to use.

Parameters
prefixprefix to use

Definition at line 140 of file ipv6-routing-table-entry.cc.

References m_prefixToUse.

Member Data Documentation

◆ m_dest

Ipv6Address ns3::Ipv6RoutingTableEntry::m_dest
private

IPv6 address of the destination.

Definition at line 261 of file ipv6-routing-table-entry.h.

Referenced by GetDest(), GetDestNetwork(), and IsDefault().

◆ m_destNetworkPrefix

Ipv6Prefix ns3::Ipv6RoutingTableEntry::m_destNetworkPrefix
private

IPv6 prefix of the destination.

Definition at line 266 of file ipv6-routing-table-entry.h.

Referenced by GetDestNetworkPrefix(), and IsHost().

◆ m_gateway

Ipv6Address ns3::Ipv6RoutingTableEntry::m_gateway
private

IPv6 address of the gateway.

Definition at line 271 of file ipv6-routing-table-entry.h.

Referenced by GetGateway(), and IsGateway().

◆ m_interface

uint32_t ns3::Ipv6RoutingTableEntry::m_interface
private

The interface index.

Definition at line 276 of file ipv6-routing-table-entry.h.

Referenced by GetInterface().

◆ m_prefixToUse

Ipv6Address ns3::Ipv6RoutingTableEntry::m_prefixToUse
private

Prefix to use.

Definition at line 281 of file ipv6-routing-table-entry.h.

Referenced by GetPrefixToUse(), and SetPrefixToUse().


The documentation for this class was generated from the following files: