[ndnSIM] Print PIT table

Spyridon (Spyros) Mastorakis mastorakis at cs.ucla.edu
Sun Jan 6 09:57:21 PST 2019


Replace the namespace and use the following line to get the PIT object:

node->GetObject<ndn::L3Protocol>()->getForwarder()->getPit()

Then use the latest API to iterate over the PIT entries (the code you mentioned was from a very old and outdated version of ndnSIM).

Thanks,

Spyridon (Spyros) Mastorakis
Personal Website: http://cs.ucla.edu/~mastorakis/
Internet Research Laboratory
Computer Science Department
UCLA

> On Jan 6, 2019, at 4:39 PM, hakima khelifi <khelifihakima22 at yahoo.fr> wrote:
> 
> Thank you for your response.
> 
> 
> Yes, I know the namespace. But I want to print the PIT table during the simulation from my script?
> 
> If you can help me to call it from my script?
> 
> Thanks,
> On Sunday, January 6, 2019, 10:28:51 PM GMT+8, Spyridon (Spyros) Mastorakis <mastorakis at cs.ucla.edu> wrote:
> 
> 
> Hi,
> 
> as you can see Pit can be found under the nfd::pit namespace:
> 
> https://github.com/named-data/NFD/blob/master/daemon/table/pit.cpp
> 
> Thanks,
> 
> Spyridon (Spyros) Mastorakis
> Personal Website: http://cs.ucla.edu/~mastorakis/
> Internet Research Laboratory
> Computer Science Department
> UCLA
> 
>> On Jan 6, 2019, at 1:26 PM, hakima khelifi <khelifihakima22 at yahoo.fr> wrote:
>> 
>> Dear all,
>> 
>> 
>> I am trying to print the PIT table by using the following code:
>> 
>> void PeriodicStatsPrinter(Ptr<Node> node, Time next)
>> {
>>   Ptr<ndn::Pit> pit = node->GetObject<ndn::Pit> ();
>> 
>>   std::cout << Simulator::Now ().ToDouble (Time::S) << "\t"
>>             << node->GetId () << "\t"
>>             << Names::FindName (node) << "\t"
>>             << pit->GetSize () << "\n";
>>   
>>   Simulator::Schedule (next, PeriodicStatsPrinter, node, next);
>> }
>> 
>> However, it is not working and I am getting the error of: ‘Pit’ is not a member of ‘ns3: :nd n’.
>> 
>> Any guidelines!
>> Regards,
>> 
> 



More information about the ndnSIM mailing list