A Discrete-Event Network Simulator
API
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. More...
 
typedef std::vector< Ipv4Address >::iterator Iterator
 Define the iterator. More...
 

Public Member Functions

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

Private Attributes

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

Detailed Description

DsrRouteCacheEntry class for entries in the route cache.

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

Member Typedef Documentation

◆ IP_VECTOR

Define the vector to hold Ip address.

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

◆ Iterator

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

Define the iterator.

Definition at line 224 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 106 of file dsr-rcache.cc.

◆ ~DsrRouteCacheEntry()

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

Definition at line 117 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 269 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 277 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 317 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 122 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== ( DsrRouteCacheEntry const &  o) const
inline

Compare the route cache entry.

Parameters
oentry to compare
Returns
true if equal

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

References m_path, and NS_ASSERT.

◆ Print()

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

Print necessary fields.

Parameters
osthe output stream

Definition at line 129 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 261 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 285 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 309 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 245 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 301 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 364 of file dsr-rcache.h.

◆ m_blackListState

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

Indicate if this entry is in "blacklist".

Definition at line 370 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 371 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 365 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 367 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 368 of file dsr-rcache.h.

◆ m_ipv4

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

The Ipv4 layer 3.

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

◆ m_ipv4Route

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

The Ipv4 route.

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

◆ m_path

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

brief The IP address constructed route

Definition at line 366 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 369 of file dsr-rcache.h.

Referenced by Invalidate().


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