*/
GNUNET_TESTBED_TOPOLOGY_RING,
+ /**
+ * Star topology. No options.
+ */
+ GNUNET_TESTBED_TOPOLOGY_STAR,
+
/**
* 2-d torus. No options.
*/
test_testbed_api_topology_clique \
test_testbed_api_testbed_run_topologyrandom \
test_testbed_api_testbed_run_topologyline \
+ test_testbed_api_testbed_run_topologystar \
test_testbed_api_testbed_run_topologyclique \
test_testbed_api_testbed_run_topologyring \
test_testbed_api_testbed_run_topologysmallworldring \
test_testbed_api_topology_clique \
test_testbed_api_testbed_run_topologyrandom \
test_testbed_api_testbed_run_topologyline \
+ test_testbed_api_testbed_run_topologystar \
test_testbed_api_testbed_run_topologyclique \
test_testbed_api_testbed_run_topologyring \
test_testbed_api_testbed_run_topology2dtorus \
$(top_builddir)/src/util/libgnunetutil.la \
libgnunettestbed.la
+test_testbed_api_testbed_run_topologystar_SOURCES = \
+ test_testbed_api_testbed_run.c
+test_testbed_api_testbed_run_topologystar_LDADD = \
+ $(top_builddir)/src/util/libgnunetutil.la \
+ libgnunettestbed.la
+
test_testbed_api_testbed_run_topologyclique_SOURCES = \
test_testbed_api_testbed_run.c
test_testbed_api_testbed_run_topologyclique_LDADD = \
test_testbed_api_test_timeout.conf \
test_testbed_api_template.conf \
test_testbed_api_testbed_run_topologyring.conf \
+ test_testbed_api_testbed_run_topologystar.conf \
test_testbed_api_testbed_run_topologyclique.conf \
test_testbed_api_testbed_run_topologyline.conf \
test_testbed_api_testbed_run_topologyrandom.conf \
{
case GNUNET_TESTBED_TOPOLOGY_LINE:
case GNUNET_TESTBED_TOPOLOGY_RING:
+ case GNUNET_TESTBED_TOPOLOGY_STAR:
case GNUNET_TESTBED_TOPOLOGY_CLIQUE:
case GNUNET_TESTBED_TOPOLOGY_2D_TORUS:
GNUNET_TESTBED_underlay_construct_ (num_peers, link_processor, NULL,
--- /dev/null
+@INLINE@ test_testbed_api_template.conf
+
+[testbed]
+OVERLAY_TOPOLOGY = STAR
*/
"RING",
+ /**
+ * Star topology. No options.
+ */
+ "STAR",
+
/**
* 2-d torus. No options.
*/
*/
"LINE",
+ /**
+ * Star topology. No options.
+ */
+ "STAR",
+
/**
* Read a topology from a given file. Followed by the name of the file (const char *).
*/
}
+/**
+ * Generates star topology
+ *
+ * @param tc the topology context
+ */
+static void
+gen_topo_star (struct TopologyContext *tc)
+{
+ unsigned int cnt;
+
+ tc->link_array_size = tc->num_peers - 1;
+ switch (tc->type)
+ {
+ case TOPOLOGYCONTEXT_TYPE_OVERLAY:
+ {
+ struct TopologyContextOverlay *overlay;
+
+ overlay = &tc->u.overlay;
+ overlay->link_array =
+ GNUNET_malloc (sizeof (struct OverlayLink) * tc->link_array_size);
+ }
+ break;
+ case TOPOLOGYCONTEXT_TYPE_UNDERLAY:
+ {
+ struct TopologyContextUnderlay *underlay;
+
+ underlay = &tc->u.underlay;
+ underlay->link_array =
+ GNUNET_malloc (sizeof (struct UnderlayLink) * tc->link_array_size);
+ }
+ break;
+ }
+ for (cnt = tc->link_array_size; cnt; cnt--)
+ make_link (0, 0, cnt, tc);
+}
+
+
/**
* Generates ring topology
*
case GNUNET_TESTBED_TOPOLOGY_LINE:
gen_topo_line (tc);
break;
+ case GNUNET_TESTBED_TOPOLOGY_STAR:
+ gen_topo_star (tc);
+ break;
case GNUNET_TESTBED_TOPOLOGY_RING:
gen_topo_ring (tc);
break;
case GNUNET_TESTBED_TOPOLOGY_LINE:
gen_topo_line (&tc);
break;
+ case GNUNET_TESTBED_TOPOLOGY_STAR:
+ gen_topo_star (&tc);
+ break;
case GNUNET_TESTBED_TOPOLOGY_RING:
gen_topo_ring (&tc);
break;