diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-09-09 12:30:54 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-09-09 12:30:54 +0000 |
commit | a1d7926951beb7466a1462e43b9933530e5825f7 (patch) | |
tree | 0ae15b2f388a1a9a0a45f95903b2e0b78513c19a /src/include | |
parent | 495ebe5987dbf7562d55e9d6a5751d78ae35ffc2 (diff) | |
download | gnunet-a1d7926951beb7466a1462e43b9933530e5825f7.tar.gz gnunet-a1d7926951beb7466a1462e43b9933530e5825f7.zip |
-adding continuation to testbed peer start/stop API
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_fs_service.h | 32 | ||||
-rw-r--r-- | src/include/gnunet_testbed_service.h | 23 |
2 files changed, 37 insertions, 18 deletions
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h index f93f4e856..0308011a6 100644 --- a/src/include/gnunet_fs_service.h +++ b/src/include/gnunet_fs_service.h | |||
@@ -1542,8 +1542,7 @@ struct GNUNET_FS_ProgressInfo | |||
1542 | * field in the GNUNET_FS_ProgressInfo struct. | 1542 | * field in the GNUNET_FS_ProgressInfo struct. |
1543 | */ | 1543 | */ |
1544 | typedef void *(*GNUNET_FS_ProgressCallback) (void *cls, | 1544 | typedef void *(*GNUNET_FS_ProgressCallback) (void *cls, |
1545 | const struct GNUNET_FS_ProgressInfo | 1545 | const struct GNUNET_FS_ProgressInfo *info); |
1546 | * info); | ||
1547 | 1546 | ||
1548 | 1547 | ||
1549 | /** | 1548 | /** |
@@ -1570,30 +1569,31 @@ enum GNUNET_FS_Flags | |||
1570 | GNUNET_FS_FLAGS_DO_PROBES = 2 | 1569 | GNUNET_FS_FLAGS_DO_PROBES = 2 |
1571 | }; | 1570 | }; |
1572 | 1571 | ||
1572 | |||
1573 | /** | 1573 | /** |
1574 | * Options specified in the VARARGs portion of GNUNET_FS_start. | 1574 | * Options specified in the VARARGs portion of GNUNET_FS_start. |
1575 | */ | 1575 | */ |
1576 | enum GNUNET_FS_OPTIONS | 1576 | enum GNUNET_FS_OPTIONS |
1577 | { | 1577 | { |
1578 | 1578 | ||
1579 | /** | 1579 | /** |
1580 | * Last option in the VARARG list. | 1580 | * Last option in the VARARG list. |
1581 | */ | 1581 | */ |
1582 | GNUNET_FS_OPTIONS_END = 0, | 1582 | GNUNET_FS_OPTIONS_END = 0, |
1583 | 1583 | ||
1584 | /** | 1584 | /** |
1585 | * Select the desired amount of parallelism (this option should be | 1585 | * Select the desired amount of parallelism (this option should be |
1586 | * followed by an "unsigned int" giving the desired maximum number | 1586 | * followed by an "unsigned int" giving the desired maximum number |
1587 | * of parallel downloads). | 1587 | * of parallel downloads). |
1588 | */ | 1588 | */ |
1589 | GNUNET_FS_OPTIONS_DOWNLOAD_PARALLELISM = 1, | 1589 | GNUNET_FS_OPTIONS_DOWNLOAD_PARALLELISM = 1, |
1590 | 1590 | ||
1591 | /** | 1591 | /** |
1592 | * Maximum number of requests that should be pending at a given | 1592 | * Maximum number of requests that should be pending at a given |
1593 | * point in time (invidivual downloads may go above this, but | 1593 | * point in time (invidivual downloads may go above this, but |
1594 | * if we are above this threshold, we should not activate any | 1594 | * if we are above this threshold, we should not activate any |
1595 | * additional downloads. | 1595 | * additional downloads. |
1596 | */ | 1596 | */ |
1597 | GNUNET_FS_OPTIONS_REQUEST_PARALLELISM = 2 | 1597 | GNUNET_FS_OPTIONS_REQUEST_PARALLELISM = 2 |
1598 | }; | 1598 | }; |
1599 | 1599 | ||
diff --git a/src/include/gnunet_testbed_service.h b/src/include/gnunet_testbed_service.h index 92a7beb40..ca7230504 100644 --- a/src/include/gnunet_testbed_service.h +++ b/src/include/gnunet_testbed_service.h | |||
@@ -647,13 +647,28 @@ GNUNET_TESTBED_peer_create (struct GNUNET_TESTBED_Controller *controller, | |||
647 | 647 | ||
648 | 648 | ||
649 | /** | 649 | /** |
650 | * Functions of this signature are called when a peer has been successfully | ||
651 | * started or stopped. | ||
652 | * | ||
653 | * @param cls the closure from GNUNET_TESTBED_peer_start/stop() | ||
654 | * @param emsg NULL on success; otherwise an error description | ||
655 | */ | ||
656 | typedef void (*GNUNET_TESTBED_PeerChurnCallback) (void *cls, | ||
657 | const char *emsg); | ||
658 | |||
659 | |||
660 | /** | ||
650 | * Start the given peer. | 661 | * Start the given peer. |
651 | * | 662 | * |
652 | * @param peer peer to start | 663 | * @param peer peer to start |
664 | * @param pcc function to call upon completion | ||
665 | * @param pcc_cls closure for 'pcc' | ||
653 | * @return handle to the operation | 666 | * @return handle to the operation |
654 | */ | 667 | */ |
655 | struct GNUNET_TESTBED_Operation * | 668 | struct GNUNET_TESTBED_Operation * |
656 | GNUNET_TESTBED_peer_start (struct GNUNET_TESTBED_Peer *peer); | 669 | GNUNET_TESTBED_peer_start (struct GNUNET_TESTBED_Peer *peer, |
670 | GNUNET_TESTBED_PeerChurnCallback pcc, | ||
671 | void *pcc_cls); | ||
657 | 672 | ||
658 | 673 | ||
659 | /** | 674 | /** |
@@ -662,10 +677,14 @@ GNUNET_TESTBED_peer_start (struct GNUNET_TESTBED_Peer *peer); | |||
662 | * state of the peer). | 677 | * state of the peer). |
663 | * | 678 | * |
664 | * @param peer peer to stop | 679 | * @param peer peer to stop |
680 | * @param pcc function to call upon completion | ||
681 | * @param pcc_cls closure for 'pcc' | ||
665 | * @return handle to the operation | 682 | * @return handle to the operation |
666 | */ | 683 | */ |
667 | struct GNUNET_TESTBED_Operation * | 684 | struct GNUNET_TESTBED_Operation * |
668 | GNUNET_TESTBED_peer_stop (struct GNUNET_TESTBED_Peer *peer); | 685 | GNUNET_TESTBED_peer_stop (struct GNUNET_TESTBED_Peer *peer, |
686 | GNUNET_TESTBED_PeerChurnCallback pcc, | ||
687 | void *pcc_cls); | ||
669 | 688 | ||
670 | 689 | ||
671 | /** | 690 | /** |