Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
56a3cc1cb484c3463cfd44b6f1f7252e8f60a27f
[simgrid.git] / examples / c / app-bittorrent / app-bittorrent.c
1 /* Copyright (c) 2012-2020. 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 "app-bittorrent.h"
7 #include "bittorrent-peer.h"
8 #include "tracker.h"
9
10 #include <simgrid/engine.h>
11 #include <xbt/asserts.h>
12
13 /** Bittorrent example launcher */
14 int main(int argc, char* argv[])
15 {
16   simgrid_init(&argc, argv);
17
18   /* Check the arguments */
19   xbt_assert(argc > 2, "Usage: %s platform_file deployment_file", argv[0]);
20
21   simgrid_load_platform(argv[1]);
22
23   simgrid_register_function("tracker", tracker);
24   simgrid_register_function("peer", peer);
25
26   simgrid_load_deployment(argv[2]);
27
28   simgrid_run();
29
30   return 0;
31 }