]> AND Public Git Repository - simgrid.git/blobdiff - src/surf/surf_routing.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[surf] Remove sg_platf_peer_cb
[simgrid.git] / src / surf / surf_routing.cpp
index bea447437a2b7adfcf42f02fe7973516b059902a..d63995d66097b4aad59af4c4610798bce25fa510 100644 (file)
@@ -21,6 +21,7 @@
  *************/
 
 surf_callback(void, RoutingEdge*) routingEdgeCreatedCallbacks;
+surf_callback(void, As*) asCreatedCallbacks;
 
 /**
  * @ingroup SURF_build_api
@@ -74,7 +75,6 @@ As* routing_get_current()
   return current_routing;
 }
 
-static void routing_parse_peer(sg_platf_peer_cbarg_t peer);     /* peer bypass */
 // static void routing_parse_Srandom(void);        /* random bypass */
 
 static void routing_parse_postparse(void);
@@ -121,7 +121,7 @@ struct s_model_type routing_models[] = {
 /**
  * \brief Add a "host_link" to the network element list
  */
-static void parse_S_host(sg_platf_host_link_cbarg_t host)
+void sg_platf_new_host_link(sg_platf_host_link_cbarg_t host)
 {
   RoutingEdge *info = sg_host_edge(sg_host_by_name(host->id));
   xbt_assert(info, "Host '%s' not found!", host->id);
@@ -375,11 +375,12 @@ void routing_AS_begin(sg_platf_AS_cbarg_t AS)
               (void *) info);
   XBT_DEBUG("Having set name '%s' id '%d'", new_as->p_name, info->getId());
 
-  routingEdgeCreatedCallbacks(info);
-
   /* set the new current component of the tree */
   current_routing = new_as;
   current_routing->p_netElem = info;
+
+  routingEdgeCreatedCallbacks(info);
+  asCreatedCallbacks(new_as);
 }
 
 /**
@@ -393,7 +394,7 @@ void routing_AS_begin(sg_platf_AS_cbarg_t AS)
  * even if you add stuff to a closed AS
  *
  */
-void routing_AS_end(sg_platf_AS_cbarg_t /*AS*/)
+void routing_AS_end()
 {
 
   if (current_routing == NULL) {
@@ -1027,7 +1028,7 @@ static void routing_parse_postparse(void) {
   xbt_dict_free(&random_value);
 }
 
-static void routing_parse_peer(sg_platf_peer_cbarg_t peer)
+void sg_platf_new_peer(sg_platf_peer_cbarg_t peer)
 {
   char *host_id = NULL;
   char *link_id = NULL;
@@ -1249,7 +1250,6 @@ static void check_disk_attachment()
 
 void routing_register_callbacks()
 {
-  sg_platf_host_link_add_cb(parse_S_host);
   sg_platf_route_add_cb(parse_E_route);
   sg_platf_ASroute_add_cb(parse_E_ASroute);
   sg_platf_bypassRoute_add_cb(parse_E_bypassRoute);
@@ -1258,14 +1258,9 @@ void routing_register_callbacks()
   sg_platf_cluster_add_cb(routing_parse_cluster);
   sg_platf_cabinet_add_cb(routing_parse_cabinet);
 
-  sg_platf_peer_add_cb(routing_parse_peer);
   sg_platf_postparse_add_cb(routing_parse_postparse);
   sg_platf_postparse_add_cb(check_disk_attachment);
 
-  /* we care about the ASes while parsing the platf. Incredible, isnt it? */
-  sg_platf_AS_end_add_cb(routing_AS_end);
-  sg_platf_AS_begin_add_cb(routing_AS_begin);
-
   sg_platf_trace_add_cb(routing_parse_trace);
   sg_platf_trace_connect_add_cb(routing_parse_trace_connect);