Merge branch 'master' of gnunet.org:gnunet
[oweals/gnunet.git] / src / testbed / gnunet-service-testbed_barriers.h
1 /*
2   This file is part of GNUnet.
3   Copyright (C) 2008--2013 GNUnet e.V.
4
5   GNUnet is free software: you can redistribute it and/or modify it
6   under the terms of the GNU Affero General Public License as published
7   by the Free Software Foundation, either version 3 of the License,
8   or (at your option) any later version.
9
10   GNUnet is distributed in the hope that it will be useful, but
11   WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13   Affero General Public License for more details.
14  
15   You should have received a copy of the GNU Affero General Public License
16   along with this program.  If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 /**
20  * @file testbed/gnunet-service-testbed_barriers.h
21  * @brief Interface for the barrier initialisation handler routine
22  * @author Sree Harsha Totakura <sreeharsha@totakura.in>
23  */
24
25 #ifndef GNUNET_SERVER_TESTBED_BARRIERS_H_
26 #define GNUNET_SERVER_TESTBED_BARRIERS_H_
27
28 /**
29  * Function to initialise barrriers component
30  *
31  * @param cfg the configuration to use for initialisation
32  */
33 void
34 GST_barriers_init (struct GNUNET_CONFIGURATION_Handle *cfg);
35
36
37 /**
38  * Function to stop the barrier service
39  */
40 void
41 GST_barriers_destroy (void);
42
43
44 /**
45  * Check #GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_INIT messages.
46  *
47  * @param cls identification of the client
48  * @param msg the actual message
49  * @return #GNUNET_OK if @a msg is well-formed
50  */
51 int
52 check_barrier_init (void *cls,
53                     const struct GNUNET_TESTBED_BarrierInit *msg);
54
55
56 /**
57  * Message handler for #GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_INIT messages.  This
58  * message should always come from a parent controller or the testbed API if we
59  * are the root controller.
60  *
61  * This handler is queued in the main service and will handle the messages sent
62  * either from the testbed driver or from a high level controller
63  *
64  * @param cls identification of the client
65  * @param msg the actual message
66  */
67 void
68 handle_barrier_init (void *cls,
69                      const struct GNUNET_TESTBED_BarrierInit *msg);
70
71
72 /**
73  * Check #GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_CANCEL messages.
74  *
75  * @param cls identification of the client
76  * @param msg the actual message
77  * @return #GNUNET_OK if @a msg is well-formed
78  */
79 int
80 check_barrier_cancel (void *cls,
81                       const struct GNUNET_TESTBED_BarrierCancel *msg);
82
83
84 /**
85  * Message handler for #GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_CANCEL messages.  This
86  * message should always come from a parent controller or the testbed API if we
87  * are the root controller.
88  *
89  * This handler is queued in the main service and will handle the messages sent
90  * either from the testbed driver or from a high level controller
91  *
92  * @param cls identification of the client
93  * @param msg the actual message
94  */
95 void
96 handle_barrier_cancel (void *cls,
97                        const struct GNUNET_TESTBED_BarrierCancel *msg);
98
99
100 /**
101  * Check #GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_STATUS messages.
102  *
103  * @param cls identification of the client
104  * @param msg the actual message
105  * @return #GNUNET_OK if @a msg is well-formed
106  */
107 int
108 check_barrier_status (void *cls,
109                       const struct GNUNET_TESTBED_BarrierStatusMsg *msg);
110
111
112 /**
113  * Message handler for #GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_STATUS messages.
114  * This handler is queued in the main service and will handle the messages sent
115  * either from the testbed driver or from a high level controller
116  *
117  * @param cls identification of the client
118  * @param msg the actual message
119  */
120 void
121 handle_barrier_status (void *cls,
122                        const struct GNUNET_TESTBED_BarrierStatusMsg *msg);
123
124 #endif  /* GNUNET_SERVER_TESTBED_BARRIERS_H_ */
125
126 /* end of gnunet-service-testbed_barriers.h */