static void parse_ns3_add_AS(simgrid::surf::As* as)
{
- const char* as_id = as->p_name;
+ const char* as_id = as->name_;
XBT_DEBUG("NS3_ADD_AS '%s'", as_id);
xbt_lib_set(as_router_lib, as_id, NS3_ASR_LEVEL, ns3_add_AS(as_id) );
}
"Refusing to create a second host named '%s'.", host->id);
simgrid::surf::As* current_routing = routing_get_current();
- if (current_routing->p_hierarchy == SURF_ROUTING_NULL)
- current_routing->p_hierarchy = SURF_ROUTING_BASE;
+ if (current_routing->hierarchy_ == SURF_ROUTING_NULL)
+ current_routing->hierarchy_ = SURF_ROUTING_BASE;
simgrid::surf::NetCard *netcard =
new simgrid::surf::NetCardImpl(host->id, SURF_NETWORK_ELEMENT_HOST, current_routing);
{
simgrid::surf::As* current_routing = routing_get_current();
- if (current_routing->p_hierarchy == SURF_ROUTING_NULL)
- current_routing->p_hierarchy = SURF_ROUTING_BASE;
+ if (current_routing->hierarchy_ == SURF_ROUTING_NULL)
+ current_routing->hierarchy_ = SURF_ROUTING_BASE;
xbt_assert(!xbt_lib_get_or_null(as_router_lib, router->id, ROUTING_ASR_LEVEL),
"Reading a router, processing unit \"%s\" already exists",
router->id);
info_loop.link_up = Link::byName(tmp_link);
info_loop.link_down = info_loop.link_up;
free(tmp_link);
- xbt_dynar_set(current_routing->p_linkUpDownList,
+ xbt_dynar_set(current_routing->upDownLinks,
rankId*(static_cast<AsCluster*>(current_routing))->p_nb_links_per_node, &info_loop);
}
info_lim.link_down = info_lim.link_up;
free(tmp_link);
auto as_cluster = static_cast<AsCluster*>(current_routing);
- xbt_dynar_set(current_routing->p_linkUpDownList,
+ xbt_dynar_set(current_routing->upDownLinks,
rankId*(as_cluster)->p_nb_links_per_node + as_cluster->p_has_loopback ,
&info_lim);
simgrid::xbt::signal<void(simgrid::surf::As*)> asCreatedCallbacks;
As::As(const char*name)
- : p_name(xbt_strdup(name))
+ : name_(xbt_strdup(name))
{}
As::~As()
{
- xbt_dict_free(&p_routingSons);
+ xbt_dict_free(&sons_);
xbt_dynar_free(&p_indexNetworkElm);
- xbt_dynar_free(&p_linkUpDownList);
- xbt_free(p_name);
- if (p_netcard)
- delete p_netcard;
+ xbt_dynar_free(&upDownLinks);
+ xbt_free(name_);
+ if (netcard_)
+ delete netcard_;
}
}} // namespace simgrid::surf
xbt_assert(link_up_down.link_down, "Link '%s' not found!",netcard_arg->link_down);
// If dynar is is greater than netcard id and if the host_link is already defined
- if((int)xbt_dynar_length(current_routing->p_linkUpDownList) > netcard->getId() &&
- xbt_dynar_get_as(current_routing->p_linkUpDownList, netcard->getId(), void*))
+ if((int)xbt_dynar_length(current_routing->upDownLinks) > netcard->getId() &&
+ xbt_dynar_get_as(current_routing->upDownLinks, netcard->getId(), void*))
surf_parse_error("Host_link for '%s' is already defined!",netcard_arg->id);
XBT_DEBUG("Push Host_link for host '%s' to position %d", netcard->getName(), netcard->getId());
- xbt_dynar_set_as(current_routing->p_linkUpDownList, netcard->getId(), s_surf_parsing_link_up_down_t, link_up_down);
+ xbt_dynar_set_as(current_routing->upDownLinks, netcard->getId(), s_surf_parsing_link_up_down_t, link_up_down);
}
void sg_platf_new_trace(sg_platf_trace_cbarg_t trace)
}
/* make a new routing component */
- simgrid::surf::NetCard *netcard = new simgrid::surf::NetCardImpl(new_as->p_name, SURF_NETWORK_ELEMENT_AS, current_routing);
+ simgrid::surf::NetCard *netcard = new simgrid::surf::NetCardImpl(new_as->name_, SURF_NETWORK_ELEMENT_AS, current_routing);
if (current_routing == NULL && routing_platf->p_root == NULL) {
/* it is the first one */
- new_as->p_routingFather = NULL;
+ new_as->father_ = NULL;
routing_platf->p_root = new_as;
netcard->setId(-1);
} else if (current_routing != NULL && routing_platf->p_root != NULL) {
- xbt_assert(!xbt_dict_get_or_null(current_routing->p_routingSons, AS->id),
+ xbt_assert(!xbt_dict_get_or_null(current_routing->sons_, AS->id),
"The AS \"%s\" already exists", AS->id);
/* it is a part of the tree */
- new_as->p_routingFather = current_routing;
+ new_as->father_ = current_routing;
/* set the father behavior */
- if (current_routing->p_hierarchy == SURF_ROUTING_NULL)
- current_routing->p_hierarchy = SURF_ROUTING_RECURSIVE;
+ if (current_routing->hierarchy_ == SURF_ROUTING_NULL)
+ current_routing->hierarchy_ = SURF_ROUTING_RECURSIVE;
/* add to the sons dictionary */
- xbt_dict_set(current_routing->p_routingSons, AS->id,
+ xbt_dict_set(current_routing->sons_, AS->id,
(void *) new_as, NULL);
/* add to the father element list */
netcard->setId(current_routing->parseAS(netcard));
xbt_lib_set(as_router_lib, netcard->getName(), ROUTING_ASR_LEVEL,
(void *) netcard);
- XBT_DEBUG("Having set name '%s' id '%d'", new_as->p_name, netcard->getId());
+ XBT_DEBUG("Having set name '%s' id '%d'", new_as->name_, netcard->getId());
/* set the new current component of the tree */
current_routing = new_as;
- current_routing->p_netcard = netcard;
+ current_routing->netcard_ = netcard;
simgrid::surf::netcardCreatedCallbacks(netcard);
simgrid::surf::asCreatedCallbacks(new_as);
{
xbt_assert(current_routing, "Cannot seal the current AS: none under construction");
current_routing->Seal();
- current_routing = current_routing->p_routingFather;
+ current_routing = current_routing->father_;
}
/* Aux Business methods */
"Ask for route \"from\"(%s) or \"to\"(%s) no found", src_name, dst_name);
/* (2) find the path to the root routing component */
- for (current = src_as; current != NULL; current = current->p_routingFather) {
+ for (current = src_as; current != NULL; current = current->father_) {
if (index_src >= ELEMENTS_FATHER_MAXDEPTH)
xbt_die("ELEMENTS_FATHER_MAXDEPTH should be increased for path_src");
path_src[index_src++] = current;
}
- for (current = dst_as; current != NULL; current = current->p_routingFather) {
+ for (current = dst_as; current != NULL; current = current->father_) {
if (index_dst >= ELEMENTS_FATHER_MAXDEPTH)
xbt_die("ELEMENTS_FATHER_MAXDEPTH should be increased for path_dst");
path_dst[index_dst++] = current;
simgrid::surf::As *common_father, *src_father, *dst_father;
elements_father(src, dst, &common_father, &src_father, &dst_father);
XBT_DEBUG("elements_father: common father '%s' src_father '%s' dst_father '%s'",
- common_father->p_name, src_father->p_name, dst_father->p_name);
+ common_father->name_, src_father->name_, dst_father->name_);
/* Check whether a direct bypass is defined */
sg_platf_route_cbarg_t e_route_bypass = NULL;
route.link_list = xbt_dynar_new(sizeof(sg_routing_link_t), NULL);
// Find the net_card corresponding to father
- simgrid::surf::NetCard *src_father_netcard = src_father->p_netcard;
- simgrid::surf::NetCard *dst_father_netcard = dst_father->p_netcard;
+ simgrid::surf::NetCard *src_father_netcard = src_father->netcard_;
+ simgrid::surf::NetCard *dst_father_netcard = dst_father->netcard_;
common_father->getRouteAndLatency(src_father_netcard, dst_father_netcard,
&route, latency);
char *key;
xbt_dict_cursor_t cursor = NULL;
AS_t rc_child;
- xbt_dict_foreach(rc->p_routingSons, cursor, key, rc_child) {
+ xbt_dict_foreach(rc->sons_, cursor, key, rc_child) {
xbt_dynar_t onelink_child = recursiveGetOneLinkRoutes(rc_child);
if (onelink_child)
xbt_dynar_merge(&ret,&onelink_child);
simgrid::surf::AsCluster *cluster = dynamic_cast<simgrid::surf::AsCluster*>(current_routing);
xbt_assert(cluster, "Only hosts from Cluster can get a backbone.");
- xbt_assert(nullptr == cluster->p_backbone, "Cluster %s already has a backbone link!", cluster->p_name);
+ xbt_assert(nullptr == cluster->p_backbone, "Cluster %s already has a backbone link!", cluster->name_);
cluster->p_backbone = static_cast<simgrid::surf::Link*>(bb);
- XBT_DEBUG("Add a backbone to AS '%s'", current_routing->p_name);
+ XBT_DEBUG("Add a backbone to AS '%s'", current_routing->name_);
}
void sg_platf_new_cabinet(sg_platf_cabinet_cbarg_t cabinet)
char *key;
AS_t elem;
- xbt_dict_foreach(as->p_routingSons, cursor, key, elem) {
+ xbt_dict_foreach(as->sons_, cursor, key, elem) {
finalize_rec(elem);
}
}
const char *surf_AS_get_name(simgrid::surf::As *as) {
- return as->p_name;
+ return as->name_;
}
static simgrid::surf::As *surf_AS_recursive_get_by_name(
AS_t elem;
simgrid::surf::As *tmp = NULL;
- if(!strcmp(current->p_name, name))
+ if(!strcmp(current->name_, name))
return current;
- xbt_dict_foreach(current->p_routingSons, cursor, key, elem) {
+ xbt_dict_foreach(current->sons_, cursor, key, elem) {
tmp = surf_AS_recursive_get_by_name(elem, name);
if(tmp != NULL ) {
break;
xbt_dict_t surf_AS_get_routing_sons(simgrid::surf::As *as)
{
- return as->p_routingSons;
+ return as->sons_;
}
xbt_dynar_t surf_AS_get_hosts(simgrid::surf::As *as)
virtual void Seal()=0;
virtual ~As();
- char *p_name = nullptr;
- NetCard *p_netcard = nullptr;
- As *p_routingFather = nullptr;
+ char *name_ = nullptr;
+ NetCard *netcard_ = nullptr;
+ As *father_ = nullptr;
+ xbt_dict_t sons_ = xbt_dict_new_homogeneous(NULL);
- xbt_dynar_t p_indexNetworkElm = xbt_dynar_new(sizeof(char*),NULL);
- xbt_dict_t p_bypassRoutes = nullptr;
- e_surf_routing_hierarchy_t p_hierarchy = SURF_ROUTING_NULL;
- xbt_dict_t p_routingSons = xbt_dict_new_homogeneous(NULL);
- xbt_dynar_t p_linkUpDownList = xbt_dynar_new(sizeof(s_surf_parsing_link_up_down_t),NULL);
+ xbt_dynar_t p_indexNetworkElm = xbt_dynar_new(sizeof(char*),NULL); // TODO: What is it?
+ xbt_dict_t bypassRoutes_ = nullptr;
+ e_surf_routing_hierarchy_t hierarchy_ = SURF_ROUTING_NULL;
+ xbt_dynar_t upDownLinks = xbt_dynar_new(sizeof(s_surf_parsing_link_up_down_t),NULL);
NetCard *src, NetCard *dst,
sg_platf_route_cbarg_t into, double *latency)=0;
virtual xbt_dynar_t getOneLinkRoutes()=0;
+
virtual void getGraph(xbt_graph_t graph, xbt_dict_t nodes, xbt_dict_t edges)=0;
- virtual sg_platf_route_cbarg_t getBypassRoute(
- NetCard *src, NetCard *dst,
- double *lat)=0;
+
+ virtual sg_platf_route_cbarg_t getBypassRoute(NetCard *src, NetCard *dst,double *lat)=0;
/* The parser calls the following functions to inform the routing models
* that a new element is added to the AS currently built.
NetCardImpl(const char *name, e_surf_network_element_type_t componentType, As *component)
: component_(component),
componentType_(componentType),
- name_(xbt_strdup(name)) {}
+ name_(xbt_strdup(name))
+ {}
~NetCardImpl() { xbt_free(name_);};
int getId() {return id_;}
if (src->getRcType() != SURF_NETWORK_ELEMENT_ROUTER) { // No specific link for router
if((src->getId() == dst->getId()) && p_has_loopback ){
- info = xbt_dynar_get_as(p_linkUpDownList, src->getId() * p_nb_links_per_node, s_surf_parsing_link_up_down_t);
+ info = xbt_dynar_get_as(upDownLinks, src->getId() * p_nb_links_per_node, s_surf_parsing_link_up_down_t);
xbt_dynar_push_as(route->link_list, void *, info.link_up);
if (lat)
*lat += static_cast<Link*>(info.link_up)->getLatency();
if (p_has_limiter){ // limiter for sender
- info = xbt_dynar_get_as(p_linkUpDownList, src->getId() * p_nb_links_per_node + p_has_loopback, s_surf_parsing_link_up_down_t);
+ info = xbt_dynar_get_as(upDownLinks, src->getId() * p_nb_links_per_node + p_has_loopback, s_surf_parsing_link_up_down_t);
xbt_dynar_push_as(route->link_list, void *, info.link_up);
}
- info = xbt_dynar_get_as(p_linkUpDownList, src->getId() * p_nb_links_per_node + p_has_loopback + p_has_limiter, s_surf_parsing_link_up_down_t);
+ info = xbt_dynar_get_as(upDownLinks, src->getId() * p_nb_links_per_node + p_has_loopback + p_has_limiter, s_surf_parsing_link_up_down_t);
if (info.link_up) { // link up
xbt_dynar_push_as(route->link_list, void *, info.link_up);
if (lat)
}
if (dst->getRcType() != SURF_NETWORK_ELEMENT_ROUTER) { // No specific link for router
- info = xbt_dynar_get_as(p_linkUpDownList, dst->getId() * p_nb_links_per_node + p_has_loopback + p_has_limiter, s_surf_parsing_link_up_down_t);
+ info = xbt_dynar_get_as(upDownLinks, dst->getId() * p_nb_links_per_node + p_has_loopback + p_has_limiter, s_surf_parsing_link_up_down_t);
if (info.link_down) { // link down
xbt_dynar_push_as(route->link_list, void *, info.link_down);
*lat += static_cast<Link*>(info.link_down)->getLatency();
}
if (p_has_limiter){ // limiter for receiver
- info = xbt_dynar_get_as(p_linkUpDownList, dst->getId() * p_nb_links_per_node + p_has_loopback, s_surf_parsing_link_up_down_t);
+ info = xbt_dynar_get_as(upDownLinks, dst->getId() * p_nb_links_per_node + p_has_loopback, s_surf_parsing_link_up_down_t);
xbt_dynar_push_as(route->link_list, void *, info.link_up);
}
}
if (src->getRcType() != SURF_NETWORK_ELEMENT_ROUTER) {
previous = new_xbt_graph_node(graph, src->getName(), nodes);
- info = xbt_dynar_get_as(p_linkUpDownList, src->getId(), s_surf_parsing_link_up_down_t);
+ info = xbt_dynar_get_as(upDownLinks, src->getId(), s_surf_parsing_link_up_down_t);
if (info.link_up) { // link up
info.link_up = sg_link_by_name(link_id);
info.link_down = info.link_up;
}
- xbt_dynar_set(p_linkUpDownList, position, &info);
+ xbt_dynar_set(upDownLinks, position, &info);
xbt_free(link_id);
}
* note that position rankId*(xbt_dynar_length(dimensions)+has_loopack?+has_limiter?)
* holds the link "rankId->rankId"
*/
- xbt_dynar_set(p_linkUpDownList, position + j, &info);
+ xbt_dynar_set(upDownLinks, position + j, &info);
dim_product *= current_dimension;
xbt_free(link_id);
}
if ((src->getId() == dst->getId()) && p_has_loopback) {
s_surf_parsing_link_up_down_t info =
- xbt_dynar_get_as(p_linkUpDownList, src->getId() * p_nb_links_per_node, s_surf_parsing_link_up_down_t);
+ xbt_dynar_get_as(upDownLinks, src->getId() * p_nb_links_per_node, s_surf_parsing_link_up_down_t);
xbt_dynar_push_as(route->link_list, void *, info.link_up);
if (lat)
s_surf_parsing_link_up_down_t info;
if (p_has_limiter) { // limiter for sender
- info = xbt_dynar_get_as(p_linkUpDownList, nodeOffset + p_has_loopback, s_surf_parsing_link_up_down_t);
+ info = xbt_dynar_get_as(upDownLinks, nodeOffset + p_has_loopback, s_surf_parsing_link_up_down_t);
xbt_dynar_push_as(route->link_list, void *, info.link_up);
}
- info = xbt_dynar_get_as(p_linkUpDownList, linkOffset, s_surf_parsing_link_up_down_t);
+ info = xbt_dynar_get_as(upDownLinks, linkOffset, s_surf_parsing_link_up_down_t);
if (use_lnk_up == false) {
xbt_dynar_push_as(route->link_list, void *, info.link_down);
p_routeCache = xbt_dict_new_homogeneous(&route_cache_elem_free);
/* Add the loopback if needed */
- if (routing_platf->p_loopback && p_hierarchy == SURF_ROUTING_BASE)
+ if (routing_platf->p_loopback && hierarchy_ == SURF_ROUTING_BASE)
addLoopback();
/* initialize graph indexes in nodes after graph has been built */
if (xbt_dynar_length(route->link_list) == 1) {
void *link = *(void **) xbt_dynar_get_ptr(route->link_list, 0);
Onelink *onelink;
- if (p_hierarchy == SURF_ROUTING_BASE)
+ if (hierarchy_ == SURF_ROUTING_BASE)
onelink = new Onelink(link, src_elm, dst_elm);
- else if (p_hierarchy == SURF_ROUTING_RECURSIVE)
+ else if (hierarchy_ == SURF_ROUTING_RECURSIVE)
onelink = new Onelink(link, route->gw_src, route->gw_dst);
else
onelink = new Onelink(link, NULL, NULL);
if (v == dst_node_id)
first_gw = gw_dst;
- if (p_hierarchy == SURF_ROUTING_RECURSIVE && v != dst_node_id
+ if (hierarchy_ == SURF_ROUTING_RECURSIVE && v != dst_node_id
&& strcmp(gw_dst->getName(), prev_gw_src->getName())) {
xbt_dynar_t e_route_as_to_as=NULL;
size++;
}
- if (p_hierarchy == SURF_ROUTING_RECURSIVE) {
+ if (hierarchy_ == SURF_ROUTING_RECURSIVE) {
route->gw_src = gw_src;
route->gw_dst = first_gw;
}
p_routeCache = xbt_dict_new_homogeneous(&route_cache_elem_free);
/* Add the loopback if needed */
- if (routing_platf->p_loopback && p_hierarchy == SURF_ROUTING_BASE)
+ if (routing_platf->p_loopback && hierarchy_ == SURF_ROUTING_BASE)
addLoopback();
/* initialize graph indexes in nodes after graph has been built */
if (m_cached && !p_routeCache)
p_routeCache = xbt_dict_new_homogeneous(&route_cache_elem_free);
- sg_platf_route_cbarg_t e_route = newExtendedRoute(p_hierarchy, route, 1);
+ sg_platf_route_cbarg_t e_route = newExtendedRoute(hierarchy_, route, 1);
newRoute(src_net_elm->getId(), dst_net_elm->getId(), e_route);
// Symmetrical YES
route->gw_src = route->gw_dst;
route->gw_dst = gw_tmp;
}
- sg_platf_route_cbarg_t link_route_back = newExtendedRoute(p_hierarchy, route, 0);
+ sg_platf_route_cbarg_t link_route_back = newExtendedRoute(hierarchy_, route, 0);
newRoute(dst_net_elm->getId(), src_net_elm->getId(), link_route_back);
}
xbt_dynar_free(&route->link_list);
}
xbt_free(p_linkTable);
/* Delete bypass dict */
- xbt_dict_free(&p_bypassRoutes);
+ xbt_dict_free(&bypassRoutes_);
/* Delete predecessor and cost table */
xbt_free(p_predecessorTable);
xbt_free(p_costTable);
if (xbt_dynar_length(route->link_list) == 1) {
void *link = *(void **) xbt_dynar_get_ptr(route->link_list, 0);
Onelink *onelink;
- if (p_hierarchy == SURF_ROUTING_BASE)
+ if (hierarchy_ == SURF_ROUTING_BASE)
onelink = new Onelink(link, src_elm, dst_elm);
- else if (p_hierarchy == SURF_ROUTING_RECURSIVE)
+ else if (hierarchy_ == SURF_ROUTING_RECURSIVE)
onelink = new Onelink(link, route->gw_src, route->gw_dst);
else
onelink = new Onelink(link, NULL, NULL);
cur = pred;
} while (cur != src->getId());
- if (p_hierarchy == SURF_ROUTING_RECURSIVE) {
+ if (hierarchy_ == SURF_ROUTING_RECURSIVE) {
res->gw_src = xbt_dynar_getlast_as(route_stack, sg_platf_route_cbarg_t)->gw_src;
res->gw_dst = xbt_dynar_getfirst_as(route_stack, sg_platf_route_cbarg_t)->gw_dst;
}
void *link;
unsigned int cpt;
- if (p_hierarchy == SURF_ROUTING_RECURSIVE && prev_dst_gw != NULL
+ if (hierarchy_ == SURF_ROUTING_RECURSIVE && prev_dst_gw != NULL
&& strcmp(prev_dst_gw->getName(), e_route->gw_src->getName())) {
routing_platf->getRouteAndLatency(prev_dst_gw, e_route->gw_src,
&res->link_list, lat);
else
{
TO_FLOYD_LINK(src_net_elm->getId(), dst_net_elm->getId()) =
- newExtendedRoute(p_hierarchy, route, 1);
+ newExtendedRoute(hierarchy_, route, 1);
TO_FLOYD_PRED(src_net_elm->getId(), dst_net_elm->getId()) = src_net_elm->getId();
TO_FLOYD_COST(src_net_elm->getId(), dst_net_elm->getId()) =
((TO_FLOYD_LINK(src_net_elm->getId(), dst_net_elm->getId()))->link_list)->used; /* count of links, old model assume 1 */
route->gw_src->getName(), src, route->gw_dst->getName());
TO_FLOYD_LINK(dst_net_elm->getId(), src_net_elm->getId()) =
- newExtendedRoute(p_hierarchy, route, 0);
+ newExtendedRoute(hierarchy_, route, 0);
TO_FLOYD_PRED(dst_net_elm->getId(), src_net_elm->getId()) = dst_net_elm->getId();
TO_FLOYD_COST(dst_net_elm->getId(), src_net_elm->getId()) =
((TO_FLOYD_LINK(dst_net_elm->getId(), src_net_elm->getId()))->link_list)->used; /* count of links, old model assume 1 */
}
/* Add the loopback if needed */
- if (routing_platf->p_loopback && p_hierarchy == SURF_ROUTING_BASE) {
+ if (routing_platf->p_loopback && hierarchy_ == SURF_ROUTING_BASE) {
for (i = 0; i < table_size; i++) {
sg_platf_route_cbarg_t e_route = TO_FLOYD_LINK(i, i);
if (!e_route) {
p_routingTable = xbt_new0(sg_platf_route_cbarg_t, table_size * table_size);
/* Add the loopback if needed */
- if (routing_platf->p_loopback && p_hierarchy == SURF_ROUTING_BASE) {
+ if (routing_platf->p_loopback && hierarchy_ == SURF_ROUTING_BASE) {
for (i = 0; i < table_size; i++) {
e_route = TO_ROUTE_FULL(i, i);
if (!e_route) {
if (xbt_dynar_length(route->link_list) == 1) {
void *link = *(void **) xbt_dynar_get_ptr(route->link_list, 0);
Onelink *onelink;
- if (p_hierarchy == SURF_ROUTING_BASE) {
+ if (hierarchy_ == SURF_ROUTING_BASE) {
NetCard *tmp_src = xbt_dynar_get_as(p_indexNetworkElm, src, sg_netcard_t);
tmp_src->setId(src);
NetCard *tmp_dst = xbt_dynar_get_as(p_indexNetworkElm, dst, sg_netcard_t);
tmp_dst->setId(dst);
onelink = new Onelink(link, tmp_src, tmp_dst);
- } else if (p_hierarchy == SURF_ROUTING_RECURSIVE)
+ } else if (hierarchy_ == SURF_ROUTING_RECURSIVE)
onelink = new Onelink(link, route->gw_src, route->gw_dst);
else
onelink = new Onelink(link, NULL, NULL);
XBT_DEBUG("ASroute goes from \"%s\" to \"%s\"",
route->gw_src->getName(), route->gw_dst->getName());
}
- TO_ROUTE_FULL(src_net_elm->getId(), dst_net_elm->getId()) = newExtendedRoute(p_hierarchy, route, 1);
+ TO_ROUTE_FULL(src_net_elm->getId(), dst_net_elm->getId()) = newExtendedRoute(hierarchy_, route, 1);
xbt_dynar_shrink(TO_ROUTE_FULL(src_net_elm->getId(), dst_net_elm->getId())->link_list, 0);
}
else
XBT_DEBUG("Load ASroute from \"%s(%s)\" to \"%s(%s)\"",
dst, route->gw_src->getName(), src, route->gw_dst->getName());
- TO_ROUTE_FULL(dst_net_elm->getId(), src_net_elm->getId()) = newExtendedRoute(p_hierarchy, route, 0);
+ TO_ROUTE_FULL(dst_net_elm->getId(), src_net_elm->getId()) = newExtendedRoute(hierarchy_, route, 0);
xbt_dynar_shrink(TO_ROUTE_FULL(dst_net_elm->getId(), src_net_elm->getId())->link_list, 0);
}
}
AsGeneric::AsGeneric(const char*name)
: AsNone(name)
{
- p_bypassRoutes = xbt_dict_new_homogeneous((void (*)(void *)) routing_route_free);
+ bypassRoutes_ = xbt_dict_new_homogeneous((void (*)(void *)) routing_route_free);
}
AsGeneric::~AsGeneric()
{
- xbt_dict_free(&p_bypassRoutes);
+ xbt_dict_free(&bypassRoutes_);
}
int AsGeneric::parsePU(NetCard *elm)
XBT_DEBUG("Load bypassASroute from \"%s\" to \"%s\"", src, dst);
else
XBT_DEBUG("Load bypassRoute from \"%s\" to \"%s\"", src, dst);
- xbt_dict_t dict_bypassRoutes = p_bypassRoutes;
+ xbt_dict_t dict_bypassRoutes = bypassRoutes_;
char *route_name;
route_name = bprintf("%s#%s", src, dst);
return NULL;
sg_platf_route_cbarg_t e_route_bypass = NULL;
- xbt_dict_t dict_bypassRoutes = p_bypassRoutes;
+ xbt_dict_t dict_bypassRoutes = bypassRoutes_;
if(dst->getRcComponent() == this && src->getRcComponent() == this ){
char *route_name = bprintf("%s#%s", src->getName(), dst->getName());
if (src == NULL || dst == NULL)
xbt_die("Ask for route \"from\"(%s) or \"to\"(%s) no found at AS \"%s\"",
src ? src->getName() : "(null)",
- dst ? dst->getName() : "(null)", p_name);
+ dst ? dst->getName() : "(null)", name_);
src_as = src->getRcComponent();
dst_as = dst->getRcComponent();
current = src_as;
while (current != NULL) {
xbt_dynar_push(path_src, ¤t);
- current = current->p_routingFather;
+ current = current->father_;
}
path_dst = xbt_dynar_new(sizeof(As*), NULL);
current = dst_as;
while (current != NULL) {
xbt_dynar_push(path_dst, ¤t);
- current = current->p_routingFather;
+ current = current->father_;
}
/* (3) find the common father */
if (i <= max_index_src && max <= max_index_dst) {
char *route_name = bprintf("%s#%s",
(*(As **)
- (xbt_dynar_get_ptr(path_src, i)))->p_name,
+ (xbt_dynar_get_ptr(path_src, i)))->name_,
(*(As **)
- (xbt_dynar_get_ptr(path_dst, max)))->p_name);
+ (xbt_dynar_get_ptr(path_dst, max)))->name_);
e_route_bypass = (sg_platf_route_cbarg_t) xbt_dict_get_or_null(dict_bypassRoutes, route_name);
xbt_free(route_name);
}
if (max <= max_index_src && i <= max_index_dst) {
char *route_name = bprintf("%s#%s",
(*(As **)
- (xbt_dynar_get_ptr(path_src, max)))->p_name,
+ (xbt_dynar_get_ptr(path_src, max)))->name_,
(*(As **)
- (xbt_dynar_get_ptr(path_dst, i)))->p_name);
+ (xbt_dynar_get_ptr(path_dst, i)))->name_);
e_route_bypass = (sg_platf_route_cbarg_t) xbt_dict_get_or_null(dict_bypassRoutes, route_name);
xbt_free(route_name);
}
if (max <= max_index_src && max <= max_index_dst) {
char *route_name = bprintf("%s#%s",
(*(As **)
- (xbt_dynar_get_ptr(path_src, max)))->p_name,
+ (xbt_dynar_get_ptr(path_src, max)))->name_,
(*(As **)
- (xbt_dynar_get_ptr(path_dst, max)))->p_name);
+ (xbt_dynar_get_ptr(path_dst, max)))->name_);
e_route_bypass = (sg_platf_route_cbarg_t) xbt_dict_get_or_null(dict_bypassRoutes, route_name);
xbt_free(route_name);
}
xbt_die("Ask for route \"from\"(%s) or \"to\"(%s) no found at AS \"%s\"",
src ? src->getName() : "(null)",
dst ? dst->getName() : "(null)",
- p_name);
+ name_);
As *src_as = src->getRcComponent();
As *dst_as = dst->getRcComponent();
if (src_as != dst_as)
xbt_die("The src(%s in %s) and dst(%s in %s) are in differents AS",
- src->getName(), src_as->p_name,
- dst->getName(), dst_as->p_name);
+ src->getName(), src_as->name_,
+ dst->getName(), dst_as->name_);
if (this != dst_as)
xbt_die
("The routing component of src'%s' and dst'%s' is not the same as the network elements belong (%s?=%s?=%s)",
src->getName(),
dst->getName(),
- src_as->p_name,
- dst_as->p_name,
- p_name);
+ src_as->name_,
+ dst_as->name_,
+ name_);
}
}
if(src->getRcType() == SURF_NETWORK_ELEMENT_HOST){
tmp_src_name = HOST_PEER(src->getName());
- if ((int)xbt_dynar_length(p_linkUpDownList)>src->getId()) {
- info = xbt_dynar_get_as(p_linkUpDownList, src->getId(), s_surf_parsing_link_up_down_t);
+ if ((int)xbt_dynar_length(upDownLinks)>src->getId()) {
+ info = xbt_dynar_get_as(upDownLinks, src->getId(), s_surf_parsing_link_up_down_t);
if(info.link_up) { // link up
xbt_dynar_push_as(route->link_list, void*, info.link_up);
if (lat)
if(dst->getRcType() == SURF_NETWORK_ELEMENT_HOST){
tmp_dst_name = HOST_PEER(dst->getName());
- if ((int)xbt_dynar_length(p_linkUpDownList)>dst->getId()) {
- info = xbt_dynar_get_as(p_linkUpDownList, dst->getId(), s_surf_parsing_link_up_down_t);
+ if ((int)xbt_dynar_length(upDownLinks)>dst->getId()) {
+ info = xbt_dynar_get_as(upDownLinks, dst->getId(), s_surf_parsing_link_up_down_t);
if(info.link_down) { // link down
xbt_dynar_push_as(route->link_list,void*,info.link_down);
if (lat)