aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-06-25 20:14:33 +0000
committerChristian Grothoff <christian@grothoff.org>2016-06-25 20:14:33 +0000
commit98764c99d4e56c8520ac5d1f3a056649fa2137fc (patch)
tree1ae83e64fb230b39bba7a9571c0bbeb0b469f5f7 /src
parent4a381daf63c41550306834dc605378bb39afc6da (diff)
downloadgnunet-98764c99d4e56c8520ac5d1f3a056649fa2137fc.tar.gz
gnunet-98764c99d4e56c8520ac5d1f3a056649fa2137fc.zip
-doxygen
Diffstat (limited to 'src')
-rw-r--r--src/include/gnunet_testbed_service.h135
-rw-r--r--src/testbed/testbed_api_barriers.c15
2 files changed, 79 insertions, 71 deletions
diff --git a/src/include/gnunet_testbed_service.h b/src/include/gnunet_testbed_service.h
index 203985dca..7f9d25006 100644
--- a/src/include/gnunet_testbed_service.h
+++ b/src/include/gnunet_testbed_service.h
@@ -183,11 +183,10 @@ struct GNUNET_TESTBED_HostHabitableCheckHandle;
183 * given to GNUNET_TESTBED_is_host_habitable() is NULL 183 * given to GNUNET_TESTBED_is_host_habitable() is NULL
184 * @param status GNUNET_YES if it is habitable; GNUNET_NO if not 184 * @param status GNUNET_YES if it is habitable; GNUNET_NO if not
185 */ 185 */
186typedef void (*GNUNET_TESTBED_HostHabitableCallback) (void *cls, 186typedef void
187 const struct 187(*GNUNET_TESTBED_HostHabitableCallback) (void *cls,
188 GNUNET_TESTBED_Host 188 const struct GNUNET_TESTBED_Host *host,
189 *host, 189 int status);
190 int status);
191 190
192 191
193/** 192/**
@@ -419,8 +418,9 @@ struct GNUNET_TESTBED_EventInformation
419 * @param cls closure 418 * @param cls closure
420 * @param event information about the event 419 * @param event information about the event
421 */ 420 */
422typedef void (*GNUNET_TESTBED_ControllerCallback)(void *cls, 421typedef void
423 const struct GNUNET_TESTBED_EventInformation *event); 422(*GNUNET_TESTBED_ControllerCallback)(void *cls,
423 const struct GNUNET_TESTBED_EventInformation *event);
424 424
425 425
426/** 426/**
@@ -434,13 +434,14 @@ struct GNUNET_TESTBED_ControllerProc;
434 * 434 *
435 * @param cls the closure from GNUNET_TESTBED_controller_start() 435 * @param cls the closure from GNUNET_TESTBED_controller_start()
436 * @param cfg the configuration with which the controller has been started; 436 * @param cfg the configuration with which the controller has been started;
437 * NULL if status is not GNUNET_OK 437 * NULL if status is not #GNUNET_OK
438 * @param status GNUNET_OK if the startup is successfull; GNUNET_SYSERR if not, 438 * @param status #GNUNET_OK if the startup is successfull; #GNUNET_SYSERR if not,
439 * GNUNET_TESTBED_controller_stop() shouldn't be called in this case 439 * GNUNET_TESTBED_controller_stop() shouldn't be called in this case
440 */ 440 */
441typedef void (*GNUNET_TESTBED_ControllerStatusCallback) (void *cls, 441typedef void
442 const struct GNUNET_CONFIGURATION_Handle *cfg, 442(*GNUNET_TESTBED_ControllerStatusCallback) (void *cls,
443 int status); 443 const struct GNUNET_CONFIGURATION_Handle *cfg,
444 int status);
444 445
445 446
446/** 447/**
@@ -531,8 +532,9 @@ struct GNUNET_TESTBED_HostRegistrationHandle;
531 * @param cls the closure 532 * @param cls the closure
532 * @param emsg the error message; NULL if host registration is successful 533 * @param emsg the error message; NULL if host registration is successful
533 */ 534 */
534typedef void (* GNUNET_TESTBED_HostRegistrationCompletion) (void *cls, 535typedef void
535 const char *emsg); 536(* GNUNET_TESTBED_HostRegistrationCompletion) (void *cls,
537 const char *emsg);
536 538
537 539
538/** 540/**
@@ -579,11 +581,10 @@ GNUNET_TESTBED_cancel_registration (struct GNUNET_TESTBED_HostRegistrationHandle
579 * @param emsg error message in case the operation has failed; will be NULL if 581 * @param emsg error message in case the operation has failed; will be NULL if
580 * operation has executed successfully. 582 * operation has executed successfully.
581 */ 583 */
582typedef void (*GNUNET_TESTBED_OperationCompletionCallback) (void *cls, 584typedef void
583 struct 585(*GNUNET_TESTBED_OperationCompletionCallback) (void *cls,
584 GNUNET_TESTBED_Operation 586 struct GNUNET_TESTBED_Operation *op,
585 *op, 587 const char *emsg);
586 const char *emsg);
587 588
588 589
589/** 590/**
@@ -652,9 +653,10 @@ GNUNET_TESTBED_get_slave_config (void *op_cls,
652 * creation 653 * creation
653 * @param emsg NULL if peer is not NULL; else MAY contain the error description 654 * @param emsg NULL if peer is not NULL; else MAY contain the error description
654 */ 655 */
655typedef void (*GNUNET_TESTBED_PeerCreateCallback) (void *cls, 656typedef void
656 struct GNUNET_TESTBED_Peer *peer, 657(*GNUNET_TESTBED_PeerCreateCallback) (void *cls,
657 const char *emsg); 658 struct GNUNET_TESTBED_Peer *peer,
659 const char *emsg);
658 660
659 661
660/** 662/**
@@ -701,8 +703,9 @@ GNUNET_TESTBED_peer_create (struct GNUNET_TESTBED_Controller *controller,
701 * @param cls the closure from GNUNET_TESTBED_peer_start/stop() 703 * @param cls the closure from GNUNET_TESTBED_peer_start/stop()
702 * @param emsg NULL on success; otherwise an error description 704 * @param emsg NULL on success; otherwise an error description
703 */ 705 */
704typedef void (*GNUNET_TESTBED_PeerChurnCallback) (void *cls, 706typedef void
705 const char *emsg); 707(*GNUNET_TESTBED_PeerChurnCallback) (void *cls,
708 const char *emsg);
706 709
707 710
708/** 711/**
@@ -780,13 +783,11 @@ struct GNUNET_TESTBED_PeerInformation
780 * @param emsg error message if the operation has failed; will be NULL if the 783 * @param emsg error message if the operation has failed; will be NULL if the
781 * operation is successfull 784 * operation is successfull
782 */ 785 */
783typedef void (*GNUNET_TESTBED_PeerInfoCallback) (void *cb_cls, 786typedef void
784 struct GNUNET_TESTBED_Operation 787(*GNUNET_TESTBED_PeerInfoCallback) (void *cb_cls,
785 *op, 788 struct GNUNET_TESTBED_Operation *op,
786 const struct 789 const struct GNUNET_TESTBED_PeerInformation *pinfo,
787 GNUNET_TESTBED_PeerInformation 790 const char *emsg);
788 *pinfo,
789 const char *emsg);
790 791
791 792
792/** 793/**
@@ -1208,8 +1209,9 @@ GNUNET_TESTBED_overlay_write_topology_to_file (struct GNUNET_TESTBED_Controller
1208 * from GNUNET_TESTBED_service_connect() 1209 * from GNUNET_TESTBED_service_connect()
1209 * @return service handle to return in 'op_result', NULL on error 1210 * @return service handle to return in 'op_result', NULL on error
1210 */ 1211 */
1211typedef void * (*GNUNET_TESTBED_ConnectAdapter)(void *cls, 1212typedef void *
1212 const struct GNUNET_CONFIGURATION_Handle *cfg); 1213(*GNUNET_TESTBED_ConnectAdapter)(void *cls,
1214 const struct GNUNET_CONFIGURATION_Handle *cfg);
1213 1215
1214 1216
1215/** 1217/**
@@ -1219,8 +1221,9 @@ typedef void * (*GNUNET_TESTBED_ConnectAdapter)(void *cls,
1219 * @param cls closure 1221 * @param cls closure
1220 * @param op_result service handle returned from the connect adapter 1222 * @param op_result service handle returned from the connect adapter
1221 */ 1223 */
1222typedef void (*GNUNET_TESTBED_DisconnectAdapter)(void *cls, 1224typedef void
1223 void *op_result); 1225(*GNUNET_TESTBED_DisconnectAdapter)(void *cls,
1226 void *op_result);
1224 1227
1225 1228
1226/** 1229/**
@@ -1232,14 +1235,11 @@ typedef void (*GNUNET_TESTBED_DisconnectAdapter)(void *cls,
1232 * @param emsg error message in case the operation has failed; will be NULL if 1235 * @param emsg error message in case the operation has failed; will be NULL if
1233 * operation has executed successfully. 1236 * operation has executed successfully.
1234 */ 1237 */
1235typedef void (*GNUNET_TESTBED_ServiceConnectCompletionCallback) (void *cls, 1238typedef void
1236 struct 1239(*GNUNET_TESTBED_ServiceConnectCompletionCallback) (void *cls,
1237 GNUNET_TESTBED_Operation 1240 struct GNUNET_TESTBED_Operation *op,
1238 *op, 1241 void *ca_result,
1239 void 1242 const char *emsg );
1240 *ca_result,
1241 const char
1242 *emsg );
1243 1243
1244 1244
1245/** 1245/**
@@ -1308,15 +1308,16 @@ GNUNET_TESTBED_operation_done (struct GNUNET_TESTBED_Operation *operation);
1308 * @param subsystem name of subsystem that created the statistic 1308 * @param subsystem name of subsystem that created the statistic
1309 * @param name the name of the datum 1309 * @param name the name of the datum
1310 * @param value the current value 1310 * @param value the current value
1311 * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not 1311 * @param is_persistent #GNUNET_YES if the value is persistent, #GNUNET_NO if not
1312 * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration 1312 * @return #GNUNET_OK to continue, #GNUNET_SYSERR to abort iteration
1313 */ 1313 */
1314typedef int (*GNUNET_TESTBED_StatisticsIterator) (void *cls, 1314typedef int
1315 const struct GNUNET_TESTBED_Peer *peer, 1315(*GNUNET_TESTBED_StatisticsIterator) (void *cls,
1316 const char *subsystem, 1316 const struct GNUNET_TESTBED_Peer *peer,
1317 const char *name, 1317 const char *subsystem,
1318 uint64_t value, 1318 const char *name,
1319 int is_persistent); 1319 uint64_t value,
1320 int is_persistent);
1320 1321
1321 1322
1322/** 1323/**
@@ -1524,17 +1525,17 @@ enum GNUNET_TESTBED_BarrierStatus
1524 * @param cls the closure given to GNUNET_TESTBED_barrier_init() 1525 * @param cls the closure given to GNUNET_TESTBED_barrier_init()
1525 * @param name the name of the barrier 1526 * @param name the name of the barrier
1526 * @param barrier the barrier handle 1527 * @param barrier the barrier handle
1527 * @param status status of the barrier; GNUNET_OK if the barrier is crossed; 1528 * @param status status of the barrier; #GNUNET_OK if the barrier is crossed;
1528 * GNUNET_SYSERR upon error 1529 * #GNUNET_SYSERR upon error
1529 * @param emsg if the status were to be GNUNET_SYSERR, this parameter has the 1530 * @param emsg if the status were to be #GNUNET_SYSERR, this parameter has the
1530 * error messsage 1531 * error messsage
1531 */ 1532 */
1532typedef void (*GNUNET_TESTBED_barrier_status_cb) (void *cls, 1533typedef void
1533 const char *name, 1534(*GNUNET_TESTBED_barrier_status_cb) (void *cls,
1534 struct GNUNET_TESTBED_Barrier 1535 const char *name,
1535 *barrier, 1536 struct GNUNET_TESTBED_Barrier *barrier,
1536 enum GNUNET_TESTBED_BarrierStatus status, 1537 enum GNUNET_TESTBED_BarrierStatus status,
1537 const char *emsg); 1538 const char *emsg);
1538 1539
1539 1540
1540/** 1541/**
@@ -1555,7 +1556,8 @@ struct GNUNET_TESTBED_Barrier *
1555GNUNET_TESTBED_barrier_init (struct GNUNET_TESTBED_Controller *controller, 1556GNUNET_TESTBED_barrier_init (struct GNUNET_TESTBED_Controller *controller,
1556 const char *name, 1557 const char *name,
1557 unsigned int quorum, 1558 unsigned int quorum,
1558 GNUNET_TESTBED_barrier_status_cb cb, void *cls); 1559 GNUNET_TESTBED_barrier_status_cb cb,
1560 void *cls);
1559 1561
1560 1562
1561/** 1563/**
@@ -1580,12 +1582,13 @@ struct GNUNET_TESTBED_BarrierWaitHandle;
1580 * 1582 *
1581 * @param cls closure pointer given to GNUNET_TESTBED_barrier_wait() 1583 * @param cls closure pointer given to GNUNET_TESTBED_barrier_wait()
1582 * @param name the barrier name 1584 * @param name the barrier name
1583 * @param status GNUNET_SYSERR in case of error while waiting for the barrier; 1585 * @param status #GNUNET_SYSERR in case of error while waiting for the barrier;
1584 * GNUNET_OK if the barrier is crossed 1586 * #GNUNET_OK if the barrier is crossed
1585 */ 1587 */
1586typedef void (*GNUNET_TESTBED_barrier_wait_cb) (void *cls, 1588typedef void
1587 const char *name, 1589(*GNUNET_TESTBED_barrier_wait_cb) (void *cls,
1588 int status); 1590 const char *name,
1591 int status);
1589 1592
1590 1593
1591/** 1594/**
diff --git a/src/testbed/testbed_api_barriers.c b/src/testbed/testbed_api_barriers.c
index fb70737be..824dbcdba 100644
--- a/src/testbed/testbed_api_barriers.c
+++ b/src/testbed/testbed_api_barriers.c
@@ -206,7 +206,8 @@ handle_barrier_status_ (struct GNUNET_TESTBED_Controller *c,
206 goto cleanup; 206 goto cleanup;
207 } 207 }
208 GNUNET_assert (NULL != barrier->cb); 208 GNUNET_assert (NULL != barrier->cb);
209 if ((GNUNET_YES == barrier->echo) && (GNUNET_TESTBED_BARRIERSTATUS_CROSSED == status)) 209 if ((GNUNET_YES == barrier->echo) &&
210 (GNUNET_TESTBED_BARRIERSTATUS_CROSSED == status))
210 GNUNET_TESTBED_queue_message_ (c, GNUNET_copy_message (&msg->header)); 211 GNUNET_TESTBED_queue_message_ (c, GNUNET_copy_message (&msg->header));
211 barrier->cb (barrier->cls, name, barrier, status, emsg); 212 barrier->cb (barrier->cls, name, barrier, status, emsg);
212 if (GNUNET_TESTBED_BARRIERSTATUS_INITIALISED == status) 213 if (GNUNET_TESTBED_BARRIERSTATUS_INITIALISED == status)
@@ -270,7 +271,8 @@ GNUNET_TESTBED_barrier_init_ (struct GNUNET_TESTBED_Controller *controller,
270 barrier->echo = echo; 271 barrier->echo = echo;
271 (void) memcpy (&barrier->key, &key, sizeof (struct GNUNET_HashCode)); 272 (void) memcpy (&barrier->key, &key, sizeof (struct GNUNET_HashCode));
272 GNUNET_assert (GNUNET_OK == 273 GNUNET_assert (GNUNET_OK ==
273 GNUNET_CONTAINER_multihashmap_put (barrier_map, &barrier->key, 274 GNUNET_CONTAINER_multihashmap_put (barrier_map,
275 &barrier->key,
274 barrier, 276 barrier,
275 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST)); 277 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST));
276 msize = name_len + sizeof (struct GNUNET_TESTBED_BarrierInit); 278 msize = name_len + sizeof (struct GNUNET_TESTBED_BarrierInit);
@@ -304,7 +306,8 @@ GNUNET_TESTBED_barrier_init (struct GNUNET_TESTBED_Controller *controller,
304 unsigned int quorum, 306 unsigned int quorum,
305 GNUNET_TESTBED_barrier_status_cb cb, void *cls) 307 GNUNET_TESTBED_barrier_status_cb cb, void *cls)
306{ 308{
307 return GNUNET_TESTBED_barrier_init_ (controller, name, quorum, cb, cls, GNUNET_YES); 309 return GNUNET_TESTBED_barrier_init_ (controller,
310 name, quorum, cb, cls, GNUNET_YES);
308} 311}
309 312
310 313
@@ -399,7 +402,8 @@ destroy_handle (struct GNUNET_TESTBED_BarrierWaitHandle *h)
399 * @param message received message; NULL on timeout or fatal error 402 * @param message received message; NULL on timeout or fatal error
400 */ 403 */
401static void 404static void
402receive_handler (void *cls, const struct GNUNET_MessageHeader *message) 405receive_handler (void *cls,
406 const struct GNUNET_MessageHeader *message)
403{ 407{
404 struct GNUNET_TESTBED_BarrierWaitHandle *h = cls; 408 struct GNUNET_TESTBED_BarrierWaitHandle *h = cls;
405 const struct GNUNET_TESTBED_BarrierStatusMsg *msg; 409 const struct GNUNET_TESTBED_BarrierStatusMsg *msg;
@@ -524,7 +528,8 @@ GNUNET_TESTBED_barrier_wait (const char *name,
524 h->cls = cls; 528 h->cls = cls;
525 if (NULL == h->conn) 529 if (NULL == h->conn)
526 { 530 {
527 LOG (GNUNET_ERROR_TYPE_ERROR, "Unable to connect to local testbed-barrier service\n"); 531 LOG (GNUNET_ERROR_TYPE_ERROR,
532 "Unable to connect to local testbed-barrier service\n");
528 destroy_handle (h); 533 destroy_handle (h);
529 return NULL; 534 return NULL;
530 } 535 }