aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_testing_lib.h
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2011-07-26 12:39:23 +0000
committerNathan S. Evans <evans@in.tum.de>2011-07-26 12:39:23 +0000
commit66e9353163686f84163816a7fee09209ce522fcb (patch)
tree2776423670bd69f4f21ef0e6e39af340585ed99b /src/include/gnunet_testing_lib.h
parente8bc36209dd09c9720c6ea8657e4f49c35c08956 (diff)
downloadgnunet-66e9353163686f84163816a7fee09209ce522fcb.tar.gz
gnunet-66e9353163686f84163816a7fee09209ce522fcb.zip
load hosts from file, implementation in testing
Diffstat (limited to 'src/include/gnunet_testing_lib.h')
-rw-r--r--src/include/gnunet_testing_lib.h55
1 files changed, 33 insertions, 22 deletions
diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h
index 34920bbab..0b998cf95 100644
--- a/src/include/gnunet_testing_lib.h
+++ b/src/include/gnunet_testing_lib.h
@@ -602,31 +602,17 @@ GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d,
602 struct GNUNET_TIME_Relative timeout, 602 struct GNUNET_TIME_Relative timeout,
603 GNUNET_TESTING_NotifyCompletion cb, void *cb_cls); 603 GNUNET_TESTING_NotifyCompletion cb, void *cb_cls);
604 604
605
606/** 605/**
607 * Establish a connection between two GNUnet daemons. 606 * Read a testing hosts file based on a configuration.
607 * Returns a DLL of hosts (caller must free!) on success
608 * or NULL on failure.
608 * 609 *
609 * @param d1 handle for the first daemon 610 * @param cfg a configuration with a testing section
610 * @param d2 handle for the second daemon 611 *
611 * @param timeout how long is the connection attempt 612 * @return DLL of hosts on success, NULL on failure
612 * allowed to take?
613 * @param max_connect_attempts how many times should we try to reconnect
614 * (within timeout)
615 * @param send_hello GNUNET_YES to send the HELLO, GNUNET_NO to assume
616 * the HELLO has already been exchanged
617 * @param cb function to call at the end
618 * @param cb_cls closure for cb
619 */ 613 */
620void 614struct GNUNET_TESTING_Host *
621GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, 615GNUNET_TESTING_hosts_load (const struct GNUNET_CONFIGURATION_Handle *cfg);
622 struct GNUNET_TESTING_Daemon *d2,
623 struct GNUNET_TIME_Relative timeout,
624 unsigned int max_connect_attempts,
625 int send_hello,
626 GNUNET_TESTING_NotifyConnection cb,
627 void *cb_cls);
628
629
630 616
631 617
632/** 618/**
@@ -679,6 +665,31 @@ GNUNET_TESTING_daemons_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
679void 665void
680GNUNET_TESTING_daemons_continue_startup(struct GNUNET_TESTING_PeerGroup *pg); 666GNUNET_TESTING_daemons_continue_startup(struct GNUNET_TESTING_PeerGroup *pg);
681 667
668
669/**
670 * Establish a connection between two GNUnet daemons.
671 *
672 * @param d1 handle for the first daemon
673 * @param d2 handle for the second daemon
674 * @param timeout how long is the connection attempt
675 * allowed to take?
676 * @param max_connect_attempts how many times should we try to reconnect
677 * (within timeout)
678 * @param send_hello GNUNET_YES to send the HELLO, GNUNET_NO to assume
679 * the HELLO has already been exchanged
680 * @param cb function to call at the end
681 * @param cb_cls closure for cb
682 */
683void
684GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1,
685 struct GNUNET_TESTING_Daemon *d2,
686 struct GNUNET_TIME_Relative timeout,
687 unsigned int max_connect_attempts,
688 int send_hello,
689 GNUNET_TESTING_NotifyConnection cb,
690 void *cb_cls);
691
692
682/** 693/**
683 * Restart all peers in the given group. 694 * Restart all peers in the given group.
684 * 695 *