[ndnSIM] node names find matching prefix
alexander.afanasyev at ucla.edu
Sun May 11 23:03:42 PDT 2014
Unfortunately, as of right now, you have to do a little bit more job than that.
You have to iterate over all nodes (NS-3 has a global variable for that) and check their names. Something like that:
for (NodeList::Iterator node = NodeList::Begin(); node != NodeList::End(); node++)
if (Names::FindName (*node).compare (0, sizeof("consumer-"), "consumer-") == 0)
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.
On May 11, 2014, at 10:27 PM, Josh J <joshjdevl at gmail.com> wrote:
> 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?
> // Consumer
> ndn::AppHelper consumerHelper ("ns3::ndn::ConsumerZipfMandelbrot");
> // Consumer will request /prefix/0, /prefix/1, ...
> consumerHelper.SetPrefix ("/producer1");
> consumerHelper.SetAttribute ("Frequency", StringValue ("10")); // 10 interests a second
> consumerHelper.SetAttribute("Randomize", StringValue ("uniform"));
> consumerHelper.Install (Names::Find<Node>("consumer*"));
> ndnSIM mailing list
> ndnSIM at lists.cs.ucla.edu
More information about the ndnSIM