aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/testbed/generate-underlay-topology.c7
-rw-r--r--src/testbed/testbed_api_topology.c3
2 files changed, 8 insertions, 2 deletions
diff --git a/src/testbed/generate-underlay-topology.c b/src/testbed/generate-underlay-topology.c
index 427c8e66a..1a432ec03 100644
--- a/src/testbed/generate-underlay-topology.c
+++ b/src/testbed/generate-underlay-topology.c
@@ -72,7 +72,7 @@ link_processor (void *cls,
72 unsigned int latency, 72 unsigned int latency,
73 unsigned int loss) 73 unsigned int loss)
74{ 74{
75 GNUNET_break (0); 75 FPRINTF (stdout, "%u -> %u\n", A, B);
76 return GNUNET_OK; 76 return GNUNET_OK;
77} 77}
78 78
@@ -166,7 +166,7 @@ run (void *cls, char *const *args, const char *cfgfile,
166 } 166 }
167 break; 167 break;
168 default: 168 default:
169 GNUNET_assert (0); 169 break;
170 } 170 }
171 /* contruct topologies */ 171 /* contruct topologies */
172 switch (topology) 172 switch (topology)
@@ -209,6 +209,9 @@ int
209main (int argc, char *const argv[]) 209main (int argc, char *const argv[])
210{ 210{
211 struct GNUNET_GETOPT_CommandLineOption option[] = { 211 struct GNUNET_GETOPT_CommandLineOption option[] = {
212 {'p', "num-peers", "COUNT",
213 gettext_noop ("create COUNT number of peers"),
214 GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_peers},
212 GNUNET_GETOPT_OPTION_END 215 GNUNET_GETOPT_OPTION_END
213 }; 216 };
214 int ret; 217 int ret;
diff --git a/src/testbed/testbed_api_topology.c b/src/testbed/testbed_api_topology.c
index 99ab76f8b..1be614ad6 100644
--- a/src/testbed/testbed_api_topology.c
+++ b/src/testbed/testbed_api_topology.c
@@ -725,6 +725,8 @@ gen_topo_random (struct TopologyContext *tc, unsigned int links, int append)
725 uint32_t A_rand; 725 uint32_t A_rand;
726 uint32_t B_rand; 726 uint32_t B_rand;
727 727
728 if (1 == tc->num_peers)
729 return;
728 if (GNUNET_YES == append) 730 if (GNUNET_YES == append)
729 { 731 {
730 index = tc->link_array_size; 732 index = tc->link_array_size;
@@ -1468,6 +1470,7 @@ GNUNET_TESTBED_underlay_construct_ (int num_peers,
1468 GNUNET_assert (NULL != proc); 1470 GNUNET_assert (NULL != proc);
1469 ret = GNUNET_OK; 1471 ret = GNUNET_OK;
1470 memset (&tc, 0, sizeof (tc)); 1472 memset (&tc, 0, sizeof (tc));
1473 tc.num_peers = num_peers;
1471 tc.type = TOPOLOGYCONTEXT_TYPE_UNDERLAY; 1474 tc.type = TOPOLOGYCONTEXT_TYPE_UNDERLAY;
1472 underlay = &tc.u.underlay; 1475 underlay = &tc.u.underlay;
1473 va_start (vargs, cls); 1476 va_start (vargs, cls);