X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/3fb716c621a70c296757ca81a37327334e829a85..d0ffc37686edcc803601f76ab51fdfed5fc2f241:/src/surf/surf_routing_private.h diff --git a/src/surf/surf_routing_private.h b/src/surf/surf_routing_private.h index 365244dbf7..18c6753995 100644 --- a/src/surf/surf_routing_private.h +++ b/src/surf/surf_routing_private.h @@ -1,109 +1,96 @@ -/* - * surf_routing_private.h - * - * Created on: 14 avr. 2011 - * Author: navarrop - */ +/* Copyright (c) 2009-2013. The SimGrid Team. + * All rights reserved. */ + +/* 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. */ #ifndef _SURF_SURF_ROUTING_PRIVATE_H #define _SURF_SURF_ROUTING_PRIVATE_H #include -#include "gras_config.h" +#include "internal_config.h" -#include "surf_private.h" +//#include "surf_private.h" #include "xbt/dynar.h" #include "xbt/str.h" #include "xbt/config.h" #include "xbt/graph.h" #include "xbt/set.h" #include "surf/surfxml_parse.h" +#include "surf_routing.hpp" +/* ************************************************************************** */ +/* ******************************* NO ROUTING ******************************* */ +/* Only save the AS tree, and forward calls to child ASes */ +AsPtr model_none_create(void); +AsPtr model_none_create_sized(size_t childsize); +void model_none_finalize(AsPtr as); /* ************************************************************************** */ /* ***************** GENERIC PARSE FUNCTIONS (declarations) ***************** */ -routing_component_t routmod_generic_create(size_t childsize); +AsPtr model_generic_create_sized(size_t childsize); +void model_generic_finalize(AsPtr as); -void generic_set_processing_unit(routing_component_t rc, - const char *name); -void generic_set_autonomous_system(routing_component_t rc, - const char *name); -void generic_set_bypassroute(routing_component_t rc, - const char *src, const char *dst, - route_extended_t e_route); +int generic_parse_PU(AsPtr rc, RoutingEdgePtr elm); +int generic_parse_AS(AsPtr rc, RoutingEdgePtr elm); +void generic_parse_bypassroute(AsPtr rc, sg_platf_route_cbarg_t e_route); /* ************************************************************************** */ /* *************** GENERIC BUSINESS METHODS (declarations) ****************** */ -double generic_get_link_latency(routing_component_t rc, const char *src, const char *dst, - route_extended_t e_route); -xbt_dynar_t generic_get_onelink_routes(routing_component_t rc); -route_extended_t generic_get_bypassroute(routing_component_t rc, - const char *src, - const char *dst); +xbt_dynar_t generic_get_onelink_routes(AsPtr rc); +sg_platf_route_cbarg_t generic_get_bypassroute(AsPtr rc, + RoutingEdgePtr src, + RoutingEdgePtr dst, + double *lat); /* ************************************************************************** */ /* ****************** GENERIC AUX FUNCTIONS (declarations) ****************** */ -route_extended_t -generic_new_extended_route(e_surf_routing_hierarchy_t hierarchy, - void *data, int order); -route_t -generic_new_route(e_surf_routing_hierarchy_t hierarchy, - void *data, int order); -void generic_free_route(route_t route); -void generic_free_extended_route(route_extended_t e_route); -routing_component_t -generic_autonomous_system_exist(routing_component_t rc, char *element); -routing_component_t -generic_processing_units_exist(routing_component_t rc, char *element); -void generic_src_dst_check(routing_component_t rc, const char *src, - const char *dst); - +/* change a route containing link names into a route containing link entities. + * If change_order is true, the links are put in reverse order in the + * produced route */ +sg_platf_route_cbarg_t generic_new_extended_route(e_surf_routing_hierarchy_t hierarchy, + sg_platf_route_cbarg_t data, int preserve_order); +AsPtr +generic_autonomous_system_exist(AsPtr rc, char *element); +AsPtr +generic_processing_units_exist(AsPtr rc, char *element); +void generic_src_dst_check(AsPtr rc, RoutingEdgePtr src, + RoutingEdgePtr dst); /* ************************************************************************** */ /* *************************** FLOYD ROUTING ******************************** */ -routing_component_t model_floyd_create(void); /* create structures for floyd routing model */ -void model_floyd_end(void); /* finalize the creation of floyd routing model */ -void model_floyd_set_route(routing_component_t rc, const char *src, - const char *dst, name_route_extended_t route); +AsPtr model_floyd_create(void); /* create structures for floyd routing model */ +void model_floyd_end(AsPtr as); /* finalize the creation of floyd routing model */ +void model_floyd_parse_route(AsPtr rc, sg_platf_route_cbarg_t route); -/* ************************************************** */ -/* ************** RULE-BASED ROUTING **************** */ -routing_component_t model_rulebased_create(void); /* create structures for rulebased routing model */ - -/* ************************************************** */ -/* ************** Cluster ROUTING **************** */ -routing_component_t model_cluster_create(void); /* create structures for cluster routing model */ -void model_cluster_unload(void); /* Finalize the routing model */ - -void surf_routing_cluster_add_link(const char* host_id,surf_parsing_link_up_down_t info); +AsPtr model_cluster_create(void); /* create structures for cluster routing model */ /* ************************************************** */ /* ************** Vivaldi ROUTING **************** */ -routing_component_t model_vivaldi_create(void); /* create structures for vivaldi routing model */ +AsPtr model_vivaldi_create(void); /* create structures for vivaldi routing model */ #define HOST_PEER(peername) bprintf("peer_%s", peername) #define ROUTER_PEER(peername) bprintf("router_%s", peername) -#define LINK_UP_PEER(peername) bprintf("link_%s_up", peername) -#define LINK_DOWN_PEER(peername) bprintf("link_%s_down", peername) +#define LINK_PEER(peername) bprintf("link_%s", peername) /* ************************************************************************** */ /* ********** Dijkstra & Dijkstra Cached ROUTING **************************** */ -routing_component_t model_dijkstra_both_create(int cached); /* create by calling dijkstra or dijkstracache */ -routing_component_t model_dijkstra_create(void); /* create structures for dijkstra routing model */ -routing_component_t model_dijkstracache_create(void); /* create structures for dijkstracache routing model */ -void model_dijkstra_both_end(void); /* finalize the creation of dijkstra routing model */ -void model_dijkstra_both_set_route (routing_component_t rc, const char *src, - const char *dst, name_route_extended_t route); +AsPtr model_dijkstra_both_create(int cached); /* create by calling dijkstra or dijkstracache */ +AsPtr model_dijkstra_create(void); /* create structures for dijkstra routing model */ +AsPtr model_dijkstracache_create(void); /* create structures for dijkstracache routing model */ +void model_dijkstra_both_end(AsPtr as); /* finalize the creation of dijkstra routing model */ +void model_dijkstra_both_parse_route (AsPtr rc, sg_platf_route_cbarg_t route); /* ************************************************************************** */ /* *************************** FULL ROUTING ********************************* */ -routing_component_t model_full_create(void); /* create structures for full routing model */ -void model_full_end(void); /* finalize the creation of full routing model */ -void model_full_set_route( /* Set the route and ASroute between src and dst */ - routing_component_t rc, const char *src, const char *dst, name_route_extended_t route); - +AsPtr model_full_create(void); /* create structures for full routing model */ +void model_full_end(AsPtr as); /* finalize the creation of full routing model */ +void model_full_set_route( /* Set the route and ASroute between src and dst */ + AsPtr rc, sg_platf_route_cbarg_t route); /* ************************************************************************** */ -/* ******************************* NO ROUTING ******************************* */ -routing_component_t model_none_create(void); /* none routing model */ +/* ************************* GRAPH EXPORTING FUNCTIONS ********************** */ +xbt_node_t new_xbt_graph_node (xbt_graph_t graph, const char *name, xbt_dict_t nodes); +xbt_edge_t new_xbt_graph_edge (xbt_graph_t graph, xbt_node_t s, xbt_node_t d, xbt_dict_t edges); + #endif /* _SURF_SURF_ROUTING_PRIVATE_H */