Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill a useless element in the NS3 extension of hosts
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 25 Mar 2016 10:59:31 +0000 (11:59 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 25 Mar 2016 10:59:31 +0000 (11:59 +0100)
examples/msg/ns3/ns3.tesh
src/surf/network_ns3.cpp
src/surf/ns3/ns3_interface.h

index e4f7fbb..50c83db 100644 (file)
@@ -41,8 +41,8 @@ p Dogbone
 ! timeout 10
 $ ns3/ns3 ${srcdir:=.}/examples/platforms/dogbone.xml ${srcdir:=.}/examples/msg/ns3/dogbone_d.xml --cfg=network/model:NS3 "--log=root.fmt:[%h:%P(%i)]%e[%c/%p]%e%m%n"
 > [:maestro(0)] [xbt_cfg/INFO] Configuration change: Set 'network/model' to 'NS3'
-> [C2:slave(4)] [msg_test/INFO] FLOW[1] : Receive 20000000 bytes from S2 to C2
 > [C1:slave(3)] [msg_test/INFO] FLOW[0] : Receive 20000000 bytes from S1 to C1
+> [C2:slave(4)] [msg_test/INFO] FLOW[1] : Receive 20000000 bytes from S2 to C2
 
 p 2hosts 1link
 
index d958942..475ad6a 100644 (file)
@@ -60,9 +60,7 @@ static void simgrid_ns3_add_host(simgrid::s4u::Host& host)
   ns3::Ptr<ns3::Node> node =  ns3::CreateObject<ns3::Node> (0);
   stack.Install(node);
   nodes.Add(node);
-  ns3host->node_num = number_of_nodes;
-  ns3host->type = NS3_NETWORK_ELEMENT_HOST;
-  number_of_nodes++;
+  ns3host->node_num = number_of_nodes ++;
 
   host.extension_set(NS3_EXTENSION_ID, ns3host);
 }
@@ -71,8 +69,7 @@ static void simgrid_ns3_add_router(simgrid::surf::NetCard* router)
 {
   const char* router_id = router->name();
   XBT_DEBUG("NS3_ADD_ROUTER '%s'",router_id);
-  xbt_lib_set(as_router_lib, router_id, NS3_ASR_LEVEL, ns3_add_router(router_id)
-    );
+  xbt_lib_set(as_router_lib, router_id, NS3_ASR_LEVEL, ns3_add_router(router_id) );
 }
 
 #include "src/surf/xml/platf.hpp" // FIXME: move that back to the parsing area
@@ -136,8 +133,8 @@ static void parse_ns3_add_cluster(sg_platf_cluster_cbarg_t cluster)
 
     xbt_assert(host_src && host_dst, "\tns3_add_link from %d to %d",host_src->node_num,host_dst->node_num);
 
-    ns3_add_link(host_src->node_num,host_src->type,
-                 host_dst->node_num,host_dst->type,
+    ns3_add_link(host_src->node_num,NS3_NETWORK_ELEMENT_HOST,
+                 host_dst->node_num,NS3_NETWORK_ELEMENT_HOST,
                  bw,lat);
 
     free(router_id);
@@ -196,7 +193,7 @@ static void create_ns3_topology(void)
       if (!host_src || !host_dst)
           xbt_die("\tns3_add_link from %d to %d",host_src->node_num,host_dst->node_num);
 
-      ns3_add_link(host_src->node_num,host_src->type,host_dst->node_num,host_dst->type,link_bdw,link_lat);
+      ns3_add_link(host_src->node_num,NS3_NETWORK_ELEMENT_HOST,host_dst->node_num,NS3_NETWORK_ELEMENT_HOST,link_bdw,link_lat);
 
       xbt_free(link_bdw);
       xbt_free(link_lat);
@@ -474,7 +471,6 @@ void * ns3_add_host_cluster(const char * id)
   Cluster_nodes.Add(node);
   nodes.Add(node);
   host->node_num = number_of_nodes;
-  host->type = NS3_NETWORK_ELEMENT_HOST;
   number_of_nodes++;
   return host;
 }
@@ -487,7 +483,6 @@ void * ns3_add_router(const char * id)
   stack.Install(node);
   nodes.Add(node);
   router->node_num = number_of_nodes;
-  router->type = NS3_NETWORK_ELEMENT_ROUTER;
   number_of_nodes++;
   return router;
 }
index b0eb1bb..33ce2eb 100644 (file)
@@ -31,7 +31,6 @@ typedef enum {
 
 typedef struct ns3_node {
   int node_num;
-  e_ns3_network_element_type_t type;
 } s_ns3_node_t, *ns3_node_t;
 
 XBT_PUBLIC_DATA(int) NS3_EXTENSION_ID;