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

A record of an IPv4 routing table entry for Ipv4GlobalRouting and Ipv4StaticRouting. More...

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

+ Inheritance diagram for ns3::Ipv4RoutingTableEntry:
+ Collaboration diagram for ns3::Ipv4RoutingTableEntry:

Public Member Functions

 Ipv4RoutingTableEntry ()
 This constructor does nothing.
 
 Ipv4RoutingTableEntry (const Ipv4RoutingTableEntry &route)
 Copy Constructor.
 
 Ipv4RoutingTableEntry (const Ipv4RoutingTableEntry *route)
 Copy Constructor.
 
Ipv4Address GetDest () const
 
Ipv4Address GetDestNetwork () const
 
Ipv4Mask GetDestNetworkMask () const
 
Ipv4Address GetGateway () const
 
uint32_t GetInterface () const
 
bool IsDefault () const
 
bool IsGateway () const
 
bool IsHost () const
 
bool IsNetwork () const
 

Static Public Member Functions

static Ipv4RoutingTableEntry CreateDefaultRoute (Ipv4Address nextHop, uint32_t interface)
 
static Ipv4RoutingTableEntry CreateHostRouteTo (Ipv4Address dest, Ipv4Address nextHop, uint32_t interface)
 
static Ipv4RoutingTableEntry CreateHostRouteTo (Ipv4Address dest, uint32_t interface)
 
static Ipv4RoutingTableEntry CreateNetworkRouteTo (Ipv4Address network, Ipv4Mask networkMask, Ipv4Address nextHop, uint32_t interface)
 
static Ipv4RoutingTableEntry CreateNetworkRouteTo (Ipv4Address network, Ipv4Mask networkMask, uint32_t interface)
 

Private Member Functions

 Ipv4RoutingTableEntry (Ipv4Address dest, Ipv4Address gateway, uint32_t interface)
 Constructor.
 
 Ipv4RoutingTableEntry (Ipv4Address dest, Ipv4Mask mask, uint32_t interface)
 Constructor.
 
 Ipv4RoutingTableEntry (Ipv4Address dest, uint32_t interface)
 Constructor.
 
 Ipv4RoutingTableEntry (Ipv4Address network, Ipv4Mask mask, Ipv4Address gateway, uint32_t interface)
 Constructor.
 

Private Attributes

Ipv4Address m_dest
 destination address
 
Ipv4Mask m_destNetworkMask
 destination network mask
 
Ipv4Address m_gateway
 gateway
 
uint32_t m_interface
 output interface
 

Detailed Description

A record of an IPv4 routing table entry for Ipv4GlobalRouting and Ipv4StaticRouting.

This is not a reference counted object.

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

Constructor & Destructor Documentation

◆ Ipv4RoutingTableEntry() [1/7]

ns3::Ipv4RoutingTableEntry::Ipv4RoutingTableEntry ( )

This constructor does nothing.

Definition at line 34 of file ipv4-routing-table-entry.cc.

References NS_LOG_FUNCTION.

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

+ Here is the caller graph for this function:

◆ Ipv4RoutingTableEntry() [2/7]

ns3::Ipv4RoutingTableEntry::Ipv4RoutingTableEntry ( const Ipv4RoutingTableEntry route)

Copy Constructor.

Parameters
routeThe route to copy

Definition at line 39 of file ipv4-routing-table-entry.cc.

References NS_LOG_FUNCTION.

◆ Ipv4RoutingTableEntry() [3/7]

ns3::Ipv4RoutingTableEntry::Ipv4RoutingTableEntry ( const Ipv4RoutingTableEntry route)

Copy Constructor.

Parameters
routeThe route to copy

Definition at line 48 of file ipv4-routing-table-entry.cc.

References NS_LOG_FUNCTION.

◆ Ipv4RoutingTableEntry() [4/7]

ns3::Ipv4RoutingTableEntry::Ipv4RoutingTableEntry ( Ipv4Address  network,
Ipv4Mask  mask,
Ipv4Address  gateway,
uint32_t  interface 
)
private

Constructor.

Parameters
networknetwork address
masknetwork mask
gatewaythe gateway
interfacethe interface index

Definition at line 75 of file ipv4-routing-table-entry.cc.

References NS_LOG_FUNCTION.

◆ Ipv4RoutingTableEntry() [5/7]

ns3::Ipv4RoutingTableEntry::Ipv4RoutingTableEntry ( Ipv4Address  dest,
Ipv4Mask  mask,
uint32_t  interface 
)
private

Constructor.

Parameters
destdestination address
masknetwork mask
interfacethe interface index

Definition at line 87 of file ipv4-routing-table-entry.cc.

References NS_LOG_FUNCTION.

◆ Ipv4RoutingTableEntry() [6/7]

ns3::Ipv4RoutingTableEntry::Ipv4RoutingTableEntry ( Ipv4Address  dest,
Ipv4Address  gateway,
uint32_t  interface 
)
private

Constructor.

Parameters
destdestination address
gatewaythe gateway
interfacethe interface index

Definition at line 57 of file ipv4-routing-table-entry.cc.

◆ Ipv4RoutingTableEntry() [7/7]

ns3::Ipv4RoutingTableEntry::Ipv4RoutingTableEntry ( Ipv4Address  dest,
uint32_t  interface 
)
private

Constructor.

Parameters
destdestination address
interfacethe interface index

Definition at line 67 of file ipv4-routing-table-entry.cc.

Member Function Documentation

◆ CreateDefaultRoute()

Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateDefaultRoute ( Ipv4Address  nextHop,
uint32_t  interface 
)
static
Returns
An Ipv4RoutingTableEntry object corresponding to the input parameters. This route is distinguished; it will match any destination for which a more specific route does not exist.
Parameters
nextHopIpv4Address of the next hop
interfaceOutgoing interface

Definition at line 195 of file ipv4-routing-table-entry.cc.

References Ipv4RoutingTableEntry(), ns3::Ipv4Address::GetZero(), ns3::Ipv4Mask::GetZero(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ CreateHostRouteTo() [1/2]

Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateHostRouteTo ( Ipv4Address  dest,
Ipv4Address  nextHop,
uint32_t  interface 
)
static
Returns
An Ipv4RoutingTableEntry object corresponding to the input parameters.
Parameters
destIpv4Address of the destination
nextHopIpv4Address of the next hop
interfaceOutgoing interface

Definition at line 162 of file ipv4-routing-table-entry.cc.

References Ipv4RoutingTableEntry(), and NS_LOG_FUNCTION.

Referenced by ns3::Ipv4GlobalRouting::AddHostRouteTo().

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

◆ CreateHostRouteTo() [2/2]

Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateHostRouteTo ( Ipv4Address  dest,
uint32_t  interface 
)
static
Returns
An Ipv4RoutingTableEntry object corresponding to the input parameters.
Parameters
destIpv4Address of the destination
interfaceOutgoing interface

Definition at line 169 of file ipv4-routing-table-entry.cc.

References Ipv4RoutingTableEntry(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ CreateNetworkRouteTo() [1/2]

Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateNetworkRouteTo ( Ipv4Address  network,
Ipv4Mask  networkMask,
Ipv4Address  nextHop,
uint32_t  interface 
)
static
Returns
An Ipv4RoutingTableEntry object corresponding to the input parameters.
Parameters
networkIpv4Address of the destination network
networkMaskIpv4Mask of the destination network mask
nextHopIpv4Address of the next hop
interfaceOutgoing interface

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

References Ipv4RoutingTableEntry(), and NS_LOG_FUNCTION.

Referenced by ns3::Ipv4GlobalRouting::AddASExternalRouteTo(), ns3::Ipv4GlobalRouting::AddNetworkRouteTo(), ns3::Ipv4StaticRouting::AddNetworkRouteTo(), ns3::GlobalRouter::InjectRoute(), and ns3::Ipv4StaticRouting::SetDefaultMulticastRoute().

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

◆ CreateNetworkRouteTo() [2/2]

Ipv4RoutingTableEntry ns3::Ipv4RoutingTableEntry::CreateNetworkRouteTo ( Ipv4Address  network,
Ipv4Mask  networkMask,
uint32_t  interface 
)
static
Returns
An Ipv4RoutingTableEntry object corresponding to the input parameters.
Parameters
networkIpv4Address of the destination network
networkMaskIpv4Mask of the destination network mask
interfaceOutgoing interface

Definition at line 186 of file ipv4-routing-table-entry.cc.

References Ipv4RoutingTableEntry(), and NS_LOG_FUNCTION.

+ Here is the call graph for this function:

◆ GetDest()

Ipv4Address ns3::Ipv4RoutingTableEntry::GetDest ( ) const
Returns
The IPv4 address of the destination of this route

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

References m_dest, and NS_LOG_FUNCTION.

Referenced by LinkTest::DoRun(), LanTest::DoRun(), TwoLinkTest::DoRun(), TwoLanTest::DoRun(), BridgeTest::DoRun(), TwoBridgeTest::DoRun(), ns3::Rip::Lookup(), ns3::Ipv4GlobalRouting::LookupGlobal(), ns3::Ipv4StaticRouting::LookupRoute(), ns3::Ipv4StaticRouting::LookupStatic(), ns3::operator<<(), ns3::operator==(), ns3::Ipv4GlobalRouting::PrintRoutingTable(), ns3::Ipv4StaticRouting::PrintRoutingTable(), and ns3::Rip::PrintRoutingTable().

+ Here is the caller graph for this function:

◆ GetDestNetwork()

Ipv4Address ns3::Ipv4RoutingTableEntry::GetDestNetwork ( ) const
Returns
The IPv4 network number of the destination of this route

Definition at line 127 of file ipv4-routing-table-entry.cc.

References m_dest, and NS_LOG_FUNCTION.

Referenced by ns3::Rip::Lookup(), ns3::operator<<(), ns3::olsr::RoutingProtocol::RoutingTableComputation(), and ns3::olsr::RoutingProtocol::SetRoutingTableAssociation().

+ Here is the caller graph for this function:

◆ GetDestNetworkMask()

Ipv4Mask ns3::Ipv4RoutingTableEntry::GetDestNetworkMask ( ) const
Returns
The IPv4 network mask of the destination of this route

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

References m_destNetworkMask, and NS_LOG_FUNCTION.

Referenced by ns3::Rip::Lookup(), ns3::Ipv4StaticRouting::LookupRoute(), ns3::operator<<(), ns3::operator==(), ns3::Ipv4GlobalRouting::PrintRoutingTable(), ns3::Ipv4StaticRouting::PrintRoutingTable(), ns3::Rip::PrintRoutingTable(), ns3::olsr::RoutingProtocol::RoutingTableComputation(), and ns3::olsr::RoutingProtocol::SetRoutingTableAssociation().

+ Here is the caller graph for this function:

◆ GetGateway()

Ipv4Address ns3::Ipv4RoutingTableEntry::GetGateway ( ) const

◆ GetInterface()

uint32_t ns3::Ipv4RoutingTableEntry::GetInterface ( ) const
Returns
The Ipv4 interface number used for sending outgoing packets

Definition at line 155 of file ipv4-routing-table-entry.cc.

References m_interface, and NS_LOG_FUNCTION.

Referenced by ns3::Rip::Lookup(), ns3::Ipv4GlobalRouting::LookupGlobal(), ns3::Ipv4StaticRouting::LookupRoute(), ns3::Ipv4StaticRouting::LookupStatic(), ns3::operator<<(), ns3::operator==(), ns3::Ipv4GlobalRouting::PrintRoutingTable(), ns3::Ipv4StaticRouting::PrintRoutingTable(), ns3::Rip::PrintRoutingTable(), and ns3::olsr::RoutingProtocol::UsesNonOlsrOutgoingInterface().

+ Here is the caller graph for this function:

◆ IsDefault()

bool ns3::Ipv4RoutingTableEntry::IsDefault ( ) const
Returns
True if this route is a default route; false otherwise

Definition at line 120 of file ipv4-routing-table-entry.cc.

References ns3::Ipv4Address::GetZero(), m_dest, and NS_LOG_FUNCTION.

Referenced by ns3::operator<<().

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

◆ IsGateway()

bool ns3::Ipv4RoutingTableEntry::IsGateway ( ) const
Returns
True if this route is a gateway route; false otherwise

Definition at line 141 of file ipv4-routing-table-entry.cc.

References ns3::Ipv4Address::GetZero(), m_gateway, and NS_LOG_FUNCTION.

Referenced by ns3::operator<<(), ns3::Ipv4GlobalRouting::PrintRoutingTable(), ns3::Ipv4StaticRouting::PrintRoutingTable(), and ns3::Rip::PrintRoutingTable().

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

◆ IsHost()

bool ns3::Ipv4RoutingTableEntry::IsHost ( ) const
Returns
True if this route is a host route (mask of all ones); false otherwise

Definition at line 99 of file ipv4-routing-table-entry.cc.

References ns3::Ipv4Mask::GetOnes(), m_destNetworkMask, and NS_LOG_FUNCTION.

Referenced by IsNetwork(), ns3::operator<<(), ns3::Ipv4GlobalRouting::PrintRoutingTable(), ns3::Ipv4StaticRouting::PrintRoutingTable(), and ns3::Rip::PrintRoutingTable().

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

◆ IsNetwork()

bool ns3::Ipv4RoutingTableEntry::IsNetwork ( ) const
Returns
True if this route is not a host route (mask is not all ones); false otherwise

This method is implemented as !IsHost ().

Definition at line 113 of file ipv4-routing-table-entry.cc.

References IsHost(), and NS_LOG_FUNCTION.

Referenced by ns3::operator<<().

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

Member Data Documentation

◆ m_dest

Ipv4Address ns3::Ipv4RoutingTableEntry::m_dest
private

destination address

Definition at line 169 of file ipv4-routing-table-entry.h.

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

◆ m_destNetworkMask

Ipv4Mask ns3::Ipv4RoutingTableEntry::m_destNetworkMask
private

destination network mask

Definition at line 170 of file ipv4-routing-table-entry.h.

Referenced by GetDestNetworkMask(), and IsHost().

◆ m_gateway

Ipv4Address ns3::Ipv4RoutingTableEntry::m_gateway
private

gateway

Definition at line 171 of file ipv4-routing-table-entry.h.

Referenced by GetGateway(), and IsGateway().

◆ m_interface

uint32_t ns3::Ipv4RoutingTableEntry::m_interface
private

output interface

Definition at line 172 of file ipv4-routing-table-entry.h.

Referenced by GetInterface().


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