aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_testing_lib.h
diff options
context:
space:
mode:
authorNathan S. Evans <evans@in.tum.de>2011-02-05 14:19:42 +0000
committerNathan S. Evans <evans@in.tum.de>2011-02-05 14:19:42 +0000
commit5d67c7671b669eec8d63d3af345217bcf10768fd (patch)
treee1abf089630ba9d540f97b2d67fda0073744e247 /src/include/gnunet_testing_lib.h
parent59b233b7e3b3d70006fc8b40bd566e67bc487231 (diff)
downloadgnunet-5d67c7671b669eec8d63d3af345217bcf10768fd.tar.gz
gnunet-5d67c7671b669eec8d63d3af345217bcf10768fd.zip
configurable connect options
Diffstat (limited to 'src/include/gnunet_testing_lib.h')
-rw-r--r--src/include/gnunet_testing_lib.h26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h
index 7830ac226..b0c43c44b 100644
--- a/src/include/gnunet_testing_lib.h
+++ b/src/include/gnunet_testing_lib.h
@@ -559,13 +559,15 @@ void GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1,
559 559
560 560
561/** 561/**
562 * Start count gnunetd processes with the same set of transports and 562 * Start count gnunet instances with the same set of transports and
563 * applications. The port numbers (any option called "PORT") will be 563 * applications. The port numbers (any option called "PORT") will be
564 * adjusted to ensure that no two peers running on the same system 564 * adjusted to ensure that no two peers running on the same system
565 * have the same port(s) in their respective configurations. 565 * have the same port(s) in their respective configurations.
566 * 566 *
567 * @param cfg configuration template to use 567 * @param cfg configuration template to use
568 * @param total number of daemons to start 568 * @param total number of daemons to start
569 * @param max_concurrent_connections for testing, how many peers can
570 * we connect to simultaneously
569 * @param timeout total time allowed for peers to start 571 * @param timeout total time allowed for peers to start
570 * @param hostkey_callback function to call on each peers hostkey generation 572 * @param hostkey_callback function to call on each peers hostkey generation
571 * if NULL, peers will be started by this call, if non-null, 573 * if NULL, peers will be started by this call, if non-null,
@@ -576,16 +578,18 @@ void GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1,
576 * @param cb_cls closure for cb 578 * @param cb_cls closure for cb
577 * @param connect_callback function to call each time two hosts are connected 579 * @param connect_callback function to call each time two hosts are connected
578 * @param connect_callback_cls closure for connect_callback 580 * @param connect_callback_cls closure for connect_callback
579 * @param hostnames linked list of hosts to use to start peers on (NULL to run on localhost only) 581 * @param hostnames linked list of host structs to use to start peers on
582 * (NULL to run on localhost only)
580 * 583 *
581 * @return NULL on error, otherwise handle to control peer group 584 * @return NULL on error, otherwise handle to control peer group
582 */ 585 */
583struct GNUNET_TESTING_PeerGroup * 586struct GNUNET_TESTING_PeerGroup *
584GNUNET_TESTING_daemons_start (const struct GNUNET_CONFIGURATION_Handle *cfg, 587GNUNET_TESTING_daemons_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
585 unsigned int total, 588 unsigned int total,
589 unsigned int max_concurrent_connections,
586 struct GNUNET_TIME_Relative timeout, 590 struct GNUNET_TIME_Relative timeout,
587 GNUNET_TESTING_NotifyHostkeyCreated hostkey_callback, 591 GNUNET_TESTING_NotifyHostkeyCreated
588 void *hostkey_cls, 592 hostkey_callback, void *hostkey_cls,
589 GNUNET_TESTING_NotifyDaemonRunning cb, 593 GNUNET_TESTING_NotifyDaemonRunning cb,
590 void *cb_cls, 594 void *cb_cls,
591 GNUNET_TESTING_NotifyConnection 595 GNUNET_TESTING_NotifyConnection
@@ -894,20 +898,24 @@ GNUNET_TESTING_get_topology (struct GNUNET_TESTING_PeerGroup *pg,
894 * @param topology which topology to connect the peers in 898 * @param topology which topology to connect the peers in
895 * @param options options for connecting the topology 899 * @param options options for connecting the topology
896 * @param option_modifier modifier for options that take a parameter 900 * @param option_modifier modifier for options that take a parameter
901 * @param connect_timeout how long to wait before giving up on connecting
902 * two peers
903 * @param connect_attempts how many times to attempt to connect two peers
904 * over the connect_timeout duration
897 * @param notify_callback notification to be called once all connections completed 905 * @param notify_callback notification to be called once all connections completed
898 * @param notify_cls closure for notification callback 906 * @param notify_cls closure for notification callback
899 * 907 *
900 * @return the number of connections that will be attempted (multiple of two, 908 * @return the number of connections that will be attempted, GNUNET_SYSERR on error
901 * each bidirectional connection counts twice!), GNUNET_SYSERR on error
902 *
903 */ 909 */
904int 910int
905GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg, 911GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg,
906 enum GNUNET_TESTING_Topology topology, 912 enum GNUNET_TESTING_Topology topology,
907 enum GNUNET_TESTING_TopologyOption options, 913 enum GNUNET_TESTING_TopologyOption options,
908 double option_modifier, 914 double option_modifier,
909 GNUNET_TESTING_NotifyCompletion notify_callback, 915 struct GNUNET_TIME_Relative connect_timeout,
910 void *notify_cls); 916 unsigned int connect_attempts,
917 GNUNET_TESTING_NotifyCompletion
918 notify_callback, void *notify_cls);
911 919
912/** 920/**
913 * Start or stop an individual peer from the given group. 921 * Start or stop an individual peer from the given group.