Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] extracting routes among ASes
authorschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 13 Dec 2010 16:44:55 +0000 (16:44 +0000)
committerschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Mon, 13 Dec 2010 16:44:55 +0000 (16:44 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9187 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/instr/instr_routing.c

index f220220..8678d43 100644 (file)
@@ -217,6 +217,29 @@ static void recursiveGraphExtraction (container_t container)
             previous_entity_name = link_name;
           }
           linkContainers (container, previous_entity_name, child_name2);
+        }else if (child1->kind == INSTR_AS &&
+                  child2->kind == INSTR_AS &&
+                  strcmp(child_name1, child_name2) != 0){
+
+          //getting route
+          routing_component_t root = global_routing->root;
+          route_extended_t route;
+          xbt_ex_t exception;
+          TRY {
+            route = root->get_route (root, child_name1, child_name2);
+          }CATCH(exception) {
+            //no route between them, that's possible
+            continue;
+          }
+          unsigned int cpt;
+          void *link;
+          char *previous_entity_name = route->src_gateway;
+          xbt_dynar_foreach (route->generic_route.link_list, cpt, link) {
+            char *link_name = ((link_CM02_t)link)->lmm_resource.generic_resource.name;
+            linkContainers (container, previous_entity_name, link_name);
+            previous_entity_name = link_name;
+          }
+          linkContainers (container, previous_entity_name, route->dst_gateway);
         }
       }
     }