X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f7bbc27a9c71861263b01883617b2828e974bb68..346c06db41ebb088e88351d8381d0c232d2ddbb5:/src/surf/surf_routing_rulebased.c diff --git a/src/surf/surf_routing_rulebased.c b/src/surf/surf_routing_rulebased.c index e7aecf4619..ca03d309fa 100644 --- a/src/surf/surf_routing_rulebased.c +++ b/src/surf/surf_routing_rulebased.c @@ -7,7 +7,7 @@ #include /* regular expression library */ /* Global vars */ -extern routing_global_t global_routing; +extern routing_platf_t routing_platf; XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_rulebased, surf, "Routing part of surf"); @@ -131,8 +131,13 @@ static void model_rulebased_parse_ASroute(AS_t rc, erroffset, dst, error); ruleroute_e->generic_rule_route.re_str_link = route->link_list; - ruleroute_e->re_src_gateway = xbt_strdup((char *)route->src_gateway); // DIRTY HACK possible only - ruleroute_e->re_dst_gateway = xbt_strdup((char *)route->dst_gateway); // because of what is in routing_parse_E_ASroute + + // DIRTY PERL HACK AHEAD: with the rulebased routing, the {src,dst}_gateway fields + // store the provided name instead of the entity directly (routing_parse_E_ASroute knows) + // + // This is because the user will provide something like "^AS_(.*)$" instead of the proper name of a given entity + ruleroute_e->re_src_gateway = xbt_strdup((char *)route->src_gateway); + ruleroute_e->re_dst_gateway = xbt_strdup((char *)route->dst_gateway); xbt_dynar_push(routing->list_ASroute, &ruleroute_e); /* make sure that they don't get freed */ @@ -335,9 +340,9 @@ static void rulebased_get_route_and_latency(AS_t rc, if (rc_src >= 0 && rc_dst >= 0) { /* matched src and dest, nothing more to do (?) */ } else if (!strcmp(src_name, dst_name) && are_processing_units) { - xbt_dynar_push(route->link_list, &(global_routing->loopback)); + xbt_dynar_push(route->link_list, &(routing_platf->loopback)); if (lat) - *lat += surf_network_model->extension.network.get_link_latency(global_routing->loopback); + *lat += surf_network_model->extension.network.get_link_latency(routing_platf->loopback); } else { THROWF(arg_error,0,"No route from '%s' to '%s'??",src_name,dst_name); //xbt_dynar_reset(route->link_list);