- src_id = network_card_new(A_surfxml_route_src);
- dst_id = network_card_new(A_surfxml_route_dst);
- route_action = A_surfxml_route_action;
-}
-
-/* KF*/
-static void parse_route_set_routers(void)
-{
- int id = network_card_new(A_surfxml_router_id);
-
- /* KF: Create the GTNets router */
- if (gtnets_add_router(id)) {
- xbt_assert0(0, "Cannot add GTNetS router");
- }
-}
-
-/* Create the route (more than one hops): MODIFIED BY KF */
-static void parse_route_set_route(void)
-{
- char *name;
- if (src_id != -1 && dst_id != -1) {
- name = bprintf("%x#%x",src_id, dst_id);
- manage_route(route_table, name, route_action, 0);
- free(name);
- }
-}
-
-static void add_route()
-{
- xbt_ex_t e;
- unsigned int cpt = 0;
- int link_list_capacity = 0;
- int nb_link = 0;
- xbt_dict_cursor_t cursor = NULL;
- char *key,*data, *end;
- const char *sep = "#";
- xbt_dynar_t links, keys;
- static network_link_GTNETS_t *link_list = NULL;
-
-
- DEBUG0("Entering add_route()");
- xbt_dict_foreach(route_table, cursor, key, data) {
- char *link = NULL;
- nb_link = 0;
- links = (xbt_dynar_t)data;
- keys = xbt_str_split_str(key, sep);
-
- link_list_capacity = xbt_dynar_length(links);
- link_list = xbt_new(network_link_GTNETS_t, link_list_capacity);
-
- src_id = strtol(xbt_dynar_get_as(keys, 0, char*), &end, 16);
- dst_id = strtol(xbt_dynar_get_as(keys, 1, char*), &end, 16);
- xbt_dynar_free(&keys);
-
- xbt_dynar_foreach (links, cpt, link) {
- TRY {
- link_list[nb_link++] = xbt_dict_get(link_set, link);
- }
- CATCH(e) {
- RETHROW1("Link %s not found (dict raised this exception: %s)", link);
- }
- }
- if (nb_link > 1)
- route_new(src_id, dst_id, link_list, nb_link);
- if (nb_link == 1)
- route_onehop_new(src_id, dst_id, link_list, nb_link);
- }
-
- xbt_dict_free(&route_table);
- DEBUG0("Bailling add_route()");
+// xbt_dict_cursor_t cursor = NULL;
+// char *key, *data;
+// xbt_dict_t onelink_routes = global_routing->get_onelink_routes();
+// xbt_assert0(onelink_routes, "Error onelink_routes was not initialized");
+//
+// DEBUG0("Starting topology generation");
+// À refaire plus tard. Il faut prendre la liste des hôtes/routeurs (dans routing)
+// À partir de cette liste, on les numérote.
+// Ensuite, on peut utiliser les id pour refaire les appels GTNets qui suivent.
+
+// xbt_dict_foreach(onelink_routes, cursor, key, data){
+// s_onelink_t link = (s_onelink_t) data;
+//
+// DEBUG3("Link (#%d), src (#%s), dst (#%s)", ((network_link_GTNETS_t)(link->link_ptr))->id , link->src, link->dst);
+// DEBUG0("Calling one link route");
+// if(global_routing->is_router(link->src)){
+// gtnets_add_router(link->src_id);
+// }
+// if(global_routing->is_router(link->dst)){
+// gtnets_add_router(link->dst_id);
+// }
+// route_onehop_new(link->src_id, link->dst_id, (network_link_GTNETS_t)(link->link_ptr));
+// }
+//
+// xbt_dict_free(&route_table);
+// if (XBT_LOG_ISENABLED(surf_network_gtnets, xbt_log_priority_debug)) {
+// gtnets_print_topology();
+// }