Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
use new name for wifi standard in recent NS3.
authorAugustin Degomme <adegomme@gmail.com>
Tue, 15 Dec 2020 11:00:00 +0000 (12:00 +0100)
committerAugustin Degomme <adegomme@gmail.com>
Tue, 15 Dec 2020 11:00:00 +0000 (12:00 +0100)
include/simgrid/config.h.in
src/surf/network_ns3.cpp
tools/cmake/Modules/FindNS3.cmake

index b0252b0..504204f 100644 (file)
@@ -21,5 +21,5 @@
 #cmakedefine01 SIMGRID_HAVE_MC
 /* Was the ns-3 support compiled in? */
 #cmakedefine01 SIMGRID_HAVE_NS3
-
+#cmakedefine NS3_MINOR_VERSION @NS3_MINOR_VERSION@ 
 #endif /* SIMGRID_PUBLIC_CONFIG_H */
index 1751d3e..bc81977 100644 (file)
@@ -80,7 +80,11 @@ static void zoneCreation_cb(simgrid::s4u::NetZone const& zone) {
     simgrid::kernel::routing::WifiZone* wifizone = dynamic_cast<simgrid::kernel::routing::WifiZone*> (zone.get_impl());
     if (wifizone == nullptr) return;
 
+#if NS3_MINOR_VERSION < 32
     wifi.SetStandard(ns3::WIFI_PHY_STANDARD_80211n_5GHZ);
+#else
+    wifi.SetStandard(ns3::WIFI_STANDARD_80211n_5GHZ);
+#endif
 
     std::string ssid = wifizone->get_name();
     const char* mcs = wifizone->get_property("mcs");
index 5a3a120..11ea8e0 100644 (file)
@@ -75,6 +75,7 @@ if(NS3_INCLUDE_DIR)
     endif()
 
     string(REGEX REPLACE ".*ns([.0-9]+)-core.*" "\\1" NS3_VERSION "${NS3_LIBRARIES}")
+    string(REGEX REPLACE "3.([.0-9]+)" "\\1" NS3_MINOR_VERSION "${NS3_VERSION}")
     get_filename_component(NS3_LIBRARY_PATH "${NS3_LIBRARIES}" PATH)
 
     # Compute NS3_PATH