- xbt_dict_foreach(routing->generic_routing.to_index, c1, k1, d1) {
- xbt_dict_foreach(routing->generic_routing.to_index, c2, k2, d2) {
- route_extended_t route = dijkstra_get_route(rc, k1, k2);
- 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->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);
+ xbt_dict_foreach(as->to_index, c1, k1, d1) {
+ xbt_dict_foreach(as->to_index, c2, k2, d2) {
+ route_t route = xbt_new0(s_route_t,1);
+ route->link_list = xbt_dynar_new(global_routing->size_of_link,NULL);
+ dijkstra_get_route_and_latency(as, k1, k2,route, NULL);
+
+ if (xbt_dynar_length(route->link_list) == 1) {
+ void *link =
+ *(void **) xbt_dynar_get_ptr(route->link_list, 0);
+ onelink_t onelink = xbt_new0(s_onelink_t, 1);
+ onelink->link_ptr = link;
+ if (as->hierarchy == SURF_ROUTING_BASE) {
+ onelink->src = xbt_strdup(k1);
+ onelink->dst = xbt_strdup(k2);
+ } else if (as->hierarchy ==
+ SURF_ROUTING_RECURSIVE) {
+ onelink->src = xbt_strdup(route->src_gateway);
+ onelink->dst = xbt_strdup(route->dst_gateway);