void As::addRoute(sg_platf_route_cbarg_t /*route*/){
xbt_die("AS %s does not accept new routes (wrong class).",name_);
}
- void As::parseBypassroute(sg_platf_route_cbarg_t /*e_route*/){
+ void As::addBypassRoute(sg_platf_route_cbarg_t /*e_route*/){
xbt_die("AS %s does not accept new bypass routes (wrong class).",name_);
}
simgrid::surf::NetCard *sg_netcard_by_name_or_null(const char *name)
{
sg_host_t h = sg_host_by_name(name);
- simgrid::surf::NetCard *net_elm = h==NULL?NULL: h->pimpl_netcard;
- if (!net_elm)
- net_elm = (simgrid::surf::NetCard*) xbt_lib_get_or_null(as_router_lib, name, ROUTING_ASR_LEVEL);
- return net_elm;
+ simgrid::surf::NetCard *netcard = h==NULL ? NULL: h->pimpl_netcard;
+ if (!netcard)
+ netcard = (simgrid::surf::NetCard*) xbt_lib_get_or_null(as_router_lib, name, ROUTING_ASR_LEVEL);
+ return netcard;
}
/* Global vars */
{
XBT_DEBUG("routing_AS_begin");
- xbt_assert(NULL == xbt_lib_get_or_null(as_router_lib, AS->id, ROUTING_ASR_LEVEL),
+ xbt_assert(nullptr == xbt_lib_get_or_null(as_router_lib, AS->id, ROUTING_ASR_LEVEL),
"Refusing to create a second AS called \"%s\".", AS->id);
_sg_cfg_init_status = 2; /* HACK: direct access to the global controlling the level of configuration to prevent
THROWF(arg_error, 0, "All defined components must belong to a AS");
}
- xbt_lib_set(as_router_lib, netcard->name(), ROUTING_ASR_LEVEL,
- (void *) netcard);
+ xbt_lib_set(as_router_lib, netcard->name(), ROUTING_ASR_LEVEL, (void *) netcard);
XBT_DEBUG("Having set name '%s' id '%d'", new_as->name_, netcard->id());
/* set the new current component of the tree */
* \param dst the destination host name
* \param *route the route where the links are stored. It is either NULL or a ready to use dynar
* \param *latency the latency, if needed
- *
- * This function is called by "get_route" and "get_latency". It allows to walk recursively through the ASes tree.
*/
static void _get_route_and_latency(simgrid::surf::NetCard *src, simgrid::surf::NetCard *dst,
xbt_dynar_t * links, double *latency)
}
}
-e_surf_network_element_type_t routing_get_network_element_type(const char *name)
-{
- simgrid::surf::NetCard *rc = sg_netcard_by_name_or_null(name);
- if (rc)
- return rc->getRcType();
-
- return SURF_NETWORK_ELEMENT_NULL;
-}
-
/** @brief create the root AS */
void routing_model_create( void *loopback)
{