Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cb89fab6662f79f5e93a17e4309f6215ffc07d29
[simgrid.git] / teshsuite / simdag / platforms / is_router_test.c
1 /* Copyright (c) 2008-2015. The SimGrid Team.
2  * All rights reserved.                                                     */
3
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. */
6
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include "simgrid/simdag.h"
10 #include "surf/surf.h"
11
12 int main(int argc, char **argv)
13 {
14   /* SD initialization */
15   int size;
16   xbt_lib_cursor_t cursor = NULL;
17   char *key, *data;
18
19   SD_init(&argc, argv);
20
21   /* creation of the environment */
22   SD_create_environment(argv[1]);
23
24   size = xbt_dict_length(host_list) + xbt_lib_length(as_router_lib);
25
26   printf("Workstation number: %zu, link number: %d, elmts number: %d\n", sg_host_count(), sg_link_count(), size);
27
28   xbt_dict_foreach(host_list, cursor, key, data)
29     printf("   - Seen: \"%s\" is type : %d\n", key, (int) routing_get_network_element_type(key));
30
31   xbt_lib_foreach(as_router_lib, cursor, key, data)
32     printf("   - Seen: \"%s\" is type : %d\n", key, (int) routing_get_network_element_type(key));
33
34   SD_exit();
35   return 0;
36 }