[ndnSIM] Resending Interest from forwarding strategy using a PIT entry

Susmit susmit at cs.colostate.edu
Thu Oct 5 16:22:44 PDT 2017


I ended up using the following code. This is a hack and there is probably a
better way of doing this.
It works for resending the Interests but incoming data is silently dropped
at the node.

I printed the InRecords before sending the Interests - some of them are
empty.
I am not sure why this would be but I think this is why incoming data is
getting dropped.

Do you know if I need to set them explicitly before resending the Interests
(insertOrUpdateInRecord)?
Thanks.

==

    for (auto pitEntry = pit.begin(); pitEntry != pit.end(); pitEntry++ ){
        if (boost::algorithm::contains(pitEntry->getName().toUri(),
"/ndnSIM")) {
          std::cout<< "Resending Interest " <<
pitEntry->getInterest().getName() <<std::endl;
          auto convPitEntry = pit.find(pitEntry->getInterest());
          this->sendInterest(convPitEntry, *addFace,
convPitEntry->getInterest());
        }



On Thu, Oct 5, 2017 at 1:15 PM, Spyridon (Spyros) Mastorakis <
mastorakis at cs.ucla.edu> wrote:

> Do you think you could try std::ref then?
>
> http://en.cppreference.com/w/cpp/utility/functional/ref
>
> Thanks,
>
> Spyridon (Spyros) Mastorakis
> Personal Website: http://cs.ucla.edu/~mastorakis/
> Internet Research Laboratory
> Computer Science Department
> UCLA
>
> On Oct 4, 2017, at 9:22 PM, Susmit <susmit at cs.colostate.edu> wrote:
>
> Hi Spyros,
>
> Yes, I have. Unfortunately, that does not work either.
>
> this->sendInterest(*(*pitEntry), *addFace, pitEntry->getInterest());
>
> "error: no match for ‘operator*’ (operand type is ‘const nfd::pit::Entry’)
>              this->sendInterest(*(*pitEntry), *addFace,
> pitEntry->getInterest());"
>
>
> Full error log is here: https://paste.fedoraproject.
> org/paste/G9FfAct-CMa8bIq~-z4OWg
>
> Thanks.
>
> On Wed, Oct 4, 2017 at 9:54 PM, Spyridon (Spyros) Mastorakis <
> mastorakis at cs.ucla.edu> wrote:
>
>> Hi Susmit,
>>
>> have you tried to pass something like *(*pitEntry)?
>>
>> Thanks,
>>
>> Spyridon (Spyros) Mastorakis
>> Personal Website: http://cs.ucla.edu/~mastorakis/
>> Internet Research Laboratory
>> Computer Science Department
>> UCLA
>>
>> On Oct 4, 2017, at 8:18 PM, Susmit <susmit at cs.colostate.edu> wrote:
>>
>> Hi All,
>>
>> I am trying to resend an Interest from a strategy. I am having trouble
>> using the pit entry, not sure if I am missing something trivial.
>>
>> Below is the code snippets I tried:
>>
>> nfd::Pit& pit = node0->getForwarder()->getPit();
>> std::cout << pit.size() << std::endl; //works
>>
>> for (auto pitEntry = pit.begin(); pitEntry != pit.end(); pitEntry++ ){
>>       if (boost::algorithm::contains(pitEntry->getName().toUri(),
>> "/ndnSIM")) {
>>           this->sendInterest(*pitEntry, *addFace,
>> pitEntry->getInterest());
>>       }
>> This returns "no known conversion for argument 1 from ‘const
>> nfd::pit::Entry’ to ‘const std::shared_ptr<nfd::pit::Entry>&".
>>
>>
>> If I change the last line to :
>>             this->sendInterest(make_shared<pit::Entry>(*pitEntry),
>> *addFace, pitEntry->getInterest());
>> I get an error: : "nfd::pit::Entry::Entry(const nfd::pit::Entry&)’ is
>> implicitly deleted because the default definition would be ill-formed".
>>
>> I did not find a method in the pit.hpp or pit-entry.hpp that returns a
>> shared_ptr for a pit entry.
>> So, how do I send out an Interest from the strategy? Any help is
>> appreciated.
>>
>> Thanks.
>>
>>
>>
>> --
>>
>> ====================================
>> http://www.cs.colostate.edu/~susmit
>> ====================================
>>
>>
>>
>> _______________________________________________
>> ndnSIM mailing list
>> ndnSIM at lists.cs.ucla.edu
>> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>>
>>
>
>
> --
>
> ====================================
> http://www.cs.colostate.edu/~susmit
> ====================================
>
>
>
> _______________________________________________
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
> http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim
>
>


-- 

====================================
http://www.cs.colostate.edu/~susmit
====================================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20171005/e9801600/attachment-0001.html>


More information about the ndnSIM mailing list