#include "network_gtnets_private.h"
#include "gtnets/gtnets_interface.h"
+#include "xbt/str.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_network_gtnets, surf,
"Logging specific to the SURF network module");
/* Free memory for a network link */
static void link_free(void *nw_link)
{
- free(((link_GTNETS_t) nw_link)->name);
+ free(((network_link_GTNETS_t) nw_link)->name);
free(nw_link);
}
static void link_new(char *name, double bw, double lat, xbt_dict_t props)
{
static int link_count = -1;
- link_GTNETS_t gtnets_link;
+ network_link_GTNETS_t gtnets_link;
/* If link already exists, nothing to do (FIXME: check that multiple definition match?) */
if (xbt_dict_get_or_null(link_set, name)) {
}
/* KF: Insert entry in the dictionary */
- gtnets_link = xbt_new0(s_link_GTNETS_t, 1);
+ gtnets_link = xbt_new0(s_network_link_GTNETS_t, 1);
gtnets_link->name = name;
gtnets_link->bw_current = bw;
gtnets_link->lat_current = lat;
static void route_new(int src_id, int dst_id, char **links, int nb_link)
{
#if 0
- link_GTNETS_t *link_list = NULL;
+ network_link_GTNETS_t *link_list = NULL;
int i;
ROUTE_SIZE(src_id, dst_id) = nb_link;
link_list = (ROUTE(src_id, dst_id) =
- xbt_new0(link_GTNETS_t, nb_link));
+ xbt_new0(network_link_GTNETS_t, nb_link));
for (i = 0; i < nb_link; i++) {
link_list[i] = xbt_dict_get_or_null(link_set, links[i]);
free(links[i]);
gtnets_links = (int *) calloc(nb_link, sizeof(int));
for (i = 0; i < nb_link; i++) {
gtnets_links[i] =
- ((link_GTNETS_t)
+ ((network_link_GTNETS_t)
(xbt_dict_get(link_set, links[i])))->id;
}
/* KF: Build the list of gtnets link IDs */
linkid =
- ((link_GTNETS_t)
+ ((network_link_GTNETS_t)
(xbt_dict_get(link_set, links[0])))->id;
/* KF: Create the GTNets route */
double lat;
e_surf_link_state_t state;
- name = xbt_strdup(A_surfxml_link_name);
+ name = xbt_strdup(A_surfxml_link_id);
surf_parse_get_double(&bw, A_surfxml_link_bandwidth);
surf_parse_get_double(&lat, A_surfxml_link_latency);
- state = SURF_link_ON;
+ state = SURF_LINK_ON;
/* Print values when no traces are specified */
{
/* KF*/
static void parse_route_set_routers(void)
{
- int id = network_card_new(A_surfxml_router_name);
+ int id = network_card_new(A_surfxml_router_id);
/* KF: Create the GTNets router */
if (gtnets_add_router(id)) {
/* if (nb_link > 1)
route_new(src_id, dst_id, link_name, nb_link);
*/
- name = bprintf("%x#%x",src_id, dst_id);
+ char *name = bprintf("%x#%x",src_id, dst_id);
xbt_dict_set(route_table, name, route_link_list, NULL);
free(name);
}
surfxml_add_callback(STag_surfxml_router_cb_list, &parse_route_set_routers);
surfxml_add_callback(STag_surfxml_link_cb_list, &parse_link_init);
surfxml_add_callback(STag_surfxml_route_cb_list, &parse_route_set_endpoints);
- surfxml_add_callback(ETag_surfxml_route_element_cb_list, &parse_route_elem);
+ surfxml_add_callback(ETag_surfxml_link_c_ctn_cb_list, &parse_route_elem);
/* surfxml_add_callback(ETag_surfxml_route_cb_list, &parse_route_set_onehop_route);*/
surfxml_add_callback(STag_surfxml_platform_cb_list, &init_data);
surfxml_add_callback(ETag_surfxml_route_cb_list, &parse_route_set_route);
/* UNUSED HERE: no traces */
static void update_resource_state(void *id,
tmgr_trace_event_t event_type,
- double value)
+ double value, double date)
{
xbt_assert0(0, "Cannot update model state for GTNetS simulation");
return;
network_card_GTNETS_t card_dst = dst;
/*
int route_size = ROUTE_SIZE(card_src->id, card_dst->id);
- link_GTNETS_t *route = ROUTE(card_src->id, card_dst->id);
+ network_link_GTNETS_t *route = ROUTE(card_src->id, card_dst->id);
*/
/*
surf_network_model->common_private->share_resources = share_resources;
surf_network_model->common_private->update_actions_state =
update_actions_state;
- surf_network_model->common_private->update_resource_state =
- update_resource_state;
+ surf_network_model->common_private->update_resource_state = update_resource_state;
surf_network_model->common_private->finalize = finalize;
surf_network_model->common_public->suspend = action_suspend;