Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[surf] Remove one router callback
authorGabriel Corona <gabriel.corona@loria.fr>
Tue, 1 Dec 2015 12:24:49 +0000 (13:24 +0100)
committerGabriel Corona <gabriel.corona@loria.fr>
Tue, 1 Dec 2015 12:24:49 +0000 (13:24 +0100)
src/surf/sg_platf.cpp
src/surf/surf_routing.cpp

index 372fb59..6772e4f 100644 (file)
@@ -152,13 +152,7 @@ void sg_platf_new_host_link(sg_platf_host_link_cbarg_t h){
     fun(h);
   }
 }
-void sg_platf_new_router(sg_platf_router_cbarg_t router) {
-  unsigned int iterator;
-  sg_platf_router_cb_t fun;
-  xbt_dynar_foreach(sg_platf_router_cb_list, iterator, fun) {
-    fun(router);
-  }
-}
+
 void sg_platf_new_link(sg_platf_link_cbarg_t link){
   unsigned int iterator;
   sg_platf_link_cb_t fun;
index 5d4588c..71a875a 100644 (file)
@@ -197,7 +197,7 @@ RoutingEdge *routing_add_host(As* current_routing, sg_platf_host_cbarg_t host)
 /**
  * \brief Add a "router" to the network element list
  */
-static void parse_S_router(sg_platf_router_cbarg_t router)
+void sg_platf_new_router(sg_platf_router_cbarg_t router)
 {
   if (current_routing->p_hierarchy == SURF_ROUTING_NULL)
     current_routing->p_hierarchy = SURF_ROUTING_BASE;
@@ -232,6 +232,12 @@ static void parse_S_router(sg_platf_router_cbarg_t router)
     xbt_lib_set(as_router_lib, router->id, COORD_ASR_LEVEL, (void *) ctn);
     XBT_DEBUG("Having set router coordinates for '%s'",router->id);
   }
+
+  unsigned int iterator;
+  sg_platf_router_cb_t fun;
+  xbt_dynar_foreach(sg_platf_router_cb_list, iterator, fun) {
+    fun(router);
+  }
 }
 
 /**