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

DsrRouteCacheEntry class for entries in the route cache. More...

#include "dsr-rcache.h"

+ Collaboration diagram for ns3::dsr::DsrRouteCacheEntry:

Public Types

typedef std::vector< Ipv4AddressIP_VECTOR
 Define the vector to hold Ip address.
 
typedef std::vector< Ipv4Address >::iterator Iterator
 Define the iterator.
 

Public Member Functions

 DsrRouteCacheEntry (IP_VECTOR const &ip=IP_VECTOR(), Ipv4Address dst=Ipv4Address(), Time exp=Simulator::Now())
 Constructor.
 
virtual ~DsrRouteCacheEntry ()
 
Time GetBlacklistTimeout () const
 Get blacklist timeout.
 
Ipv4Address GetDestination () const
 Get destination address.
 
Time GetExpireTime () const
 Get expire time.
 
IP_VECTOR GetVector () const
 Get the IP vector.
 
void Invalidate (Time badLinkLifetime)
 Mark entry as "down" (i.e.
 
bool IsUnidirectional () const
 Get unidirectional flag.
 
bool operator== (const DsrRouteCacheEntry &o) const
 Compare the route cache entry.
 
void Print (std::ostream &os) const
 Print necessary fields.
 
void SetBlacklistTimeout (Time t)
 Set blacklist timeout.
 
void SetDestination (Ipv4Address d)
 Set destination address.
 
void SetExpireTime (Time exp)
 Set expire time.
 
void SetUnidirectional (bool u)
 Set unidirectional flag.
 
void SetVector (IP_VECTOR v)
 Sets the IP vector.
 

Private Attributes

Timer m_ackTimer
 RREP_ACK timer.
 
bool m_blackListState
 Indicate if this entry is in "blacklist".
 
Time m_blackListTimeout
 Time for which the node is put into the blacklist.
 
Ipv4Address m_dst
 The destination Ip address.
 
Time m_expire
 Expire time for queue entry.
 
Ipv4InterfaceAddress m_iface
 Output interface address.
 
Ptr< Ipv4m_ipv4
 The Ipv4 layer 3.
 
Ptr< Ipv4Routem_ipv4Route
 The Ipv4 route.
 
IP_VECTOR m_path
 brief The IP address constructed route
 
uint8_t m_reqCount
 Number of route requests.
 

Detailed Description

DsrRouteCacheEntry class for entries in the route cache.

Definition at line 217 of file dsr-rcache.h.

Member Typedef Documentation

◆ IP_VECTOR

Define the vector to hold Ip address.

Definition at line 220 of file dsr-rcache.h.

◆ Iterator

typedef std::vector<Ipv4Address>::iterator ns3::dsr::DsrRouteCacheEntry::Iterator

Define the iterator.

Definition at line 221 of file dsr-rcache.h.

Constructor & Destructor Documentation

◆ DsrRouteCacheEntry()

ns3::dsr::DsrRouteCacheEntry::DsrRouteCacheEntry ( IP_VECTOR const & ip = IP_VECTOR(),
Ipv4Address dst = Ipv4Address(),
Time exp = Simulator::Now() )

Constructor.

Parameters
ipIP_VECTOR
dstdestination IPv4 address
expexpiration time

Definition at line 104 of file dsr-rcache.cc.

◆ ~DsrRouteCacheEntry()

ns3::dsr::DsrRouteCacheEntry::~DsrRouteCacheEntry ( )
virtual

Definition at line 115 of file dsr-rcache.cc.

Member Function Documentation

◆ GetBlacklistTimeout()

Time ns3::dsr::DsrRouteCacheEntry::GetBlacklistTimeout ( ) const
inline

Get blacklist timeout.

Returns
the blacklist timeout

Definition at line 271 of file dsr-rcache.h.

References m_blackListTimeout.

◆ GetDestination()

Ipv4Address ns3::dsr::DsrRouteCacheEntry::GetDestination ( ) const
inline

Get destination address.

Returns
the destination IP address

Definition at line 280 of file dsr-rcache.h.

References m_dst.

Referenced by ns3::dsr::DsrRouteCache::AddRoute(), DsrCacheEntryTest::DoRun(), and ns3::dsr::DsrRouteCache::FindSameRoute().

+ Here is the caller graph for this function:

◆ GetExpireTime()

Time ns3::dsr::DsrRouteCacheEntry::GetExpireTime ( ) const
inline

Get expire time.

Returns
the expire time

Definition at line 325 of file dsr-rcache.h.

References m_expire, and ns3::Simulator::Now().

Referenced by ns3::dsr::DsrRouteCache::AddRoute(), ns3::dsr::CompareRoutesBoth(), ns3::dsr::CompareRoutesExpire(), DsrCacheEntryTest::DoRun(), and ns3::dsr::DsrRouteCache::FindSameRoute().

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

◆ GetVector()

◆ Invalidate()

void ns3::dsr::DsrRouteCacheEntry::Invalidate ( Time badLinkLifetime)

Mark entry as "down" (i.e.

disable it)

Parameters
badLinkLifetimeTime before purging the link for real.

Definition at line 120 of file dsr-rcache.cc.

References m_expire, m_reqCount, and ns3::Simulator::Now().

+ Here is the call graph for this function:

◆ IsUnidirectional()

bool ns3::dsr::DsrRouteCacheEntry::IsUnidirectional ( ) const
inline

Get unidirectional flag.

Returns
the unidirectional flag

Definition at line 253 of file dsr-rcache.h.

References m_blackListState.

◆ operator==()

bool ns3::dsr::DsrRouteCacheEntry::operator== ( const DsrRouteCacheEntry & o) const
inline

Compare the route cache entry.

Only the paths are compared.

Parameters
oentry to compare
Returns
true if both route cache entries are equal

Definition at line 341 of file dsr-rcache.h.

References m_path.

◆ Print()

void ns3::dsr::DsrRouteCacheEntry::Print ( std::ostream & os) const

Print necessary fields.

Parameters
osthe output stream

Definition at line 127 of file dsr-rcache.cc.

References m_dst, m_expire, ns3::Simulator::Now(), and ns3::Time::S.

+ Here is the call graph for this function:

◆ SetBlacklistTimeout()

void ns3::dsr::DsrRouteCacheEntry::SetBlacklistTimeout ( Time t)
inline

Set blacklist timeout.

Parameters
tthe blacklist timeout

Definition at line 262 of file dsr-rcache.h.

References m_blackListTimeout.

◆ SetDestination()

void ns3::dsr::DsrRouteCacheEntry::SetDestination ( Ipv4Address d)
inline

Set destination address.

Parameters
dthe destination IP address

Definition at line 289 of file dsr-rcache.h.

References m_dst.

Referenced by ns3::dsr::DsrRouteCache::DeleteAllRoutesIncludeLink(), DsrCacheEntryTest::DoRun(), ns3::dsr::DsrRouteCache::LookupRoute(), and ns3::dsr::DsrRouteCache::LookupRoute_Link().

+ Here is the caller graph for this function:

◆ SetExpireTime()

void ns3::dsr::DsrRouteCacheEntry::SetExpireTime ( Time exp)
inline

Set expire time.

Parameters
expthe expire time

Definition at line 316 of file dsr-rcache.h.

References m_expire, and ns3::Simulator::Now().

Referenced by ns3::dsr::DsrRouteCache::DeleteAllRoutesIncludeLink(), DsrCacheEntryTest::DoRun(), ns3::dsr::DsrRouteCache::LookupRoute(), ns3::dsr::DsrRouteCache::LookupRoute_Link(), and ns3::dsr::DsrRouteCache::UpdateRouteEntry().

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

◆ SetUnidirectional()

void ns3::dsr::DsrRouteCacheEntry::SetUnidirectional ( bool u)
inline

Set unidirectional flag.

Parameters
uthe unidirectional flag

Definition at line 244 of file dsr-rcache.h.

References m_blackListState.

◆ SetVector()

void ns3::dsr::DsrRouteCacheEntry::SetVector ( IP_VECTOR v)
inline

Sets the IP vector.

Parameters
vthe IP vector

Definition at line 307 of file dsr-rcache.h.

References m_path.

Referenced by ns3::dsr::DsrRouteCache::DeleteAllRoutesIncludeLink(), DsrCacheEntryTest::DoRun(), ns3::dsr::DsrRouteCache::LookupRoute(), and ns3::dsr::DsrRouteCache::LookupRoute_Link().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_ackTimer

Timer ns3::dsr::DsrRouteCacheEntry::m_ackTimer
private

RREP_ACK timer.

Definition at line 347 of file dsr-rcache.h.

◆ m_blackListState

bool ns3::dsr::DsrRouteCacheEntry::m_blackListState
private

Indicate if this entry is in "blacklist".

Definition at line 353 of file dsr-rcache.h.

Referenced by IsUnidirectional(), and SetUnidirectional().

◆ m_blackListTimeout

Time ns3::dsr::DsrRouteCacheEntry::m_blackListTimeout
private

Time for which the node is put into the blacklist.

Definition at line 354 of file dsr-rcache.h.

Referenced by GetBlacklistTimeout(), and SetBlacklistTimeout().

◆ m_dst

Ipv4Address ns3::dsr::DsrRouteCacheEntry::m_dst
private

The destination Ip address.

Definition at line 348 of file dsr-rcache.h.

Referenced by GetDestination(), Print(), and SetDestination().

◆ m_expire

Time ns3::dsr::DsrRouteCacheEntry::m_expire
private

Expire time for queue entry.

Definition at line 350 of file dsr-rcache.h.

Referenced by GetExpireTime(), Invalidate(), Print(), and SetExpireTime().

◆ m_iface

Ipv4InterfaceAddress ns3::dsr::DsrRouteCacheEntry::m_iface
private

Output interface address.

Definition at line 351 of file dsr-rcache.h.

◆ m_ipv4

Ptr<Ipv4> ns3::dsr::DsrRouteCacheEntry::m_ipv4
private

The Ipv4 layer 3.

Definition at line 356 of file dsr-rcache.h.

◆ m_ipv4Route

Ptr<Ipv4Route> ns3::dsr::DsrRouteCacheEntry::m_ipv4Route
private

The Ipv4 route.

Definition at line 355 of file dsr-rcache.h.

◆ m_path

IP_VECTOR ns3::dsr::DsrRouteCacheEntry::m_path
private

brief The IP address constructed route

Definition at line 349 of file dsr-rcache.h.

Referenced by GetVector(), operator==(), and SetVector().

◆ m_reqCount

uint8_t ns3::dsr::DsrRouteCacheEntry::m_reqCount
private

Number of route requests.

Definition at line 352 of file dsr-rcache.h.

Referenced by Invalidate().


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