aboutsummaryrefslogtreecommitdiff
path: root/src/testbed/testbed_api.c
diff options
context:
space:
mode:
authorSree Harsha Totakura <totakura@in.tum.de>2013-01-02 09:30:42 +0000
committerSree Harsha Totakura <totakura@in.tum.de>2013-01-02 09:30:42 +0000
commit12125a5027fffe8fccf873b46c08f2c8cb1b96c6 (patch)
tree86c135671af5c9701674bc6f67a953969272d637 /src/testbed/testbed_api.c
parent01e21ba6afe2d16ba45b5a73f2777152fd27ffc3 (diff)
downloadgnunet-12125a5027fffe8fccf873b46c08f2c8cb1b96c6.tar.gz
gnunet-12125a5027fffe8fccf873b46c08f2c8cb1b96c6.zip
- doxygen
Diffstat (limited to 'src/testbed/testbed_api.c')
-rw-r--r--src/testbed/testbed_api.c50
1 files changed, 37 insertions, 13 deletions
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 */
320static struct SDHandle * 320static struct SDHandle *
321SD_init (unsigned int max_cnt) 321SD_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 */
338static void 337static void
339SD_destroy (struct SDHandle *h) 338SD_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 */
351static void 357static void
352SD_add_data (struct SDHandle *h, unsigned int amount) 358SD_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 */
392static int 399static int
393SD_deviation_factor (struct SDHandle *h, unsigned int amount) 400SD_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 */
1472static void 1479static void
1473GNUNET_TESTBED_set_num_parallel_overlay_connects_ (struct 1480GNUNET_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 */
2492static void 2505static void
2493decide_npoc (struct GNUNET_TESTBED_Controller *c) 2506decide_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 */
2531int 2554int
2532GNUNET_TESTBED_release_time_slot_ (struct GNUNET_TESTBED_Controller *c, 2555GNUNET_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 */
2556void 2580void