Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
and now with the right test so that not all our tests fail
authorMartin Quinson <martin.quinson@loria.fr>
Fri, 3 Feb 2012 16:21:23 +0000 (17:21 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Fri, 3 Feb 2012 16:21:23 +0000 (17:21 +0100)
src/surf/surf_routing_full.c

index 23654df..3c2c05d 100644 (file)
@@ -206,12 +206,21 @@ 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{
-                         if (xbt_dict_get_or_null(rc->to_index, route->src_gateway) == NULL)
-                                 surf_parse_error("The ASroute source gateway must be part of the current AS (being in a sub-AS is not enough), but '%s' is not in '%s'.",
-                                                 route->src_gateway,rc->name);
-                         if (xbt_dict_get_or_null(rc->to_index, route->dst_gateway) == NULL)
-                                 surf_parse_error("The ASroute destination gateway must be part of the current AS (being in a sub-AS is not enough), but '%s' is not in '%s'.",
-                                                 route->dst_gateway,rc->name);
+                   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);
 
                          XBT_DEBUG("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", src,
                                 route->src_gateway, dst, route->dst_gateway);