X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c882e24932c718fad85c22cb546f30e158f1b31d..5b3677b425b9cc6949c1573d59ac772540cbf4b2:/examples/msg/chainsend/messages.h diff --git a/examples/msg/chainsend/messages.h b/examples/msg/chainsend/messages.h index 44213051f2..b717d5c0dc 100644 --- a/examples/msg/chainsend/messages.h +++ b/examples/msg/chainsend/messages.h @@ -1,3 +1,9 @@ +/* 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 KADEPLOY_MESSAGES_H #define KADEPLOY_MESSAGES_H @@ -5,32 +11,29 @@ #include "xbt/sysdep.h" #define MESSAGE_BUILD_CHAIN_SIZE 40 -#define MESSAGE_SEND_DATA_HEADER_SIZE 10 -#define MESSAGE_END_DATA_SIZE 20 +#define MESSAGE_SEND_DATA_HEADER_SIZE 1 +#define MESSAGE_END_DATA_SIZE 1 /* Messages enum */ typedef enum { MESSAGE_BUILD_CHAIN = 0, - MESSAGE_SEND_DATA, - MESSAGE_END_DATA + MESSAGE_SEND_DATA } e_message_type; /* Message struct */ typedef struct s_message { e_message_type type; - const char *issuer_hostname; - const char *mailbox; - const char *prev_hostname; - const char *next_hostname; + char *prev_hostname; + char *next_hostname; const char *data_block; unsigned int data_length; + unsigned int num_pieces; } s_message_t, *message_t; /* Message methods */ -msg_task_t task_message_new(e_message_type type, unsigned int len, const char *issuer_hostname, const char *mailbox); -msg_task_t task_message_chain_new(const char *issuer_hostname, const char *mailbox, const char* prev, const char *next); -msg_task_t task_message_data_new(const char *issuer_hostname, const char *mailbox, const char *block, unsigned int len); -msg_task_t task_message_end_data_new(const char *issuer_hostname, const char *mailbox); +msg_task_t task_message_new(e_message_type type, unsigned int len); +msg_task_t task_message_chain_new(const char* prev, const char *next, const unsigned int num_pieces); +msg_task_t task_message_data_new(const char *block, unsigned int len); void task_message_delete(void *); #endif /* KADEPLOY_MESSAGES_H */