3 /* gras_addons - several addons to do specific stuff not in GRAS itself */
5 /* Copyright (c) 2003, 2004 Martin Quinson. All rights reserved. */
7 /* This program is free software; you can redistribute it and/or modify it
8 * under the terms of the license (GNU LGPL) which comes with this package. */
15 #define HOSTNAME_LEN 256
18 /* ****************************************************************************
19 * The common types used as payload in the messages and their definitions
20 * ****************************************************************************/
25 * Description of an host
29 char host[HOSTNAME_LEN];
33 static const DataDescriptor msgHostDesc[] =
34 { SIMPLE_MEMBER(CHAR_TYPE,HOSTNAME_LEN,offsetof(msgHost_t,host)),
35 SIMPLE_MEMBER(UNSIGNED_INT_TYPE,1, offsetof(msgHost_t,port))};
41 * how to indicate an eventual error
45 char errmsg[ERRMSG_LEN];
49 static const DataDescriptor msgErrorDesc[] =
50 { SIMPLE_MEMBER(CHAR_TYPE, ERRMSG_LEN,offsetof(msgError_t,errmsg)),
51 SIMPLE_MEMBER(UNSIGNED_INT_TYPE, 1, offsetof(msgError_t,errcode))};
57 * how to report the result of an experiment
61 unsigned int timestamp;
65 static const DataDescriptor msgResultDesc[] =
66 { SIMPLE_MEMBER(UNSIGNED_INT_TYPE, 1, offsetof(msgResult_t,timestamp)),
67 SIMPLE_MEMBER(DOUBLE_TYPE, 1, offsetof(msgResult_t,value))};
68 #define msgResultLen 2
73 * Repports an error to the process listening on socket sock.
75 * The information will be embeeded in a message of type id, which must take a msgError_t as first
76 * sequence (and SeqCount sequences in total). Other sequences beside the error one will be of
79 * The message will be builded as sprintf would, using the given format and extra args.
81 * If the message cannot be builded and sent to recipient, the string severeError will be printed
82 * on localhost's stderr.
85 grasRepportError (gras_socket_t *sock, int id, int SeqCount,
86 const char *severeError,
87 xbt_error_t errcode, const char* format,...);
89 #endif /* GRAS_ADDONS_H */