-more datacache integration work
[oweals/gnunet.git] / src / include / gnunet_testbed_service.h
index 60fcb64afd1feb1f220c6f8f8fa4d422853e80a3..4d60c3e6c51d22c52dbf3926e32c9f196eb95e95 100644 (file)
@@ -1,6 +1,6 @@
 /*
       This file is part of GNUnet
-      (C) 2008--2013 Christian Grothoff (and other contributing authors)
+      Copyright (C) 2008--2013 Christian Grothoff (and other contributing authors)
 
       GNUnet is free software; you can redistribute it and/or modify
       it under the terms of the GNU General Public License as published
@@ -1335,11 +1335,25 @@ GNUNET_TESTBED_get_statistics (unsigned int num_peers,
                                GNUNET_TESTBED_OperationCompletionCallback cont,
                                void *cls);
 
+
+/**
+ * Return the index of the peer inside of the total peer array,
+ * aka. the peer's "unique ID".
+ *
+ * @param peer Peer handle.
+ *
+ * @return The peer's unique ID.
+ */
+uint32_t
+GNUNET_TESTBED_get_index (const struct GNUNET_TESTBED_Peer *peer);
+
+
 /**
  * Handle for testbed run helper funtions
  */
 struct GNUNET_TESTBED_RunHandle;
 
+
 /**
  * Signature of a main function for a testcase.
  *
@@ -1354,12 +1368,13 @@ struct GNUNET_TESTBED_RunHandle;
  *          failed
  * @see GNUNET_TESTBED_test_run()
  */
-typedef void (*GNUNET_TESTBED_TestMaster)(void *cls,
-                                          struct GNUNET_TESTBED_RunHandle *h,
-                                          unsigned int num_peers,
-                                          struct GNUNET_TESTBED_Peer **peers,
-                                          unsigned int links_succeeded,
-                                          unsigned int links_failed);
+typedef void
+(*GNUNET_TESTBED_TestMaster)(void *cls,
+                             struct GNUNET_TESTBED_RunHandle *h,
+                             unsigned int num_peers,
+                             struct GNUNET_TESTBED_Peer **peers,
+                             unsigned int links_succeeded,
+                             unsigned int links_failed);
 
 
 /**
@@ -1435,7 +1450,7 @@ GNUNET_TESTBED_run (const char *host_filename,
  *                   respective 'enum GNUNET_TESTBED_EventType'
  *                   (i.e.  "(1LL << GNUNET_TESTBED_ET_CONNECT) || ...")
  * @param cc controller callback to invoke on events; This callback is called
- *        for all peer start events even if GNUNET_TESTBED_ET_PEER_START isn't
+ *        for all peer start events even if #GNUNET_TESTBED_ET_PEER_START isn't
  *        set in the event_mask as this is the only way get access to the
  *        handle of each peer
  * @param cc_cls closure for @a cc