- new_e_route->src_gateway =
- remplace(ruleroute_extended->re_src_gateway, list_src, rc_src,
- list_dst, rc_dst);
- new_e_route->dst_gateway =
- remplace(ruleroute_extended->re_dst_gateway, list_src, rc_src,
- list_dst, rc_dst);
+ char *gw_src_name = remplace(ruleroute_extended->re_src_gateway, list_src, rc_src,
+ list_dst, rc_dst);
+ route->src_gateway = xbt_lib_get_or_null(host_lib, gw_src_name,
+ ROUTING_HOST_LEVEL);
+ route->src_gateway = xbt_lib_get_or_null(host_lib, gw_src_name,
+ ROUTING_HOST_LEVEL);
+ if (!route->src_gateway)
+ route->src_gateway = xbt_lib_get_or_null(as_router_lib, gw_src_name,
+ ROUTING_ASR_LEVEL);
+ if (!route->src_gateway)
+ route->src_gateway = xbt_lib_get_or_null(as_router_lib, gw_src_name,
+ ROUTING_ASR_LEVEL);
+ xbt_free(gw_src_name);
+
+ char *gw_dst_name = remplace(ruleroute_extended->re_dst_gateway, list_src, rc_src,
+ list_dst, rc_dst);
+ route->dst_gateway = xbt_lib_get_or_null(host_lib, gw_dst_name,
+ ROUTING_HOST_LEVEL);
+ route->dst_gateway = xbt_lib_get_or_null(host_lib, gw_dst_name,
+ ROUTING_HOST_LEVEL);
+ if (!route->dst_gateway)
+ route->dst_gateway = xbt_lib_get_or_null(as_router_lib, gw_dst_name,
+ ROUTING_ASR_LEVEL);
+ if (!route->dst_gateway)
+ route->dst_gateway = xbt_lib_get_or_null(as_router_lib, gw_dst_name,
+ ROUTING_ASR_LEVEL);
+ xbt_free(gw_dst_name);