diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-06-27 14:08:01 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-06-27 14:08:01 +0000 |
commit | 02a21c4dcaae82d610630036d3ea4921723504f9 (patch) | |
tree | b41d48e6d14a06e540500c6e6a41c8a1ec39b8c9 /src | |
parent | 24680d0c69d4a14e207b20051c34ee48dbafdc1f (diff) | |
download | gnunet-02a21c4dcaae82d610630036d3ea4921723504f9.tar.gz gnunet-02a21c4dcaae82d610630036d3ea4921723504f9.zip |
move functions unrelated to TESTBED_BarrierWaitHandle out of testbed_api_barriers.c
Diffstat (limited to 'src')
-rw-r--r-- | src/testbed/Makefile.am | 2 | ||||
-rw-r--r-- | src/testbed/gnunet-service-testbed_barriers.c | 2 | ||||
-rw-r--r-- | src/testbed/testbed_api.c | 1 | ||||
-rw-r--r-- | src/testbed/testbed_api.h | 37 | ||||
-rw-r--r-- | src/testbed/testbed_api_barriers.c | 4 | ||||
-rw-r--r-- | src/testbed/testbed_api_barriers.h | 68 |
6 files changed, 40 insertions, 74 deletions
diff --git a/src/testbed/Makefile.am b/src/testbed/Makefile.am index b5a7758f0..9c1bfcce6 100644 --- a/src/testbed/Makefile.am +++ b/src/testbed/Makefile.am | |||
@@ -45,7 +45,7 @@ gnunet_service_testbed_SOURCES = \ | |||
45 | gnunet-service-testbed_oc.c \ | 45 | gnunet-service-testbed_oc.c \ |
46 | gnunet-service-testbed_cpustatus.c \ | 46 | gnunet-service-testbed_cpustatus.c \ |
47 | gnunet-service-testbed_meminfo.c gnunet-service-testbed_meminfo.h \ | 47 | gnunet-service-testbed_meminfo.c gnunet-service-testbed_meminfo.h \ |
48 | gnunet-service-testbed_barriers.c gnunet-service-testbed_barriers.h \ | 48 | gnunet-service-testbed_barriers.c \ |
49 | gnunet-service-testbed_connectionpool.c gnunet-service-testbed_connectionpool.h | 49 | gnunet-service-testbed_connectionpool.c gnunet-service-testbed_connectionpool.h |
50 | gnunet_service_testbed_LDADD = $(XLIB) \ | 50 | gnunet_service_testbed_LDADD = $(XLIB) \ |
51 | $(top_builddir)/src/util/libgnunetutil.la \ | 51 | $(top_builddir)/src/util/libgnunetutil.la \ |
diff --git a/src/testbed/gnunet-service-testbed_barriers.c b/src/testbed/gnunet-service-testbed_barriers.c index 5b081ed12..d8545ad04 100644 --- a/src/testbed/gnunet-service-testbed_barriers.c +++ b/src/testbed/gnunet-service-testbed_barriers.c | |||
@@ -26,7 +26,7 @@ | |||
26 | 26 | ||
27 | #include "gnunet-service-testbed.h" | 27 | #include "gnunet-service-testbed.h" |
28 | #include "gnunet-service-testbed_barriers.h" | 28 | #include "gnunet-service-testbed_barriers.h" |
29 | #include "testbed_api_barriers.h" | 29 | #include "testbed_api.h" |
30 | 30 | ||
31 | 31 | ||
32 | /** | 32 | /** |
diff --git a/src/testbed/testbed_api.c b/src/testbed/testbed_api.c index 67b1e8c96..9b8066412 100644 --- a/src/testbed/testbed_api.c +++ b/src/testbed/testbed_api.c | |||
@@ -36,7 +36,6 @@ | |||
36 | 36 | ||
37 | #include "testbed.h" | 37 | #include "testbed.h" |
38 | #include "testbed_api.h" | 38 | #include "testbed_api.h" |
39 | #include "testbed_api_barriers.h" | ||
40 | #include "testbed_api_hosts.h" | 39 | #include "testbed_api_hosts.h" |
41 | #include "testbed_api_peers.h" | 40 | #include "testbed_api_peers.h" |
42 | #include "testbed_api_operations.h" | 41 | #include "testbed_api_operations.h" |
diff --git a/src/testbed/testbed_api.h b/src/testbed/testbed_api.h index 7a8e6539a..cd3358c9a 100644 --- a/src/testbed/testbed_api.h +++ b/src/testbed/testbed_api.h | |||
@@ -505,5 +505,42 @@ GNUNET_TESTBED_get_slave_config_ (void *op_cls, | |||
505 | uint32_t slave_host_id); | 505 | uint32_t slave_host_id); |
506 | 506 | ||
507 | 507 | ||
508 | |||
509 | /** | ||
510 | * Initialise a barrier and call the given callback when the required percentage | ||
511 | * of peers (quorum) reach the barrier OR upon error. | ||
512 | * | ||
513 | * @param controller the handle to the controller | ||
514 | * @param name identification name of the barrier | ||
515 | * @param quorum the percentage of peers that is required to reach the barrier. | ||
516 | * Peers signal reaching a barrier by calling | ||
517 | * GNUNET_TESTBED_barrier_reached(). | ||
518 | * @param cb the callback to call when the barrier is reached or upon error. | ||
519 | * Cannot be NULL. | ||
520 | * @param cls closure for the above callback | ||
521 | * @param echo #GNUNET_YES to echo the barrier crossed status message back to the | ||
522 | * controller | ||
523 | * @return barrier handle; NULL upon error | ||
524 | */ | ||
525 | struct GNUNET_TESTBED_Barrier * | ||
526 | GNUNET_TESTBED_barrier_init_ (struct GNUNET_TESTBED_Controller *controller, | ||
527 | const char *name, | ||
528 | unsigned int quorum, | ||
529 | GNUNET_TESTBED_barrier_status_cb cb, | ||
530 | void *cls, | ||
531 | int echo); | ||
532 | |||
533 | |||
534 | /** | ||
535 | * Remove a barrier and it was the last one in the barrier hash map, destroy the | ||
536 | * hash map | ||
537 | * | ||
538 | * @param barrier the barrier to remove | ||
539 | */ | ||
540 | void | ||
541 | GNUNET_TESTBED_barrier_remove_ (struct GNUNET_TESTBED_Barrier *barrier); | ||
542 | |||
543 | |||
544 | |||
508 | #endif | 545 | #endif |
509 | /* end of testbed_api.h */ | 546 | /* end of testbed_api.h */ |
diff --git a/src/testbed/testbed_api_barriers.c b/src/testbed/testbed_api_barriers.c index deb8ca97f..527a86554 100644 --- a/src/testbed/testbed_api_barriers.c +++ b/src/testbed/testbed_api_barriers.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2008--2013 GNUnet e.V. | 3 | Copyright (C) 2008--2013, 2016 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -23,11 +23,9 @@ | |||
23 | * @brief API implementation for testbed barriers | 23 | * @brief API implementation for testbed barriers |
24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | 24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> |
25 | */ | 25 | */ |
26 | |||
27 | #include "platform.h" | 26 | #include "platform.h" |
28 | #include "gnunet_testbed_service.h" | 27 | #include "gnunet_testbed_service.h" |
29 | #include "testbed_api.h" | 28 | #include "testbed_api.h" |
30 | #include "testbed_api_barriers.h" | ||
31 | 29 | ||
32 | /** | 30 | /** |
33 | * Logging shorthand | 31 | * Logging shorthand |
diff --git a/src/testbed/testbed_api_barriers.h b/src/testbed/testbed_api_barriers.h deleted file mode 100644 index b839a4ce4..000000000 --- a/src/testbed/testbed_api_barriers.h +++ /dev/null | |||
@@ -1,68 +0,0 @@ | |||
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 | ||
6 | it under the terms of the GNU General Public License as published | ||
7 | by the Free Software Foundation; either version 3, or (at your | ||
8 | 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 | General Public License for more details. | ||
14 | |||
15 | You should have received a copy of the GNU General Public License | ||
16 | along with GNUnet; see the file COPYING. If not, write to the | ||
17 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
18 | Boston, MA 02110-1301, USA. | ||
19 | */ | ||
20 | |||
21 | /** | ||
22 | * @file testbed/testbed_api_barriers.h | ||
23 | * @brief interface for barriers API function that are used internally (not | ||
24 | * exposed as user API) | ||
25 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | ||
26 | */ | ||
27 | #ifndef TESTBED_API_BARRIERS_H | ||
28 | #define TESTBED_API_BARRIERS_H | ||
29 | |||
30 | #include "gnunet_testbed_service.h" | ||
31 | |||
32 | |||
33 | /** | ||
34 | * Initialise a barrier and call the given callback when the required percentage | ||
35 | * of peers (quorum) reach the barrier OR upon error. | ||
36 | * | ||
37 | * @param controller the handle to the controller | ||
38 | * @param name identification name of the barrier | ||
39 | * @param quorum the percentage of peers that is required to reach the barrier. | ||
40 | * Peers signal reaching a barrier by calling | ||
41 | * GNUNET_TESTBED_barrier_reached(). | ||
42 | * @param cb the callback to call when the barrier is reached or upon error. | ||
43 | * Cannot be NULL. | ||
44 | * @param cls closure for the above callback | ||
45 | * @param echo #GNUNET_YES to echo the barrier crossed status message back to the | ||
46 | * controller | ||
47 | * @return barrier handle; NULL upon error | ||
48 | */ | ||
49 | struct GNUNET_TESTBED_Barrier * | ||
50 | GNUNET_TESTBED_barrier_init_ (struct GNUNET_TESTBED_Controller *controller, | ||
51 | const char *name, | ||
52 | unsigned int quorum, | ||
53 | GNUNET_TESTBED_barrier_status_cb cb, | ||
54 | void *cls, | ||
55 | int echo); | ||
56 | |||
57 | |||
58 | /** | ||
59 | * Remove a barrier and it was the last one in the barrier hash map, destroy the | ||
60 | * hash map | ||
61 | * | ||
62 | * @param barrier the barrier to remove | ||
63 | */ | ||
64 | void | ||
65 | GNUNET_TESTBED_barrier_remove_ (struct GNUNET_TESTBED_Barrier *barrier); | ||
66 | |||
67 | |||
68 | #endif | ||