helper exception callback lesser parameters
[oweals/gnunet.git] / src / include / gnunet_testbed_service.h
index 2fffb0fc87b68596f846283c5f4b92dc9798027d..a190b67a729b91cff85a6da1be6bf37a7591df28 100644 (file)
@@ -29,6 +29,7 @@
 #define GNUNET_TESTBED_SERVICE_H
 
 #include "gnunet_util_lib.h"
+#include "gnunet_testing_lib-new.h"
 
 #ifdef __cplusplus
 extern "C"
@@ -402,13 +403,41 @@ struct GNUNET_TESTBED_ControllerProc;
 
 
 /**
- * Starts a controller process at the host
+ * Function called on errors with the controller.
  *
+ * @param cls closure
+ * @param emsg error message if available; can be NULL, which does NOT mean
+ *             that there was no error
+ */
+typedef void (*GNUNET_TESTBED_ControllerErrorCallback)(void *cls,
+                                                      const char *emsg);
+
+
+/**
+ * Starts a controller process at the host. FIXME: add controller start callback
+ * with the configuration with which the controller is started
+ *
+ * @param controller_ip the ip address of the controller. Will be set as TRUSTED
+ *          host when starting testbed controller at host
  * @param host the host where the controller has to be started; NULL for localhost
- * @return the controller process handle
+ * @param cfg template configuration to use for the remote controller; the
+ *          remote controller will be started with a slightly modified
+ *          configuration (port numbers, unix domain sockets and service home
+ *          values are changed as per TESTING library on the remote host)
+ * @param cec function called if the contoller dies unexpectedly; will not be 
+ *            invoked after GNUNET_TESTBED_controller_stop, if 'cec' was called,
+ *            GNUNET_TESTBED_controller_stop must no longer be called; will
+ *            never be called in the same task as 'GNUNET_TESTBED_controller_start'
+ *            (synchronous errors will be signalled by returning NULL)
+ * @param cec_cls closure for 'cec'
+ * @return the controller process handle, NULL on errors
  */
 struct GNUNET_TESTBED_ControllerProc *
-GNUNET_TESTBED_controller_start (struct GNUNET_TESTBED_Host *host);
+GNUNET_TESTBED_controller_start (const char *controller_ip,
+                                struct GNUNET_TESTBED_Host *host,
+                                const struct GNUNET_CONFIGURATION_Handle *cfg,
+                                GNUNET_TESTBED_ControllerErrorCallback cec,
+                                void *cec_cls);
 
 
 /**
@@ -564,9 +593,9 @@ GNUNET_TESTBED_controller_link (struct GNUNET_TESTBED_Controller *master,
  * @param delegated_host requests to which host should be delegated; cannot be NULL
  * @param slave_host which host is used to run the slave controller; use NULL to
  *          make the master controller connect to the delegated host
- * @param scfg serialized and compressed configuration
- * @param scfg_size the size scfg
- * @param cfg_size the size of uncompressed serialized configuration
+ * @param sxcfg serialized and compressed configuration
+ * @param sxcfg_size the size scfg
+ * @param scfg_size the size of uncompressed serialized configuration
  * @param is_subordinate GNUNET_YES if the controller at delegated_host should
  *          be started by the master controller; GNUNET_NO if we are just
  *          allowed to use the slave via TCP/IP
@@ -575,9 +604,9 @@ void
 GNUNET_TESTBED_controller_link_2 (struct GNUNET_TESTBED_Controller *master,
                                  struct GNUNET_TESTBED_Host *delegated_host,
                                  struct GNUNET_TESTBED_Host *slave_host,
-                                 const char *scfg,
+                                 const char *sxcfg,
+                                 size_t sxcfg_size,
                                  size_t scfg_size,
-                                 size_t cfg_size,
                                  int is_subordinate);