diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-09-02 10:48:55 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-09-02 10:48:55 +0000 |
commit | 4fe5a61f8149aeaf7da9f32408b3c3195695e0c4 (patch) | |
tree | 488098f4046cbeb5dde6e33a19aa51425924b76a /src/include | |
parent | 6b7b591bb3cb3b1fe94b0cc573578a05e4f5a9d3 (diff) | |
download | gnunet-4fe5a61f8149aeaf7da9f32408b3c3195695e0c4.tar.gz gnunet-4fe5a61f8149aeaf7da9f32408b3c3195695e0c4.zip |
typos
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_testing_lib.h | 98 |
1 files changed, 63 insertions, 35 deletions
diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h index 5bedc406c..42ee990c9 100644 --- a/src/include/gnunet_testing_lib.h +++ b/src/include/gnunet_testing_lib.h | |||
@@ -114,7 +114,6 @@ typedef void (*GNUNET_TESTING_NotifyDaemonRunning) (void *cls, | |||
114 | struct GNUNET_TESTING_Daemon | 114 | struct GNUNET_TESTING_Daemon |
115 | * d, const char *emsg); | 115 | * d, const char *emsg); |
116 | 116 | ||
117 | |||
118 | /** | 117 | /** |
119 | * Handle to an entire testbed of GNUnet peers. | 118 | * Handle to an entire testbed of GNUnet peers. |
120 | */ | 119 | */ |
@@ -305,63 +304,66 @@ struct GNUNET_TESTING_Daemon | |||
305 | void *update_cb_cls; | 304 | void *update_cb_cls; |
306 | 305 | ||
307 | /** | 306 | /** |
308 | * Identity of this peer (once started). | 307 | * PID of the process that we started last. |
309 | */ | 308 | */ |
310 | struct GNUNET_PeerIdentity id; | 309 | struct GNUNET_OS_Process *proc; |
311 | 310 | ||
312 | /** | 311 | /** |
313 | * Flag to indicate that we've already been asked | 312 | * Handle to the server. |
314 | * to terminate (but could not because some action | ||
315 | * was still pending). | ||
316 | */ | 313 | */ |
317 | int dead; | 314 | struct GNUNET_CORE_Handle *server; |
318 | 315 | ||
319 | /** | 316 | /** |
320 | * GNUNET_YES if the hostkey has been created | 317 | * Handle to the transport service of this peer |
321 | * for this peer, GNUNET_NO otherwise. | ||
322 | */ | 318 | */ |
323 | int have_hostkey; | 319 | struct GNUNET_TRANSPORT_Handle *th; |
324 | 320 | ||
325 | /** | 321 | /** |
326 | * PID of the process that we started last. | 322 | * HELLO message for this peer |
327 | */ | 323 | */ |
328 | struct GNUNET_OS_Process *proc; | 324 | struct GNUNET_HELLO_Message *hello; |
329 | 325 | ||
330 | /** | 326 | /** |
331 | * In which phase are we during the start of | 327 | * Handle to a pipe for reading the hostkey. |
332 | * this process? | ||
333 | */ | 328 | */ |
334 | enum GNUNET_TESTING_StartPhase phase; | 329 | struct GNUNET_DISK_PipeHandle *pipe_stdout; |
335 | 330 | ||
336 | /** | 331 | /** |
337 | * ID of the current task. | 332 | * Currently, a single char * pointing to a service |
333 | * that has been churned off. | ||
334 | * | ||
335 | * FIXME: make this a linked list of services that have been churned off!!! | ||
338 | */ | 336 | */ |
339 | GNUNET_SCHEDULER_TaskIdentifier task; | 337 | char *churned_services; |
340 | 338 | ||
341 | /** | 339 | /** |
342 | * Handle to the server. | 340 | * ID of the current task. |
343 | */ | 341 | */ |
344 | struct GNUNET_CORE_Handle *server; | 342 | GNUNET_SCHEDULER_TaskIdentifier task; |
345 | 343 | ||
346 | /** | 344 | /** |
347 | * Handle to the transport service of this peer | 345 | * Identity of this peer (once started). |
348 | */ | 346 | */ |
349 | struct GNUNET_TRANSPORT_Handle *th; | 347 | struct GNUNET_PeerIdentity id; |
350 | 348 | ||
351 | /** | 349 | /** |
352 | * HELLO message for this peer | 350 | * Flag to indicate that we've already been asked |
351 | * to terminate (but could not because some action | ||
352 | * was still pending). | ||
353 | */ | 353 | */ |
354 | struct GNUNET_HELLO_Message *hello; | 354 | int dead; |
355 | 355 | ||
356 | /** | 356 | /** |
357 | * Handle to a pipe for reading the hostkey. | 357 | * GNUNET_YES if the hostkey has been created |
358 | * for this peer, GNUNET_NO otherwise. | ||
358 | */ | 359 | */ |
359 | struct GNUNET_DISK_PipeHandle *pipe_stdout; | 360 | int have_hostkey; |
360 | 361 | ||
361 | /** | 362 | /** |
362 | * Output from gnunet-peerinfo is read into this buffer. | 363 | * In which phase are we during the start of |
364 | * this process? | ||
363 | */ | 365 | */ |
364 | char hostkeybuf[105]; | 366 | enum GNUNET_TESTING_StartPhase phase; |
365 | 367 | ||
366 | /** | 368 | /** |
367 | * Current position in 'hostkeybuf' (for reading from gnunet-peerinfo) | 369 | * Current position in 'hostkeybuf' (for reading from gnunet-peerinfo) |
@@ -380,12 +382,10 @@ struct GNUNET_TESTING_Daemon | |||
380 | int churn; | 382 | int churn; |
381 | 383 | ||
382 | /** | 384 | /** |
383 | * Currently, a single char * pointing to a service | 385 | * Output from gnunet-peerinfo is read into this buffer. |
384 | * that has been churned off. | ||
385 | * | ||
386 | * FIXME: make this a linked list of services that have been churned off!!! | ||
387 | */ | 386 | */ |
388 | char *churned_services; | 387 | char hostkeybuf[105]; |
388 | |||
389 | }; | 389 | }; |
390 | 390 | ||
391 | 391 | ||
@@ -567,7 +567,8 @@ struct GNUNET_TESTING_Daemon * | |||
567 | GNUNET_TESTING_daemon_get (struct GNUNET_TESTING_PeerGroup *pg, | 567 | GNUNET_TESTING_daemon_get (struct GNUNET_TESTING_PeerGroup *pg, |
568 | unsigned int position); | 568 | unsigned int position); |
569 | 569 | ||
570 | /* | 570 | |
571 | /** | ||
571 | * Get a daemon by peer identity, so callers can | 572 | * Get a daemon by peer identity, so callers can |
572 | * retrieve the daemon without knowing it's offset. | 573 | * retrieve the daemon without knowing it's offset. |
573 | * | 574 | * |
@@ -580,6 +581,7 @@ struct GNUNET_TESTING_Daemon * | |||
580 | GNUNET_TESTING_daemon_get_by_id (struct GNUNET_TESTING_PeerGroup *pg, | 581 | GNUNET_TESTING_daemon_get_by_id (struct GNUNET_TESTING_PeerGroup *pg, |
581 | struct GNUNET_PeerIdentity *peer_id); | 582 | struct GNUNET_PeerIdentity *peer_id); |
582 | 583 | ||
584 | |||
583 | /** | 585 | /** |
584 | * Stops a GNUnet daemon. | 586 | * Stops a GNUnet daemon. |
585 | * | 587 | * |
@@ -614,6 +616,7 @@ GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d, | |||
614 | GNUNET_TESTING_NotifyCompletion cb, | 616 | GNUNET_TESTING_NotifyCompletion cb, |
615 | void *cb_cls); | 617 | void *cb_cls); |
616 | 618 | ||
619 | |||
617 | /** | 620 | /** |
618 | * Stops a single service of a GNUnet daemon. Used like daemon_stop, | 621 | * Stops a single service of a GNUnet daemon. Used like daemon_stop, |
619 | * only doesn't stop the entire peer in any case. If the service | 622 | * only doesn't stop the entire peer in any case. If the service |
@@ -633,6 +636,7 @@ GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d, | |||
633 | GNUNET_TESTING_NotifyCompletion cb, | 636 | GNUNET_TESTING_NotifyCompletion cb, |
634 | void *cb_cls); | 637 | void *cb_cls); |
635 | 638 | ||
639 | |||
636 | /** | 640 | /** |
637 | * Read a testing hosts file based on a configuration. | 641 | * Read a testing hosts file based on a configuration. |
638 | * Returns a DLL of hosts (caller must free!) on success | 642 | * Returns a DLL of hosts (caller must free!) on success |
@@ -687,6 +691,7 @@ GNUNET_TESTING_daemons_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
687 | void *connect_callback_cls, | 691 | void *connect_callback_cls, |
688 | const struct GNUNET_TESTING_Host *hostnames); | 692 | const struct GNUNET_TESTING_Host *hostnames); |
689 | 693 | ||
694 | |||
690 | /** | 695 | /** |
691 | * Function which continues a peer group starting up | 696 | * Function which continues a peer group starting up |
692 | * after successfully generating hostkeys for each peer. | 697 | * after successfully generating hostkeys for each peer. |
@@ -711,7 +716,7 @@ GNUNET_TESTING_daemons_continue_startup (struct GNUNET_TESTING_PeerGroup *pg); | |||
711 | * @param cb function to call at the end | 716 | * @param cb function to call at the end |
712 | * @param cb_cls closure for cb | 717 | * @param cb_cls closure for cb |
713 | */ | 718 | */ |
714 | void | 719 | struct GNUNET_TESTING_ConnectContext * |
715 | GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, | 720 | GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, |
716 | struct GNUNET_TESTING_Daemon *d2, | 721 | struct GNUNET_TESTING_Daemon *d2, |
717 | struct GNUNET_TIME_Relative timeout, | 722 | struct GNUNET_TIME_Relative timeout, |
@@ -722,6 +727,15 @@ GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, | |||
722 | 727 | ||
723 | 728 | ||
724 | /** | 729 | /** |
730 | * Cancel an attempt to connect two daemons. | ||
731 | * | ||
732 | * @param cc connect context | ||
733 | */ | ||
734 | void | ||
735 | GNUNET_TESTING_daemons_connect_cancel (struct GNUNET_TESTING_ConnectContext *cc); | ||
736 | |||
737 | |||
738 | /** | ||
725 | * Restart all peers in the given group. | 739 | * Restart all peers in the given group. |
726 | * | 740 | * |
727 | * @param pg the handle to the peer group | 741 | * @param pg the handle to the peer group |
@@ -758,6 +772,7 @@ GNUNET_TESTING_daemons_stop (struct GNUNET_TESTING_PeerGroup *pg, | |||
758 | unsigned int | 772 | unsigned int |
759 | GNUNET_TESTING_daemons_running (struct GNUNET_TESTING_PeerGroup *pg); | 773 | GNUNET_TESTING_daemons_running (struct GNUNET_TESTING_PeerGroup *pg); |
760 | 774 | ||
775 | |||
761 | /** | 776 | /** |
762 | * Simulate churn by stopping some peers (and possibly | 777 | * Simulate churn by stopping some peers (and possibly |
763 | * re-starting others if churn is called multiple times). This | 778 | * re-starting others if churn is called multiple times). This |
@@ -787,7 +802,9 @@ GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg, | |||
787 | unsigned int von, | 802 | unsigned int von, |
788 | struct GNUNET_TIME_Relative timeout, | 803 | struct GNUNET_TIME_Relative timeout, |
789 | GNUNET_TESTING_NotifyCompletion cb, void *cb_cls); | 804 | GNUNET_TESTING_NotifyCompletion cb, void *cb_cls); |
790 | /* | 805 | |
806 | |||
807 | /** | ||
791 | * Start a given service for each of the peers in the peer group. | 808 | * Start a given service for each of the peers in the peer group. |
792 | * | 809 | * |
793 | * @param pg handle for the peer group | 810 | * @param pg handle for the peer group |
@@ -805,6 +822,7 @@ GNUNET_TESTING_daemons_start_service (struct GNUNET_TESTING_PeerGroup *pg, | |||
805 | GNUNET_TESTING_NotifyCompletion cb, | 822 | GNUNET_TESTING_NotifyCompletion cb, |
806 | void *cb_cls); | 823 | void *cb_cls); |
807 | 824 | ||
825 | |||
808 | /** | 826 | /** |
809 | * Callback function to process statistic values. | 827 | * Callback function to process statistic values. |
810 | * | 828 | * |
@@ -824,6 +842,7 @@ typedef int (*GNUNET_TESTING_STATISTICS_Iterator) (void *cls, | |||
824 | uint64_t value, | 842 | uint64_t value, |
825 | int is_persistent); | 843 | int is_persistent); |
826 | 844 | ||
845 | |||
827 | /** | 846 | /** |
828 | * Iterate over all (running) peers in the peer group, retrieve | 847 | * Iterate over all (running) peers in the peer group, retrieve |
829 | * all statistics from each. | 848 | * all statistics from each. |
@@ -839,6 +858,7 @@ GNUNET_TESTING_get_statistics (struct GNUNET_TESTING_PeerGroup *pg, | |||
839 | GNUNET_TESTING_STATISTICS_Iterator proc, | 858 | GNUNET_TESTING_STATISTICS_Iterator proc, |
840 | void *cls); | 859 | void *cls); |
841 | 860 | ||
861 | |||
842 | /** | 862 | /** |
843 | * Topologies supported for testbeds. | 863 | * Topologies supported for testbeds. |
844 | */ | 864 | */ |
@@ -956,6 +976,7 @@ int | |||
956 | GNUNET_TESTING_topology_get (enum GNUNET_TESTING_Topology *topology, | 976 | GNUNET_TESTING_topology_get (enum GNUNET_TESTING_Topology *topology, |
957 | const char *topology_string); | 977 | const char *topology_string); |
958 | 978 | ||
979 | |||
959 | /** | 980 | /** |
960 | * Get connect topology option from string input. | 981 | * Get connect topology option from string input. |
961 | * | 982 | * |
@@ -1013,6 +1034,7 @@ GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg, | |||
1013 | enum GNUNET_TESTING_Topology restrict_topology, | 1034 | enum GNUNET_TESTING_Topology restrict_topology, |
1014 | const char *restrict_transports); | 1035 | const char *restrict_transports); |
1015 | 1036 | ||
1037 | |||
1016 | /** | 1038 | /** |
1017 | * Iterate over all (running) peers in the peer group, retrieve | 1039 | * Iterate over all (running) peers in the peer group, retrieve |
1018 | * all connections that each currently has. | 1040 | * all connections that each currently has. |
@@ -1025,6 +1047,7 @@ void | |||
1025 | GNUNET_TESTING_get_topology (struct GNUNET_TESTING_PeerGroup *pg, | 1047 | GNUNET_TESTING_get_topology (struct GNUNET_TESTING_PeerGroup *pg, |
1026 | GNUNET_TESTING_NotifyTopology cb, void *cls); | 1048 | GNUNET_TESTING_NotifyTopology cb, void *cls); |
1027 | 1049 | ||
1050 | |||
1028 | /** | 1051 | /** |
1029 | * Stop the connection process temporarily. | 1052 | * Stop the connection process temporarily. |
1030 | * | 1053 | * |
@@ -1033,6 +1056,7 @@ GNUNET_TESTING_get_topology (struct GNUNET_TESTING_PeerGroup *pg, | |||
1033 | void | 1056 | void |
1034 | GNUNET_TESTING_stop_connections (struct GNUNET_TESTING_PeerGroup *pg); | 1057 | GNUNET_TESTING_stop_connections (struct GNUNET_TESTING_PeerGroup *pg); |
1035 | 1058 | ||
1059 | |||
1036 | /** | 1060 | /** |
1037 | * Resume the connection process. | 1061 | * Resume the connection process. |
1038 | * | 1062 | * |
@@ -1041,6 +1065,7 @@ GNUNET_TESTING_stop_connections (struct GNUNET_TESTING_PeerGroup *pg); | |||
1041 | void | 1065 | void |
1042 | GNUNET_TESTING_resume_connections (struct GNUNET_TESTING_PeerGroup *pg); | 1066 | GNUNET_TESTING_resume_connections (struct GNUNET_TESTING_PeerGroup *pg); |
1043 | 1067 | ||
1068 | |||
1044 | /** | 1069 | /** |
1045 | * There are many ways to connect peers that are supported by this function. | 1070 | * There are many ways to connect peers that are supported by this function. |
1046 | * To connect peers in the same topology that was created via the | 1071 | * To connect peers in the same topology that was created via the |
@@ -1073,6 +1098,7 @@ GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg, | |||
1073 | GNUNET_TESTING_NotifyCompletion | 1098 | GNUNET_TESTING_NotifyCompletion |
1074 | notify_callback, void *notify_cls); | 1099 | notify_callback, void *notify_cls); |
1075 | 1100 | ||
1101 | |||
1076 | /** | 1102 | /** |
1077 | * Start or stop an individual peer from the given group. | 1103 | * Start or stop an individual peer from the given group. |
1078 | * | 1104 | * |
@@ -1089,6 +1115,7 @@ GNUNET_TESTING_daemons_vary (struct GNUNET_TESTING_PeerGroup *pg, | |||
1089 | struct GNUNET_TIME_Relative timeout, | 1115 | struct GNUNET_TIME_Relative timeout, |
1090 | GNUNET_TESTING_NotifyCompletion cb, void *cb_cls); | 1116 | GNUNET_TESTING_NotifyCompletion cb, void *cb_cls); |
1091 | 1117 | ||
1118 | |||
1092 | /** | 1119 | /** |
1093 | * Start a peer group with a given number of peers. Notify | 1120 | * Start a peer group with a given number of peers. Notify |
1094 | * on completion of peer startup and connection based on given | 1121 | * on completion of peer startup and connection based on given |
@@ -1115,6 +1142,7 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1115 | void *peergroup_cls, | 1142 | void *peergroup_cls, |
1116 | const struct GNUNET_TESTING_Host *hostnames); | 1143 | const struct GNUNET_TESTING_Host *hostnames); |
1117 | 1144 | ||
1145 | |||
1118 | /** | 1146 | /** |
1119 | * Print current topology to a graphviz readable file. | 1147 | * Print current topology to a graphviz readable file. |
1120 | * | 1148 | * |