<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></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="">this method is executed every time a NACK is received. Therefore, your counter should be initialized when the consumer is initialized.</div><div class=""><br class=""></div><div class="">I am not sure whether you can access an application attribute from the simulation scenario. At least, I do not think I have tried to do so. Probably you can send an email to the NS-3 mailing list and ask.</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 class=""><br class=""></div></div></div></div><div><blockquote type="cite" class=""><div class="">On Sep 20, 2018, at 9:14 PM, madhurima buragohain <<a href="mailto:madhurimajya@gmail.com" class="">madhurimajya@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Dear All,</div><div class=""><br class=""></div><div class="">I want to count the number of NACK packets received in consumer.cpp  file.</div><div class=""><br class=""></div><div class="">I have declared a variable "count" in ndn-consumer.hpp to count the number of NACK packets received.<br class=""></div><div class=""><br class=""></div><div class="">void<br class="">Consumer::OnNack(shared_ptr<const lp::Nack> nack)</div><div class="">{</div><div class="">static int count=0;</div><div class="">count++;</div><div class="">.....<br class=""></div><div class="">}</div><div class=""><br class=""></div><div class="">I want to access the value "count " from the <a href="http://ndn-simple.cc" class="">ndn-simple.cc</a> file in scratch. <br class=""></div><div class="">How should I proceed?</div><div class=""><br class=""></div></div></div></blockquote></div><br class=""></div></body></html>