Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
move some XML specific code from surf_routing.c to surfxml_parse.c
[simgrid.git] / src / surf / surf_routing_floyd.c
index b441684..87d2bfa 100644 (file)
@@ -8,8 +8,6 @@
 
 /* Global vars */
 extern routing_global_t global_routing;
-extern AS_t current_routing;
-extern routing_model_description_t current_routing_model;
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_floyd, surf, "Routing part of surf");
 
@@ -118,7 +116,7 @@ static route_extended_t floyd_get_route(AS_t asg,
     if (asg->hierarchy == SURF_ROUTING_RECURSIVE && !first
         && strcmp(gw_dst, prev_gw_src)) {
       xbt_dynar_t e_route_as_to_as =
-          (*(global_routing->get_route)) (gw_dst, prev_gw_src);
+          routing_get_route(gw_dst, prev_gw_src);
       xbt_assert(e_route_as_to_as, "no route between \"%s\" and \"%s\"",
                   gw_dst, prev_gw_src);
       links = e_route_as_to_as;
@@ -173,7 +171,7 @@ static void floyd_finalize(AS_t rc)
 
 AS_t model_floyd_create(void)
 {
-  as_floyd_t new_component = (as_floyd_t)routmod_generic_create(sizeof(s_as_floyd_t));
+  as_floyd_t new_component = (as_floyd_t)model_generic_create_sized(sizeof(s_as_floyd_t));
   new_component->generic_routing.parse_route = model_floyd_parse_route;
   new_component->generic_routing.parse_ASroute = model_floyd_parse_route;
   new_component->generic_routing.get_route = floyd_get_route;
@@ -183,7 +181,7 @@ AS_t model_floyd_create(void)
   return (AS_t)new_component;
 }
 
-void model_floyd_end(void)
+void model_floyd_end(AS_t current_routing)
 {
 
        as_floyd_t as =
@@ -313,9 +311,9 @@ void model_floyd_parse_route(AS_t rc, const char *src,
                else{
                        XBT_DEBUG("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", src,
                                 route->src_gateway, dst, route->dst_gateway);
-                       if(global_routing->get_network_element_type((const char*)route->dst_gateway) == SURF_NETWORK_ELEMENT_NULL)
+                       if(routing_get_network_element_type((const char*)route->dst_gateway) == SURF_NETWORK_ELEMENT_NULL)
                                xbt_die("The dst_gateway '%s' does not exist!",route->dst_gateway);
-                       if(global_routing->get_network_element_type((const char*)route->src_gateway) == SURF_NETWORK_ELEMENT_NULL)
+                       if(routing_get_network_element_type((const char*)route->src_gateway) == SURF_NETWORK_ELEMENT_NULL)
                                xbt_die("The src_gateway '%s' does not exist!",route->src_gateway);
                }
            TO_FLOYD_LINK(*src_id, *dst_id) =