Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Removing RngStream
[simgrid.git] / teshsuite / msg / app-bittorrent / bittorrent.c
1 /* Copyright (c) 2012-2019. The SimGrid Team. All rights reserved.          */
2
3 /* This program is free software; you can redistribute it and/or modify it
4  * under the terms of the license (GNU LGPL) which comes with this package. */
5
6 #include "bittorrent.h"
7 #include "bittorrent-peer.h"
8 #include "tracker.h"
9 #include <simgrid/msg.h>
10
11 #include <stdio.h> /* snprintf */
12
13 /** Bittorrent example launcher */
14 int main(int argc, char* argv[])
15 {
16   msg_host_t host;
17   unsigned i;
18
19   MSG_init(&argc, argv);
20
21   /* Check the arguments */
22   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file", argv[0]);
23
24   MSG_create_environment(argv[1]);
25
26   xbt_dynar_t host_list = MSG_hosts_as_dynar();
27   xbt_dynar_foreach (host_list, i, host) {
28     char descr[512];
29     snprintf(descr, sizeof descr, "RngSream<%s>", MSG_host_get_name(host));
30   }
31
32   MSG_function_register("tracker", tracker);
33   MSG_function_register("peer", peer);
34
35   MSG_launch_application(argv[2]);
36
37   MSG_main();
38
39   xbt_dynar_free(&host_list);
40
41   return 0;
42 }