1 /* Copyright (c) 2012-2015. 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 #ifndef KADEPLOY_PEER_H
8 #define KADEPLOY_PEER_H
10 #include "simgrid/msg.h"
11 #include "xbt/sysdep.h"
16 #define PEER_SHUTDOWN_DEADLINE 60000
19 typedef struct s_peer {
25 unsigned long long bytes;
26 xbt_dynar_t pending_recvs;
27 xbt_dynar_t pending_sends;
28 unsigned int total_pieces;
31 /* Peer: helper functions */
32 msg_error_t peer_wait_for_message(peer_t peer);
33 int peer_execute_task(peer_t peer, msg_task_t task);
34 void peer_init_chain(peer_t peer, message_t msg);
35 void peer_delete(peer_t p);
36 void peer_shutdown(peer_t p);
37 void peer_init(peer_t p, int argc, char *argv[]);
38 void peer_print_stats(peer_t p, float elapsed_time);
40 int peer(int argc, char *argv[]);
42 #endif /* KADEPLOY_PEER_H */