aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_testbed_service.h
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-09-08 12:33:09 +0000
committerng0 <ng0@n0.is>2019-09-08 12:33:09 +0000
commitd41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb (patch)
tree9efd18ea7d425652085ed0bd5e8e45604bc5f6b9 /src/include/gnunet_testbed_service.h
parenta0fce305c565c0937d917a92712f15e9c5736260 (diff)
downloadgnunet-d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb.tar.gz
gnunet-d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb.zip
uncrustify as demanded.
Diffstat (limited to 'src/include/gnunet_testbed_service.h')
-rw-r--r--src/include/gnunet_testbed_service.h430
1 files changed, 200 insertions, 230 deletions
diff --git a/src/include/gnunet_testbed_service.h b/src/include/gnunet_testbed_service.h
index db626df0e..5acf885dc 100644
--- a/src/include/gnunet_testbed_service.h
+++ b/src/include/gnunet_testbed_service.h
@@ -11,7 +11,7 @@
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
@@ -89,10 +89,10 @@ struct GNUNET_TESTBED_Controller;
89 * @return handle to the host, NULL on error 89 * @return handle to the host, NULL on error
90 */ 90 */
91struct GNUNET_TESTBED_Host * 91struct GNUNET_TESTBED_Host *
92GNUNET_TESTBED_host_create (const char *hostname, 92GNUNET_TESTBED_host_create(const char *hostname,
93 const char *username, 93 const char *username,
94 const struct GNUNET_CONFIGURATION_Handle *cfg, 94 const struct GNUNET_CONFIGURATION_Handle *cfg,
95 uint16_t port); 95 uint16_t port);
96 96
97 97
98 98
@@ -112,12 +112,12 @@ GNUNET_TESTBED_host_create (const char *hostname,
112 * @return handle to the host, NULL on error 112 * @return handle to the host, NULL on error
113 */ 113 */
114struct GNUNET_TESTBED_Host * 114struct GNUNET_TESTBED_Host *
115GNUNET_TESTBED_host_create_with_id (uint32_t id, 115GNUNET_TESTBED_host_create_with_id(uint32_t id,
116 const char *hostname, 116 const char *hostname,
117 const char *username, 117 const char *username,
118 const struct GNUNET_CONFIGURATION_Handle 118 const struct GNUNET_CONFIGURATION_Handle
119 *cfg, 119 *cfg,
120 uint16_t port); 120 uint16_t port);
121 121
122 122
123/** 123/**
@@ -133,10 +133,10 @@ GNUNET_TESTBED_host_create_with_id (uint32_t id,
133 * @return number of hosts returned in 'hosts', 0 on error 133 * @return number of hosts returned in 'hosts', 0 on error
134 */ 134 */
135unsigned int 135unsigned int
136GNUNET_TESTBED_hosts_load_from_file (const char *filename, 136GNUNET_TESTBED_hosts_load_from_file(const char *filename,
137 const struct GNUNET_CONFIGURATION_Handle 137 const struct GNUNET_CONFIGURATION_Handle
138 *cfg, 138 *cfg,
139 struct GNUNET_TESTBED_Host ***hosts); 139 struct GNUNET_TESTBED_Host ***hosts);
140 140
141 141
142/** 142/**
@@ -152,10 +152,10 @@ GNUNET_TESTBED_hosts_load_from_file (const char *filename,
152 * @return number of hosts returned in 'hosts', 0 on error 152 * @return number of hosts returned in 'hosts', 0 on error
153 */ 153 */
154unsigned int 154unsigned int
155GNUNET_TESTBED_hosts_load_from_loadleveler (const struct 155GNUNET_TESTBED_hosts_load_from_loadleveler(const struct
156 GNUNET_CONFIGURATION_Handle *cfg, 156 GNUNET_CONFIGURATION_Handle *cfg,
157 struct GNUNET_TESTBED_Host 157 struct GNUNET_TESTBED_Host
158 ***hosts); 158 ***hosts);
159 159
160/** 160/**
161 * Destroy a host handle. Must only be called once everything 161 * Destroy a host handle. Must only be called once everything
@@ -164,7 +164,7 @@ GNUNET_TESTBED_hosts_load_from_loadleveler (const struct
164 * @param host handle to destroy 164 * @param host handle to destroy
165 */ 165 */
166void 166void
167GNUNET_TESTBED_host_destroy (struct GNUNET_TESTBED_Host *host); 167GNUNET_TESTBED_host_destroy(struct GNUNET_TESTBED_Host *host);
168 168
169 169
170/** 170/**
@@ -201,11 +201,11 @@ typedef void
201 * GNUNET_TESTBED_is_host_habitable_cancel() 201 * GNUNET_TESTBED_is_host_habitable_cancel()
202 */ 202 */
203struct GNUNET_TESTBED_HostHabitableCheckHandle * 203struct GNUNET_TESTBED_HostHabitableCheckHandle *
204GNUNET_TESTBED_is_host_habitable (const struct GNUNET_TESTBED_Host *host, 204GNUNET_TESTBED_is_host_habitable(const struct GNUNET_TESTBED_Host *host,
205 const struct GNUNET_CONFIGURATION_Handle 205 const struct GNUNET_CONFIGURATION_Handle
206 *config, 206 *config,
207 GNUNET_TESTBED_HostHabitableCallback cb, 207 GNUNET_TESTBED_HostHabitableCallback cb,
208 void *cb_cls); 208 void *cb_cls);
209 209
210 210
211/** 211/**
@@ -214,9 +214,9 @@ GNUNET_TESTBED_is_host_habitable (const struct GNUNET_TESTBED_Host *host,
214 * @param handle the habitability check handle 214 * @param handle the habitability check handle
215 */ 215 */
216void 216void
217GNUNET_TESTBED_is_host_habitable_cancel (struct 217GNUNET_TESTBED_is_host_habitable_cancel(struct
218 GNUNET_TESTBED_HostHabitableCheckHandle 218 GNUNET_TESTBED_HostHabitableCheckHandle
219 *handle); 219 *handle);
220 220
221/** 221/**
222 * Obtain the host's hostname. 222 * Obtain the host's hostname.
@@ -225,15 +225,14 @@ GNUNET_TESTBED_is_host_habitable_cancel (struct
225 * @return hostname of the host 225 * @return hostname of the host
226 */ 226 */
227const char * 227const char *
228GNUNET_TESTBED_host_get_hostname (const struct GNUNET_TESTBED_Host *host); 228GNUNET_TESTBED_host_get_hostname(const struct GNUNET_TESTBED_Host *host);
229 229
230 230
231/** 231/**
232 * Enumeration with (at most 64) possible event types that 232 * Enumeration with (at most 64) possible event types that
233 * can be monitored using the testbed framework. 233 * can be monitored using the testbed framework.
234 */ 234 */
235enum GNUNET_TESTBED_EventType 235enum GNUNET_TESTBED_EventType {
236{
237 /** 236 /**
238 * A peer has been started. 237 * A peer has been started.
239 */ 238 */
@@ -258,16 +257,13 @@ enum GNUNET_TESTBED_EventType
258 * A requested testbed operation has been completed. 257 * A requested testbed operation has been completed.
259 */ 258 */
260 GNUNET_TESTBED_ET_OPERATION_FINISHED = 4, 259 GNUNET_TESTBED_ET_OPERATION_FINISHED = 4,
261
262}; 260};
263 261
264 262
265/** 263/**
266 * Types of information that can be requested about a peer. 264 * Types of information that can be requested about a peer.
267 */ 265 */
268enum GNUNET_TESTBED_PeerInformationType 266enum GNUNET_TESTBED_PeerInformationType {
269{
270
271 /** 267 /**
272 * Special value (not valid for requesting information) 268 * Special value (not valid for requesting information)
273 * that is used in the event struct if a 'generic' pointer 269 * that is used in the event struct if a 'generic' pointer
@@ -291,7 +287,6 @@ enum GNUNET_TESTBED_PeerInformationType
291 * 'GNUNET_TESTNIG_operation_done' is called. 287 * 'GNUNET_TESTNIG_operation_done' is called.
292 */ 288 */
293 GNUNET_TESTBED_PIT_IDENTITY 289 GNUNET_TESTBED_PIT_IDENTITY
294
295}; 290};
296 291
297 292
@@ -299,9 +294,7 @@ enum GNUNET_TESTBED_PeerInformationType
299 * Argument to GNUNET_TESTBED_ControllerCallback with details about 294 * Argument to GNUNET_TESTBED_ControllerCallback with details about
300 * the event. 295 * the event.
301 */ 296 */
302struct GNUNET_TESTBED_EventInformation 297struct GNUNET_TESTBED_EventInformation {
303{
304
305 /** 298 /**
306 * Type of the event. 299 * Type of the event.
307 */ 300 */
@@ -320,14 +313,11 @@ struct GNUNET_TESTBED_EventInformation
320 /** 313 /**
321 * Details about the event. 314 * Details about the event.
322 */ 315 */
323 union 316 union {
324 {
325
326 /** 317 /**
327 * Details about peer start event. 318 * Details about peer start event.
328 */ 319 */
329 struct 320 struct {
330 {
331 /** 321 /**
332 * Handle for the host where the peer 322 * Handle for the host where the peer
333 * was started. 323 * was started.
@@ -338,27 +328,22 @@ struct GNUNET_TESTBED_EventInformation
338 * Handle for the peer that was started. 328 * Handle for the peer that was started.
339 */ 329 */
340 struct GNUNET_TESTBED_Peer *peer; 330 struct GNUNET_TESTBED_Peer *peer;
341
342 } peer_start; 331 } peer_start;
343 332
344 /** 333 /**
345 * Details about peer stop event. 334 * Details about peer stop event.
346 */ 335 */
347 struct 336 struct {
348 {
349
350 /** 337 /**
351 * Handle for the peer that was started. 338 * Handle for the peer that was started.
352 */ 339 */
353 struct GNUNET_TESTBED_Peer *peer; 340 struct GNUNET_TESTBED_Peer *peer;
354
355 } peer_stop; 341 } peer_stop;
356 342
357 /** 343 /**
358 * Details about connect event. 344 * Details about connect event.
359 */ 345 */
360 struct 346 struct {
361 {
362 /** 347 /**
363 * Handle for one of the connected peers. 348 * Handle for one of the connected peers.
364 */ 349 */
@@ -368,14 +353,12 @@ struct GNUNET_TESTBED_EventInformation
368 * Handle for one of the connected peers. 353 * Handle for one of the connected peers.
369 */ 354 */
370 struct GNUNET_TESTBED_Peer *peer2; 355 struct GNUNET_TESTBED_Peer *peer2;
371
372 } peer_connect; 356 } peer_connect;
373 357
374 /** 358 /**
375 * Details about disconnect event. 359 * Details about disconnect event.
376 */ 360 */
377 struct 361 struct {
378 {
379 /** 362 /**
380 * Handle for one of the disconnected peers. 363 * Handle for one of the disconnected peers.
381 */ 364 */
@@ -385,14 +368,12 @@ struct GNUNET_TESTBED_EventInformation
385 * Handle for one of the disconnected peers. 368 * Handle for one of the disconnected peers.
386 */ 369 */
387 struct GNUNET_TESTBED_Peer *peer2; 370 struct GNUNET_TESTBED_Peer *peer2;
388
389 } peer_disconnect; 371 } peer_disconnect;
390 372
391 /** 373 /**
392 * Details about an operation finished event. 374 * Details about an operation finished event.
393 */ 375 */
394 struct 376 struct {
395 {
396 /** 377 /**
397 * Error message for the operation, NULL on success. 378 * Error message for the operation, NULL on success.
398 */ 379 */
@@ -403,11 +384,8 @@ struct GNUNET_TESTBED_EventInformation
403 * (whatever the GNUNET_TESTBED_ConnectAdapter returned). 384 * (whatever the GNUNET_TESTBED_ConnectAdapter returned).
404 */ 385 */
405 void *generic; 386 void *generic;
406
407 } operation_finished; 387 } operation_finished;
408
409 } details; 388 } details;
410
411}; 389};
412 390
413 391
@@ -468,10 +446,10 @@ typedef void
468 * @return the controller process handle, NULL on errors 446 * @return the controller process handle, NULL on errors
469 */ 447 */
470struct GNUNET_TESTBED_ControllerProc * 448struct GNUNET_TESTBED_ControllerProc *
471GNUNET_TESTBED_controller_start (const char *trusted_ip, 449GNUNET_TESTBED_controller_start(const char *trusted_ip,
472 struct GNUNET_TESTBED_Host *host, 450 struct GNUNET_TESTBED_Host *host,
473 GNUNET_TESTBED_ControllerStatusCallback cb, 451 GNUNET_TESTBED_ControllerStatusCallback cb,
474 void *cls); 452 void *cls);
475 453
476 454
477/** 455/**
@@ -483,7 +461,7 @@ GNUNET_TESTBED_controller_start (const char *trusted_ip,
483 * @param cproc the controller process handle 461 * @param cproc the controller process handle
484 */ 462 */
485void 463void
486GNUNET_TESTBED_controller_stop (struct GNUNET_TESTBED_ControllerProc *cproc); 464GNUNET_TESTBED_controller_stop(struct GNUNET_TESTBED_ControllerProc *cproc);
487 465
488 466
489/** 467/**
@@ -503,10 +481,10 @@ GNUNET_TESTBED_controller_stop (struct GNUNET_TESTBED_ControllerProc *cproc);
503 * @return handle to the controller 481 * @return handle to the controller
504 */ 482 */
505struct GNUNET_TESTBED_Controller * 483struct GNUNET_TESTBED_Controller *
506GNUNET_TESTBED_controller_connect (struct GNUNET_TESTBED_Host *host, 484GNUNET_TESTBED_controller_connect(struct GNUNET_TESTBED_Host *host,
507 uint64_t event_mask, 485 uint64_t event_mask,
508 GNUNET_TESTBED_ControllerCallback cc, 486 GNUNET_TESTBED_ControllerCallback cc,
509 void *cc_cls); 487 void *cc_cls);
510 488
511 489
512/** 490/**
@@ -517,7 +495,7 @@ GNUNET_TESTBED_controller_connect (struct GNUNET_TESTBED_Host *host,
517 * @param c handle to controller to stop 495 * @param c handle to controller to stop
518 */ 496 */
519void 497void
520GNUNET_TESTBED_controller_disconnect (struct GNUNET_TESTBED_Controller *c); 498GNUNET_TESTBED_controller_disconnect(struct GNUNET_TESTBED_Controller *c);
521 499
522 500
523/** 501/**
@@ -553,10 +531,10 @@ typedef void
553 * is not cancelled 531 * is not cancelled
554 */ 532 */
555struct GNUNET_TESTBED_HostRegistrationHandle * 533struct GNUNET_TESTBED_HostRegistrationHandle *
556GNUNET_TESTBED_register_host (struct GNUNET_TESTBED_Controller *controller, 534GNUNET_TESTBED_register_host(struct GNUNET_TESTBED_Controller *controller,
557 struct GNUNET_TESTBED_Host *host, 535 struct GNUNET_TESTBED_Host *host,
558 GNUNET_TESTBED_HostRegistrationCompletion cc, 536 GNUNET_TESTBED_HostRegistrationCompletion cc,
559 void *cc_cls); 537 void *cc_cls);
560 538
561 539
562/** 540/**
@@ -569,8 +547,8 @@ GNUNET_TESTBED_register_host (struct GNUNET_TESTBED_Controller *controller,
569 * @param handle the registration handle to cancel 547 * @param handle the registration handle to cancel
570 */ 548 */
571void 549void
572GNUNET_TESTBED_cancel_registration (struct GNUNET_TESTBED_HostRegistrationHandle 550GNUNET_TESTBED_cancel_registration(struct GNUNET_TESTBED_HostRegistrationHandle
573 *handle); 551 *handle);
574 552
575 553
576/** 554/**
@@ -616,11 +594,11 @@ typedef void
616 * @return the operation handle 594 * @return the operation handle
617 */ 595 */
618struct GNUNET_TESTBED_Operation * 596struct GNUNET_TESTBED_Operation *
619GNUNET_TESTBED_controller_link (void *op_cls, 597GNUNET_TESTBED_controller_link(void *op_cls,
620 struct GNUNET_TESTBED_Controller *master, 598 struct GNUNET_TESTBED_Controller *master,
621 struct GNUNET_TESTBED_Host *delegated_host, 599 struct GNUNET_TESTBED_Host *delegated_host,
622 struct GNUNET_TESTBED_Host *slave_host, 600 struct GNUNET_TESTBED_Host *slave_host,
623 int is_subordinate); 601 int is_subordinate);
624 602
625 603
626/** 604/**
@@ -639,9 +617,9 @@ GNUNET_TESTBED_controller_link (void *op_cls,
639 * master 617 * master
640 */ 618 */
641struct GNUNET_TESTBED_Operation * 619struct GNUNET_TESTBED_Operation *
642GNUNET_TESTBED_get_slave_config (void *op_cls, 620GNUNET_TESTBED_get_slave_config(void *op_cls,
643 struct GNUNET_TESTBED_Controller *master, 621 struct GNUNET_TESTBED_Controller *master,
644 struct GNUNET_TESTBED_Host *slave_host); 622 struct GNUNET_TESTBED_Host *slave_host);
645 623
646 624
647/** 625/**
@@ -689,11 +667,11 @@ typedef void
689 * @return the operation handle 667 * @return the operation handle
690 */ 668 */
691struct GNUNET_TESTBED_Operation * 669struct GNUNET_TESTBED_Operation *
692GNUNET_TESTBED_peer_create (struct GNUNET_TESTBED_Controller *controller, 670GNUNET_TESTBED_peer_create(struct GNUNET_TESTBED_Controller *controller,
693 struct GNUNET_TESTBED_Host *host, 671 struct GNUNET_TESTBED_Host *host,
694 const struct GNUNET_CONFIGURATION_Handle *cfg, 672 const struct GNUNET_CONFIGURATION_Handle *cfg,
695 GNUNET_TESTBED_PeerCreateCallback cb, 673 GNUNET_TESTBED_PeerCreateCallback cb,
696 void *cls); 674 void *cls);
697 675
698 676
699/** 677/**
@@ -719,10 +697,10 @@ typedef void
719 * @return handle to the operation 697 * @return handle to the operation
720 */ 698 */
721struct GNUNET_TESTBED_Operation * 699struct GNUNET_TESTBED_Operation *
722GNUNET_TESTBED_peer_start (void *op_cls, 700GNUNET_TESTBED_peer_start(void *op_cls,
723 struct GNUNET_TESTBED_Peer *peer, 701 struct GNUNET_TESTBED_Peer *peer,
724 GNUNET_TESTBED_PeerChurnCallback pcc, 702 GNUNET_TESTBED_PeerChurnCallback pcc,
725 void *pcc_cls); 703 void *pcc_cls);
726 704
727 705
728/** 706/**
@@ -738,17 +716,16 @@ GNUNET_TESTBED_peer_start (void *op_cls,
738 * @return handle to the operation 716 * @return handle to the operation
739 */ 717 */
740struct GNUNET_TESTBED_Operation * 718struct GNUNET_TESTBED_Operation *
741GNUNET_TESTBED_peer_stop (void *op_cls, 719GNUNET_TESTBED_peer_stop(void *op_cls,
742 struct GNUNET_TESTBED_Peer *peer, 720 struct GNUNET_TESTBED_Peer *peer,
743 GNUNET_TESTBED_PeerChurnCallback pcc, 721 GNUNET_TESTBED_PeerChurnCallback pcc,
744 void *pcc_cls); 722 void *pcc_cls);
745 723
746 724
747/** 725/**
748 * Data returned from GNUNET_TESTBED_peer_get_information 726 * Data returned from GNUNET_TESTBED_peer_get_information
749 */ 727 */
750struct GNUNET_TESTBED_PeerInformation 728struct GNUNET_TESTBED_PeerInformation {
751{
752 /** 729 /**
753 * Peer information type; captures which of the types 730 * Peer information type; captures which of the types
754 * in the 'op_result' is actually in use. 731 * in the 'op_result' is actually in use.
@@ -758,8 +735,7 @@ struct GNUNET_TESTBED_PeerInformation
758 /** 735 /**
759 * The result of the get information operation; Choose according to the pit 736 * The result of the get information operation; Choose according to the pit
760 */ 737 */
761 union 738 union {
762 {
763 /** 739 /**
764 * The configuration of the peer 740 * The configuration of the peer
765 */ 741 */
@@ -805,11 +781,11 @@ typedef void
805 * @return handle to the operation 781 * @return handle to the operation
806 */ 782 */
807struct GNUNET_TESTBED_Operation * 783struct GNUNET_TESTBED_Operation *
808GNUNET_TESTBED_peer_get_information (struct GNUNET_TESTBED_Peer *peer, 784GNUNET_TESTBED_peer_get_information(struct GNUNET_TESTBED_Peer *peer,
809 enum GNUNET_TESTBED_PeerInformationType 785 enum GNUNET_TESTBED_PeerInformationType
810 pit, 786 pit,
811 GNUNET_TESTBED_PeerInfoCallback cb, 787 GNUNET_TESTBED_PeerInfoCallback cb,
812 void *cb_cls); 788 void *cb_cls);
813 789
814 790
815/** 791/**
@@ -821,8 +797,8 @@ GNUNET_TESTBED_peer_get_information (struct GNUNET_TESTBED_Peer *peer,
821 * @return handle to the operation 797 * @return handle to the operation
822 */ 798 */
823struct GNUNET_TESTBED_Operation * 799struct GNUNET_TESTBED_Operation *
824GNUNET_TESTBED_peer_update_configuration (struct GNUNET_TESTBED_Peer *peer, 800GNUNET_TESTBED_peer_update_configuration(struct GNUNET_TESTBED_Peer *peer,
825 const struct GNUNET_CONFIGURATION_Handle *cfg); 801 const struct GNUNET_CONFIGURATION_Handle *cfg);
826 802
827 803
828/** 804/**
@@ -833,7 +809,7 @@ GNUNET_TESTBED_peer_update_configuration (struct GNUNET_TESTBED_Peer *peer,
833 * @return handle to the operation 809 * @return handle to the operation
834 */ 810 */
835struct GNUNET_TESTBED_Operation * 811struct GNUNET_TESTBED_Operation *
836GNUNET_TESTBED_peer_destroy (struct GNUNET_TESTBED_Peer *peer); 812GNUNET_TESTBED_peer_destroy(struct GNUNET_TESTBED_Peer *peer);
837 813
838 814
839/** 815/**
@@ -852,12 +828,12 @@ GNUNET_TESTBED_peer_destroy (struct GNUNET_TESTBED_Peer *peer);
852 * @return an operation handle; NULL upon error (peer not running) 828 * @return an operation handle; NULL upon error (peer not running)
853 */ 829 */
854struct GNUNET_TESTBED_Operation * 830struct GNUNET_TESTBED_Operation *
855GNUNET_TESTBED_peer_manage_service (void *op_cls, 831GNUNET_TESTBED_peer_manage_service(void *op_cls,
856 struct GNUNET_TESTBED_Peer *peer, 832 struct GNUNET_TESTBED_Peer *peer,
857 const char *service_name, 833 const char *service_name,
858 GNUNET_TESTBED_OperationCompletionCallback cb, 834 GNUNET_TESTBED_OperationCompletionCallback cb,
859 void *cb_cls, 835 void *cb_cls,
860 unsigned int start); 836 unsigned int start);
861 837
862 838
863/** 839/**
@@ -876,18 +852,17 @@ GNUNET_TESTBED_peer_manage_service (void *op_cls,
876 * present 852 * present
877 */ 853 */
878struct GNUNET_TESTBED_Operation * 854struct GNUNET_TESTBED_Operation *
879GNUNET_TESTBED_shutdown_peers (struct GNUNET_TESTBED_Controller *c, 855GNUNET_TESTBED_shutdown_peers(struct GNUNET_TESTBED_Controller *c,
880 void *op_cls, 856 void *op_cls,
881 GNUNET_TESTBED_OperationCompletionCallback cb, 857 GNUNET_TESTBED_OperationCompletionCallback cb,
882 void *cb_cls); 858 void *cb_cls);
883 859
884 860
885 861
886/** 862/**
887 * Options for peer connections. 863 * Options for peer connections.
888 */ 864 */
889enum GNUNET_TESTBED_ConnectOption 865enum GNUNET_TESTBED_ConnectOption {
890{
891 /** 866 /**
892 * No option (not valid as an argument). 867 * No option (not valid as an argument).
893 */ 868 */
@@ -907,7 +882,6 @@ enum GNUNET_TESTBED_ConnectOption
907 * particular transports, force simulation of particular latencies 882 * particular transports, force simulation of particular latencies
908 * or message loss rates, or set bandwidth limitations. 883 * or message loss rates, or set bandwidth limitations.
909 */ 884 */
910
911}; 885};
912 886
913 887
@@ -924,11 +898,11 @@ enum GNUNET_TESTBED_ConnectOption
924 * time is not allowed 898 * time is not allowed
925 */ 899 */
926struct GNUNET_TESTBED_Operation * 900struct GNUNET_TESTBED_Operation *
927GNUNET_TESTBED_underlay_configure_link_va (void *op_cls, 901GNUNET_TESTBED_underlay_configure_link_va(void *op_cls,
928 struct GNUNET_TESTBED_Peer *p1, 902 struct GNUNET_TESTBED_Peer *p1,
929 struct GNUNET_TESTBED_Peer *p2, 903 struct GNUNET_TESTBED_Peer *p2,
930 enum GNUNET_TESTBED_ConnectOption co, 904 enum GNUNET_TESTBED_ConnectOption co,
931 va_list ap); 905 va_list ap);
932 906
933 907
934/** 908/**
@@ -944,10 +918,10 @@ GNUNET_TESTBED_underlay_configure_link_va (void *op_cls,
944 * time is not allowed 918 * time is not allowed
945 */ 919 */
946struct GNUNET_TESTBED_Operation * 920struct GNUNET_TESTBED_Operation *
947GNUNET_TESTBED_underlay_configure_link (void *op_cls, 921GNUNET_TESTBED_underlay_configure_link(void *op_cls,
948 struct GNUNET_TESTBED_Peer *p1, 922 struct GNUNET_TESTBED_Peer *p1,
949 struct GNUNET_TESTBED_Peer *p2, 923 struct GNUNET_TESTBED_Peer *p2,
950 enum GNUNET_TESTBED_ConnectOption co, ...); 924 enum GNUNET_TESTBED_ConnectOption co, ...);
951 925
952 926
953 927
@@ -955,8 +929,7 @@ GNUNET_TESTBED_underlay_configure_link (void *op_cls,
955 * Topologies and topology options supported for testbeds. Options should always 929 * Topologies and topology options supported for testbeds. Options should always
956 * end with #GNUNET_TESTBED_TOPOLOGY_OPTION_END 930 * end with #GNUNET_TESTBED_TOPOLOGY_OPTION_END
957 */ 931 */
958enum GNUNET_TESTBED_TopologyOption 932enum GNUNET_TESTBED_TopologyOption {
959{
960 /** 933 /**
961 * A clique (everyone connected to everyone else). No options. If there are N 934 * A clique (everyone connected to everyone else). No options. If there are N
962 * peers this topology results in (N * (N -1)) connections. 935 * peers this topology results in (N * (N -1)) connections.
@@ -1063,11 +1036,11 @@ enum GNUNET_TESTBED_TopologyOption
1063 * is not allowed at this time 1036 * is not allowed at this time
1064 */ 1037 */
1065struct GNUNET_TESTBED_Operation * 1038struct GNUNET_TESTBED_Operation *
1066GNUNET_TESTBED_underlay_configure_topology_va (void *op_cls, 1039GNUNET_TESTBED_underlay_configure_topology_va(void *op_cls,
1067 unsigned int num_peers, 1040 unsigned int num_peers,
1068 struct GNUNET_TESTBED_Peer **peers, 1041 struct GNUNET_TESTBED_Peer **peers,
1069 enum GNUNET_TESTBED_TopologyOption topo, 1042 enum GNUNET_TESTBED_TopologyOption topo,
1070 va_list ap); 1043 va_list ap);
1071 1044
1072 1045
1073/** 1046/**
@@ -1082,11 +1055,11 @@ GNUNET_TESTBED_underlay_configure_topology_va (void *op_cls,
1082 * is not allowed at this time 1055 * is not allowed at this time
1083 */ 1056 */
1084struct GNUNET_TESTBED_Operation * 1057struct GNUNET_TESTBED_Operation *
1085GNUNET_TESTBED_underlay_configure_topology (void *op_cls, 1058GNUNET_TESTBED_underlay_configure_topology(void *op_cls,
1086 unsigned int num_peers, 1059 unsigned int num_peers,
1087 struct GNUNET_TESTBED_Peer **peers, 1060 struct GNUNET_TESTBED_Peer **peers,
1088 enum GNUNET_TESTBED_TopologyOption topo, 1061 enum GNUNET_TESTBED_TopologyOption topo,
1089 ...); 1062 ...);
1090 1063
1091 1064
1092/** 1065/**
@@ -1104,11 +1077,11 @@ GNUNET_TESTBED_underlay_configure_topology (void *op_cls,
1104 * not running or underlay disallows) 1077 * not running or underlay disallows)
1105 */ 1078 */
1106struct GNUNET_TESTBED_Operation * 1079struct GNUNET_TESTBED_Operation *
1107GNUNET_TESTBED_overlay_connect (void *op_cls, 1080GNUNET_TESTBED_overlay_connect(void *op_cls,
1108 GNUNET_TESTBED_OperationCompletionCallback cb, 1081 GNUNET_TESTBED_OperationCompletionCallback cb,
1109 void *cb_cls, 1082 void *cb_cls,
1110 struct GNUNET_TESTBED_Peer *p1, 1083 struct GNUNET_TESTBED_Peer *p1,
1111 struct GNUNET_TESTBED_Peer *p2); 1084 struct GNUNET_TESTBED_Peer *p2);
1112 1085
1113 1086
1114/** 1087/**
@@ -1121,8 +1094,8 @@ GNUNET_TESTBED_overlay_connect (void *op_cls,
1121 * @param nfailures the number of overlay connects which failed 1094 * @param nfailures the number of overlay connects which failed
1122 */ 1095 */
1123typedef void (*GNUNET_TESTBED_TopologyCompletionCallback) (void *cls, 1096typedef void (*GNUNET_TESTBED_TopologyCompletionCallback) (void *cls,
1124 unsigned int nsuccess, 1097 unsigned int nsuccess,
1125 unsigned int nfailures); 1098 unsigned int nfailures);
1126 1099
1127 1100
1128/** 1101/**
@@ -1146,15 +1119,15 @@ typedef void (*GNUNET_TESTBED_TopologyCompletionCallback) (void *cls,
1146 * not running or underlay disallows) or if num_peers is less than 2 1119 * not running or underlay disallows) or if num_peers is less than 2
1147 */ 1120 */
1148struct GNUNET_TESTBED_Operation * 1121struct GNUNET_TESTBED_Operation *
1149GNUNET_TESTBED_overlay_configure_topology_va (void *op_cls, 1122GNUNET_TESTBED_overlay_configure_topology_va(void *op_cls,
1150 unsigned int num_peers, 1123 unsigned int num_peers,
1151 struct GNUNET_TESTBED_Peer **peers, 1124 struct GNUNET_TESTBED_Peer **peers,
1152 unsigned int *max_connections, 1125 unsigned int *max_connections,
1153 GNUNET_TESTBED_TopologyCompletionCallback 1126 GNUNET_TESTBED_TopologyCompletionCallback
1154 comp_cb, 1127 comp_cb,
1155 void *comp_cb_cls, 1128 void *comp_cb_cls,
1156 enum GNUNET_TESTBED_TopologyOption topo, 1129 enum GNUNET_TESTBED_TopologyOption topo,
1157 va_list va); 1130 va_list va);
1158 1131
1159 1132
1160/** 1133/**
@@ -1178,15 +1151,15 @@ GNUNET_TESTBED_overlay_configure_topology_va (void *op_cls,
1178 * not running or underlay disallows) or if num_peers is less than 2 1151 * not running or underlay disallows) or if num_peers is less than 2
1179 */ 1152 */
1180struct GNUNET_TESTBED_Operation * 1153struct GNUNET_TESTBED_Operation *
1181GNUNET_TESTBED_overlay_configure_topology (void *op_cls, 1154GNUNET_TESTBED_overlay_configure_topology(void *op_cls,
1182 unsigned int num_peers, 1155 unsigned int num_peers,
1183 struct GNUNET_TESTBED_Peer **peers, 1156 struct GNUNET_TESTBED_Peer **peers,
1184 unsigned int *max_connections, 1157 unsigned int *max_connections,
1185 GNUNET_TESTBED_TopologyCompletionCallback 1158 GNUNET_TESTBED_TopologyCompletionCallback
1186 comp_cb, 1159 comp_cb,
1187 void *comp_cb_cls, 1160 void *comp_cb_cls,
1188 enum GNUNET_TESTBED_TopologyOption topo, 1161 enum GNUNET_TESTBED_TopologyOption topo,
1189 ...); 1162 ...);
1190 1163
1191 1164
1192/** 1165/**
@@ -1200,8 +1173,8 @@ GNUNET_TESTBED_overlay_configure_topology (void *op_cls,
1200 * be written to. 1173 * be written to.
1201 */ 1174 */
1202void 1175void
1203GNUNET_TESTBED_overlay_write_topology_to_file (struct GNUNET_TESTBED_Controller *controller, 1176GNUNET_TESTBED_overlay_write_topology_to_file(struct GNUNET_TESTBED_Controller *controller,
1204 const char *filename); 1177 const char *filename);
1205 1178
1206 1179
1207/** 1180/**
@@ -1244,7 +1217,7 @@ typedef void
1244(*GNUNET_TESTBED_ServiceConnectCompletionCallback) (void *cls, 1217(*GNUNET_TESTBED_ServiceConnectCompletionCallback) (void *cls,
1245 struct GNUNET_TESTBED_Operation *op, 1218 struct GNUNET_TESTBED_Operation *op,
1246 void *ca_result, 1219 void *ca_result,
1247 const char *emsg ); 1220 const char *emsg);
1248 1221
1249 1222
1250/** 1223/**
@@ -1270,14 +1243,14 @@ typedef void
1270 * @return handle for the operation 1243 * @return handle for the operation
1271 */ 1244 */
1272struct GNUNET_TESTBED_Operation * 1245struct GNUNET_TESTBED_Operation *
1273GNUNET_TESTBED_service_connect (void *op_cls, 1246GNUNET_TESTBED_service_connect(void *op_cls,
1274 struct GNUNET_TESTBED_Peer *peer, 1247 struct GNUNET_TESTBED_Peer *peer,
1275 const char *service_name, 1248 const char *service_name,
1276 GNUNET_TESTBED_ServiceConnectCompletionCallback cb, 1249 GNUNET_TESTBED_ServiceConnectCompletionCallback cb,
1277 void *cb_cls, 1250 void *cb_cls,
1278 GNUNET_TESTBED_ConnectAdapter ca, 1251 GNUNET_TESTBED_ConnectAdapter ca,
1279 GNUNET_TESTBED_DisconnectAdapter da, 1252 GNUNET_TESTBED_DisconnectAdapter da,
1280 void *cada_cls); 1253 void *cada_cls);
1281 1254
1282 1255
1283/** 1256/**
@@ -1302,7 +1275,7 @@ GNUNET_TESTBED_service_connect (void *op_cls,
1302 * @param operation operation to signal completion or cancellation 1275 * @param operation operation to signal completion or cancellation
1303 */ 1276 */
1304void 1277void
1305GNUNET_TESTBED_operation_done (struct GNUNET_TESTBED_Operation *operation); 1278GNUNET_TESTBED_operation_done(struct GNUNET_TESTBED_Operation *operation);
1306 1279
1307 1280
1308/** 1281/**
@@ -1341,12 +1314,12 @@ typedef int
1341 * @return operation handle to cancel the operation 1314 * @return operation handle to cancel the operation
1342 */ 1315 */
1343struct GNUNET_TESTBED_Operation * 1316struct GNUNET_TESTBED_Operation *
1344GNUNET_TESTBED_get_statistics (unsigned int num_peers, 1317GNUNET_TESTBED_get_statistics(unsigned int num_peers,
1345 struct GNUNET_TESTBED_Peer **peers, 1318 struct GNUNET_TESTBED_Peer **peers,
1346 const char *subsystem, const char *name, 1319 const char *subsystem, const char *name,
1347 GNUNET_TESTBED_StatisticsIterator proc, 1320 GNUNET_TESTBED_StatisticsIterator proc,
1348 GNUNET_TESTBED_OperationCompletionCallback cont, 1321 GNUNET_TESTBED_OperationCompletionCallback cont,
1349 void *cls); 1322 void *cls);
1350 1323
1351 1324
1352/** 1325/**
@@ -1358,7 +1331,7 @@ GNUNET_TESTBED_get_statistics (unsigned int num_peers,
1358 * @return The peer's unique ID. 1331 * @return The peer's unique ID.
1359 */ 1332 */
1360uint32_t 1333uint32_t
1361GNUNET_TESTBED_get_index (const struct GNUNET_TESTBED_Peer *peer); 1334GNUNET_TESTBED_get_index(const struct GNUNET_TESTBED_Peer *peer);
1362 1335
1363 1336
1364/** 1337/**
@@ -1424,14 +1397,14 @@ typedef void
1424 * @param test_master_cls closure for 'test_master'. 1397 * @param test_master_cls closure for 'test_master'.
1425 */ 1398 */
1426void 1399void
1427GNUNET_TESTBED_run (const char *host_filename, 1400GNUNET_TESTBED_run(const char *host_filename,
1428 const struct GNUNET_CONFIGURATION_Handle *cfg, 1401 const struct GNUNET_CONFIGURATION_Handle *cfg,
1429 unsigned int num_peers, 1402 unsigned int num_peers,
1430 uint64_t event_mask, 1403 uint64_t event_mask,
1431 GNUNET_TESTBED_ControllerCallback cc, 1404 GNUNET_TESTBED_ControllerCallback cc,
1432 void *cc_cls, 1405 void *cc_cls,
1433 GNUNET_TESTBED_TestMaster test_master, 1406 GNUNET_TESTBED_TestMaster test_master,
1434 void *test_master_cls); 1407 void *test_master_cls);
1435 1408
1436 1409
1437/** 1410/**
@@ -1473,14 +1446,14 @@ GNUNET_TESTBED_run (const char *host_filename,
1473 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success 1446 * @return #GNUNET_SYSERR on error, #GNUNET_OK on success
1474 */ 1447 */
1475int 1448int
1476GNUNET_TESTBED_test_run (const char *testname, 1449GNUNET_TESTBED_test_run(const char *testname,
1477 const char *cfg_filename, 1450 const char *cfg_filename,
1478 unsigned int num_peers, 1451 unsigned int num_peers,
1479 uint64_t event_mask, 1452 uint64_t event_mask,
1480 GNUNET_TESTBED_ControllerCallback cc, 1453 GNUNET_TESTBED_ControllerCallback cc,
1481 void *cc_cls, 1454 void *cc_cls,
1482 GNUNET_TESTBED_TestMaster test_master, 1455 GNUNET_TESTBED_TestMaster test_master,
1483 void *test_master_cls); 1456 void *test_master_cls);
1484 1457
1485 1458
1486/** 1459/**
@@ -1491,7 +1464,7 @@ GNUNET_TESTBED_test_run (const char *testname,
1491 * @return handle to the master controller 1464 * @return handle to the master controller
1492 */ 1465 */
1493struct GNUNET_TESTBED_Controller * 1466struct GNUNET_TESTBED_Controller *
1494GNUNET_TESTBED_run_get_controller_handle (struct GNUNET_TESTBED_RunHandle *h); 1467GNUNET_TESTBED_run_get_controller_handle(struct GNUNET_TESTBED_RunHandle *h);
1495 1468
1496 1469
1497/** 1470/**
@@ -1503,8 +1476,7 @@ struct GNUNET_TESTBED_Barrier;
1503/** 1476/**
1504 * Status of a barrier 1477 * Status of a barrier
1505 */ 1478 */
1506enum GNUNET_TESTBED_BarrierStatus 1479enum GNUNET_TESTBED_BarrierStatus {
1507{
1508 /** 1480 /**
1509 * Barrier initialised successfully 1481 * Barrier initialised successfully
1510 */ 1482 */
@@ -1519,7 +1491,6 @@ enum GNUNET_TESTBED_BarrierStatus
1519 * Error status 1491 * Error status
1520 */ 1492 */
1521 GNUNET_TESTBED_BARRIERSTATUS_ERROR, 1493 GNUNET_TESTBED_BARRIERSTATUS_ERROR,
1522
1523}; 1494};
1524 1495
1525 1496
@@ -1561,11 +1532,11 @@ typedef void
1561 * @return barrier handle 1532 * @return barrier handle
1562 */ 1533 */
1563struct GNUNET_TESTBED_Barrier * 1534struct GNUNET_TESTBED_Barrier *
1564GNUNET_TESTBED_barrier_init (struct GNUNET_TESTBED_Controller *controller, 1535GNUNET_TESTBED_barrier_init(struct GNUNET_TESTBED_Controller *controller,
1565 const char *name, 1536 const char *name,
1566 unsigned int quorum, 1537 unsigned int quorum,
1567 GNUNET_TESTBED_barrier_status_cb cb, 1538 GNUNET_TESTBED_barrier_status_cb cb,
1568 void *cb_cls); 1539 void *cb_cls);
1569 1540
1570 1541
1571/** 1542/**
@@ -1574,7 +1545,7 @@ GNUNET_TESTBED_barrier_init (struct GNUNET_TESTBED_Controller *controller,
1574 * @param barrier the barrier handle 1545 * @param barrier the barrier handle
1575 */ 1546 */
1576void 1547void
1577GNUNET_TESTBED_barrier_cancel (struct GNUNET_TESTBED_Barrier *barrier); 1548GNUNET_TESTBED_barrier_cancel(struct GNUNET_TESTBED_Barrier *barrier);
1578 1549
1579 1550
1580/** 1551/**
@@ -1611,9 +1582,9 @@ typedef void
1611 * anytime before the callback is called. NULL upon error. 1582 * anytime before the callback is called. NULL upon error.
1612 */ 1583 */
1613struct GNUNET_TESTBED_BarrierWaitHandle * 1584struct GNUNET_TESTBED_BarrierWaitHandle *
1614GNUNET_TESTBED_barrier_wait (const char *name, 1585GNUNET_TESTBED_barrier_wait(const char *name,
1615 GNUNET_TESTBED_barrier_wait_cb cb, 1586 GNUNET_TESTBED_barrier_wait_cb cb,
1616 void *cls); 1587 void *cls);
1617 1588
1618 1589
1619/** 1590/**
@@ -1623,7 +1594,7 @@ GNUNET_TESTBED_barrier_wait (const char *name,
1623 * @param h the barrier wait handle 1594 * @param h the barrier wait handle
1624 */ 1595 */
1625void 1596void
1626GNUNET_TESTBED_barrier_wait_cancel (struct GNUNET_TESTBED_BarrierWaitHandle *h); 1597GNUNET_TESTBED_barrier_wait_cancel(struct GNUNET_TESTBED_BarrierWaitHandle *h);
1627 1598
1628 1599
1629/** 1600/**
@@ -1637,8 +1608,7 @@ struct GNUNET_TESTBED_UnderlayLinkModel;
1637 * The type of GNUNET_TESTBED_UnderlayLinkModel 1608 * The type of GNUNET_TESTBED_UnderlayLinkModel
1638 * @ingroup underlay 1609 * @ingroup underlay
1639 */ 1610 */
1640enum GNUNET_TESTBED_UnderlayLinkModelType 1611enum GNUNET_TESTBED_UnderlayLinkModelType {
1641{
1642 /** 1612 /**
1643 * The model is based on white listing of peers to which underlay connections 1613 * The model is based on white listing of peers to which underlay connections
1644 * are permitted. Underlay connections to all other peers will not be 1614 * are permitted. Underlay connections to all other peers will not be
@@ -1665,8 +1635,8 @@ enum GNUNET_TESTBED_UnderlayLinkModelType
1665 * @return the model 1635 * @return the model
1666 */ 1636 */
1667struct GNUNET_TESTBED_UnderlayLinkModel * 1637struct GNUNET_TESTBED_UnderlayLinkModel *
1668GNUNET_TESTBED_underlaylinkmodel_create (struct GNUNET_TESTBED_Peer *peer, 1638GNUNET_TESTBED_underlaylinkmodel_create(struct GNUNET_TESTBED_Peer *peer,
1669 enum GNUNET_TESTBED_UnderlayLinkModelType type); 1639 enum GNUNET_TESTBED_UnderlayLinkModelType type);
1670 1640
1671 1641
1672/** 1642/**
@@ -1679,8 +1649,8 @@ GNUNET_TESTBED_underlaylinkmodel_create (struct GNUNET_TESTBED_Peer *peer,
1679 * @param peer the peer to add 1649 * @param peer the peer to add
1680 */ 1650 */
1681void 1651void
1682GNUNET_TESTBED_underlaylinkmodel_add_peer (struct GNUNET_TESTBED_UnderlayLinkModel *model, 1652GNUNET_TESTBED_underlaylinkmodel_add_peer(struct GNUNET_TESTBED_UnderlayLinkModel *model,
1683 struct GNUNET_TESTBED_Peer *peer); 1653 struct GNUNET_TESTBED_Peer *peer);
1684 1654
1685 1655
1686/** 1656/**
@@ -1695,11 +1665,11 @@ GNUNET_TESTBED_underlaylinkmodel_add_peer (struct GNUNET_TESTBED_UnderlayLinkMod
1695 * @param bandwidth bandwidth of the link in kilobytes per second [kB/s] 1665 * @param bandwidth bandwidth of the link in kilobytes per second [kB/s]
1696 */ 1666 */
1697void 1667void
1698GNUNET_TESTBED_underlaylinkmodel_set_link (struct GNUNET_TESTBED_UnderlayLinkModel *model, 1668GNUNET_TESTBED_underlaylinkmodel_set_link(struct GNUNET_TESTBED_UnderlayLinkModel *model,
1699 struct GNUNET_TESTBED_Peer *peer, 1669 struct GNUNET_TESTBED_Peer *peer,
1700 uint32_t latency, 1670 uint32_t latency,
1701 uint32_t loss, 1671 uint32_t loss,
1702 uint32_t bandwidth); 1672 uint32_t bandwidth);
1703 1673
1704 1674
1705/** 1675/**
@@ -1709,7 +1679,7 @@ GNUNET_TESTBED_underlaylinkmodel_set_link (struct GNUNET_TESTBED_UnderlayLinkMod
1709 * @param model the model to commit 1679 * @param model the model to commit
1710 */ 1680 */
1711void 1681void
1712GNUNET_TESTBED_underlaylinkmodel_commit (struct GNUNET_TESTBED_UnderlayLinkModel *model); 1682GNUNET_TESTBED_underlaylinkmodel_commit(struct GNUNET_TESTBED_UnderlayLinkModel *model);
1713 1683
1714 1684
1715/** 1685/**
@@ -1721,7 +1691,7 @@ GNUNET_TESTBED_underlaylinkmodel_commit (struct GNUNET_TESTBED_UnderlayLinkModel
1721 * @param model the model to unallocate 1691 * @param model the model to unallocate
1722 */ 1692 */
1723void 1693void
1724GNUNET_TESTBED_underlaylinkmodel_free (struct GNUNET_TESTBED_UnderlayLinkModel *model); 1694GNUNET_TESTBED_underlaylinkmodel_free(struct GNUNET_TESTBED_UnderlayLinkModel *model);
1725 1695
1726 1696
1727#if 0 /* keep Emacsens' auto-indent happy */ 1697#if 0 /* keep Emacsens' auto-indent happy */