<div dir="ltr">I think using the Simulator::ScheduleWithContext would be the best, as Alex just suggested.<div><br></div><div>However, what is the behavior if you tried something like:</div><div><br></div><div>

<div style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><div>void</div><div>BroadcastStrategy::<wbr>afterReceiveInterest(const Face& inFace, const Interest& interest,const shared_ptr<pit::Entry>& pitEntry)</div><div>{</div></div><div style="font-size:12.8px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><div>  const fib::Entry& fibEntry = this->lookupFib(*pitEntry);</div><div>  const fib::NextHopList& nexthops = fibEntry.getNextHops(); </div><div>  </div><div> <b>int contextVal = ns3::Simulator::GetContext();</b></div><div><b><br></b></div><div><b> if(contextVal != -1) </b></div><div><b> {</b></div><div><b>    ns3::Ptr<ns3::Node> node = ns3::NodeList::GetNode(contextVal);  </b></div><div>    ns3::Ptr<ns3::NetDevice> netDevice;</div><div>    ns3::Ptr<ns3::ndn::L3Protocol> ndnl3;</div><div>    ndnl3 = node->GetObject<ns3::ndn::<wbr>L3Protocol>(); </div><div> }</div></div>

<br></div><div><br></div><div>//...........</div><div><br></div><div>Thoughts?</div><div><br></div><div>John</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jun 13, 2018 at 8:33 PM, Adhy Satya <span dir="ltr"><<a href="mailto:adhysatya820@gmail.com" target="_blank">adhysatya820@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I wrote a custom fw-strategy where I get the node ID like so:</div><div><br></div><div><div>void</div><div>BroadcastStrategy::<wbr>afterReceiveInterest(const Face& inFace, const Interest& interest,const shared_ptr<pit::Entry>& pitEntry)</div><div>{</div></div><div><div>  const fib::Entry& fibEntry = this->lookupFib(*pitEntry);</div><div>  const fib::NextHopList& nexthops = fibEntry.getNextHops(); </div><div>  </div><div>  </div><div>  ns3::Ptr<ns3::Node> node = ns3::NodeList::GetNode(ns3::<wbr>Simulator::GetContext());  </div><div>  ns3::Ptr<ns3::NetDevice> netDevice;</div><div>  ns3::Ptr<ns3::ndn::L3Protocol> ndnl3;</div><div>  ndnl3 = node->GetObject<ns3::ndn::<wbr>L3Protocol>(); </div></div><div><br></div><div><br></div><div>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" target="_blank">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><br></div><div>I can't apply the solution from this posts in my case, since I don't call Simulator::<wbr>ScheduleWithContext(). I just want to get the id of the node that is processing the Interest.</div><div><br></div><div>Is there another option to this?</div><div><br></div><div>I'm using ndnSIM 2.5</div><div><br></div><div>Thank you!</div><span class="HOEnZb"><font color="#888888"><div>Adhy</div><div><br></div></font></span></div>
<br>______________________________<wbr>_________________<br>
ndnSIM mailing list<br>
<a href="mailto:ndnSIM@lists.cs.ucla.edu">ndnSIM@lists.cs.ucla.edu</a><br>
<a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" rel="noreferrer" target="_blank">http://www.lists.cs.ucla.edu/<wbr>mailman/listinfo/ndnsim</a><br>
<br></blockquote></div><br></div>