[ndnSIM] Print PIT table

hakima khelifi khelifihakima22 at yahoo.fr
Sun Jan 6 23:36:50 PST 2019


 Okay, Thank you. 

    On Monday, January 7, 2019, 1:57:29 AM GMT+8, Spyridon (Spyros) Mastorakis <mastorakis at cs.ucla.edu> wrote:  
 
 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,
>> 
> 
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20190107/31ac0c11/attachment.html>


More information about the ndnSIM mailing list