<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hi Spyridon,</p>
    <p>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>
    </p>
    <br>
    <div class="moz-cite-prefix">On 25/04/17 01:22, Spyridon (Spyros)
      Mastorakis wrote:<br>
    </div>
    <blockquote
      cite="mid:28503AE9-7764-473A-A63B-48C778BE72FA@cs.ucla.edu"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      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>
          <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>
  </body>
</html>