[ndnSIM] NDN FIB
Alex Afanasyev
alexander.afanasyev at ucla.edu
Tue Apr 23 11:40:20 PDT 2013
Hi again,
There is no tracer for FIB content, since it is (it was) not intended to be dynamically modified. If you need to print out FIB contents (e.g., periodically, using Simulator::Schedule), there are a couple of ways. If you don't care about the format, you can do the following:
input: Ptr<Node> node;
std::cout << *node->GetObject<ndn::Fib> () << std::endl;
If you need more precise control over what is printed out, it is also possible, but a little bit more complicated:
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 () << std::endl;
...
}
---
Alex
On Apr 23, 2013, at 12:33 AM, Xee <1839750381 at qq.com> wrote:
> Hi Alex
>
> I need to print FIB entries, how can I get that. Is there any tracer to print fib entries ?
>
> rgd,
> -Xee
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
More information about the ndnSIM
mailing list