X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0f123dd4d0d60d0c57bcae6f3629c83e32549b39..613cd4ffa7ffbfdd4f21bf7ecb6053daf666b95e:/examples/msg/bittorrent/connection.h diff --git a/examples/msg/bittorrent/connection.h b/examples/msg/bittorrent/connection.h index 7647ef6ae7..418b638c2a 100644 --- a/examples/msg/bittorrent/connection.h +++ b/examples/msg/bittorrent/connection.h @@ -1,24 +1,26 @@ -/* Copyright (c) 2012. The SimGrid Team. +/* Copyright (c) 2012-2014. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ + #ifndef BITTORRENT_CONNECTION_H_ #define BITTORRENT_CONNECTION_H_ /** * Contains the connection data of a peer. */ typedef struct s_connection { - int id; //Peer id - char *bitfield; //Fields - char *mailbox; - int messages_count; - double peer_speed; - double last_unchoke; - int am_interested:1; //Indicates if we are interested in something the peer has - int interested:1; //Indicates if the peer is interested in one of our pieces - int choked_upload:1; //Indicates if the peer is choked for the current peer - int choked_download:1; //Indicates if the peer has choked the current peer + int id; //Peer id + char *bitfield; //Fields + char *mailbox; + int messages_count; + double peer_speed; + double last_unchoke; + int current_piece; + int am_interested:1; //Indicates if we are interested in something the peer has + int interested:1; //Indicates if the peer is interested in one of our pieces + int choked_upload:1; //Indicates if the peer is choked for the current peer + int choked_download:1; //Indicates if the peer has choked the current peer } s_connection_t, *connection_t; /** * Build a new connection object from the peer id. @@ -35,4 +37,4 @@ void connection_add_speed_value(connection_t connection, double speed); * Frees a connection object */ void connection_free(void *data); -#endif /* BITTORRENT_CONNECTION_H_ */ +#endif /* BITTORRENT_CONNECTION_H_ */