- //create link ns3
- ns3_node_t host_src = ns3_find_host(src);
- if (!host_src)
- host_src = static_cast<ns3_node_t>(xbt_lib_get_or_null(as_router_lib,src,NS3_ASR_LEVEL));
- ns3_node_t host_dst = ns3_find_host(dst);
- if(!host_dst)
- host_dst = static_cast<ns3_node_t>(xbt_lib_get_or_null(as_router_lib,dst,NS3_ASR_LEVEL));
-
- if (!host_src || !host_dst)
- xbt_die("\tns3_add_link from %d to %d",host_src->node_num,host_dst->node_num);
-
- ns3_add_link(host_src->node_num, host_dst->node_num, link_bdw, link_lat);
-
- xbt_free(link_bdw);
- xbt_free(link_lat);
- }
+ ns3_add_link(host_src, host_dst, link->bandwidth(), link->latency());
+ } else {
+ static bool warned_about_long_routes = false;
+
+ if (not warned_about_long_routes)
+ XBT_WARN("Ignoring a route between %s and %s of length %zu: Only routes of length 1 are considered with NS3.\n"
+ "WARNING: You can ignore this warning if your hosts can still communicate when only considering routes "
+ "of length 1.\n"
+ "WARNING: Remove long routes to avoid this harmless message; subsequent long routes will be silently "
+ "ignored.",
+ src->getCname(), dst->getCname(), link_list.size());
+ warned_about_long_routes = true;