X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/d155fd69fa99c97b3a9c86bb7f2e472c2e7332df..4233134b16caf9ccba18a6b08e79d24d443ece75:/src/surf/surf_routing.c diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index 5901fbd2ff..110992498b 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -1229,3 +1229,37 @@ void routing_exit(void) { finalize_rec(routing_platf->root); xbt_free(routing_platf); } + +AS_t surf_AS_get_routing_root() { + return routing_platf->root; +} + +const char *surf_AS_get_name(AS_t as) { + return as->name; +} + +xbt_dict_t surf_AS_get_routing_sons(AS_t as) { + return as->routing_sons; +} + +const char *surf_AS_get_model(AS_t as) { + return as->model_desc->name; +} + +xbt_dynar_t surf_AS_get_hosts(AS_t as) { + xbt_dynar_t elms = as->index_network_elm; + sg_routing_edge_t relm; + xbt_dictelm_t delm; + int index; + int count = xbt_dynar_length(elms); + xbt_dynar_t res = xbt_dynar_new(sizeof(xbt_dictelm_t), NULL); + for (index = 0; index < count; index++) { + relm = xbt_dynar_get_as(elms, index, sg_routing_edge_t); + printf("relm:%s\n", relm->name); + delm = xbt_lib_get_elm_or_null(host_lib, relm->name); + if (delm!=NULL) { + xbt_dynar_push(res, &delm); + } + } + return res; +}