Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix NS3 and lua builds
[simgrid.git] / src / surf / network_ns3.cpp
index c82909d..e27db35 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2007-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 #include "ns3/core-module.h"
 #include "ns3/node.h"
 
-#include "ns3/ns3_interface.h"
 #include "ns3/ns3_simulator.h"
 #include "network_ns3.hpp"
 
-#include "simgrid/sg_config.h"
 #include "src/instr/instr_private.h" // TRACE_is_enabled(). FIXME: remove by subscribing tracing to the surf signals
 #include "src/kernel/routing/NetPoint.hpp"
-#include "src/surf/HostImpl.hpp"
-#include "src/surf/surf_private.h"
 
+#include "simgrid/s4u/Engine.hpp"
 #include "simgrid/s4u/NetZone.hpp"
-#include "simgrid/s4u/engine.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(ns3, surf, "Logging specific to the SURF network NS3 module");
 
@@ -97,13 +93,13 @@ static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoin
   if (link_list->size() == 1) {
     simgrid::surf::LinkNS3* link = static_cast<simgrid::surf::LinkNS3*>(link_list->at(0));
 
-    XBT_DEBUG("Route from '%s' to '%s' with link '%s' %s", src->cname(), dst->cname(), link->getName(),
+    XBT_DEBUG("Route from '%s' to '%s' with link '%s' %s", src->cname(), dst->cname(), link->cname(),
               (symmetrical ? "(symmetrical)" : "(not symmetrical)"));
     char* link_bdw = bprintf("%fBps", link->bandwidth());
     char* link_lat = bprintf("%fs", link->latency());
 
     //   XBT_DEBUG("src (%s), dst (%s), src_id = %d, dst_id = %d",src,dst, src_id, dst_id);
-    XBT_DEBUG("\tLink (%s) bdw:%s lat:%s", link->getName(), link_bdw, link_lat);
+    XBT_DEBUG("\tLink (%s) bdw:%s lat:%s", link->cname(), link_bdw, link_lat);
 
     // create link ns3
     NetPointNs3* host_src = src->extension<NetPointNs3>();
@@ -235,7 +231,8 @@ void NetworkNS3Model::updateActionsState(double now, double delta)
 
       action->src_->routeTo(action->dst_, &route, nullptr);
       for (auto link : route)
-        TRACE_surf_link_set_utilization (link->getName(), action->getCategory(), (data_delta_sent)/delta, now-delta, delta);
+        TRACE_surf_link_set_utilization(link->cname(), action->getCategory(), (data_delta_sent) / delta, now - delta,
+                                        delta);
 
       action->lastSent_ = sgFlow->sentBytes_;
     }
@@ -269,7 +266,7 @@ LinkNS3::LinkNS3(NetworkNS3Model* model, const char* name, double bandwidth, dou
   bandwidth_.peak = bandwidth;
   latency_.peak   = latency;
 
-  LinkImpl::onCreation(this);
+  s4u::Link::onCreation(this->piface_);
 }
 
 LinkNS3::~LinkNS3() = default;
@@ -298,7 +295,7 @@ NetworkNS3Action::NetworkNS3Action(Model* model, double size, s4u::Host* src, s4
   dst_ = dst;
   ns3_create_flow(src, dst, surf_get_clock(), size, this);
 
-  LinkImpl::onCommunicate(this, src, dst);
+  s4u::Link::onCommunicate(this, src, dst);
 }
 
 void NetworkNS3Action::suspend() {