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

(-)a/src/internet/model/icmpv6-l4-protocol.cc (-2 / +2 lines)
 Lines 1295-1301   bool Icmpv6L4Protocol::Lookup (Ipv6Address dst, Ptr<NetDevice> device, Ptr<Ndisc Link Here 
1295
      NdiscCache::Entry* entry = cache->Lookup (dst);
1295
      NdiscCache::Entry* entry = cache->Lookup (dst);
1296
      if (entry)
1296
      if (entry)
1297
        {
1297
        {
1298
          if (entry->IsReachable () || entry->IsDelay ())
1298
          if (entry->IsReachable () || entry->IsDelay () || entry->IsPermanent ())
1299
            {
1299
            {
1300
              *hardwareDestination = entry->GetMacAddress ();
1300
              *hardwareDestination = entry->GetMacAddress ();
1301
              return true;
1301
              return true;
 Lines 1329-1335   bool Icmpv6L4Protocol::Lookup (Ptr<Packet> p, Ipv6Address dst, Ptr<NetDevice> de Link Here 
1329
  NdiscCache::Entry* entry = cache->Lookup (dst);
1329
  NdiscCache::Entry* entry = cache->Lookup (dst);
1330
  if (entry)
1330
  if (entry)
1331
    {
1331
    {
1332
      if (entry->IsReachable () || entry->IsDelay ())
1332
      if (entry->IsReachable () || entry->IsDelay () || entry->IsPermanent ())
1333
        {
1333
        {
1334
          /* XXX check reachability time */
1334
          /* XXX check reachability time */
1335
          /* send packet */
1335
          /* send packet */
(-)a/src/internet/model/ndisc-cache.cc (-1 / +21 lines)
 Lines 187-196   void NdiscCache::PrintNdiscCache (Ptr<OutputStreamWrapper> stream) Link Here 
187
        {
187
        {
188
          *os << " PROBE\n";
188
          *os << " PROBE\n";
189
        }
189
        }
190
      else
190
      else if (i->second->IsStale ())
191
        {
191
        {
192
          *os << " STALE\n";
192
          *os << " STALE\n";
193
        }
193
        }
194
      else if (i->second->IsPermanent ())
195
	{
196
	  *os << " PERMANENT\n";
197
	}
198
      else
199
	{
200
	  NS_FATAL_ERROR ("Test for possibly unreachable code-- please file a bug report, with a test case, if this is ever hit");
201
	}
194
    }
202
    }
195
}
203
}
196
204
 Lines 495-500   void NdiscCache::Entry::MarkDelay () Link Here 
495
  m_state = DELAY;
503
  m_state = DELAY;
496
}
504
}
497
505
506
void NdiscCache::Entry::MarkPermanent ()
507
{
508
  NS_LOG_FUNCTION_NOARGS ();
509
  m_state = PERMANENT;
510
}
511
498
bool NdiscCache::Entry::IsStale () const
512
bool NdiscCache::Entry::IsStale () const
499
{
513
{
500
  NS_LOG_FUNCTION_NOARGS ();
514
  NS_LOG_FUNCTION_NOARGS ();
 Lines 525-530   bool NdiscCache::Entry::IsProbe () const Link Here 
525
  return (m_state == PROBE);
539
  return (m_state == PROBE);
526
}
540
}
527
541
542
bool NdiscCache::Entry::IsPermanent () const
543
{
544
  NS_LOG_FUNCTION_NOARGS ();
545
  return (m_state == PERMANENT);
546
}
547
528
Address NdiscCache::Entry::GetMacAddress () const
548
Address NdiscCache::Entry::GetMacAddress () const
529
{
549
{
530
  NS_LOG_FUNCTION_NOARGS ();
550
  NS_LOG_FUNCTION_NOARGS ();
(-)a/src/internet/model/ndisc-cache.h (-3 / +13 lines)
 Lines 185-190   public: Link Here 
185
    void MarkDelay ();
185
    void MarkDelay ();
186
186
187
    /**
187
    /**
188
     * \brief Change the state to this entry to PERMANENT.
189
     */
190
    void MarkPermanent ();
191
192
    /**
188
     * \brief Add a packet (or replace old value) in the queue.
193
     * \brief Add a packet (or replace old value) in the queue.
189
     * \param p packet to add
194
     * \param p packet to add
190
     */
195
     */
 Lines 226-231   public: Link Here 
226
    bool IsProbe () const;
231
    bool IsProbe () const;
227
232
228
    /**
233
    /**
234
     * \brief Is the entry PERMANENT
235
     * \return true if the entry is in PERMANENT state, false otherwise
236
     */
237
    bool IsPermanent () const;
238
239
    /**
229
     * \brief Get the MAC address of this entry.
240
     * \brief Get the MAC address of this entry.
230
     * \return the L2 address
241
     * \return the L2 address
231
     */
242
     */
 Lines 328-334   private: Link Here 
328
      REACHABLE, /**< Mapping exists between IPv6 and L2 addresses */
339
      REACHABLE, /**< Mapping exists between IPv6 and L2 addresses */
329
      STALE, /**< Mapping is stale */
340
      STALE, /**< Mapping is stale */
330
      DELAY, /**< Try to wait contact from remote host */
341
      DELAY, /**< Try to wait contact from remote host */
331
      PROBE /**< Try to contact IPv6 address to know again its L2 address */
342
      PROBE, /**< Try to contact IPv6 address to know again its L2 address */
343
      PERMANENT /**< Permanent Mapping exists between IPv6 and L2 addresses */
332
    };
344
    };
333
345
334
    /**
346
    /**
335
- 
336
igonred
347
igonred
337
--
338
src/internet/model/icmpv6-l4-protocol.cc | 4 ++--
348
src/internet/model/icmpv6-l4-protocol.cc | 4 ++--
339
1 file changed, 2 insertions(+), 2 deletions(-)
349
1 file changed, 2 insertions(+), 2 deletions(-)
(-)a/src/internet/model/icmpv6-l4-protocol.cc (-3 / +2 lines)
 Lines 401-407   void Icmpv6L4Protocol::ReceiveLLA (Icmpv6OptionLinkLayerAddress lla, Ipv6Address Link Here 
401
            }
401
            }
402
          else
402
          else
403
            {
403
            {
404
              if (!entry->IsReachable ())
404
              if (!entry->IsReachable () || !entry->IsPermanent ())
405
                {
405
                {
406
                  entry->StopNudTimer ();
406
                  entry->StopNudTimer ();
407
                  waiting = entry->MarkReachable (lla.GetAddress ());
407
                  waiting = entry->MarkReachable (lla.GetAddress ());
 Lines 708-714   void Icmpv6L4Protocol::HandleNA (Ptr<Packet> packet, Ipv6Address const &src, Ipv Link Here 
708
708
709
              if (naHeader.GetFlagS ())
709
              if (naHeader.GetFlagS ())
710
                {
710
                {
711
                  if (!entry->IsReachable ())
711
                  if (!entry->IsReachable () || !entry->IsPermanent ())
712
                    {
712
                    {
713
                      if (entry->IsProbe ())
713
                      if (entry->IsProbe ())
714
                        {
714
                        {
715
- 

Return to bug 2145