DsrRouteCacheEntry class for entries in the route cache. More...
#include "dsr-rcache.h"
Public Types | |
typedef std::vector< Ipv4Address > | IP_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== (const DsrRouteCacheEntry &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< Ipv4 > | m_ipv4 |
The Ipv4 layer 3. More... | |
Ptr< Ipv4Route > | m_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... | |
DsrRouteCacheEntry class for entries in the route cache.
Definition at line 228 of file dsr-rcache.h.
typedef std::vector<Ipv4Address> ns3::dsr::DsrRouteCacheEntry::IP_VECTOR |
Define the vector to hold Ip address.
Definition at line 231 of file dsr-rcache.h.
typedef std::vector<Ipv4Address>::iterator ns3::dsr::DsrRouteCacheEntry::Iterator |
Define the iterator.
Definition at line 232 of file dsr-rcache.h.
ns3::dsr::DsrRouteCacheEntry::DsrRouteCacheEntry | ( | IP_VECTOR const & | ip = IP_VECTOR() , |
Ipv4Address | dst = Ipv4Address() , |
||
Time | exp = Simulator::Now() |
||
) |
Constructor.
ip | IP_VECTOR |
dst | destination IPv4 address |
exp | expiration time |
Definition at line 115 of file dsr-rcache.cc.
|
virtual |
Definition at line 126 of file dsr-rcache.cc.
|
inline |
Get blacklist timeout.
Definition at line 282 of file dsr-rcache.h.
References m_blackListTimeout.
|
inline |
Get destination address.
Definition at line 291 of file dsr-rcache.h.
References m_dst.
Referenced by ns3::dsr::DsrRouteCache::AddRoute(), DsrCacheEntryTest::DoRun(), and ns3::dsr::DsrRouteCache::FindSameRoute().
|
inline |
Get expire time.
Definition at line 336 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().
|
inline |
Get the IP vector.
Definition at line 309 of file dsr-rcache.h.
References m_path.
Referenced by ns3::dsr::DsrRouteCache::AddRoute(), ns3::dsr::DsrRouting::AddRoute(), ns3::dsr::DsrRouting::CheckSendBuffer(), ns3::dsr::CompareRoutesBoth(), ns3::dsr::CompareRoutesHops(), DsrCacheEntryTest::DoRun(), ns3::dsr::DsrRouteCache::FindSameRoute(), ns3::dsr::DsrRouteCache::LookupRoute_Link(), ns3::dsr::DsrRouting::PacketNewRoute(), ns3::dsr::DsrOptionRreq::Process(), ns3::dsr::DsrRouting::RouteRequestTimerExpire(), ns3::dsr::DsrRouting::SalvagePacket(), ns3::dsr::DsrRouting::Send(), ns3::dsr::DsrRouting::SendErrorRequest(), and ns3::dsr::DsrRouting::SendUnreachError().
void ns3::dsr::DsrRouteCacheEntry::Invalidate | ( | Time | badLinkLifetime | ) |
Mark entry as "down" (i.e.
disable it)
badLinkLifetime | Time before purging the link for real. |
Definition at line 131 of file dsr-rcache.cc.
References m_expire, m_reqCount, and ns3::Simulator::Now().
|
inline |
Get unidirectional flag.
Definition at line 264 of file dsr-rcache.h.
References m_blackListState.
|
inline |
Compare the route cache entry.
Only the paths are compared.
o | entry to compare |
Definition at line 352 of file dsr-rcache.h.
References m_path.
void ns3::dsr::DsrRouteCacheEntry::Print | ( | std::ostream & | os | ) | const |
Print necessary fields.
os | the output stream |
Definition at line 138 of file dsr-rcache.cc.
References m_dst, m_expire, ns3::Simulator::Now(), and ns3::Time::S.
|
inline |
Set blacklist timeout.
t | the blacklist timeout |
Definition at line 273 of file dsr-rcache.h.
References m_blackListTimeout.
|
inline |
Set destination address.
d | the destination IP address |
Definition at line 300 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().
|
inline |
Set expire time.
exp | the expire time |
Definition at line 327 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().
|
inline |
Set unidirectional flag.
u | the unidirectional flag |
Definition at line 255 of file dsr-rcache.h.
References m_blackListState.
|
inline |
Sets the IP vector.
v | the IP vector |
Definition at line 318 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().
|
private |
RREP_ACK timer.
Definition at line 358 of file dsr-rcache.h.
|
private |
Indicate if this entry is in "blacklist".
Definition at line 364 of file dsr-rcache.h.
Referenced by IsUnidirectional(), and SetUnidirectional().
|
private |
Time for which the node is put into the blacklist.
Definition at line 365 of file dsr-rcache.h.
Referenced by GetBlacklistTimeout(), and SetBlacklistTimeout().
|
private |
The destination Ip address.
Definition at line 359 of file dsr-rcache.h.
Referenced by GetDestination(), Print(), and SetDestination().
|
private |
Expire time for queue entry.
Definition at line 361 of file dsr-rcache.h.
Referenced by GetExpireTime(), Invalidate(), Print(), and SetExpireTime().
|
private |
Output interface address.
Definition at line 362 of file dsr-rcache.h.
The Ipv4 layer 3.
Definition at line 367 of file dsr-rcache.h.
The Ipv4 route.
Definition at line 366 of file dsr-rcache.h.
|
private |
brief The IP address constructed route
Definition at line 360 of file dsr-rcache.h.
Referenced by GetVector(), operator==(), and SetVector().
|
private |