Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Basic infrastructure for a real model-checker process
[simgrid.git] / src / mc / mc_protocol.h
1 /* Copyright (c) 2015. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef MC_PROTOCOL_H
8 #define MC_PROTOCOL_H
9
10 #include <xbt/misc.h>
11
12 SG_BEGIN_DECL()
13
14 // ***** Environment variables for passing context to the model-checked process
15
16 /** Environment variable name set by `simgrid-mc` to enable MC support in the
17  *  children MC processes
18  */
19 #define MC_ENV_VARIABLE "SIMGRIC_MC"
20
21 /** Environment variable name used to pass the communication socket */
22 #define MC_ENV_SOCKET_FD "SIMGRID_MC_SOCKET_FD"
23
24 // ***** Messages
25
26 enum {
27   MC_MESSAGE_NONE = 0,
28   MC_MESSAGE_HELLO = 1,
29   MC_MESSAGE_CONTINUE = 2,
30 };
31
32 typedef struct s_mc_message {
33   int type;
34 } s_mc_message_t, *mc_message_t;
35
36 /**
37  *  @return errno
38  */
39 int MC_protocol_send_simple_message(int socket, int type);
40 int MC_protocol_hello(int socket);
41
42 SG_END_DECL()
43
44 #endif