-/* Copyright (c) 2008-2014. The SimGrid Team.
+/* Copyright (c) 2008-2015. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
#include "xbt/ex.h"
#include "xbt/xbt_os_time.h"
#include "surf/surf.h"
-#include "surf/surf_private.h"
+#include "src/surf/surf_private.h"
static const char link_ctn_v2[] = "link:ctn";
static const char link_ctn_v3[] = "link_ctn";
xbt_lib_cursor_t cursor_src = NULL;
xbt_lib_cursor_t cursor_dst = NULL;
char *src,*dst,*key,*data;
- sg_routing_edge_t value1;
- sg_routing_edge_t value2;
+ sg_netcard_t value1;
+ sg_netcard_t value2;
const SD_workstation_t *hosts;
const SD_link_t *links;
}
}
-
- xbt_lib_foreach(host_lib, cursor_src, src, value1) // Routes from host
+ sg_host_t host1, host2;
+ xbt_dict_foreach(host_list, cursor_src, src, host1) // Routes from host
{
value1 = sg_host_edge(sg_host_by_name(src));
- xbt_lib_foreach(host_lib, cursor_dst, dst, value2) //to host
+ xbt_dict_foreach(host_list, cursor_dst, dst, host2) //to host
{
printf(" <route src=\"%s\" dst=\"%s\">\n "
,src
,dst);
xbt_dynar_t route=NULL;
value2 = sg_host_edge(sg_host_by_name(dst));
- routing_get_route_and_latency(value1,value2,&route,NULL);
+ routing_get_route_and_latency(value1, value2, &route,NULL);
for(i=0;i<xbt_dynar_length(route) ;i++)
{
void *link = xbt_dynar_get_as(route,i,void *);
,dst);
xbt_dynar_t route=NULL;
value2 = xbt_lib_get_or_null(as_router_lib,dst,ROUTING_ASR_LEVEL);
- routing_get_route_and_latency((sg_routing_edge_t)value1,(sg_routing_edge_t)value2,&route,NULL);
+ routing_get_route_and_latency((sg_netcard_t)value1,(sg_netcard_t)value2,&route,NULL);
for(i=0;i<xbt_dynar_length(route) ;i++)
{
void *link = xbt_dynar_get_as(route,i,void *);
,dst);
xbt_dynar_t route=NULL;
value2 = xbt_lib_get_or_null(as_router_lib,dst,ROUTING_ASR_LEVEL);
- routing_get_route_and_latency((sg_routing_edge_t)value1,(sg_routing_edge_t)value2,&route,NULL);
+ routing_get_route_and_latency((sg_netcard_t)value1,(sg_netcard_t)value2,&route,NULL);
for(i=0;i<xbt_dynar_length(route) ;i++)
{
void *link = xbt_dynar_get_as(route,i,void *);
printf("\n </route>\n");
}
}
- xbt_lib_foreach(host_lib, cursor_dst, dst, value2) //to host
+ xbt_dict_foreach(host_list, cursor_dst, dst, value2) //to host
{
printf(" <route src=\"%s\" dst=\"%s\">\n "
,src, dst);
xbt_dynar_t route=NULL;
value2 = sg_host_edge(sg_host_by_name(dst));
- routing_get_route_and_latency((sg_routing_edge_t)value1,(sg_routing_edge_t)value2,&route, NULL);
+ routing_get_route_and_latency((sg_netcard_t)value1,(sg_netcard_t)value2,&route, NULL);
for(i=0;i<xbt_dynar_length(route) ;i++)
{
void *link = xbt_dynar_get_as(route,i,void *);