[ndnSIM] How to print FIB table?

Muhammad Hosain Abdollahi Sabet mhasabet at gmail.com
Wed Feb 22 03:33:43 PST 2017


That is it! You're right. Thank you.

This is anyone interested:

printFIB(Ptr<Node> node)
{
    const nfd::Fib& fib =
node->GetObject<ndn::L3Protocol>()->getForwarder()->getFib();
    for (nfd::Fib::const_iterator entry = fib.begin(); entry != fib.end();
entry++)
      cout<<entry->getPrefix()<<std::endl;
    cout<<std::endl;
}

--
Sabet

On Mon, Feb 20, 2017 at 10:33 PM, Junxiao Shi <shijunxiao at email.arizona.edu>
wrote:

> Hi Sabet
>
> void
>> printFIB(Ptr<Node> node)
>> {
>>     auto fib = node->GetObject<ndn::L3Protoco
>> l>()->getForwarder()->getFib();
>>
> This line is trying to copy Fib type because 'auto' is deduced as
> 'nfd::Fib' value type. Change it to 'const nfd::Fib&' and this should
> compile.
>
>     cout<<std::endl<<fib.size()<<std::endl;
>> }
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20170222/71c23397/attachment.html>


More information about the ndnSIM mailing list