|
|
| 100 |
return 0; |
100 |
return 0; |
| 101 |
} |
101 |
} |
| 102 |
|
102 |
|
|
|
103 |
std::list<NdiscCache::Entry*> NdiscCache::LookupInverse (Address dst) |
| 104 |
{ |
| 105 |
NS_LOG_FUNCTION (this << dst); |
| 106 |
|
| 107 |
std::list<NdiscCache::Entry *> entryList; |
| 108 |
for (CacheI i = m_ndCache.begin (); i != m_ndCache.end (); i++) |
| 109 |
{ |
| 110 |
NdiscCache::Entry *entry = (*i).second; |
| 111 |
if (entry->GetMacAddress () == dst) |
| 112 |
{ |
| 113 |
entryList.push_back (entry); |
| 114 |
} |
| 115 |
} |
| 116 |
return entryList; |
| 117 |
} |
| 118 |
|
| 119 |
|
| 103 |
NdiscCache::Entry* NdiscCache::Add (Ipv6Address to) |
120 |
NdiscCache::Entry* NdiscCache::Add (Ipv6Address to) |
| 104 |
{ |
121 |
{ |
| 105 |
NS_LOG_FUNCTION (this << to); |
122 |
NS_LOG_FUNCTION (this << to); |
|
|
| 397 |
return m_lastReachabilityConfirmation; |
414 |
return m_lastReachabilityConfirmation; |
| 398 |
} |
415 |
} |
| 399 |
|
416 |
|
| 400 |
void NdiscCache::Entry::UpdateLastReachabilityconfirmation () |
|
|
| 401 |
{ |
| 402 |
NS_LOG_FUNCTION_NOARGS (); |
| 403 |
} |
| 404 |
|
| 405 |
void NdiscCache::Entry::StartReachableTimer () |
417 |
void NdiscCache::Entry::StartReachableTimer () |
| 406 |
{ |
418 |
{ |
| 407 |
NS_LOG_FUNCTION_NOARGS (); |
419 |
NS_LOG_FUNCTION_NOARGS (); |
|
|
| 410 |
m_nudTimer.Cancel (); |
422 |
m_nudTimer.Cancel (); |
| 411 |
} |
423 |
} |
| 412 |
|
424 |
|
|
|
425 |
m_lastReachabilityConfirmation = Simulator::Now (); |
| 413 |
m_nudTimer.SetFunction (&NdiscCache::Entry::FunctionReachableTimeout, this); |
426 |
m_nudTimer.SetFunction (&NdiscCache::Entry::FunctionReachableTimeout, this); |
| 414 |
m_nudTimer.SetDelay (MilliSeconds (Icmpv6L4Protocol::REACHABLE_TIME)); |
427 |
m_nudTimer.SetDelay (MilliSeconds (Icmpv6L4Protocol::REACHABLE_TIME)); |
| 415 |
m_nudTimer.Schedule (); |
428 |
m_nudTimer.Schedule (); |
| 416 |
} |
429 |
} |
| 417 |
|
430 |
|
|
|
431 |
void NdiscCache::Entry::UpdateReachableTimer () |
| 432 |
{ |
| 433 |
NS_LOG_FUNCTION_NOARGS (); |
| 434 |
|
| 435 |
if (m_state == REACHABLE) |
| 436 |
{ |
| 437 |
m_lastReachabilityConfirmation = Simulator::Now (); |
| 438 |
if (m_nudTimer.IsRunning ()) |
| 439 |
{ |
| 440 |
m_nudTimer.Cancel (); |
| 441 |
} |
| 442 |
m_nudTimer.Schedule (); |
| 443 |
} |
| 444 |
} |
| 445 |
|
| 418 |
void NdiscCache::Entry::StartProbeTimer () |
446 |
void NdiscCache::Entry::StartProbeTimer () |
| 419 |
{ |
447 |
{ |
| 420 |
NS_LOG_FUNCTION_NOARGS (); |
448 |
NS_LOG_FUNCTION_NOARGS (); |