<div dir="ltr">Thanks. Do we make patches against<div><pre>git://<a href="http://github.com/cawka/ns-3-dev-ndnSIM.git">github.com/cawka/ns-3-dev-ndnSIM.git</a></pre><pre><br></pre><pre>I may implement this in AppHelper and also a zipf for file sizes as well.</pre>
<pre><br></pre><pre>Thanks,</pre><pre>Josh</pre></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, May 11, 2014 at 11:03 PM, Alex Afanasyev <span dir="ltr"><<a href="mailto:alexander.afanasyev@ucla.edu" target="_blank">alexander.afanasyev@ucla.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Josh,<br>
<br>
Unfortunately, as of right now, you have to do a little bit more job than that.<br>
<br>
You have to iterate over all nodes (NS-3 has a global variable for that) and check their names. Something like that:<br>
<br>
for (NodeList::Iterator node = NodeList::Begin(); node != NodeList::End(); node++)<br>
  {<br>
    if (Names::FindName (*node).compare (0, sizeof("consumer-"), "consumer-") == 0)<br>
      {<br>
        consumerHelper.Install (*node);<br>
      }<br>
  }<br>
<br>
If you can spend some time and implement a generic way for doing this in AppHelper, I would be happy to merge that code in.<br>
<br>
---<br>
Alex<br>
<div><div class="h5"><br>
<br>
On May 11, 2014, at 10:27 PM, Josh J <<a href="mailto:joshjdevl@gmail.com">joshjdevl@gmail.com</a>> wrote:<br>
<br>
> Hi,<br>
><br>
> I would like to install the consumer helper on all nodes which begin with "consumer", so I tried the following though receive a segfault. Is there a way I can find and match all nodes beginning with a certain name?<br>

><br>
>   // Consumer<br>
>   ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerZipfMandelbrot");<br>
>   // Consumer will request /prefix/0, /prefix/1, ...<br>
>   consumerHelper.SetPrefix ("/producer1");<br>
>   consumerHelper.SetAttribute ("Frequency", StringValue ("10")); // 10 interests a second<br>
>   consumerHelper.SetAttribute("Randomize",    StringValue ("uniform"));<br>
>   consumerHelper.Install (Names::Find<Node>("consumer*"));<br>
><br>
><br>
> Thanks,<br>
> Josh<br>
</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" target="_blank">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a><br>
<br>
</blockquote></div><br></div>