diff options
Diffstat (limited to 'src/include/gnunet_testing_lib.h')
-rw-r--r-- | src/include/gnunet_testing_lib.h | 254 |
1 files changed, 150 insertions, 104 deletions
diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h index 9d85f3af9..1111f576c 100644 --- a/src/include/gnunet_testing_lib.h +++ b/src/include/gnunet_testing_lib.h | |||
@@ -88,10 +88,12 @@ struct GNUNET_TESTING_Host | |||
88 | * @param d handle for the daemon | 88 | * @param d handle for the daemon |
89 | * @param emsg error message (NULL on success) | 89 | * @param emsg error message (NULL on success) |
90 | */ | 90 | */ |
91 | typedef void (*GNUNET_TESTING_NotifyHostkeyCreated)(void *cls, | 91 | typedef void (*GNUNET_TESTING_NotifyHostkeyCreated) (void *cls, |
92 | const struct GNUNET_PeerIdentity *id, | 92 | const struct |
93 | struct GNUNET_TESTING_Daemon *d, | 93 | GNUNET_PeerIdentity * id, |
94 | const char *emsg); | 94 | struct |
95 | GNUNET_TESTING_Daemon * d, | ||
96 | const char *emsg); | ||
95 | 97 | ||
96 | /** | 98 | /** |
97 | * Prototype of a function that will be called whenever | 99 | * Prototype of a function that will be called whenever |
@@ -103,11 +105,14 @@ typedef void (*GNUNET_TESTING_NotifyHostkeyCreated)(void *cls, | |||
103 | * @param d handle for the daemon | 105 | * @param d handle for the daemon |
104 | * @param emsg error message (NULL on success) | 106 | * @param emsg error message (NULL on success) |
105 | */ | 107 | */ |
106 | typedef void (*GNUNET_TESTING_NotifyDaemonRunning)(void *cls, | 108 | typedef void (*GNUNET_TESTING_NotifyDaemonRunning) (void *cls, |
107 | const struct GNUNET_PeerIdentity *id, | 109 | const struct |
108 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 110 | GNUNET_PeerIdentity * id, |
109 | struct GNUNET_TESTING_Daemon *d, | 111 | const struct |
110 | const char *emsg); | 112 | GNUNET_CONFIGURATION_Handle |
113 | * cfg, | ||
114 | struct GNUNET_TESTING_Daemon | ||
115 | * d, const char *emsg); | ||
111 | 116 | ||
112 | 117 | ||
113 | /** | 118 | /** |
@@ -203,8 +208,7 @@ enum GNUNET_TESTING_StartPhase | |||
203 | * @param cls closure | 208 | * @param cls closure |
204 | * @param emsg NULL on success | 209 | * @param emsg NULL on success |
205 | */ | 210 | */ |
206 | typedef void (*GNUNET_TESTING_NotifyCompletion)(void *cls, | 211 | typedef void (*GNUNET_TESTING_NotifyCompletion) (void *cls, const char *emsg); |
207 | const char *emsg); | ||
208 | 212 | ||
209 | /** | 213 | /** |
210 | * Prototype of a function that will be called with the | 214 | * Prototype of a function that will be called with the |
@@ -213,8 +217,8 @@ typedef void (*GNUNET_TESTING_NotifyCompletion)(void *cls, | |||
213 | * @param cls closure | 217 | * @param cls closure |
214 | * @param num_connections the number of connections created | 218 | * @param num_connections the number of connections created |
215 | */ | 219 | */ |
216 | typedef void (*GNUNET_TESTING_NotifyConnections)(void *cls, | 220 | typedef void (*GNUNET_TESTING_NotifyConnections) (void *cls, |
217 | unsigned int num_connections); | 221 | unsigned int num_connections); |
218 | 222 | ||
219 | /** | 223 | /** |
220 | * Handle for a GNUnet daemon (technically a set of | 224 | * Handle for a GNUnet daemon (technically a set of |
@@ -405,15 +409,23 @@ struct GNUNET_TESTING_PeerGroup; | |||
405 | * @param second_daemon handle for the second daemon | 409 | * @param second_daemon handle for the second daemon |
406 | * @param emsg error message (NULL on success) | 410 | * @param emsg error message (NULL on success) |
407 | */ | 411 | */ |
408 | typedef void (*GNUNET_TESTING_NotifyConnection)(void *cls, | 412 | typedef void (*GNUNET_TESTING_NotifyConnection) (void *cls, |
409 | const struct GNUNET_PeerIdentity *first, | 413 | const struct |
410 | const struct GNUNET_PeerIdentity *second, | 414 | GNUNET_PeerIdentity * first, |
411 | uint32_t distance, | 415 | const struct |
412 | const struct GNUNET_CONFIGURATION_Handle *first_cfg, | 416 | GNUNET_PeerIdentity * second, |
413 | const struct GNUNET_CONFIGURATION_Handle *second_cfg, | 417 | uint32_t distance, |
414 | struct GNUNET_TESTING_Daemon *first_daemon, | 418 | const struct |
415 | struct GNUNET_TESTING_Daemon *second_daemon, | 419 | GNUNET_CONFIGURATION_Handle * |
416 | const char *emsg); | 420 | first_cfg, |
421 | const struct | ||
422 | GNUNET_CONFIGURATION_Handle * | ||
423 | second_cfg, | ||
424 | struct GNUNET_TESTING_Daemon * | ||
425 | first_daemon, | ||
426 | struct GNUNET_TESTING_Daemon * | ||
427 | second_daemon, | ||
428 | const char *emsg); | ||
417 | 429 | ||
418 | /** | 430 | /** |
419 | * Prototype of a callback function indicating that two peers | 431 | * Prototype of a callback function indicating that two peers |
@@ -425,10 +437,11 @@ typedef void (*GNUNET_TESTING_NotifyConnection)(void *cls, | |||
425 | * @param distance distance between the connected peers | 437 | * @param distance distance between the connected peers |
426 | * @param emsg error message (NULL on success) | 438 | * @param emsg error message (NULL on success) |
427 | */ | 439 | */ |
428 | typedef void (*GNUNET_TESTING_NotifyTopology)(void *cls, | 440 | typedef void (*GNUNET_TESTING_NotifyTopology) (void *cls, |
429 | const struct GNUNET_PeerIdentity *first, | 441 | const struct GNUNET_PeerIdentity |
430 | const struct GNUNET_PeerIdentity *second, | 442 | * first, |
431 | const char *emsg); | 443 | const struct GNUNET_PeerIdentity |
444 | * second, const char *emsg); | ||
432 | 445 | ||
433 | /** | 446 | /** |
434 | * Starts a GNUnet daemon. GNUnet must be installed on the target | 447 | * Starts a GNUnet daemon. GNUnet must be installed on the target |
@@ -453,18 +466,22 @@ typedef void (*GNUNET_TESTING_NotifyTopology)(void *cls, | |||
453 | * @param cb_cls closure for cb | 466 | * @param cb_cls closure for cb |
454 | * @return handle to the daemon (actual start will be completed asynchronously) | 467 | * @return handle to the daemon (actual start will be completed asynchronously) |
455 | */ | 468 | */ |
456 | struct GNUNET_TESTING_Daemon * | 469 | struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_start (const struct |
457 | GNUNET_TESTING_daemon_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | 470 | GNUNET_CONFIGURATION_Handle |
458 | struct GNUNET_TIME_Relative timeout, | 471 | *cfg, |
459 | int pretend, | 472 | struct |
460 | const char *hostname, | 473 | GNUNET_TIME_Relative |
461 | const char *ssh_username, | 474 | timeout, int pretend, |
462 | uint16_t sshport, | 475 | const char *hostname, |
463 | const char *hostkey, | 476 | const char |
464 | GNUNET_TESTING_NotifyHostkeyCreated | 477 | *ssh_username, |
465 | hostkey_callback, void *hostkey_cls, | 478 | uint16_t sshport, |
466 | GNUNET_TESTING_NotifyDaemonRunning cb, | 479 | const char *hostkey, |
467 | void *cb_cls); | 480 | GNUNET_TESTING_NotifyHostkeyCreated |
481 | hostkey_callback, | ||
482 | void *hostkey_cls, | ||
483 | GNUNET_TESTING_NotifyDaemonRunning | ||
484 | cb, void *cb_cls); | ||
468 | 485 | ||
469 | /** | 486 | /** |
470 | * Continues GNUnet daemon startup when user wanted to be notified | 487 | * Continues GNUnet daemon startup when user wanted to be notified |
@@ -474,7 +491,7 @@ GNUNET_TESTING_daemon_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
474 | * @param daemon the daemon to finish starting | 491 | * @param daemon the daemon to finish starting |
475 | */ | 492 | */ |
476 | void | 493 | void |
477 | GNUNET_TESTING_daemon_continue_startup(struct GNUNET_TESTING_Daemon *daemon); | 494 | GNUNET_TESTING_daemon_continue_startup (struct GNUNET_TESTING_Daemon *daemon); |
478 | 495 | ||
479 | /** | 496 | /** |
480 | * Check whether the given daemon is running. | 497 | * Check whether the given daemon is running. |
@@ -484,8 +501,7 @@ GNUNET_TESTING_daemon_continue_startup(struct GNUNET_TESTING_Daemon *daemon); | |||
484 | * @return GNUNET_YES if the daemon is up, GNUNET_NO if the | 501 | * @return GNUNET_YES if the daemon is up, GNUNET_NO if the |
485 | * daemon is down, GNUNET_SYSERR on error. | 502 | * daemon is down, GNUNET_SYSERR on error. |
486 | */ | 503 | */ |
487 | int | 504 | int GNUNET_TESTING_daemon_running (struct GNUNET_TESTING_Daemon *daemon); |
488 | GNUNET_TESTING_daemon_running (struct GNUNET_TESTING_Daemon *daemon); | ||
489 | 505 | ||
490 | /** | 506 | /** |
491 | * Restart (stop and start) a GNUnet daemon. | 507 | * Restart (stop and start) a GNUnet daemon. |
@@ -496,7 +512,8 @@ GNUNET_TESTING_daemon_running (struct GNUNET_TESTING_Daemon *daemon); | |||
496 | */ | 512 | */ |
497 | void | 513 | void |
498 | GNUNET_TESTING_daemon_restart (struct GNUNET_TESTING_Daemon *d, | 514 | GNUNET_TESTING_daemon_restart (struct GNUNET_TESTING_Daemon *d, |
499 | GNUNET_TESTING_NotifyDaemonRunning cb, void *cb_cls); | 515 | GNUNET_TESTING_NotifyDaemonRunning cb, |
516 | void *cb_cls); | ||
500 | 517 | ||
501 | /** | 518 | /** |
502 | * Start a peer that has previously been stopped using the daemon_stop | 519 | * Start a peer that has previously been stopped using the daemon_stop |
@@ -526,7 +543,8 @@ void | |||
526 | GNUNET_TESTING_daemon_start_service (struct GNUNET_TESTING_Daemon *d, | 543 | GNUNET_TESTING_daemon_start_service (struct GNUNET_TESTING_Daemon *d, |
527 | char *service, | 544 | char *service, |
528 | struct GNUNET_TIME_Relative timeout, | 545 | struct GNUNET_TIME_Relative timeout, |
529 | GNUNET_TESTING_NotifyDaemonRunning cb, void *cb_cls); | 546 | GNUNET_TESTING_NotifyDaemonRunning cb, |
547 | void *cb_cls); | ||
530 | 548 | ||
531 | /** | 549 | /** |
532 | * Starts a GNUnet daemon's service which has been previously turned off. | 550 | * Starts a GNUnet daemon's service which has been previously turned off. |
@@ -540,8 +558,10 @@ GNUNET_TESTING_daemon_start_service (struct GNUNET_TESTING_Daemon *d, | |||
540 | void | 558 | void |
541 | GNUNET_TESTING_daemon_start_stopped_service (struct GNUNET_TESTING_Daemon *d, | 559 | GNUNET_TESTING_daemon_start_stopped_service (struct GNUNET_TESTING_Daemon *d, |
542 | char *service, | 560 | char *service, |
543 | struct GNUNET_TIME_Relative timeout, | 561 | struct GNUNET_TIME_Relative |
544 | GNUNET_TESTING_NotifyDaemonRunning cb, void *cb_cls); | 562 | timeout, |
563 | GNUNET_TESTING_NotifyDaemonRunning | ||
564 | cb, void *cb_cls); | ||
545 | 565 | ||
546 | /** | 566 | /** |
547 | * Get a certain testing daemon handle. | 567 | * Get a certain testing daemon handle. |
@@ -549,9 +569,10 @@ GNUNET_TESTING_daemon_start_stopped_service (struct GNUNET_TESTING_Daemon *d, | |||
549 | * @param pg handle to the set of running peers | 569 | * @param pg handle to the set of running peers |
550 | * @param position the number of the peer to return | 570 | * @param position the number of the peer to return |
551 | */ | 571 | */ |
552 | struct GNUNET_TESTING_Daemon * | 572 | struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_get (struct |
553 | GNUNET_TESTING_daemon_get (struct GNUNET_TESTING_PeerGroup *pg, | 573 | GNUNET_TESTING_PeerGroup |
554 | unsigned int position); | 574 | *pg, |
575 | unsigned int position); | ||
555 | 576 | ||
556 | /* | 577 | /* |
557 | * Get a daemon by peer identity, so callers can | 578 | * Get a daemon by peer identity, so callers can |
@@ -562,9 +583,12 @@ GNUNET_TESTING_daemon_get (struct GNUNET_TESTING_PeerGroup *pg, | |||
562 | * | 583 | * |
563 | * @return the daemon on success, or NULL if no such peer identity is found | 584 | * @return the daemon on success, or NULL if no such peer identity is found |
564 | */ | 585 | */ |
565 | struct GNUNET_TESTING_Daemon * | 586 | struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_get_by_id (struct |
566 | GNUNET_TESTING_daemon_get_by_id (struct GNUNET_TESTING_PeerGroup *pg, | 587 | GNUNET_TESTING_PeerGroup |
567 | struct GNUNET_PeerIdentity *peer_id); | 588 | *pg, |
589 | struct | ||
590 | GNUNET_PeerIdentity | ||
591 | *peer_id); | ||
568 | 592 | ||
569 | /** | 593 | /** |
570 | * Stops a GNUnet daemon. | 594 | * Stops a GNUnet daemon. |
@@ -595,9 +619,9 @@ GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d, | |||
595 | * @param cb_cls closure for cb | 619 | * @param cb_cls closure for cb |
596 | */ | 620 | */ |
597 | void GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d, | 621 | void GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d, |
598 | struct GNUNET_CONFIGURATION_Handle *cfg, | 622 | struct GNUNET_CONFIGURATION_Handle *cfg, |
599 | GNUNET_TESTING_NotifyCompletion cb, | 623 | GNUNET_TESTING_NotifyCompletion cb, |
600 | void * cb_cls); | 624 | void *cb_cls); |
601 | 625 | ||
602 | /** | 626 | /** |
603 | * Stops a single service of a GNUnet daemon. Used like daemon_stop, | 627 | * Stops a single service of a GNUnet daemon. Used like daemon_stop, |
@@ -615,7 +639,8 @@ void | |||
615 | GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d, | 639 | GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d, |
616 | char *service, | 640 | char *service, |
617 | struct GNUNET_TIME_Relative timeout, | 641 | struct GNUNET_TIME_Relative timeout, |
618 | GNUNET_TESTING_NotifyCompletion cb, void *cb_cls); | 642 | GNUNET_TESTING_NotifyCompletion cb, |
643 | void *cb_cls); | ||
619 | 644 | ||
620 | /** | 645 | /** |
621 | * Read a testing hosts file based on a configuration. | 646 | * Read a testing hosts file based on a configuration. |
@@ -626,8 +651,9 @@ GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d, | |||
626 | * | 651 | * |
627 | * @return DLL of hosts on success, NULL on failure | 652 | * @return DLL of hosts on success, NULL on failure |
628 | */ | 653 | */ |
629 | struct GNUNET_TESTING_Host * | 654 | struct GNUNET_TESTING_Host *GNUNET_TESTING_hosts_load (const struct |
630 | GNUNET_TESTING_hosts_load (const struct GNUNET_CONFIGURATION_Handle *cfg); | 655 | GNUNET_CONFIGURATION_Handle |
656 | *cfg); | ||
631 | 657 | ||
632 | 658 | ||
633 | /** | 659 | /** |
@@ -657,19 +683,31 @@ GNUNET_TESTING_hosts_load (const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
657 | * | 683 | * |
658 | * @return NULL on error, otherwise handle to control peer group | 684 | * @return NULL on error, otherwise handle to control peer group |
659 | */ | 685 | */ |
660 | struct GNUNET_TESTING_PeerGroup * | 686 | struct GNUNET_TESTING_PeerGroup *GNUNET_TESTING_daemons_start (const struct |
661 | GNUNET_TESTING_daemons_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | 687 | GNUNET_CONFIGURATION_Handle |
662 | unsigned int total, | 688 | *cfg, |
663 | unsigned int max_concurrent_connections, | 689 | unsigned int |
664 | unsigned int max_concurrent_ssh, | 690 | total, |
665 | struct GNUNET_TIME_Relative timeout, | 691 | unsigned int |
666 | GNUNET_TESTING_NotifyHostkeyCreated | 692 | max_concurrent_connections, |
667 | hostkey_callback, void *hostkey_cls, | 693 | unsigned int |
668 | GNUNET_TESTING_NotifyDaemonRunning cb, | 694 | max_concurrent_ssh, |
669 | void *cb_cls, | 695 | struct |
670 | GNUNET_TESTING_NotifyConnection | 696 | GNUNET_TIME_Relative |
671 | connect_callback, void *connect_callback_cls, | 697 | timeout, |
672 | const struct GNUNET_TESTING_Host *hostnames); | 698 | GNUNET_TESTING_NotifyHostkeyCreated |
699 | hostkey_callback, | ||
700 | void | ||
701 | *hostkey_cls, | ||
702 | GNUNET_TESTING_NotifyDaemonRunning | ||
703 | cb, void *cb_cls, | ||
704 | GNUNET_TESTING_NotifyConnection | ||
705 | connect_callback, | ||
706 | void | ||
707 | *connect_callback_cls, | ||
708 | const struct | ||
709 | GNUNET_TESTING_Host | ||
710 | *hostnames); | ||
673 | 711 | ||
674 | /** | 712 | /** |
675 | * Function which continues a peer group starting up | 713 | * Function which continues a peer group starting up |
@@ -678,7 +716,7 @@ GNUNET_TESTING_daemons_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
678 | * @param pg the peer group to continue starting | 716 | * @param pg the peer group to continue starting |
679 | */ | 717 | */ |
680 | void | 718 | void |
681 | GNUNET_TESTING_daemons_continue_startup(struct GNUNET_TESTING_PeerGroup *pg); | 719 | GNUNET_TESTING_daemons_continue_startup (struct GNUNET_TESTING_PeerGroup *pg); |
682 | 720 | ||
683 | 721 | ||
684 | /** | 722 | /** |
@@ -727,10 +765,9 @@ GNUNET_TESTING_daemons_restart (struct GNUNET_TESTING_PeerGroup *pg, | |||
727 | * @param cb_cls closure for cb | 765 | * @param cb_cls closure for cb |
728 | */ | 766 | */ |
729 | void | 767 | void |
730 | GNUNET_TESTING_daemons_stop (struct GNUNET_TESTING_PeerGroup *pg, | 768 | GNUNET_TESTING_daemons_stop (struct GNUNET_TESTING_PeerGroup *pg, |
731 | struct GNUNET_TIME_Relative timeout, | 769 | struct GNUNET_TIME_Relative timeout, |
732 | GNUNET_TESTING_NotifyCompletion cb, | 770 | GNUNET_TESTING_NotifyCompletion cb, void *cb_cls); |
733 | void *cb_cls); | ||
734 | 771 | ||
735 | 772 | ||
736 | /** | 773 | /** |
@@ -772,8 +809,7 @@ GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg, | |||
772 | unsigned int voff, | 809 | unsigned int voff, |
773 | unsigned int von, | 810 | unsigned int von, |
774 | struct GNUNET_TIME_Relative timeout, | 811 | struct GNUNET_TIME_Relative timeout, |
775 | GNUNET_TESTING_NotifyCompletion cb, | 812 | GNUNET_TESTING_NotifyCompletion cb, void *cb_cls); |
776 | void *cb_cls); | ||
777 | /* | 813 | /* |
778 | * Start a given service for each of the peers in the peer group. | 814 | * Start a given service for each of the peers in the peer group. |
779 | * | 815 | * |
@@ -804,7 +840,8 @@ GNUNET_TESTING_daemons_start_service (struct GNUNET_TESTING_PeerGroup *pg, | |||
804 | * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration | 840 | * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration |
805 | */ | 841 | */ |
806 | typedef int (*GNUNET_TESTING_STATISTICS_Iterator) (void *cls, | 842 | typedef int (*GNUNET_TESTING_STATISTICS_Iterator) (void *cls, |
807 | const struct GNUNET_PeerIdentity *peer, | 843 | const struct |
844 | GNUNET_PeerIdentity * peer, | ||
808 | const char *subsystem, | 845 | const char *subsystem, |
809 | const char *name, | 846 | const char *name, |
810 | uint64_t value, | 847 | uint64_t value, |
@@ -822,7 +859,8 @@ typedef int (*GNUNET_TESTING_STATISTICS_Iterator) (void *cls, | |||
822 | void | 859 | void |
823 | GNUNET_TESTING_get_statistics (struct GNUNET_TESTING_PeerGroup *pg, | 860 | GNUNET_TESTING_get_statistics (struct GNUNET_TESTING_PeerGroup *pg, |
824 | GNUNET_STATISTICS_Callback cont, | 861 | GNUNET_STATISTICS_Callback cont, |
825 | GNUNET_TESTING_STATISTICS_Iterator proc, void *cls); | 862 | GNUNET_TESTING_STATISTICS_Iterator proc, |
863 | void *cls); | ||
826 | 864 | ||
827 | /** | 865 | /** |
828 | * Topologies supported for testbeds. | 866 | * Topologies supported for testbeds. |
@@ -938,8 +976,8 @@ enum GNUNET_TESTING_TopologyOption | |||
938 | * known topology, GNUNET_NO if not | 976 | * known topology, GNUNET_NO if not |
939 | */ | 977 | */ |
940 | int | 978 | int |
941 | GNUNET_TESTING_topology_get(enum GNUNET_TESTING_Topology *topology, | 979 | GNUNET_TESTING_topology_get (enum GNUNET_TESTING_Topology *topology, |
942 | const char * topology_string); | 980 | const char *topology_string); |
943 | 981 | ||
944 | /** | 982 | /** |
945 | * Get connect topology option from string input. | 983 | * Get connect topology option from string input. |
@@ -951,8 +989,9 @@ GNUNET_TESTING_topology_get(enum GNUNET_TESTING_Topology *topology, | |||
951 | * known topology, GNUNET_NO if not | 989 | * known topology, GNUNET_NO if not |
952 | */ | 990 | */ |
953 | int | 991 | int |
954 | GNUNET_TESTING_topology_option_get(enum GNUNET_TESTING_TopologyOption *topology_option, | 992 | GNUNET_TESTING_topology_option_get (enum GNUNET_TESTING_TopologyOption |
955 | const char * topology_string); | 993 | *topology_option, |
994 | const char *topology_string); | ||
956 | 995 | ||
957 | 996 | ||
958 | /** | 997 | /** |
@@ -1007,21 +1046,21 @@ GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg, | |||
1007 | */ | 1046 | */ |
1008 | void | 1047 | void |
1009 | GNUNET_TESTING_get_topology (struct GNUNET_TESTING_PeerGroup *pg, | 1048 | GNUNET_TESTING_get_topology (struct GNUNET_TESTING_PeerGroup *pg, |
1010 | GNUNET_TESTING_NotifyTopology cb, void *cls); | 1049 | GNUNET_TESTING_NotifyTopology cb, void *cls); |
1011 | 1050 | ||
1012 | /** | 1051 | /** |
1013 | * Stop the connection process temporarily. | 1052 | * Stop the connection process temporarily. |
1014 | * | 1053 | * |
1015 | * @param pg the peer group to stop connecting | 1054 | * @param pg the peer group to stop connecting |
1016 | */ | 1055 | */ |
1017 | void GNUNET_TESTING_stop_connections(struct GNUNET_TESTING_PeerGroup *pg); | 1056 | void GNUNET_TESTING_stop_connections (struct GNUNET_TESTING_PeerGroup *pg); |
1018 | 1057 | ||
1019 | /** | 1058 | /** |
1020 | * Resume the connection process. | 1059 | * Resume the connection process. |
1021 | * | 1060 | * |
1022 | * @param pg the peer group to resume connecting | 1061 | * @param pg the peer group to resume connecting |
1023 | */ | 1062 | */ |
1024 | void GNUNET_TESTING_resume_connections(struct GNUNET_TESTING_PeerGroup *pg); | 1063 | void GNUNET_TESTING_resume_connections (struct GNUNET_TESTING_PeerGroup *pg); |
1025 | 1064 | ||
1026 | /** | 1065 | /** |
1027 | * There are many ways to connect peers that are supported by this function. | 1066 | * There are many ways to connect peers that are supported by this function. |
@@ -1066,12 +1105,11 @@ GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg, | |||
1066 | * @param cb_cls closure for cb | 1105 | * @param cb_cls closure for cb |
1067 | */ | 1106 | */ |
1068 | void | 1107 | void |
1069 | GNUNET_TESTING_daemons_vary (struct GNUNET_TESTING_PeerGroup *pg, | 1108 | GNUNET_TESTING_daemons_vary (struct GNUNET_TESTING_PeerGroup *pg, |
1070 | unsigned int offset, | 1109 | unsigned int offset, |
1071 | int desired_status, | 1110 | int desired_status, |
1072 | struct GNUNET_TIME_Relative timeout, | 1111 | struct GNUNET_TIME_Relative timeout, |
1073 | GNUNET_TESTING_NotifyCompletion cb, | 1112 | GNUNET_TESTING_NotifyCompletion cb, void *cb_cls); |
1074 | void *cb_cls); | ||
1075 | 1113 | ||
1076 | /** | 1114 | /** |
1077 | * Start a peer group with a given number of peers. Notify | 1115 | * Start a peer group with a given number of peers. Notify |
@@ -1090,15 +1128,23 @@ GNUNET_TESTING_daemons_vary (struct GNUNET_TESTING_PeerGroup *pg, | |||
1090 | * | 1128 | * |
1091 | * @return NULL on error, otherwise handle to control peer group | 1129 | * @return NULL on error, otherwise handle to control peer group |
1092 | */ | 1130 | */ |
1093 | struct GNUNET_TESTING_PeerGroup * | 1131 | struct GNUNET_TESTING_PeerGroup *GNUNET_TESTING_peergroup_start (const struct |
1094 | GNUNET_TESTING_peergroup_start( | 1132 | GNUNET_CONFIGURATION_Handle |
1095 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 1133 | *cfg, |
1096 | unsigned int total, | 1134 | unsigned int |
1097 | struct GNUNET_TIME_Relative timeout, | 1135 | total, |
1098 | GNUNET_TESTING_NotifyConnection connect_cb, | 1136 | struct |
1099 | GNUNET_TESTING_NotifyCompletion peergroup_cb, | 1137 | GNUNET_TIME_Relative |
1100 | void *peergroup_cls, | 1138 | timeout, |
1101 | const struct GNUNET_TESTING_Host *hostnames); | 1139 | GNUNET_TESTING_NotifyConnection |
1140 | connect_cb, | ||
1141 | GNUNET_TESTING_NotifyCompletion | ||
1142 | peergroup_cb, | ||
1143 | void | ||
1144 | *peergroup_cls, | ||
1145 | const struct | ||
1146 | GNUNET_TESTING_Host | ||
1147 | *hostnames); | ||
1102 | 1148 | ||
1103 | /** | 1149 | /** |
1104 | * Print current topology to a graphviz readable file. | 1150 | * Print current topology to a graphviz readable file. |
@@ -1110,10 +1156,10 @@ GNUNET_TESTING_peergroup_start( | |||
1110 | * | 1156 | * |
1111 | */ | 1157 | */ |
1112 | void | 1158 | void |
1113 | GNUNET_TESTING_peergroup_topology_to_file(struct GNUNET_TESTING_PeerGroup *pg, | 1159 | GNUNET_TESTING_peergroup_topology_to_file (struct GNUNET_TESTING_PeerGroup *pg, |
1114 | const char *output_filename, | 1160 | const char *output_filename, |
1115 | GNUNET_TESTING_NotifyCompletion notify_cb, | 1161 | GNUNET_TESTING_NotifyCompletion |
1116 | void *notify_cb_cls); | 1162 | notify_cb, void *notify_cb_cls); |
1117 | 1163 | ||
1118 | 1164 | ||
1119 | #if 0 /* keep Emacsens' auto-indent happy */ | 1165 | #if 0 /* keep Emacsens' auto-indent happy */ |