X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f783ed4680c6862a1b7543237e89d1221334bae0..f193fed57024f1b113f3ec07500a76e1ed5b76b1:/src/surf/surf_routing_floyd.c diff --git a/src/surf/surf_routing_floyd.c b/src/surf/surf_routing_floyd.c index e744b8670e..fc8d664346 100644 --- a/src/surf/surf_routing_floyd.c +++ b/src/surf/surf_routing_floyd.c @@ -9,7 +9,7 @@ /* Global vars */ extern routing_global_t global_routing; extern routing_component_t current_routing; -extern model_type_t current_routing_model; +extern routing_model_description_t current_routing_model; XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_floyd, surf, "Routing part of surf"); @@ -174,38 +174,16 @@ static void floyd_finalize(routing_component_t rc) } } -void *model_floyd_create(void) +routing_component_t model_floyd_create(void) { - routing_component_floyd_t new_component = - xbt_new0(s_routing_component_floyd_t, 1); - new_component->generic_routing.set_processing_unit = - generic_set_processing_unit; - new_component->generic_routing.set_autonomous_system = - generic_set_autonomous_system; - new_component->generic_routing.set_route = model_floyd_set_route; - new_component->generic_routing.set_ASroute = model_floyd_set_route; - new_component->generic_routing.set_bypassroute = generic_set_bypassroute; + routing_component_floyd_t new_component = (routing_component_floyd_t)routmod_generic_create(sizeof(s_routing_component_floyd_t)); + new_component->generic_routing.parse_route = model_floyd_parse_route; + new_component->generic_routing.parse_ASroute = model_floyd_parse_route; new_component->generic_routing.get_route = floyd_get_route; - new_component->generic_routing.get_latency = generic_get_link_latency; new_component->generic_routing.get_onelink_routes = floyd_get_onelink_routes; - new_component->generic_routing.get_bypass_route = - generic_get_bypassroute; new_component->generic_routing.finalize = floyd_finalize; - new_component->generic_routing.to_index = xbt_dict_new(); - new_component->generic_routing.bypassRoutes = xbt_dict_new(); - new_component->generic_routing.get_network_element_type = get_network_element_type; - return new_component; -} - -void model_floyd_load(void) -{ - /* use "surfxml_add_callback" to add a parse function call */ -} - -void model_floyd_unload(void) -{ - /* use "surfxml_del_callback" to remove a parse function call */ + return (routing_component_t)new_component; } void model_floyd_end(void) @@ -271,7 +249,13 @@ void model_floyd_end(void) } } -void model_floyd_set_route(routing_component_t rc, const char *src, +static int surf_pointer_resource_cmp(const void *a, const void *b) { + return a != b; +} + +//FIXME: kill dupplicates in next function with full routing + +void model_floyd_parse_route(routing_component_t rc, const char *src, const char *dst, name_route_extended_t route) { routing_component_floyd_t routing = (routing_component_floyd_t) rc;