*/
static void routing_parse_S_route(void)
{
- if (src != NULL && dst != NULL && parsed_link_list != NULL)
- THROWF(arg_error, 0, "Route between %s to %s can not be defined",
- A_surfxml_route_src, A_surfxml_route_dst);
src = A_surfxml_route_src;
dst = A_surfxml_route_dst;
xbt_assert(strlen(src) > 0 || strlen(dst) > 0,
- "Some limits are null in the route between \"%s\" and \"%s\"",
+ "Missing end-points while defining route \"%s\"->\"%s\"",
src, dst);
parsed_link_list = xbt_dynar_new(sizeof(char *), &xbt_free_ref);
}
*/
static void routing_parse_S_ASroute(void)
{
- if (src != NULL && dst != NULL && parsed_link_list != NULL)
- THROWF(arg_error, 0, "Route between %s to %s can not be defined",
- A_surfxml_ASroute_src, A_surfxml_ASroute_dst);
src = A_surfxml_ASroute_src;
dst = A_surfxml_ASroute_dst;
gw_src = A_surfxml_ASroute_gw_src;
gw_dst = A_surfxml_ASroute_gw_dst;
- xbt_assert(strlen(src) > 0 || strlen(dst) > 0 || strlen(gw_src) > 0
- || strlen(gw_dst) > 0,
- "Some limits are null in the route between \"%s\" and \"%s\"",
- src, dst);
+ xbt_assert(strlen(src) > 0 || strlen(dst) > 0 || strlen(gw_src) > 0 || strlen(gw_dst) > 0,
+ "Missing end-points while defining route \"%s\"->\"%s\" (with %s and %s as gateways)",
+ src, dst,gw_src,gw_dst);
parsed_link_list = xbt_dynar_new(sizeof(char *), &xbt_free_ref);
}
*/
static void routing_parse_S_bypassRoute(void)
{
- if (src != NULL && dst != NULL && parsed_link_list != NULL)
- THROWF(arg_error, 0,
- "Bypass Route between %s to %s can not be defined",
- A_surfxml_bypassRoute_src, A_surfxml_bypassRoute_dst);
src = A_surfxml_bypassRoute_src;
dst = A_surfxml_bypassRoute_dst;
gw_src = NULL;
gw_dst = NULL;
- xbt_assert(strlen(src) > 0 || strlen(dst) > 0 || strlen(gw_src) > 0
- || strlen(gw_dst) > 0,
- "Some limits are null in the route between \"%s\" and \"%s\"",
- src, dst);
+ xbt_assert(strlen(src) > 0 || strlen(dst) > 0 || strlen(gw_src) > 0 || strlen(gw_dst) > 0,
+ "Missing end-points while defining route \"%s\"->\"%s\" (with %s and %s as gateways)",
+ src, dst,gw_src,gw_dst);
parsed_link_list = xbt_dynar_new(sizeof(char *), &xbt_free_ref);
}
*/
static void routing_parse_S_bypassASroute(void)
{
- if (src != NULL && dst != NULL && parsed_link_list != NULL)
- THROWF(arg_error, 0,
- "Bypass AS Route between %s to %s can not be defined",
- A_surfxml_bypassASroute_src, A_surfxml_bypassASroute_dst);
src = A_surfxml_bypassASroute_src;
dst = A_surfxml_bypassASroute_dst;
gw_src = A_surfxml_bypassASroute_gw_src;
gw_dst = A_surfxml_bypassASroute_gw_dst;
- xbt_assert(strlen(src) > 0 || strlen(dst) > 0 || strlen(gw_src) > 0
- || strlen(gw_dst) > 0,
- "Some limits are null in the route between \"%s\" and \"%s\"",
- src, dst);
+ xbt_assert(strlen(src) > 0 || strlen(dst) > 0 || strlen(gw_src) > 0 || strlen(gw_dst) > 0,
+ "Missing end-points while defining route \"%s\"->\"%s\" (with %s and %s as gateways)",
+ src, dst,gw_src,gw_dst);
parsed_link_list = xbt_dynar_new(sizeof(char *), &xbt_free_ref);
}
/**
e_route->link_list = parsed_link_list;
if (!strcmp(current_routing->model_desc->name,"RuleBased")) {
- e_route->src_gateway = (sg_routing_edge_t) gw_src; // DIRTY HACK possible only FIXME
- e_route->dst_gateway = (sg_routing_edge_t) gw_dst; // 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 (model_rulebased_parse_ASroute knows)
+ //
+ // This is because the user will provide something like "^AS_(.*)$" instead of the proper name of a given entity
+ e_route->src_gateway = (sg_routing_edge_t) gw_src;
+ e_route->dst_gateway = (sg_routing_edge_t) gw_dst;
} else {
e_route->src_gateway = sg_routing_edge_by_name_or_null(gw_src);
e_route->dst_gateway = sg_routing_edge_by_name_or_null(gw_dst);