<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Hi Isuru,</div><div><br></div><div>You may be having a code inconsistency effect.  Did you install the modified and compiled NS-3 code and recompiled the scenario code afterwards?   If so, are you using the same model (debug or optimized) in both?</div><div><br></div><div>I had similar problem when I accidentally installed debug version of NS-3 (and I had previously installed optimized version of unmodified NS-3), then compiled scenario in optimized mode.   Everything got compiled (the header files are correct), but then I was getting run time errors (the actual library is wrong).</div><div><br></div><div>---</div><div>Alex</div><br><div><div>On Dec 17, 2013, at 5:02 AM, <a href="mailto:i.liyanage@surrey.ac.uk">i.liyanage@surrey.ac.uk</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr" tabindex="0" fpstyle="1" aria-label="Message body" id="" style="font-family: Menlo-Regular; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div name="divtagdefaultwrapper" id="divtagdefaultwrapper" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; margin: 0px;"><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">Hi Alex,</div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><br></div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">I tried writing the code in ndnSIM/apps folder and it worked fine.</div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><br></div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">But when I use the same code in scenario folder (used scenario template of yours) it fails as i mentioned. </div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><br></div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">It must be something regarded to the scenario template.....</div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">As if I include the file "ns3/ndn-forwarding-strategy.h" it says my variable(set container) is not defined, </div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><font color="#808080">../extensions/<a href="http://testsimple.cc/">testsimple.cc</a>:109:19: error: ‘class ns3::ndn::ForwardingStrategy’ has no member named ‘m_allowCS’</font></div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">so I have to include the complete path to the above header file. Then it compiles fine. but end abruptly. </div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><br></div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><br></div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">In the terminal I just want to confirm whether the program works by looking at the log messages.</div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><br></div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">I attached the following files which I modified.</div><div style="margin-top: 0px; margin-bottom: 0px;">../scenario/extensions/testsimple.h         -       modified from ndn-producer</div><div style="margin-top: 0px; margin-bottom: 0px;">../scenario/extensions/<a href="http://testsimple.cc/">testsimple.cc</a></div><div style="margin-top: 0px; margin-bottom: 0px;">../scenario/scenarios/<a href="http://simple.cc/">simple.cc</a><span class="Apple-converted-space"> </span>              -       modified from ndn-simple</div><div style="margin-top: 0px; margin-bottom: 0px;"><br></div><div style="margin-top: 0px; margin-bottom: 0px;">ndnSIM/model/fw/ndn-forwarding-strategy.h</div><div style="margin-top: 0px; margin-bottom: 0px;">ndnSIM/model/fw/<a href="http://ndn-forwarding-strategy.cc/">ndn-forwarding-strategy.cc</a></div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><br></div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">Many Thanks,</div><div style="margin-top: 0px; margin-bottom: 0px; font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">Isuru</div><div style="color: rgb(40, 40, 40); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;"><hr tabindex="-1" style="display: inline-block; width: 753px;"><div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size: 11pt;"><b>From:</b><span class="Apple-converted-space"> </span>Alexander Afanasyev <<a href="mailto:cawka1@gmail.com">cawka1@gmail.com</a>> on behalf of Alex Afanasyev <<a href="mailto:alexander.afanasyev@ucla.edu">alexander.afanasyev@ucla.edu</a>><br><b>Sent:</b><span class="Apple-converted-space"> </span>16 December 2013 21:30<br><b>To:</b><span class="Apple-converted-space"> </span>Liyanage IU Mr (PG/R - Electronic Eng)<br><b>Cc:</b><span class="Apple-converted-space"> </span>ndnsim<br><b>Subject:</b><span class="Apple-converted-space"> </span>Re: [ndnSIM] declaring a variable in ndn-forwarding-strategy</font><div> </div></div><div><div>Hi Isuru,</div><div><br></div><div>I have tried to follow your implementation (added set container in the forwarding strategy and the added a prefix in StartApplication).  Everything worked as expected.</div><div><br></div><div>If you can share your code, I can try to run it and see what is wrong.</div><div><br></div><div>Btw. What are you expecting to see on the terminal?</div><div><br></div><div>---s</div><div>Alex</div><br><div><div>On Dec 16, 2013, at 12:37 PM, <<a href="mailto:i.liyanage@surrey.ac.uk">i.liyanage@surrey.ac.uk</a>> <<a href="mailto:i.liyanage@surrey.ac.uk">i.liyanage@surrey.ac.uk</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr" tabindex="0" style="font-family: Menlo-Regular; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;"><div name="divtagdefaultwrapper" id="divtagdefaultwrapper" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; margin: 0px;"><div style="margin-top: 0px; margin-bottom: 0px;">Hi Alex,</div><div style="margin-top: 0px; margin-bottom: 0px;"><br></div><div style="margin-top: 0px; margin-bottom: 0px;">I compiled without the -d optimized and ran without the visualizer. </div><div style="margin-top: 0px; margin-bottom: 0px;">Then it just compile and nothing is displayed in the terminal.</div><div style="margin-top: 0px; margin-bottom: 0px;"><br></div><div style="margin-top: 0px; margin-bottom: 0px;">I entered the code in StartApplication() function.</div><div style="margin-top: 0px; margin-bottom: 0px;"><br></div><div style="margin-top: 0px; margin-bottom: 0px;">I was trying to build a collaborative caching application.</div><div style="margin-top: 0px; margin-bottom: 0px;"><br></div><div style="margin-top: 0px; margin-bottom: 0px;"><font color="#808080">Ptr<ForwardingStrategy> forwardingstat = GetNode()->GetObject<ForwardingStrategy>();</font></div><div style="margin-top: 0px; margin-bottom: 0px;"><font color="#808080">Ptr<Name> inName = Create<ndn::Name> ("/prefix/thisfix/");</font></div><div style="margin-top: 0px; margin-bottom: 0px;"><font color="#ff0000">forwardingstat->addAllowCS(inName);</font></div><div style="margin-top: 0px; margin-bottom: 0px;"><font color="#ff0000"><br></font></div><div style="margin-top: 0px; margin-bottom: 0px;">If I comment out the third line(line in red) it works fine.</div><div style="margin-top: 0px; margin-bottom: 0px;"><br></div><div style="margin-top: 0px; margin-bottom: 0px;">Many Thanks,</div><div style="margin-top: 0px; margin-bottom: 0px;">Isuru</div><div style="color: rgb(40, 40, 40);"><hr tabindex="-1" style="display: inline-block; width: 747px;"><div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size: 11pt;"><b>From:</b><span class="Apple-converted-space"> </span>Alexander Afanasyev <<a href="mailto:cawka1@gmail.com">cawka1@gmail.com</a>> on behalf of Alex Afanasyev <<a href="mailto:alexander.afanasyev@ucla.edu">alexander.afanasyev@ucla.edu</a>><br><b>Sent:</b><span class="Apple-converted-space"> </span>16 December 2013 19:47<br><b>To:</b><span class="Apple-converted-space"> </span>Liyanage IU Mr (PG/R - Electronic Eng)<br><b>Cc:</b><span class="Apple-converted-space"> </span>ndnsim<br><b>Subject:</b><span class="Apple-converted-space"> </span>Re: [ndnSIM] declaring a variable in ndn-forwarding-strategy</font><div> </div></div><div><div>Hi Isuru,</div><div><br></div><div>Are you running simulation in the visualizer?  Try to run without it and in debug mode (in case you have compiled with ./waf configure -d optimized, re-compile with ./waf configure -d debug or just ./waf configure).</div><div><br></div><div>The variable declaration seems right.  The problem that I could think of is that you're trying to use it in application's constructor, when neither Node() nor strategy objects are not yet set.</div><div><br></div><div>Btw. What the effect you're trying to achieve?  Normally (in "real world") applications cannot directly communicate with the forwarding daemon.  Or is it something that is simulation-specific?</div><div><br></div><div>---</div><div>Alex</div><br><div><div>On Dec 16, 2013, at 11:43 AM, <<a href="mailto:i.liyanage@surrey.ac.uk">i.liyanage@surrey.ac.uk</a>> <<a href="mailto:i.liyanage@surrey.ac.uk">i.liyanage@surrey.ac.uk</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr" tabindex="0" style="font-family: Menlo-Regular; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;"><div name="divtagdefaultwrapper" id="divtagdefaultwrapper" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; margin: 0px;"><div style="margin-top: 0px; margin-bottom: 0px;">Hi Alex,</div><div style="margin-top: 0px; margin-bottom: 0px;"><br></div><div style="margin-top: 0px; margin-bottom: 0px;">It terminates without anything once I click the simulate button. </div><div style="margin-top: 0px; margin-bottom: 0px;">I will try with the debugger as well.</div><div style="margin-top: 0px; margin-bottom: 0px;"><br></div><div style="margin-top: 0px; margin-bottom: 0px;">Could you suggest me a way to declare this kind of variable which could be accessed in both forwadingStrategy class and in an application.</div><div style="margin-top: 0px; margin-bottom: 0px;"><br></div><div style="margin-top: 0px; margin-bottom: 0px;">Many Thanks,</div><div style="margin-top: 0px; margin-bottom: 0px;">Isuru</div><div style="color: rgb(40, 40, 40);"><hr tabindex="-1" style="display: inline-block; width: 747px;"><div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size: 11pt;"><b>From:</b><span class="Apple-converted-space"> </span>Alexander Afanasyev <<a href="mailto:cawka1@gmail.com">cawka1@gmail.com</a>> on behalf of Alex Afanasyev <<a href="mailto:alexander.afanasyev@ucla.edu" title="mailto:alexander.afanasyev@ucla.edu
Ctrl+click or tap to follow link">alexander.afanasyev@ucla.edu</a>><br><b>Sent:</b><span class="Apple-converted-space"> </span>16 December 2013 19:26<br><b>To:</b><span class="Apple-converted-space"> </span>Liyanage IU Mr (PG/R - Electronic Eng)<br><b>Cc:</b><span class="Apple-converted-space"> </span>ndnsim<br><b>Subject:</b><span class="Apple-converted-space"> </span>Re: [ndnSIM] declaring a variable in ndn-forwarding-strategy</font><div> </div></div><div><div>Is it just terminates without any output or terminates with an error?</div><div><br></div><div>If it is an error, then try to run in a debugger, so you can see what exactly is causing the error.  For example,</div><div><br></div><div>./waf --run <scenario> --command-template 'gdb --args %s'</div><div><br></div><div>---</div><div>Alex</div><br><div><div>On Dec 15, 2013, at 10:17 AM, <<a href="mailto:i.liyanage@surrey.ac.uk">i.liyanage@surrey.ac.uk</a>> <<a href="mailto:i.liyanage@surrey.ac.uk">i.liyanage@surrey.ac.uk</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr" tabindex="0" style="font-family: Menlo-Regular; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;"><div name="divtagdefaultwrapper" id="divtagdefaultwrapper" style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; margin: 0px;">Hi,<div><br></div><div>In ndn-forwading-strategy.h, I declared variable.</div><div><font color="#808080">std::set<Name>  m_allowCS;</font></div><div><br></div><div>and tried to access in one of the applications by following code</div><div><div><font color="#808080">Ptr<ForwardingStrategy> forwardingstat = GetNode()->GetObject<ForwardingStrategy>();</font></div><div><font color="#808080">Ptr<Name> inName = Create<ndn::Name> ("/prefix");</font></div><div><font color="#808080">forwardingstat->m_allowCS.insert(*inName);</font></div></div><div><br></div><div>This compiles fine.</div><div>but once I run this, simulator exit without any output. Could you point out what's wrong.</div><div><br></div><div>Many Thanks,</div><div>Isuru</div></div>_______________________________________________<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">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a></div></blockquote></div><br></div></div></div>_______________________________________________<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">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a></div></blockquote></div></div></div></div></div></blockquote></div><br></div></div></div><span><<a href="http://ndn-forwarding-strategy.cc">ndn-forwarding-strategy.cc</a>></span><span><ndn-forwarding-strategy.h></span><span><<a href="http://testsimple.cc">testsimple.cc</a>></span><span><testsimple.h></span><span><<a href="http://simple.cc">simple.cc</a>></span></div></blockquote></div><br></body></html>