examples: Modifying examples to work with the new codebase
diff --git a/examples/ndn-congestion-topo-plugin.cpp b/examples/ndn-congestion-topo-plugin.cpp
index 0a6a58b..3518873 100644
--- a/examples/ndn-congestion-topo-plugin.cpp
+++ b/examples/ndn-congestion-topo-plugin.cpp
@@ -17,20 +17,22 @@
*
* Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
+
// ndn-congestion-topo-plugin.cc
+
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
-using namespace ns3;
+namespace ns3 {
/**
* This scenario simulates a grid topology (using topology reader module)
*
- * /------\ /------\
+ * /------\ /------\
* | Src1 |<--+ +-->| Dst1 |
* \------/ \ / \------/
- * \ /
+ * \ /
* +-->/------\ "bottleneck" /------\<-+
* | Rtr1 |<===============>| Rtr2 |
* +-->\------/ \------/<-+
@@ -56,10 +58,13 @@
// Install NDN stack on all nodes
ndn::StackHelper ndnHelper;
- ndnHelper.SetForwardingStrategy("ns3::ndn::fw::BestRoute");
+ ndnHelper.SetContentStoreChoice(false);
ndnHelper.SetContentStore("ns3::ndn::cs::Lru", "MaxSize", "10000");
ndnHelper.InstallAll();
+ // Choosing forwarding strategy
+ ndn::StrategyChoiceHelper::InstallAll("/prefix", "/localhost/nfd/strategy/best-route");
+
// Installing global routing interface on all nodes
ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
ndnGlobalRoutingHelper.InstallAll();
@@ -109,3 +114,12 @@
return 0;
}
+
+
+} // namespace ns3
+
+int
+main(int argc, char* argv[])
+{
+ return ns3::main(argc, argv);
+}