From 8b9d5b06f13415e8201d2bff377190232121ab42 Mon Sep 17 00:00:00 2001 From: navarro Date: Mon, 6 Aug 2012 11:38:35 +0200 Subject: [PATCH] Add function sg_platf_new_* for *route and bypass*route. --- include/simgrid/platf.h | 36 ++++++ src/include/simgrid/platf_interface.h | 10 ++ src/surf/sg_platf.c | 55 ++++++++- src/surf/surf_routing.c | 166 +++++++------------------- src/surf/surfxml_parse.c | 102 +++++++++++++--- 5 files changed, 230 insertions(+), 139 deletions(-) diff --git a/include/simgrid/platf.h b/include/simgrid/platf.h index aa0075dabe..2359872f7a 100644 --- a/include/simgrid/platf.h +++ b/include/simgrid/platf.h @@ -122,6 +122,36 @@ typedef struct s_sg_platf_linkctn_cbarg { e_surf_link_ctn_direction_t direction; } s_sg_platf_linkctn_cbarg_t; +typedef struct s_sg_platf_route_cbarg *sg_platf_route_cbarg_t; +typedef struct s_sg_platf_route_cbarg { + int symmetrical; + const char *src; + const char *dst; +} s_sg_platf_route_cbarg_t; + +typedef struct s_sg_platf_ASroute_cbarg *sg_platf_ASroute_cbarg_t; +typedef struct s_sg_platf_ASroute_cbarg { + int symmetrical; + const char *src; + const char *dst; + const char *gw_src; + const char *gw_dst; +} s_sg_platf_ASroute_cbarg_t; + +typedef struct s_sg_platf_bypassRoute_cbarg *sg_platf_bypassRoute_cbarg_t; +typedef struct s_sg_platf_bypassRoute_cbarg { + const char *src; + const char *dst; +} s_sg_platf_bypassRoute_cbarg_t; + +typedef struct s_sg_platf_bypassASroute_cbarg *sg_platf_bypassASroute_cbarg_t; +typedef struct s_sg_platf_bypassASroute_cbarg { + const char *src; + const char *dst; + const char *gw_src; + const char *gw_dst; +} s_sg_platf_bypassASroute_cbarg_t; + typedef struct s_sg_platf_cluster_cbarg *sg_platf_cluster_cbarg_t; typedef struct s_sg_platf_cluster_cbarg { const char* id; @@ -191,6 +221,12 @@ XBT_PUBLIC(void) sg_platf_new_linkctn (sg_platf_linkctn_cbarg_t linkctn); XBT_PUBLIC(void) sg_platf_new_peer (sg_platf_peer_cbarg_t peer); // Add a peer to the currently described AS XBT_PUBLIC(void) sg_platf_new_cluster(sg_platf_cluster_cbarg_t clust); // Add a cluster to the currently described AS XBT_PUBLIC(void) sg_platf_new_cabinet(sg_platf_cabinet_cbarg_t cabinet); // Add a cabinet to the currently described AS + +XBT_PUBLIC(void) sg_platf_new_route (sg_platf_route_cbarg_t route); // Add a route +XBT_PUBLIC(void) sg_platf_new_ASroute (sg_platf_ASroute_cbarg_t ASroute); // Add an ASroute +XBT_PUBLIC(void) sg_platf_new_bypassRoute (sg_platf_bypassRoute_cbarg_t bypassroute); // Add a bypassRoute +XBT_PUBLIC(void) sg_platf_new_bypassASroute (sg_platf_bypassASroute_cbarg_t bypassASroute); // Add an bypassASroute + XBT_PUBLIC(void) sg_platf_new_storage(sg_platf_storage_cbarg_t storage); // Add a storage to the currently described AS XBT_PUBLIC(void) sg_platf_new_storage(sg_platf_storage_cbarg_t storage); // Add a storage to the currently described AS XBT_PUBLIC(void) sg_platf_new_mstorage(sg_platf_mstorage_cbarg_t mstorage); diff --git a/src/include/simgrid/platf_interface.h b/src/include/simgrid/platf_interface.h index b230dc7853..da830c7009 100644 --- a/src/include/simgrid/platf_interface.h +++ b/src/include/simgrid/platf_interface.h @@ -28,6 +28,11 @@ typedef void (*sg_platf_cluster_cb_t)(sg_platf_cluster_cbarg_t); typedef void (*sg_platf_cabinet_cb_t)(sg_platf_cabinet_cbarg_t); typedef void (*sg_platf_AS_begin_cb_t)(const char*id, int routing); +typedef void (*sg_platf_route_cb_t)(sg_platf_route_cbarg_t); +typedef void (*sg_platf_ASroute_cb_t)(sg_platf_ASroute_cbarg_t); +typedef void (*sg_platf_bypassRoute_cb_t)(sg_platf_bypassRoute_cbarg_t); +typedef void (*sg_platf_bypassASroute_cb_t)(sg_platf_bypassASroute_cbarg_t); + typedef void (*sg_platf_storage_cb_t)(sg_platf_storage_cbarg_t); typedef void (*sg_platf_storage_type_cb_t)(sg_platf_storage_type_cbarg_t); typedef void (*sg_platf_mount_cb_t)(sg_platf_mount_cbarg_t); @@ -45,6 +50,11 @@ void sg_platf_postparse_add_cb(void_f_void_t fct); void sg_platf_AS_begin_add_cb(sg_platf_AS_begin_cb_t fct); void sg_platf_AS_end_add_cb(void_f_void_t fct); +void sg_platf_route_add_cb(sg_platf_route_cb_t); +void sg_platf_ASroute_add_cb(sg_platf_ASroute_cb_t); +void sg_platf_bypassRoute_add_cb(sg_platf_bypassRoute_cb_t); +void sg_platf_bypassASroute_add_cb(sg_platf_bypassASroute_cb_t); + void sg_platf_storage_add_cb(sg_platf_storage_cb_t fct); void sg_platf_mstorage_add_cb(sg_platf_mstorage_cb_t fct); void sg_platf_storage_type_add_cb(sg_platf_storage_type_cb_t fct); diff --git a/src/surf/sg_platf.c b/src/surf/sg_platf.c index e4480b155d..175ff66f6f 100644 --- a/src/surf/sg_platf.c +++ b/src/surf/sg_platf.c @@ -24,6 +24,11 @@ xbt_dynar_t sg_platf_AS_begin_cb_list = NULL; //of sg_platf_AS_begin_cb_t xbt_dynar_t sg_platf_AS_end_cb_list = NULL; //of void_f_void_t xbt_dynar_t sg_platf_postparse_cb_list = NULL; // of void_f_void_t +xbt_dynar_t sg_platf_route_cb_list = NULL; // of sg_platf_route_cb_t +xbt_dynar_t sg_platf_ASroute_cb_list = NULL; // of sg_platf_ASroute_cb_t +xbt_dynar_t sg_platf_bypassRoute_cb_list = NULL; // of sg_platf_bypassRoute_cb_t +xbt_dynar_t sg_platf_bypassASroute_cb_list = NULL; // of sg_platf_bypassASroute_cb_t + xbt_dynar_t sg_platf_storage_cb_list = NULL; // of sg_platf_storage_cb_t xbt_dynar_t sg_platf_storage_type_cb_list = NULL; // of sg_platf_storage_cb_t xbt_dynar_t sg_platf_mstorage_cb_list = NULL; // of sg_platf_storage_cb_t @@ -53,6 +58,11 @@ void sg_platf_init(void) { sg_platf_AS_begin_cb_list = xbt_dynar_new(sizeof(sg_platf_AS_begin_cb_t),NULL); sg_platf_AS_end_cb_list = xbt_dynar_new(sizeof(void_f_void_t),NULL); + sg_platf_route_cb_list = xbt_dynar_new(sizeof(sg_platf_route_cb_t), NULL); + sg_platf_ASroute_cb_list = xbt_dynar_new(sizeof(sg_platf_ASroute_cb_t), NULL); + sg_platf_bypassRoute_cb_list = xbt_dynar_new(sizeof(sg_platf_bypassRoute_cb_t), NULL); + sg_platf_bypassASroute_cb_list = xbt_dynar_new(sizeof(sg_platf_bypassASroute_cb_t), NULL); + sg_platf_storage_cb_list = xbt_dynar_new(sizeof(sg_platf_storage_cb_t), NULL); sg_platf_storage_type_cb_list = xbt_dynar_new(sizeof(sg_platf_storage_cb_t), NULL); sg_platf_mstorage_cb_list = xbt_dynar_new(sizeof(sg_platf_storage_cb_t), NULL); @@ -72,6 +82,11 @@ void sg_platf_exit(void) { xbt_dynar_free(&sg_platf_AS_begin_cb_list); xbt_dynar_free(&sg_platf_AS_end_cb_list); + xbt_dynar_free(&sg_platf_route_cb_list); + xbt_dynar_free(&sg_platf_ASroute_cb_list); + xbt_dynar_free(&sg_platf_bypassRoute_cb_list); + xbt_dynar_free(&sg_platf_bypassASroute_cb_list); + xbt_dynar_free(&sg_platf_storage_cb_list); xbt_dynar_free(&sg_platf_storage_type_cb_list); xbt_dynar_free(&sg_platf_mstorage_cb_list); @@ -166,7 +181,32 @@ void sg_platf_new_mount(sg_platf_mount_cbarg_t mount){ fun(mount); } } - +void sg_platf_new_route(sg_platf_route_cbarg_t route) { + unsigned int iterator; + sg_platf_route_cb_t fun; + xbt_dynar_foreach(sg_platf_route_cb_list, iterator, fun) { + fun(route); + } +}void sg_platf_new_ASroute(sg_platf_ASroute_cbarg_t ASroute) { + unsigned int iterator; + sg_platf_ASroute_cb_t fun; + xbt_dynar_foreach(sg_platf_ASroute_cb_list, iterator, fun) { + fun(ASroute); + } +} +void sg_platf_new_bypassRoute(sg_platf_bypassRoute_cbarg_t bypassRoute) { + unsigned int iterator; + sg_platf_bypassRoute_cb_t fun; + xbt_dynar_foreach(sg_platf_bypassRoute_cb_list, iterator, fun) { + fun(bypassRoute); + } +}void sg_platf_new_bypassASroute(sg_platf_bypassASroute_cbarg_t bypassASroute) { + unsigned int iterator; + sg_platf_bypassASroute_cb_t fun; + xbt_dynar_foreach(sg_platf_bypassASroute_cb_list, iterator, fun) { + fun(bypassASroute); + } +} void sg_platf_begin() { /* Do nothing: just for symmetry of user code */ } void sg_platf_end() { @@ -259,7 +299,18 @@ void sg_platf_mstorage_add_cb(sg_platf_mstorage_cb_t fct) { void sg_platf_mount_add_cb(sg_platf_mount_cb_t fct) { xbt_dynar_push(sg_platf_mount_cb_list, &fct); } - +void sg_platf_route_add_cb(sg_platf_route_cb_t fct) { + xbt_dynar_push(sg_platf_route_cb_list, &fct); +} +void sg_platf_ASroute_add_cb(sg_platf_ASroute_cb_t fct) { + xbt_dynar_push(sg_platf_ASroute_cb_list, &fct); +} +void sg_platf_bypassRoute_add_cb(sg_platf_bypassRoute_cb_t fct) { + xbt_dynar_push(sg_platf_bypassRoute_cb_list, &fct); +} +void sg_platf_bypassASroute_add_cb(sg_platf_bypassASroute_cb_t fct) { + xbt_dynar_push(sg_platf_bypassASroute_cb_list, &fct); +} void sg_platf_rng_stream_init(unsigned long seed[6]) { RngStream_SetPackageSeed(seed); diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index 50f6ddc9ac..b3a8d72930 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -63,11 +63,6 @@ AS_t current_routing = NULL; xbt_dynar_t parsed_link_list = NULL; /* temporary store of current list link of a route */ extern xbt_dynar_t mount_list; -static const char *src = NULL; /* temporary store the source name of a route */ -static const char *dst = NULL; /* temporary store the destination name of a route */ -static char *gw_src = NULL; /* temporary store the gateway source name of a route */ -static char *gw_dst = NULL; /* temporary store the gateway destination name of a route */ - XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route, surf, "Routing part of surf"); static void routing_parse_peer(sg_platf_peer_cbarg_t peer); /* peer bypass */ @@ -226,86 +221,28 @@ static void parse_S_router(sg_platf_router_cbarg_t router) } } - -/** - * \brief Set the end points for a route - */ -static void routing_parse_S_route(void) -{ - src = A_surfxml_route_src; - dst = A_surfxml_route_dst; - xbt_assert(strlen(src) > 0 || strlen(dst) > 0, - "Missing end-points while defining route \"%s\"->\"%s\"", - src, dst); - parsed_link_list = xbt_dynar_new(sizeof(char *), &xbt_free_ref); -} - -/** - * \brief Set the end points and gateways for a ASroute - */ -static void routing_parse_S_ASroute(void) -{ - src = A_surfxml_ASroute_src; - dst = A_surfxml_ASroute_dst; - gw_src = A_surfxml_ASroute_gw_src; - gw_dst = A_surfxml_ASroute_gw_dst; - xbt_assert(strlen(src) > 0 || strlen(dst) > 0 || strlen(gw_src) > 0 || strlen(gw_dst) > 0, - "Missing end-points while defining route \"%s\"->\"%s\" (with %s and %s as gateways)", - src, dst,gw_src,gw_dst); - parsed_link_list = xbt_dynar_new(sizeof(char *), &xbt_free_ref); -} - -/** - * \brief Set the end points for a bypassRoute - */ -static void routing_parse_S_bypassRoute(void) -{ - src = A_surfxml_bypassRoute_src; - dst = A_surfxml_bypassRoute_dst; - gw_src = NULL; - gw_dst = NULL; - xbt_assert(strlen(src) > 0 || strlen(dst) > 0 || strlen(gw_src) > 0 || strlen(gw_dst) > 0, - "Missing end-points while defining route \"%s\"->\"%s\" (with %s and %s as gateways)", - src, dst,gw_src,gw_dst); - parsed_link_list = xbt_dynar_new(sizeof(char *), &xbt_free_ref); -} - -/** - * \brief Set the end points for a bypassASroute - */ -static void routing_parse_S_bypassASroute(void) -{ - src = A_surfxml_bypassASroute_src; - dst = A_surfxml_bypassASroute_dst; - gw_src = A_surfxml_bypassASroute_gw_src; - gw_dst = A_surfxml_bypassASroute_gw_dst; - xbt_assert(strlen(src) > 0 || strlen(dst) > 0 || strlen(gw_src) > 0 || strlen(gw_dst) > 0, - "Missing end-points while defining route \"%s\"->\"%s\" (with %s and %s as gateways)", - src, dst,gw_src,gw_dst); - parsed_link_list = xbt_dynar_new(sizeof(char *), &xbt_free_ref); -} - /** * \brief Store the route by calling the set_route function of the current routing component */ -static void routing_parse_E_route(void) +static void parse_E_route(sg_platf_route_cbarg_t route) { - route_t route = xbt_new0(s_route_t, 1); - route->link_list = parsed_link_list; + route_t created_route = xbt_new0(s_route_t, 1); + created_route->link_list = parsed_link_list; + xbt_assert(current_routing->parse_route, "no defined method \"set_route\" in \"%s\"", current_routing->name); - current_routing->parse_route(current_routing, src, dst, route); - generic_free_route(route); + + current_routing->parse_route(current_routing, + route->src, route->dst, created_route); + generic_free_route(created_route); parsed_link_list = NULL; - src = NULL; - dst = NULL; } /** * \brief Store the ASroute by calling the set_ASroute function of the current routing component */ -static void routing_parse_E_ASroute(void) +static void parse_E_ASroute(sg_platf_ASroute_cbarg_t ASroute) { route_t e_route = xbt_new0(s_route_t, 1); e_route->link_list = parsed_link_list; @@ -315,28 +252,24 @@ static void routing_parse_E_ASroute(void) // store the provided name instead of the entity directly (model_rulebased_parse_ASroute knows) // // This is because the user will provide something like "^AS_(.*)$" instead of the proper name of a given entity - e_route->src_gateway = (sg_routing_edge_t) gw_src; - e_route->dst_gateway = (sg_routing_edge_t) gw_dst; + e_route->src_gateway = (sg_routing_edge_t) ASroute->gw_src; + e_route->dst_gateway = (sg_routing_edge_t) ASroute->gw_dst; } else { - e_route->src_gateway = sg_routing_edge_by_name_or_null(gw_src); - e_route->dst_gateway = sg_routing_edge_by_name_or_null(gw_dst); + e_route->src_gateway = sg_routing_edge_by_name_or_null(ASroute->gw_src); + e_route->dst_gateway = sg_routing_edge_by_name_or_null(ASroute->gw_dst); } xbt_assert(current_routing->parse_ASroute, "no defined method \"set_ASroute\" in \"%s\"", current_routing->name); - current_routing->parse_ASroute(current_routing, src, dst, e_route); + current_routing->parse_ASroute(current_routing, ASroute->src, ASroute->dst, e_route); generic_free_route(e_route); parsed_link_list = NULL; - src = NULL; - dst = NULL; - gw_src = NULL; - gw_dst = NULL; } /** * \brief Store the bypass route by calling the set_bypassroute function of the current routing component */ -static void routing_parse_E_bypassRoute(void) +static void parse_E_bypassRoute(sg_platf_bypassRoute_cbarg_t route) { route_t e_route = xbt_new0(s_route_t, 1); e_route->link_list = parsed_link_list; @@ -345,12 +278,24 @@ static void routing_parse_E_bypassRoute(void) "Bypassing mechanism not implemented by routing '%s'", current_routing->name); - current_routing->parse_bypassroute(current_routing, src, dst, e_route); + current_routing->parse_bypassroute(current_routing, route->src, route->dst, e_route); + parsed_link_list = NULL; +} + +/** + * \brief Store the bypass route by calling the set_bypassroute function of the current routing component + */ +static void parse_E_bypassASroute(sg_platf_bypassASroute_cbarg_t ASroute) +{ + route_t e_route = xbt_new0(s_route_t, 1); + e_route->link_list = parsed_link_list; + e_route->src_gateway = sg_routing_edge_by_name_or_null(ASroute->gw_src); + e_route->dst_gateway = sg_routing_edge_by_name_or_null(ASroute->gw_dst); + xbt_assert(current_routing->parse_bypassroute, + "Bypassing mechanism not implemented by routing '%s'", + current_routing->name); + current_routing->parse_bypassroute(current_routing, ASroute->src, ASroute->dst, e_route); parsed_link_list = NULL; - src = NULL; - dst = NULL; - gw_src = NULL; - gw_dst = NULL; } /** @@ -371,27 +316,11 @@ static void routing_parse_link_ctn(sg_platf_linkctn_cbarg_t linkctn) link_id = bprintf("%s_DOWN", linkctn->id); break; } - xbt_dynar_push(parsed_link_list, &link_id); -} -/** - * \brief Store the bypass route by calling the set_bypassroute function of the current routing component - */ -static void routing_parse_E_bypassASroute(void) -{ - route_t e_route = xbt_new0(s_route_t, 1); - e_route->link_list = parsed_link_list; - e_route->src_gateway = sg_routing_edge_by_name_or_null(gw_src); - e_route->dst_gateway = sg_routing_edge_by_name_or_null(gw_dst); - xbt_assert(current_routing->parse_bypassroute, - "Bypassing mechanism not implemented by routing '%s'", - current_routing->name); - current_routing->parse_bypassroute(current_routing, src, dst, e_route); - parsed_link_list = NULL; - src = NULL; - dst = NULL; - gw_src = NULL; - gw_dst = NULL; + if(parsed_link_list == NULL) + parsed_link_list = xbt_dynar_new(sizeof(char *), &xbt_free_ref); + + xbt_dynar_push(parsed_link_list, &link_id); } /** @@ -1201,22 +1130,10 @@ void routing_register_callbacks() sg_platf_host_add_cb(parse_S_host); sg_platf_router_add_cb(parse_S_router); sg_platf_host_link_add_cb(parse_S_host_link); - - surfxml_add_callback(STag_surfxml_random_cb_list, &routing_parse_Srandom); - - surfxml_add_callback(STag_surfxml_route_cb_list, &routing_parse_S_route); - surfxml_add_callback(STag_surfxml_ASroute_cb_list, &routing_parse_S_ASroute); - surfxml_add_callback(STag_surfxml_bypassRoute_cb_list, - &routing_parse_S_bypassRoute); - surfxml_add_callback(STag_surfxml_bypassASroute_cb_list, - &routing_parse_S_bypassASroute); - - surfxml_add_callback(ETag_surfxml_route_cb_list, &routing_parse_E_route); - surfxml_add_callback(ETag_surfxml_ASroute_cb_list, &routing_parse_E_ASroute); - surfxml_add_callback(ETag_surfxml_bypassRoute_cb_list, - &routing_parse_E_bypassRoute); - surfxml_add_callback(ETag_surfxml_bypassASroute_cb_list, - &routing_parse_E_bypassASroute); + sg_platf_route_add_cb(parse_E_route); + sg_platf_ASroute_add_cb(parse_E_ASroute); + sg_platf_bypassRoute_add_cb(parse_E_bypassRoute); + sg_platf_bypassASroute_add_cb(parse_E_bypassASroute); sg_platf_cluster_add_cb(routing_parse_cluster); sg_platf_cabinet_add_cb(routing_parse_cabinet); @@ -1230,6 +1147,9 @@ void routing_register_callbacks() sg_platf_AS_end_add_cb(routing_AS_end); sg_platf_AS_begin_add_cb(routing_AS_begin); + surfxml_add_callback(STag_surfxml_random_cb_list, &routing_parse_Srandom); + + #ifdef HAVE_TRACING instr_routing_define_callbacks(); #endif diff --git a/src/surf/surfxml_parse.c b/src/surf/surfxml_parse.c index 4e0804f504..873ec5a08a 100644 --- a/src/surf/surfxml_parse.c +++ b/src/surf/surfxml_parse.c @@ -606,8 +606,94 @@ void ETag_surfxml_backbone(void){ } void STag_surfxml_route(void){ - surfxml_call_cb_functions(STag_surfxml_route_cb_list); + xbt_assert(strlen(A_surfxml_route_src) > 0 || strlen(A_surfxml_route_dst) > 0, + "Missing end-points while defining route \"%s\"->\"%s\"", + A_surfxml_route_src, A_surfxml_route_dst); } +void STag_surfxml_ASroute(void){ + xbt_assert(strlen(A_surfxml_ASroute_src) > 0 || strlen(A_surfxml_ASroute_dst) > 0 + || strlen(A_surfxml_ASroute_gw_src) > 0 || strlen(A_surfxml_ASroute_gw_dst) > 0, + "Missing end-points while defining route \"%s\"->\"%s\" (with %s and %s as gateways)", + A_surfxml_ASroute_src, A_surfxml_ASroute_dst, + A_surfxml_ASroute_gw_src,A_surfxml_ASroute_gw_dst); +} +void STag_surfxml_bypassRoute(void){ + xbt_assert(strlen(A_surfxml_bypassRoute_src) > 0 || strlen(A_surfxml_bypassRoute_dst) > 0, + "Missing end-points while defining bupass route \"%s\"->\"%s\"", + A_surfxml_bypassRoute_src, A_surfxml_bypassRoute_dst); +} +void STag_surfxml_bypassASroute(void){ + xbt_assert(strlen(A_surfxml_bypassASroute_src) > 0 || strlen(A_surfxml_bypassASroute_dst) > 0 + || strlen(A_surfxml_bypassASroute_gw_src) > 0 || strlen(A_surfxml_bypassASroute_gw_dst) > 0, + "Missing end-points while defining route \"%s\"->\"%s\" (with %s and %s as gateways)", + A_surfxml_bypassASroute_src, A_surfxml_bypassASroute_dst, + A_surfxml_bypassASroute_gw_src,A_surfxml_bypassASroute_gw_dst); +} + +void ETag_surfxml_route(void){ + s_sg_platf_route_cbarg_t route; + memset(&route,0,sizeof(route)); + + route.src = A_surfxml_route_src; + route.dst = A_surfxml_route_dst; + + switch (A_surfxml_route_symmetrical) { + case AU_surfxml_route_symmetrical: + case A_surfxml_route_symmetrical_YES: + route.symmetrical = TRUE; + break; + case A_surfxml_route_symmetrical_NO: + route.symmetrical = FALSE;; + break; + } + + sg_platf_new_route(&route); +} + +void ETag_surfxml_ASroute(void){ + s_sg_platf_ASroute_cbarg_t ASroute; + memset(&ASroute,0,sizeof(ASroute)); + + ASroute.src = A_surfxml_ASroute_src; + ASroute.dst = A_surfxml_ASroute_dst; + ASroute.gw_src = A_surfxml_ASroute_gw_src; + ASroute.gw_dst = A_surfxml_ASroute_gw_dst; + + switch (A_surfxml_ASroute_symmetrical) { + case AU_surfxml_ASroute_symmetrical: + case A_surfxml_ASroute_symmetrical_YES: + ASroute.symmetrical = TRUE; + break; + case A_surfxml_ASroute_symmetrical_NO: + ASroute.symmetrical = FALSE;; + break; + } + + sg_platf_new_ASroute(&ASroute); +} + +void ETag_surfxml_bypassRoute(void){ + s_sg_platf_bypassRoute_cbarg_t route; + memset(&route,0,sizeof(route)); + + route.src = A_surfxml_bypassRoute_src; + route.dst = A_surfxml_bypassRoute_dst; + + sg_platf_new_bypassRoute(&route); +} + +void ETag_surfxml_bypassASroute(void){ + s_sg_platf_bypassASroute_cbarg_t ASroute; + memset(&ASroute,0,sizeof(ASroute)); + + ASroute.src = A_surfxml_bypassASroute_src; + ASroute.dst = A_surfxml_bypassASroute_dst; + ASroute.gw_src = A_surfxml_bypassASroute_gw_src; + ASroute.gw_dst = A_surfxml_bypassASroute_gw_dst; + + sg_platf_new_bypassASroute(&ASroute); +} + void STag_surfxml_process(void){ surfxml_call_cb_functions(STag_surfxml_process_cb_list); } @@ -629,15 +715,7 @@ void STag_surfxml_AS(void){ void ETag_surfxml_AS(void){ sg_platf_new_AS_end(); } -void STag_surfxml_ASroute(void){ - surfxml_call_cb_functions(STag_surfxml_ASroute_cb_list); -} -void STag_surfxml_bypassRoute(void){ - surfxml_call_cb_functions(STag_surfxml_bypassRoute_cb_list); -} -void STag_surfxml_bypassASroute(void){ - surfxml_call_cb_functions(STag_surfxml_bypassASroute_cb_list); -} + void STag_surfxml_config(void){ XBT_DEBUG("START configuration name = %s",A_surfxml_config_id); xbt_assert(current_property_set == NULL, "Someone forgot to reset the property set to NULL in its closing tag (or XML malformed)"); @@ -667,16 +745,12 @@ void STag_surfxml_random(void){ { surfxml_call_cb_functions(type##Tag_surfxml_##name##_cb_list); } \ void type##Tag_surfxml_##name(void) -parse_method(E, route); parse_method(E, process); parse_method(E, argument); parse_method(E, prop); parse_method(E, trace); parse_method(E, trace_connect); parse_method(E, random); -parse_method(E, ASroute); -parse_method(E, bypassRoute); -parse_method(E, bypassASroute); /* Open and Close parse file */ -- 2.20.1