File: ns3-47.diff

package info (click to toggle)
simgrid 4.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 39,236 kB
  • sloc: cpp: 124,918; ansic: 66,744; python: 8,560; java: 6,773; fortran: 6,079; f90: 5,123; xml: 4,587; sh: 2,194; perl: 1,436; makefile: 111; lisp: 49; javascript: 7; sed: 6
file content (32 lines) | stat: -rw-r--r-- 1,670 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Adapt to the recent ns3 API change. Picked from upstream.

diff --git a/examples/cpp/network-ns3/s4u-network-ns3-timed.tesh b/examples/cpp/network-ns3/s4u-network-ns3-timed.tesh
index 23ec6c55de..dab74fe29d 100644
--- a/examples/cpp/network-ns3/s4u-network-ns3-timed.tesh
+++ b/examples/cpp/network-ns3/s4u-network-ns3-timed.tesh
@@ -25,6 +25,7 @@ $ ${bindir:=.}/s4u-network-ns3 ${platfdir}/small_platform_one_link_routes.xml ${
 
 p One cluster
 
+! output ignore
 $ ${bindir:=.}/s4u-network-ns3 ${platfdir}/cluster_backbone.xml ${srcdir}/one_cluster_d.xml --cfg=network/model:ns-3 "--log=root.fmt:[%h:%a(%i)%e%r]%e[%c/%p]%e%m%n"
 > [:maestro(0) 0.000000] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'ns-3'
 > [node-6.simgrid.org:worker(2) 0.021502] [s4u_test/INFO] FLOW[1] : Receive 100 bytes from node-2.simgrid.org to node-6.simgrid.org
diff --git a/src/kernel/resource/models/network_ns3.cpp b/src/kernel/resource/models/network_ns3.cpp
index 9a7034cb9a..9288e64e70 100644
--- a/src/kernel/resource/models/network_ns3.cpp
+++ b/src/kernel/resource/models/network_ns3.cpp
@@ -354,8 +354,13 @@ UdpTraceClient=0*/
 
   s4u::Engine::on_platform_created_cb([]() {
     /* Create the ns3 topology based on routing strategy */
+#if NS3_MINOR_VERSION < 47
     ns3::GlobalRouteManager::BuildGlobalRoutingDatabase();
     ns3::GlobalRouteManager::InitializeRoutes();
+#else
+    ns3::GlobalRouteManager<Ipv4Manager>::BuildGlobalRoutingDatabase();
+    ns3::GlobalRouteManager<Ipv4Manager>::InitializeRoutes();
+#endif
   });
   routing::on_cluster_creation.connect(&clusterCreation_cb);
   routing::NetZoneImpl::on_route_creation.connect(&routeCreation_cb);