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

IPv4 route cache entry (similar to Linux struct rtable) More...

#include "ipv4-route.h"

+ Inheritance diagram for ns3::Ipv4Route:
+ Collaboration diagram for ns3::Ipv4Route:

Public Member Functions

 Ipv4Route ()
 
Ipv4Address GetDestination () const
 
Ipv4Address GetGateway () const
 
Ptr< NetDeviceGetOutputDevice () const
 
Ipv4Address GetSource () const
 
void SetDestination (Ipv4Address dest)
 
void SetGateway (Ipv4Address gw)
 
void SetOutputDevice (Ptr< NetDevice > outputDevice)
 Equivalent in Linux to dst_entry.dev.
 
void SetSource (Ipv4Address src)
 
- Public Member Functions inherited from ns3::SimpleRefCount< Ipv4Route >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 

Private Attributes

Ipv4Address m_dest
 Destination address.
 
Ipv4Address m_gateway
 Gateway address.
 
Ptr< NetDevicem_outputDevice
 Output device.
 
Ipv4Address m_source
 Source address.
 

Detailed Description

IPv4 route cache entry (similar to Linux struct rtable)

This is a reference counted object. In the future, we will add other entries from struct dst_entry, struct rtable, and struct dst_ops as needed.

Definition at line 30 of file ipv4-route.h.

Constructor & Destructor Documentation

◆ Ipv4Route()

ns3::Ipv4Route::Ipv4Route ( )

Definition at line 19 of file ipv4-route.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ GetDestination()

Ipv4Address ns3::Ipv4Route::GetDestination ( ) const
Returns
Destination Ipv4Address of the route

Definition at line 32 of file ipv4-route.cc.

References m_dest, and NS_LOG_FUNCTION.

Referenced by ns3::operator<<().

+ Here is the caller graph for this function:

◆ GetGateway()

Ipv4Address ns3::Ipv4Route::GetGateway ( ) const
Returns
Ipv4Address of the gateway (next hop)

Definition at line 60 of file ipv4-route.cc.

References m_gateway, and NS_LOG_FUNCTION.

Referenced by ns3::operator<<().

+ Here is the caller graph for this function:

◆ GetOutputDevice()

Ptr< NetDevice > ns3::Ipv4Route::GetOutputDevice ( ) const
Returns
pointer to NetDevice for outgoing packets

Definition at line 74 of file ipv4-route.cc.

References m_outputDevice, and NS_LOG_FUNCTION.

◆ GetSource()

Ipv4Address ns3::Ipv4Route::GetSource ( ) const
Returns
Source Ipv4Address of the route

Definition at line 46 of file ipv4-route.cc.

References m_source, and NS_LOG_FUNCTION.

Referenced by ns3::operator<<().

+ Here is the caller graph for this function:

◆ SetDestination()

void ns3::Ipv4Route::SetDestination ( Ipv4Address dest)
Parameters
destDestination Ipv4Address

Definition at line 25 of file ipv4-route.cc.

References m_dest, and NS_LOG_FUNCTION.

◆ SetGateway()

void ns3::Ipv4Route::SetGateway ( Ipv4Address gw)
Parameters
gwGateway (next hop) Ipv4Address

Definition at line 53 of file ipv4-route.cc.

References m_gateway, and NS_LOG_FUNCTION.

◆ SetOutputDevice()

void ns3::Ipv4Route::SetOutputDevice ( Ptr< NetDevice > outputDevice)

Equivalent in Linux to dst_entry.dev.

Parameters
outputDevicepointer to NetDevice for outgoing packets

Definition at line 67 of file ipv4-route.cc.

References m_outputDevice, and NS_LOG_FUNCTION.

◆ SetSource()

void ns3::Ipv4Route::SetSource ( Ipv4Address src)
Parameters
srcSource Ipv4Address

Definition at line 39 of file ipv4-route.cc.

References m_source, and NS_LOG_FUNCTION.

Member Data Documentation

◆ m_dest

Ipv4Address ns3::Ipv4Route::m_dest
private

Destination address.

Definition at line 80 of file ipv4-route.h.

Referenced by GetDestination(), and SetDestination().

◆ m_gateway

Ipv4Address ns3::Ipv4Route::m_gateway
private

Gateway address.

Definition at line 82 of file ipv4-route.h.

Referenced by GetGateway(), and SetGateway().

◆ m_outputDevice

Ptr<NetDevice> ns3::Ipv4Route::m_outputDevice
private

Output device.

Definition at line 83 of file ipv4-route.h.

Referenced by GetOutputDevice(), and SetOutputDevice().

◆ m_source

Ipv4Address ns3::Ipv4Route::m_source
private

Source address.

Definition at line 81 of file ipv4-route.h.

Referenced by GetSource(), and SetSource().


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