1 /* Copyright (c) 2009, 2010, 2011. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #include "surf_routing_private.h"
9 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_route_none, surf, "Routing part of surf");
11 static xbt_dynar_t none_get_onelink_routes(AS_t rc) {
15 static route_t none_get_route(AS_t rc,
16 const char *src, const char *dst)
21 static route_t none_get_bypass_route(AS_t rc,
27 static void none_parse_PU(AS_t rc, const char *name) {
28 /* don't care about PUs */
31 static void none_parse_AS(AS_t rc, const char *name) {
32 /* even don't care about sub-ASes */
35 /* Creation routing model functions */
36 AS_t model_none_create() {
37 return model_none_create_sized(sizeof(s_as_t));
39 AS_t model_none_create_sized(size_t childsize) {
40 AS_t new_component = xbt_malloc0(childsize);
41 new_component->parse_PU = none_parse_PU;
42 new_component->parse_AS = none_parse_AS;
43 new_component->parse_route = NULL;
44 new_component->parse_ASroute = NULL;
45 new_component->parse_bypassroute = NULL;
46 new_component->get_route = none_get_route;
47 new_component->get_onelink_routes = none_get_onelink_routes;
48 new_component->get_bypass_route = none_get_bypass_route;
49 new_component->finalize = model_none_finalize;
51 new_component->routing_sons = xbt_dict_new();
56 void model_none_finalize(AS_t as) {
57 xbt_dict_free(&as->routing_sons);