Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge pull request #1 from mquinson/master
[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 "src/surf/surf_private.h"
10
11 extern routing_platf_t routing_platf;
12
13 int main(int argc, char **argv)
14 {
15   /* SD initialization */
16   int size;
17   xbt_lib_cursor_t cursor = NULL;
18   char *key, *data;
19
20 #ifdef _XBT_WIN32
21   setbuf(stderr, NULL);
22   setbuf(stdout, NULL);
23 #endif
24
25   SD_init(&argc, argv);
26
27   /* creation of the environment */
28   SD_create_environment(argv[1]);
29
30   size = xbt_dict_length(host_list) + xbt_lib_length(as_router_lib);
31
32   printf("Workstation number: %zu, link number: %d, elmts number: %d\n",
33          sg_host_count(), sg_link_count(), size);
34
35   xbt_dict_foreach(host_list, cursor, key, data) {
36     printf("   - Seen: \"%s\" is type : %d\n", key,
37            (int) routing_get_network_element_type(key));
38   }
39
40   xbt_lib_foreach(as_router_lib, cursor, key, data) {
41     printf("   - Seen: \"%s\" is type : %d\n", key,
42            (int) routing_get_network_element_type(key));
43   }
44
45   SD_exit();
46   return 0;
47 }