<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jun 13, 2018, at 8:33 PM, Adhy Satya <<a href="mailto:adhysatya820@gmail.com" class="">adhysatya820@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi,<div class=""><br class=""></div><div class="">I wrote a custom fw-strategy where I get the node ID like so:</div><div class=""><br class=""></div><div class=""><div class="">void</div><div class="">BroadcastStrategy::afterReceiveInterest(const Face& inFace, const Interest& interest,const shared_ptr<pit::Entry>& pitEntry)</div><div class="">{</div></div><div class=""><div class="">  const fib::Entry& fibEntry = this->lookupFib(*pitEntry);</div><div class="">  const fib::NextHopList& nexthops = fibEntry.getNextHops(); </div><div class="">  </div><div class="">  </div><div class="">  ns3::Ptr<ns3::Node> node = ns3::NodeList::GetNode(ns3::Simulator::GetContext());  </div><div class="">  ns3::Ptr<ns3::NetDevice> netDevice;</div><div class="">  ns3::Ptr<ns3::ndn::L3Protocol> ndnl3;</div><div class="">  ndnl3 = node->GetObject<ns3::ndn::L3Protocol>(); </div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">The issue is that I'm getting the exact same error as <a href="http://www.lists.cs.ucla.edu/pipermail/ndnsim/2017-October/004175.html" class="">this post from Oct 2017</a>. There are several other posts with the same issue, some want to get the node id in the lru-cache, etc. However, all these posts seem to be scheduling an event, then getting with Simulator::GetContext().</div><div class=""><br class=""></div><div class="">I can't apply the solution from this posts in my case, since I don't call Simulator::ScheduleWithContext(). I just want to get the id of the node that is processing the Interest.</div><div class=""><br class=""></div><div class="">Is there another option to this?</div></div></div></blockquote><div><br class=""></div><div>Whether you're scheduling with context or not, events are executed in the context.  afterReceiveInterest will be executed in the context of the node, so the solution from the old post still works.</div><div><br class=""></div><div>--</div><div>Alex</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">I'm using ndnSIM 2.5</div><div class=""><br class=""></div><div class="">Thank you!</div><div class="">Adhy</div><div class=""><br class=""></div></div>
_______________________________________________<br class="">ndnSIM mailing list<br class=""><a href="mailto:ndnSIM@lists.cs.ucla.edu" class="">ndnSIM@lists.cs.ucla.edu</a><br class=""><a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" class="">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a><br class=""></div></blockquote></div><br class=""><div class="">
<div dir="auto" style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="color: rgb(0, 0, 0); letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">______________<br class="">Alex Afanasyev<br class="">Assistant Professor, SCIS, Florida International University<br class="">11200 SW 8th Street, ECS Room 261B, Miami, FL 33199<br class="">phone: +1.305.348.4960 (office); <a href="mailto:aa@cs.fiu.edu" class="">email: aa@cs.fiu.edu</a><br class="">web: <a href="https://users.cs.fiu.edu/~afanasyev/" class="">https://users.cs.fiu.edu/~afanasyev/</a><br class=""><br class=""></div></div></div>
</div>
<br class=""></body></html>