X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5d4bf7d1cd502bc979d98e35067872186f2a0a21..77163c152598f613abd0a938a967fcbd7a95fc8b:/src/surf/network_ns3.cpp
diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp
index 279db8666f..e27db353d1 100644
--- a/src/surf/network_ns3.cpp
+++ b/src/surf/network_ns3.cpp
@@ -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. */
@@ -10,18 +10,14 @@
#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");
@@ -91,18 +87,19 @@ static void clusterCreation_cb(sg_platf_cluster_cbarg_t cluster)
static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoint* src,
simgrid::kernel::routing::NetPoint* dst, simgrid::kernel::routing::NetPoint* gw_src,
- simgrid::kernel::routing::NetPoint* gw_dst, std::vector* link_list)
+ simgrid::kernel::routing::NetPoint* gw_dst,
+ std::vector* link_list)
{
if (link_list->size() == 1) {
simgrid::surf::LinkNS3* link = static_cast(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();
@@ -234,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_;
}
@@ -268,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;
@@ -297,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() {