testing function definitions, minor stuff
authorNathan S. Evans <evans@in.tum.de>
Tue, 10 Aug 2010 15:18:18 +0000 (15:18 +0000)
committerNathan S. Evans <evans@in.tum.de>
Tue, 10 Aug 2010 15:18:18 +0000 (15:18 +0000)
src/include/gnunet_core_service.h
src/include/gnunet_protocols.h
src/include/gnunet_testing_lib.h

index 5dac1fa3855260ccf0c80b2cca71b462ab34e6fa..caa02c6b299c7b38e2c59ac36bf8737163dde6cc 100644 (file)
@@ -87,7 +87,7 @@ typedef void (*GNUNET_CORE_PeerStatusEventHandler) (void *cls,
 
 
 /**
- * Method called whenever a given peer either disconnects.
+ * Method called whenever a peer disconnects.
  *
  * @param cls closure
  * @param peer peer identity this notification is about
index e3f266e2542137ed914e87e4cbd05fd108c98176..e56fec6253aaef638f493fc99f5e65b91136feff 100644 (file)
@@ -565,6 +565,11 @@ extern "C"
  */
 #define GNUNET_MESSAGE_TYPE_DHT_FIND_PEER_RESULT 151
 
+/**
+ * P2P DHT PING request type
+ */
+#define GNUNET_MESSAGE_TYPE_DHT_P2P_PING 152
+
 /**
  * Hostlist advertisement message
  */
index 479cb07e09c3eb068a0eaa97e8f894e175f3c93b..5145e2e09850ca25a6c84d6aaa2b0a4fcee72969 100644 (file)
@@ -33,6 +33,7 @@
 #define GNUNET_TESTING_LIB_H
 
 #include "gnunet_util_lib.h"
+#include "gnunet_statistics_service.h"
 
 #ifdef __cplusplus
 extern "C"
@@ -615,6 +616,32 @@ GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg,
                               GNUNET_TESTING_NotifyCompletion cb,
                               void *cb_cls);
 
+/**
+ * Callback function to process statistic values.
+ *
+ * @param cls closure
+ * @param peer the peer the statistics belong to
+ * @param subsystem name of subsystem that created the statistic
+ * @param name the name of the datum
+ * @param value the current value
+ * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not
+ * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration
+ */
+typedef int (*GNUNET_TESTING_STATISTICS_Iterator) (void *cls,
+                                                   const struct GNUNET_PeerIdentity *peer,
+                                                   const char *subsystem,
+                                                   const char *name,
+                                                   uint64_t value,
+                                                   int is_persistent);
+
+/**
+ * Iterate over all (running) peers in the peer group, retrieve
+ * all statistics from each.
+ */
+void
+GNUNET_TESTING_get_statistics (struct GNUNET_TESTING_PeerGroup *pg,
+                               GNUNET_STATISTICS_Callback cont,
+                               GNUNET_TESTING_STATISTICS_Iterator proc, void *cls);
 
 /**
  * Topologies supported for testbeds.