Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cosmetics
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 8 Feb 2018 22:04:15 +0000 (23:04 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Tue, 13 Feb 2018 14:42:11 +0000 (15:42 +0100)
src/surf/network_ns3.cpp

index 0ff044c..76f53b9 100644 (file)
@@ -383,26 +383,24 @@ void ns3_initialize(std::string TcpProtocol)
   ns3::Config::SetDefault ("ns3::TcpSocket::DelAckCount", ns3::UintegerValue (1));
   ns3::Config::SetDefault ("ns3::TcpSocketBase::Timestamp", ns3::BooleanValue (false));
 
-  if (TcpProtocol == "default")
-    return;
+  if (TcpProtocol == "default") {
+    /* nothing to do */
 
-  if (TcpProtocol == "Reno") {
+  } else if (TcpProtocol == "Reno") {
     XBT_INFO("Switching Tcp protocol to '%s'", TcpProtocol.c_str());
     ns3::Config::SetDefault ("ns3::TcpL4Protocol::SocketType", ns3::StringValue("ns3::TcpReno"));
-    return;
-  }
-  if (TcpProtocol == "NewReno") {
+
+  } else if (TcpProtocol == "NewReno") {
     XBT_INFO("Switching Tcp protocol to '%s'", TcpProtocol.c_str());
     ns3::Config::SetDefault ("ns3::TcpL4Protocol::SocketType", ns3::StringValue("ns3::TcpNewReno"));
-    return;
-  }
-  if (TcpProtocol == "Tahoe") {
+
+  } else if (TcpProtocol == "Tahoe") {
     XBT_INFO("Switching Tcp protocol to '%s'", TcpProtocol.c_str());
     ns3::Config::SetDefault ("ns3::TcpL4Protocol::SocketType", ns3::StringValue("ns3::TcpTahoe"));
-    return;
-  }
 
-  xbt_die("The ns3/TcpModel must be: NewReno or Reno or Tahoe");
+  } else {
+    xbt_die("The ns3/TcpModel must be: NewReno or Reno or Tahoe");
+  }
 }
 
 void ns3_add_cluster(const char* id, double bw, double lat) {