1 /* Copyright (c) 2009, 2010, 2011. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #ifndef _SURF_SURF_ROUTING_PRIVATE_H
8 #define _SURF_SURF_ROUTING_PRIVATE_H
11 #include "internal_config.h"
14 #include "xbt/dynar.h"
16 #include "xbt/config.h"
17 #include "xbt/graph.h"
19 #include "surf/surfxml_parse.h"
21 /* ************************************************************************** */
22 /* ******************************* NO ROUTING ******************************* */
23 /* Only save the AS tree, and forward calls to child ASes */
24 AS_t model_none_create(void);
25 AS_t model_none_create_sized(size_t childsize);
26 void model_none_finalize(AS_t as);
27 /* ************************************************************************** */
28 /* ***************** GENERIC PARSE FUNCTIONS (declarations) ***************** */
29 AS_t model_generic_create_sized(size_t childsize);
30 void model_generic_finalize(AS_t as);
32 int generic_parse_PU(AS_t rc, sg_routing_edge_t elm);
33 int generic_parse_AS(AS_t rc, sg_routing_edge_t elm);
34 void generic_parse_bypassroute(AS_t rc, sg_platf_route_cbarg_t e_route);
36 /* ************************************************************************** */
37 /* *************** GENERIC BUSINESS METHODS (declarations) ****************** */
39 xbt_dynar_t generic_get_onelink_routes(AS_t rc);
40 sg_platf_route_cbarg_t generic_get_bypassroute(AS_t rc,
41 sg_routing_edge_t src,
42 sg_routing_edge_t dst,
45 /* ************************************************************************** */
46 /* ****************** GENERIC AUX FUNCTIONS (declarations) ****************** */
48 /* change a route containing link names into a route containing link entities.
49 * If change_order is true, the links are put in reverse order in the
51 sg_platf_route_cbarg_t generic_new_extended_route(e_surf_routing_hierarchy_t hierarchy,
52 sg_platf_route_cbarg_t data, int preserve_order);
54 generic_autonomous_system_exist(AS_t rc, char *element);
56 generic_processing_units_exist(AS_t rc, char *element);
57 void generic_src_dst_check(AS_t rc, sg_routing_edge_t src,
58 sg_routing_edge_t dst);
60 /* ************************************************************************** */
61 /* *************************** FLOYD ROUTING ******************************** */
62 AS_t model_floyd_create(void); /* create structures for floyd routing model */
63 void model_floyd_end(AS_t as); /* finalize the creation of floyd routing model */
64 void model_floyd_parse_route(AS_t rc, sg_platf_route_cbarg_t route);
66 /* ************************************************** */
67 /* ************** Cluster ROUTING **************** */
68 class AsCluster : public As {
72 RoutingEdgePtr p_router;
74 typedef AsCluster *AsClusterPtr;
75 //FIXME:remove} s_as_cluster_t, *as_cluster_t;
77 AsPtr model_cluster_create(void); /* create structures for cluster routing model */
79 /* ************************************************** */
80 /* ************** Vivaldi ROUTING **************** */
81 AS_t model_vivaldi_create(void); /* create structures for vivaldi routing model */
82 #define HOST_PEER(peername) bprintf("peer_%s", peername)
83 #define ROUTER_PEER(peername) bprintf("router_%s", peername)
84 #define LINK_PEER(peername) bprintf("link_%s", peername)
86 /* ************************************************************************** */
87 /* ********** Dijkstra & Dijkstra Cached ROUTING **************************** */
88 AS_t model_dijkstra_both_create(int cached); /* create by calling dijkstra or dijkstracache */
89 AS_t model_dijkstra_create(void); /* create structures for dijkstra routing model */
90 AS_t model_dijkstracache_create(void); /* create structures for dijkstracache routing model */
91 void model_dijkstra_both_end(AS_t as); /* finalize the creation of dijkstra routing model */
92 void model_dijkstra_both_parse_route (AS_t rc, sg_platf_route_cbarg_t route);
94 /* ************************************************************************** */
95 /* *************************** FULL ROUTING ********************************* */
96 AS_t model_full_create(void); /* create structures for full routing model */
97 void model_full_end(AS_t as); /* finalize the creation of full routing model */
98 void model_full_set_route( /* Set the route and ASroute between src and dst */
99 AS_t rc, sg_platf_route_cbarg_t route);
100 /* ************************************************************************** */
101 /* ************************* GRAPH EXPORTING FUNCTIONS ********************** */
102 xbt_node_t new_xbt_graph_node (xbt_graph_t graph, const char *name, xbt_dict_t nodes);
103 xbt_edge_t new_xbt_graph_edge (xbt_graph_t graph, xbt_node_t s, xbt_node_t d, xbt_dict_t edges);
106 #endif /* _SURF_SURF_ROUTING_PRIVATE_H */