<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi,<div class=""><br class=""></div><div class="">please take a look at the related documentation:</div><div class=""><br class=""></div><div class=""><a href="http://ndnsim.net/2.3/helpers.html#forwarding-strategy" class="">http://ndnsim.net/2.3/helpers.html#forwarding-strategy</a></div><div class=""><a href="http://ndnsim.net/2.3/fw.html#writing-your-own-custom-strategy" class="">http://ndnsim.net/2.3/fw.html#writing-your-own-custom-strategy</a></div><div class=""><br class=""></div><div class="">Thanks,</div><div class=""><br class=""><div class="">
<div class=""><div class=""><div class=""><span class="" style="float: none; display: inline !important;">Spyridon (Spyros) Mastorakis</span><br class=""><span class="" style="float: none; display: inline !important;">Personal Website: </span><a href="http://cs.ucla.edu/~mastorakis/" class="">http://cs.ucla.edu/~mastorakis/</a><br class=""><span class="" style="float: none; display: inline !important;">Internet Research Laboratory</span><br class=""><span class="" style="float: none; display: inline !important;">Computer Science Department</span><br class=""><span class="" style="float: none; display: inline !important;">UCLA</span></div></div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Apr 24, 2017, at 7:50 AM, Michał Król <<a href="mailto:mharnen@gmail.com" class="">mharnen@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Dear All,<br class=""><br class="">I'm trying to send a new Interest packet from my forwarding strategy (for signaling reasons). So after I get an interest for data I forward it, and want to generate and broadcast another one to my neighbors.<br class=""><br class="">I tried to modify the code from ndn-app.cpp as that's the only "example" I found. However, the interest is not passed to the Forwarder and I'm not sure how to do it. The callback "afterSendInterest" is invoked.<br class=""><br class="">I'm wondering if I can use "NullTransport" for that (as it's done for ndn-app) or I need a different one?<br class=""><br class="">Is it the right way to implement a signaling protocol in my forwarding strategy?<br class=""><br class="">I would be grateful for any advices/comments.<br class=""><br class=""><br class="">Regards,<br class=""><br class="">Michał Król<br class=""><br class=""><br class=""><br class="">//create and add a face<br class=""><br class="">  auto genericLink = make_unique<nfd::face::GenericLinkService>();<br class="">  auto transport = make_unique<ns3::ndn::NullTransport>("appFace://", "appFace://",<br class="">::ndn::nfd::FACE_SCOPE_LOCAL);<br class="">  m_face = std::make_shared<Face>(std::move(genericLink), std::move(transport));<br class="">  m_genericLinkService = static_cast<nfd::face::GenericLinkService*>(m_face->getLinkService());<br class="">  m_face->setMetric(1);<br class="">  m_forwarder.addFace(m_face);<br class=""><br class=""><br class="">//connect callbacks<br class="">  m_genericLinkService->afterReceiveData.connect([this] (Data data) {<br class="">                      onData(data);<br class="">                        });<br class=""><br class="">  m_genericLinkService->afterSendInterest.connect([this] (Interest interest) {<br class="">                      afterInterest(interest);<br class="">                        });<br class=""><br class=""><br class="">//send an interest<br class=""><br class="">  shared_ptr<Name> name = make_shared<Name>("/signaling");<br class="">  shared_ptr<Interest> interest = make_shared<Interest>();<br class="">  interest->setName(*name);<br class=""><br class="">  m_genericLinkService->sendInterest(*interest);<br class=""><br class=""><br class=""></div></div></blockquote></div><br class=""></div></body></html>