Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
rename AsRoute to BypassRoute, and move it to its own file
[simgrid.git] / src / s4u / s4u_as.cpp
index 0a14f8d..1a8587b 100644 (file)
@@ -9,14 +9,21 @@
 #include <simgrid/s4u/host.hpp>
 #include <simgrid/s4u/As.hpp>
 
-#include "src/surf/surf_routing.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"
 
 XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_as,"S4U autonomous systems");
 
 namespace simgrid {
   namespace s4u {
 
+  simgrid::xbt::signal<void(bool symmetrical, kernel::routing::NetCard* src, kernel::routing::NetCard* dst,
+                            kernel::routing::NetCard* gw_src, kernel::routing::NetCard* gw_dst,
+                            std::vector<Link*>* link_list)>
+      As::onRouteCreation;
+
   As::As(As* father, const char* name) : father_(father), name_(xbt_strdup(name))
   {
   }
@@ -95,9 +102,9 @@ namespace simgrid {
     }
 
     /* Build a copy that will be stored in the dict */
-    std::vector<surf::Link*>* newRoute = new std::vector<surf::Link*>();
+    kernel::routing::BypassRoute* newRoute = new kernel::routing::BypassRoute(e_route->gw_src, e_route->gw_dst);
     for (auto link : *e_route->link_list)
-      newRoute->push_back(link);
+      newRoute->links.push_back(link);
 
     /* Store it */
     bypassRoutes_.insert({{e_route->src, e_route->dst}, newRoute});