X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a3fac4d6b683940fa2ed70fbb093469c7624bfe2..3fb716c621a70c296757ca81a37327334e829a85:/src/surf/surf_routing_rulebased.c diff --git a/src/surf/surf_routing_rulebased.c b/src/surf/surf_routing_rulebased.c index a74ae31707..23581f4d4e 100644 --- a/src/surf/surf_routing_rulebased.c +++ b/src/surf/surf_routing_rulebased.c @@ -4,8 +4,6 @@ /* 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. */ #include "surf_routing_private.h" - -#ifdef HAVE_PCRE_LIB #include /* regular expression library */ /* Global vars */ @@ -181,7 +179,7 @@ static char *remplace(char *value, const char **src_list, int src_size, /* solve the indication */ const char **param_list; - int param_size; + _XBT_GNUC_UNUSED int param_size; if (value[i] == 's' && value[i + 1] == 'r' && value[i + 2] == 'c') { param_list = src_list; param_size = src_size; @@ -221,6 +219,11 @@ static route_extended_t rulebased_get_route(routing_component_t rc, static xbt_dynar_t rulebased_get_onelink_routes(routing_component_t rc) { xbt_dynar_t ret = xbt_dynar_new (sizeof(onelink_t), xbt_free); + + //We have already bypass cluster routes with network NS3 + if(!strcmp(surf_network_model->name,"network NS3")) + return ret; + routing_component_rulebased_t routing = (routing_component_rulebased_t)rc; xbt_dict_cursor_t c1 = NULL; @@ -306,7 +309,7 @@ static route_extended_t rulebased_get_route(routing_component_t rc, int ovector_dst[OVECCOUNT]; const char **list_src = NULL; const char **list_dst = NULL; - int res; + _XBT_GNUC_UNUSED int res; xbt_dynar_foreach(rule_list, cpt, ruleroute) { rc_src = pcre_exec(ruleroute->re_src, NULL, src, src_length, 0, 0, @@ -391,10 +394,11 @@ static void rulebased_finalize(routing_component_t rc) } /* Creation routing model functions */ -void *model_rulebased_create(void) -{ - routing_component_rulebased_t new_component = - xbt_new0(s_routing_component_rulebased_t, 1); +routing_component_t model_rulebased_create(void) { + + routing_component_rulebased_t new_component = (routing_component_rulebased_t) + routmod_generic_create(sizeof(s_routing_component_rulebased_t)); + new_component->generic_routing.set_processing_unit = model_rulebased_set_processing_unit; new_component->generic_routing.set_autonomous_system = @@ -404,10 +408,8 @@ void *model_rulebased_create(void) new_component->generic_routing.set_bypassroute = model_rulebased_set_bypassroute; new_component->generic_routing.get_onelink_routes = rulebased_get_onelink_routes; new_component->generic_routing.get_route = rulebased_get_route; - new_component->generic_routing.get_latency = generic_get_link_latency; new_component->generic_routing.get_bypass_route = rulebased_get_bypass_route; new_component->generic_routing.finalize = rulebased_finalize; - new_component->generic_routing.get_network_element_type = get_network_element_type; /* initialization of internal structures */ new_component->dict_processing_units = xbt_dict_new(); new_component->dict_autonomous_systems = xbt_dict_new(); @@ -415,21 +417,6 @@ void *model_rulebased_create(void) new_component->list_ASroute = xbt_dynar_new(sizeof(rule_route_extended_t), &rule_route_extended_free); - return new_component; -} -void model_rulebased_load(void) -{ - /* use "surfxml_add_callback" to add a parse function call */ + return (routing_component_t) new_component; } - -void model_rulebased_unload(void) -{ - /* use "surfxml_del_callback" to remove a parse function call */ -} - -void model_rulebased_end(void) -{ -} - -#endif /* HAVE_PCRE_LIB */