- route->src_gateway =
- remplace(ruleroute_extended->re_src_gateway, list_src, rc_src,
- list_dst, rc_dst);
- 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 = (network_element_t)xbt_lib_get_or_null(host_lib, gw_src_name, ROUTING_HOST_LEVEL);
+ route->src_gateway = (network_element_t)xbt_lib_get_or_null(host_lib, gw_src_name, ROUTING_HOST_LEVEL);
+ if(!route->src_gateway)
+ route->src_gateway = (network_element_t)xbt_lib_get_or_null(as_router_lib, gw_src_name, ROUTING_ASR_LEVEL);
+ if(!route->src_gateway)
+ route->src_gateway = (network_element_t)xbt_lib_get_or_null(as_router_lib, gw_src_name, ROUTING_ASR_LEVEL);
+
+ char *gw_dst_name = remplace(ruleroute_extended->re_dst_gateway, list_src, rc_src,
+ list_dst, rc_dst);
+ route->dst_gateway = (network_element_t)xbt_lib_get_or_null(host_lib, gw_dst_name, ROUTING_HOST_LEVEL);
+ route->dst_gateway = (network_element_t)xbt_lib_get_or_null(host_lib, gw_dst_name, ROUTING_HOST_LEVEL);
+ if(!route->dst_gateway)
+ route->dst_gateway = (network_element_t)xbt_lib_get_or_null(as_router_lib, gw_dst_name, ROUTING_ASR_LEVEL);
+ if(!route->dst_gateway)
+ route->dst_gateway = (network_element_t)xbt_lib_get_or_null(as_router_lib, gw_dst_name, ROUTING_ASR_LEVEL);