aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-05-03 17:43:01 +0000
committerChristian Grothoff <christian@grothoff.org>2012-05-03 17:43:01 +0000
commit00a452de44319475a603552c9635799612b559f7 (patch)
tree20d67eb4493917cd111c14ae3730d81a3ee1cbc1
parent49407f6d8563cdc61eab5199e23b802aeca49f66 (diff)
downloadgnunet-00a452de44319475a603552c9635799612b559f7.tar.gz
gnunet-00a452de44319475a603552c9635799612b559f7.zip
-fix
-rw-r--r--src/include/gnunet_testing_service.h124
1 files changed, 61 insertions, 63 deletions
diff --git a/src/include/gnunet_testing_service.h b/src/include/gnunet_testing_service.h
index 27eb69839..6e56093e5 100644
--- a/src/include/gnunet_testing_service.h
+++ b/src/include/gnunet_testing_service.h
@@ -100,26 +100,6 @@ GNUNET_TESTING_hosts_load_from_file (const char *filename,
100 100
101 101
102/** 102/**
103 * Configure shared services at a peer. Using this function,
104 * you can specify that certain services (such as "resolver")
105 * should not be run for each peer but instead be shared
106 * across N peers on the specified host. This function
107 * must be called before any peers are created at the host.
108 *
109 * @param host host to configure
110 * @param service_name name of the service to share
111 * @param num_peers number of peers that should share one instance
112 * of the specified service (1 for no sharing is the default),
113 * use 0 to disable the service
114 */
115void
116GNUNET_TESTING_host_configure (struct GNUNET_TESTING_Host *host,
117 const char *service_name,
118 uint32_t num_peers);
119// FIXME: make this controller-configure?
120
121
122/**
123 * Destroy a host handle. Must only be called once everything 103 * Destroy a host handle. Must only be called once everything
124 * running on that host has been stopped. 104 * running on that host has been stopped.
125 * 105 *
@@ -169,6 +149,46 @@ enum GNUNET_TESTING_EventType
169 149
170 150
171/** 151/**
152 * Types of information that can be requested about a peer.
153 */
154enum GNUNET_TESTING_PeerInformationType
155{
156
157 /**
158 * Special value (not valid for requesting information)
159 * that is used in the event struct if a 'generic' pointer
160 * is returned (for other operations not related to this
161 * enumeration).
162 */
163 GNUNET_TESTING_PIT_GENERIC = 0,
164
165 /**
166 * What host is the peer running on? Returns a 'const struct
167 * GNUNET_TESTING_Host *'. Valid until
168 * 'GNUNET_TESTING_operation_done' is called.
169 */
170 GNUNET_TESTING_PIT_HOST,
171
172 /**
173 * What configuration is the peer using? Returns a 'const struct
174 * GNUNET_CONFIGURATION_Handle *'. Valid until
175 * 'GNUNET_TESTNIG_operation_done' is called. However, the
176 * values may be inaccurate if the peer is reconfigured in
177 * the meantime.
178 */
179 GNUNET_TESTING_PIT_CONFIGURATION,
180
181 /**
182 * What is the identity of the peer? Returns a
183 * 'const struct GNUNET_PeerIdentity *'. Valid until
184 * 'GNUNET_TESTNIG_operation_done' is called.
185 */
186 GNUNET_TESTING_PIT_IDENTITY
187
188};
189
190
191/**
172 * Argument to GNUNET_TESTING_ControllerCallback with details about 192 * Argument to GNUNET_TESTING_ControllerCallback with details about
173 * the event. 193 * the event.
174 */ 194 */
@@ -376,6 +396,24 @@ GNUNET_TESTING_controller_start (const struct GNUNET_CONFIGURATION_Handle *cfg,
376 void *cc_cls); 396 void *cc_cls);
377 397
378 398
399/**
400 * Configure shared services at a controller. Using this function,
401 * you can specify that certain services (such as "resolver")
402 * should not be run for each peer but instead be shared
403 * across N peers on the specified host. This function
404 * must be called before any peers are created at the host.
405 *
406 * @param controller controller to configure
407 * @param service_name name of the service to share
408 * @param num_peers number of peers that should share one instance
409 * of the specified service (1 for no sharing is the default),
410 * use 0 to disable the service
411 */
412void
413GNUNET_TESTING_controller_configure_sharing (struct GNUNET_TESTING_Controller *controller,
414 const char *service_name,
415 uint32_t num_peers);
416
379 417
380/** 418/**
381 * Stop the given controller (also will terminate all peers and 419 * Stop the given controller (also will terminate all peers and
@@ -473,46 +511,6 @@ GNUNET_TESTING_peer_stop (struct GNUNET_TESTING_Peer *peer);
473 511
474 512
475/** 513/**
476 * Types of information that can be requested about a peer.
477 */
478enum GNUNET_TESTING_PeerInformationType
479{
480
481 /**
482 * Special value (not valid for requesting information)
483 * that is used in the event struct if a 'generic' pointer
484 * is returned (for other operations not related to this
485 * enumeration).
486 */
487 GNUNET_TESTING_PIT_GENERIC = 0,
488
489 /**
490 * What host is the peer running on? Returns a 'const struct
491 * GNUNET_TESTING_Host *'. Valid until
492 * 'GNUNET_TESTING_operation_done' is called.
493 */
494 GNUNET_TESTING_PIT_HOST,
495
496 /**
497 * What configuration is the peer using? Returns a 'const struct
498 * GNUNET_CONFIGURATION_Handle *'. Valid until
499 * 'GNUNET_TESTNIG_operation_done' is called. However, the
500 * values may be inaccurate if the peer is reconfigured in
501 * the meantime.
502 */
503 GNUNET_TESTING_PIT_CONFIGURATION,
504
505 /**
506 * What is the identity of the peer? Returns a
507 * 'const struct GNUNET_PeerIdentity *'. Valid until
508 * 'GNUNET_TESTNIG_operation_done' is called.
509 */
510 GNUNET_TESTING_PIT_IDENTITY
511
512};
513
514
515/**
516 * Request information about a peer. 514 * Request information about a peer.
517 * 515 *
518 * @param peer peer to request information about 516 * @param peer peer to request information about
@@ -601,7 +599,7 @@ GNUNET_TESTING_underlay_configure_link (void *op_cls,
601/** 599/**
602 * Topologies supported for testbeds. 600 * Topologies supported for testbeds.
603 */ 601 */
604enum GNUNET_TESTING_Topology 602enum GNUNET_TESTING_TopologyOption
605{ 603{
606 /** 604 /**
607 * A clique (everyone connected to everyone else). No options. 605 * A clique (everyone connected to everyone else). No options.
@@ -881,7 +879,7 @@ GNUNET_TESTING_testbed_create_va (struct GNUNET_TESTING_Controller *controller,
881 struct GNUNET_TESTING_Host **hosts, 879 struct GNUNET_TESTING_Host **hosts,
882 unsigned int num_peers, 880 unsigned int num_peers,
883 const struct GNUNET_CONFIGURATION_Handle *peer_cfg, 881 const struct GNUNET_CONFIGURATION_Handle *peer_cfg,
884 enum GNUNET_TESTING_Topology underlay_topology, 882 enum GNUNET_TESTING_TopologyOption underlay_topology,
885 va_list va); 883 va_list va);
886 884
887 885
@@ -907,7 +905,7 @@ GNUNET_TESTING_testbed_create (struct GNUNET_TESTING_Controller *controller,
907 struct GNUNET_TESTING_Host **hosts, 905 struct GNUNET_TESTING_Host **hosts,
908 unsigned int num_peers, 906 unsigned int num_peers,
909 const struct GNUNET_CONFIGURATION_Handle *peer_cfg, 907 const struct GNUNET_CONFIGURATION_Handle *peer_cfg,
910 enum GNUNET_TESTING_Topology underlay_topology, 908 enum GNUNET_TESTING_TopologyOption underlay_topology,
911 ...); 909 ...);
912 910
913 911