namespace routing {
class AsImpl;
class NetCard;
- class AsRoute;
+ class BypassRoute;
}
}
namespace s4u {
bool sealed_ = false; // We cannot add more content when sealed
- std::map<std::pair<kernel::routing::NetCard*, kernel::routing::NetCard*>, kernel::routing::AsRoute*>
+ std::map<std::pair<kernel::routing::NetCard*, kernel::routing::NetCard*>, kernel::routing::BypassRoute*>
bypassRoutes_; // src x dst -> route
xbt_dict_t children_ = xbt_dict_new_homogeneous(nullptr); // sub-ASes
};
#include "simgrid/s4u/host.hpp"
#include "src/kernel/routing/AsImpl.hpp"
+#include "src/kernel/routing/BypassRoute.hpp"
#include "src/kernel/routing/NetCard.hpp"
#include "src/surf/cpu_interface.hpp"
#include "src/surf/network_interface.hpp"
/* Base case, no recursion is needed */
if (dst->containingAS() == this && src->containingAS() == this) {
if (bypassRoutes_.find({src, dst}) != bypassRoutes_.end()) {
- AsRoute* bypassedRoute = bypassRoutes_.at({src, dst});
+ BypassRoute* bypassedRoute = bypassRoutes_.at({src, dst});
for (surf::Link* link : bypassedRoute->links) {
links->push_back(link);
if (latency)
int max_index = std::max(max_index_src, max_index_dst);
/* (3) Search for a bypass making the path up to the ancestor useless */
- AsRoute* bypassedRoute = nullptr;
+ BypassRoute* bypassedRoute = nullptr;
std::pair<kernel::routing::NetCard*, kernel::routing::NetCard*> key;
for (int max = 0; max <= max_index; max++) {
for (int i = 0; i < max; i++) {
--- /dev/null
+/* Copyright (c) 2013-2016. The SimGrid Team. All rights reserved. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#ifndef KERNEL_ROUTING_BYPASSROUTE_HPP_
+#define KERNEL_ROUTING_BYPASSROUTE_HPP_
+
+#include <xbt/base.h>
+#include <xbt/signal.hpp>
+
+#include "src/kernel/routing/NetCard.hpp"
+
+namespace simgrid {
+namespace kernel {
+namespace routing {
+
+class BypassRoute {
+public:
+ explicit BypassRoute(NetCard* gwSrc, NetCard* gwDst) : gw_src(gwSrc), gw_dst(gwDst) {}
+ const NetCard* gw_src;
+ const NetCard* gw_dst;
+ std::vector<Link*> links;
+};
+}
+}
+}
+
+#endif /* KERNEL_ROUTING_BYPASSROUTE_HPP_ */
#include <simgrid/s4u/host.hpp>
#include <simgrid/s4u/As.hpp>
+#include "src/kernel/routing/BypassRoute.hpp"
#include "src/kernel/routing/NetCard.hpp"
#include "src/surf/network_interface.hpp" // Link FIXME: move to proper header
#include "src/surf/surf_routing.hpp"
}
/* Build a copy that will be stored in the dict */
- kernel::routing::AsRoute* newRoute = new kernel::routing::AsRoute(e_route->gw_src, e_route->gw_dst);
+ kernel::routing::BypassRoute* newRoute = new kernel::routing::BypassRoute(e_route->gw_src, e_route->gw_dst);
for (auto link : *e_route->link_list)
newRoute->links.push_back(link);
XBT_PUBLIC_DATA(simgrid::xbt::signal<void(s4u::As*)>) asCreatedCallbacks;
-/***********
- * Classes *
- ***********/
-
-class AsRoute {
-public:
- explicit AsRoute(NetCard* gwSrc, NetCard* gwDst) : gw_src(gwSrc), gw_dst(gwDst) {}
- const NetCard* gw_src;
- const NetCard* gw_dst;
- std::vector<Link*> links;
-};
-
}}}
#endif /* NETWORK_ROUTING_HPP_ */
src/kernel/routing/AsRoutedGraph.hpp
src/kernel/routing/AsNone.hpp
src/kernel/routing/AsVivaldi.hpp
+ src/kernel/routing/BypassRoute.hpp
src/kernel/routing/NetCard.hpp
src/surf/storage_interface.hpp