aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_testbed_service.h
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-03-18 13:11:36 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-03-18 13:11:36 +0000
commitd0d39def77f1f81dd83823e0fe2cfe84a5393a74 (patch)
tree7c566f79daa839bc74569a415c1b0d2537263280 /src/include/gnunet_testbed_service.h
parent153c0ba219f50e851aaef92d0cef28f80a33763e (diff)
downloadgnunet-d0d39def77f1f81dd83823e0fe2cfe84a5393a74.tar.gz
gnunet-d0d39def77f1f81dd83823e0fe2cfe84a5393a74.zip
expose Operation and associated closure in every event
Diffstat (limited to 'src/include/gnunet_testbed_service.h')
-rw-r--r--src/include/gnunet_testbed_service.h62
1 files changed, 16 insertions, 46 deletions
diff --git a/src/include/gnunet_testbed_service.h b/src/include/gnunet_testbed_service.h
index e41901ff1..d41087484 100644
--- a/src/include/gnunet_testbed_service.h
+++ b/src/include/gnunet_testbed_service.h
@@ -252,11 +252,6 @@ enum GNUNET_TESTBED_EventType
252 */ 252 */
253 GNUNET_TESTBED_ET_OPERATION_FINISHED = 4, 253 GNUNET_TESTBED_ET_OPERATION_FINISHED = 4,
254 254
255 /**
256 * The 'GNUNET_TESTBED_run' operation has been completed
257 */
258 GNUNET_TESTBED_ET_TESTBED_ONLINE = 5
259
260}; 255};
261 256
262 257
@@ -306,6 +301,16 @@ struct GNUNET_TESTBED_EventInformation
306 enum GNUNET_TESTBED_EventType type; 301 enum GNUNET_TESTBED_EventType type;
307 302
308 /** 303 /**
304 * Handle for the corresponding operation that generated this event
305 */
306 struct GNUNET_TESTBED_Operation *op;
307
308 /**
309 * Closure given while creating the above operation
310 */
311 void *op_cls;
312
313 /**
309 * Details about the event. 314 * Details about the event.
310 */ 315 */
311 union 316 union
@@ -381,18 +386,6 @@ struct GNUNET_TESTBED_EventInformation
381 */ 386 */
382 struct 387 struct
383 { 388 {
384
385 /**
386 * Handle for the operation that was finished.
387 */
388 struct GNUNET_TESTBED_Operation *operation;
389
390 /**
391 * Closure that was passed in when the event was
392 * requested.
393 */
394 void *op_cls;
395
396 /** 389 /**
397 * Error message for the operation, NULL on success. 390 * Error message for the operation, NULL on success.
398 */ 391 */
@@ -406,32 +399,6 @@ struct GNUNET_TESTBED_EventInformation
406 399
407 } operation_finished; 400 } operation_finished;
408 401
409 /**
410 * Details about an testbed run completed event.
411 */
412 struct
413 {
414
415 /**
416 * Error message for the operation, NULL on success.
417 */
418 const char *emsg;
419
420 /**
421 * Array of peers now running (valid until
422 * 'GNUNET_TESTBED_testbed_stop' is called). Note that it is
423 * not allowed to call 'GNUNET_TESTBED_peer_destroy' on peers
424 * from this array.
425 */
426 struct GNUNET_TESTBED_Peer **peers;
427
428 /**
429 * Size of the 'peers' array.
430 */
431 unsigned int num_peers;
432
433 } testbed_run_finished;
434
435 } details; 402 } details;
436 403
437}; 404};
@@ -787,8 +754,8 @@ typedef void (*GNUNET_TESTBED_PeerChurnCallback) (void *cls,
787/** 754/**
788 * Start the given peer. 755 * Start the given peer.
789 * 756 *
790 * @param op_cls the closure for this operation; will be set in 757 * @param op_cls the closure for this operation; will be set in the event
791 * event->details.operation_finished.op_cls when this operation fails. 758 * information
792 * @param peer peer to start 759 * @param peer peer to start
793 * @param pcc function to call upon completion 760 * @param pcc function to call upon completion
794 * @param pcc_cls closure for 'pcc' 761 * @param pcc_cls closure for 'pcc'
@@ -806,13 +773,16 @@ GNUNET_TESTBED_peer_start (void *op_cls,
806 * "GNUNET_TESTBED_peer_destroy" to fully clean up the 773 * "GNUNET_TESTBED_peer_destroy" to fully clean up the
807 * state of the peer). 774 * state of the peer).
808 * 775 *
776 * @param op_cls the closure for this operation; will be set in the event
777 * information
809 * @param peer peer to stop 778 * @param peer peer to stop
810 * @param pcc function to call upon completion 779 * @param pcc function to call upon completion
811 * @param pcc_cls closure for 'pcc' 780 * @param pcc_cls closure for 'pcc'
812 * @return handle to the operation 781 * @return handle to the operation
813 */ 782 */
814struct GNUNET_TESTBED_Operation * 783struct GNUNET_TESTBED_Operation *
815GNUNET_TESTBED_peer_stop (struct GNUNET_TESTBED_Peer *peer, 784GNUNET_TESTBED_peer_stop (void *op_cls,
785 struct GNUNET_TESTBED_Peer *peer,
816 GNUNET_TESTBED_PeerChurnCallback pcc, 786 GNUNET_TESTBED_PeerChurnCallback pcc,
817 void *pcc_cls); 787 void *pcc_cls);
818 788