-/*
- * surf_routing_private.h
- *
- * Created on: 14 avr. 2011
- * Author: navarrop
- */
+/* Copyright (c) 2009, 2010, 2011. 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 "xbt/set.h"
#include "surf/surfxml_parse.h"
+/* ************************************************************************** */
+/* ******************************* NO ROUTING ******************************* */
+/* Only save the AS tree, and forward calls to child ASes */
+AS_t model_none_create(void);
+AS_t model_none_create_sized(size_t childsize);
+void model_none_finalize(AS_t as);
/* ************************************************************************** */
/* ***************** GENERIC PARSE FUNCTIONS (declarations) ***************** */
-AS_t routmod_generic_create(size_t childsize);
+AS_t model_generic_create_sized(size_t childsize);
+void model_generic_finalize(AS_t as);
-void generic_parse_PU(AS_t rc,
- const char *name);
-void generic_parse_AS(AS_t rc,
- const char *name);
-void generic_parse_bypassroute(AS_t rc,
- const char *src, const char *dst,
- route_extended_t e_route);
+int generic_parse_PU(AS_t rc, sg_routing_edge_t elm);
+int generic_parse_AS(AS_t rc, sg_routing_edge_t elm);
+void generic_parse_bypassroute(AS_t rc, const char *src, const char *dst,
+ route_t e_route);
/* ************************************************************************** */
/* *************** GENERIC BUSINESS METHODS (declarations) ****************** */
-double generic_get_link_latency(AS_t rc, const char *src, const char *dst,
- route_extended_t e_route);
xbt_dynar_t generic_get_onelink_routes(AS_t rc);
-route_extended_t generic_get_bypassroute(AS_t rc,
- const char *src,
- const char *dst);
+route_t generic_get_bypassroute(AS_t rc,
+ sg_routing_edge_t src,
+ sg_routing_edge_t 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);
+/* 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 */
+route_t generic_new_extended_route(e_surf_routing_hierarchy_t hierarchy,
+ route_t data, int preserve_order);
AS_t
generic_autonomous_system_exist(AS_t rc, char *element);
AS_t
generic_processing_units_exist(AS_t rc, char *element);
-void generic_src_dst_check(AS_t rc, const char *src,
- const char *dst);
+void generic_src_dst_check(AS_t rc, sg_routing_edge_t src,
+ sg_routing_edge_t dst);
/* ************************************************************************** */
AS_t model_floyd_create(void); /* create structures for floyd routing model */
void model_floyd_end(AS_t as); /* finalize the creation of floyd routing model */
void model_floyd_parse_route(AS_t rc, const char *src,
- const char *dst, route_extended_t route);
+ const char *dst, route_t route);
/* ************************************************** */
/* ************** RULE-BASED ROUTING **************** */
/* ************** Cluster ROUTING **************** */
AS_t model_cluster_create(void); /* create structures for cluster routing model */
-void surf_routing_cluster_add_link(const char* host_id,surf_parsing_link_up_down_t info);
+/* Pass info from the cluster parser to the cluster routing */
+void surf_routing_cluster_add_backbone(AS_t as, void* bb);
/* ************************************************** */
/* ************** Vivaldi ROUTING **************** */
AS_t model_dijkstracache_create(void); /* create structures for dijkstracache routing model */
void model_dijkstra_both_end(AS_t as); /* finalize the creation of dijkstra routing model */
void model_dijkstra_both_parse_route (AS_t rc, const char *src,
- const char *dst, route_extended_t route);
+ const char *dst, route_t route);
/* ************************************************************************** */
/* *************************** FULL ROUTING ********************************* */
AS_t model_full_create(void); /* create structures for full routing model */
void model_full_end(AS_t as); /* finalize the creation of full routing model */
-void model_full_set_route( /* Set the route and ASroute between src and dst */
- AS_t rc, const char *src, const char *dst, route_extended_t route);
+void model_full_set_route( /* Set the route and ASroute between src and dst */
+ AS_t rc, const char *src, const char *dst, route_t route);
-/* ************************************************************************** */
-/* ******************************* NO ROUTING ******************************* */
-AS_t model_none_create(void); /* none routing model */
#endif /* _SURF_SURF_ROUTING_PRIVATE_H */