-void instr_routing_define_callbacks ()
-{
- if (!TRACE_is_active())
- return;
- surfxml_add_callback(STag_surfxml_AS_cb_list, &instr_routing_parse_start_AS);
- surfxml_add_callback(ETag_surfxml_AS_cb_list, &instr_routing_parse_end_AS);
- surfxml_add_callback(STag_surfxml_link_cb_list, &instr_routing_parse_start_link);
- surfxml_add_callback(ETag_surfxml_link_cb_list, &instr_routing_parse_end_link);
- surfxml_add_callback(STag_surfxml_host_cb_list, &instr_routing_parse_start_host);
- surfxml_add_callback(ETag_surfxml_host_cb_list, &instr_routing_parse_end_host);
- surfxml_add_callback(STag_surfxml_router_cb_list, &instr_routing_parse_start_router);
- surfxml_add_callback(ETag_surfxml_router_cb_list, &instr_routing_parse_end_router);
- surfxml_add_callback(ETag_surfxml_platform_cb_list, &instr_routing_parse_end_platform);
-}
-
-static long long int newContainedId ()
-{
- static long long counter = 0;
- return counter++;
-}
-
-static container_t newContainer (const char *name, const char *type, e_container_types kind)
-{
- long long int counter = newContainedId();
- char id_str[INSTR_DEFAULT_STR_SIZE];
- snprintf (id_str, INSTR_DEFAULT_STR_SIZE, "%lld", counter);
-
- container_t newContainer = xbt_new0(s_container_t, 1);
- newContainer->name = xbt_strdup (name);
- newContainer->id = xbt_strdup (id_str);
- newContainer->father = xbt_dynar_get_ptr(currentContainer, xbt_dynar_length(currentContainer)-1);
- newContainer->level = newContainer->father->level+1;
- newContainer->type = xbt_strdup (type);
- switch (kind){
- case INSTR_HOST: newContainer->typename = xbt_strdup ("HOST"); break;
- case INSTR_LINK: newContainer->typename = xbt_strdup ("LINK"); break;
- case INSTR_ROUTER: newContainer->typename = xbt_strdup ("ROUTER"); break;
- case INSTR_AS: newContainer->typename = xbt_strdup ("AS"); break;
- default: xbt_die ("Congratulations, you have found a bug on newContainer function of instr_routing.c"); break;
- }
- newContainer->kind = kind;
- newContainer->children = xbt_dict_new();
- xbt_dict_set(newContainer->father->children, newContainer->name, newContainer, NULL);
-
- newContainerType (newContainer->type, newContainer->father->type, newContainer->typename);
- pajeCreateContainer (0, newContainer->id, newContainer->type, newContainer->father->id, newContainer->name);
-
- return newContainer;
-}
-
-static void recursiveDestroyContainer (container_t container)
-{