X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/640bc8d792c29169599712bf42d1b8cb873fe2fd..967421ad9a8dcd567206f2c398a30c08c9507a81:/src/surf/surf_routing_full.c diff --git a/src/surf/surf_routing_full.c b/src/surf/surf_routing_full.c index 1781b2fae4..ab14bf6b0f 100644 --- a/src/surf/surf_routing_full.c +++ b/src/surf/surf_routing_full.c @@ -7,7 +7,7 @@ #include "surf_routing_private.h" /* Global vars */ -extern routing_global_t global_routing; +extern routing_platf_t routing_platf; extern int surf_parse_lineno; XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_full, surf, "Routing part of surf"); @@ -136,7 +136,7 @@ void model_full_end(AS_t current_routing) routing->routing_table = xbt_new0(route_t, table_size * table_size); /* Add the loopback if needed */ - if (global_routing->loopback && current_routing->hierarchy == SURF_ROUTING_BASE) { + if (routing_platf->loopback && current_routing->hierarchy == SURF_ROUTING_BASE) { for (i = 0; i < table_size; i++) { e_route = TO_ROUTE_FULL(i, i); if (!e_route) { @@ -144,7 +144,7 @@ void model_full_end(AS_t current_routing) e_route->src_gateway = NULL; e_route->dst_gateway = NULL; e_route->link_list = xbt_dynar_new(sizeof(sg_routing_link_t), NULL); - xbt_dynar_push(e_route->link_list, &global_routing->loopback); + xbt_dynar_push(e_route->link_list, &routing_platf->loopback); TO_ROUTE_FULL(i, i) = e_route; } } @@ -161,12 +161,8 @@ void model_full_set_route(AS_t rc, const char *src, { sg_routing_edge_t src_net_elm, dst_net_elm; int as_route = 0; - src_net_elm = xbt_lib_get_or_null(host_lib, src, ROUTING_HOST_LEVEL); - dst_net_elm = xbt_lib_get_or_null(host_lib, dst, ROUTING_HOST_LEVEL); - if (!src_net_elm) - src_net_elm = xbt_lib_get_or_null(as_router_lib, src, ROUTING_ASR_LEVEL); - if (!dst_net_elm) - dst_net_elm = xbt_lib_get_or_null(as_router_lib, dst, ROUTING_ASR_LEVEL); + src_net_elm = sg_routing_edge_by_name_or_null(src); + dst_net_elm = sg_routing_edge_by_name_or_null(dst); xbt_assert(src_net_elm, "Network elements %s not found", src); xbt_assert(dst_net_elm, "Network elements %s not found", dst);