X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a185be0269391eb526a7d6e34e3ff917a1908ad1..7e2b05b2e2ec6a745966f800121782a684166f6f:/src/surf/surf_routing.c diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index d2338f47a0..ac58e67547 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -11,7 +11,7 @@ #include "xbt/graph.h" #include "xbt/set.h" -XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route,surf,"Routing part of surf");// FIXME: connect this under windows +XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route,surf,"Routing part of surf"); routing_t used_routing = NULL; @@ -68,6 +68,13 @@ typedef struct { /* * Parsing */ +static void routing_full_parse_Srouter(void) { + int *val = xbt_malloc(sizeof(int)); + DEBUG2("Seen router %s (#%d)",A_surfxml_host_id,used_routing->host_count); + *val = used_routing->host_count++; + xbt_dict_set(used_routing->host_id,A_surfxml_host_id,val,xbt_free); +} + static void routing_full_parse_Shost(void) { int *val = xbt_malloc(sizeof(int)); DEBUG2("Seen host %s (#%d)",A_surfxml_host_id,used_routing->host_count); @@ -311,6 +318,7 @@ static void routing_model_full_create(size_t size_of_link,void *loopback) { /* Setup the parsing callbacks we need */ routing->generic_routing.host_id = xbt_dict_new(); surfxml_add_callback(STag_surfxml_host_cb_list, &routing_full_parse_Shost); + surfxml_add_callback(STag_surfxml_router_cb_list, &routing_full_parse_Srouter); surfxml_add_callback(ETag_surfxml_platform_cb_list, &routing_full_parse_end); surfxml_add_callback(STag_surfxml_route_cb_list, &routing_full_parse_Sroute_set_endpoints);