*************/
surf_callback(void, RoutingEdge*) routingEdgeCreatedCallbacks;
+surf_callback(void, As*) asCreatedCallbacks;
/**
* @ingroup SURF_build_api
return current_routing;
}
-static void routing_parse_peer(sg_platf_peer_cbarg_t peer); /* peer bypass */
// static void routing_parse_Srandom(void); /* random bypass */
static void routing_parse_postparse(void);
/**
* \brief Add a "host_link" to the network element list
*/
-static void parse_S_host(sg_platf_host_link_cbarg_t host)
+void sg_platf_new_host_link(sg_platf_host_link_cbarg_t host)
{
RoutingEdge *info = sg_host_edge(sg_host_by_name(host->id));
xbt_assert(info, "Host '%s' not found!", host->id);
return routingEdge;
}
-/**
- * \brief Store the route by calling the set_route function of the current routing component
- */
-static void parse_E_route(sg_platf_route_cbarg_t route)
-{
- /*FIXME:REMOVE:xbt_assert(current_routing->parse_route,
- "no defined method \"set_route\" in \"%s\"",
- current_routing->name);*/
-
- current_routing->parseRoute(route);
-}
-
/**
* \brief Store the ASroute by calling the set_ASroute function of the current routing component
*/
current_routing->parseASroute(ASroute);
}
-/**
- * \brief Store the bypass route by calling the set_bypassroute function of the current routing component
- */
-static void parse_E_bypassRoute(sg_platf_route_cbarg_t route)
-{
- /*FIXME:REMOVE:xbt_assert(current_routing->parse_bypassroute,
- "Bypassing mechanism not implemented by routing '%s'",
- current_routing->name);*/
-
- current_routing->parseBypassroute(route);
-}
-
-/**
- * \brief Store the bypass route by calling the set_bypassroute function of the current routing component
- */
-static void parse_E_bypassASroute(sg_platf_route_cbarg_t ASroute)
-{
- /*FIXME:REMOVE:xbt_assert(current_routing->parse_bypassroute,
- "Bypassing mechanism not implemented by routing '%s'",
- current_routing->name);*/
- current_routing->parseBypassroute(ASroute);
-}
-
-static void routing_parse_trace(sg_platf_trace_cbarg_t trace)
+void sg_platf_new_trace(sg_platf_trace_cbarg_t trace)
{
tmgr_trace_t tmgr_trace;
if (!trace->file || strcmp(trace->file, "") != 0) {
xbt_dict_set(traces_set_list, trace->id, (void *) tmgr_trace, NULL);
}
-static void routing_parse_trace_connect(sg_platf_trace_connect_cbarg_t trace_connect)
+void sg_platf_trace_connect(sg_platf_trace_connect_cbarg_t trace_connect)
{
xbt_assert(xbt_dict_get_or_null
(traces_set_list, trace_connect->trace),
(void *) info);
XBT_DEBUG("Having set name '%s' id '%d'", new_as->p_name, info->getId());
- routingEdgeCreatedCallbacks(info);
-
/* set the new current component of the tree */
current_routing = new_as;
current_routing->p_netElem = info;
+
+ routingEdgeCreatedCallbacks(info);
+ asCreatedCallbacks(new_as);
}
/**
* even if you add stuff to a closed AS
*
*/
-void routing_AS_end(sg_platf_AS_cbarg_t /*AS*/)
+void routing_AS_end()
{
if (current_routing == NULL) {
XBT_DEBUG("Add a backbone to AS '%s'", current_routing->p_name);
}
-static void routing_parse_cabinet(sg_platf_cabinet_cbarg_t cabinet)
+void sg_platf_new_cabinet(sg_platf_cabinet_cbarg_t cabinet)
{
int start, end, i;
char *groups , *host_id , *link_id = NULL;
xbt_dict_free(&random_value);
}
-static void routing_parse_peer(sg_platf_peer_cbarg_t peer)
+void sg_platf_new_peer(sg_platf_peer_cbarg_t peer)
{
char *host_id = NULL;
char *link_id = NULL;
void routing_register_callbacks()
{
- sg_platf_host_link_add_cb(parse_S_host);
- sg_platf_route_add_cb(parse_E_route);
- sg_platf_ASroute_add_cb(parse_E_ASroute);
- sg_platf_bypassRoute_add_cb(parse_E_bypassRoute);
- sg_platf_bypassASroute_add_cb(parse_E_bypassASroute);
-
sg_platf_cluster_add_cb(routing_parse_cluster);
- sg_platf_cabinet_add_cb(routing_parse_cabinet);
- sg_platf_peer_add_cb(routing_parse_peer);
sg_platf_postparse_add_cb(routing_parse_postparse);
sg_platf_postparse_add_cb(check_disk_attachment);
- /* we care about the ASes while parsing the platf. Incredible, isnt it? */
- sg_platf_AS_end_add_cb(routing_AS_end);
- sg_platf_AS_begin_add_cb(routing_AS_begin);
-
- sg_platf_trace_add_cb(routing_parse_trace);
- sg_platf_trace_connect_add_cb(routing_parse_trace_connect);
-
instr_routing_define_callbacks();
}