aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_testing_service.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-04-30 18:15:38 +0000
committerChristian Grothoff <christian@grothoff.org>2012-04-30 18:15:38 +0000
commit624967dfd6e1bfdeae0052e6fb1d614893638f63 (patch)
tree39237c40e028513c93a51852f0d61ec41461fe6a /src/include/gnunet_testing_service.h
parent40df6b7920d1f83945a9e6896cb0e30e9d90bf65 (diff)
downloadgnunet-624967dfd6e1bfdeae0052e6fb1d614893638f63.tar.gz
gnunet-624967dfd6e1bfdeae0052e6fb1d614893638f63.zip
-further revisions on testing API and new testing IPC message definitions
Diffstat (limited to 'src/include/gnunet_testing_service.h')
-rw-r--r--src/include/gnunet_testing_service.h48
1 files changed, 42 insertions, 6 deletions
diff --git a/src/include/gnunet_testing_service.h b/src/include/gnunet_testing_service.h
index 2ecb23915..a21f74b17 100644
--- a/src/include/gnunet_testing_service.h
+++ b/src/include/gnunet_testing_service.h
@@ -25,11 +25,10 @@
25 * @author Christian Grothoff 25 * @author Christian Grothoff
26 */ 26 */
27 27
28#ifndef GNUNET_TESTING_LIB_H 28#ifndef GNUNET_TESTING_SERVICE_H
29#define GNUNET_TESTING_LIB_H 29#define GNUNET_TESTING_SERVICE_H
30 30
31#include "gnunet_util_lib.h" 31#include "gnunet_util_lib.h"
32#include "gnunet_statistics_service.h"
33 32
34#ifdef __cplusplus 33#ifdef __cplusplus
35extern "C" 34extern "C"
@@ -273,11 +272,40 @@ struct GNUNET_TESTING_EventInformation
273 const char *emsg; 272 const char *emsg;
274 273
275 /** 274 /**
275 * Peer information type; captures which of the types
276 * in the 'op_result' is actually in use.
277 */
278 enum GNUNET_TESTING_PeerInformationType pit;
279
280 /**
276 * Pointer to an operation-specific return value; NULL on error; 281 * Pointer to an operation-specific return value; NULL on error;
277 * can be NULL for certain operations. Valid until 282 * can be NULL for certain operations. Valid until
278 * 'GNUNET_TESTNG_operation_done' is called. 283 * 'GNUNET_TESTING_operation_done' is called.
279 */ 284 */
280 void *op_result; 285 union
286 {
287 /**
288 * No result (NULL pointer) or generic result
289 * (whatever the GNUNET_TESTING_ConnectAdapter returned).
290 */
291 void *generic;
292
293 /**
294 * Identity of host running the peer.
295 */
296 struct GNUNET_TESTING_Host *host;
297
298 /**
299 * Identity of the peer.
300 */
301 const struct GNUNET_PeerIdentity *pid;
302
303 /**
304 * Configuration of the peer.
305 */
306 const struct GNUNET_CONFIGURATION_Handle *cfg;
307
308 } op_result;
281 309
282 } operation_finished; 310 } operation_finished;
283 311
@@ -449,9 +477,17 @@ enum GNUNET_TESTING_PeerInformationType
449{ 477{
450 478
451 /** 479 /**
480 * Special value (not valid for requesting information)
481 * that is used in the event struct if a 'generic' pointer
482 * is returned (for other operations not related to this
483 * enumeration).
484 */
485 GNUNET_TESTING_PIT_GENERIC = 0,
486
487 /**
452 * What host is the peer running on? Returns a 'const struct 488 * What host is the peer running on? Returns a 'const struct
453 * GNUNET_TESTING_Host *'. Valid until 489 * GNUNET_TESTING_Host *'. Valid until
454 * 'GNUNET_TESTNIG_operation_done' is called. 490 * 'GNUNET_TESTING_operation_done' is called.
455 */ 491 */
456 GNUNET_TESTING_PIT_HOST, 492 GNUNET_TESTING_PIT_HOST,
457 493