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"
13 #include "surf_interface.hpp"
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 **************** */
69 AsPtr model_cluster_create(void); /* create structures for cluster routing model */
70 AsPtr model_torus_cluster_create(void); /* create structures for cluster routing model */
73 /* ************************************************** */
74 /* ************** Vivaldi ROUTING **************** */
75 AS_t model_vivaldi_create(void); /* create structures for vivaldi routing model */
76 #define HOST_PEER(peername) bprintf("peer_%s", peername)
77 #define ROUTER_PEER(peername) bprintf("router_%s", peername)
78 #define LINK_PEER(peername) bprintf("link_%s", peername)
80 /* ************************************************************************** */
81 /* ********** Dijkstra & Dijkstra Cached ROUTING **************************** */
82 AS_t model_dijkstra_both_create(int cached); /* create by calling dijkstra or dijkstracache */
83 AS_t model_dijkstra_create(void); /* create structures for dijkstra routing model */
84 AS_t model_dijkstracache_create(void); /* create structures for dijkstracache routing model */
85 void model_dijkstra_both_end(AS_t as); /* finalize the creation of dijkstra routing model */
86 void model_dijkstra_both_parse_route (AS_t rc, sg_platf_route_cbarg_t route);
88 /* ************************************************************************** */
89 /* *************************** FULL ROUTING ********************************* */
90 AS_t model_full_create(void); /* create structures for full routing model */
91 void model_full_end(AS_t as); /* finalize the creation of full routing model */
92 void model_full_set_route( /* Set the route and ASroute between src and dst */
93 AS_t rc, sg_platf_route_cbarg_t route);
94 /* ************************************************************************** */
95 /* ************************* GRAPH EXPORTING FUNCTIONS ********************** */
96 xbt_node_t new_xbt_graph_node (xbt_graph_t graph, const char *name, xbt_dict_t nodes);
97 xbt_edge_t new_xbt_graph_edge (xbt_graph_t graph, xbt_node_t s, xbt_node_t d, xbt_dict_t edges);
100 #endif /* _SURF_SURF_ROUTING_PRIVATE_H */