diff options
Diffstat (limited to 'src/testbed/testbed_api.h')
-rw-r--r-- | src/testbed/testbed_api.h | 87 |
1 files changed, 48 insertions, 39 deletions
diff --git a/src/testbed/testbed_api.h b/src/testbed/testbed_api.h index c79c35a5e..023d772a0 100644 --- a/src/testbed/testbed_api.h +++ b/src/testbed/testbed_api.h | |||
@@ -41,7 +41,8 @@ | |||
41 | /** | 41 | /** |
42 | * Enumeration of operations | 42 | * Enumeration of operations |
43 | */ | 43 | */ |
44 | enum OperationType { | 44 | enum OperationType |
45 | { | ||
45 | /** | 46 | /** |
46 | * Peer create operation | 47 | * Peer create operation |
47 | */ | 48 | */ |
@@ -108,7 +109,8 @@ enum OperationType { | |||
108 | /** | 109 | /** |
109 | * Enumeration of states of OperationContext | 110 | * Enumeration of states of OperationContext |
110 | */ | 111 | */ |
111 | enum OperationContextState { | 112 | enum OperationContextState |
113 | { | ||
112 | /** | 114 | /** |
113 | * The initial state where the associated operation has just been created | 115 | * The initial state where the associated operation has just been created |
114 | * and is waiting in the operation queues to be started | 116 | * and is waiting in the operation queues to be started |
@@ -132,7 +134,8 @@ enum OperationContextState { | |||
132 | /** | 134 | /** |
133 | * Context information for GNUNET_TESTBED_Operation | 135 | * Context information for GNUNET_TESTBED_Operation |
134 | */ | 136 | */ |
135 | struct OperationContext { | 137 | struct OperationContext |
138 | { | ||
136 | /** | 139 | /** |
137 | * The controller to which this operation context belongs to | 140 | * The controller to which this operation context belongs to |
138 | */ | 141 | */ |
@@ -188,7 +191,8 @@ typedef void | |||
188 | * controllers can interact with each other (in a P2P fashion); those | 191 | * controllers can interact with each other (in a P2P fashion); those |
189 | * links are established via TCP/IP on the controller's service port. | 192 | * links are established via TCP/IP on the controller's service port. |
190 | */ | 193 | */ |
191 | struct GNUNET_TESTBED_Controller { | 194 | struct GNUNET_TESTBED_Controller |
195 | { | ||
192 | /** | 196 | /** |
193 | * The host where the controller is running | 197 | * The host where the controller is running |
194 | */ | 198 | */ |
@@ -271,7 +275,8 @@ struct GNUNET_TESTBED_Controller { | |||
271 | /** | 275 | /** |
272 | * Handle for barrier | 276 | * Handle for barrier |
273 | */ | 277 | */ |
274 | struct GNUNET_TESTBED_Barrier { | 278 | struct GNUNET_TESTBED_Barrier |
279 | { | ||
275 | /** | 280 | /** |
276 | * hashcode identifying this barrier in the hashmap | 281 | * hashcode identifying this barrier in the hashmap |
277 | */ | 282 | */ |
@@ -313,8 +318,8 @@ struct GNUNET_TESTBED_Barrier { | |||
313 | * @deprecated | 318 | * @deprecated |
314 | */ | 319 | */ |
315 | void | 320 | void |
316 | GNUNET_TESTBED_queue_message_(struct GNUNET_TESTBED_Controller *controller, | 321 | GNUNET_TESTBED_queue_message_ (struct GNUNET_TESTBED_Controller *controller, |
317 | struct GNUNET_MessageHeader *msg); | 322 | struct GNUNET_MessageHeader *msg); |
318 | 323 | ||
319 | 324 | ||
320 | /** | 325 | /** |
@@ -326,8 +331,8 @@ GNUNET_TESTBED_queue_message_(struct GNUNET_TESTBED_Controller *controller, | |||
326 | * @param opc the operation context to be inserted | 331 | * @param opc the operation context to be inserted |
327 | */ | 332 | */ |
328 | void | 333 | void |
329 | GNUNET_TESTBED_insert_opc_(struct GNUNET_TESTBED_Controller *c, | 334 | GNUNET_TESTBED_insert_opc_ (struct GNUNET_TESTBED_Controller *c, |
330 | struct OperationContext *opc); | 335 | struct OperationContext *opc); |
331 | 336 | ||
332 | 337 | ||
333 | /** | 338 | /** |
@@ -338,8 +343,8 @@ GNUNET_TESTBED_insert_opc_(struct GNUNET_TESTBED_Controller *c, | |||
338 | * @param opc the operation context to remove | 343 | * @param opc the operation context to remove |
339 | */ | 344 | */ |
340 | void | 345 | void |
341 | GNUNET_TESTBED_remove_opc_(const struct GNUNET_TESTBED_Controller *c, | 346 | GNUNET_TESTBED_remove_opc_ (const struct GNUNET_TESTBED_Controller *c, |
342 | struct OperationContext *opc); | 347 | struct OperationContext *opc); |
343 | 348 | ||
344 | 349 | ||
345 | /** | 350 | /** |
@@ -352,9 +357,9 @@ GNUNET_TESTBED_remove_opc_(const struct GNUNET_TESTBED_Controller *c, | |||
352 | * @return the size of the xconfig | 357 | * @return the size of the xconfig |
353 | */ | 358 | */ |
354 | size_t | 359 | size_t |
355 | GNUNET_TESTBED_compress_config_(const char *config, | 360 | GNUNET_TESTBED_compress_config_ (const char *config, |
356 | size_t size, | 361 | size_t size, |
357 | char **xconfig); | 362 | char **xconfig); |
358 | 363 | ||
359 | 364 | ||
360 | /** | 365 | /** |
@@ -367,9 +372,9 @@ GNUNET_TESTBED_compress_config_(const char *config, | |||
367 | * @return the serialized and compressed configuration | 372 | * @return the serialized and compressed configuration |
368 | */ | 373 | */ |
369 | char * | 374 | char * |
370 | GNUNET_TESTBED_compress_cfg_(const struct GNUNET_CONFIGURATION_Handle *cfg, | 375 | GNUNET_TESTBED_compress_cfg_ (const struct GNUNET_CONFIGURATION_Handle *cfg, |
371 | size_t *size, | 376 | size_t *size, |
372 | size_t *xsize); | 377 | size_t *xsize); |
373 | 378 | ||
374 | 379 | ||
375 | /** | 380 | /** |
@@ -386,9 +391,10 @@ GNUNET_TESTBED_compress_cfg_(const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
386 | * @return the initialization message | 391 | * @return the initialization message |
387 | */ | 392 | */ |
388 | struct GNUNET_TESTBED_HelperInit * | 393 | struct GNUNET_TESTBED_HelperInit * |
389 | GNUNET_TESTBED_create_helper_init_msg_(const char *cname, | 394 | GNUNET_TESTBED_create_helper_init_msg_ (const char *cname, |
390 | const char *hostname, | 395 | const char *hostname, |
391 | const struct GNUNET_CONFIGURATION_Handle *cfg); | 396 | const struct |
397 | GNUNET_CONFIGURATION_Handle *cfg); | ||
392 | 398 | ||
393 | 399 | ||
394 | /** | 400 | /** |
@@ -406,11 +412,12 @@ GNUNET_TESTBED_create_helper_init_msg_(const char *cname, | |||
406 | * operation | 412 | * operation |
407 | */ | 413 | */ |
408 | struct OperationContext * | 414 | struct OperationContext * |
409 | GNUNET_TESTBED_forward_operation_msg_(struct GNUNET_TESTBED_Controller *controller, | 415 | GNUNET_TESTBED_forward_operation_msg_ (struct |
410 | uint64_t operation_id, | 416 | GNUNET_TESTBED_Controller *controller, |
411 | const struct GNUNET_MessageHeader *msg, | 417 | uint64_t operation_id, |
412 | GNUNET_MQ_MessageCallback cc, | 418 | const struct GNUNET_MessageHeader *msg, |
413 | void *cc_cls); | 419 | GNUNET_MQ_MessageCallback cc, |
420 | void *cc_cls); | ||
414 | 421 | ||
415 | /** | 422 | /** |
416 | * Function to cancel an operation created by simply forwarding an operation | 423 | * Function to cancel an operation created by simply forwarding an operation |
@@ -419,7 +426,7 @@ GNUNET_TESTBED_forward_operation_msg_(struct GNUNET_TESTBED_Controller *controll | |||
419 | * @param opc the operation context from GNUNET_TESTBED_forward_operation_msg_() | 426 | * @param opc the operation context from GNUNET_TESTBED_forward_operation_msg_() |
420 | */ | 427 | */ |
421 | void | 428 | void |
422 | GNUNET_TESTBED_forward_operation_msg_cancel_(struct OperationContext *opc); | 429 | GNUNET_TESTBED_forward_operation_msg_cancel_ (struct OperationContext *opc); |
423 | 430 | ||
424 | 431 | ||
425 | /** | 432 | /** |
@@ -432,7 +439,7 @@ GNUNET_TESTBED_forward_operation_msg_cancel_(struct OperationContext *opc); | |||
432 | * @return handle to the parsed configuration | 439 | * @return handle to the parsed configuration |
433 | */ | 440 | */ |
434 | struct GNUNET_CONFIGURATION_Handle * | 441 | struct GNUNET_CONFIGURATION_Handle * |
435 | GNUNET_TESTBED_extract_config_(const struct GNUNET_MessageHeader *msg); | 442 | GNUNET_TESTBED_extract_config_ (const struct GNUNET_MessageHeader *msg); |
436 | 443 | ||
437 | 444 | ||
438 | /** | 445 | /** |
@@ -443,7 +450,9 @@ GNUNET_TESTBED_extract_config_(const struct GNUNET_MessageHeader *msg); | |||
443 | * @return the error message | 450 | * @return the error message |
444 | */ | 451 | */ |
445 | const char * | 452 | const char * |
446 | GNUNET_TESTBED_parse_error_string_(const struct GNUNET_TESTBED_OperationFailureEventMessage *msg); | 453 | GNUNET_TESTBED_parse_error_string_ (const struct |
454 | GNUNET_TESTBED_OperationFailureEventMessage | ||
455 | *msg); | ||
447 | 456 | ||
448 | 457 | ||
449 | /** | 458 | /** |
@@ -454,7 +463,7 @@ GNUNET_TESTBED_parse_error_string_(const struct GNUNET_TESTBED_OperationFailureE | |||
454 | * @return the incremented operation id. | 463 | * @return the incremented operation id. |
455 | */ | 464 | */ |
456 | uint64_t | 465 | uint64_t |
457 | GNUNET_TESTBED_get_next_op_id(struct GNUNET_TESTBED_Controller *controller); | 466 | GNUNET_TESTBED_get_next_op_id (struct GNUNET_TESTBED_Controller *controller); |
458 | 467 | ||
459 | 468 | ||
460 | /** | 469 | /** |
@@ -470,9 +479,9 @@ GNUNET_TESTBED_get_next_op_id(struct GNUNET_TESTBED_Controller *controller); | |||
470 | * @return the operation handle; | 479 | * @return the operation handle; |
471 | */ | 480 | */ |
472 | struct GNUNET_TESTBED_Operation * | 481 | struct GNUNET_TESTBED_Operation * |
473 | GNUNET_TESTBED_get_slave_config_(void *op_cls, | 482 | GNUNET_TESTBED_get_slave_config_ (void *op_cls, |
474 | struct GNUNET_TESTBED_Controller *master, | 483 | struct GNUNET_TESTBED_Controller *master, |
475 | uint32_t slave_host_id); | 484 | uint32_t slave_host_id); |
476 | 485 | ||
477 | 486 | ||
478 | 487 | ||
@@ -493,12 +502,12 @@ GNUNET_TESTBED_get_slave_config_(void *op_cls, | |||
493 | * @return barrier handle; NULL upon error | 502 | * @return barrier handle; NULL upon error |
494 | */ | 503 | */ |
495 | struct GNUNET_TESTBED_Barrier * | 504 | struct GNUNET_TESTBED_Barrier * |
496 | GNUNET_TESTBED_barrier_init_(struct GNUNET_TESTBED_Controller *controller, | 505 | GNUNET_TESTBED_barrier_init_ (struct GNUNET_TESTBED_Controller *controller, |
497 | const char *name, | 506 | const char *name, |
498 | unsigned int quorum, | 507 | unsigned int quorum, |
499 | GNUNET_TESTBED_barrier_status_cb cb, | 508 | GNUNET_TESTBED_barrier_status_cb cb, |
500 | void *cls, | 509 | void *cls, |
501 | int echo); | 510 | int echo); |
502 | 511 | ||
503 | 512 | ||
504 | /** | 513 | /** |
@@ -508,7 +517,7 @@ GNUNET_TESTBED_barrier_init_(struct GNUNET_TESTBED_Controller *controller, | |||
508 | * @param barrier the barrier to remove | 517 | * @param barrier the barrier to remove |
509 | */ | 518 | */ |
510 | void | 519 | void |
511 | GNUNET_TESTBED_barrier_remove_(struct GNUNET_TESTBED_Barrier *barrier); | 520 | GNUNET_TESTBED_barrier_remove_ (struct GNUNET_TESTBED_Barrier *barrier); |
512 | 521 | ||
513 | 522 | ||
514 | 523 | ||