/*
This file is part of GNUnet
- (C) 2008--2013 Christian Grothoff (and other contributing authors)
+ Copyright (C) 2008--2013 GNUnet e.V.
GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
You should have received a copy of the GNU General Public License
along with GNUnet; see the file COPYING. If not, write to the
- Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA.
+ Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
*/
/**
LOG (GNUNET_ERROR_TYPE_WARNING, "Host with id: %u already created\n", id);
return NULL;
}
- host = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_Host));
+ host = GNUNET_new (struct GNUNET_TESTBED_Host);
host->hostname = (NULL != hostname) ? GNUNET_strdup (hostname) : NULL;
host->username = (NULL != username) ? GNUNET_strdup (username) : NULL;
host->id = id;
GNUNET_CONFIGURATION_Handle *cfg,
struct GNUNET_TESTBED_Host ***hosts)
{
-#if !ENABLE_LL
+#if !ENABLE_SUPERMUC
LOG (GNUNET_ERROR_TYPE_ERROR,
_("The function %s is only available when compiled with (--with-ll)\n"),
__func__);
return;
}
}
- rc = GNUNET_malloc (sizeof (struct RegisteredController));
+ rc = GNUNET_new (struct RegisteredController);
rc->controller = controller;
GNUNET_CONTAINER_DLL_insert_tail (host->rc_head, host->rc_tail, rc);
}
for (argp = 0; NULL != argv[argp]; argp++) ;
argv_dup = GNUNET_malloc (sizeof (char *) * (argp + 1));
for (argp = 0; NULL != argv[argp]; argp++)
- argv_dup[argp] = strdup (argv[argp]);
+ argv_dup[argp] = GNUNET_strdup (argv[argp]);
return argv_dup;
}
* should not mention `-p' (port) option and destination address as these will
* be set locally in the function from its parameteres. If the environmental
* variable is not found then it defaults to `ssh -o BatchMode=yes -o
- * NoHostAuthenticationForLocalhost=yes'
+ * NoHostAuthenticationForLocalhost=yes -o StrictHostkeyChecking=no -o
+ * PasswordAuthentication=noc'
*
* @param port the destination port number
* @param hostname the hostname of the target host
"BatchMode=yes",
"-o",
"NoHostAuthenticationForLocalhost=yes",
+ "-o",
+ "StrictHostKeyChecking=no",
+ "-o",
+ "PasswordAuthentication=no",
"%h",
NULL
};
host->locked = GNUNET_YES;
API_VIOLATION (GNUNET_NO == host->controller_started,
"Attempting to start a controller on a host which is already started a controller");
- cp = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_ControllerProc));
+ cp = GNUNET_new (struct GNUNET_TESTBED_ControllerProc);
if (0 == GNUNET_TESTBED_host_get_id_ (host))
{
cp->helper =
GNUNET_asprintf (&port, "%u", host->port);
LOG_DEBUG ("Starting remote connection to destination %s\n", hostname);
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (cfg, "testbed",
+ GNUNET_CONFIGURATION_get_value_filename (cfg, "testbed",
"HELPER_BINARY_PATH",
&helper_binary_path_args[0]))
helper_binary_path_args[0] =
/**
* Task id for the habitability check task
*/
- GNUNET_SCHEDULER_TaskIdentifier habitability_check_task;
+ struct GNUNET_SCHEDULER_Task * habitability_check_task;
/**
* How long we wait before checking the process status. Should grow
* Task for checking whether a host is habitable or not
*
* @param cls GNUNET_TESTBED_HostHabitableCheckHandle
- * @param tc the scheduler task context
*/
static void
-habitability_check (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+habitability_check (void *cls)
{
struct GNUNET_TESTBED_HostHabitableCheckHandle *h = cls;
void *cb_cls;
enum GNUNET_OS_ProcessStatusType type;
int ret;
- h->habitability_check_task = GNUNET_SCHEDULER_NO_TASK;
+ h->habitability_check_task = NULL;
ret = GNUNET_OS_process_status (h->auxp, &type, &code);
if (GNUNET_SYSERR == ret)
{
const char *hostname;
char *port;
- h = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_HostHabitableCheckHandle));
+ h = GNUNET_new (struct GNUNET_TESTBED_HostHabitableCheckHandle);
h->cb = cb;
h->cb_cls = cb_cls;
h->host = host;
hostname = (NULL == host->hostname) ? "127.0.0.1" : host->hostname;
if (GNUNET_OK !=
- GNUNET_CONFIGURATION_get_value_string (config, "testbed",
+ GNUNET_CONFIGURATION_get_value_filename (config, "testbed",
"HELPER_BINARY_PATH",
&stat_args[1]))
stat_args[1] =
free_argv (rsh_args);
h->auxp =
GNUNET_OS_start_process_vap (GNUNET_NO, GNUNET_OS_INHERIT_STD_ERR, NULL,
- NULL, h->helper_argv[0], h->helper_argv);
+ NULL, NULL, h->helper_argv[0], h->helper_argv);
if (NULL == h->auxp)
{
GNUNET_break (0); /* Cannot exec SSH? */
*handle)
{
GNUNET_SCHEDULER_cancel (handle->habitability_check_task);
- (void) GNUNET_OS_process_kill (handle->auxp, SIGTERM);
+ (void) GNUNET_OS_process_kill (handle->auxp, GNUNET_TERM_SIG);
(void) GNUNET_OS_process_wait (handle->auxp);
GNUNET_OS_process_destroy (handle->auxp);
free_argv (handle->helper_argv);
(NULL == hostname) ? "localhost" : hostname);
return NULL;
}
- rh = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_HostRegistrationHandle));
+ rh = GNUNET_new (struct GNUNET_TESTBED_HostRegistrationHandle);
rh->host = host;
rh->c = controller;
GNUNET_assert (NULL != cc);