X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/11f5429d522f11788e00bfa16b86650ea5640e4b..9f4ddf3b15fccdab0f2666bf44061e7fd8305f49:/src/surf/surf_routing_full.c diff --git a/src/surf/surf_routing_full.c b/src/surf/surf_routing_full.c index 5e22b48add..c4a4c9f4d6 100644 --- a/src/surf/surf_routing_full.c +++ b/src/surf/surf_routing_full.c @@ -164,7 +164,7 @@ void model_full_set_route(AS_t rc, const char *src, int *src_id, *dst_id; src_id = xbt_dict_get_or_null(rc->to_index, src); dst_id = xbt_dict_get_or_null(rc->to_index, dst); - routing_component_full_t routing = ((routing_component_full_t) rc); + routing_component_full_t routing = (routing_component_full_t) rc; size_t table_size = xbt_dict_length(routing->generic_routing.to_index); xbt_assert(src_id, "Network elements %s not found", src); @@ -187,9 +187,8 @@ void model_full_set_route(AS_t rc, const char *src, xbt_assert(link, "Link : '%s' doesn't exists.", link_name); xbt_dynar_push(link_route_to_test, &link); } - if (xbt_dynar_compare((void *) TO_ROUTE_FULL(*src_id, *dst_id)->link_list, - (void *) link_route_to_test, - (int_f_cpvoid_cpvoid_t) full_pointer_resource_cmp)) { + if (xbt_dynar_compare(TO_ROUTE_FULL(*src_id, *dst_id)->link_list, + link_route_to_test, full_pointer_resource_cmp)) { surf_parse_error("A route between \"%s\" and \"%s\" already exists " "with a different content. " "If you are trying to define a reverse route, " @@ -203,36 +202,39 @@ void model_full_set_route(AS_t rc, const char *src, if (!route->dst_gateway && !route->src_gateway) XBT_DEBUG("Load Route from \"%s\" to \"%s\"", src, dst); else { - AS_t subas = xbt_dict_get_or_null(rc->routing_sons, src); - if (subas == NULL) - surf_parse_error("The source of an ASroute must be a sub-AS " - "declared within the current AS, " - "but '%s' is not an AS within '%s'", src, rc->name); - if (xbt_dict_get_or_null(subas->to_index, route->src_gateway) == NULL) - surf_parse_error("In an ASroute, source gateway must be part of " - "the source sub-AS (in particular, being in a " - "sub-sub-AS is not allowed), " - "but '%s' is not in '%s'.", - route->src_gateway, subas->name); - - subas = xbt_dict_get_or_null(rc->routing_sons, dst); - if (subas == NULL) - surf_parse_error("The destination of an ASroute must be a sub-AS " - "declared within the current AS, " - "but '%s' is not an AS within '%s'", dst, rc->name); - if (xbt_dict_get_or_null(subas->to_index, route->dst_gateway) == NULL) - surf_parse_error("In an ASroute, destination gateway must be " - "part of the destination sub-AS (in particular, " - "in a sub-sub-AS is not allowed), " - "but '%s' is not in '%s'.", - route->dst_gateway, subas->name); +// FIXME We can call a gw wich is down the current AS (cf g5k.xml) but not upper. +// AS_t subas = xbt_dict_get_or_null(rc->routing_sons, src); +// if (subas == NULL) +// surf_parse_error("The source of an ASroute must be a sub-AS " +// "declared within the current AS, " +// "but '%s' is not an AS within '%s'", src, rc->name); +// if (subas->to_index +// && xbt_dict_get_or_null(subas->to_index, route->src_gateway) == NULL) +// surf_parse_error("In an ASroute, source gateway must be part of " +// "the source sub-AS (in particular, being in a " +// "sub-sub-AS is not allowed), " +// "but '%s' is not in '%s'.", +// route->src_gateway, subas->name); +// +// subas = xbt_dict_get_or_null(rc->routing_sons, dst); +// if (subas == NULL) +// surf_parse_error("The destination of an ASroute must be a sub-AS " +// "declared within the current AS, " +// "but '%s' is not an AS within '%s'", dst, rc->name); +// if (subas->to_index +// && xbt_dict_get_or_null(subas->to_index, route->dst_gateway) == NULL) +// surf_parse_error("In an ASroute, destination gateway must be " +// "part of the destination sub-AS (in particular, " +// "in a sub-sub-AS is not allowed), " +// "but '%s' is not in '%s'.", +// route->dst_gateway, subas->name); XBT_DEBUG("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", src, route->src_gateway, dst, route->dst_gateway); - if (routing_get_network_element_type((const char *) route->dst_gateway) == + if (routing_get_network_element_type(route->dst_gateway) == SURF_NETWORK_ELEMENT_NULL) xbt_die("The dst_gateway '%s' does not exist!", route->dst_gateway); - if (routing_get_network_element_type((const char *) route->src_gateway) == + if (routing_get_network_element_type(route->src_gateway) == SURF_NETWORK_ELEMENT_NULL) xbt_die("The src_gateway '%s' does not exist!", route->src_gateway); } @@ -260,10 +262,9 @@ void model_full_set_route(AS_t rc, const char *src, xbt_assert(link, "Link : '%s' doesn't exists.", link_name); xbt_dynar_push(link_route_to_test, &link); } - xbt_assert(!xbt_dynar_compare - ((void *) TO_ROUTE_FULL(*dst_id, *src_id)->link_list, - (void *) link_route_to_test, (int_f_cpvoid_cpvoid_t) - full_pointer_resource_cmp), + xbt_assert(!xbt_dynar_compare(TO_ROUTE_FULL(*dst_id, *src_id)->link_list, + link_route_to_test, + full_pointer_resource_cmp), "The route between \"%s\" and \"%s\" already exists", src, dst); } else {