GNUnet is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 2, or (at your
+ by the Free Software Foundation; either version 3, or (at your
option) any later version.
GNUnet is distributed in the hope that it will be useful, but
return GNUNET_NO;
while (topology_strings[curr] != NULL)
{
- if (strcmp(topology_strings[curr], topology_string) == 0)
+ if (strcasecmp(topology_strings[curr], topology_string) == 0)
{
*topology = curr;
return GNUNET_YES;
* topology option, GNUNET_NO if not
*/
int
-GNUNET_TESTING_topology_option_get(enum GNUNET_TESTING_TopologyOption *topology_option,
- char * topology_string)
+GNUNET_TESTING_topology_option_get (enum GNUNET_TESTING_TopologyOption *topology_option,
+ char * topology_string)
{
/**
* Options for connecting a topology as strings.
return GNUNET_NO;
while (NULL != topology_option_strings[curr])
{
- if (strcmp(topology_option_strings[curr], topology_string) == 0)
+ if (strcasecmp(topology_option_strings[curr], topology_string) == 0)
{
*topology_option = curr;
return GNUNET_YES;
{
GNUNET_asprintf(&allowed_hosts, "%s; 127.0.0.1;", control_host);
GNUNET_CONFIGURATION_set_value_string(uc.ret, "core", "ACCEPT_FROM", allowed_hosts);
+ GNUNET_CONFIGURATION_set_value_string(uc.ret, "transport", "ACCEPT_FROM", allowed_hosts);
GNUNET_free_non_null(control_host);
GNUNET_free(allowed_hosts);
}
* @param cb_cls closure for cb
* @param connect_callback function to call each time two hosts are connected
* @param connect_callback_cls closure for connect_callback
- * @param hostnames space-separated list of hostnames to use; can be NULL (to run
- * everything on localhost).
+ * @param hostnames linked list of hosts to use to start peers on (NULL to run on localhost only)
+ *
* @return NULL on error, otherwise handle to control peer group
*/
struct GNUNET_TESTING_PeerGroup *
void *cb_cls,
GNUNET_TESTING_NotifyConnection
connect_callback, void *connect_callback_cls,
- const char *hostnames)
+ const struct GNUNET_TESTING_Host *hostnames)
{
struct GNUNET_TESTING_PeerGroup *pg;
- const char *rpos;
+ const struct GNUNET_TESTING_Host *hostpos;
+#if 0
char *pos;
+ const char *rpos;
char *start;
+#endif
const char *hostname;
char *baseservicehome;
char *newservicehome;
pg->peers = GNUNET_malloc (total * sizeof (struct PeerData));
if (NULL != hostnames)
{
+ off = 2;
+ hostpos = hostnames;
+ while (hostpos != NULL)
+ {
+ hostpos = hostpos->next;
+ off++;
+ }
+ pg->hosts = GNUNET_malloc (off * sizeof (struct HostData));
+ off = 0;
+
+ hostpos = hostnames;
+ while (hostpos != NULL)
+ {
+ pg->hosts[off].minport = LOW_PORT;
+ pg->hosts[off++].hostname = GNUNET_strdup(hostpos->hostname);
+ hostpos = hostpos->next;
+ }
+
+ if (off == 0)
+ {
+ GNUNET_free (pg->hosts);
+ pg->hosts = NULL;
+ }
+ hostcnt = off;
+ minport = 0;
+
+#if NO_LL
off = 2;
/* skip leading spaces */
while ((0 != *hostnames) && (isspace ( (unsigned char) *hostnames)))
}
hostcnt = off;
minport = 0; /* make gcc happy */
+#endif
}
else
{
shutdown_cb = NULL;
shutdown_ctx = NULL;
- if ((cb != NULL) && (pg->total > 0))
+ if (cb != NULL)
{
shutdown_ctx = GNUNET_malloc(sizeof(struct ShutdownContext));
shutdown_ctx->cb = cb;