View | Details | Raw Unified | Return to bug 468
Collapse All | Expand All

(-)a/src/internet-stack/arp-cache.cc (-14 / +1 lines)
 Lines 185-191   ArpCache::HandleWaitReplyTimeout (void) Link Here 
185
  for (CacheI i = m_arpCache.begin (); i != m_arpCache.end (); i++) 
185
  for (CacheI i = m_arpCache.begin (); i != m_arpCache.end (); i++) 
186
    {
186
    {
187
      entry = (*i).second;
187
      entry = (*i).second;
188
      if (entry != 0 && entry->IsWaitReply () && entry->IsExpiring () )
188
      if (entry != 0 && entry->IsWaitReply ())
189
          {
189
          {
190
          if (entry->GetRetries () < m_maxRetries)
190
          if (entry->GetRetries () < m_maxRetries)
191
            {
191
            {
 Lines 374-392   ArpCache::Entry::GetTimeout (void) const Link Here 
374
    /* NOTREACHED */
374
    /* NOTREACHED */
375
  }
375
  }
376
}
376
}
377
bool
378
ArpCache::Entry::IsExpiring (void) const
379
{
380
  NS_LOG_FUNCTION_NOARGS ();
381
  Time timeout = GetTimeout ();
382
  Time delta = Simulator::Now () - m_lastSeen;
383
  NS_LOG_DEBUG ("delta=" << delta.GetSeconds () << "s");
384
  if (delta >= timeout)
385
    {
386
      return true;
387
    }
388
  return false;
389
}
390
bool 
377
bool 
391
ArpCache::Entry::IsExpired (void) const
378
ArpCache::Entry::IsExpired (void) const
392
{
379
{
(-)a/src/internet-stack/arp-cache.h (-14 lines)
 Lines 164-185   public: Link Here 
164
     *
164
     *
165
     * This function returns true if the time elapsed strictly exceeds
165
     * This function returns true if the time elapsed strictly exceeds
166
     * the timeout value (i.e., is not less than or equal to the timeout).
166
     * the timeout value (i.e., is not less than or equal to the timeout).
167
     * Differs from IsExpiring() only in the boundary condition 
168
     * delta == timeout.
169
     * \see IsExpiring
170
     */
167
     */
171
    bool IsExpired (void) const;
168
    bool IsExpired (void) const;
172
    /**
173
     * \return True if this entry is timing out or has already timed out; 
174
     * false otherwise.
175
     *
176
     * This function returns true if the time elapsed is equal to or exceeds
177
     * the timeout value.  Differs from IsExpired() only in the boundary 
178
     * condition delta == timeout.
179
     * \see IsExpired
180
     */
181
    bool IsExpiring (void) const;
182
183
    /**
169
    /**
184
     * \returns 0 is no packet is pending, the next packet to send if 
170
     * \returns 0 is no packet is pending, the next packet to send if 
185
     *            packets are pending.
171
     *            packets are pending.

Return to bug 468