Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
considering gateways when get_onelink_routes from recursive AS'es
authorschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 11 Oct 2010 09:02:45 +0000 (09:02 +0000)
committerschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 11 Oct 2010 09:02:45 +0000 (09:02 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8392 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/surf/surf_routing.c

index 9f198f2..dbfaad9 100644 (file)
@@ -815,11 +815,15 @@ static xbt_dynar_t full_get_onelink_routes(routing_component_t rc)
       if (route){
         if (xbt_dynar_length(route->generic_route.link_list) == 1){
           void *link = *(void**)xbt_dynar_get_ptr(route->generic_route.link_list,0);
-
           onelink_t onelink = xbt_new0 (s_onelink_t, 1);
-          onelink->src = xbt_strdup (k1);
-          onelink->dst = xbt_strdup (k2);
           onelink->link_ptr = link;
+          if (routing->generic_routing.hierarchy == SURF_ROUTING_BASE){
+            onelink->src = xbt_strdup (k1);
+            onelink->dst = xbt_strdup (k2);
+          }else if (routing->generic_routing.hierarchy == SURF_ROUTING_RECURSIVE){
+            onelink->src = xbt_strdup (route->src_gateway);
+            onelink->dst = xbt_strdup (route->dst_gateway);
+          }
           xbt_dynar_push (ret, &onelink);
         }
       }
@@ -1004,9 +1008,14 @@ static xbt_dynar_t floyd_get_onelink_routes(routing_component_t rc)
         if (xbt_dynar_length(route->generic_route.link_list) == 1){
           void *link = *(void**)xbt_dynar_get_ptr(route->generic_route.link_list,0);
           onelink_t onelink = xbt_new0 (s_onelink_t, 1);
-          onelink->src = xbt_strdup (k1);
-          onelink->dst = xbt_strdup (k2);
           onelink->link_ptr = link;
+          if (routing->generic_routing.hierarchy == SURF_ROUTING_BASE){
+            onelink->src = xbt_strdup (k1);
+            onelink->dst = xbt_strdup (k2);
+          }else if (routing->generic_routing.hierarchy == SURF_ROUTING_RECURSIVE){
+            onelink->src = xbt_strdup (route->src_gateway);
+            onelink->dst = xbt_strdup (route->dst_gateway);
+          }
           xbt_dynar_push (ret, &onelink);
         }
       }