Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
ea7141ea3a21ee1f5ce7529cc834f3e22c805c36
[simgrid.git] / examples / msg / chainsend / messages.h
1 #ifndef KADEPLOY_MESSAGES_H
2 #define KADEPLOY_MESSAGES_H
3
4 #include "msg/msg.h"
5 #include "xbt/sysdep.h"
6
7 #define MESSAGE_BUILD_CHAIN_SIZE 40
8 #define MESSAGE_SEND_DATA_HEADER_SIZE 1
9 #define MESSAGE_END_DATA_SIZE 1
10
11 /* Messages enum */
12 typedef enum {
13   MESSAGE_BUILD_CHAIN = 0,
14   MESSAGE_SEND_DATA
15 } e_message_type;
16
17 /* Message struct */
18 typedef struct s_message {
19   e_message_type type;
20   char *issuer_hostname;
21   char *mailbox;
22   char *prev_hostname;
23   char *next_hostname;
24   const char *data_block;
25   unsigned int data_length;
26   unsigned int num_pieces;
27 } s_message_t, *message_t;
28
29 /* Message methods */
30 msg_task_t task_message_new(e_message_type type, unsigned int len, const char *issuer_hostname, const char *mailbox);
31 msg_task_t task_message_chain_new(const char *issuer_hostname, const char *mailbox, const char* prev, const char *next, const unsigned int num_pieces);
32 msg_task_t task_message_data_new(const char *issuer_hostname, const char *mailbox, const char *block, unsigned int len);
33 void task_message_delete(void *);
34
35 #endif /* KADEPLOY_MESSAGES_H */