From 00a452de44319475a603552c9635799612b559f7 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 3 May 2012 17:43:01 +0000 Subject: [PATCH] -fix --- src/include/gnunet_testing_service.h | 124 +++++++++++++-------------- 1 file 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 @@ -99,26 +99,6 @@ GNUNET_TESTING_hosts_load_from_file (const char *filename, struct GNUNET_TESTING_Host **hosts); -/** - * Configure shared services at a peer. Using this function, - * you can specify that certain services (such as "resolver") - * should not be run for each peer but instead be shared - * across N peers on the specified host. This function - * must be called before any peers are created at the host. - * - * @param host host to configure - * @param service_name name of the service to share - * @param num_peers number of peers that should share one instance - * of the specified service (1 for no sharing is the default), - * use 0 to disable the service - */ -void -GNUNET_TESTING_host_configure (struct GNUNET_TESTING_Host *host, - const char *service_name, - uint32_t num_peers); -// FIXME: make this controller-configure? - - /** * Destroy a host handle. Must only be called once everything * running on that host has been stopped. @@ -168,6 +148,46 @@ enum GNUNET_TESTING_EventType }; +/** + * Types of information that can be requested about a peer. + */ +enum GNUNET_TESTING_PeerInformationType +{ + + /** + * Special value (not valid for requesting information) + * that is used in the event struct if a 'generic' pointer + * is returned (for other operations not related to this + * enumeration). + */ + GNUNET_TESTING_PIT_GENERIC = 0, + + /** + * What host is the peer running on? Returns a 'const struct + * GNUNET_TESTING_Host *'. Valid until + * 'GNUNET_TESTING_operation_done' is called. + */ + GNUNET_TESTING_PIT_HOST, + + /** + * What configuration is the peer using? Returns a 'const struct + * GNUNET_CONFIGURATION_Handle *'. Valid until + * 'GNUNET_TESTNIG_operation_done' is called. However, the + * values may be inaccurate if the peer is reconfigured in + * the meantime. + */ + GNUNET_TESTING_PIT_CONFIGURATION, + + /** + * What is the identity of the peer? Returns a + * 'const struct GNUNET_PeerIdentity *'. Valid until + * 'GNUNET_TESTNIG_operation_done' is called. + */ + GNUNET_TESTING_PIT_IDENTITY + +}; + + /** * Argument to GNUNET_TESTING_ControllerCallback with details about * the event. @@ -376,6 +396,24 @@ GNUNET_TESTING_controller_start (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cc_cls); +/** + * Configure shared services at a controller. Using this function, + * you can specify that certain services (such as "resolver") + * should not be run for each peer but instead be shared + * across N peers on the specified host. This function + * must be called before any peers are created at the host. + * + * @param controller controller to configure + * @param service_name name of the service to share + * @param num_peers number of peers that should share one instance + * of the specified service (1 for no sharing is the default), + * use 0 to disable the service + */ +void +GNUNET_TESTING_controller_configure_sharing (struct GNUNET_TESTING_Controller *controller, + const char *service_name, + uint32_t num_peers); + /** * Stop the given controller (also will terminate all peers and @@ -472,46 +510,6 @@ struct GNUNET_TESTING_Operation * GNUNET_TESTING_peer_stop (struct GNUNET_TESTING_Peer *peer); -/** - * Types of information that can be requested about a peer. - */ -enum GNUNET_TESTING_PeerInformationType -{ - - /** - * Special value (not valid for requesting information) - * that is used in the event struct if a 'generic' pointer - * is returned (for other operations not related to this - * enumeration). - */ - GNUNET_TESTING_PIT_GENERIC = 0, - - /** - * What host is the peer running on? Returns a 'const struct - * GNUNET_TESTING_Host *'. Valid until - * 'GNUNET_TESTING_operation_done' is called. - */ - GNUNET_TESTING_PIT_HOST, - - /** - * What configuration is the peer using? Returns a 'const struct - * GNUNET_CONFIGURATION_Handle *'. Valid until - * 'GNUNET_TESTNIG_operation_done' is called. However, the - * values may be inaccurate if the peer is reconfigured in - * the meantime. - */ - GNUNET_TESTING_PIT_CONFIGURATION, - - /** - * What is the identity of the peer? Returns a - * 'const struct GNUNET_PeerIdentity *'. Valid until - * 'GNUNET_TESTNIG_operation_done' is called. - */ - GNUNET_TESTING_PIT_IDENTITY - -}; - - /** * Request information about a peer. * @@ -601,7 +599,7 @@ GNUNET_TESTING_underlay_configure_link (void *op_cls, /** * Topologies supported for testbeds. */ -enum GNUNET_TESTING_Topology +enum GNUNET_TESTING_TopologyOption { /** * A clique (everyone connected to everyone else). No options. @@ -881,7 +879,7 @@ GNUNET_TESTING_testbed_create_va (struct GNUNET_TESTING_Controller *controller, struct GNUNET_TESTING_Host **hosts, unsigned int num_peers, const struct GNUNET_CONFIGURATION_Handle *peer_cfg, - enum GNUNET_TESTING_Topology underlay_topology, + enum GNUNET_TESTING_TopologyOption underlay_topology, va_list va); @@ -907,7 +905,7 @@ GNUNET_TESTING_testbed_create (struct GNUNET_TESTING_Controller *controller, struct GNUNET_TESTING_Host **hosts, unsigned int num_peers, const struct GNUNET_CONFIGURATION_Handle *peer_cfg, - enum GNUNET_TESTING_Topology underlay_topology, + enum GNUNET_TESTING_TopologyOption underlay_topology, ...); -- 2.25.1