/**
* The size of the link array
*/
- unsigned int link_array_size;
+ unsigned int link_array_size;
+
+ /**
+ * should the automatic retry be disabled
+ */
+ int disable_retry;
};
GNUNET_assert (op == link->op);
GNUNET_TESTBED_operation_done (op);
- link->op = NULL;
- if (NULL != emsg)
+ link->op = NULL;
+ tc = link->tc;
+ if ((NULL != emsg) && (GNUNET_NO == tc->disable_retry))
{
- tc = link->tc;
LOG (GNUNET_ERROR_TYPE_WARNING,
"Error while establishing a link: %s -- Retrying\n", emsg);
link->op =
{
for (p = 0; p < tc->link_array_size; p++)
if (NULL != tc->link_array[p].op)
- GNUNET_TESTBED_operation_cancel (tc->link_array[p].op);
+ GNUNET_TESTBED_operation_done (tc->link_array[p].op);
GNUNET_free (tc->link_array);
}
GNUNET_free (tc);
struct TopologyContext *tc;
struct GNUNET_TESTBED_Operation *op;
struct GNUNET_TESTBED_Controller *c;
+ enum GNUNET_TESTBED_TopologyOption secondary_option;
unsigned int cnt;
if (num_peers < 2)
{
tc->link_array[cnt-1].A = cnt-1;
tc->link_array[cnt-1].B = cnt;
+ tc->link_array[cnt-1].tc = tc;
}
break;
case GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI:
tc->link_array[cnt].tc = tc;
}
break;
+ case GNUNET_TESTBED_TOPOLOGY_CLIQUE:
+ tc->link_array_size = num_peers * (num_peers - 1);
+ tc->link_array = GNUNET_malloc (sizeof (struct OverlayLink) *
+ tc->link_array_size);
+ {
+ unsigned int offset;
+
+ offset = 0;
+ for (cnt=0; cnt < num_peers; cnt++)
+ {
+ unsigned int neighbour;
+
+ for (neighbour=0; neighbour < num_peers; neighbour++)
+ {
+ if (neighbour == cnt)
+ continue;
+ tc->link_array[offset].A = cnt;
+ tc->link_array[offset].B = neighbour;
+ tc->link_array[offset].tc = tc;
+ offset++;
+ }
+ }
+ }
+ break;
default:
GNUNET_break (0);
return NULL;
}
+ do
+ {
+ secondary_option = va_arg (va, enum GNUNET_TESTBED_TopologyOption);
+ switch (secondary_option)
+ {
+ case GNUNET_TESTBED_TOPOLOGY_DISABLE_AUTO_RETRY:
+ tc->disable_retry = GNUNET_YES;
+ break;
+ case GNUNET_TESTBED_TOPOLOGY_OPTION_END:
+ break;
+ default:
+ GNUNET_break (0); /* Should not use any other option apart from
+ the ones handled here */
+ GNUNET_free_non_null (tc->link_array);
+ GNUNET_free (tc);
+ return NULL;
+ }
+ } while (GNUNET_TESTBED_TOPOLOGY_OPTION_END != secondary_option);
op = GNUNET_TESTBED_operation_create_ (tc,
&opstart_overlay_configure_topology,
&oprelease_overlay_configure_topology);
GNUNET_TESTBED_operation_queue_insert_
(c->opq_parallel_topology_config_operations, op);
+ GNUNET_TESTBED_operation_begin_wait_ (op);
return op;
}
struct GNUNET_TESTBED_Operation *op;
va_list vargs;
+ GNUNET_assert (topo < GNUNET_TESTBED_TOPOLOGY_OPTION_END);
va_start (vargs, topo);
op = GNUNET_TESTBED_overlay_configure_topology_va (op_cls, num_peers, peers,
topo, vargs);