From 4d1b8809fe1df0f2524abc0e65f2f770c88adbdf Mon Sep 17 00:00:00 2001 From: Sree Harsha Totakura Date: Mon, 6 Jan 2014 22:44:10 +0000 Subject: [PATCH] -fixes --- src/testbed/generate-underlay-topology.c | 7 +++++-- src/testbed/testbed_api_topology.c | 3 +++ 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, unsigned int latency, unsigned int loss) { - GNUNET_break (0); + FPRINTF (stdout, "%u -> %u\n", A, B); return GNUNET_OK; } @@ -166,7 +166,7 @@ run (void *cls, char *const *args, const char *cfgfile, } break; default: - GNUNET_assert (0); + break; } /* contruct topologies */ switch (topology) @@ -209,6 +209,9 @@ int main (int argc, char *const argv[]) { struct GNUNET_GETOPT_CommandLineOption option[] = { + {'p', "num-peers", "COUNT", + gettext_noop ("create COUNT number of peers"), + GNUNET_YES, &GNUNET_GETOPT_set_uint, &num_peers}, GNUNET_GETOPT_OPTION_END }; 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) uint32_t A_rand; uint32_t B_rand; + if (1 == tc->num_peers) + return; if (GNUNET_YES == append) { index = tc->link_array_size; @@ -1468,6 +1470,7 @@ GNUNET_TESTBED_underlay_construct_ (int num_peers, GNUNET_assert (NULL != proc); ret = GNUNET_OK; memset (&tc, 0, sizeof (tc)); + tc.num_peers = num_peers; tc.type = TOPOLOGYCONTEXT_TYPE_UNDERLAY; underlay = &tc.u.underlay; va_start (vargs, cls); -- 2.25.1