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

(-)a/src/internet/model/arp-cache.cc (+37 lines)
 Lines 242-247    Link Here 
242
    }
242
    }
243
}
243
}
244
244
245
void
246
ArpCache::PrintArpCache (Ptr<OutputStreamWrapper> stream)
247
{
248
  NS_LOG_FUNCTION (this << stream);
249
  std::ostream* os = stream->GetStream ();
250
251
  for (CacheI i = m_arpCache.begin (); i != m_arpCache.end (); i++)
252
    {
253
      os << i->first << " dev ";
254
      std::string found = Names::FindName (m_device);
255
      if (Names::FindName (m_device) != "")
256
        {
257
          os << found;
258
        }
259
      else
260
        {
261
          os << m_device->GetIfIndex ();
262
        }
263
264
      os << " lladdr " << i->second->m_macAddress;
265
266
      if (i->second->IsAlive ())
267
        {
268
          os << " REACHABLE\n";
269
        }
270
      else if (i->second->IsWaitReply ())
271
        {
272
          os << " DELAY\n";
273
        }
274
      else
275
        {
276
          os << " STALE\n";
277
        }
278
    }
279
}
280
281
245
ArpCache::Entry *
282
ArpCache::Entry *
246
ArpCache::Lookup (Ipv4Address to)
283
ArpCache::Lookup (Ipv4Address to)
247
{
284
{
(-)a/src/internet/model/arp-cache.h (-2 / +9 lines)
 Lines 76-83    Link Here 
76
  /**
76
  /**
77
   * \brief Set the NetDevice and Ipv4Interface associated with the ArpCache
77
   * \brief Set the NetDevice and Ipv4Interface associated with the ArpCache
78
   *
78
   *
79
   * \param device The hardware NetDevice associated with this ARP chache
79
   * \param device The hardware NetDevice associated with this ARP cache
80
   * \param interface the Ipv4Interface associated with this ARP chache
80
   * \param interface the Ipv4Interface associated with this ARP cache
81
   */
81
   */
82
  void SetDevice (Ptr<NetDevice> device, Ptr<Ipv4Interface> interface);
82
  void SetDevice (Ptr<NetDevice> device, Ptr<Ipv4Interface> interface);
83
  /**
83
  /**
 Lines 155-160    Link Here 
155
  void Flush (void);
155
  void Flush (void);
156
156
157
  /**
157
  /**
158
   * \brief Print the ARP cache entries
159
   *
160
   * \param stream the ostream the ARP cache entries is printed to
161
   */
162
  void PrintArpCache (Ptr<OutputStreamWrapper> stream);
163
164
  /**
158
   * \brief A record that that holds information about an ArpCache entry
165
   * \brief A record that that holds information about an ArpCache entry
159
   */
166
   */
160
  class Entry {
167
  class Entry {

Return to bug 652