+/**
+ * Get a topology from a string input.
+ *
+ * @param topology where to write the retrieved topology
+ * @param topology_string The string to attempt to
+ * get a configuration value from
+ * @return GNUNET_YES if topology string matched a
+ * known topology, GNUNET_NO if not
+ */
+int
+GNUNET_TESTING_topology_get(enum GNUNET_TESTING_Topology *topology, char * topology_string)
+{
+ int found = 0;
+ int curr = 0;
+
+ if (topology_string == NULL)
+ return GNUNET_NO;
+
+ do
+ {
+ if (strcmp(GNUNET_TESTING_TopologyStrings[curr], topology_string) == 0)
+ {
+ found = GNUNET_YES;
+ break;
+ }
+ curr++;
+ } while (strcmp(GNUNET_TESTING_TopologyStrings[curr], "NONE") != 0);
+ *topology = curr;
+ if (found)
+ return GNUNET_YES;
+ else
+ return GNUNET_NO;
+}
+
+/**
+ * Get connect topology option from string input.
+ *
+ * @param topology where to write the retrieved topology
+ * @param topology_string The string to attempt to
+ * get a configuration value from
+ * @return GNUNET_YES if string matched a known
+ * topology option, GNUNET_NO if not
+ */
+int
+GNUNET_TESTING_topology_option_get(enum GNUNET_TESTING_TopologyOption *topology, char * topology_string)
+{
+ int found = 0;
+ int curr = 0;
+
+ if (topology_string == NULL)
+ return GNUNET_NO;
+
+ do
+ {
+ if (strcmp(GNUNET_TESTING_TopologyOptionStrings[curr], topology_string) == 0)
+ {
+ found = GNUNET_YES;
+ break;
+ }
+ curr++;
+ } while (strcmp(GNUNET_TESTING_TopologyOptionStrings[curr], "CONNECT_NONE") != 0);
+ *topology = curr;
+ if (found)
+ return GNUNET_YES;
+ else
+ return GNUNET_NO;
+}