[ndnSIM] fib table in ndnSIM

Anwar Kalghoum anwar.kalghoum at yahoo.fr
Tue Apr 21 13:15:44 PDT 2015


Hi;thank you very much Narjes;

The  code  in ndnSIM v2  :
   
 for (const auto& entry : ndn->getForwarder()->getFib()) {      std::cout << entry.getPrefix() << " (";
      bool isFirst = true;
      for (auto& nextHop : entry.getNextHops()) {
       std::cout << *nextHop.getFace();
        auto face = dynamic_pointer_cast<ndn::NetDeviceFace>(nextHop.getFace());
        if (face == nullptr)
          continue;
       std::cout << " towards ";
        if (!isFirst)
         std::cout << ", ";
        std::cout << Names::FindName(face->GetNetDevice()->GetChannel()->GetDevice(1)->GetNode());
        isFirst = false;
      }
      cout << ")" << endl;
    }
  
.................
Best Regards 
 


     Le Vendredi 17 avril 2015 16h40, narjes aloulou <aloulounarjes at yahoo.fr> a écrit :
   

 Hi,

I use the ndnSIM v1. The following code displays the content of FIB table for each node: 

  for (NodeList::Iterator node = NodeList::Begin (); node != NodeList::End (); node ++)
  {
  std::cout << "Node <" << ((*node)->GetId ())<<"\n";
  Ptr<ndn::Fib> fib = (*node)->GetObject<ndn::Fib> ();
  for (Ptr<ndn::fib::Entry> entry = fib->Begin (); entry != fib->End (); entry = fib->Next (entry))
    {
      std::cout << entry->GetPrefix () ;  
      BOOST_FOREACH (const ndn::fib::FaceMetric &faceMetric, entry->m_faces)
      {
        std::cout <<"face=" << faceMetric.GetFace ()->GetId()<<"\n";
      }
    }
  std::cout <<"==============="<<std::endl;
  }

Best Regards
--------------------------------------------
En date de : Ven 17.4.15, Anwar Kalghoum <anwar.kalghoum at yahoo.fr> a écrit :

 Objet: [ndnSIM] fib table in ndnSIM
 À: "ndnsim at lists.cs.ucla.edu" <ndnsim at lists.cs.ucla.edu>
 Date: Vendredi 17 avril 2015, 16h18
 
 Hi,
 How to
 show the contents of the FIB table in ndnSIM ?
 
 thank you
 
 
 -----La pièce jointe associée suit-----
 
 _______________________________________________
 ndnSIM mailing list
 ndnSIM at lists.cs.ucla.edu
 http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim


  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20150421/fe425053/attachment.html>


More information about the ndnSIM mailing list