Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
this file got renamed in the tesh
[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   MESSAGE_END_DATA
16 } e_message_type;
17
18 /* Message struct */
19 typedef struct s_message {
20   e_message_type type;
21   const char *issuer_hostname;
22   const char *mailbox;
23   const char *prev_hostname;
24   const char *next_hostname;
25   const char *data_block;
26   unsigned int data_length;
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);
32 msg_task_t task_message_data_new(const char *issuer_hostname, const char *mailbox, const char *block, unsigned int len);
33 msg_task_t task_message_end_data_new(const char *issuer_hostname, const char *mailbox);
34 void task_message_delete(void *);
35
36 #endif /* KADEPLOY_MESSAGES_H */