aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_testbed_service.h
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-08-30 14:55:13 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-08-30 14:55:13 +0000
commit5e1efe185cf484018f53dd33d64e546ac042fdee (patch)
treee1369e8e1a239426d4ba2d81bb31571bbd4f82eb /src/include/gnunet_testbed_service.h
parent7d8d536bbaa0f72587552af517f643e3c05e7a6f (diff)
downloadgnunet-5e1efe185cf484018f53dd33d64e546ac042fdee.tar.gz
gnunet-5e1efe185cf484018f53dd33d64e546ac042fdee.zip
- towards testbed barriers
Diffstat (limited to 'src/include/gnunet_testbed_service.h')
-rw-r--r--src/include/gnunet_testbed_service.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/src/include/gnunet_testbed_service.h b/src/include/gnunet_testbed_service.h
index 6249707d9..173aa76b3 100644
--- a/src/include/gnunet_testbed_service.h
+++ b/src/include/gnunet_testbed_service.h
@@ -1471,6 +1471,63 @@ GNUNET_TESTBED_test_run (const char *testname,
1471 void *test_master_cls); 1471 void *test_master_cls);
1472 1472
1473 1473
1474/**
1475 * Opaque handle for barrier
1476 */
1477struct GNUNET_TESTBED_Barrier;
1478
1479
1480/**
1481 * Functions of this type are to be given as callback argument to
1482 * GNUNET_TESTBED_barrier_init(). The callback will be called when status
1483 * information is available for the barrier.
1484 *
1485 * @param cls the closure given to GNUNET_TESTBED_barrier_init()
1486 * @param name the name of the barrier
1487 * @param barrier the barrier handle
1488 * @param status status of the barrier; GNUNET_OK if the barrier is crossed;
1489 * GNUNET_SYSERR upon error
1490 * @param emsg if the status were to be GNUNET_SYSERR, this parameter has the
1491 * error messsage
1492 */
1493typedef void (*GNUNET_TESTBED_barrier_status_cb) (void *cls,
1494 const char *name,
1495 struct GNUNET_TESTBED_Barrier
1496 *barrier,
1497 int status,
1498 const char *emsg);
1499
1500
1501/**
1502 * Initialise a barrier and call the given callback when the required percentage
1503 * of peers (quorum) reach the barrier.
1504 *
1505 * @param controller the handle to the controller
1506 * @param name identification name of the barrier
1507 * @param quorum the percentage of peers that is required to reach the barrier.
1508 * Peers signal reaching a barrier by calling
1509 * GNUNET_TESTBED_barrier_reached().
1510 * @param cb the callback to call when the barrier is reached or upon error.
1511 * Cannot be NULL.
1512 * @param cls closure for the above callback
1513 * @return barrier handle
1514 */
1515struct GNUNET_TESTBED_Barrier *
1516GNUNET_TESTBED_barrier_init (struct GNUNET_TESTBED_Controller *controller,
1517 const char *name,
1518 unsigned int quorum,
1519 GNUNET_TESTBED_barrier_status_cb cb, void *cls);
1520
1521
1522/**
1523 * Cancel a barrier.
1524 *
1525 * @param barrier the barrier handle
1526 */
1527void
1528GNUNET_TESTBED_barrier_cancel (struct GNUNET_TESTBED_Barrier *barrier);
1529
1530
1474#if 0 /* keep Emacsens' auto-indent happy */ 1531#if 0 /* keep Emacsens' auto-indent happy */
1475{ 1532{
1476#endif 1533#endif