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 "gras_config.h"
13 #include "surf_private.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);
61 /* ************************************************************************** */
62 /* *************************** FLOYD ROUTING ******************************** */
63 AS_t model_floyd_create(void); /* create structures for floyd routing model */
64 void model_floyd_end(AS_t as); /* finalize the creation of floyd routing model */
65 void model_floyd_parse_route(AS_t rc, sg_platf_route_cbarg_t route);
67 /* ************************************************** */
68 /* ************** RULE-BASED ROUTING **************** */
69 AS_t model_rulebased_create(void); /* create structures for rulebased routing model */
71 /* ************************************************** */
72 /* ************** Cluster ROUTING **************** */
74 s_as_t generic_routing;
76 } s_as_cluster_t, *as_cluster_t;
78 AS_t model_cluster_create(void); /* create structures for cluster routing model */
80 /* ************************************************** */
81 /* ************** Vivaldi ROUTING **************** */
82 AS_t model_vivaldi_create(void); /* create structures for vivaldi routing model */
83 #define HOST_PEER(peername) bprintf("peer_%s", peername)
84 #define ROUTER_PEER(peername) bprintf("router_%s", peername)
85 #define LINK_PEER(peername) bprintf("link_%s", peername)
87 /* ************************************************************************** */
88 /* ********** Dijkstra & Dijkstra Cached ROUTING **************************** */
89 AS_t model_dijkstra_both_create(int cached); /* create by calling dijkstra or dijkstracache */
90 AS_t model_dijkstra_create(void); /* create structures for dijkstra routing model */
91 AS_t model_dijkstracache_create(void); /* create structures for dijkstracache routing model */
92 void model_dijkstra_both_end(AS_t as); /* finalize the creation of dijkstra routing model */
93 void model_dijkstra_both_parse_route (AS_t rc, sg_platf_route_cbarg_t route);
95 /* ************************************************************************** */
96 /* *************************** FULL ROUTING ********************************* */
97 AS_t model_full_create(void); /* create structures for full routing model */
98 void model_full_end(AS_t as); /* finalize the creation of full routing model */
99 void model_full_set_route( /* Set the route and ASroute between src and dst */
100 AS_t rc, sg_platf_route_cbarg_t route);
103 #endif /* _SURF_SURF_ROUTING_PRIVATE_H */