From 68314cecaad4e199944b325a121f14390c284fea Mon Sep 17 00:00:00 2001 From: navarro Date: Mon, 19 Mar 2012 13:07:20 +0100 Subject: [PATCH] Make ns3 compile with new communicate (network_element_t) --- src/surf/network_ns3.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/surf/network_ns3.c b/src/surf/network_ns3.c index 648b321e17..3713856c83 100644 --- a/src/surf/network_ns3.c +++ b/src/surf/network_ns3.c @@ -26,8 +26,8 @@ static double time_to_next_flow_completion = -1; static double ns3_share_resources(double min); static void ns3_update_actions_state(double now, double delta); static void finalize(void); -static surf_action_t ns3_communicate(const char *src_name, - const char *dst_name, double size, double rate); +static surf_action_t ns3_communicate(void *src_elm, void *dst_elm, + double size, double rate); static void action_suspend(surf_action_t action); static void action_resume(surf_action_t action); static int action_is_suspended(surf_action_t action); @@ -260,10 +260,9 @@ static void create_ns3_topology(void) onelink_t onelink; unsigned int iter; xbt_dynar_foreach(onelink_routes, iter, onelink) { - char *src = onelink->src; - char *dst = onelink->dst; + char *src = ((network_element_t)onelink->src)->name; + char *dst = ((network_element_t)onelink->dst)->name; void *link = onelink->link_ptr; - if( strcmp(src,dst) && ((surf_ns3_link_t)link)->created){ XBT_DEBUG("Route from '%s' to '%s' with link '%s'",src,dst,((surf_ns3_link_t)link)->data->id); char * link_bdw = xbt_strdup(((surf_ns3_link_t)link)->data->bdw); @@ -478,15 +477,15 @@ static void ns3_update_actions_state(double now, double delta) } /* Max durations are not supported */ -static surf_action_t ns3_communicate(void *src_card, - void *dst_card, double size, double rate) +static surf_action_t ns3_communicate(void *src_elm, + void *dst_elm, double size, double rate) { surf_action_network_ns3_t action = NULL; - XBT_DEBUG("Communicate from %s to %s",src_name,dst_name); + XBT_DEBUG("Communicate from %s to %s",((network_element_t)src_elm)->name,((network_element_t)dst_elm)->name); action = surf_action_new(sizeof(s_surf_action_network_ns3_t), size, surf_network_model, 0); - ns3_create_flow(src_name, dst_name, surf_get_clock(), size, action); + ns3_create_flow(((network_element_t)src_elm)->name, ((network_element_t)dst_elm)->name, surf_get_clock(), size, action); #ifdef HAVE_TRACING action->last_sent = 0; -- 2.20.1