From: Martin Quinson Date: Sun, 20 Mar 2016 23:00:59 +0000 (+0100) Subject: ns3: rename a type for consistency X-Git-Tag: v3_13~360 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/3bf83c178e063b2a63809add332e54e810df87cc ns3: rename a type for consistency --- diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index 2624c3e60d..fece65ae48 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -124,8 +124,8 @@ static void parse_ns3_add_cluster(sg_platf_cluster_cbarg_t cluster) router_id = bprintf("ns3_%s%d%s", cluster->prefix, elmts, cluster->suffix); XBT_DEBUG("Create link from '%s' to '%s'",host_id,router_id); - ns3_nodes_t host_src = ns3_find_host(host_id); - ns3_nodes_t host_dst = ns3_find_host(router_id); + ns3_node_t host_src = ns3_find_host(host_id); + ns3_node_t host_dst = ns3_find_host(router_id); if(host_src && host_dst){} else xbt_die("\tns3_add_link from %d to %d",host_src->node_num,host_dst->node_num); @@ -181,12 +181,12 @@ static void create_ns3_topology(void) XBT_DEBUG("\tLink (%s) bdw:%s lat:%s", link->getName(), link_bdw, link_lat); //create link ns3 - ns3_nodes_t host_src = ns3_find_host(src); + ns3_node_t host_src = ns3_find_host(src); if (!host_src) - host_src = static_cast(xbt_lib_get_or_null(as_router_lib,src,NS3_ASR_LEVEL)); - ns3_nodes_t host_dst = ns3_find_host(dst); + host_src = static_cast(xbt_lib_get_or_null(as_router_lib,src,NS3_ASR_LEVEL)); + ns3_node_t host_dst = ns3_find_host(dst); if(!host_dst) - host_dst = static_cast(xbt_lib_get_or_null(as_router_lib,dst,NS3_ASR_LEVEL)); + host_dst = static_cast(xbt_lib_get_or_null(as_router_lib,dst,NS3_ASR_LEVEL)); if (!host_src || !host_dst) xbt_die("\tns3_add_link from %d to %d",host_src->node_num,host_dst->node_num); @@ -225,7 +225,7 @@ static void free_ns3_link(void * elmts) static void free_ns3_host(void * elmts) { - ns3_nodes_t host = static_cast(elmts); + ns3_node_t host = static_cast(elmts); free(host); } diff --git a/src/surf/ns3/ns3_interface.cc b/src/surf/ns3/ns3_interface.cc index 95ca5f8216..8a0055a9f3 100644 --- a/src/surf/ns3/ns3_interface.cc +++ b/src/surf/ns3/ns3_interface.cc @@ -54,8 +54,8 @@ char ns3_get_socket_is_finished(void *socket){ int ns3_create_flow(const char* a,const char *b,double start,u_int32_t TotalBytes,void * action) { - ns3_nodes_t node1 = ns3_find_host(a); - ns3_nodes_t node2 = ns3_find_host(b); + ns3_node_t node1 = ns3_find_host(a); + ns3_node_t node2 = ns3_find_host(b); Ptr src_node = nodes.Get(node1->node_num); Ptr dst_node = nodes.Get(node2->node_num); @@ -122,7 +122,7 @@ int ns3_initialize(const char* TcpProtocol){ void * ns3_add_host(const char * id) { - ns3_nodes_t host = xbt_new0(s_ns3_nodes_t,1); + ns3_node_t host = xbt_new0(s_ns3_node_t,1); XBT_DEBUG("Interface ns3 add host[%d] '%s'",number_of_nodes,id); Ptr node = CreateObject (0); stack.Install(node); @@ -136,7 +136,7 @@ void * ns3_add_host(const char * id) void * ns3_add_host_cluster(const char * id) { - ns3_nodes_t host = xbt_new0(s_ns3_nodes_t,1); + ns3_node_t host = xbt_new0(s_ns3_node_t,1); XBT_DEBUG("Interface ns3 add host[%d] '%s'",number_of_nodes,id); Ptr node = CreateObject (0); stack.Install(node); @@ -151,7 +151,7 @@ void * ns3_add_host_cluster(const char * id) void * ns3_add_router(const char * id) { - ns3_nodes_t router = xbt_new0(s_ns3_nodes_t,1); + ns3_node_t router = xbt_new0(s_ns3_node_t,1); XBT_DEBUG("Interface ns3 add router[%d] '%s'",number_of_nodes,id); Ptr node = CreateObject (0); stack.Install(node); diff --git a/src/surf/ns3/ns3_interface.h b/src/surf/ns3/ns3_interface.h index 1fc6d22048..6f94334fcc 100644 --- a/src/surf/ns3/ns3_interface.h +++ b/src/surf/ns3/ns3_interface.h @@ -24,11 +24,11 @@ typedef enum { } e_ns3_network_element_type_t; -typedef struct ns3_nodes{ +typedef struct ns3_node { int node_num; e_ns3_network_element_type_t type; void * data; -}s_ns3_nodes_t, *ns3_nodes_t; +} s_ns3_node_t, *ns3_node_t; XBT_PUBLIC_DATA(int) NS3_EXTENSION_ID; @@ -53,13 +53,13 @@ XBT_PUBLIC(void) ns3_end_platform(void); XBT_PUBLIC(void) ns3_add_cluster(char * bw,char * lat,const char *id); inline -ns3_nodes_t ns3_find_host(const char* id) +ns3_node_t ns3_find_host(const char* id) { sg_host_t host = sg_host_by_name(id); if (host == nullptr) return nullptr; else - return (ns3_nodes_t) host->extension(NS3_EXTENSION_ID); + return (ns3_node_t) host->extension(NS3_EXTENSION_ID); } SG_END_DECL()