- xbt_node_t node = NULL;
- unsigned int cursor2;
- xbt_dynar_t nodes = NULL;
-
- /* Create the topology graph */
- if(!p_routeGraph)
- p_routeGraph = xbt_graph_new_graph(1, NULL);
- if(!p_graphNodeMap)
- p_graphNodeMap = xbt_dict_new_homogeneous(&graph_node_map_elem_free);
-
- if (m_cached && !p_routeCache)
- p_routeCache = xbt_dict_new_homogeneous(&route_cache_elem_free);
-
- /* Add the loopback if needed */
- if (routing_platf->p_loopback && p_hierarchy == SURF_ROUTING_BASE)
- addLoopback();
-
- /* initialize graph indexes in nodes after graph has been built */
- nodes = xbt_graph_get_nodes(p_routeGraph);
-
- xbt_dynar_foreach(nodes, cursor2, node) {
- graph_node_data_t data = (graph_node_data_t) xbt_graph_node_get_data(node);
- data->graph_id = cursor2;
- }
-
-}
-
-void AsDijkstra::parseASroute(sg_platf_route_cbarg_t route)
-{
- parseRoute(route);
-}
-
-void AsDijkstra::parseRoute(sg_platf_route_cbarg_t route)
-{
- char *src = (char*)(route->src);
- char *dst = (char*)(route->dst);
-
- int as_route = 0;
- if(!route->gw_dst && !route->gw_src)
- XBT_DEBUG("Load Route from \"%s\" to \"%s\"", src, dst);
- else{
- XBT_DEBUG("Load ASroute from \"%s(%s)\" to \"%s(%s)\"", src,
- route->gw_src->getName(), dst, route->gw_dst->getName());
- as_route = 1;
- if(route->gw_dst->getRcType() == SURF_NETWORK_ELEMENT_NULL)
- surf_parse_error("The gw_dst '%s' does not exist!",route->gw_dst->getName());
- if(route->gw_src->getRcType() == SURF_NETWORK_ELEMENT_NULL)
- surf_parse_error("The gw_src '%s' does not exist!",route->gw_src->getName());
- }
-
- NetCard *src_net_elm, *dst_net_elm;
-
- src_net_elm = sg_netcard_by_name_or_null(src);
- dst_net_elm = sg_netcard_by_name_or_null(dst);