X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0f123dd4d0d60d0c57bcae6f3629c83e32549b39..4cc3a40d551a1480c31732dcc91adefc127801aa:/examples/msg/bittorrent/messages.h diff --git a/examples/msg/bittorrent/messages.h b/examples/msg/bittorrent/messages.h index 342df0f800..507364057a 100644 --- a/examples/msg/bittorrent/messages.h +++ b/examples/msg/bittorrent/messages.h @@ -11,54 +11,66 @@ * Types of messages exchanged between two peers. */ typedef enum { - MESSAGE_HANDSHAKE, - MESSAGE_CHOKE, - MESSAGE_UNCHOKE, - MESSAGE_INTERESTED, - MESSAGE_NOTINTERESTED, - MESSAGE_HAVE, - MESSAGE_BITFIELD, - MESSAGE_REQUEST, - MESSAGE_PIECE + MESSAGE_HANDSHAKE, + MESSAGE_CHOKE, + MESSAGE_UNCHOKE, + MESSAGE_INTERESTED, + MESSAGE_NOTINTERESTED, + MESSAGE_HAVE, + MESSAGE_BITFIELD, + MESSAGE_REQUEST, + MESSAGE_PIECE } e_message_type; /** * Message data */ typedef struct s_message { - e_message_type type; - const char *mailbox; - const char *issuer_host_name; - int peer_id; - char *bitfield; - int index; - int block_index; - int block_length; - int stalled:1; + e_message_type type; + const char *mailbox; + const char *issuer_host_name; + int peer_id; + char *bitfield; + int index; + int block_index; + int block_length; + int stalled:1; } s_message_t, *message_t; /** * Builds a new value-less message */ -XBT_INLINE msg_task_t task_message_new(e_message_type type, const char *issuer_host_name, const char *mailbox, int peer_id); +msg_task_t task_message_new(e_message_type type, + const char *issuer_host_name, + const char *mailbox, int peer_id); /** * Builds a new "have/piece" message */ -XBT_INLINE msg_task_t task_message_index_new(e_message_type type, const char *issuer_host_name, const char *mailbox, int peer_id, int index); +msg_task_t task_message_index_new(e_message_type type, + const char *issuer_host_name, + const char *mailbox, int peer_id, + int index); /** * Builds a new bitfield message */ -msg_task_t task_message_bitfield_new(const char *issuer_host_name, const char *mailbox, int peer_id, char *bitfield); +msg_task_t task_message_bitfield_new(const char *issuer_host_name, + const char *mailbox, int peer_id, + char *bitfield); /** * Builds a new "request" message */ -msg_task_t task_message_request_new(const char *issuer_host_name, const char *mailbox, int peer_id, int index, int block_index, int block_length); +msg_task_t task_message_request_new(const char *issuer_host_name, + const char *mailbox, int peer_id, int index, + int block_index, int block_length); /** * Build a new "piece" message */ -msg_task_t task_message_piece_new(const char *issuer_host_name, const char *mailbox, int peer_id, int index, int stalled, int block_index, int block_length); +msg_task_t task_message_piece_new(const char *issuer_host_name, + const char *mailbox, int peer_id, int index, + int stalled, int block_index, + int block_length); /** * Free a message task */ -void task_message_free(void*); -#endif /* BITTORRENT_MESSAGES_H_ */ +void task_message_free(void *); +#endif /* BITTORRENT_MESSAGES_H_ */