messages for inter-controller overlay connect
[oweals/gnunet.git] / src / include / gnunet_testing_lib-new.h
index d78e7d0c7617f814597ed2a93ab881741f0ec24f..802839d17045d077f6b6335634060e25f436f011 100644 (file)
@@ -60,7 +60,8 @@ struct GNUNET_TESTING_Peer;
 
 /**
  * Create a system handle.  There must only be one system
- * handle per operating system.
+ * handle per operating system.  Uses a default range for allowed ports.
+ * Ports are still tested for availability.
  *
  * @param testdir only the directory name without any path. This is used for
  *          all service homes; the directory will be created in a temporary
@@ -75,6 +76,30 @@ GNUNET_TESTING_system_create (const char *testdir,
                              const char *controller);
 
 
+/**
+ * Create a system handle.  There must only be one system
+ * handle per operating system.  Use this function directly
+ * if multiple system objects are created for the same host
+ * (only really useful when testing --- or to make the port
+ * range configureable).
+ *
+ * @param testdir only the directory name without any path. This is used for
+ *          all service homes; the directory will be created in a temporary
+ *          location depending on the underlying OS
+ * @param controller hostname of the controlling host, 
+ *        service configurations are modified to allow 
+ *        control connections from this host; can be NULL
+ * @param lowport lowest port number this system is allowed to allocate (inclusive)
+ * @param highport highest port number this system is allowed to allocate (exclusive)
+ * @return handle to this system, NULL on error
+ */
+struct GNUNET_TESTING_System *
+GNUNET_TESTING_system_create_with_portrange (const char *testdir,
+                                            const char *controller,
+                                            uint16_t lowport,
+                                            uint16_t highport);
+
+
 /**
  * Free system resources.
  *
@@ -137,9 +162,11 @@ GNUNET_TESTING_release_port (struct GNUNET_TESTING_System *system,
 
 
 /**
- * Create a new configuration using the given configuration
- * as a template; ports and paths will be modified to select
- * available ports on the local system.  If we run
+ * Create a new configuration using the given configuration as a template;
+ * ports and paths will be modified to select available ports on the local
+ * system. The default configuration will be available in PATHS section under
+ * the option DEFAULTCONFIG after the call. SERVICE_HOME is also set in PATHS
+ * section to the temporary directory specific to this configuration. If we run
  * out of "*port" numbers, return SYSERR.
  *
  * This is primarily a helper function used internally