From: Nathan S. Evans Date: Tue, 10 Aug 2010 15:18:18 +0000 (+0000) Subject: testing function definitions, minor stuff X-Git-Tag: initial-import-from-subversion-38251~20721 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=98d0dea1af964cd623279f027bc63d54e5775ab7;p=oweals%2Fgnunet.git testing function definitions, minor stuff --- diff --git a/src/include/gnunet_core_service.h b/src/include/gnunet_core_service.h index 5dac1fa38..caa02c6b2 100644 --- a/src/include/gnunet_core_service.h +++ b/src/include/gnunet_core_service.h @@ -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 diff --git a/src/include/gnunet_protocols.h b/src/include/gnunet_protocols.h index e3f266e25..e56fec625 100644 --- a/src/include/gnunet_protocols.h +++ b/src/include/gnunet_protocols.h @@ -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 */ diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h index 479cb07e0..5145e2e09 100644 --- a/src/include/gnunet_testing_lib.h +++ b/src/include/gnunet_testing_lib.h @@ -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.