<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>To use sendInterest function I need a corresponding PIT entry and
I don't have it for an interest I've just created. It's possible
to create it "manually", but m_forwarder giving access to the PIT
table is private in the base Strategy class (I wonder if it's for
a reason ;). <br>
</p>
<p>Anyway, I changed it to protected and it works. Just not sure if
it's the best way to do it. <br>
</p>
<p>Thank you for your help! <br>
</p>
<p>Michał<br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 26/04/17 03:20, Spyridon (Spyros)
Mastorakis wrote:<br>
</div>
<blockquote
cite="mid:3A41686A-1195-4FD2-B132-C6E9514BB4FC@cs.ucla.edu"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Hi,
<div class=""><br class="">
</div>
<div class="">you should be able to use the SendInterest method
directly from the afterReceiveInterest callback of your strategy
to send out the Interests that you need.</div>
<div class=""><br class="">
</div>
<div class="">Just make sure that there is a FIB entry for the
appropriate name.</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
moz-do-not-send="true"
href="http://cs.ucla.edu/%7Emastorakis/" 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 class=""><br class="">
</div>
</div>
</div>
</div>
<div>
<blockquote type="cite" class="">
<div class="">On Apr 24, 2017, at 11:08 PM, Michał Król <<a
moz-do-not-send="true" href="mailto:mharnen@gmail.com"
class="">mharnen@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<meta content="text/html; charset=utf-8"
http-equiv="Content-Type" class="">
<div bgcolor="#FFFFFF" text="#000000" class="">
<p class="">Hi Spyridon,</p>
<p class="">thank you for your answer. I've read both
before starting my strategy. However, I don't see
anything concerning creating and sending a custom
interest (not the one passed by the forwarder) from
the strategy. Am I missing something?<br class="">
</p>
<br class="">
<div class="moz-cite-prefix">On 25/04/17 01:22, Spyridon
(Spyros) Mastorakis wrote:<br class="">
</div>
<blockquote
cite="mid:28503AE9-7764-473A-A63B-48C778BE72FA@cs.ucla.edu"
type="cite" class="">
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" 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 moz-do-not-send="true"
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 moz-do-not-send="true"
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
moz-do-not-send="true"
href="http://cs.ucla.edu/%7Emastorakis/"
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 class="">
<blockquote type="cite" class="">
<div class="">On Apr 24, 2017, at 7:50 AM,
Michał Król <<a moz-do-not-send="true"
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>
</blockquote>
<br class="">
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</blockquote>
<br>
</body>
</html>