X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/03cb5ca8689347e26d4d3158db3a5340639ce7f1..f2907d4c4e2bfdd55ae8a7c41711b731d106f668:/src/surf/network_ns3.cpp diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index a343a7a498..aedde294bd 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -90,8 +90,6 @@ static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoin simgrid::kernel::routing::NetPoint* gw_dst, std::vector* link_list) { - static bool warned_about_long_routes = false; - if (link_list->size() == 1) { simgrid::surf::LinkNS3* link = static_cast(link_list->at(0)); @@ -117,19 +115,21 @@ static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoin xbt_free(link_bdw); xbt_free(link_lat); } else { + static bool warned_about_long_routes = false; + if (not warned_about_long_routes) - XBT_INFO( - "Ignoring a route between %s and %s of length %zu: Only routes of length 1 are considered with NS3.\n" - "You can ignore this warning if your hosts can still communicate when only considering routes of length 1.\n" - "You may also remove these routes to avoid this harmless message. Other long routes will be silently " - "ignored.", - src->cname(), dst->cname(), link_list->size()); + XBT_WARN("Ignoring a route between %s and %s of length %zu: Only routes of length 1 are considered with NS3.\n" + "WARNING: You can ignore this warning if your hosts can still communicate when only considering routes " + "of length 1.\n" + "WARNING: Remove long routes to avoid this harmless message; subsequent long routes will be silently " + "ignored.", + src->cname(), dst->cname(), link_list->size()); warned_about_long_routes = true; } } /* Create the ns3 topology based on routing strategy */ -static void postparse_cb(void) +static void postparse_cb() { IPV4addr.shrink_to_fit(); @@ -197,7 +197,7 @@ double NetworkNS3Model::nextOccuringEvent(double now) XBT_DEBUG("ns3_next_occuring_event"); //get the first relevant value from the running_actions list - if (!getRunningActionSet()->size() || now == 0.0) + if (not getRunningActionSet()->size() || now == 0.0) return -1.0; else do { @@ -256,7 +256,7 @@ void NetworkNS3Model::updateActionsState(double now, double delta) } } - while (!xbt_dynar_is_empty(socket_to_destroy)){ + while (not xbt_dynar_is_empty(socket_to_destroy)) { xbt_dynar_pop(socket_to_destroy,&ns3Socket); if (XBT_LOG_ISENABLED(ns3, xbt_log_priority_debug)) { @@ -317,7 +317,12 @@ void NetworkNS3Action::resume() { THROW_UNIMPLEMENTED; } - /* Test whether a flow is suspended */ +std::list NetworkNS3Action::links() +{ + THROW_UNIMPLEMENTED; +} + +/* Test whether a flow is suspended */ bool NetworkNS3Action::isSuspended() { return false; @@ -326,7 +331,7 @@ bool NetworkNS3Action::isSuspended() int NetworkNS3Action::unref() { refcount_--; - if (!refcount_) { + if (not refcount_) { if (action_hook.is_linked()) stateSet_->erase(stateSet_->iterator_to(*this)); XBT_DEBUG ("Removing action %p", this); @@ -391,20 +396,20 @@ void ns3_initialize(const char* TcpProtocol){ ns3::Config::SetDefault ("ns3::TcpSocket::SegmentSize", ns3::UintegerValue (1024)); // 1024-byte packet for easier reading ns3::Config::SetDefault ("ns3::TcpSocket::DelAckCount", ns3::UintegerValue (1)); - if (!strcmp(TcpProtocol,"default")) + if (not strcmp(TcpProtocol, "default")) return; - if (!strcmp(TcpProtocol,"Reno")) { + if (not strcmp(TcpProtocol, "Reno")) { XBT_INFO("Switching Tcp protocol to '%s'",TcpProtocol); ns3::Config::SetDefault ("ns3::TcpL4Protocol::SocketType", ns3::StringValue("ns3::TcpReno")); return; } - if (!strcmp(TcpProtocol,"NewReno")) { + if (not strcmp(TcpProtocol, "NewReno")) { XBT_INFO("Switching Tcp protocol to '%s'",TcpProtocol); ns3::Config::SetDefault ("ns3::TcpL4Protocol::SocketType", ns3::StringValue("ns3::TcpNewReno")); return; } - if(!strcmp(TcpProtocol,"Tahoe")){ + if (not strcmp(TcpProtocol, "Tahoe")) { XBT_INFO("Switching Tcp protocol to '%s'",TcpProtocol); ns3::Config::SetDefault ("ns3::TcpL4Protocol::SocketType", ns3::StringValue("ns3::TcpTahoe")); return;