X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f2d416e568c637bec46247643265b22045e6eed3:/examples/msg/app-bittorrent/connection.h..fad318e69b9130ad51b5bcff09362b1f162f5270:/teshsuite/msg/app-bittorrent/connection.h diff --git a/examples/msg/app-bittorrent/connection.h b/teshsuite/msg/app-bittorrent/connection.h similarity index 62% rename from examples/msg/app-bittorrent/connection.h rename to teshsuite/msg/app-bittorrent/connection.h index cd3362014f..2b64528b7e 100644 --- a/examples/msg/app-bittorrent/connection.h +++ b/teshsuite/msg/app-bittorrent/connection.h @@ -9,20 +9,20 @@ /** Contains the connection data of a peer. */ typedef struct s_connection { - int id; //Peer id - unsigned int bitfield; //Fields - char *mailbox; + int id; // Peer id + unsigned int bitfield; // Fields + char* mailbox; int messages_count; double peer_speed; double last_unchoke; int current_piece; - unsigned int am_interested:1; //Indicates if we are interested in something the peer has - unsigned int interested:1; //Indicates if the peer is interested in one of our pieces - unsigned int choked_upload:1; //Indicates if the peer is choked for the current peer - unsigned int choked_download:1; //Indicates if the peer has choked the current peer + unsigned int am_interested : 1; // Indicates if we are interested in something the peer has + unsigned int interested : 1; // Indicates if the peer is interested in one of our pieces + unsigned int choked_upload : 1; // Indicates if the peer is choked for the current peer + unsigned int choked_download : 1; // Indicates if the peer has choked the current peer } s_connection_t; -typedef s_connection_t *connection_t; +typedef s_connection_t* connection_t; /** @brief Build a new connection object from the peer id. * @param id id of the peer @@ -34,6 +34,6 @@ connection_t connection_new(int id); */ void connection_add_speed_value(connection_t connection, double speed); /** Frees a connection object */ -void connection_free(void *data); +void connection_free(void* data); int connection_has_piece(connection_t connection, unsigned int piece); -#endif /* BITTORRENT_CONNECTION_H_ */ +#endif /* BITTORRENT_CONNECTION_H_ */