+/**
+ * \brief Find a route toward another host
+ *
+ * \param dest [IN] where to
+ * \param links [OUT] where to store the list of links (must exist, cannot be nullptr).
+ * \param latency [OUT] where to store the latency experienced on the path (or nullptr if not interested)
+ * It is the caller responsibility to initialize latency to 0 (we add to provided route)
+ * \pre links!=nullptr
+ *
+ * walk through the routing components tree and find a route between hosts
+ * by calling each "get_route" function in each routing component.
+ */
+void Host::routeTo(Host* dest, std::vector<Link*>* links, double* latency)
+{
+ std::vector<surf::LinkImpl*> linkImpls;
+ this->routeTo(dest, &linkImpls, latency);
+ for (surf::LinkImpl* l : linkImpls)
+ links->push_back(&l->piface_);
+}
+/** @brief Just like Host::routeTo, but filling an array of link implementations */
+void Host::routeTo(Host* dest, std::vector<surf::LinkImpl*>* links, double* latency)
+{
+ simgrid::kernel::routing::NetZoneImpl::getGlobalRoute(pimpl_netpoint, dest->pimpl_netpoint, links, latency);
+ if (XBT_LOG_ISENABLED(surf_route, xbt_log_priority_debug)) {
+ XBT_CDEBUG(surf_route, "Route from '%s' to '%s' (latency: %f):", cname(), dest->cname(),
+ (latency == nullptr ? -1 : *latency));
+ for (auto link : *links)
+ XBT_CDEBUG(surf_route, "Link %s", link->cname());
+ }
+}
+