diff options
-rw-r--r-- | src/include/gnunet_testbed_service.h | 4 | ||||
-rw-r--r-- | src/include/gnunet_testing_lib.h | 3 | ||||
-rw-r--r-- | src/testbed/testbed_api.c | 50 | ||||
-rw-r--r-- | src/testbed/testbed_api.h | 36 | ||||
-rw-r--r-- | src/testbed/testbed_api_hosts.c | 2 |
5 files changed, 74 insertions, 21 deletions
diff --git a/src/include/gnunet_testbed_service.h b/src/include/gnunet_testbed_service.h index 8e5e9a47c..ada7d0988 100644 --- a/src/include/gnunet_testbed_service.h +++ b/src/include/gnunet_testbed_service.h | |||
@@ -172,7 +172,7 @@ GNUNET_TESTBED_is_host_habitable (const struct GNUNET_TESTBED_Host *host, | |||
172 | /** | 172 | /** |
173 | * Function to cancel a request started using GNUNET_TESTBED_is_host_habitable() | 173 | * Function to cancel a request started using GNUNET_TESTBED_is_host_habitable() |
174 | * | 174 | * |
175 | * @param struct handle the habitability check handle | 175 | * @param handle the habitability check handle |
176 | */ | 176 | */ |
177 | void | 177 | void |
178 | GNUNET_TESTBED_is_host_habitable_cancel (struct | 178 | GNUNET_TESTBED_is_host_habitable_cancel (struct |
@@ -1378,7 +1378,7 @@ GNUNET_TESTBED_run (const char *host_filename, | |||
1378 | * @param cc_cls closure for cc | 1378 | * @param cc_cls closure for cc |
1379 | * @param test_master this callback will be called once the test is ready | 1379 | * @param test_master this callback will be called once the test is ready |
1380 | * @param test_master_cls closure for 'test_master'. | 1380 | * @param test_master_cls closure for 'test_master'. |
1381 | * @param GNUNET_SYSERR on error, GNUNET_OK on success | 1381 | * @return GNUNET_SYSERR on error, GNUNET_OK on success |
1382 | */ | 1382 | */ |
1383 | int | 1383 | int |
1384 | GNUNET_TESTBED_test_run (const char *testname, | 1384 | GNUNET_TESTBED_test_run (const char *testname, |
diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h index c34166b2e..04a3e9942 100644 --- a/src/include/gnunet_testing_lib.h +++ b/src/include/gnunet_testing_lib.h | |||
@@ -95,9 +95,6 @@ GNUNET_TESTING_system_create (const char *testdir, | |||
95 | * service configurations generated to allow control connections from | 95 | * service configurations generated to allow control connections from |
96 | * this ip. This can either be a single ip address or a network address | 96 | * this ip. This can either be a single ip address or a network address |
97 | * in CIDR notation. | 97 | * in CIDR notation. |
98 | * @param controller hostname of the controlling host, | ||
99 | * service configurations are modified to allow | ||
100 | * control connections from this host; can be NULL | ||
101 | * @param hostname the hostname of the system we are using for testing; NULL for | 98 | * @param hostname the hostname of the system we are using for testing; NULL for |
102 | * localhost | 99 | * localhost |
103 | * @param lowport lowest port number this system is allowed to allocate (inclusive) | 100 | * @param lowport lowest port number this system is allowed to allocate (inclusive) |
diff --git a/src/testbed/testbed_api.c b/src/testbed/testbed_api.c index eb98bea46..a4e78b472 100644 --- a/src/testbed/testbed_api.c +++ b/src/testbed/testbed_api.c | |||
@@ -312,10 +312,10 @@ struct SDHandle | |||
312 | 312 | ||
313 | 313 | ||
314 | /** | 314 | /** |
315 | * FIXME: doc | 315 | * Initialize standard deviation calculation handle |
316 | * | 316 | * |
317 | * @param | 317 | * @param max_cnt the maximum number of readings to keep |
318 | * @return | 318 | * @return the initialized handle |
319 | */ | 319 | */ |
320 | static struct SDHandle * | 320 | static struct SDHandle * |
321 | SD_init (unsigned int max_cnt) | 321 | SD_init (unsigned int max_cnt) |
@@ -330,10 +330,9 @@ SD_init (unsigned int max_cnt) | |||
330 | 330 | ||
331 | 331 | ||
332 | /** | 332 | /** |
333 | * FIXME: doc | 333 | * Frees the memory allocated to the SD handle |
334 | * | 334 | * |
335 | * @param | 335 | * @param h the SD handle |
336 | * @return | ||
337 | */ | 336 | */ |
338 | static void | 337 | static void |
339 | SD_destroy (struct SDHandle *h) | 338 | SD_destroy (struct SDHandle *h) |
@@ -348,6 +347,13 @@ SD_destroy (struct SDHandle *h) | |||
348 | GNUNET_free (h); | 347 | GNUNET_free (h); |
349 | } | 348 | } |
350 | 349 | ||
350 | |||
351 | /** | ||
352 | * Add a reading to SD | ||
353 | * | ||
354 | * @param h the SD handle | ||
355 | * @param amount the reading value | ||
356 | */ | ||
351 | static void | 357 | static void |
352 | SD_add_data (struct SDHandle *h, unsigned int amount) | 358 | SD_add_data (struct SDHandle *h, unsigned int amount) |
353 | { | 359 | { |
@@ -385,9 +391,10 @@ SD_add_data (struct SDHandle *h, unsigned int amount) | |||
385 | * | 391 | * |
386 | * @param h the SDhandle | 392 | * @param h the SDhandle |
387 | * @param amount the value for which the deviation is returned | 393 | * @param amount the value for which the deviation is returned |
394 | |||
388 | * @return the deviation from the average; GNUNET_SYSERR if the deviation cannot | 395 | * @return the deviation from the average; GNUNET_SYSERR if the deviation cannot |
389 | * be calculated; a maximum of 4 is returned for deviations equal to | 396 | * be calculated OR 0 if the deviation is less than the average; a |
390 | * or larger than 4 | 397 | * maximum of 4 is returned for deviations equal to or larger than 4 |
391 | */ | 398 | */ |
392 | static int | 399 | static int |
393 | SD_deviation_factor (struct SDHandle *h, unsigned int amount) | 400 | SD_deviation_factor (struct SDHandle *h, unsigned int amount) |
@@ -1464,10 +1471,10 @@ oprelease_get_slave_config (void *cls) | |||
1464 | 1471 | ||
1465 | 1472 | ||
1466 | /** | 1473 | /** |
1467 | * FIXME: doc | 1474 | * Initializes the operation queue for parallel overlay connects |
1468 | * | 1475 | * |
1469 | * @param | 1476 | * @param c the controller handle |
1470 | * @return | 1477 | * @param npoc the number of parallel overlay connects - the queue size |
1471 | */ | 1478 | */ |
1472 | static void | 1479 | static void |
1473 | GNUNET_TESTBED_set_num_parallel_overlay_connects_ (struct | 1480 | GNUNET_TESTBED_set_num_parallel_overlay_connects_ (struct |
@@ -1528,8 +1535,6 @@ free_argv (char **argv) | |||
1528 | * HOST(all connections form this ip are permitted by the testbed) when | 1535 | * HOST(all connections form this ip are permitted by the testbed) when |
1529 | * starting testbed controller at host. This can either be a single ip | 1536 | * starting testbed controller at host. This can either be a single ip |
1530 | * address or a network address in CIDR notation. | 1537 | * address or a network address in CIDR notation. |
1531 | * @param controller_ip the ip address of the controller. Will be set as TRUSTED | ||
1532 | * host when starting testbed controller at host | ||
1533 | * @param host the host where the controller has to be started; NULL for | 1538 | * @param host the host where the controller has to be started; NULL for |
1534 | * localhost | 1539 | * localhost |
1535 | * @param cfg template configuration to use for the remote controller; the | 1540 | * @param cfg template configuration to use for the remote controller; the |
@@ -2469,6 +2474,8 @@ GNUNET_TESTBED_get_next_op_id (struct GNUNET_TESTBED_Controller *controller) | |||
2469 | * Returns a timing slot which will be exclusively locked | 2474 | * Returns a timing slot which will be exclusively locked |
2470 | * | 2475 | * |
2471 | * @param c the controller handle | 2476 | * @param c the controller handle |
2477 | * @param key a pointer which is associated to the returned slot; should not be | ||
2478 | * NULL. It serves as a key to determine the correct owner of the slot | ||
2472 | * @return the time slot index in the array of time slots in the controller | 2479 | * @return the time slot index in the array of time slots in the controller |
2473 | * handle | 2480 | * handle |
2474 | */ | 2481 | */ |
@@ -2489,6 +2496,12 @@ GNUNET_TESTBED_get_tslot_ (struct GNUNET_TESTBED_Controller *c, void *key) | |||
2489 | } | 2496 | } |
2490 | 2497 | ||
2491 | 2498 | ||
2499 | /** | ||
2500 | * Decides whether any change in the number of parallel overlay connects is | ||
2501 | * necessary to adapt to the load on the system | ||
2502 | * | ||
2503 | * @param c the controller handle | ||
2504 | */ | ||
2492 | static void | 2505 | static void |
2493 | decide_npoc (struct GNUNET_TESTBED_Controller *c) | 2506 | decide_npoc (struct GNUNET_TESTBED_Controller *c) |
2494 | { | 2507 | { |
@@ -2528,6 +2541,16 @@ decide_npoc (struct GNUNET_TESTBED_Controller *c) | |||
2528 | } | 2541 | } |
2529 | 2542 | ||
2530 | 2543 | ||
2544 | /** | ||
2545 | * Releases a time slot thus making it available for be used again | ||
2546 | * | ||
2547 | * @param c the controller handle | ||
2548 | * @param index the index of the the time slot | ||
2549 | * @param key the key to prove ownership of the timeslot | ||
2550 | * @return GNUNET_YES if the time slot is successfully removed; GNUNET_NO if the | ||
2551 | * time slot cannot be removed - this could be because of the index | ||
2552 | * greater than existing number of time slots or `key' being different | ||
2553 | */ | ||
2531 | int | 2554 | int |
2532 | GNUNET_TESTBED_release_time_slot_ (struct GNUNET_TESTBED_Controller *c, | 2555 | GNUNET_TESTBED_release_time_slot_ (struct GNUNET_TESTBED_Controller *c, |
2533 | unsigned int index, | 2556 | unsigned int index, |
@@ -2551,6 +2574,7 @@ GNUNET_TESTBED_release_time_slot_ (struct GNUNET_TESTBED_Controller *c, | |||
2551 | * | 2574 | * |
2552 | * @param c the controller handle | 2575 | * @param c the controller handle |
2553 | * @param index the index of the time slot to update | 2576 | * @param index the index of the time slot to update |
2577 | * @param key the key to identify ownership of the slot | ||
2554 | * @param time the new time | 2578 | * @param time the new time |
2555 | */ | 2579 | */ |
2556 | void | 2580 | void |
diff --git a/src/testbed/testbed_api.h b/src/testbed/testbed_api.h index 54a622dbf..ed5b38b1d 100644 --- a/src/testbed/testbed_api.h +++ b/src/testbed/testbed_api.h | |||
@@ -379,9 +379,13 @@ GNUNET_TESTBED_operation_add_ (struct GNUNET_TESTBED_Operation *op); | |||
379 | 379 | ||
380 | 380 | ||
381 | /** | 381 | /** |
382 | * Creates a helper initialization message. Only for testing. | 382 | * Creates a helper initialization message. This function is here because we |
383 | * want to use this in testing | ||
383 | * | 384 | * |
384 | * @param cname the ip address of the controlling host | 385 | * @param trusted_ip the ip address of the controller which will be set as TRUSTED |
386 | * HOST(all connections form this ip are permitted by the testbed) when | ||
387 | * starting testbed controller at host. This can either be a single ip | ||
388 | * address or a network address in CIDR notation. | ||
385 | * @param hostname the hostname of the destination this message is intended for | 389 | * @param hostname the hostname of the destination this message is intended for |
386 | * @param cfg the configuration that has to used to start the testbed service | 390 | * @param cfg the configuration that has to used to start the testbed service |
387 | * thru helper | 391 | * thru helper |
@@ -535,10 +539,28 @@ GNUNET_TESTBED_controller_link_ (void *op_cls, | |||
535 | *slave_cfg, | 539 | *slave_cfg, |
536 | int is_subordinate); | 540 | int is_subordinate); |
537 | 541 | ||
542 | |||
543 | /** | ||
544 | * Returns a timing slot which will be exclusively locked | ||
545 | * | ||
546 | * @param c the controller handle | ||
547 | * @param key a pointer which is associated to the returned slot; should not be | ||
548 | * NULL. It serves as a key to determine the correct owner of the slot | ||
549 | * @return the time slot index in the array of time slots in the controller | ||
550 | * handle | ||
551 | */ | ||
538 | unsigned int | 552 | unsigned int |
539 | GNUNET_TESTBED_get_tslot_ (struct GNUNET_TESTBED_Controller *c, void *key); | 553 | GNUNET_TESTBED_get_tslot_ (struct GNUNET_TESTBED_Controller *c, void *key); |
540 | 554 | ||
541 | 555 | ||
556 | /** | ||
557 | * Function to update a time slot | ||
558 | * | ||
559 | * @param c the controller handle | ||
560 | * @param index the index of the time slot to update | ||
561 | * @param key the key to identify ownership of the slot | ||
562 | * @param time the new time | ||
563 | */ | ||
542 | void | 564 | void |
543 | GNUNET_TESTBED_update_time_slot_ (struct GNUNET_TESTBED_Controller *c, | 565 | GNUNET_TESTBED_update_time_slot_ (struct GNUNET_TESTBED_Controller *c, |
544 | unsigned int index, | 566 | unsigned int index, |
@@ -546,6 +568,16 @@ GNUNET_TESTBED_update_time_slot_ (struct GNUNET_TESTBED_Controller *c, | |||
546 | struct GNUNET_TIME_Relative time); | 568 | struct GNUNET_TIME_Relative time); |
547 | 569 | ||
548 | 570 | ||
571 | /** | ||
572 | * Releases a time slot thus making it available for be used again | ||
573 | * | ||
574 | * @param c the controller handle | ||
575 | * @param index the index of the the time slot | ||
576 | * @param key the key to prove ownership of the timeslot | ||
577 | * @return GNUNET_YES if the time slot is successfully removed; GNUNET_NO if the | ||
578 | * time slot cannot be removed - this could be because of the index | ||
579 | * greater than existing number of time slots or `key' being different | ||
580 | */ | ||
549 | int | 581 | int |
550 | GNUNET_TESTBED_release_time_slot_ (struct GNUNET_TESTBED_Controller *c, | 582 | GNUNET_TESTBED_release_time_slot_ (struct GNUNET_TESTBED_Controller *c, |
551 | unsigned int index, | 583 | unsigned int index, |
diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c index e61164475..8bba56d6c 100644 --- a/src/testbed/testbed_api_hosts.c +++ b/src/testbed/testbed_api_hosts.c | |||
@@ -646,7 +646,7 @@ GNUNET_TESTBED_is_host_habitable (const struct GNUNET_TESTBED_Host *host, | |||
646 | /** | 646 | /** |
647 | * Function to cancel a request started using GNUNET_TESTBED_is_host_habitable() | 647 | * Function to cancel a request started using GNUNET_TESTBED_is_host_habitable() |
648 | * | 648 | * |
649 | * @param struct handle the habitability check handle | 649 | * @param handle the habitability check handle |
650 | */ | 650 | */ |
651 | void | 651 | void |
652 | GNUNET_TESTBED_is_host_habitable_cancel (struct | 652 | GNUNET_TESTBED_is_host_habitable_cancel (struct |