xbt_dynar_t back_route = NULL;
int constraints_per_variable = 0;
- // I will need this route for some time so let's call get_route_no_cleanup
- xbt_dynar_t route = global_routing->get_route_no_cleanup(src_name, dst_name);
+ // I will need this route for some time so let's call get_route with 0 as last argument to preserve it
+ xbt_dynar_t route;
+ routing_get_route_and_latency(src_name, dst_name,&route,NULL,0);
if (sg_network_fullduplex == 1) {
*
* walk through the routing components tree and find a route between hosts
* by calling the differents "get_route" functions in each routing component.
- * No need to free the returned dynar. It will be freed at the next call.
*/
void routing_get_route_and_latency(const char *src, const char *dst,
xbt_dynar_t * route, double *latency, int cleanup)
}
}
-/**
- * \brief Generic method: find a route between hosts
- *
- * \param src the source host name
- * \param dst the destination host name
- *
- * walk through the routing components tree and find a route between hosts
- * by calling the differents "get_route" functions in each routing component.
- * Leaves the caller the responsability to clean the returned dynar.
- */
-static xbt_dynar_t get_route_no_cleanup(const char *src, const char *dst)
-{
- xbt_dynar_t route = NULL;
- routing_get_route_and_latency(src, dst, &route, NULL, 0);
- return route;
-}
-
static xbt_dynar_t recursive_get_onelink_routes(AS_t rc)
{
xbt_dynar_t ret = xbt_dynar_new(sizeof(onelink_t), xbt_free);
/* config the uniq global routing */
global_routing = xbt_new0(s_routing_global_t, 1);
global_routing->root = NULL;
- global_routing->get_route_no_cleanup = get_route_no_cleanup;
global_routing->get_onelink_routes = get_onelink_routes;
global_routing->loopback = loopback;
global_routing->size_of_link = size_of_links;