clique topology
[oweals/gnunet.git] / src / testbed / testbed_api_hosts.h
index cc88d78a317cbc9e4d36c9a8f19da1e2435dc8b2..ea93579b0a3f31af4ca1ffdc66c5596ad74b4f18 100644 (file)
 #include "testbed_helper.h"
 
 
-/**
- * Wrapper around
- */
-struct GNUNET_TESTBED_HelperHandle
-{
-  /**
-   * The process handle
-   */
-  struct GNUNET_OS_Process *process;
-
-  /**
-   * Pipe connecting to stdin of the process.
-   */
-  struct GNUNET_DISK_PipeHandle *cpipe_in;
-
-  /**
-   * Pipe from the stdout of the process.
-   */
-  struct GNUNET_DISK_PipeHandle *cpipe_out;
-
-  /**
-   * The port number for ssh; used for helpers starting ssh
-   */
-  char *port;
-
-  /**
-   * The ssh destination string; used for helpers starting ssh
-   */
-  char *dst; 
-};
-
-
 /**
  * Lookup a host by ID.
- * 
+ *
  * @param id global host ID assigned to the host; 0 is
  *        reserved to always mean 'localhost'
  * @return handle to the host, NULL on error
@@ -78,7 +46,7 @@ GNUNET_TESTBED_host_lookup_by_id_ (uint32_t id);
  * Create a host by ID; given this host handle, we could not
  * run peers at the host, but we can talk about the host
  * internally.
- * 
+ *
  * @param id global host ID assigned to the host; 0 is
  *        reserved to always mean 'localhost'
  * @return handle to the host, NULL on error
@@ -89,7 +57,7 @@ GNUNET_TESTBED_host_create_by_id_ (uint32_t id);
 
 /**
  * Obtain a host's unique global ID.
- * 
+ *
  * @param host handle to the host, NULL means 'localhost'
  * @return id global host ID assigned to the host (0 is
  *         'localhost', but then obviously not globally unique)
@@ -100,7 +68,7 @@ GNUNET_TESTBED_host_get_id_ (const struct GNUNET_TESTBED_Host *host);
 
 /**
  * Obtain the host's hostname.
- * 
+ *
  * @param host handle to the host, NULL means 'localhost'
  * @return hostname of the host
  */
@@ -110,7 +78,7 @@ GNUNET_TESTBED_host_get_hostname_ (const struct GNUNET_TESTBED_Host *host);
 
 /**
  * Obtain the host's username
- * 
+ *
  * @param host handle to the host, NULL means 'localhost'
  * @return username to login to the host
  */
@@ -120,7 +88,7 @@ GNUNET_TESTBED_host_get_username_ (const struct GNUNET_TESTBED_Host *host);
 
 /**
  * Obtain the host's ssh port
- * 
+ *
  * @param host handle to the host, NULL means 'localhost'
  * @return username to login to the host
  */
@@ -134,28 +102,41 @@ GNUNET_TESTBED_host_get_ssh_port_ (const struct GNUNET_TESTBED_Host *host);
 struct GNUNET_TESTBED_HelperHandle;
 
 
-/**
- * Run a given helper process at the given host.  Communication
- * with the helper will be via GNUnet messages on stdin/stdout.
- * Runs the process via 'ssh' at the specified host, or locally.
- * Essentially an SSH-wrapper around the 'gnunet_helper_lib.h' API.
- * 
- * @param host host to use, use "NULL" for localhost
- * @param binary_argv binary name and command-line arguments to give to the binary
- * @return handle to terminate the command, NULL on error
- */
-struct GNUNET_TESTBED_HelperHandle *
-GNUNET_TESTBED_host_run_ (const struct GNUNET_TESTBED_Host *host,
-                         char *const binary_argv[]);
-
-
-/**
- * Stops a helper in the HelperHandle using GNUNET_HELPER_stop
- *
- * @param handle the handle returned from GNUNET_TESTBED_host_start_
- */
-void
-GNUNET_TESTBED_host_stop_ (struct GNUNET_TESTBED_HelperHandle *handle);
+/* /\** */
+/*  * Run a given helper process at the given host.  Communication */
+/*  * with the helper will be via GNUnet messages on stdin/stdout. */
+/*  * Runs the process via 'ssh' at the specified host, or locally. */
+/*  * Essentially an SSH-wrapper around the 'gnunet_helper_lib.h' API. */
+/*  *  */
+/*  * @param controller_ip the ip address of the controller. Will be set as TRUSTED */
+/*  *          host when starting testbed controller at host */
+/*  * @param host host to use, use "NULL" for localhost */
+/*  * @param binary_argv binary name and command-line arguments to give to the */
+/*  *          binary */
+/*  * @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 cb the callback to run when helper process dies; cannot be NULL */
+/*  * @param cb_cls the closure for the above callback */
+/*  * @return handle to terminate the command, NULL on error */
+/*  *\/ */
+/* struct GNUNET_TESTBED_HelperHandle * */
+/* GNUNET_TESTBED_host_run_ (const char *controller_ip, */
+/*                       const struct GNUNET_TESTBED_Host *host, */
+/*                       const struct GNUNET_CONFIGURATION_Handle *cfg, */
+/*                       GNUNET_HELPER_ExceptionCallback cb, */
+/*                       void *cb_cls); */
+
+
+
+/* /\** */
+/*  * Stops a helper in the HelperHandle using GNUNET_HELPER_stop */
+/*  * */
+/*  * @param handle the handle returned from GNUNET_TESTBED_host_start_ */
+/*  *\/ */
+/* void */
+/* GNUNET_TESTBED_host_stop_ (struct GNUNET_TESTBED_HelperHandle *handle); */
 
 
 /**
@@ -166,8 +147,8 @@ GNUNET_TESTBED_host_stop_ (struct GNUNET_TESTBED_HelperHandle *handle);
  */
 void
 GNUNET_TESTBED_mark_host_registered_at_ (struct GNUNET_TESTBED_Host *host,
-                                        const struct GNUNET_TESTBED_Controller
-                                        *controller);
+                                         const struct GNUNET_TESTBED_Controller
+                                         *controller);
 
 
 /**
@@ -179,21 +160,8 @@ GNUNET_TESTBED_mark_host_registered_at_ (struct GNUNET_TESTBED_Host *host,
  */
 int
 GNUNET_TESTBED_is_host_registered_ (const struct GNUNET_TESTBED_Host *host,
-                                   const struct GNUNET_TESTBED_Controller
-                                        *controller);
-
-
-/**
- * Creates a helper initialization message. Only for testing.
- *
- * @param cname the ip address of the controlling host
- * @param cfg the configuration that has to used to start the testbed service
- *          thru helper
- * @return the initialization message
- */
-struct GNUNET_TESTBED_HelperInit *
-GNUNET_TESTBED_create_helper_init_msg_ (const char *cname,
-                                        const struct GNUNET_CONFIGURATION_Handle *cfg);
+                                    const struct GNUNET_TESTBED_Controller
+                                    *controller);