iterate topoogy header related stuff
[oweals/gnunet.git] / src / include / gnunet_testing_lib.h
index 04a2d8191e8411b976f68f86f34cd373698cbf49..479cb07e09c3eb068a0eaa97e8f894e175f3c93b 100644 (file)
@@ -363,6 +363,23 @@ typedef void (*GNUNET_TESTING_NotifyConnection)(void *cls,
                                                 struct GNUNET_TESTING_Daemon *second_daemon,
                                                 const char *emsg);
 
+/**
+ * Prototype of a callback function indicating that two peers
+ * are currently connected.
+ *
+ * @param cls closure
+ * @param first peer id for first daemon
+ * @param second peer id for the second daemon
+ * @param distance distance between the connected peers
+ * @param emsg error message (NULL on success)
+ */
+typedef void (*GNUNET_TESTING_NotifyTopology)(void *cls,
+                                              const struct GNUNET_PeerIdentity *first,
+                                              const struct GNUNET_PeerIdentity *second,
+                                              struct GNUNET_TIME_Relative latency,
+                                              uint32_t distance,
+                                              const char *emsg);
+
 /**
  * Starts a GNUnet daemon.  GNUnet must be installed on the target
  * system and available in the PATH.  The machine must furthermore be
@@ -742,6 +759,17 @@ GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg,
                                 enum GNUNET_TESTING_Topology restrict_topology,
                                 char *restrict_transports);
 
+/**
+ * Iterate over all (running) peers in the peer group, retrieve
+ * all connections that each currently has.
+ *
+ * @param pg the peer group we are concerned with
+ * @param cb callback for topology information
+ * @param cls closure for callback
+ */
+void
+GNUNET_TESTING_get_topology (struct GNUNET_TESTING_PeerGroup *pg, GNUNET_TESTING_NotifyTopology cb, void *cls);
+
 /**
  * There are many ways to connect peers that are supported by this function.
  * To connect peers in the same topology that was created via the