diff options
Diffstat (limited to 'src/testbed')
43 files changed, 331 insertions, 331 deletions
diff --git a/src/testbed/gnunet-daemon-testbed-blacklist.c b/src/testbed/gnunet-daemon-testbed-blacklist.c index d14944362..6be43999c 100644 --- a/src/testbed/gnunet-daemon-testbed-blacklist.c +++ b/src/testbed/gnunet-daemon-testbed-blacklist.c | |||
@@ -22,8 +22,8 @@ | |||
22 | /** | 22 | /** |
23 | * @file testbed/gnunet-daemon-testbed-blacklist.c | 23 | * @file testbed/gnunet-daemon-testbed-blacklist.c |
24 | * @brief daemon to restrict incoming connections from other peers at the | 24 | * @brief daemon to restrict incoming connections from other peers at the |
25 | * transport layer of a peer | 25 | * transport layer of a peer |
26 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | 26 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> |
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "platform.h" | 29 | #include "platform.h" |
@@ -143,7 +143,7 @@ static int | |||
143 | check_access (void *cls, const struct GNUNET_PeerIdentity * pid) | 143 | check_access (void *cls, const struct GNUNET_PeerIdentity * pid) |
144 | { | 144 | { |
145 | int contains; | 145 | int contains; |
146 | 146 | ||
147 | if (NULL != map) | 147 | if (NULL != map) |
148 | contains = GNUNET_CONTAINER_multipeermap_contains (map, pid); | 148 | contains = GNUNET_CONTAINER_multipeermap_contains (map, pid); |
149 | else | 149 | else |
@@ -167,7 +167,7 @@ setup_ac (const char *fname, const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
167 | uint64_t fsize; | 167 | uint64_t fsize; |
168 | unsigned int npeers; | 168 | unsigned int npeers; |
169 | unsigned int cnt; | 169 | unsigned int cnt; |
170 | 170 | ||
171 | GNUNET_assert (GNUNET_OK != GNUNET_DISK_file_size (fname, &fsize, GNUNET_NO, | 171 | GNUNET_assert (GNUNET_OK != GNUNET_DISK_file_size (fname, &fsize, GNUNET_NO, |
172 | GNUNET_YES)); | 172 | GNUNET_YES)); |
173 | if (0 != (fsize % sizeof (struct GNUNET_PeerIdentity))) | 173 | if (0 != (fsize % sizeof (struct GNUNET_PeerIdentity))) |
diff --git a/src/testbed/gnunet-helper-testbed.c b/src/testbed/gnunet-helper-testbed.c index 95c54d06d..f49789a80 100644 --- a/src/testbed/gnunet-helper-testbed.c +++ b/src/testbed/gnunet-helper-testbed.c | |||
@@ -24,8 +24,8 @@ | |||
24 | * gnunet-service-testbed. This binary also receives configuration | 24 | * gnunet-service-testbed. This binary also receives configuration |
25 | * from the remove controller which is put in a temporary location | 25 | * from the remove controller which is put in a temporary location |
26 | * with ports and paths fixed so that gnunet-service-testbed runs | 26 | * with ports and paths fixed so that gnunet-service-testbed runs |
27 | * without any hurdles. | 27 | * without any hurdles. |
28 | * | 28 | * |
29 | * This helper monitors for three termination events. They are: (1)The | 29 | * This helper monitors for three termination events. They are: (1)The |
30 | * stdin of the helper is closed for reading; (2)the helper received | 30 | * stdin of the helper is closed for reading; (2)the helper received |
31 | * SIGTERM/SIGINT; (3)the testbed crashed. In case of events 1 and 2 | 31 | * SIGTERM/SIGINT; (3)the testbed crashed. In case of events 1 and 2 |
@@ -161,13 +161,13 @@ static int status; | |||
161 | static void | 161 | static void |
162 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 162 | shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
163 | { | 163 | { |
164 | LOG_DEBUG ("Shutting down\n"); | 164 | LOG_DEBUG ("Shutting down\n"); |
165 | shutdown_task_id = GNUNET_SCHEDULER_NO_TASK; | 165 | shutdown_task_id = GNUNET_SCHEDULER_NO_TASK; |
166 | if (NULL != testbed) | 166 | if (NULL != testbed) |
167 | { | 167 | { |
168 | LOG_DEBUG ("Killing testbed\n"); | 168 | LOG_DEBUG ("Killing testbed\n"); |
169 | GNUNET_break (0 == GNUNET_OS_process_kill (testbed, SIGTERM)); | 169 | GNUNET_break (0 == GNUNET_OS_process_kill (testbed, SIGTERM)); |
170 | } | 170 | } |
171 | if (GNUNET_SCHEDULER_NO_TASK != read_task_id) | 171 | if (GNUNET_SCHEDULER_NO_TASK != read_task_id) |
172 | { | 172 | { |
173 | GNUNET_SCHEDULER_cancel (read_task_id); | 173 | GNUNET_SCHEDULER_cancel (read_task_id); |
@@ -194,7 +194,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
194 | GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (testbed)); | 194 | GNUNET_break (GNUNET_OK == GNUNET_OS_process_wait (testbed)); |
195 | GNUNET_OS_process_destroy (testbed); | 195 | GNUNET_OS_process_destroy (testbed); |
196 | testbed = NULL; | 196 | testbed = NULL; |
197 | } | 197 | } |
198 | if (NULL != test_system) | 198 | if (NULL != test_system) |
199 | { | 199 | { |
200 | GNUNET_TESTING_system_destroy (test_system, GNUNET_YES); | 200 | GNUNET_TESTING_system_destroy (test_system, GNUNET_YES); |
@@ -291,7 +291,7 @@ child_death_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
291 | GNUNET_break (0); | 291 | GNUNET_break (0); |
292 | return; | 292 | return; |
293 | } | 293 | } |
294 | GNUNET_break (GNUNET_SYSERR != | 294 | GNUNET_break (GNUNET_SYSERR != |
295 | (ret = GNUNET_OS_process_status (testbed, &type, &code))); | 295 | (ret = GNUNET_OS_process_status (testbed, &type, &code))); |
296 | if (GNUNET_NO != ret) | 296 | if (GNUNET_NO != ret) |
297 | { | 297 | { |
@@ -456,7 +456,7 @@ tokenizer_cb (void *cls, void *client, | |||
456 | wc->data = reply; | 456 | wc->data = reply; |
457 | write_task_id = | 457 | write_task_id = |
458 | GNUNET_SCHEDULER_add_write_file (GNUNET_TIME_UNIT_FOREVER_REL, stdout_fd, | 458 | GNUNET_SCHEDULER_add_write_file (GNUNET_TIME_UNIT_FOREVER_REL, stdout_fd, |
459 | &write_task, wc); | 459 | &write_task, wc); |
460 | child_death_task_id = | 460 | child_death_task_id = |
461 | GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, | 461 | GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, |
462 | GNUNET_DISK_pipe_handle (sigpipe, | 462 | GNUNET_DISK_pipe_handle (sigpipe, |
@@ -534,7 +534,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
534 | read_task_id = | 534 | read_task_id = |
535 | GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, stdin_fd, | 535 | GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_UNIT_FOREVER_REL, stdin_fd, |
536 | &read_task, NULL); | 536 | &read_task, NULL); |
537 | shutdown_task_id = | 537 | shutdown_task_id = |
538 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, | 538 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, &shutdown_task, |
539 | NULL); | 539 | NULL); |
540 | } | 540 | } |
@@ -576,7 +576,7 @@ main (int argc, char **argv) | |||
576 | int ret; | 576 | int ret; |
577 | 577 | ||
578 | status = GNUNET_OK; | 578 | status = GNUNET_OK; |
579 | if (NULL == (sigpipe = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, | 579 | if (NULL == (sigpipe = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, |
580 | GNUNET_NO, GNUNET_NO))) | 580 | GNUNET_NO, GNUNET_NO))) |
581 | { | 581 | { |
582 | GNUNET_break (0); | 582 | GNUNET_break (0); |
diff --git a/src/testbed/gnunet-service-test-barriers.c b/src/testbed/gnunet-service-test-barriers.c index f22deb57e..efc9d5677 100644 --- a/src/testbed/gnunet-service-test-barriers.c +++ b/src/testbed/gnunet-service-test-barriers.c | |||
@@ -22,7 +22,7 @@ | |||
22 | * @file testbed/gnunet-service-test-barriers.c | 22 | * @file testbed/gnunet-service-test-barriers.c |
23 | * @brief Daemon acting as a service for testing testbed barriers. It is | 23 | * @brief Daemon acting as a service for testing testbed barriers. It is |
24 | * started as a peer service and waits for a barrier to be crossed. | 24 | * started as a peer service and waits for a barrier to be crossed. |
25 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | 25 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include "platform.h" | 28 | #include "platform.h" |
@@ -81,7 +81,7 @@ barrier_wait_cb (void *cls, const char *name, int status) | |||
81 | * | 81 | * |
82 | * @param cls NULL | 82 | * @param cls NULL |
83 | * @param tc scheduler task context | 83 | * @param tc scheduler task context |
84 | * @return | 84 | * @return |
85 | */ | 85 | */ |
86 | static void | 86 | static void |
87 | do_wait (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 87 | do_wait (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
@@ -126,7 +126,7 @@ int main (int argc, char **argv) | |||
126 | GNUNET_GETOPT_OPTION_END | 126 | GNUNET_GETOPT_OPTION_END |
127 | }; | 127 | }; |
128 | int ret; | 128 | int ret; |
129 | 129 | ||
130 | ret = | 130 | ret = |
131 | GNUNET_PROGRAM_run (argc, argv, | 131 | GNUNET_PROGRAM_run (argc, argv, |
132 | "test-barriers", "nohelp", options, &run, NULL); | 132 | "test-barriers", "nohelp", options, &run, NULL); |
diff --git a/src/testbed/gnunet-service-testbed-logger.c b/src/testbed/gnunet-service-testbed-logger.c index c92237ccb..dfa9da52f 100644 --- a/src/testbed/gnunet-service-testbed-logger.c +++ b/src/testbed/gnunet-service-testbed-logger.c | |||
@@ -230,7 +230,7 @@ logger_run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
230 | GNUNET_CONFIGURATION_get_value_filename (cfg, "TESTBED-LOGGER", "DIR", | 230 | GNUNET_CONFIGURATION_get_value_filename (cfg, "TESTBED-LOGGER", "DIR", |
231 | &dir)) | 231 | &dir)) |
232 | { | 232 | { |
233 | LOG (GNUNET_ERROR_TYPE_ERROR, "Not logging directory definied. Exiting\n"); | 233 | LOG (GNUNET_ERROR_TYPE_ERROR, "Not logging directory definied. Exiting\n"); |
234 | GNUNET_SCHEDULER_shutdown (); | 234 | GNUNET_SCHEDULER_shutdown (); |
235 | return; | 235 | return; |
236 | } | 236 | } |
@@ -272,7 +272,7 @@ main (int argc, char *const *argv) | |||
272 | { | 272 | { |
273 | //sleep (15); /* Debugging */ | 273 | //sleep (15); /* Debugging */ |
274 | return (GNUNET_OK == | 274 | return (GNUNET_OK == |
275 | GNUNET_SERVICE_run (argc, argv, "testbed-logger", | 275 | GNUNET_SERVICE_run (argc, argv, "testbed-logger", |
276 | GNUNET_SERVICE_OPTION_NONE, | 276 | GNUNET_SERVICE_OPTION_NONE, |
277 | &logger_run, NULL)) ? 0 : 1; | 277 | &logger_run, NULL)) ? 0 : 1; |
278 | } | 278 | } |
diff --git a/src/testbed/gnunet-service-testbed.c b/src/testbed/gnunet-service-testbed.c index b9465b2fe..6f806e21b 100644 --- a/src/testbed/gnunet-service-testbed.c +++ b/src/testbed/gnunet-service-testbed.c | |||
@@ -446,7 +446,7 @@ parse_shared_services (char *ss_str, struct GNUNET_CONFIGURATION_Handle *cfg) | |||
446 | (void) memcpy (&slist[n - 1], &ss, \ | 446 | (void) memcpy (&slist[n - 1], &ss, \ |
447 | sizeof (struct GNUNET_TESTING_SharedService)); \ | 447 | sizeof (struct GNUNET_TESTING_SharedService)); \ |
448 | } while (0) | 448 | } while (0) |
449 | 449 | ||
450 | slist = NULL; | 450 | slist = NULL; |
451 | n = 0; | 451 | n = 0; |
452 | ss.cfg = cfg; | 452 | ss.cfg = cfg; |
@@ -590,7 +590,7 @@ handle_add_host (void *cls, struct GNUNET_SERVER_Client *client, | |||
590 | username_length = ntohs (msg->username_length); | 590 | username_length = ntohs (msg->username_length); |
591 | hostname_length = ntohs (msg->hostname_length); | 591 | hostname_length = ntohs (msg->hostname_length); |
592 | /* msg must contain hostname */ | 592 | /* msg must contain hostname */ |
593 | if ((msize <= (sizeof (struct GNUNET_TESTBED_AddHostMessage) + | 593 | if ((msize <= (sizeof (struct GNUNET_TESTBED_AddHostMessage) + |
594 | username_length)) | 594 | username_length)) |
595 | || (0 == hostname_length)) | 595 | || (0 == hostname_length)) |
596 | { | 596 | { |
@@ -731,7 +731,7 @@ void | |||
731 | GST_clear_fopcq () | 731 | GST_clear_fopcq () |
732 | { | 732 | { |
733 | struct ForwardedOperationContext *fopc; | 733 | struct ForwardedOperationContext *fopc; |
734 | 734 | ||
735 | while (NULL != (fopc = fopcq_head)) | 735 | while (NULL != (fopc = fopcq_head)) |
736 | { | 736 | { |
737 | GNUNET_CONTAINER_DLL_remove (fopcq_head, fopcq_tail, fopc); | 737 | GNUNET_CONTAINER_DLL_remove (fopcq_head, fopcq_tail, fopc); |
@@ -747,7 +747,7 @@ GST_clear_fopcq () | |||
747 | case OP_SHUTDOWN_PEERS: | 747 | case OP_SHUTDOWN_PEERS: |
748 | { | 748 | { |
749 | struct HandlerContext_ShutdownPeers *hc = fopc->cls; | 749 | struct HandlerContext_ShutdownPeers *hc = fopc->cls; |
750 | 750 | ||
751 | GNUNET_assert (0 < hc->nslaves); | 751 | GNUNET_assert (0 < hc->nslaves); |
752 | hc->nslaves--; | 752 | hc->nslaves--; |
753 | if (0 == hc->nslaves) | 753 | if (0 == hc->nslaves) |
@@ -901,9 +901,9 @@ testbed_run (void *cls, struct GNUNET_SERVER_Handle *server, | |||
901 | sizeof (struct GNUNET_TESTBED_ShutdownPeersMessage)}, | 901 | sizeof (struct GNUNET_TESTBED_ShutdownPeersMessage)}, |
902 | {&GST_handle_peer_reconfigure, NULL, | 902 | {&GST_handle_peer_reconfigure, NULL, |
903 | GNUNET_MESSAGE_TYPE_TESTBED_RECONFIGURE_PEER, 0}, | 903 | GNUNET_MESSAGE_TYPE_TESTBED_RECONFIGURE_PEER, 0}, |
904 | {&GST_handle_barrier_init, NULL, | 904 | {&GST_handle_barrier_init, NULL, |
905 | GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_INIT, 0}, | 905 | GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_INIT, 0}, |
906 | {&GST_handle_barrier_cancel, NULL, | 906 | {&GST_handle_barrier_cancel, NULL, |
907 | GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_CANCEL, 0}, | 907 | GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_CANCEL, 0}, |
908 | {&GST_handle_barrier_status, NULL, | 908 | {&GST_handle_barrier_status, NULL, |
909 | GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_STATUS, 0}, | 909 | GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_STATUS, 0}, |
diff --git a/src/testbed/gnunet-service-testbed_barriers.c b/src/testbed/gnunet-service-testbed_barriers.c index bffafd7ae..634f0a07a 100644 --- a/src/testbed/gnunet-service-testbed_barriers.c +++ b/src/testbed/gnunet-service-testbed_barriers.c | |||
@@ -21,7 +21,7 @@ | |||
21 | /** | 21 | /** |
22 | * @file testbed/gnunet-service-testbed_barriers.c | 22 | * @file testbed/gnunet-service-testbed_barriers.c |
23 | * @brief barrier handling at the testbed controller | 23 | * @brief barrier handling at the testbed controller |
24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | 24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "gnunet-service-testbed.h" | 27 | #include "gnunet-service-testbed.h" |
@@ -200,12 +200,12 @@ struct Barrier | |||
200 | * Identifier for the timeout task | 200 | * Identifier for the timeout task |
201 | */ | 201 | */ |
202 | GNUNET_SCHEDULER_TaskIdentifier tout_task; | 202 | GNUNET_SCHEDULER_TaskIdentifier tout_task; |
203 | 203 | ||
204 | /** | 204 | /** |
205 | * The status of this barrier | 205 | * The status of this barrier |
206 | */ | 206 | */ |
207 | enum GNUNET_TESTBED_BarrierStatus status; | 207 | enum GNUNET_TESTBED_BarrierStatus status; |
208 | 208 | ||
209 | /** | 209 | /** |
210 | * Number of barriers wrapped in the above DLL | 210 | * Number of barriers wrapped in the above DLL |
211 | */ | 211 | */ |
@@ -235,7 +235,7 @@ struct Barrier | |||
235 | * Quorum percentage to be reached | 235 | * Quorum percentage to be reached |
236 | */ | 236 | */ |
237 | uint8_t quorum; | 237 | uint8_t quorum; |
238 | 238 | ||
239 | }; | 239 | }; |
240 | 240 | ||
241 | 241 | ||
@@ -261,7 +261,7 @@ static struct GNUNET_SERVICE_Context *ctx; | |||
261 | * @param buf where the callee should write the message | 261 | * @param buf where the callee should write the message |
262 | * @return number of bytes written to buf | 262 | * @return number of bytes written to buf |
263 | */ | 263 | */ |
264 | static size_t | 264 | static size_t |
265 | transmit_ready_cb (void *cls, size_t size, void *buf) | 265 | transmit_ready_cb (void *cls, size_t size, void *buf) |
266 | { | 266 | { |
267 | struct ClientCtx *ctx = cls; | 267 | struct ClientCtx *ctx = cls; |
@@ -276,7 +276,7 @@ transmit_ready_cb (void *cls, size_t size, void *buf) | |||
276 | { | 276 | { |
277 | GNUNET_assert (NULL != ctx->client); | 277 | GNUNET_assert (NULL != ctx->client); |
278 | GNUNET_SERVER_client_drop (ctx->client); | 278 | GNUNET_SERVER_client_drop (ctx->client); |
279 | ctx->client = NULL; | 279 | ctx->client = NULL; |
280 | return 0; | 280 | return 0; |
281 | } | 281 | } |
282 | mq = ctx->mq_head; | 282 | mq = ctx->mq_head; |
@@ -306,7 +306,7 @@ queue_message (struct ClientCtx *ctx, struct GNUNET_MessageHeader *msg) | |||
306 | { | 306 | { |
307 | struct MessageQueue *mq; | 307 | struct MessageQueue *mq; |
308 | struct GNUNET_SERVER_Client *client = ctx->client; | 308 | struct GNUNET_SERVER_Client *client = ctx->client; |
309 | 309 | ||
310 | mq = GNUNET_malloc (sizeof (struct MessageQueue)); | 310 | mq = GNUNET_malloc (sizeof (struct MessageQueue)); |
311 | mq->msg = msg; | 311 | mq->msg = msg; |
312 | LOG_DEBUG ("Queueing message of type %u, size %u for sending\n", | 312 | LOG_DEBUG ("Queueing message of type %u, size %u for sending\n", |
@@ -328,12 +328,12 @@ static void | |||
328 | cleanup_clientctx (struct ClientCtx *ctx) | 328 | cleanup_clientctx (struct ClientCtx *ctx) |
329 | { | 329 | { |
330 | struct MessageQueue *mq; | 330 | struct MessageQueue *mq; |
331 | 331 | ||
332 | if (NULL != ctx->client) | 332 | if (NULL != ctx->client) |
333 | { | 333 | { |
334 | GNUNET_SERVER_client_set_user_context_ (ctx->client, NULL, 0); | 334 | GNUNET_SERVER_client_set_user_context_ (ctx->client, NULL, 0); |
335 | GNUNET_SERVER_client_drop (ctx->client); | 335 | GNUNET_SERVER_client_drop (ctx->client); |
336 | } | 336 | } |
337 | if (NULL != ctx->tx) | 337 | if (NULL != ctx->tx) |
338 | GNUNET_SERVER_notify_transmit_ready_cancel (ctx->tx); | 338 | GNUNET_SERVER_notify_transmit_ready_cancel (ctx->tx); |
339 | if (NULL != (mq = ctx->mq_head)) | 339 | if (NULL != (mq = ctx->mq_head)) |
@@ -356,7 +356,7 @@ static void | |||
356 | remove_barrier (struct Barrier *barrier) | 356 | remove_barrier (struct Barrier *barrier) |
357 | { | 357 | { |
358 | struct ClientCtx *ctx; | 358 | struct ClientCtx *ctx; |
359 | 359 | ||
360 | GNUNET_assert (GNUNET_YES == GNUNET_CONTAINER_multihashmap_remove (barrier_map, | 360 | GNUNET_assert (GNUNET_YES == GNUNET_CONTAINER_multihashmap_remove (barrier_map, |
361 | &barrier->hash, | 361 | &barrier->hash, |
362 | barrier)); | 362 | barrier)); |
@@ -397,7 +397,7 @@ cancel_wrappers (struct Barrier *barrier) | |||
397 | * @param name the barrier name | 397 | * @param name the barrier name |
398 | * @param status the status of the barrier | 398 | * @param status the status of the barrier |
399 | * @param emsg the error message; should be non-NULL for | 399 | * @param emsg the error message; should be non-NULL for |
400 | * status=GNUNET_TESTBED_BARRIERSTATUS_ERROR | 400 | * status=GNUNET_TESTBED_BARRIERSTATUS_ERROR |
401 | */ | 401 | */ |
402 | static void | 402 | static void |
403 | send_client_status_msg (struct GNUNET_SERVER_Client *client, | 403 | send_client_status_msg (struct GNUNET_SERVER_Client *client, |
@@ -431,7 +431,7 @@ send_client_status_msg (struct GNUNET_SERVER_Client *client, | |||
431 | * | 431 | * |
432 | * @param barrier the corresponding barrier | 432 | * @param barrier the corresponding barrier |
433 | * @param emsg the error message; should be non-NULL for | 433 | * @param emsg the error message; should be non-NULL for |
434 | * status=GNUNET_TESTBED_BARRIERSTATUS_ERROR | 434 | * status=GNUNET_TESTBED_BARRIERSTATUS_ERROR |
435 | */ | 435 | */ |
436 | static void | 436 | static void |
437 | send_barrier_status_msg (struct Barrier *barrier, const char *emsg) | 437 | send_barrier_status_msg (struct Barrier *barrier, const char *emsg) |
@@ -464,7 +464,7 @@ handle_barrier_wait (void *cls, struct GNUNET_SERVER_Client *client, | |||
464 | struct GNUNET_HashCode key; | 464 | struct GNUNET_HashCode key; |
465 | size_t name_len; | 465 | size_t name_len; |
466 | uint16_t msize; | 466 | uint16_t msize; |
467 | 467 | ||
468 | msize = ntohs (message->size); | 468 | msize = ntohs (message->size); |
469 | if (msize <= sizeof (struct GNUNET_TESTBED_BarrierWait)) | 469 | if (msize <= sizeof (struct GNUNET_TESTBED_BarrierWait)) |
470 | { | 470 | { |
@@ -500,7 +500,7 @@ handle_barrier_wait (void *cls, struct GNUNET_SERVER_Client *client, | |||
500 | GNUNET_SERVER_client_keep (client); | 500 | GNUNET_SERVER_client_keep (client); |
501 | client_ctx->barrier = barrier; | 501 | client_ctx->barrier = barrier; |
502 | GNUNET_CONTAINER_DLL_insert_tail (barrier->head, barrier->tail, client_ctx); | 502 | GNUNET_CONTAINER_DLL_insert_tail (barrier->head, barrier->tail, client_ctx); |
503 | GNUNET_SERVER_client_set_user_context (client, client_ctx); | 503 | GNUNET_SERVER_client_set_user_context (client, client_ctx); |
504 | } | 504 | } |
505 | barrier->nreached++; | 505 | barrier->nreached++; |
506 | if ((barrier->num_wbarriers_reached == barrier->num_wbarriers) | 506 | if ((barrier->num_wbarriers_reached == barrier->num_wbarriers) |
@@ -525,7 +525,7 @@ static void | |||
525 | disconnect_cb (void *cls, struct GNUNET_SERVER_Client *client) | 525 | disconnect_cb (void *cls, struct GNUNET_SERVER_Client *client) |
526 | { | 526 | { |
527 | struct ClientCtx *client_ctx; | 527 | struct ClientCtx *client_ctx; |
528 | 528 | ||
529 | if (NULL == client) | 529 | if (NULL == client) |
530 | return; | 530 | return; |
531 | client_ctx = GNUNET_SERVER_client_get_user_context (client, struct ClientCtx); | 531 | client_ctx = GNUNET_SERVER_client_get_user_context (client, struct ClientCtx); |
@@ -554,7 +554,7 @@ GST_barriers_init (struct GNUNET_CONFIGURATION_Handle *cfg) | |||
554 | GNUNET_SERVICE_OPTION_MANUAL_SHUTDOWN); | 554 | GNUNET_SERVICE_OPTION_MANUAL_SHUTDOWN); |
555 | srv = GNUNET_SERVICE_get_server (ctx); | 555 | srv = GNUNET_SERVICE_get_server (ctx); |
556 | GNUNET_SERVER_add_handlers (srv, message_handlers); | 556 | GNUNET_SERVER_add_handlers (srv, message_handlers); |
557 | GNUNET_SERVER_disconnect_notify (srv, &disconnect_cb, NULL); | 557 | GNUNET_SERVER_disconnect_notify (srv, &disconnect_cb, NULL); |
558 | } | 558 | } |
559 | 559 | ||
560 | 560 | ||
@@ -568,7 +568,7 @@ GST_barriers_init (struct GNUNET_CONFIGURATION_Handle *cfg) | |||
568 | * iterate, | 568 | * iterate, |
569 | * #GNUNET_NO if not. | 569 | * #GNUNET_NO if not. |
570 | */ | 570 | */ |
571 | static int | 571 | static int |
572 | barrier_destroy_iterator (void *cls, | 572 | barrier_destroy_iterator (void *cls, |
573 | const struct GNUNET_HashCode *key, | 573 | const struct GNUNET_HashCode *key, |
574 | void *value) | 574 | void *value) |
@@ -612,7 +612,7 @@ GST_barriers_destroy () | |||
612 | * @param emsg if the status were to be GNUNET_SYSERR, this parameter has the | 612 | * @param emsg if the status were to be GNUNET_SYSERR, this parameter has the |
613 | * error messsage | 613 | * error messsage |
614 | */ | 614 | */ |
615 | static void | 615 | static void |
616 | wbarrier_status_cb (void *cls, const char *name, | 616 | wbarrier_status_cb (void *cls, const char *name, |
617 | struct GNUNET_TESTBED_Barrier *b_, | 617 | struct GNUNET_TESTBED_Barrier *b_, |
618 | enum GNUNET_TESTBED_BarrierStatus status, | 618 | enum GNUNET_TESTBED_BarrierStatus status, |
@@ -679,7 +679,7 @@ static void | |||
679 | fwd_tout_barrier_init (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 679 | fwd_tout_barrier_init (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
680 | { | 680 | { |
681 | struct Barrier *barrier = cls; | 681 | struct Barrier *barrier = cls; |
682 | 682 | ||
683 | cancel_wrappers (barrier); | 683 | cancel_wrappers (barrier); |
684 | barrier->status = GNUNET_TESTBED_BARRIERSTATUS_ERROR; | 684 | barrier->status = GNUNET_TESTBED_BARRIERSTATUS_ERROR; |
685 | send_barrier_status_msg (barrier, | 685 | send_barrier_status_msg (barrier, |
@@ -713,7 +713,7 @@ GST_handle_barrier_init (void *cls, struct GNUNET_SERVER_Client *client, | |||
713 | size_t name_len; | 713 | size_t name_len; |
714 | unsigned int cnt; | 714 | unsigned int cnt; |
715 | uint16_t msize; | 715 | uint16_t msize; |
716 | 716 | ||
717 | if (NULL == GST_context) | 717 | if (NULL == GST_context) |
718 | { | 718 | { |
719 | GNUNET_break_op (0); | 719 | GNUNET_break_op (0); |
@@ -741,7 +741,7 @@ GST_handle_barrier_init (void *cls, struct GNUNET_SERVER_Client *client, | |||
741 | LOG_DEBUG ("Received BARRIER_INIT for barrier `%s'\n", name); | 741 | LOG_DEBUG ("Received BARRIER_INIT for barrier `%s'\n", name); |
742 | if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (barrier_map, &hash)) | 742 | if (GNUNET_YES == GNUNET_CONTAINER_multihashmap_contains (barrier_map, &hash)) |
743 | { | 743 | { |
744 | 744 | ||
745 | send_client_status_msg (client, name, GNUNET_TESTBED_BARRIERSTATUS_ERROR, | 745 | send_client_status_msg (client, name, GNUNET_TESTBED_BARRIERSTATUS_ERROR, |
746 | "A barrier with the same name already exists"); | 746 | "A barrier with the same name already exists"); |
747 | GNUNET_free (name); | 747 | GNUNET_free (name); |
@@ -821,7 +821,7 @@ GST_handle_barrier_cancel (void *cls, struct GNUNET_SERVER_Client *client, | |||
821 | GNUNET_break_op (0); | 821 | GNUNET_break_op (0); |
822 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 822 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
823 | return; | 823 | return; |
824 | } | 824 | } |
825 | if (client != GST_context->client) | 825 | if (client != GST_context->client) |
826 | { | 826 | { |
827 | GNUNET_break_op (0); | 827 | GNUNET_break_op (0); |
@@ -850,7 +850,7 @@ GST_handle_barrier_cancel (void *cls, struct GNUNET_SERVER_Client *client, | |||
850 | GNUNET_assert (NULL != barrier); | 850 | GNUNET_assert (NULL != barrier); |
851 | cancel_wrappers (barrier); | 851 | cancel_wrappers (barrier); |
852 | remove_barrier (barrier); | 852 | remove_barrier (barrier); |
853 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 853 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
854 | } | 854 | } |
855 | 855 | ||
856 | 856 | ||
@@ -868,20 +868,20 @@ GST_handle_barrier_status (void *cls, struct GNUNET_SERVER_Client *client, | |||
868 | const struct GNUNET_MessageHeader *message) | 868 | const struct GNUNET_MessageHeader *message) |
869 | { | 869 | { |
870 | const struct GNUNET_TESTBED_BarrierStatusMsg *msg; | 870 | const struct GNUNET_TESTBED_BarrierStatusMsg *msg; |
871 | struct Barrier *barrier; | 871 | struct Barrier *barrier; |
872 | struct ClientCtx *client_ctx; | 872 | struct ClientCtx *client_ctx; |
873 | const char *name; | 873 | const char *name; |
874 | struct GNUNET_HashCode key; | 874 | struct GNUNET_HashCode key; |
875 | enum GNUNET_TESTBED_BarrierStatus status; | 875 | enum GNUNET_TESTBED_BarrierStatus status; |
876 | uint16_t msize; | 876 | uint16_t msize; |
877 | uint16_t name_len; | 877 | uint16_t name_len; |
878 | 878 | ||
879 | if (NULL == GST_context) | 879 | if (NULL == GST_context) |
880 | { | 880 | { |
881 | GNUNET_break_op (0); | 881 | GNUNET_break_op (0); |
882 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 882 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
883 | return; | 883 | return; |
884 | } | 884 | } |
885 | if (client != GST_context->client) | 885 | if (client != GST_context->client) |
886 | { | 886 | { |
887 | GNUNET_break_op (0); | 887 | GNUNET_break_op (0); |
diff --git a/src/testbed/gnunet-service-testbed_barriers.h b/src/testbed/gnunet-service-testbed_barriers.h index a96812086..2d6cfd4df 100644 --- a/src/testbed/gnunet-service-testbed_barriers.h +++ b/src/testbed/gnunet-service-testbed_barriers.h | |||
@@ -21,7 +21,7 @@ | |||
21 | /** | 21 | /** |
22 | * @file testbed/gnunet-service-testbed_barriers.h | 22 | * @file testbed/gnunet-service-testbed_barriers.h |
23 | * @brief Interface for the barrier initialisation handler routine | 23 | * @brief Interface for the barrier initialisation handler routine |
24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | 24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #ifndef GNUNET_SERVER_TESTBED_BARRIERS_H_ | 27 | #ifndef GNUNET_SERVER_TESTBED_BARRIERS_H_ |
diff --git a/src/testbed/gnunet-service-testbed_cache.c b/src/testbed/gnunet-service-testbed_cache.c index 6a141a252..9db2155fc 100644 --- a/src/testbed/gnunet-service-testbed_cache.c +++ b/src/testbed/gnunet-service-testbed_cache.c | |||
@@ -352,7 +352,7 @@ close_handles (struct CacheEntry *entry) | |||
352 | if (NULL != entry->transport_op) | 352 | if (NULL != entry->transport_op) |
353 | { | 353 | { |
354 | GNUNET_TESTBED_operation_done (entry->transport_op); | 354 | GNUNET_TESTBED_operation_done (entry->transport_op); |
355 | entry->transport_op = NULL; | 355 | entry->transport_op = NULL; |
356 | } | 356 | } |
357 | if (NULL != entry->core_op) | 357 | if (NULL != entry->core_op) |
358 | { | 358 | { |
@@ -610,7 +610,7 @@ oprelease_get_handle_transport (void *cls) | |||
610 | * @param my_identity ID of this peer, NULL if we failed | 610 | * @param my_identity ID of this peer, NULL if we failed |
611 | */ | 611 | */ |
612 | static void | 612 | static void |
613 | core_startup_cb (void *cls, | 613 | core_startup_cb (void *cls, |
614 | const struct GNUNET_PeerIdentity *my_identity) | 614 | const struct GNUNET_PeerIdentity *my_identity) |
615 | { | 615 | { |
616 | struct CacheEntry *entry = cls; | 616 | struct CacheEntry *entry = cls; |
@@ -836,7 +836,7 @@ cache_clear_iterator (void *cls, const struct GNUNET_HashCode *key, void *value) | |||
836 | GNUNET_assert (NULL != entry); | 836 | GNUNET_assert (NULL != entry); |
837 | GNUNET_break (0 == entry->demand); | 837 | GNUNET_break (0 == entry->demand); |
838 | LOG_DEBUG ("Clearing entry %u of %u\n", ++ncleared, cache_size); | 838 | LOG_DEBUG ("Clearing entry %u of %u\n", ++ncleared, cache_size); |
839 | GNUNET_assert (GNUNET_YES == | 839 | GNUNET_assert (GNUNET_YES == |
840 | GNUNET_CONTAINER_multihashmap_remove (cache, key, value)); | 840 | GNUNET_CONTAINER_multihashmap_remove (cache, key, value)); |
841 | close_handles (entry); | 841 | close_handles (entry); |
842 | GNUNET_free_non_null (entry->hello); | 842 | GNUNET_free_non_null (entry->hello); |
diff --git a/src/testbed/gnunet-service-testbed_connectionpool.c b/src/testbed/gnunet-service-testbed_connectionpool.c index 80d020111..f4eb73778 100644 --- a/src/testbed/gnunet-service-testbed_connectionpool.c +++ b/src/testbed/gnunet-service-testbed_connectionpool.c | |||
@@ -21,7 +21,7 @@ | |||
21 | /** | 21 | /** |
22 | * @file testbed/gnunet-service-testbed_connectionpool.c | 22 | * @file testbed/gnunet-service-testbed_connectionpool.c |
23 | * @brief connection pooling for connections to peers' services | 23 | * @brief connection pooling for connections to peers' services |
24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | 24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "gnunet-service-testbed.h" | 27 | #include "gnunet-service-testbed.h" |
@@ -268,7 +268,7 @@ destroy_pooled_connection (struct PooledConnection *entry) | |||
268 | if (entry->in_lru) | 268 | if (entry->in_lru) |
269 | GNUNET_CONTAINER_DLL_remove (head_lru, tail_lru, entry); | 269 | GNUNET_CONTAINER_DLL_remove (head_lru, tail_lru, entry); |
270 | if (entry->in_pool) | 270 | if (entry->in_pool) |
271 | GNUNET_assert (GNUNET_OK == | 271 | GNUNET_assert (GNUNET_OK == |
272 | GNUNET_CONTAINER_multihashmap32_remove (map, | 272 | GNUNET_CONTAINER_multihashmap32_remove (map, |
273 | entry->index, | 273 | entry->index, |
274 | entry)); | 274 | entry)); |
@@ -466,7 +466,7 @@ transport_peer_connect_notify_cb (void *cls, | |||
466 | const struct GNUNET_PeerIdentity *peer) | 466 | const struct GNUNET_PeerIdentity *peer) |
467 | { | 467 | { |
468 | struct PooledConnection *entry = cls; | 468 | struct PooledConnection *entry = cls; |
469 | 469 | ||
470 | peer_connect_notify_cb (entry, peer, GST_CONNECTIONPOOL_SERVICE_TRANSPORT); | 470 | peer_connect_notify_cb (entry, peer, GST_CONNECTIONPOOL_SERVICE_TRANSPORT); |
471 | } | 471 | } |
472 | 472 | ||
@@ -532,7 +532,7 @@ static void | |||
532 | core_peer_connect_cb (void *cls, const struct GNUNET_PeerIdentity *peer) | 532 | core_peer_connect_cb (void *cls, const struct GNUNET_PeerIdentity *peer) |
533 | { | 533 | { |
534 | struct PooledConnection *entry = cls; | 534 | struct PooledConnection *entry = cls; |
535 | 535 | ||
536 | peer_connect_notify_cb (entry, peer, GST_CONNECTIONPOOL_SERVICE_CORE); | 536 | peer_connect_notify_cb (entry, peer, GST_CONNECTIONPOOL_SERVICE_CORE); |
537 | } | 537 | } |
538 | 538 | ||
@@ -550,7 +550,7 @@ core_peer_connect_cb (void *cls, const struct GNUNET_PeerIdentity *peer) | |||
550 | * @param my_identity ID of this peer, NULL if we failed | 550 | * @param my_identity ID of this peer, NULL if we failed |
551 | */ | 551 | */ |
552 | static void | 552 | static void |
553 | core_startup_cb (void *cls, | 553 | core_startup_cb (void *cls, |
554 | const struct GNUNET_PeerIdentity *my_identity) | 554 | const struct GNUNET_PeerIdentity *my_identity) |
555 | { | 555 | { |
556 | struct PooledConnection *entry = cls; | 556 | struct PooledConnection *entry = cls; |
@@ -642,9 +642,9 @@ cleanup_iterator (void *cls, | |||
642 | void *value) | 642 | void *value) |
643 | { | 643 | { |
644 | struct PooledConnection *entry = value; | 644 | struct PooledConnection *entry = value; |
645 | 645 | ||
646 | GNUNET_assert (NULL != entry); | 646 | GNUNET_assert (NULL != entry); |
647 | GNUNET_assert (GNUNET_OK == | 647 | GNUNET_assert (GNUNET_OK == |
648 | GNUNET_CONTAINER_multihashmap32_remove (map, key, entry)); | 648 | GNUNET_CONTAINER_multihashmap32_remove (map, key, entry)); |
649 | if (entry->in_lru) | 649 | if (entry->in_lru) |
650 | GNUNET_CONTAINER_DLL_remove (head_lru, tail_lru, entry); | 650 | GNUNET_CONTAINER_DLL_remove (head_lru, tail_lru, entry); |
@@ -678,7 +678,7 @@ void | |||
678 | GST_connection_pool_destroy () | 678 | GST_connection_pool_destroy () |
679 | { | 679 | { |
680 | struct PooledConnection *entry; | 680 | struct PooledConnection *entry; |
681 | 681 | ||
682 | if (NULL != map) | 682 | if (NULL != map) |
683 | { | 683 | { |
684 | GNUNET_assert (GNUNET_SYSERR != | 684 | GNUNET_assert (GNUNET_SYSERR != |
@@ -776,7 +776,7 @@ GST_connection_pool_get_handle (unsigned int peer_id, | |||
776 | { | 776 | { |
777 | entry = GNUNET_new (struct PooledConnection); | 777 | entry = GNUNET_new (struct PooledConnection); |
778 | entry->index = peer_id32; | 778 | entry->index = peer_id32; |
779 | if ((NULL != map) | 779 | if ((NULL != map) |
780 | && (GNUNET_CONTAINER_multihashmap32_size (map) < max_size)) | 780 | && (GNUNET_CONTAINER_multihashmap32_size (map) < max_size)) |
781 | { | 781 | { |
782 | GNUNET_assert (GNUNET_OK == | 782 | GNUNET_assert (GNUNET_OK == |
@@ -859,7 +859,7 @@ GST_connection_pool_get_handle_done (struct GST_ConnectionPool_GetHandle *gh) | |||
859 | GNUNET_CONTAINER_DLL_remove (entry->head_notify, entry->head_notify, gh); | 859 | GNUNET_CONTAINER_DLL_remove (entry->head_notify, entry->head_notify, gh); |
860 | GNUNET_free (gh); | 860 | GNUNET_free (gh); |
861 | gh = NULL; | 861 | gh = NULL; |
862 | GNUNET_assert (!entry->in_lru); | 862 | GNUNET_assert (!entry->in_lru); |
863 | if ( (!entry->in_pool) && (NULL != map) ) | 863 | if ( (!entry->in_pool) && (NULL != map) ) |
864 | { | 864 | { |
865 | if (GNUNET_YES == GNUNET_CONTAINER_multihashmap32_contains (map, | 865 | if (GNUNET_YES == GNUNET_CONTAINER_multihashmap32_contains (map, |
@@ -871,8 +871,8 @@ GST_connection_pool_get_handle_done (struct GST_ConnectionPool_GetHandle *gh) | |||
871 | destroy_pooled_connection (head_lru); | 871 | destroy_pooled_connection (head_lru); |
872 | GNUNET_CONTAINER_DLL_remove (head_not_pooled, tail_not_pooled, entry); | 872 | GNUNET_CONTAINER_DLL_remove (head_not_pooled, tail_not_pooled, entry); |
873 | GNUNET_assert (GNUNET_OK == | 873 | GNUNET_assert (GNUNET_OK == |
874 | GNUNET_CONTAINER_multihashmap32_put (map, | 874 | GNUNET_CONTAINER_multihashmap32_put (map, |
875 | entry->index, | 875 | entry->index, |
876 | entry, | 876 | entry, |
877 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); | 877 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); |
878 | entry->in_pool = GNUNET_YES; | 878 | entry->in_pool = GNUNET_YES; |
diff --git a/src/testbed/gnunet-service-testbed_connectionpool.h b/src/testbed/gnunet-service-testbed_connectionpool.h index c055b32ac..e2f25cce8 100644 --- a/src/testbed/gnunet-service-testbed_connectionpool.h +++ b/src/testbed/gnunet-service-testbed_connectionpool.h | |||
@@ -21,7 +21,7 @@ | |||
21 | /** | 21 | /** |
22 | * @file testbed/gnunet-service-testbed_connectionpool.h | 22 | * @file testbed/gnunet-service-testbed_connectionpool.h |
23 | * @brief Interface for connection pooling subroutines | 23 | * @brief Interface for connection pooling subroutines |
24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | 24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> |
25 | */ | 25 | */ |
26 | 26 | ||
27 | 27 | ||
@@ -78,7 +78,7 @@ GST_connection_pool_destroy (); | |||
78 | * @param peer_id the identity of the peer. Will be NULL if ch is NULL. In other | 78 | * @param peer_id the identity of the peer. Will be NULL if ch is NULL. In other |
79 | * cases, its value being NULL means that CORE connection has failed. | 79 | * cases, its value being NULL means that CORE connection has failed. |
80 | */ | 80 | */ |
81 | typedef void | 81 | typedef void |
82 | (*GST_connection_pool_connection_ready_cb) (void *cls, | 82 | (*GST_connection_pool_connection_ready_cb) (void *cls, |
83 | struct GNUNET_CORE_Handle * ch, | 83 | struct GNUNET_CORE_Handle * ch, |
84 | struct GNUNET_TRANSPORT_Handle * th, | 84 | struct GNUNET_TRANSPORT_Handle * th, |
diff --git a/src/testbed/gnunet-service-testbed_cpustatus.c b/src/testbed/gnunet-service-testbed_cpustatus.c index 129088c40..4071c7172 100644 --- a/src/testbed/gnunet-service-testbed_cpustatus.c +++ b/src/testbed/gnunet-service-testbed_cpustatus.c | |||
@@ -318,7 +318,7 @@ updateUsage () | |||
318 | kc = kstat_open (); | 318 | kc = kstat_open (); |
319 | if (kc == NULL) | 319 | if (kc == NULL) |
320 | { | 320 | { |
321 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kstat_close"); | 321 | GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kstat_close"); |
322 | goto ABORT_KSTAT; | 322 | goto ABORT_KSTAT; |
323 | } | 323 | } |
324 | 324 | ||
@@ -633,7 +633,7 @@ get_nproc () | |||
633 | nproc = 0; | 633 | nproc = 0; |
634 | while (NULL != (ent = readdir (dir))) | 634 | while (NULL != (ent = readdir (dir))) |
635 | { | 635 | { |
636 | if((*ent->d_name > '0') && (*ent->d_name <= '9')) | 636 | if((*ent->d_name > '0') && (*ent->d_name <= '9')) |
637 | nproc++; | 637 | nproc++; |
638 | } | 638 | } |
639 | closedir (dir); | 639 | closedir (dir); |
@@ -669,14 +669,14 @@ sample_load_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
669 | now = GNUNET_TIME_absolute_get (); | 669 | now = GNUNET_TIME_absolute_get (); |
670 | nbs = GNUNET_asprintf (&str, "%llu %d %d %u %u\n", now.abs_value_us / 1000LL / 1000LL, | 670 | nbs = GNUNET_asprintf (&str, "%llu %d %d %u %u\n", now.abs_value_us / 1000LL / 1000LL, |
671 | ld_cpu, ld_disk, mem_usage, nproc); | 671 | ld_cpu, ld_disk, mem_usage, nproc); |
672 | if (0 < nbs) | 672 | if (0 < nbs) |
673 | { | 673 | { |
674 | GNUNET_BIO_write (bw, str, nbs); | 674 | GNUNET_BIO_write (bw, str, nbs); |
675 | } | 675 | } |
676 | else | 676 | else |
677 | GNUNET_break (0); | 677 | GNUNET_break (0); |
678 | GNUNET_free (str); | 678 | GNUNET_free (str); |
679 | 679 | ||
680 | reschedule: | 680 | reschedule: |
681 | sample_load_task_id = | 681 | sample_load_task_id = |
682 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, | 682 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_SECONDS, |
@@ -696,7 +696,7 @@ GST_stats_init (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
696 | char *stats_dir; | 696 | char *stats_dir; |
697 | char *fn; | 697 | char *fn; |
698 | size_t len; | 698 | size_t len; |
699 | 699 | ||
700 | #if MINGW | 700 | #if MINGW |
701 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 701 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
702 | "Load statistics logging now available for windows\n"); | 702 | "Load statistics logging now available for windows\n"); |
@@ -716,7 +716,7 @@ GST_stats_init (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
716 | GNUNET_free (hostname); | 716 | GNUNET_free (hostname); |
717 | return; | 717 | return; |
718 | } | 718 | } |
719 | fn = NULL; | 719 | fn = NULL; |
720 | (void) GNUNET_asprintf (&fn, "%s/%.*s-%jd.dat", stats_dir, len, | 720 | (void) GNUNET_asprintf (&fn, "%s/%.*s-%jd.dat", stats_dir, len, |
721 | hostname, (intmax_t) getpid()); | 721 | hostname, (intmax_t) getpid()); |
722 | GNUNET_free (stats_dir); | 722 | GNUNET_free (stats_dir); |
@@ -740,7 +740,7 @@ GST_stats_init (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
740 | initMachCpuStats (); | 740 | initMachCpuStats (); |
741 | #endif | 741 | #endif |
742 | updateUsage (); /* initialize */ | 742 | updateUsage (); /* initialize */ |
743 | 743 | ||
744 | } | 744 | } |
745 | 745 | ||
746 | 746 | ||
diff --git a/src/testbed/gnunet-service-testbed_links.c b/src/testbed/gnunet-service-testbed_links.c index 85a4538ef..79166d438 100644 --- a/src/testbed/gnunet-service-testbed_links.c +++ b/src/testbed/gnunet-service-testbed_links.c | |||
@@ -98,7 +98,7 @@ struct LCFContext | |||
98 | * The id of the operation which created this context | 98 | * The id of the operation which created this context |
99 | */ | 99 | */ |
100 | uint64_t operation_id; | 100 | uint64_t operation_id; |
101 | 101 | ||
102 | /** | 102 | /** |
103 | * should the slave controller start the delegated controller? | 103 | * should the slave controller start the delegated controller? |
104 | */ | 104 | */ |
@@ -186,7 +186,7 @@ struct Neighbour | |||
186 | * The controller handle | 186 | * The controller handle |
187 | */ | 187 | */ |
188 | struct GNUNET_TESTBED_Controller *controller; | 188 | struct GNUNET_TESTBED_Controller *controller; |
189 | 189 | ||
190 | /** | 190 | /** |
191 | * Operation handle for opening a lateral connection to another controller. | 191 | * Operation handle for opening a lateral connection to another controller. |
192 | * Will be NULL if the slave controller is started by this controller | 192 | * Will be NULL if the slave controller is started by this controller |
@@ -217,11 +217,11 @@ struct Neighbour | |||
217 | * Is the conn_op inactivated? | 217 | * Is the conn_op inactivated? |
218 | */ | 218 | */ |
219 | unsigned int inactive; | 219 | unsigned int inactive; |
220 | 220 | ||
221 | /** | 221 | /** |
222 | * The id of the host this controller is running on | 222 | * The id of the host this controller is running on |
223 | */ | 223 | */ |
224 | uint32_t host_id; | 224 | uint32_t host_id; |
225 | }; | 225 | }; |
226 | 226 | ||
227 | 227 | ||
@@ -256,7 +256,7 @@ struct NeighbourConnectCtxt | |||
256 | * The neighbour to whom connection should be made | 256 | * The neighbour to whom connection should be made |
257 | */ | 257 | */ |
258 | struct Neighbour *n; | 258 | struct Neighbour *n; |
259 | 259 | ||
260 | /** | 260 | /** |
261 | * The client requesting the connection | 261 | * The client requesting the connection |
262 | */ | 262 | */ |
@@ -379,7 +379,7 @@ void | |||
379 | GST_route_list_clear () | 379 | GST_route_list_clear () |
380 | { | 380 | { |
381 | unsigned int id; | 381 | unsigned int id; |
382 | 382 | ||
383 | for (id = 0; id < route_list_size; id++) | 383 | for (id = 0; id < route_list_size; id++) |
384 | if (NULL != route_list[id]) | 384 | if (NULL != route_list[id]) |
385 | GNUNET_free (route_list[id]); | 385 | GNUNET_free (route_list[id]); |
@@ -437,7 +437,7 @@ kill_slave (struct Slave *slave) | |||
437 | } | 437 | } |
438 | if (NULL != slave->rhandle) | 438 | if (NULL != slave->rhandle) |
439 | GNUNET_TESTBED_cancel_registration (slave->rhandle); | 439 | GNUNET_TESTBED_cancel_registration (slave->rhandle); |
440 | GNUNET_assert (GNUNET_SYSERR != | 440 | GNUNET_assert (GNUNET_SYSERR != |
441 | GNUNET_CONTAINER_multihashmap_iterate (slave->reghost_map, | 441 | GNUNET_CONTAINER_multihashmap_iterate (slave->reghost_map, |
442 | reghost_free_iterator, | 442 | reghost_free_iterator, |
443 | slave)); | 443 | slave)); |
@@ -545,7 +545,7 @@ send_controller_link_response (struct GNUNET_SERVER_Client *client, | |||
545 | struct GNUNET_TESTBED_ControllerLinkResponse *msg; | 545 | struct GNUNET_TESTBED_ControllerLinkResponse *msg; |
546 | char *xconfig; | 546 | char *xconfig; |
547 | size_t config_size; | 547 | size_t config_size; |
548 | size_t xconfig_size; | 548 | size_t xconfig_size; |
549 | uint16_t msize; | 549 | uint16_t msize; |
550 | 550 | ||
551 | GNUNET_assert ((NULL == cfg) || (NULL == emsg)); | 551 | GNUNET_assert ((NULL == cfg) || (NULL == emsg)); |
@@ -757,7 +757,7 @@ slave_event_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event) | |||
757 | GNUNET_SCHEDULER_cancel (lcf->timeout_task); | 757 | GNUNET_SCHEDULER_cancel (lcf->timeout_task); |
758 | if (NULL == event->details.operation_finished.emsg) | 758 | if (NULL == event->details.operation_finished.emsg) |
759 | send_controller_link_response (lcf->client, lcf->operation_id, | 759 | send_controller_link_response (lcf->client, lcf->operation_id, |
760 | GNUNET_TESTBED_host_get_cfg_ | 760 | GNUNET_TESTBED_host_get_cfg_ |
761 | (GST_host_list[lcf->delegated_host_id]), | 761 | (GST_host_list[lcf->delegated_host_id]), |
762 | NULL); | 762 | NULL); |
763 | else | 763 | else |
@@ -855,17 +855,17 @@ trigger_notifications (struct Neighbour *n); | |||
855 | * @param tc scheduler task context | 855 | * @param tc scheduler task context |
856 | */ | 856 | */ |
857 | static void | 857 | static void |
858 | neighbour_connect_notify_task (void *cls, | 858 | neighbour_connect_notify_task (void *cls, |
859 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 859 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
860 | { | 860 | { |
861 | struct Neighbour *n = cls; | 861 | struct Neighbour *n = cls; |
862 | struct NeighbourConnectNotification *h; | 862 | struct NeighbourConnectNotification *h; |
863 | 863 | ||
864 | GNUNET_assert (NULL != (h = n->nl_head)); | 864 | GNUNET_assert (NULL != (h = n->nl_head)); |
865 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != n->notify_task); | 865 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != n->notify_task); |
866 | n->notify_task = GNUNET_SCHEDULER_NO_TASK; | 866 | n->notify_task = GNUNET_SCHEDULER_NO_TASK; |
867 | GNUNET_assert (NULL != n->controller); | 867 | GNUNET_assert (NULL != n->controller); |
868 | GNUNET_CONTAINER_DLL_remove (n->nl_head, n->nl_tail, h); | 868 | GNUNET_CONTAINER_DLL_remove (n->nl_head, n->nl_tail, h); |
869 | trigger_notifications (n); | 869 | trigger_notifications (n); |
870 | h->cb (h->cb_cls, n->controller); | 870 | h->cb (h->cb_cls, n->controller); |
871 | GNUNET_free (h); | 871 | GNUNET_free (h); |
@@ -889,7 +889,7 @@ trigger_notifications (struct Neighbour *n) | |||
889 | if (NULL == n->controller) | 889 | if (NULL == n->controller) |
890 | return; | 890 | return; |
891 | if (GNUNET_SCHEDULER_NO_TASK != n->notify_task) | 891 | if (GNUNET_SCHEDULER_NO_TASK != n->notify_task) |
892 | return; | 892 | return; |
893 | if (1 == n->inactive) | 893 | if (1 == n->inactive) |
894 | { | 894 | { |
895 | GNUNET_assert (0 == n->reference_cnt); | 895 | GNUNET_assert (0 == n->reference_cnt); |
@@ -897,7 +897,7 @@ trigger_notifications (struct Neighbour *n) | |||
897 | n->inactive = 0; | 897 | n->inactive = 0; |
898 | } | 898 | } |
899 | n->reference_cnt++; | 899 | n->reference_cnt++; |
900 | n->notify_task = | 900 | n->notify_task = |
901 | GNUNET_SCHEDULER_add_now (&neighbour_connect_notify_task, n); | 901 | GNUNET_SCHEDULER_add_now (&neighbour_connect_notify_task, n); |
902 | } | 902 | } |
903 | 903 | ||
@@ -913,7 +913,7 @@ static void | |||
913 | opstart_neighbour_conn (void *cls) | 913 | opstart_neighbour_conn (void *cls) |
914 | { | 914 | { |
915 | struct Neighbour *n = cls; | 915 | struct Neighbour *n = cls; |
916 | 916 | ||
917 | GNUNET_assert (NULL != n->conn_op); | 917 | GNUNET_assert (NULL != n->conn_op); |
918 | GNUNET_assert (NULL == n->controller); | 918 | GNUNET_assert (NULL == n->controller); |
919 | LOG_DEBUG ("Opening connection to controller on host %u\n", n->host_id); | 919 | LOG_DEBUG ("Opening connection to controller on host %u\n", n->host_id); |
@@ -999,7 +999,7 @@ GST_neighbour_get_connection_cancel (struct NeighbourConnectNotification *h) | |||
999 | { | 999 | { |
1000 | struct Neighbour *n; | 1000 | struct Neighbour *n; |
1001 | int cleanup_task; | 1001 | int cleanup_task; |
1002 | 1002 | ||
1003 | n = h->n; | 1003 | n = h->n; |
1004 | cleanup_task = (h == n->nl_head) ? GNUNET_YES : GNUNET_NO; | 1004 | cleanup_task = (h == n->nl_head) ? GNUNET_YES : GNUNET_NO; |
1005 | GNUNET_CONTAINER_DLL_remove (n->nl_head, n->nl_tail, h); | 1005 | GNUNET_CONTAINER_DLL_remove (n->nl_head, n->nl_tail, h); |
@@ -1121,7 +1121,7 @@ GST_free_nccq () | |||
1121 | * @param tc the scheduler task context | 1121 | * @param tc the scheduler task context |
1122 | */ | 1122 | */ |
1123 | static void | 1123 | static void |
1124 | timeout_neighbour_connect (void *cls, | 1124 | timeout_neighbour_connect (void *cls, |
1125 | const struct GNUNET_SCHEDULER_TaskContext *tc) | 1125 | const struct GNUNET_SCHEDULER_TaskContext *tc) |
1126 | { | 1126 | { |
1127 | struct NeighbourConnectCtxt *ncc = cls; | 1127 | struct NeighbourConnectCtxt *ncc = cls; |
@@ -1233,7 +1233,7 @@ GST_handle_link_controllers (void *cls, struct GNUNET_SERVER_Client *client, | |||
1233 | struct Slave *slave; | 1233 | struct Slave *slave; |
1234 | struct LinkControllersContext *lcc; | 1234 | struct LinkControllersContext *lcc; |
1235 | 1235 | ||
1236 | 1236 | ||
1237 | if (1 != msg->is_subordinate) | 1237 | if (1 != msg->is_subordinate) |
1238 | { | 1238 | { |
1239 | struct Neighbour *n; | 1239 | struct Neighbour *n; |
@@ -1253,12 +1253,12 @@ GST_handle_link_controllers (void *cls, struct GNUNET_SERVER_Client *client, | |||
1253 | ncc->n = n; | 1253 | ncc->n = n; |
1254 | ncc->op_id = op_id; | 1254 | ncc->op_id = op_id; |
1255 | ncc->client = client; | 1255 | ncc->client = client; |
1256 | GNUNET_SERVER_client_keep (client); | 1256 | GNUNET_SERVER_client_keep (client); |
1257 | ncc->nh = GST_neighbour_get_connection (n, neighbour_connect_cb, ncc); | 1257 | ncc->nh = GST_neighbour_get_connection (n, neighbour_connect_cb, ncc); |
1258 | ncc->timeout_task = GNUNET_SCHEDULER_add_delayed (GST_timeout, | 1258 | ncc->timeout_task = GNUNET_SCHEDULER_add_delayed (GST_timeout, |
1259 | &timeout_neighbour_connect, | 1259 | &timeout_neighbour_connect, |
1260 | ncc); | 1260 | ncc); |
1261 | GNUNET_CONTAINER_DLL_insert_tail (ncc_head, ncc_tail, ncc); | 1261 | GNUNET_CONTAINER_DLL_insert_tail (ncc_head, ncc_tail, ncc); |
1262 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 1262 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
1263 | return; | 1263 | return; |
1264 | } | 1264 | } |
@@ -1351,7 +1351,7 @@ GST_free_lcfq () | |||
1351 | { | 1351 | { |
1352 | struct LCFContextQueue *lcfq; | 1352 | struct LCFContextQueue *lcfq; |
1353 | struct LCFContext *lcf; | 1353 | struct LCFContext *lcf; |
1354 | 1354 | ||
1355 | if (NULL != lcfq_head) | 1355 | if (NULL != lcfq_head) |
1356 | { | 1356 | { |
1357 | if (GNUNET_SCHEDULER_NO_TASK != lcf_proc_task_id) | 1357 | if (GNUNET_SCHEDULER_NO_TASK != lcf_proc_task_id) |
diff --git a/src/testbed/gnunet-service-testbed_oc.c b/src/testbed/gnunet-service-testbed_oc.c index b98f319a2..55f18d251 100644 --- a/src/testbed/gnunet-service-testbed_oc.c +++ b/src/testbed/gnunet-service-testbed_oc.c | |||
@@ -89,7 +89,7 @@ enum OverlayConnectContextType | |||
89 | * has to be made between local peers | 89 | * has to be made between local peers |
90 | */ | 90 | */ |
91 | OCC_TYPE_LOCAL, | 91 | OCC_TYPE_LOCAL, |
92 | 92 | ||
93 | /** | 93 | /** |
94 | * Type to be used when the first peer is local and the other peer is on a slave | 94 | * Type to be used when the first peer is local and the other peer is on a slave |
95 | * controller started by us | 95 | * controller started by us |
@@ -109,7 +109,7 @@ enum OverlayConnectContextType | |||
109 | * contexts | 109 | * contexts |
110 | */ | 110 | */ |
111 | struct LocalPeer2Context | 111 | struct LocalPeer2Context |
112 | { | 112 | { |
113 | /** | 113 | /** |
114 | * The handle for offering the HELLO of the first peer to the second | 114 | * The handle for offering the HELLO of the first peer to the second |
115 | * peer. | 115 | * peer. |
@@ -128,20 +128,20 @@ struct LocalPeer2Context | |||
128 | * contexts | 128 | * contexts |
129 | */ | 129 | */ |
130 | struct RemotePeer2Context | 130 | struct RemotePeer2Context |
131 | { | 131 | { |
132 | /** | 132 | /** |
133 | * Controller of peer 2; If OCC_TYPE_REMOTE_LATERAL is the type of overlay | 133 | * Controller of peer 2; If OCC_TYPE_REMOTE_LATERAL is the type of overlay |
134 | * connection then this can be NULL until the connection to the controller is | 134 | * connection then this can be NULL until the connection to the controller is |
135 | * established | 135 | * established |
136 | */ | 136 | */ |
137 | struct GNUNET_TESTBED_Controller *p2c; | 137 | struct GNUNET_TESTBED_Controller *p2c; |
138 | 138 | ||
139 | /** | 139 | /** |
140 | * Operation context for the suboperation we start to get the identity of the | 140 | * Operation context for the suboperation we start to get the identity of the |
141 | * second peer | 141 | * second peer |
142 | */ | 142 | */ |
143 | struct OperationContext *opc; | 143 | struct OperationContext *opc; |
144 | 144 | ||
145 | /** | 145 | /** |
146 | * Notification handle acquire to connect to a remote controller. Only used | 146 | * Notification handle acquire to connect to a remote controller. Only used |
147 | * if the type of overlay connection is OCC_TYPE_REMOTE_LATERAL. | 147 | * if the type of overlay connection is OCC_TYPE_REMOTE_LATERAL. |
@@ -152,7 +152,7 @@ struct RemotePeer2Context | |||
152 | * The neighbour handle. Only used if the type of overlay connection is | 152 | * The neighbour handle. Only used if the type of overlay connection is |
153 | * OCC_TYPE_REMOTE_LATERAL. | 153 | * OCC_TYPE_REMOTE_LATERAL. |
154 | */ | 154 | */ |
155 | struct Neighbour *p2n; | 155 | struct Neighbour *p2n; |
156 | }; | 156 | }; |
157 | 157 | ||
158 | /** | 158 | /** |
@@ -364,7 +364,7 @@ static struct RemoteOverlayConnectCtx *roccq_tail; | |||
364 | void | 364 | void |
365 | GST_cleanup_focc (struct ForwardedOverlayConnectContext *focc) | 365 | GST_cleanup_focc (struct ForwardedOverlayConnectContext *focc) |
366 | { | 366 | { |
367 | GNUNET_SERVER_client_drop (focc->client); | 367 | GNUNET_SERVER_client_drop (focc->client); |
368 | GNUNET_free_non_null (focc->orig_msg); | 368 | GNUNET_free_non_null (focc->orig_msg); |
369 | GNUNET_free (focc); | 369 | GNUNET_free (focc); |
370 | } | 370 | } |
@@ -535,7 +535,7 @@ cleanup_occ (struct OverlayConnectContext *occ) | |||
535 | if (NULL != occ->cgh_p1th) | 535 | if (NULL != occ->cgh_p1th) |
536 | GST_cache_get_handle_done (occ->cgh_p1th); | 536 | GST_cache_get_handle_done (occ->cgh_p1th); |
537 | GNUNET_assert (NULL != GST_peer_list); | 537 | GNUNET_assert (NULL != GST_peer_list); |
538 | GNUNET_assert (occ->peer->reference_cnt > 0); | 538 | GNUNET_assert (occ->peer->reference_cnt > 0); |
539 | occ->peer->reference_cnt--; | 539 | occ->peer->reference_cnt--; |
540 | if (PEER_EXPIRED (occ->peer)) | 540 | if (PEER_EXPIRED (occ->peer)) |
541 | GST_destroy_peer (occ->peer); | 541 | GST_destroy_peer (occ->peer); |
@@ -776,7 +776,7 @@ occ_hello_sent_cb (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
776 | GNUNET_free_non_null (occ->emsg); | 776 | GNUNET_free_non_null (occ->emsg); |
777 | GNUNET_asprintf (&occ->emsg, | 777 | GNUNET_asprintf (&occ->emsg, |
778 | "0x%llx: Timeout during TRANSPORT_try_connect() " | 778 | "0x%llx: Timeout during TRANSPORT_try_connect() " |
779 | "at peer %4s", occ->op_id, | 779 | "at peer %4s", occ->op_id, |
780 | GNUNET_i2s(&occ->other_peer_identity)); | 780 | GNUNET_i2s(&occ->other_peer_identity)); |
781 | lp2c->tcc.pid = &occ->peer_identity; | 781 | lp2c->tcc.pid = &occ->peer_identity; |
782 | lp2c->tcc.op_id = occ->op_id; | 782 | lp2c->tcc.op_id = occ->op_id; |
@@ -798,10 +798,10 @@ send_hello_thru_rocc (struct OverlayConnectContext *occ) | |||
798 | char *other_peer_str; | 798 | char *other_peer_str; |
799 | uint16_t msize; | 799 | uint16_t msize; |
800 | uint16_t hello_size; | 800 | uint16_t hello_size; |
801 | 801 | ||
802 | GNUNET_assert (OCC_TYPE_LOCAL != occ->type); | 802 | GNUNET_assert (OCC_TYPE_LOCAL != occ->type); |
803 | GNUNET_assert (NULL != occ->hello); | 803 | GNUNET_assert (NULL != occ->hello); |
804 | other_peer_str = GNUNET_strdup (GNUNET_i2s (&occ->other_peer_identity)); | 804 | other_peer_str = GNUNET_strdup (GNUNET_i2s (&occ->other_peer_identity)); |
805 | LOG_DEBUG ("0x%llx: Offering HELLO of %s (size: %u) to %s via Remote " | 805 | LOG_DEBUG ("0x%llx: Offering HELLO of %s (size: %u) to %s via Remote " |
806 | "Overlay Request\n", occ->op_id, | 806 | "Overlay Request\n", occ->op_id, |
807 | GNUNET_i2s (&occ->peer_identity), ntohs (occ->hello->size), | 807 | GNUNET_i2s (&occ->peer_identity), ntohs (occ->hello->size), |
@@ -848,7 +848,7 @@ send_hello (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
848 | return; | 848 | return; |
849 | } | 849 | } |
850 | lp2c = &occ->p2ctx.local; | 850 | lp2c = &occ->p2ctx.local; |
851 | other_peer_str = GNUNET_strdup (GNUNET_i2s (&occ->other_peer_identity)); | 851 | other_peer_str = GNUNET_strdup (GNUNET_i2s (&occ->other_peer_identity)); |
852 | LOG_DEBUG ("0x%llx: Offering HELLO of %s to %s\n", occ->op_id, | 852 | LOG_DEBUG ("0x%llx: Offering HELLO of %s to %s\n", occ->op_id, |
853 | GNUNET_i2s (&occ->peer_identity), other_peer_str); | 853 | GNUNET_i2s (&occ->peer_identity), other_peer_str); |
854 | GNUNET_free (other_peer_str); | 854 | GNUNET_free (other_peer_str); |
@@ -919,7 +919,7 @@ p2_transport_connect (struct OverlayConnectContext *occ) | |||
919 | GNUNET_assert (NULL == occ->cgh_p1th); | 919 | GNUNET_assert (NULL == occ->cgh_p1th); |
920 | if (OCC_TYPE_LOCAL == occ->type) | 920 | if (OCC_TYPE_LOCAL == occ->type) |
921 | { | 921 | { |
922 | GNUNET_assert (NULL != (peer2 = GST_peer_list[occ->other_peer_id])); | 922 | GNUNET_assert (NULL != (peer2 = GST_peer_list[occ->other_peer_id])); |
923 | occ->p2ctx.local.tcc.cgh_th = | 923 | occ->p2ctx.local.tcc.cgh_th = |
924 | GST_cache_get_handle_transport (occ->other_peer_id, | 924 | GST_cache_get_handle_transport (occ->other_peer_id, |
925 | peer2->details.local.cfg, | 925 | peer2->details.local.cfg, |
@@ -1145,7 +1145,7 @@ static void | |||
1145 | host_registration_comp (void *cls, const char *emsg) | 1145 | host_registration_comp (void *cls, const char *emsg) |
1146 | { | 1146 | { |
1147 | struct RegisteredHostContext *rhc = cls; | 1147 | struct RegisteredHostContext *rhc = cls; |
1148 | 1148 | ||
1149 | rhc->state = RHC_DONE; | 1149 | rhc->state = RHC_DONE; |
1150 | GST_process_next_focc (rhc); | 1150 | GST_process_next_focc (rhc); |
1151 | } | 1151 | } |
@@ -1217,7 +1217,7 @@ register_host (struct Slave *slave, struct GNUNET_TESTBED_Host *host) | |||
1217 | { | 1217 | { |
1218 | struct GNUNET_HashCode hash; | 1218 | struct GNUNET_HashCode hash; |
1219 | struct RegisteredHostContext *rhc; | 1219 | struct RegisteredHostContext *rhc; |
1220 | 1220 | ||
1221 | rhc = GNUNET_malloc (sizeof (struct RegisteredHostContext)); | 1221 | rhc = GNUNET_malloc (sizeof (struct RegisteredHostContext)); |
1222 | rhc->reg_host = host; | 1222 | rhc->reg_host = host; |
1223 | rhc->host = GST_host_list[slave->host_id]; | 1223 | rhc->host = GST_host_list[slave->host_id]; |
@@ -1290,7 +1290,7 @@ forward_overlay_connect (const struct GNUNET_TESTBED_OverlayConnectMessage *msg, | |||
1290 | route_to_peer1_host = GST_find_dest_route | 1290 | route_to_peer1_host = GST_find_dest_route |
1291 | (peer->details.remote.remote_host_id); | 1291 | (peer->details.remote.remote_host_id); |
1292 | GNUNET_assert (NULL != route_to_peer1_host); | 1292 | GNUNET_assert (NULL != route_to_peer1_host); |
1293 | if ((NULL != route_to_peer2_host) && | 1293 | if ((NULL != route_to_peer2_host) && |
1294 | (route_to_peer1_host->dest == route_to_peer2_host->dest)) | 1294 | (route_to_peer1_host->dest == route_to_peer2_host->dest)) |
1295 | goto forward; | 1295 | goto forward; |
1296 | /* Peer2 is either with us OR peer1 and peer2 can be reached through | 1296 | /* Peer2 is either with us OR peer1 and peer2 can be reached through |
@@ -1417,17 +1417,17 @@ GST_handle_overlay_connect (void *cls, struct GNUNET_SERVER_Client *client, | |||
1417 | { | 1417 | { |
1418 | GNUNET_break (0); | 1418 | GNUNET_break (0); |
1419 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 1419 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
1420 | return; | 1420 | return; |
1421 | } | 1421 | } |
1422 | forward_overlay_connect (msg, client); | 1422 | forward_overlay_connect (msg, client); |
1423 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 1423 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
1424 | return; | 1424 | return; |
1425 | } | 1425 | } |
1426 | p2n = NULL; | 1426 | p2n = NULL; |
1427 | occ = GNUNET_malloc (sizeof (struct OverlayConnectContext)); | 1427 | occ = GNUNET_malloc (sizeof (struct OverlayConnectContext)); |
1428 | occ->type = OCC_TYPE_LOCAL; | 1428 | occ->type = OCC_TYPE_LOCAL; |
1429 | if (!VALID_PEER_ID (p2)) /* May be peer2 is on a another controller */ | 1429 | if (!VALID_PEER_ID (p2)) /* May be peer2 is on a another controller */ |
1430 | { | 1430 | { |
1431 | if (NULL == (p2n = GST_get_neighbour (peer2_host_id))) | 1431 | if (NULL == (p2n = GST_get_neighbour (peer2_host_id))) |
1432 | { | 1432 | { |
1433 | if (!VALID_HOST_ID (peer2_host_id)) | 1433 | if (!VALID_HOST_ID (peer2_host_id)) |
@@ -1455,7 +1455,7 @@ GST_handle_overlay_connect (void *cls, struct GNUNET_SERVER_Client *client, | |||
1455 | occ->client = client; | 1455 | occ->client = client; |
1456 | occ->other_peer_id = p2; | 1456 | occ->other_peer_id = p2; |
1457 | GST_peer_list[p1]->reference_cnt++; | 1457 | GST_peer_list[p1]->reference_cnt++; |
1458 | occ->peer = GST_peer_list[p1]; | 1458 | occ->peer = GST_peer_list[p1]; |
1459 | occ->op_id = operation_id; | 1459 | occ->op_id = operation_id; |
1460 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == occ->timeout_task); | 1460 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == occ->timeout_task); |
1461 | occ->timeout_task = | 1461 | occ->timeout_task = |
@@ -1466,7 +1466,7 @@ GST_handle_overlay_connect (void *cls, struct GNUNET_SERVER_Client *client, | |||
1466 | GNUNET_asprintf (&occ->emsg, | 1466 | GNUNET_asprintf (&occ->emsg, |
1467 | "0x%llx: Timeout while acquiring connection to peer %u's " | 1467 | "0x%llx: Timeout while acquiring connection to peer %u's " |
1468 | "host: %u\n", occ->op_id, occ->other_peer_id, peer2_host_id); | 1468 | "host: %u\n", occ->op_id, occ->other_peer_id, peer2_host_id); |
1469 | occ->p2ctx.remote.ncn = | 1469 | occ->p2ctx.remote.ncn = |
1470 | GST_neighbour_get_connection (p2n, &p2_controller_connect_cb, occ); | 1470 | GST_neighbour_get_connection (p2n, &p2_controller_connect_cb, occ); |
1471 | break; | 1471 | break; |
1472 | case OCC_TYPE_REMOTE_SLAVE: | 1472 | case OCC_TYPE_REMOTE_SLAVE: |
diff --git a/src/testbed/gnunet-service-testbed_peers.c b/src/testbed/gnunet-service-testbed_peers.c index 1792373a3..959229543 100644 --- a/src/testbed/gnunet-service-testbed_peers.c +++ b/src/testbed/gnunet-service-testbed_peers.c | |||
@@ -22,7 +22,7 @@ | |||
22 | /** | 22 | /** |
23 | * @file testbed/gnunet-service-testbed_peers.c | 23 | * @file testbed/gnunet-service-testbed_peers.c |
24 | * @brief implementation of TESTBED service that deals with peer management | 24 | * @brief implementation of TESTBED service that deals with peer management |
25 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | 25 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include "gnunet-service-testbed.h" | 28 | #include "gnunet-service-testbed.h" |
@@ -70,12 +70,12 @@ struct ManageServiceContext | |||
70 | * The client which requested to manage the peer's service | 70 | * The client which requested to manage the peer's service |
71 | */ | 71 | */ |
72 | struct GNUNET_SERVER_Client *client; | 72 | struct GNUNET_SERVER_Client *client; |
73 | 73 | ||
74 | /** | 74 | /** |
75 | * The operation id of the associated request | 75 | * The operation id of the associated request |
76 | */ | 76 | */ |
77 | uint64_t op_id; | 77 | uint64_t op_id; |
78 | 78 | ||
79 | /** | 79 | /** |
80 | * 1 if the service at the peer has to be started; 0 if it has to be stopped | 80 | * 1 if the service at the peer has to be started; 0 if it has to be stopped |
81 | */ | 81 | */ |
@@ -85,7 +85,7 @@ struct ManageServiceContext | |||
85 | * Is this context expired? Do not work on this context if it is set to | 85 | * Is this context expired? Do not work on this context if it is set to |
86 | * GNUNET_YES | 86 | * GNUNET_YES |
87 | */ | 87 | */ |
88 | uint8_t expired; | 88 | uint8_t expired; |
89 | }; | 89 | }; |
90 | 90 | ||
91 | 91 | ||
@@ -343,7 +343,7 @@ GST_handle_peer_create (void *cls, struct GNUNET_SERVER_Client *client, | |||
343 | return; | 343 | return; |
344 | } | 344 | } |
345 | if (UINT32_MAX == peer_id) | 345 | if (UINT32_MAX == peer_id) |
346 | { | 346 | { |
347 | GST_send_operation_fail_msg (client, GNUNET_ntohll (msg->operation_id), | 347 | GST_send_operation_fail_msg (client, GNUNET_ntohll (msg->operation_id), |
348 | "Cannot create peer with given ID"); | 348 | "Cannot create peer with given ID"); |
349 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 349 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
@@ -793,7 +793,7 @@ prc_stop_cb (void *cls, struct GNUNET_TESTING_Peer *p, int success) | |||
793 | struct PeerReconfigureContext *prc = cls; | 793 | struct PeerReconfigureContext *prc = cls; |
794 | struct Peer *peer; | 794 | struct Peer *peer; |
795 | char *emsg; | 795 | char *emsg; |
796 | 796 | ||
797 | GNUNET_assert (VALID_PEER_ID (prc->peer_id)); | 797 | GNUNET_assert (VALID_PEER_ID (prc->peer_id)); |
798 | peer = GST_peer_list [prc->peer_id]; | 798 | peer = GST_peer_list [prc->peer_id]; |
799 | GNUNET_assert (GNUNET_NO == peer->is_remote); | 799 | GNUNET_assert (GNUNET_NO == peer->is_remote); |
@@ -815,13 +815,13 @@ prc_stop_cb (void *cls, struct GNUNET_TESTING_Peer *p, int success) | |||
815 | } | 815 | } |
816 | if (GNUNET_OK != start_peer (peer)) | 816 | if (GNUNET_OK != start_peer (peer)) |
817 | { | 817 | { |
818 | 818 | ||
819 | GST_send_operation_fail_msg (prc->client, prc->op_id, | 819 | GST_send_operation_fail_msg (prc->client, prc->op_id, |
820 | "Failed to start reconfigured peer"); | 820 | "Failed to start reconfigured peer"); |
821 | goto cleanup; | 821 | goto cleanup; |
822 | } | 822 | } |
823 | GST_send_operation_success_msg (prc->client, prc->op_id); | 823 | GST_send_operation_success_msg (prc->client, prc->op_id); |
824 | 824 | ||
825 | cleanup: | 825 | cleanup: |
826 | cleanup_prc (prc); | 826 | cleanup_prc (prc); |
827 | return; | 827 | return; |
@@ -849,7 +849,7 @@ GST_handle_peer_reconfigure (void *cls, struct GNUNET_SERVER_Client *client, | |||
849 | uint64_t op_id; | 849 | uint64_t op_id; |
850 | uint32_t peer_id; | 850 | uint32_t peer_id; |
851 | uint16_t msize; | 851 | uint16_t msize; |
852 | 852 | ||
853 | msize = ntohs (message->size); | 853 | msize = ntohs (message->size); |
854 | if (msize <= sizeof (struct GNUNET_TESTBED_PeerReconfigureMessage)) | 854 | if (msize <= sizeof (struct GNUNET_TESTBED_PeerReconfigureMessage)) |
855 | { | 855 | { |
@@ -907,7 +907,7 @@ GST_handle_peer_reconfigure (void *cls, struct GNUNET_SERVER_Client *client, | |||
907 | cfg = GNUNET_TESTBED_extract_config_ (message); | 907 | cfg = GNUNET_TESTBED_extract_config_ (message); |
908 | if (NULL == cfg) | 908 | if (NULL == cfg) |
909 | { | 909 | { |
910 | GNUNET_break (0); | 910 | GNUNET_break (0); |
911 | GST_send_operation_fail_msg (client, op_id, "Compression error"); | 911 | GST_send_operation_fail_msg (client, op_id, "Compression error"); |
912 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 912 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
913 | return; | 913 | return; |
@@ -916,7 +916,7 @@ GST_handle_peer_reconfigure (void *cls, struct GNUNET_SERVER_Client *client, | |||
916 | prc->cfg = cfg; | 916 | prc->cfg = cfg; |
917 | prc->peer_id = peer_id; | 917 | prc->peer_id = peer_id; |
918 | prc->op_id = op_id; | 918 | prc->op_id = op_id; |
919 | prc->client = client; | 919 | prc->client = client; |
920 | GNUNET_SERVER_client_keep (client); | 920 | GNUNET_SERVER_client_keep (client); |
921 | GNUNET_CONTAINER_DLL_insert_tail (prc_head, prc_tail, prc); | 921 | GNUNET_CONTAINER_DLL_insert_tail (prc_head, prc_tail, prc); |
922 | GNUNET_TESTING_peer_stop_async (peer->details.local.peer, prc_stop_cb, prc); | 922 | GNUNET_TESTING_peer_stop_async (peer->details.local.peer, prc_stop_cb, prc); |
@@ -1032,8 +1032,8 @@ arm_ret_string (enum GNUNET_ARM_Result result) | |||
1032 | * @param result result of the operation | 1032 | * @param result result of the operation |
1033 | */ | 1033 | */ |
1034 | static void | 1034 | static void |
1035 | service_manage_result_cb (void *cls, | 1035 | service_manage_result_cb (void *cls, |
1036 | enum GNUNET_ARM_RequestStatus rs, | 1036 | enum GNUNET_ARM_RequestStatus rs, |
1037 | const char *service, enum GNUNET_ARM_Result result) | 1037 | const char *service, enum GNUNET_ARM_Result result) |
1038 | { | 1038 | { |
1039 | struct ManageServiceContext *mctx = cls; | 1039 | struct ManageServiceContext *mctx = cls; |
@@ -1072,7 +1072,7 @@ service_manage_result_cb (void *cls, | |||
1072 | goto ret; | 1072 | goto ret; |
1073 | } | 1073 | } |
1074 | /* service started successfully */ | 1074 | /* service started successfully */ |
1075 | 1075 | ||
1076 | ret: | 1076 | ret: |
1077 | if (NULL != emsg) | 1077 | if (NULL != emsg) |
1078 | { | 1078 | { |
@@ -1107,17 +1107,17 @@ GST_handle_manage_peer_service (void *cls, struct GNUNET_SERVER_Client *client, | |||
1107 | uint64_t op_id; | 1107 | uint64_t op_id; |
1108 | uint32_t peer_id; | 1108 | uint32_t peer_id; |
1109 | uint16_t msize; | 1109 | uint16_t msize; |
1110 | 1110 | ||
1111 | 1111 | ||
1112 | msize = ntohs (message->size); | 1112 | msize = ntohs (message->size); |
1113 | if (msize <= sizeof (struct GNUNET_TESTBED_ManagePeerServiceMessage)) | 1113 | if (msize <= sizeof (struct GNUNET_TESTBED_ManagePeerServiceMessage)) |
1114 | { | 1114 | { |
1115 | GNUNET_break_op (0); | 1115 | GNUNET_break_op (0); |
1116 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 1116 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
1117 | return; | 1117 | return; |
1118 | } | 1118 | } |
1119 | msg = (const struct GNUNET_TESTBED_ManagePeerServiceMessage *) message; | 1119 | msg = (const struct GNUNET_TESTBED_ManagePeerServiceMessage *) message; |
1120 | service = (const char *) &msg[1]; | 1120 | service = (const char *) &msg[1]; |
1121 | if ('\0' != service[msize - sizeof | 1121 | if ('\0' != service[msize - sizeof |
1122 | (struct GNUNET_TESTBED_ManagePeerServiceMessage) - 1]) | 1122 | (struct GNUNET_TESTBED_ManagePeerServiceMessage) - 1]) |
1123 | { | 1123 | { |
@@ -1129,7 +1129,7 @@ GST_handle_manage_peer_service (void *cls, struct GNUNET_SERVER_Client *client, | |||
1129 | { | 1129 | { |
1130 | GNUNET_break_op (0); | 1130 | GNUNET_break_op (0); |
1131 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); | 1131 | GNUNET_SERVER_receive_done (client, GNUNET_SYSERR); |
1132 | return; | 1132 | return; |
1133 | } | 1133 | } |
1134 | peer_id = ntohl (msg->peer_id); | 1134 | peer_id = ntohl (msg->peer_id); |
1135 | op_id = GNUNET_ntohll (msg->operation_id); | 1135 | op_id = GNUNET_ntohll (msg->operation_id); |
@@ -1247,7 +1247,7 @@ GST_destroy_peers () | |||
1247 | { | 1247 | { |
1248 | peer = GST_peer_list[id]; | 1248 | peer = GST_peer_list[id]; |
1249 | if (NULL == peer) | 1249 | if (NULL == peer) |
1250 | continue; | 1250 | continue; |
1251 | if (GNUNET_NO == peer->is_remote) | 1251 | if (GNUNET_NO == peer->is_remote) |
1252 | { | 1252 | { |
1253 | if (GNUNET_YES == peer->details.local.is_running) | 1253 | if (GNUNET_YES == peer->details.local.is_running) |
@@ -1288,7 +1288,7 @@ shutdown_peers_timeout_cb (void *cls, | |||
1288 | GNUNET_free (hc); | 1288 | GNUNET_free (hc); |
1289 | hc = NULL; | 1289 | hc = NULL; |
1290 | } | 1290 | } |
1291 | GNUNET_TESTBED_forward_operation_msg_cancel_ (fo_ctxt->opc); | 1291 | GNUNET_TESTBED_forward_operation_msg_cancel_ (fo_ctxt->opc); |
1292 | GNUNET_SERVER_client_drop (fo_ctxt->client); | 1292 | GNUNET_SERVER_client_drop (fo_ctxt->client); |
1293 | GNUNET_CONTAINER_DLL_remove (fopcq_head, fopcq_tail, fo_ctxt); | 1293 | GNUNET_CONTAINER_DLL_remove (fopcq_head, fopcq_tail, fo_ctxt); |
1294 | GNUNET_free (fo_ctxt); | 1294 | GNUNET_free (fo_ctxt); |
@@ -1309,14 +1309,14 @@ shutdown_peers_reply_cb (void *cls, | |||
1309 | { | 1309 | { |
1310 | struct ForwardedOperationContext *fo_ctxt = cls; | 1310 | struct ForwardedOperationContext *fo_ctxt = cls; |
1311 | struct HandlerContext_ShutdownPeers *hc; | 1311 | struct HandlerContext_ShutdownPeers *hc; |
1312 | 1312 | ||
1313 | hc = fo_ctxt->cls; | 1313 | hc = fo_ctxt->cls; |
1314 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != fo_ctxt->timeout_task); | 1314 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK != fo_ctxt->timeout_task); |
1315 | GNUNET_SCHEDULER_cancel (fo_ctxt->timeout_task); | 1315 | GNUNET_SCHEDULER_cancel (fo_ctxt->timeout_task); |
1316 | fo_ctxt->timeout_task = GNUNET_SCHEDULER_NO_TASK; | 1316 | fo_ctxt->timeout_task = GNUNET_SCHEDULER_NO_TASK; |
1317 | GNUNET_assert (0 < hc->nslaves); | 1317 | GNUNET_assert (0 < hc->nslaves); |
1318 | hc->nslaves--; | 1318 | hc->nslaves--; |
1319 | if (GNUNET_MESSAGE_TYPE_TESTBED_GENERIC_OPERATION_SUCCESS != | 1319 | if (GNUNET_MESSAGE_TYPE_TESTBED_GENERIC_OPERATION_SUCCESS != |
1320 | ntohs (msg->type)) | 1320 | ntohs (msg->type)) |
1321 | hc->timeout = GNUNET_YES; | 1321 | hc->timeout = GNUNET_YES; |
1322 | if (0 == hc->nslaves) | 1322 | if (0 == hc->nslaves) |
@@ -1398,5 +1398,5 @@ GST_handle_shutdown_peers (void *cls, struct GNUNET_SERVER_Client *client, | |||
1398 | GST_send_operation_success_msg (client, op_id); | 1398 | GST_send_operation_success_msg (client, op_id); |
1399 | GNUNET_free (hc); | 1399 | GNUNET_free (hc); |
1400 | } | 1400 | } |
1401 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 1401 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
1402 | } | 1402 | } |
diff --git a/src/testbed/gnunet-testbed-profiler.c b/src/testbed/gnunet-testbed-profiler.c index 8d85280fe..c6c472f92 100644 --- a/src/testbed/gnunet-testbed-profiler.c +++ b/src/testbed/gnunet-testbed-profiler.c | |||
@@ -49,7 +49,7 @@ struct GNUNET_TESTBED_Operation *topology_op; | |||
49 | /** | 49 | /** |
50 | * Name of the file with the hosts to run the test over (configuration option). | 50 | * Name of the file with the hosts to run the test over (configuration option). |
51 | * It will be NULL if ENABLE_LL is set | 51 | * It will be NULL if ENABLE_LL is set |
52 | */ | 52 | */ |
53 | static char *hosts_file; | 53 | static char *hosts_file; |
54 | 54 | ||
55 | /** | 55 | /** |
@@ -216,7 +216,7 @@ controller_event_cb (void *cls, | |||
216 | * @param links_failed the number of overlay link | 216 | * @param links_failed the number of overlay link |
217 | */ | 217 | */ |
218 | static void | 218 | static void |
219 | test_run (void *cls, | 219 | test_run (void *cls, |
220 | struct GNUNET_TESTBED_RunHandle *h, | 220 | struct GNUNET_TESTBED_RunHandle *h, |
221 | unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers, | 221 | unsigned int num_peers, struct GNUNET_TESTBED_Peer **peers, |
222 | unsigned int links_succeeded, | 222 | unsigned int links_succeeded, |
diff --git a/src/testbed/gnunet_testbed_mpi_spawn.c b/src/testbed/gnunet_testbed_mpi_spawn.c index c7b7aab0b..a7652cfd8 100644 --- a/src/testbed/gnunet_testbed_mpi_spawn.c +++ b/src/testbed/gnunet_testbed_mpi_spawn.c | |||
@@ -26,7 +26,7 @@ static int ret; | |||
26 | static struct GNUNET_OS_Process *child; | 26 | static struct GNUNET_OS_Process *child; |
27 | 27 | ||
28 | /** | 28 | /** |
29 | * The arguments including the binary to spawn | 29 | * The arguments including the binary to spawn |
30 | */ | 30 | */ |
31 | static char **argv2; | 31 | static char **argv2; |
32 | 32 | ||
@@ -79,7 +79,7 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
79 | shutdown_task_id = GNUNET_SCHEDULER_NO_TASK; | 79 | shutdown_task_id = GNUNET_SCHEDULER_NO_TASK; |
80 | if (0 != child_exit_code) | 80 | if (0 != child_exit_code) |
81 | { | 81 | { |
82 | LOG (GNUNET_ERROR_TYPE_WARNING, "Child exited with error code: %lu\n", | 82 | LOG (GNUNET_ERROR_TYPE_WARNING, "Child exited with error code: %lu\n", |
83 | child_exit_code); | 83 | child_exit_code); |
84 | ret = 128 + (int) child_exit_code; | 84 | ret = 128 + (int) child_exit_code; |
85 | } | 85 | } |
@@ -101,7 +101,7 @@ terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
101 | static int hard_kill; | 101 | static int hard_kill; |
102 | 102 | ||
103 | GNUNET_assert (NULL != child); | 103 | GNUNET_assert (NULL != child); |
104 | terminate_task_id = | 104 | terminate_task_id = |
105 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, | 105 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL, |
106 | &terminate_task, NULL); | 106 | &terminate_task, NULL); |
107 | if (0 != hard_kill) | 107 | if (0 != hard_kill) |
@@ -110,7 +110,7 @@ terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
110 | { | 110 | { |
111 | case 1: | 111 | case 1: |
112 | case 2: | 112 | case 2: |
113 | LOG (GNUNET_ERROR_TYPE_WARNING, | 113 | LOG (GNUNET_ERROR_TYPE_WARNING, |
114 | "%d more interrupts needed to send SIGKILL to the child\n", | 114 | "%d more interrupts needed to send SIGKILL to the child\n", |
115 | 3 - hard_kill); | 115 | 3 - hard_kill); |
116 | hard_kill++; | 116 | hard_kill++; |
@@ -190,7 +190,7 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
190 | char *hostname; | 190 | char *hostname; |
191 | size_t hostname_len; | 191 | size_t hostname_len; |
192 | unsigned int nhosts; | 192 | unsigned int nhosts; |
193 | 193 | ||
194 | null_cfg = GNUNET_CONFIGURATION_create (); | 194 | null_cfg = GNUNET_CONFIGURATION_create (); |
195 | nhosts = GNUNET_TESTBED_hosts_load_from_loadleveler (null_cfg, &hosts); | 195 | nhosts = GNUNET_TESTBED_hosts_load_from_loadleveler (null_cfg, &hosts); |
196 | if (0 == nhosts) | 196 | if (0 == nhosts) |
@@ -223,7 +223,7 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
223 | if (NULL == tmpdir) | 223 | if (NULL == tmpdir) |
224 | tmpdir = getenv ("TMP"); | 224 | tmpdir = getenv ("TMP"); |
225 | if (NULL == tmpdir) | 225 | if (NULL == tmpdir) |
226 | tmpdir = getenv ("TEMP"); | 226 | tmpdir = getenv ("TEMP"); |
227 | if (NULL == tmpdir) | 227 | if (NULL == tmpdir) |
228 | tmpdir = "/tmp"; | 228 | tmpdir = "/tmp"; |
229 | (void) GNUNET_asprintf (&fn, "%s/gnunet-testbed-spawn.lock", tmpdir); | 229 | (void) GNUNET_asprintf (&fn, "%s/gnunet-testbed-spawn.lock", tmpdir); |
@@ -304,7 +304,7 @@ main (int argc, char *argv[]) | |||
304 | GNUNET_break (0); | 304 | GNUNET_break (0); |
305 | return 1; | 305 | return 1; |
306 | } | 306 | } |
307 | if (NULL == (sigpipe = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, | 307 | if (NULL == (sigpipe = GNUNET_DISK_pipe (GNUNET_NO, GNUNET_NO, |
308 | GNUNET_NO, GNUNET_NO))) | 308 | GNUNET_NO, GNUNET_NO))) |
309 | { | 309 | { |
310 | GNUNET_break (0); | 310 | GNUNET_break (0); |
@@ -321,7 +321,7 @@ main (int argc, char *argv[]) | |||
321 | argv2 = GNUNET_malloc (sizeof (char *) * argc); | 321 | argv2 = GNUNET_malloc (sizeof (char *) * argc); |
322 | for (cnt = 1; cnt < argc; cnt++) | 322 | for (cnt = 1; cnt < argc; cnt++) |
323 | argv2[cnt - 1] = argv[cnt]; | 323 | argv2[cnt - 1] = argv[cnt]; |
324 | GNUNET_SCHEDULER_run (run, NULL); | 324 | GNUNET_SCHEDULER_run (run, NULL); |
325 | GNUNET_free (argv2); | 325 | GNUNET_free (argv2); |
326 | GNUNET_SIGNAL_handler_uninstall (shc_chld); | 326 | GNUNET_SIGNAL_handler_uninstall (shc_chld); |
327 | shc_chld = NULL; | 327 | shc_chld = NULL; |
diff --git a/src/testbed/test_getcwd.c b/src/testbed/test_getcwd.c index 2b98a56d8..433f65f09 100644 --- a/src/testbed/test_getcwd.c +++ b/src/testbed/test_getcwd.c | |||
@@ -5,7 +5,7 @@ int main () | |||
5 | { | 5 | { |
6 | char buf[PATH_MAX]; | 6 | char buf[PATH_MAX]; |
7 | char *out; | 7 | char *out; |
8 | 8 | ||
9 | out = getcwd (buf, PATH_MAX); | 9 | out = getcwd (buf, PATH_MAX); |
10 | (void) printf ("CWD: %s\n", out); | 10 | (void) printf ("CWD: %s\n", out); |
11 | return 0; | 11 | return 0; |
diff --git a/src/testbed/test_testbed_api.c b/src/testbed/test_testbed_api.c index 97ca15c5f..47caa06f3 100644 --- a/src/testbed/test_testbed_api.c +++ b/src/testbed/test_testbed_api.c | |||
@@ -416,7 +416,7 @@ status_cb (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg_, int status | |||
416 | cp = NULL; | 416 | cp = NULL; |
417 | FAIL_TEST (0, return); | 417 | FAIL_TEST (0, return); |
418 | return; | 418 | return; |
419 | } | 419 | } |
420 | event_mask = 0; | 420 | event_mask = 0; |
421 | event_mask |= (1L << GNUNET_TESTBED_ET_PEER_START); | 421 | event_mask |= (1L << GNUNET_TESTBED_ET_PEER_START); |
422 | event_mask |= (1L << GNUNET_TESTBED_ET_PEER_STOP); | 422 | event_mask |= (1L << GNUNET_TESTBED_ET_PEER_STOP); |
diff --git a/src/testbed/test_testbed_api_barriers.c b/src/testbed/test_testbed_api_barriers.c index 2fbd6ea81..648af792b 100644 --- a/src/testbed/test_testbed_api_barriers.c +++ b/src/testbed/test_testbed_api_barriers.c | |||
@@ -21,7 +21,7 @@ | |||
21 | /** | 21 | /** |
22 | * @file testbed/test_testbed_api_barriers.c | 22 | * @file testbed/test_testbed_api_barriers.c |
23 | * @brief testcase binary for testing testbed barriers API | 23 | * @brief testcase binary for testing testbed barriers API |
24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | 24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "platform.h" | 27 | #include "platform.h" |
@@ -73,7 +73,7 @@ do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
73 | GNUNET_TESTBED_barrier_cancel (barrier); | 73 | GNUNET_TESTBED_barrier_cancel (barrier); |
74 | barrier = NULL; | 74 | barrier = NULL; |
75 | } | 75 | } |
76 | 76 | ||
77 | GNUNET_SCHEDULER_shutdown (); | 77 | GNUNET_SCHEDULER_shutdown (); |
78 | } | 78 | } |
79 | 79 | ||
@@ -99,7 +99,7 @@ barrier_cb (void *cls, | |||
99 | const char *emsg) | 99 | const char *emsg) |
100 | { | 100 | { |
101 | static enum GNUNET_TESTBED_BarrierStatus old_status; | 101 | static enum GNUNET_TESTBED_BarrierStatus old_status; |
102 | 102 | ||
103 | GNUNET_assert (NULL == cls); | 103 | GNUNET_assert (NULL == cls); |
104 | GNUNET_assert (_barrier == barrier); | 104 | GNUNET_assert (_barrier == barrier); |
105 | switch (status) | 105 | switch (status) |
@@ -109,14 +109,14 @@ barrier_cb (void *cls, | |||
109 | old_status = status; | 109 | old_status = status; |
110 | return; | 110 | return; |
111 | case GNUNET_TESTBED_BARRIERSTATUS_ERROR: | 111 | case GNUNET_TESTBED_BARRIERSTATUS_ERROR: |
112 | LOG (GNUNET_ERROR_TYPE_ERROR, "Barrier initialisation failed: %s", | 112 | LOG (GNUNET_ERROR_TYPE_ERROR, "Barrier initialisation failed: %s", |
113 | (NULL == emsg) ? "unknown reason" : emsg); | 113 | (NULL == emsg) ? "unknown reason" : emsg); |
114 | barrier = NULL; | 114 | barrier = NULL; |
115 | GNUNET_SCHEDULER_shutdown (); | 115 | GNUNET_SCHEDULER_shutdown (); |
116 | return; | 116 | return; |
117 | case GNUNET_TESTBED_BARRIERSTATUS_CROSSED: | 117 | case GNUNET_TESTBED_BARRIERSTATUS_CROSSED: |
118 | LOG (GNUNET_ERROR_TYPE_INFO, "Barrier crossed\n"); | 118 | LOG (GNUNET_ERROR_TYPE_INFO, "Barrier crossed\n"); |
119 | if (old_status == GNUNET_TESTBED_BARRIERSTATUS_INITIALISED) | 119 | if (old_status == GNUNET_TESTBED_BARRIERSTATUS_INITIALISED) |
120 | result = GNUNET_OK; | 120 | result = GNUNET_OK; |
121 | barrier = NULL; | 121 | barrier = NULL; |
122 | GNUNET_SCHEDULER_shutdown (); | 122 | GNUNET_SCHEDULER_shutdown (); |
@@ -161,7 +161,7 @@ test_master (void *cls, | |||
161 | &barrier_cb, NULL); | 161 | &barrier_cb, NULL); |
162 | shutdown_task = | 162 | shutdown_task = |
163 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply | 163 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply |
164 | (GNUNET_TIME_UNIT_SECONDS, | 164 | (GNUNET_TIME_UNIT_SECONDS, |
165 | 10 * (NUM_PEERS + 1)), | 165 | 10 * (NUM_PEERS + 1)), |
166 | &do_shutdown, NULL); | 166 | &do_shutdown, NULL); |
167 | } | 167 | } |
@@ -181,7 +181,7 @@ main (int argc, char **argv) | |||
181 | result = GNUNET_SYSERR; | 181 | result = GNUNET_SYSERR; |
182 | event_mask = 0; | 182 | event_mask = 0; |
183 | cfg = GNUNET_CONFIGURATION_create (); | 183 | cfg = GNUNET_CONFIGURATION_create (); |
184 | GNUNET_assert (GNUNET_YES == | 184 | GNUNET_assert (GNUNET_YES == |
185 | GNUNET_CONFIGURATION_parse (cfg, | 185 | GNUNET_CONFIGURATION_parse (cfg, |
186 | "test_testbed_api_barriers.conf.in")); | 186 | "test_testbed_api_barriers.conf.in")); |
187 | if (NULL == getcwd (pwd, PATH_MAX)) | 187 | if (NULL == getcwd (pwd, PATH_MAX)) |
@@ -191,7 +191,7 @@ main (int argc, char **argv) | |||
191 | GNUNET_CONFIGURATION_set_value_string (cfg, "test-barriers","BINARY", binary); | 191 | GNUNET_CONFIGURATION_set_value_string (cfg, "test-barriers","BINARY", binary); |
192 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_write | 192 | GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_write |
193 | (cfg, "test_testbed_api_barriers.conf")); | 193 | (cfg, "test_testbed_api_barriers.conf")); |
194 | GNUNET_CONFIGURATION_destroy (cfg); | 194 | GNUNET_CONFIGURATION_destroy (cfg); |
195 | cfg = NULL; | 195 | cfg = NULL; |
196 | GNUNET_free (binary); | 196 | GNUNET_free (binary); |
197 | binary = NULL; | 197 | binary = NULL; |
diff --git a/src/testbed/test_testbed_api_hosts.c b/src/testbed/test_testbed_api_hosts.c index 0c3c17a6b..4d96b2303 100644 --- a/src/testbed/test_testbed_api_hosts.c +++ b/src/testbed/test_testbed_api_hosts.c | |||
@@ -118,7 +118,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
118 | { | 118 | { |
119 | if (cnt < 3) | 119 | if (cnt < 3) |
120 | { | 120 | { |
121 | GNUNET_assert (0 == strcmp ("totakura", | 121 | GNUNET_assert (0 == strcmp ("totakura", |
122 | GNUNET_TESTBED_host_get_username_ | 122 | GNUNET_TESTBED_host_get_username_ |
123 | (hosts[cnt]))); | 123 | (hosts[cnt]))); |
124 | GNUNET_assert (NULL != GNUNET_TESTBED_host_get_hostname (hosts[cnt])); | 124 | GNUNET_assert (NULL != GNUNET_TESTBED_host_get_hostname (hosts[cnt])); |
@@ -126,7 +126,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
126 | } | 126 | } |
127 | if (3 == cnt) | 127 | if (3 == cnt) |
128 | { | 128 | { |
129 | GNUNET_assert (0 == strcmp ("totakura", | 129 | GNUNET_assert (0 == strcmp ("totakura", |
130 | GNUNET_TESTBED_host_get_username_ | 130 | GNUNET_TESTBED_host_get_username_ |
131 | (hosts[cnt]))); | 131 | (hosts[cnt]))); |
132 | GNUNET_assert (NULL != GNUNET_TESTBED_host_get_hostname (hosts[cnt])); | 132 | GNUNET_assert (NULL != GNUNET_TESTBED_host_get_hostname (hosts[cnt])); |
@@ -134,7 +134,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
134 | } | 134 | } |
135 | if (4 == cnt) | 135 | if (4 == cnt) |
136 | { | 136 | { |
137 | GNUNET_assert (0 == strcmp ("totakura", | 137 | GNUNET_assert (0 == strcmp ("totakura", |
138 | GNUNET_TESTBED_host_get_username_ | 138 | GNUNET_TESTBED_host_get_username_ |
139 | (hosts[cnt]))); | 139 | (hosts[cnt]))); |
140 | GNUNET_assert (0 == strcmp ("asgard.realm", | 140 | GNUNET_assert (0 == strcmp ("asgard.realm", |
diff --git a/src/testbed/test_testbed_api_operations.c b/src/testbed/test_testbed_api_operations.c index feca147b7..ceae76cd4 100644 --- a/src/testbed/test_testbed_api_operations.c +++ b/src/testbed/test_testbed_api_operations.c | |||
@@ -296,8 +296,8 @@ step (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
296 | case TEST_OP4_STARTED: | 296 | case TEST_OP4_STARTED: |
297 | GNUNET_TESTBED_operation_release_ (op4); | 297 | GNUNET_TESTBED_operation_release_ (op4); |
298 | break; | 298 | break; |
299 | case TEST_OP6_RELEASED: | 299 | case TEST_OP6_RELEASED: |
300 | op8 = GNUNET_TESTBED_operation_create_ (&op8, &start_cb, &release_cb); | 300 | op8 = GNUNET_TESTBED_operation_create_ (&op8, &start_cb, &release_cb); |
301 | GNUNET_TESTBED_operation_queue_insert2_ (q1, op8, 2); | 301 | GNUNET_TESTBED_operation_queue_insert2_ (q1, op8, 2); |
302 | GNUNET_TESTBED_operation_queue_insert2_ (q2, op8, 2); | 302 | GNUNET_TESTBED_operation_queue_insert2_ (q2, op8, 2); |
303 | result = TEST_OP8_WAITING; | 303 | result = TEST_OP8_WAITING; |
@@ -311,13 +311,13 @@ step (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
311 | case TEST_OP8_INACTIVE_1: | 311 | case TEST_OP8_INACTIVE_1: |
312 | GNUNET_TESTBED_operation_activate_ (op8); | 312 | GNUNET_TESTBED_operation_activate_ (op8); |
313 | result = TEST_OP8_ACTIVE; | 313 | result = TEST_OP8_ACTIVE; |
314 | op9 = GNUNET_TESTBED_operation_create_ (&op9, &start_cb, &release_cb); | 314 | op9 = GNUNET_TESTBED_operation_create_ (&op9, &start_cb, &release_cb); |
315 | GNUNET_TESTBED_operation_queue_insert2_ (q1, op9, 1); | 315 | GNUNET_TESTBED_operation_queue_insert2_ (q1, op9, 1); |
316 | GNUNET_TESTBED_operation_queue_insert2_ (q2, op9, 1); | 316 | GNUNET_TESTBED_operation_queue_insert2_ (q2, op9, 1); |
317 | GNUNET_TESTBED_operation_begin_wait_ (op9); | 317 | GNUNET_TESTBED_operation_begin_wait_ (op9); |
318 | step_task = GNUNET_SCHEDULER_add_delayed (STEP_DELAY, &step, NULL); | 318 | step_task = GNUNET_SCHEDULER_add_delayed (STEP_DELAY, &step, NULL); |
319 | break; | 319 | break; |
320 | case TEST_OP8_ACTIVE: | 320 | case TEST_OP8_ACTIVE: |
321 | GNUNET_TESTBED_operation_inactivate_ (op8); | 321 | GNUNET_TESTBED_operation_inactivate_ (op8); |
322 | /* op8 should be released by now due to above call */ | 322 | /* op8 should be released by now due to above call */ |
323 | GNUNET_assert (TEST_OP8_RELEASED == result); | 323 | GNUNET_assert (TEST_OP8_RELEASED == result); |
diff --git a/src/testbed/test_testbed_api_peer_reconfiguration.c b/src/testbed/test_testbed_api_peer_reconfiguration.c index 7f7bf6473..8ca679c27 100644 --- a/src/testbed/test_testbed_api_peer_reconfiguration.c +++ b/src/testbed/test_testbed_api_peer_reconfiguration.c | |||
@@ -22,7 +22,7 @@ | |||
22 | * @file testbed/test_testbed_api_peer_reconfiguration.c | 22 | * @file testbed/test_testbed_api_peer_reconfiguration.c |
23 | * @brief testcase for testing GNUNET_TESTBED_peer_manage_service() | 23 | * @brief testcase for testing GNUNET_TESTBED_peer_manage_service() |
24 | * implementation | 24 | * implementation |
25 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | 25 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include "platform.h" | 28 | #include "platform.h" |
@@ -63,7 +63,7 @@ enum { | |||
63 | * Peers have been started | 63 | * Peers have been started |
64 | */ | 64 | */ |
65 | STATE_PEER_STARTED, | 65 | STATE_PEER_STARTED, |
66 | 66 | ||
67 | /** | 67 | /** |
68 | * Peer has been reconfigured. Test completed successfully | 68 | * Peer has been reconfigured. Test completed successfully |
69 | */ | 69 | */ |
@@ -97,7 +97,7 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
97 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Aborting\n"); | 97 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Aborting\n"); |
98 | abort_task = GNUNET_SCHEDULER_NO_TASK; | 98 | abort_task = GNUNET_SCHEDULER_NO_TASK; |
99 | if (NULL != op) | 99 | if (NULL != op) |
100 | { | 100 | { |
101 | GNUNET_TESTBED_operation_done (op); | 101 | GNUNET_TESTBED_operation_done (op); |
102 | op = NULL; | 102 | op = NULL; |
103 | } | 103 | } |
@@ -128,7 +128,7 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event) | |||
128 | fprintf (stderr, "Operation failed: %s\n", | 128 | fprintf (stderr, "Operation failed: %s\n", |
129 | event->details.operation_finished.emsg); | 129 | event->details.operation_finished.emsg); |
130 | GNUNET_TESTBED_operation_done (op); | 130 | GNUNET_TESTBED_operation_done (op); |
131 | op = NULL; | 131 | op = NULL; |
132 | FAIL_TEST (0, return); | 132 | FAIL_TEST (0, return); |
133 | } | 133 | } |
134 | GNUNET_TESTBED_operation_done (op); | 134 | GNUNET_TESTBED_operation_done (op); |
@@ -152,7 +152,7 @@ controller_cb (void *cls, const struct GNUNET_TESTBED_EventInformation *event) | |||
152 | * failed | 152 | * failed |
153 | */ | 153 | */ |
154 | static void | 154 | static void |
155 | test_master (void *cls, | 155 | test_master (void *cls, |
156 | struct GNUNET_TESTBED_RunHandle *h, | 156 | struct GNUNET_TESTBED_RunHandle *h, |
157 | unsigned int num_peers, | 157 | unsigned int num_peers, |
158 | struct GNUNET_TESTBED_Peer **peers_, | 158 | struct GNUNET_TESTBED_Peer **peers_, |
diff --git a/src/testbed/test_testbed_api_peers_manage_services.c b/src/testbed/test_testbed_api_peers_manage_services.c index 29eed3d12..d61c11408 100644 --- a/src/testbed/test_testbed_api_peers_manage_services.c +++ b/src/testbed/test_testbed_api_peers_manage_services.c | |||
@@ -22,7 +22,7 @@ | |||
22 | * @file testbed/test_testbed_api_peers_manage_services.c | 22 | * @file testbed/test_testbed_api_peers_manage_services.c |
23 | * @brief testcase for testing GNUNET_TESTBED_peer_manage_service() | 23 | * @brief testcase for testing GNUNET_TESTBED_peer_manage_service() |
24 | * implementation | 24 | * implementation |
25 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | 25 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include "platform.h" | 28 | #include "platform.h" |
@@ -68,7 +68,7 @@ enum { | |||
68 | * Peers have been started | 68 | * Peers have been started |
69 | */ | 69 | */ |
70 | STATE_PEERS_STARTED, | 70 | STATE_PEERS_STARTED, |
71 | 71 | ||
72 | /** | 72 | /** |
73 | * statistics service went down | 73 | * statistics service went down |
74 | */ | 74 | */ |
@@ -111,7 +111,7 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
111 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Aborting\n"); | 111 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Aborting\n"); |
112 | abort_task = GNUNET_SCHEDULER_NO_TASK; | 112 | abort_task = GNUNET_SCHEDULER_NO_TASK; |
113 | if (NULL != op) | 113 | if (NULL != op) |
114 | { | 114 | { |
115 | GNUNET_TESTBED_operation_done (op); | 115 | GNUNET_TESTBED_operation_done (op); |
116 | op = NULL; | 116 | op = NULL; |
117 | } | 117 | } |
diff --git a/src/testbed/test_testbed_api_sd.c b/src/testbed/test_testbed_api_sd.c index d4fa7af84..0748c0ffd 100644 --- a/src/testbed/test_testbed_api_sd.c +++ b/src/testbed/test_testbed_api_sd.c | |||
@@ -22,7 +22,7 @@ | |||
22 | /** | 22 | /** |
23 | * @file testbed/testbed_api_sd.c | 23 | * @file testbed/testbed_api_sd.c |
24 | * @brief test cases for calculating standard deviation | 24 | * @brief test cases for calculating standard deviation |
25 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | 25 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include "platform.h" | 28 | #include "platform.h" |
@@ -58,7 +58,7 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
58 | ret = 1; | 58 | ret = 1; |
59 | goto err; | 59 | goto err; |
60 | } | 60 | } |
61 | GNUNET_TESTBED_SD_add_data_ (h, 30); | 61 | GNUNET_TESTBED_SD_add_data_ (h, 30); |
62 | if (GNUNET_SYSERR == GNUNET_TESTBED_SD_deviation_factor_ (h, 80, &sd)) | 62 | if (GNUNET_SYSERR == GNUNET_TESTBED_SD_deviation_factor_ (h, 80, &sd)) |
63 | { | 63 | { |
64 | GNUNET_break (0); | 64 | GNUNET_break (0); |
diff --git a/src/testbed/test_testbed_api_statistics.c b/src/testbed/test_testbed_api_statistics.c index e0f48fcb5..4c27e2982 100644 --- a/src/testbed/test_testbed_api_statistics.c +++ b/src/testbed/test_testbed_api_statistics.c | |||
@@ -21,7 +21,7 @@ | |||
21 | /** | 21 | /** |
22 | * @file testbed/test_testbed_api_statistics.c | 22 | * @file testbed/test_testbed_api_statistics.c |
23 | * @brief testcase for testing GNUNET_TESTBED_get_statistics() implementation | 23 | * @brief testcase for testing GNUNET_TESTBED_get_statistics() implementation |
24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | 24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "platform.h" | 27 | #include "platform.h" |
@@ -95,7 +95,7 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
95 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Test timed out -- Aborting\n"); | 95 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Test timed out -- Aborting\n"); |
96 | abort_task = GNUNET_SCHEDULER_NO_TASK; | 96 | abort_task = GNUNET_SCHEDULER_NO_TASK; |
97 | if (NULL != op) | 97 | if (NULL != op) |
98 | { | 98 | { |
99 | GNUNET_TESTBED_operation_done (op); | 99 | GNUNET_TESTBED_operation_done (op); |
100 | op = NULL; | 100 | op = NULL; |
101 | } | 101 | } |
@@ -121,12 +121,12 @@ stats_iterator (void *cls, | |||
121 | int is_persistent) | 121 | int is_persistent) |
122 | { | 122 | { |
123 | unsigned int cnt; | 123 | unsigned int cnt; |
124 | 124 | ||
125 | FAIL_TEST (cls == dummy_cls, return GNUNET_SYSERR); | 125 | FAIL_TEST (cls == dummy_cls, return GNUNET_SYSERR); |
126 | for (cnt = 0; cnt < num_seen_peers; cnt++) | 126 | for (cnt = 0; cnt < num_seen_peers; cnt++) |
127 | FAIL_TEST (peer != seen_peers[cnt], return GNUNET_SYSERR); | 127 | FAIL_TEST (peer != seen_peers[cnt], return GNUNET_SYSERR); |
128 | FAIL_TEST (NULL != subsystem, return GNUNET_SYSERR); | 128 | FAIL_TEST (NULL != subsystem, return GNUNET_SYSERR); |
129 | FAIL_TEST (NULL != name, return GNUNET_SYSERR); | 129 | FAIL_TEST (NULL != name, return GNUNET_SYSERR); |
130 | GNUNET_array_append (seen_peers, num_seen_peers, | 130 | GNUNET_array_append (seen_peers, num_seen_peers, |
131 | (struct GNUNET_TESTBED_Peer *) peer); | 131 | (struct GNUNET_TESTBED_Peer *) peer); |
132 | return GNUNET_SYSERR; | 132 | return GNUNET_SYSERR; |
@@ -151,7 +151,7 @@ op_comp_cb (void *cls, | |||
151 | GNUNET_TESTBED_operation_done (op); | 151 | GNUNET_TESTBED_operation_done (op); |
152 | op = NULL; | 152 | op = NULL; |
153 | GNUNET_SCHEDULER_cancel (abort_task); | 153 | GNUNET_SCHEDULER_cancel (abort_task); |
154 | GNUNET_SCHEDULER_shutdown (); | 154 | GNUNET_SCHEDULER_shutdown (); |
155 | } | 155 | } |
156 | 156 | ||
157 | 157 | ||
diff --git a/src/testbed/test_testbed_api_testbed_run.c b/src/testbed/test_testbed_api_testbed_run.c index b7cff2ec7..30acf268f 100644 --- a/src/testbed/test_testbed_api_testbed_run.c +++ b/src/testbed/test_testbed_api_testbed_run.c | |||
@@ -107,7 +107,7 @@ do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
107 | * failed | 107 | * failed |
108 | */ | 108 | */ |
109 | static void | 109 | static void |
110 | test_master (void *cls, | 110 | test_master (void *cls, |
111 | struct GNUNET_TESTBED_RunHandle *h, | 111 | struct GNUNET_TESTBED_RunHandle *h, |
112 | unsigned int num_peers, | 112 | unsigned int num_peers, |
113 | struct GNUNET_TESTBED_Peer **peers_, | 113 | struct GNUNET_TESTBED_Peer **peers_, |
diff --git a/src/testbed/test_testbed_logger_api.c b/src/testbed/test_testbed_logger_api.c index a8ed3d22c..dae972427 100644 --- a/src/testbed/test_testbed_logger_api.c +++ b/src/testbed/test_testbed_logger_api.c | |||
@@ -142,12 +142,12 @@ iterator_cb (void *cls, struct GNUNET_DISK_DirectoryIterator *di, | |||
142 | if ((BSIZE * 2) != fs) /* The file size should be equal to what we | 142 | if ((BSIZE * 2) != fs) /* The file size should be equal to what we |
143 | have written */ | 143 | have written */ |
144 | goto iteration_cont; | 144 | goto iteration_cont; |
145 | 145 | ||
146 | cancel = GNUNET_YES; | 146 | cancel = GNUNET_YES; |
147 | result = GNUNET_OK; | 147 | result = GNUNET_OK; |
148 | 148 | ||
149 | iteration_cont: | 149 | iteration_cont: |
150 | if ( (NULL != di) && | 150 | if ( (NULL != di) && |
151 | (GNUNET_YES == GNUNET_DISK_directory_iterator_next (di, cancel)) ) | 151 | (GNUNET_YES == GNUNET_DISK_directory_iterator_next (di, cancel)) ) |
152 | return; | 152 | return; |
153 | shutdown_now (); | 153 | shutdown_now (); |
@@ -193,7 +193,7 @@ do_write (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
193 | /** | 193 | /** |
194 | * Signature of the 'main' function for a (single-peer) testcase that | 194 | * Signature of the 'main' function for a (single-peer) testcase that |
195 | * is run using 'GNUNET_TESTING_peer_run'. | 195 | * is run using 'GNUNET_TESTING_peer_run'. |
196 | * | 196 | * |
197 | * @param cls closure | 197 | * @param cls closure |
198 | * @param cfg configuration of the peer that was started | 198 | * @param cfg configuration of the peer that was started |
199 | * @param peer identity of the peer that was created | 199 | * @param peer identity of the peer that was created |
diff --git a/src/testbed/testbed.h b/src/testbed/testbed.h index f781eea0d..cb39cc993 100644 --- a/src/testbed/testbed.h +++ b/src/testbed/testbed.h | |||
@@ -175,7 +175,7 @@ struct GNUNET_TESTBED_ControllerLinkRequest | |||
175 | */ | 175 | */ |
176 | struct GNUNET_TESTBED_ControllerLinkResponse | 176 | struct GNUNET_TESTBED_ControllerLinkResponse |
177 | { | 177 | { |
178 | 178 | ||
179 | /** | 179 | /** |
180 | * Type is GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS_RESULT | 180 | * Type is GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS_RESULT |
181 | */ | 181 | */ |
@@ -453,7 +453,7 @@ struct GNUNET_TESTBED_RemoteOverlayConnectMessage | |||
453 | /** | 453 | /** |
454 | * To be followed by the HELLO message of A | 454 | * To be followed by the HELLO message of A |
455 | */ | 455 | */ |
456 | struct GNUNET_MessageHeader hello[0]; | 456 | struct GNUNET_MessageHeader hello[0]; |
457 | // FIXME: we usually do not use this gcc-hack as some | 457 | // FIXME: we usually do not use this gcc-hack as some |
458 | // compilers / tools really get messed up by it... | 458 | // compilers / tools really get messed up by it... |
459 | 459 | ||
@@ -763,7 +763,7 @@ struct GNUNET_TESTBED_ManagePeerServiceMessage | |||
763 | * set this to 1 to start the service; 0 to stop the service | 763 | * set this to 1 to start the service; 0 to stop the service |
764 | */ | 764 | */ |
765 | uint8_t start; | 765 | uint8_t start; |
766 | 766 | ||
767 | /** | 767 | /** |
768 | * The NULL-terminated name of the service to start/stop follows here | 768 | * The NULL-terminated name of the service to start/stop follows here |
769 | */ | 769 | */ |
@@ -830,7 +830,7 @@ struct GNUNET_TESTBED_BarrierStatusMsg | |||
830 | * Type is GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_STATUS | 830 | * Type is GNUNET_MESSAGE_TYPE_TESTBED_BARRIER_STATUS |
831 | */ | 831 | */ |
832 | struct GNUNET_MessageHeader header; | 832 | struct GNUNET_MessageHeader header; |
833 | 833 | ||
834 | /** | 834 | /** |
835 | * status. Use enumerated values of enum BarrierStatus | 835 | * status. Use enumerated values of enum BarrierStatus |
836 | */ | 836 | */ |
@@ -840,7 +840,7 @@ struct GNUNET_TESTBED_BarrierStatusMsg | |||
840 | * strlen of the barrier name | 840 | * strlen of the barrier name |
841 | */ | 841 | */ |
842 | uint16_t name_len GNUNET_PACKED; | 842 | uint16_t name_len GNUNET_PACKED; |
843 | 843 | ||
844 | /** | 844 | /** |
845 | * the barrier name (NULL terminated) concatenated with an error message (NULL | 845 | * the barrier name (NULL terminated) concatenated with an error message (NULL |
846 | * terminated) if the status were to indicate an error | 846 | * terminated) if the status were to indicate an error |
diff --git a/src/testbed/testbed_api.c b/src/testbed/testbed_api.c index 3539eae03..2ee17c9e0 100644 --- a/src/testbed/testbed_api.c +++ b/src/testbed/testbed_api.c | |||
@@ -202,7 +202,7 @@ exop_insert (struct GNUNET_TESTBED_Operation *op) | |||
202 | 202 | ||
203 | entry = GNUNET_malloc (sizeof (struct ExpireOperationEntry)); | 203 | entry = GNUNET_malloc (sizeof (struct ExpireOperationEntry)); |
204 | entry->op = op; | 204 | entry->op = op; |
205 | GNUNET_CONTAINER_DLL_insert_tail (exop_head, exop_tail, entry); | 205 | GNUNET_CONTAINER_DLL_insert_tail (exop_head, exop_tail, entry); |
206 | } | 206 | } |
207 | 207 | ||
208 | 208 | ||
@@ -281,7 +281,7 @@ opc_search_iterator (void *cls, uint32_t key, void *value) | |||
281 | { | 281 | { |
282 | struct SearchContext *sc = cls; | 282 | struct SearchContext *sc = cls; |
283 | struct OperationContext *opc = value; | 283 | struct OperationContext *opc = value; |
284 | 284 | ||
285 | GNUNET_assert (NULL != opc); | 285 | GNUNET_assert (NULL != opc); |
286 | GNUNET_assert (NULL == sc->opc); | 286 | GNUNET_assert (NULL == sc->opc); |
287 | if (opc->id != sc->id) | 287 | if (opc->id != sc->id) |
@@ -307,7 +307,7 @@ find_opc (const struct GNUNET_TESTBED_Controller *c, const uint64_t id) | |||
307 | sc.id = id; | 307 | sc.id = id; |
308 | sc.opc = NULL; | 308 | sc.opc = NULL; |
309 | GNUNET_assert (NULL != c->opc_map); | 309 | GNUNET_assert (NULL != c->opc_map); |
310 | if (GNUNET_SYSERR != | 310 | if (GNUNET_SYSERR != |
311 | GNUNET_CONTAINER_multihashmap32_get_multiple (c->opc_map, (uint32_t) id, | 311 | GNUNET_CONTAINER_multihashmap32_get_multiple (c->opc_map, (uint32_t) id, |
312 | &opc_search_iterator, &sc)) | 312 | &opc_search_iterator, &sc)) |
313 | return NULL; | 313 | return NULL; |
@@ -330,7 +330,7 @@ GNUNET_TESTBED_insert_opc_ (struct GNUNET_TESTBED_Controller *c, | |||
330 | if (NULL == c->opc_map) | 330 | if (NULL == c->opc_map) |
331 | c->opc_map = GNUNET_CONTAINER_multihashmap32_create (256); | 331 | c->opc_map = GNUNET_CONTAINER_multihashmap32_create (256); |
332 | GNUNET_assert (GNUNET_OK == | 332 | GNUNET_assert (GNUNET_OK == |
333 | GNUNET_CONTAINER_multihashmap32_put (c->opc_map, | 333 | GNUNET_CONTAINER_multihashmap32_put (c->opc_map, |
334 | (uint32_t) opc->id, opc, | 334 | (uint32_t) opc->id, opc, |
335 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE)); | 335 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_MULTIPLE)); |
336 | } | 336 | } |
@@ -341,7 +341,7 @@ GNUNET_TESTBED_insert_opc_ (struct GNUNET_TESTBED_Controller *c, | |||
341 | * given controller | 341 | * given controller |
342 | * | 342 | * |
343 | * @param c the controller | 343 | * @param c the controller |
344 | * @param opc the operation context to remove | 344 | * @param opc the operation context to remove |
345 | */ | 345 | */ |
346 | void | 346 | void |
347 | GNUNET_TESTBED_remove_opc_ (const struct GNUNET_TESTBED_Controller *c, | 347 | GNUNET_TESTBED_remove_opc_ (const struct GNUNET_TESTBED_Controller *c, |
@@ -465,7 +465,7 @@ handle_opsuccess (struct GNUNET_TESTBED_Controller *c, | |||
465 | } | 465 | } |
466 | GNUNET_TESTBED_remove_opc_ (opc->c, opc); | 466 | GNUNET_TESTBED_remove_opc_ (opc->c, opc); |
467 | opc->state = OPC_STATE_FINISHED; | 467 | opc->state = OPC_STATE_FINISHED; |
468 | exop_insert (event.op); | 468 | exop_insert (event.op); |
469 | if (0 != (c->event_mask & (1L << GNUNET_TESTBED_ET_OPERATION_FINISHED))) | 469 | if (0 != (c->event_mask & (1L << GNUNET_TESTBED_ET_OPERATION_FINISHED))) |
470 | { | 470 | { |
471 | if (NULL != c->cc) | 471 | if (NULL != c->cc) |
@@ -611,7 +611,7 @@ handle_peer_event (struct GNUNET_TESTBED_Controller *c, | |||
611 | if (0 != (mask & c->event_mask)) | 611 | if (0 != (mask & c->event_mask)) |
612 | { | 612 | { |
613 | if (NULL != c->cc) | 613 | if (NULL != c->cc) |
614 | c->cc (c->cc_cls, &event); | 614 | c->cc (c->cc_cls, &event); |
615 | if (GNUNET_NO == exop_check (event.op)) | 615 | if (GNUNET_NO == exop_check (event.op)) |
616 | return GNUNET_YES; | 616 | return GNUNET_YES; |
617 | } | 617 | } |
@@ -689,7 +689,7 @@ handle_peer_conevent (struct GNUNET_TESTBED_Controller *c, | |||
689 | c->cc (c->cc_cls, &event); | 689 | c->cc (c->cc_cls, &event); |
690 | if (GNUNET_NO == exop_check (event.op)) | 690 | if (GNUNET_NO == exop_check (event.op)) |
691 | return GNUNET_YES; | 691 | return GNUNET_YES; |
692 | } | 692 | } |
693 | if (NULL != cb) | 693 | if (NULL != cb) |
694 | cb (cb_cls, opc->op, NULL); | 694 | cb (cb_cls, opc->op, NULL); |
695 | /* You could have marked the operation as done by now */ | 695 | /* You could have marked the operation as done by now */ |
@@ -738,12 +738,12 @@ handle_peer_config (struct GNUNET_TESTBED_Controller *c, | |||
738 | GNUNET_assert (NULL != peer); | 738 | GNUNET_assert (NULL != peer); |
739 | GNUNET_assert (ntohl (msg->peer_id) == peer->unique_id); | 739 | GNUNET_assert (ntohl (msg->peer_id) == peer->unique_id); |
740 | pinfo = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_PeerInformation)); | 740 | pinfo = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_PeerInformation)); |
741 | pinfo->pit = data->pit; | 741 | pinfo->pit = data->pit; |
742 | cb = data->cb; | 742 | cb = data->cb; |
743 | cb_cls = data->cb_cls; | 743 | cb_cls = data->cb_cls; |
744 | GNUNET_assert (NULL != cb); | 744 | GNUNET_assert (NULL != cb); |
745 | GNUNET_free (data); | 745 | GNUNET_free (data); |
746 | opc->data = NULL; | 746 | opc->data = NULL; |
747 | switch (pinfo->pit) | 747 | switch (pinfo->pit) |
748 | { | 748 | { |
749 | case GNUNET_TESTBED_PIT_IDENTITY: | 749 | case GNUNET_TESTBED_PIT_IDENTITY: |
@@ -760,7 +760,7 @@ handle_peer_config (struct GNUNET_TESTBED_Controller *c, | |||
760 | break; | 760 | break; |
761 | } | 761 | } |
762 | opc->data = pinfo; | 762 | opc->data = pinfo; |
763 | GNUNET_TESTBED_remove_opc_ (opc->c, opc); | 763 | GNUNET_TESTBED_remove_opc_ (opc->c, opc); |
764 | opc->state = OPC_STATE_FINISHED; | 764 | opc->state = OPC_STATE_FINISHED; |
765 | cb (cb_cls, opc->op, pinfo, NULL); | 765 | cb (cb_cls, opc->op, pinfo, NULL); |
766 | /* We dont check whether the operation is marked as done here as the | 766 | /* We dont check whether the operation is marked as done here as the |
@@ -871,7 +871,7 @@ handle_op_fail_event (struct GNUNET_TESTBED_Controller *c, | |||
871 | case OP_FORWARDED: | 871 | case OP_FORWARDED: |
872 | GNUNET_assert (0); | 872 | GNUNET_assert (0); |
873 | case OP_LINK_CONTROLLERS: /* No secondary callback */ | 873 | case OP_LINK_CONTROLLERS: /* No secondary callback */ |
874 | break; | 874 | break; |
875 | case OP_SHUTDOWN_PEERS: | 875 | case OP_SHUTDOWN_PEERS: |
876 | { | 876 | { |
877 | struct ShutdownPeersData *data; | 877 | struct ShutdownPeersData *data; |
@@ -1156,7 +1156,7 @@ message_handler (void *cls, const struct GNUNET_MessageHeader *msg) | |||
1156 | msg); | 1156 | msg); |
1157 | break; | 1157 | break; |
1158 | case GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS_RESULT: | 1158 | case GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS_RESULT: |
1159 | status = | 1159 | status = |
1160 | handle_link_controllers_result (c, | 1160 | handle_link_controllers_result (c, |
1161 | (const struct | 1161 | (const struct |
1162 | GNUNET_TESTBED_ControllerLinkResponse | 1162 | GNUNET_TESTBED_ControllerLinkResponse |
@@ -1365,7 +1365,7 @@ oprelease_link_controllers (void *cls) | |||
1365 | switch (opc->state) | 1365 | switch (opc->state) |
1366 | { | 1366 | { |
1367 | case OPC_STATE_INIT: | 1367 | case OPC_STATE_INIT: |
1368 | GNUNET_free (data->msg); | 1368 | GNUNET_free (data->msg); |
1369 | break; | 1369 | break; |
1370 | case OPC_STATE_STARTED: | 1370 | case OPC_STATE_STARTED: |
1371 | GNUNET_TESTBED_remove_opc_ (opc->c, opc); | 1371 | GNUNET_TESTBED_remove_opc_ (opc->c, opc); |
@@ -1543,7 +1543,7 @@ opc_free_iterator (void *cls, uint32_t key, void *value) | |||
1543 | 1543 | ||
1544 | GNUNET_assert (NULL != opc); | 1544 | GNUNET_assert (NULL != opc); |
1545 | GNUNET_break (0); | 1545 | GNUNET_break (0); |
1546 | GNUNET_assert (GNUNET_YES == | 1546 | GNUNET_assert (GNUNET_YES == |
1547 | GNUNET_CONTAINER_multihashmap32_remove (map, key, value)); | 1547 | GNUNET_CONTAINER_multihashmap32_remove (map, key, value)); |
1548 | GNUNET_free (opc); | 1548 | GNUNET_free (opc); |
1549 | return GNUNET_YES; | 1549 | return GNUNET_YES; |
@@ -1638,7 +1638,7 @@ GNUNET_TESTBED_compress_cfg_ (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
1638 | char *xconfig; | 1638 | char *xconfig; |
1639 | size_t size_; | 1639 | size_t size_; |
1640 | size_t xsize_; | 1640 | size_t xsize_; |
1641 | 1641 | ||
1642 | config = GNUNET_CONFIGURATION_serialize (cfg, &size_); | 1642 | config = GNUNET_CONFIGURATION_serialize (cfg, &size_); |
1643 | xsize_ = GNUNET_TESTBED_compress_config_ (config, size_, &xconfig); | 1643 | xsize_ = GNUNET_TESTBED_compress_config_ (config, size_, &xconfig); |
1644 | GNUNET_free (config); | 1644 | GNUNET_free (config); |
@@ -1689,7 +1689,7 @@ GNUNET_TESTBED_controller_link (void *op_cls, | |||
1689 | uint32_t slave_host_id; | 1689 | uint32_t slave_host_id; |
1690 | uint32_t delegated_host_id; | 1690 | uint32_t delegated_host_id; |
1691 | uint16_t msg_size; | 1691 | uint16_t msg_size; |
1692 | 1692 | ||
1693 | GNUNET_assert (GNUNET_YES == | 1693 | GNUNET_assert (GNUNET_YES == |
1694 | GNUNET_TESTBED_is_host_registered_ (delegated_host, master)); | 1694 | GNUNET_TESTBED_is_host_registered_ (delegated_host, master)); |
1695 | slave_host_id = | 1695 | slave_host_id = |
@@ -1875,7 +1875,7 @@ GNUNET_TESTBED_create_helper_init_msg_ (const char *trusted_ip, | |||
1875 | * cancels the operation, frees its resources and ensures the no event is | 1875 | * cancels the operation, frees its resources and ensures the no event is |
1876 | * generated with respect to this operation. Note that however cancelling an | 1876 | * generated with respect to this operation. Note that however cancelling an |
1877 | * operation does NOT guarantee that the operation will be fully undone (or that | 1877 | * operation does NOT guarantee that the operation will be fully undone (or that |
1878 | * nothing ever happened). | 1878 | * nothing ever happened). |
1879 | * | 1879 | * |
1880 | * This function MUST be called for every operation to fully remove the | 1880 | * This function MUST be called for every operation to fully remove the |
1881 | * operation from the operation queue. After calling this function, if | 1881 | * operation from the operation queue. After calling this function, if |
@@ -1949,11 +1949,11 @@ GNUNET_TESTBED_extract_config_ (const struct GNUNET_MessageHeader *msg) | |||
1949 | { | 1949 | { |
1950 | const struct GNUNET_TESTBED_AddHostMessage *imsg; | 1950 | const struct GNUNET_TESTBED_AddHostMessage *imsg; |
1951 | uint16_t osize; | 1951 | uint16_t osize; |
1952 | 1952 | ||
1953 | imsg = (const struct GNUNET_TESTBED_AddHostMessage *) msg; | 1953 | imsg = (const struct GNUNET_TESTBED_AddHostMessage *) msg; |
1954 | data_len = (uLong) ntohs (imsg->config_size); | 1954 | data_len = (uLong) ntohs (imsg->config_size); |
1955 | osize = sizeof (struct GNUNET_TESTBED_AddHostMessage) + | 1955 | osize = sizeof (struct GNUNET_TESTBED_AddHostMessage) + |
1956 | ntohs (imsg->username_length) + ntohs (imsg->hostname_length); | 1956 | ntohs (imsg->username_length) + ntohs (imsg->hostname_length); |
1957 | xdata_len = ntohs (imsg->header.size) - osize; | 1957 | xdata_len = ntohs (imsg->header.size) - osize; |
1958 | xdata = (const Bytef *) ((const void *) imsg + osize); | 1958 | xdata = (const Bytef *) ((const void *) imsg + osize); |
1959 | } | 1959 | } |
@@ -1961,10 +1961,10 @@ GNUNET_TESTBED_extract_config_ (const struct GNUNET_MessageHeader *msg) | |||
1961 | case GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS_RESULT: | 1961 | case GNUNET_MESSAGE_TYPE_TESTBED_LINK_CONTROLLERS_RESULT: |
1962 | { | 1962 | { |
1963 | const struct GNUNET_TESTBED_ControllerLinkResponse *imsg; | 1963 | const struct GNUNET_TESTBED_ControllerLinkResponse *imsg; |
1964 | 1964 | ||
1965 | imsg = (const struct GNUNET_TESTBED_ControllerLinkResponse *) msg; | 1965 | imsg = (const struct GNUNET_TESTBED_ControllerLinkResponse *) msg; |
1966 | data_len = ntohs (imsg->config_size); | 1966 | data_len = ntohs (imsg->config_size); |
1967 | xdata_len = ntohs (imsg->header.size) - | 1967 | xdata_len = ntohs (imsg->header.size) - |
1968 | sizeof (const struct GNUNET_TESTBED_ControllerLinkResponse); | 1968 | sizeof (const struct GNUNET_TESTBED_ControllerLinkResponse); |
1969 | xdata = (const Bytef *) &imsg[1]; | 1969 | xdata = (const Bytef *) &imsg[1]; |
1970 | } | 1970 | } |
@@ -2077,7 +2077,7 @@ opstart_shutdown_peers (void *cls) | |||
2077 | 2077 | ||
2078 | opc->state = OPC_STATE_STARTED; | 2078 | opc->state = OPC_STATE_STARTED; |
2079 | msg = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_ShutdownPeersMessage)); | 2079 | msg = GNUNET_malloc (sizeof (struct GNUNET_TESTBED_ShutdownPeersMessage)); |
2080 | msg->header.size = | 2080 | msg->header.size = |
2081 | htons (sizeof (struct GNUNET_TESTBED_ShutdownPeersMessage)); | 2081 | htons (sizeof (struct GNUNET_TESTBED_ShutdownPeersMessage)); |
2082 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS); | 2082 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_TESTBED_SHUTDOWN_PEERS); |
2083 | msg->operation_id = GNUNET_htonll (opc->id); | 2083 | msg->operation_id = GNUNET_htonll (opc->id); |
@@ -2146,7 +2146,7 @@ GNUNET_TESTBED_shutdown_peers (struct GNUNET_TESTBED_Controller *c, | |||
2146 | opc->data = data; | 2146 | opc->data = data; |
2147 | opc->id = GNUNET_TESTBED_get_next_op_id (c); | 2147 | opc->id = GNUNET_TESTBED_get_next_op_id (c); |
2148 | opc->type = OP_SHUTDOWN_PEERS; | 2148 | opc->type = OP_SHUTDOWN_PEERS; |
2149 | opc->state = OPC_STATE_INIT; | 2149 | opc->state = OPC_STATE_INIT; |
2150 | opc->op = GNUNET_TESTBED_operation_create_ (opc, &opstart_shutdown_peers, | 2150 | opc->op = GNUNET_TESTBED_operation_create_ (opc, &opstart_shutdown_peers, |
2151 | &oprelease_shutdown_peers); | 2151 | &oprelease_shutdown_peers); |
2152 | GNUNET_TESTBED_operation_queue_insert_ (opc->c->opq_parallel_operations, | 2152 | GNUNET_TESTBED_operation_queue_insert_ (opc->c->opq_parallel_operations, |
diff --git a/src/testbed/testbed_api.h b/src/testbed/testbed_api.h index 3b6678c56..46a9bc203 100644 --- a/src/testbed/testbed_api.h +++ b/src/testbed/testbed_api.h | |||
@@ -94,7 +94,7 @@ enum OperationType | |||
94 | OP_GET_SLAVE_CONFIG, | 94 | OP_GET_SLAVE_CONFIG, |
95 | 95 | ||
96 | /** | 96 | /** |
97 | * Stop and destroy all peers | 97 | * Stop and destroy all peers |
98 | */ | 98 | */ |
99 | OP_SHUTDOWN_PEERS, | 99 | OP_SHUTDOWN_PEERS, |
100 | 100 | ||
@@ -320,7 +320,7 @@ GNUNET_TESTBED_insert_opc_ (struct GNUNET_TESTBED_Controller *c, | |||
320 | * given controller | 320 | * given controller |
321 | * | 321 | * |
322 | * @param c the controller | 322 | * @param c the controller |
323 | * @param opc the operation context to remove | 323 | * @param opc the operation context to remove |
324 | */ | 324 | */ |
325 | void | 325 | void |
326 | GNUNET_TESTBED_remove_opc_ (const struct GNUNET_TESTBED_Controller *c, | 326 | GNUNET_TESTBED_remove_opc_ (const struct GNUNET_TESTBED_Controller *c, |
diff --git a/src/testbed/testbed_api_barriers.c b/src/testbed/testbed_api_barriers.c index 2a197719f..2ec34bb1b 100644 --- a/src/testbed/testbed_api_barriers.c +++ b/src/testbed/testbed_api_barriers.c | |||
@@ -21,7 +21,7 @@ | |||
21 | /** | 21 | /** |
22 | * @file testbed/testbed_api_barriers.c | 22 | * @file testbed/testbed_api_barriers.c |
23 | * @brief API implementation for testbed barriers | 23 | * @brief API implementation for testbed barriers |
24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | 24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "platform.h" | 27 | #include "platform.h" |
@@ -55,7 +55,7 @@ struct GNUNET_TESTBED_Barrier | |||
55 | * The controller handle given while initiliasing this barrier | 55 | * The controller handle given while initiliasing this barrier |
56 | */ | 56 | */ |
57 | struct GNUNET_TESTBED_Controller *c; | 57 | struct GNUNET_TESTBED_Controller *c; |
58 | 58 | ||
59 | /** | 59 | /** |
60 | * The name of the barrier | 60 | * The name of the barrier |
61 | */ | 61 | */ |
@@ -70,7 +70,7 @@ struct GNUNET_TESTBED_Barrier | |||
70 | * the closure for the above callback | 70 | * the closure for the above callback |
71 | */ | 71 | */ |
72 | void *cls; | 72 | void *cls; |
73 | 73 | ||
74 | /** | 74 | /** |
75 | * Should the barrier crossed status message be echoed back to the controller? | 75 | * Should the barrier crossed status message be echoed back to the controller? |
76 | */ | 76 | */ |
@@ -125,15 +125,15 @@ GNUNET_TESTBED_handle_barrier_status_ (struct GNUNET_TESTBED_Controller *c, | |||
125 | struct GNUNET_TESTBED_Barrier *barrier; | 125 | struct GNUNET_TESTBED_Barrier *barrier; |
126 | char *emsg; | 126 | char *emsg; |
127 | const char *name; | 127 | const char *name; |
128 | struct GNUNET_HashCode key; | 128 | struct GNUNET_HashCode key; |
129 | size_t emsg_len; | 129 | size_t emsg_len; |
130 | int status; | 130 | int status; |
131 | uint16_t msize; | 131 | uint16_t msize; |
132 | uint16_t name_len; | 132 | uint16_t name_len; |
133 | 133 | ||
134 | emsg = NULL; | 134 | emsg = NULL; |
135 | barrier = NULL; | 135 | barrier = NULL; |
136 | msize = ntohs (msg->header.size); | 136 | msize = ntohs (msg->header.size); |
137 | name = msg->data; | 137 | name = msg->data; |
138 | name_len = ntohs (msg->name_len); | 138 | name_len = ntohs (msg->name_len); |
139 | LOG_DEBUG ("Received BARRIER_STATUS msg\n"); | 139 | LOG_DEBUG ("Received BARRIER_STATUS msg\n"); |
@@ -219,7 +219,7 @@ GNUNET_TESTBED_barrier_init_ (struct GNUNET_TESTBED_Controller *controller, | |||
219 | struct GNUNET_HashCode key; | 219 | struct GNUNET_HashCode key; |
220 | size_t name_len; | 220 | size_t name_len; |
221 | uint16_t msize; | 221 | uint16_t msize; |
222 | 222 | ||
223 | GNUNET_assert (quorum <= 100); | 223 | GNUNET_assert (quorum <= 100); |
224 | GNUNET_assert (NULL != cb); | 224 | GNUNET_assert (NULL != cb); |
225 | name_len = strlen (name); | 225 | name_len = strlen (name); |
@@ -310,11 +310,11 @@ struct GNUNET_TESTBED_BarrierWaitHandle | |||
310 | * The name of the barrier | 310 | * The name of the barrier |
311 | */ | 311 | */ |
312 | char *name; | 312 | char *name; |
313 | 313 | ||
314 | /** | 314 | /** |
315 | * Then configuration used for the client connection | 315 | * Then configuration used for the client connection |
316 | */ | 316 | */ |
317 | struct GNUNET_CONFIGURATION_Handle *cfg; | 317 | struct GNUNET_CONFIGURATION_Handle *cfg; |
318 | 318 | ||
319 | /** | 319 | /** |
320 | * The client connection | 320 | * The client connection |
@@ -376,7 +376,7 @@ receive_handler (void *cls, const struct GNUNET_MessageHeader *message) | |||
376 | struct GNUNET_TESTBED_BarrierWaitHandle *h = cls; | 376 | struct GNUNET_TESTBED_BarrierWaitHandle *h = cls; |
377 | const struct GNUNET_TESTBED_BarrierStatusMsg *msg; | 377 | const struct GNUNET_TESTBED_BarrierStatusMsg *msg; |
378 | uint16_t msize; | 378 | uint16_t msize; |
379 | 379 | ||
380 | if (NULL == message) | 380 | if (NULL == message) |
381 | { | 381 | { |
382 | GNUNET_break_op (0); | 382 | GNUNET_break_op (0); |
@@ -386,13 +386,13 @@ receive_handler (void *cls, const struct GNUNET_MessageHeader *message) | |||
386 | { | 386 | { |
387 | GNUNET_break_op (0); | 387 | GNUNET_break_op (0); |
388 | goto fail; | 388 | goto fail; |
389 | } | 389 | } |
390 | msize = ntohs (message->size); | 390 | msize = ntohs (message->size); |
391 | if (msize <= sizeof (struct GNUNET_TESTBED_BarrierStatusMsg)) | 391 | if (msize <= sizeof (struct GNUNET_TESTBED_BarrierStatusMsg)) |
392 | { | 392 | { |
393 | GNUNET_break_op (0); | 393 | GNUNET_break_op (0); |
394 | goto fail; | 394 | goto fail; |
395 | } | 395 | } |
396 | msg = (const struct GNUNET_TESTBED_BarrierStatusMsg *) message; | 396 | msg = (const struct GNUNET_TESTBED_BarrierStatusMsg *) message; |
397 | switch (ntohs (msg->status)) | 397 | switch (ntohs (msg->status)) |
398 | { | 398 | { |
@@ -432,7 +432,7 @@ transmit_notify (void *cls, size_t size, void *buf) | |||
432 | { | 432 | { |
433 | struct GNUNET_TESTBED_BarrierWaitHandle *h = cls; | 433 | struct GNUNET_TESTBED_BarrierWaitHandle *h = cls; |
434 | uint16_t msize; | 434 | uint16_t msize; |
435 | 435 | ||
436 | h->tx = NULL; | 436 | h->tx = NULL; |
437 | if ((0 == size) || (NULL == buf)) | 437 | if ((0 == size) || (NULL == buf)) |
438 | { | 438 | { |
@@ -507,7 +507,7 @@ GNUNET_TESTBED_barrier_wait (const char *name, | |||
507 | msg->header.size = htons (msize); | 507 | msg->header.size = htons (msize); |
508 | (void) memcpy (msg->name, name, name_len); | 508 | (void) memcpy (msg->name, name, name_len); |
509 | h->msg = &msg->header; | 509 | h->msg = &msg->header; |
510 | h->tx = | 510 | h->tx = |
511 | GNUNET_CLIENT_notify_transmit_ready (h->conn, msize, | 511 | GNUNET_CLIENT_notify_transmit_ready (h->conn, msize, |
512 | GNUNET_TIME_UNIT_FOREVER_REL, | 512 | GNUNET_TIME_UNIT_FOREVER_REL, |
513 | GNUNET_NO, | 513 | GNUNET_NO, |
diff --git a/src/testbed/testbed_api_barriers.h b/src/testbed/testbed_api_barriers.h index 89aa56ca5..708b2db04 100644 --- a/src/testbed/testbed_api_barriers.h +++ b/src/testbed/testbed_api_barriers.h | |||
@@ -22,7 +22,7 @@ | |||
22 | * @file testbed/testbed_api_barriers.h | 22 | * @file testbed/testbed_api_barriers.h |
23 | * @brief interface for barriers API function that are used internally (not | 23 | * @brief interface for barriers API function that are used internally (not |
24 | * exposed as user API) | 24 | * exposed as user API) |
25 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | 25 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include "gnunet_testbed_service.h" | 28 | #include "gnunet_testbed_service.h" |
diff --git a/src/testbed/testbed_api_hosts.c b/src/testbed/testbed_api_hosts.c index e8417c0d8..51bd632c7 100644 --- a/src/testbed/testbed_api_hosts.c +++ b/src/testbed/testbed_api_hosts.c | |||
@@ -318,7 +318,7 @@ GNUNET_TESTBED_host_replace_cfg_ (struct GNUNET_TESTBED_Host *host, | |||
318 | */ | 318 | */ |
319 | struct GNUNET_TESTBED_Host * | 319 | struct GNUNET_TESTBED_Host * |
320 | GNUNET_TESTBED_host_create_with_id (uint32_t id, const char *hostname, | 320 | GNUNET_TESTBED_host_create_with_id (uint32_t id, const char *hostname, |
321 | const char *username, | 321 | const char *username, |
322 | const struct GNUNET_CONFIGURATION_Handle | 322 | const struct GNUNET_CONFIGURATION_Handle |
323 | *cfg, | 323 | *cfg, |
324 | uint16_t port) | 324 | uint16_t port) |
@@ -338,7 +338,7 @@ GNUNET_TESTBED_host_create_with_id (uint32_t id, const char *hostname, | |||
338 | host->port = (0 == port) ? 22 : port; | 338 | host->port = (0 == port) ? 22 : port; |
339 | host->cfg = GNUNET_CONFIGURATION_dup (cfg); | 339 | host->cfg = GNUNET_CONFIGURATION_dup (cfg); |
340 | host->opq_parallel_overlay_connect_operations = | 340 | host->opq_parallel_overlay_connect_operations = |
341 | GNUNET_TESTBED_operation_queue_create_ (OPERATION_QUEUE_TYPE_ADAPTIVE, | 341 | GNUNET_TESTBED_operation_queue_create_ (OPERATION_QUEUE_TYPE_ADAPTIVE, |
342 | UINT_MAX); | 342 | UINT_MAX); |
343 | new_size = host_list_size; | 343 | new_size = host_list_size; |
344 | while (id >= new_size) | 344 | while (id >= new_size) |
@@ -371,7 +371,7 @@ GNUNET_TESTBED_host_create (const char *hostname, const char *username, | |||
371 | static uint32_t uid_generator; | 371 | static uint32_t uid_generator; |
372 | 372 | ||
373 | if (NULL == hostname) | 373 | if (NULL == hostname) |
374 | return GNUNET_TESTBED_host_create_with_id (0, hostname, username, | 374 | return GNUNET_TESTBED_host_create_with_id (0, hostname, username, |
375 | cfg, port); | 375 | cfg, port); |
376 | return GNUNET_TESTBED_host_create_with_id (++uid_generator, hostname, | 376 | return GNUNET_TESTBED_host_create_with_id (++uid_generator, hostname, |
377 | username, cfg, port); | 377 | username, cfg, port); |
@@ -398,7 +398,7 @@ GNUNET_TESTBED_hosts_load_from_file (const char *filename, | |||
398 | //struct GNUNET_TESTBED_Host **host_array; | 398 | //struct GNUNET_TESTBED_Host **host_array; |
399 | struct GNUNET_TESTBED_Host *starting_host; | 399 | struct GNUNET_TESTBED_Host *starting_host; |
400 | char *data; | 400 | char *data; |
401 | char *buf; | 401 | char *buf; |
402 | char *username; | 402 | char *username; |
403 | char *hostname; | 403 | char *hostname; |
404 | regex_t rex; | 404 | regex_t rex; |
@@ -417,12 +417,12 @@ GNUNET_TESTBED_hosts_load_from_file (const char *filename, | |||
417 | } | 417 | } |
418 | if (GNUNET_OK != | 418 | if (GNUNET_OK != |
419 | GNUNET_DISK_file_size (filename, &fs, GNUNET_YES, GNUNET_YES)) | 419 | GNUNET_DISK_file_size (filename, &fs, GNUNET_YES, GNUNET_YES)) |
420 | fs = 0; | 420 | fs = 0; |
421 | if (0 == fs) | 421 | if (0 == fs) |
422 | { | 422 | { |
423 | LOG (GNUNET_ERROR_TYPE_WARNING, _("Hosts file %s has no data\n"), filename); | 423 | LOG (GNUNET_ERROR_TYPE_WARNING, _("Hosts file %s has no data\n"), filename); |
424 | return 0; | 424 | return 0; |
425 | } | 425 | } |
426 | data = GNUNET_malloc (fs); | 426 | data = GNUNET_malloc (fs); |
427 | if (fs != GNUNET_DISK_fn_read (filename, data, fs)) | 427 | if (fs != GNUNET_DISK_fn_read (filename, data, fs)) |
428 | { | 428 | { |
@@ -440,9 +440,9 @@ GNUNET_TESTBED_hosts_load_from_file (const char *filename, | |||
440 | "^(([[:alnum:]]+)@)?" /* username */ | 440 | "^(([[:alnum:]]+)@)?" /* username */ |
441 | "([[:alnum:]]+[-[:alnum:]_\\.]+)" /* hostname */ | 441 | "([[:alnum:]]+[-[:alnum:]_\\.]+)" /* hostname */ |
442 | "(:([[:digit:]]{1,5}))?", /* port */ | 442 | "(:([[:digit:]]{1,5}))?", /* port */ |
443 | REG_EXTENDED | REG_ICASE)); | 443 | REG_EXTENDED | REG_ICASE)); |
444 | while (offset < (fs - 1)) | 444 | while (offset < (fs - 1)) |
445 | { | 445 | { |
446 | offset++; | 446 | offset++; |
447 | if (((data[offset] == '\n')) && (buf != &data[offset])) | 447 | if (((data[offset] == '\n')) && (buf != &data[offset])) |
448 | { | 448 | { |
@@ -469,7 +469,7 @@ GNUNET_TESTBED_hosts_load_from_file (const char *filename, | |||
469 | } | 469 | } |
470 | if (-1 != pmatch[5].rm_so) | 470 | if (-1 != pmatch[5].rm_so) |
471 | { | 471 | { |
472 | (void) SSCANF (buf + pmatch[5].rm_so, "%5hd", &port); | 472 | (void) SSCANF (buf + pmatch[5].rm_so, "%5hd", &port); |
473 | } | 473 | } |
474 | size = pmatch[3].rm_eo - pmatch[3].rm_so; | 474 | size = pmatch[3].rm_eo - pmatch[3].rm_so; |
475 | hostname = GNUNET_malloc (size + 1); | 475 | hostname = GNUNET_malloc (size + 1); |
@@ -489,7 +489,7 @@ GNUNET_TESTBED_hosts_load_from_file (const char *filename, | |||
489 | (void) GNUNET_TESTBED_host_create (hostname, username, cfg, port); | 489 | (void) GNUNET_TESTBED_host_create (hostname, username, cfg, port); |
490 | count++; | 490 | count++; |
491 | GNUNET_free_non_null (username); | 491 | GNUNET_free_non_null (username); |
492 | GNUNET_free (hostname); | 492 | GNUNET_free (hostname); |
493 | buf = &data[offset + 1]; | 493 | buf = &data[offset + 1]; |
494 | } | 494 | } |
495 | else if ((data[offset] == '\n') || (data[offset] == '\0')) | 495 | else if ((data[offset] == '\n') || (data[offset] == '\0')) |
@@ -516,7 +516,7 @@ const char * | |||
516 | simple_resolve (const char *host) | 516 | simple_resolve (const char *host) |
517 | { | 517 | { |
518 | struct addrinfo *res; | 518 | struct addrinfo *res; |
519 | const struct sockaddr_in *in_addr; | 519 | const struct sockaddr_in *in_addr; |
520 | char *hostip; | 520 | char *hostip; |
521 | struct addrinfo hint; | 521 | struct addrinfo hint; |
522 | unsigned int rc; | 522 | unsigned int rc; |
@@ -566,13 +566,13 @@ GNUNET_TESTBED_hosts_load_from_loadleveler (const struct | |||
566 | struct GNUNET_TESTBED_Host ***hosts) | 566 | struct GNUNET_TESTBED_Host ***hosts) |
567 | { | 567 | { |
568 | #if !ENABLE_LL | 568 | #if !ENABLE_LL |
569 | LOG (GNUNET_ERROR_TYPE_ERROR, | 569 | LOG (GNUNET_ERROR_TYPE_ERROR, |
570 | _("The function %s is only available when compiled with (--with-ll)\n"), | 570 | _("The function %s is only available when compiled with (--with-ll)\n"), |
571 | __func__); | 571 | __func__); |
572 | GNUNET_assert (0); | 572 | GNUNET_assert (0); |
573 | #else | 573 | #else |
574 | const char *hostfile; | 574 | const char *hostfile; |
575 | 575 | ||
576 | if (NULL == (hostfile = getenv ("MP_SAVEHOSTFILE"))) | 576 | if (NULL == (hostfile = getenv ("MP_SAVEHOSTFILE"))) |
577 | { | 577 | { |
578 | GNUNET_break (0); | 578 | GNUNET_break (0); |
@@ -930,7 +930,7 @@ gen_rsh_suffix_args (const char * const *append_args) | |||
930 | } | 930 | } |
931 | if (NULL != append_args) | 931 | if (NULL != append_args) |
932 | { | 932 | { |
933 | for (append_cnt = 0; NULL != append_args[append_cnt]; append_cnt++) | 933 | for (append_cnt = 0; NULL != append_args[append_cnt]; append_cnt++) |
934 | GNUNET_array_append (rshell_args, cnt, GNUNET_strdup (append_args[append_cnt])); | 934 | GNUNET_array_append (rshell_args, cnt, GNUNET_strdup (append_args[append_cnt])); |
935 | } | 935 | } |
936 | GNUNET_array_append (rshell_args, cnt, NULL); | 936 | GNUNET_array_append (rshell_args, cnt, NULL); |
@@ -1070,7 +1070,7 @@ GNUNET_TESTBED_controller_start (const char *trusted_ip, | |||
1070 | static char *const binary_argv[] = { | 1070 | static char *const binary_argv[] = { |
1071 | HELPER_TESTBED_BINARY, NULL | 1071 | HELPER_TESTBED_BINARY, NULL |
1072 | }; | 1072 | }; |
1073 | 1073 | ||
1074 | GNUNET_assert (NULL != host); | 1074 | GNUNET_assert (NULL != host); |
1075 | GNUNET_assert (NULL != (cfg = GNUNET_TESTBED_host_get_cfg_ (host))); | 1075 | GNUNET_assert (NULL != (cfg = GNUNET_TESTBED_host_get_cfg_ (host))); |
1076 | hostname = NULL; | 1076 | hostname = NULL; |
@@ -1118,7 +1118,7 @@ GNUNET_TESTBED_controller_start (const char *trusted_ip, | |||
1118 | argstr = GNUNET_strdup (""); | 1118 | argstr = GNUNET_strdup (""); |
1119 | for (cnt = 0; NULL != cp->helper_argv[cnt]; cnt++) | 1119 | for (cnt = 0; NULL != cp->helper_argv[cnt]; cnt++) |
1120 | { | 1120 | { |
1121 | aux = argstr; | 1121 | aux = argstr; |
1122 | GNUNET_assert (0 < GNUNET_asprintf (&argstr, "%s %s", aux, cp->helper_argv[cnt])); | 1122 | GNUNET_assert (0 < GNUNET_asprintf (&argstr, "%s %s", aux, cp->helper_argv[cnt])); |
1123 | GNUNET_free (aux); | 1123 | GNUNET_free (aux); |
1124 | } | 1124 | } |
@@ -1334,7 +1334,7 @@ GNUNET_TESTBED_is_host_habitable (const struct GNUNET_TESTBED_Host *host, | |||
1334 | "HELPER_BINARY_PATH", | 1334 | "HELPER_BINARY_PATH", |
1335 | &stat_args[1])) | 1335 | &stat_args[1])) |
1336 | stat_args[1] = | 1336 | stat_args[1] = |
1337 | GNUNET_OS_get_libexec_binary_path (HELPER_TESTBED_BINARY); | 1337 | GNUNET_OS_get_libexec_binary_path (HELPER_TESTBED_BINARY); |
1338 | GNUNET_asprintf (&port, "%u", host->port); | 1338 | GNUNET_asprintf (&port, "%u", host->port); |
1339 | rsh_args = gen_rsh_args (port, hostname, host->username); | 1339 | rsh_args = gen_rsh_args (port, hostname, host->username); |
1340 | GNUNET_free (port); | 1340 | GNUNET_free (port); |
@@ -1523,12 +1523,12 @@ GNUNET_TESTBED_cancel_registration (struct GNUNET_TESTBED_HostRegistrationHandle | |||
1523 | * | 1523 | * |
1524 | * @param h the host handle | 1524 | * @param h the host handle |
1525 | * @param op the operation to queue in the given host's parally overlay connect | 1525 | * @param op the operation to queue in the given host's parally overlay connect |
1526 | * queue | 1526 | * queue |
1527 | */ | 1527 | */ |
1528 | void | 1528 | void |
1529 | GNUNET_TESTBED_host_queue_oc_ (struct GNUNET_TESTBED_Host *h, | 1529 | GNUNET_TESTBED_host_queue_oc_ (struct GNUNET_TESTBED_Host *h, |
1530 | struct GNUNET_TESTBED_Operation *op) | 1530 | struct GNUNET_TESTBED_Operation *op) |
1531 | { | 1531 | { |
1532 | GNUNET_TESTBED_operation_queue_insert_ | 1532 | GNUNET_TESTBED_operation_queue_insert_ |
1533 | (h->opq_parallel_overlay_connect_operations, op); | 1533 | (h->opq_parallel_overlay_connect_operations, op); |
1534 | } | 1534 | } |
diff --git a/src/testbed/testbed_api_hosts.h b/src/testbed/testbed_api_hosts.h index a1cbb5b88..f83ffd148 100644 --- a/src/testbed/testbed_api_hosts.h +++ b/src/testbed/testbed_api_hosts.h | |||
@@ -156,10 +156,10 @@ GNUNET_TESTBED_is_host_registered_ (const struct GNUNET_TESTBED_Host *host, | |||
156 | * | 156 | * |
157 | * @param h the host handle | 157 | * @param h the host handle |
158 | * @param op the operation to queue in the given host's parally overlay connect | 158 | * @param op the operation to queue in the given host's parally overlay connect |
159 | * queue | 159 | * queue |
160 | */ | 160 | */ |
161 | void | 161 | void |
162 | GNUNET_TESTBED_host_queue_oc_ (struct GNUNET_TESTBED_Host *h, | 162 | GNUNET_TESTBED_host_queue_oc_ (struct GNUNET_TESTBED_Host *h, |
163 | struct GNUNET_TESTBED_Operation *op); | 163 | struct GNUNET_TESTBED_Operation *op); |
164 | 164 | ||
165 | 165 | ||
diff --git a/src/testbed/testbed_api_operations.c b/src/testbed/testbed_api_operations.c index ce715785f..e3e9bb83d 100644 --- a/src/testbed/testbed_api_operations.c +++ b/src/testbed/testbed_api_operations.c | |||
@@ -115,7 +115,7 @@ struct FeedbackCtx | |||
115 | * Head for DLL of time slots which are free to be allocated to operations | 115 | * Head for DLL of time slots which are free to be allocated to operations |
116 | */ | 116 | */ |
117 | struct TimeSlot *alloc_head; | 117 | struct TimeSlot *alloc_head; |
118 | 118 | ||
119 | /** | 119 | /** |
120 | * Tail for DLL of time slots which are free to be allocated to operations | 120 | * Tail for DLL of time slots which are free to be allocated to operations |
121 | */ | 121 | */ |
@@ -131,7 +131,7 @@ struct FeedbackCtx | |||
131 | * Number of time slots filled so far | 131 | * Number of time slots filled so far |
132 | */ | 132 | */ |
133 | unsigned int tslots_filled; | 133 | unsigned int tslots_filled; |
134 | 134 | ||
135 | /** | 135 | /** |
136 | * Bound on the maximum number of operations which can be active | 136 | * Bound on the maximum number of operations which can be active |
137 | */ | 137 | */ |
@@ -267,7 +267,7 @@ struct ReadyQueueEntry | |||
267 | * next ptr for DLL | 267 | * next ptr for DLL |
268 | */ | 268 | */ |
269 | struct ReadyQueueEntry *next; | 269 | struct ReadyQueueEntry *next; |
270 | 270 | ||
271 | /** | 271 | /** |
272 | * prev ptr for DLL | 272 | * prev ptr for DLL |
273 | */ | 273 | */ |
@@ -407,7 +407,7 @@ remove_queue_entry (struct GNUNET_TESTBED_Operation *op, unsigned int index) | |||
407 | { | 407 | { |
408 | struct OperationQueue *opq; | 408 | struct OperationQueue *opq; |
409 | struct QueueEntry *entry; | 409 | struct QueueEntry *entry; |
410 | 410 | ||
411 | opq = op->queues[index]; | 411 | opq = op->queues[index]; |
412 | entry = op->qentries[index]; | 412 | entry = op->qentries[index]; |
413 | switch (op->state) | 413 | switch (op->state) |
@@ -445,7 +445,7 @@ change_state (struct GNUNET_TESTBED_Operation *op, enum OperationState state) | |||
445 | struct OperationQueue *opq; | 445 | struct OperationQueue *opq; |
446 | unsigned int cnt; | 446 | unsigned int cnt; |
447 | unsigned int s; | 447 | unsigned int s; |
448 | 448 | ||
449 | GNUNET_assert (OP_STATE_INIT != state); | 449 | GNUNET_assert (OP_STATE_INIT != state); |
450 | GNUNET_assert (NULL != op->queues); | 450 | GNUNET_assert (NULL != op->queues); |
451 | GNUNET_assert (NULL != op->nres); | 451 | GNUNET_assert (NULL != op->nres); |
@@ -459,7 +459,7 @@ change_state (struct GNUNET_TESTBED_Operation *op, enum OperationState state) | |||
459 | entry->op = op; | 459 | entry->op = op; |
460 | entry->nres = op->nres[cnt]; | 460 | entry->nres = op->nres[cnt]; |
461 | s = cnt; | 461 | s = cnt; |
462 | GNUNET_array_append (op->qentries, s, entry); | 462 | GNUNET_array_append (op->qentries, s, entry); |
463 | } | 463 | } |
464 | else | 464 | else |
465 | { | 465 | { |
@@ -498,7 +498,7 @@ change_state (struct GNUNET_TESTBED_Operation *op, enum OperationState state) | |||
498 | */ | 498 | */ |
499 | static void | 499 | static void |
500 | rq_remove (struct GNUNET_TESTBED_Operation *op) | 500 | rq_remove (struct GNUNET_TESTBED_Operation *op) |
501 | { | 501 | { |
502 | GNUNET_assert (NULL != op->rq_entry); | 502 | GNUNET_assert (NULL != op->rq_entry); |
503 | GNUNET_CONTAINER_DLL_remove (rq_head, rq_tail, op->rq_entry); | 503 | GNUNET_CONTAINER_DLL_remove (rq_head, rq_tail, op->rq_entry); |
504 | GNUNET_free (op->rq_entry); | 504 | GNUNET_free (op->rq_entry); |
@@ -650,7 +650,7 @@ decide_capacity (struct OperationQueue *opq, | |||
650 | } | 650 | } |
651 | 651 | ||
652 | ret: | 652 | ret: |
653 | GNUNET_free_non_null (evict_entries); | 653 | GNUNET_free_non_null (evict_entries); |
654 | if (NULL != ops_) | 654 | if (NULL != ops_) |
655 | *ops_ = ops; | 655 | *ops_ = ops; |
656 | else | 656 | else |
@@ -680,12 +680,12 @@ merge_ops (struct GNUNET_TESTBED_Operation ***old, | |||
680 | unsigned int i; | 680 | unsigned int i; |
681 | unsigned int j; | 681 | unsigned int j; |
682 | unsigned int n_cur; | 682 | unsigned int n_cur; |
683 | 683 | ||
684 | GNUNET_assert (NULL != old); | 684 | GNUNET_assert (NULL != old); |
685 | n_cur = *n_old; | 685 | n_cur = *n_old; |
686 | cur = *old; | 686 | cur = *old; |
687 | for (i = 0; i < n_new; i++) | 687 | for (i = 0; i < n_new; i++) |
688 | { | 688 | { |
689 | for (j = 0; j < *n_old; j++) | 689 | for (j = 0; j < *n_old; j++) |
690 | { | 690 | { |
691 | if (new[i] == cur[j]) | 691 | if (new[i] == cur[j]) |
@@ -698,7 +698,7 @@ merge_ops (struct GNUNET_TESTBED_Operation ***old, | |||
698 | *old = cur; | 698 | *old = cur; |
699 | *n_old = n_cur; | 699 | *n_old = n_cur; |
700 | } | 700 | } |
701 | 701 | ||
702 | 702 | ||
703 | 703 | ||
704 | /** | 704 | /** |
@@ -732,12 +732,12 @@ check_readiness (struct GNUNET_TESTBED_Operation *op) | |||
732 | if (NULL == ops) | 732 | if (NULL == ops) |
733 | continue; | 733 | continue; |
734 | merge_ops (&evict_ops, &n_evict_ops, ops, n_ops); | 734 | merge_ops (&evict_ops, &n_evict_ops, ops, n_ops); |
735 | GNUNET_free (ops); | 735 | GNUNET_free (ops); |
736 | } | 736 | } |
737 | if (NULL != evict_ops) | 737 | if (NULL != evict_ops) |
738 | { | 738 | { |
739 | for (i = 0; i < n_evict_ops; i++) | 739 | for (i = 0; i < n_evict_ops; i++) |
740 | GNUNET_TESTBED_operation_release_ (evict_ops[i]); | 740 | GNUNET_TESTBED_operation_release_ (evict_ops[i]); |
741 | GNUNET_free (evict_ops); | 741 | GNUNET_free (evict_ops); |
742 | evict_ops = NULL; | 742 | evict_ops = NULL; |
743 | /* Evicting the operations should schedule this operation */ | 743 | /* Evicting the operations should schedule this operation */ |
@@ -767,7 +767,7 @@ defer (struct GNUNET_TESTBED_Operation *op) | |||
767 | for (i = 0; i < op->nqueues; i++) | 767 | for (i = 0; i < op->nqueues; i++) |
768 | { | 768 | { |
769 | GNUNET_assert (op->queues[i]->active >= op->nres[i]); | 769 | GNUNET_assert (op->queues[i]->active >= op->nres[i]); |
770 | op->queues[i]->active -= op->nres[i]; | 770 | op->queues[i]->active -= op->nres[i]; |
771 | } | 771 | } |
772 | change_state (op, OP_STATE_WAITING); | 772 | change_state (op, OP_STATE_WAITING); |
773 | } | 773 | } |
@@ -809,7 +809,7 @@ cleanup_tslots (struct OperationQueue *queue) | |||
809 | * Cleansup the existing timing slots and sets new timing slots in the given | 809 | * Cleansup the existing timing slots and sets new timing slots in the given |
810 | * queue to accommodate given number of max active operations. | 810 | * queue to accommodate given number of max active operations. |
811 | * | 811 | * |
812 | * @param queue the queue | 812 | * @param queue the queue |
813 | * @param n the number of maximum active operations. If n is greater than the | 813 | * @param n the number of maximum active operations. If n is greater than the |
814 | * maximum limit set while creating the queue, then the minimum of these two | 814 | * maximum limit set while creating the queue, then the minimum of these two |
815 | * will be selected as n | 815 | * will be selected as n |
@@ -820,7 +820,7 @@ adaptive_queue_set_max_active (struct OperationQueue *queue, unsigned int n) | |||
820 | struct FeedbackCtx *fctx = queue->fctx; | 820 | struct FeedbackCtx *fctx = queue->fctx; |
821 | struct TimeSlot *tslot; | 821 | struct TimeSlot *tslot; |
822 | unsigned int cnt; | 822 | unsigned int cnt; |
823 | 823 | ||
824 | cleanup_tslots (queue); | 824 | cleanup_tslots (queue); |
825 | n = GNUNET_MIN (n ,fctx->max_active_bound); | 825 | n = GNUNET_MIN (n ,fctx->max_active_bound); |
826 | fctx->tslots_freeptr = GNUNET_malloc (n * sizeof (struct TimeSlot)); | 826 | fctx->tslots_freeptr = GNUNET_malloc (n * sizeof (struct TimeSlot)); |
@@ -872,7 +872,7 @@ adapt_parallelism (struct OperationQueue *queue) | |||
872 | return; | 872 | return; |
873 | } | 873 | } |
874 | avg = GNUNET_TIME_relative_divide (avg, nvals); | 874 | avg = GNUNET_TIME_relative_divide (avg, nvals); |
875 | if (GNUNET_SYSERR == | 875 | if (GNUNET_SYSERR == |
876 | GNUNET_TESTBED_SD_deviation_factor_ (fctx->sd, | 876 | GNUNET_TESTBED_SD_deviation_factor_ (fctx->sd, |
877 | (unsigned int) avg.rel_value_us, | 877 | (unsigned int) avg.rel_value_us, |
878 | &sd)) | 878 | &sd)) |
@@ -923,14 +923,14 @@ update_tslots (struct GNUNET_TESTBED_Operation *op) | |||
923 | struct GNUNET_TIME_Relative t; | 923 | struct GNUNET_TIME_Relative t; |
924 | struct TimeSlot *tslot; | 924 | struct TimeSlot *tslot; |
925 | struct FeedbackCtx *fctx; | 925 | struct FeedbackCtx *fctx; |
926 | 926 | ||
927 | t = GNUNET_TIME_absolute_get_duration (op->tstart); | 927 | t = GNUNET_TIME_absolute_get_duration (op->tstart); |
928 | while (NULL != (tslot = op->tslots_head)) /* update time slots */ | 928 | while (NULL != (tslot = op->tslots_head)) /* update time slots */ |
929 | { | 929 | { |
930 | queue = tslot->queue; | 930 | queue = tslot->queue; |
931 | fctx = queue->fctx; | 931 | fctx = queue->fctx; |
932 | GNUNET_CONTAINER_DLL_remove (op->tslots_head, op->tslots_tail, tslot); | 932 | GNUNET_CONTAINER_DLL_remove (op->tslots_head, op->tslots_tail, tslot); |
933 | tslot->op = NULL; | 933 | tslot->op = NULL; |
934 | GNUNET_CONTAINER_DLL_insert_tail (fctx->alloc_head, fctx->alloc_tail, | 934 | GNUNET_CONTAINER_DLL_insert_tail (fctx->alloc_head, fctx->alloc_tail, |
935 | tslot); | 935 | tslot); |
936 | if (op->failed) | 936 | if (op->failed) |
@@ -1011,7 +1011,7 @@ void | |||
1011 | GNUNET_TESTBED_operation_queue_destroy_ (struct OperationQueue *queue) | 1011 | GNUNET_TESTBED_operation_queue_destroy_ (struct OperationQueue *queue) |
1012 | { | 1012 | { |
1013 | struct FeedbackCtx *fctx; | 1013 | struct FeedbackCtx *fctx; |
1014 | 1014 | ||
1015 | GNUNET_break (GNUNET_YES == is_queue_empty (queue)); | 1015 | GNUNET_break (GNUNET_YES == is_queue_empty (queue)); |
1016 | if (OPERATION_QUEUE_TYPE_ADAPTIVE == queue->type) | 1016 | if (OPERATION_QUEUE_TYPE_ADAPTIVE == queue->type) |
1017 | { | 1017 | { |
@@ -1205,7 +1205,7 @@ GNUNET_TESTBED_operation_activate_ (struct GNUNET_TESTBED_Operation *op) | |||
1205 | void | 1205 | void |
1206 | GNUNET_TESTBED_operation_release_ (struct GNUNET_TESTBED_Operation *op) | 1206 | GNUNET_TESTBED_operation_release_ (struct GNUNET_TESTBED_Operation *op) |
1207 | { | 1207 | { |
1208 | struct QueueEntry *entry; | 1208 | struct QueueEntry *entry; |
1209 | struct OperationQueue *opq; | 1209 | struct OperationQueue *opq; |
1210 | unsigned int i; | 1210 | unsigned int i; |
1211 | 1211 | ||
@@ -1221,19 +1221,19 @@ GNUNET_TESTBED_operation_release_ (struct GNUNET_TESTBED_Operation *op) | |||
1221 | if (OP_STATE_ACTIVE == op->state) | 1221 | if (OP_STATE_ACTIVE == op->state) |
1222 | update_tslots (op); | 1222 | update_tslots (op); |
1223 | GNUNET_assert (NULL != op->queues); | 1223 | GNUNET_assert (NULL != op->queues); |
1224 | GNUNET_assert (NULL != op->qentries); | 1224 | GNUNET_assert (NULL != op->qentries); |
1225 | for (i = 0; i < op->nqueues; i++) | 1225 | for (i = 0; i < op->nqueues; i++) |
1226 | { | 1226 | { |
1227 | entry = op->qentries[i]; | 1227 | entry = op->qentries[i]; |
1228 | remove_queue_entry (op, i); | 1228 | remove_queue_entry (op, i); |
1229 | opq = op->queues[i]; | 1229 | opq = op->queues[i]; |
1230 | switch (op->state) | 1230 | switch (op->state) |
1231 | { | 1231 | { |
1232 | case OP_STATE_INIT: | 1232 | case OP_STATE_INIT: |
1233 | case OP_STATE_INACTIVE: | 1233 | case OP_STATE_INACTIVE: |
1234 | GNUNET_assert (0); | 1234 | GNUNET_assert (0); |
1235 | break; | 1235 | break; |
1236 | case OP_STATE_WAITING: | 1236 | case OP_STATE_WAITING: |
1237 | break; | 1237 | break; |
1238 | case OP_STATE_ACTIVE: | 1238 | case OP_STATE_ACTIVE: |
1239 | case OP_STATE_READY: | 1239 | case OP_STATE_READY: |
@@ -1242,7 +1242,7 @@ GNUNET_TESTBED_operation_release_ (struct GNUNET_TESTBED_Operation *op) | |||
1242 | opq->active -= entry->nres; | 1242 | opq->active -= entry->nres; |
1243 | recheck_waiting (opq); | 1243 | recheck_waiting (opq); |
1244 | break; | 1244 | break; |
1245 | } | 1245 | } |
1246 | GNUNET_free (entry); | 1246 | GNUNET_free (entry); |
1247 | } | 1247 | } |
1248 | GNUNET_free_non_null (op->qentries); | 1248 | GNUNET_free_non_null (op->qentries); |
diff --git a/src/testbed/testbed_api_peers.c b/src/testbed/testbed_api_peers.c index 9b21bfb3a..5d55e3ef6 100644 --- a/src/testbed/testbed_api_peers.c +++ b/src/testbed/testbed_api_peers.c | |||
@@ -105,7 +105,7 @@ opstart_peer_create (void *cls) | |||
105 | size_t xc_size; | 105 | size_t xc_size; |
106 | uint16_t msize; | 106 | uint16_t msize; |
107 | 107 | ||
108 | GNUNET_assert (OP_PEER_CREATE == opc->type); | 108 | GNUNET_assert (OP_PEER_CREATE == opc->type); |
109 | GNUNET_assert (NULL != data); | 109 | GNUNET_assert (NULL != data); |
110 | GNUNET_assert (NULL != data->peer); | 110 | GNUNET_assert (NULL != data->peer); |
111 | opc->state = OPC_STATE_STARTED; | 111 | opc->state = OPC_STATE_STARTED; |
@@ -464,7 +464,7 @@ opstart_peer_reconfigure (void *cls) | |||
464 | char *xconfig; | 464 | char *xconfig; |
465 | size_t xc_size; | 465 | size_t xc_size; |
466 | uint16_t msize; | 466 | uint16_t msize; |
467 | 467 | ||
468 | opc->state = OPC_STATE_STARTED; | 468 | opc->state = OPC_STATE_STARTED; |
469 | GNUNET_assert (NULL != data); | 469 | GNUNET_assert (NULL != data); |
470 | xc_size = GNUNET_TESTBED_compress_config_ (data->config, data->cfg_size, | 470 | xc_size = GNUNET_TESTBED_compress_config_ (data->config, data->cfg_size, |
@@ -472,7 +472,7 @@ opstart_peer_reconfigure (void *cls) | |||
472 | GNUNET_free (data->config); | 472 | GNUNET_free (data->config); |
473 | data->config = NULL; | 473 | data->config = NULL; |
474 | GNUNET_assert (xc_size <= UINT16_MAX); | 474 | GNUNET_assert (xc_size <= UINT16_MAX); |
475 | msize = (uint16_t) xc_size + | 475 | msize = (uint16_t) xc_size + |
476 | sizeof (struct GNUNET_TESTBED_PeerReconfigureMessage); | 476 | sizeof (struct GNUNET_TESTBED_PeerReconfigureMessage); |
477 | msg = GNUNET_realloc (xconfig, msize); | 477 | msg = GNUNET_realloc (xconfig, msize); |
478 | (void) memmove (&msg[1], msg, xc_size); | 478 | (void) memmove (&msg[1], msg, xc_size); |
@@ -498,7 +498,7 @@ oprelease_peer_reconfigure (void *cls) | |||
498 | { | 498 | { |
499 | struct OperationContext *opc = cls; | 499 | struct OperationContext *opc = cls; |
500 | struct PeerReconfigureData *data = opc->data; | 500 | struct PeerReconfigureData *data = opc->data; |
501 | 501 | ||
502 | switch (opc->state) | 502 | switch (opc->state) |
503 | { | 503 | { |
504 | case OPC_STATE_INIT: | 504 | case OPC_STATE_INIT: |
@@ -508,7 +508,7 @@ oprelease_peer_reconfigure (void *cls) | |||
508 | case OPC_STATE_STARTED: | 508 | case OPC_STATE_STARTED: |
509 | GNUNET_TESTBED_remove_opc_ (opc->c, opc); | 509 | GNUNET_TESTBED_remove_opc_ (opc->c, opc); |
510 | break; | 510 | break; |
511 | case OPC_STATE_FINISHED: | 511 | case OPC_STATE_FINISHED: |
512 | break; | 512 | break; |
513 | } | 513 | } |
514 | GNUNET_free (opc); | 514 | GNUNET_free (opc); |
@@ -874,15 +874,15 @@ opstart_manage_service (void *cls) | |||
874 | struct OperationContext *opc = cls; | 874 | struct OperationContext *opc = cls; |
875 | struct ManageServiceData *data = opc->data; | 875 | struct ManageServiceData *data = opc->data; |
876 | struct GNUNET_TESTBED_ManagePeerServiceMessage *msg; | 876 | struct GNUNET_TESTBED_ManagePeerServiceMessage *msg; |
877 | 877 | ||
878 | GNUNET_assert (NULL != data); | 878 | GNUNET_assert (NULL != data); |
879 | msg = GNUNET_malloc (data->msize); | 879 | msg = GNUNET_malloc (data->msize); |
880 | msg->header.size = htons (data->msize); | 880 | msg->header.size = htons (data->msize); |
881 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_TESTBED_MANAGE_PEER_SERVICE); | 881 | msg->header.type = htons (GNUNET_MESSAGE_TYPE_TESTBED_MANAGE_PEER_SERVICE); |
882 | msg->peer_id = htonl (data->peer->unique_id); | 882 | msg->peer_id = htonl (data->peer->unique_id); |
883 | msg->operation_id = GNUNET_htonll (opc->id); | 883 | msg->operation_id = GNUNET_htonll (opc->id); |
884 | msg->start = (uint8_t) data->start; | 884 | msg->start = (uint8_t) data->start; |
885 | (void) memcpy (&msg[1], data->service_name, data->msize | 885 | (void) memcpy (&msg[1], data->service_name, data->msize |
886 | - sizeof (struct GNUNET_TESTBED_ManagePeerServiceMessage)); | 886 | - sizeof (struct GNUNET_TESTBED_ManagePeerServiceMessage)); |
887 | GNUNET_free (data->service_name); | 887 | GNUNET_free (data->service_name); |
888 | data->service_name = NULL; | 888 | data->service_name = NULL; |
diff --git a/src/testbed/testbed_api_peers.h b/src/testbed/testbed_api_peers.h index 7416e1f05..2dbce8ef7 100644 --- a/src/testbed/testbed_api_peers.h +++ b/src/testbed/testbed_api_peers.h | |||
@@ -255,13 +255,13 @@ struct OverlayConnectData | |||
255 | 255 | ||
256 | struct ManageServiceData { | 256 | struct ManageServiceData { |
257 | GNUNET_TESTBED_OperationCompletionCallback cb; | 257 | GNUNET_TESTBED_OperationCompletionCallback cb; |
258 | 258 | ||
259 | void *cb_cls; | 259 | void *cb_cls; |
260 | 260 | ||
261 | struct GNUNET_TESTBED_Peer *peer; | 261 | struct GNUNET_TESTBED_Peer *peer; |
262 | 262 | ||
263 | char *service_name; | 263 | char *service_name; |
264 | 264 | ||
265 | unsigned int start; | 265 | unsigned int start; |
266 | 266 | ||
267 | uint16_t msize; | 267 | uint16_t msize; |
diff --git a/src/testbed/testbed_api_sd.c b/src/testbed/testbed_api_sd.c index 62f358de9..7a1da6b80 100644 --- a/src/testbed/testbed_api_sd.c +++ b/src/testbed/testbed_api_sd.c | |||
@@ -21,7 +21,7 @@ | |||
21 | /** | 21 | /** |
22 | * @file testbed/testbed_api_sd.c | 22 | * @file testbed/testbed_api_sd.c |
23 | * @brief functions to calculate standard deviation | 23 | * @brief functions to calculate standard deviation |
24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | 24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "platform.h" | 27 | #include "platform.h" |
diff --git a/src/testbed/testbed_api_sd.h b/src/testbed/testbed_api_sd.h index b3e19c0bd..577522d07 100644 --- a/src/testbed/testbed_api_sd.h +++ b/src/testbed/testbed_api_sd.h | |||
@@ -21,7 +21,7 @@ | |||
21 | /** | 21 | /** |
22 | * @file testbed/testbed_api_sd.h | 22 | * @file testbed/testbed_api_sd.h |
23 | * @brief functions to calculate standard deviation | 23 | * @brief functions to calculate standard deviation |
24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | 24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #ifndef TESTBED_API_SD_H | 27 | #ifndef TESTBED_API_SD_H |
diff --git a/src/testbed/testbed_api_statistics.c b/src/testbed/testbed_api_statistics.c index dbbb99e4a..5fa0750e3 100644 --- a/src/testbed/testbed_api_statistics.c +++ b/src/testbed/testbed_api_statistics.c | |||
@@ -95,7 +95,7 @@ struct GetStatsContext | |||
95 | * The task for calling the continuation callback | 95 | * The task for calling the continuation callback |
96 | */ | 96 | */ |
97 | GNUNET_SCHEDULER_TaskIdentifier call_completion_task_id; | 97 | GNUNET_SCHEDULER_TaskIdentifier call_completion_task_id; |
98 | 98 | ||
99 | /** | 99 | /** |
100 | * The number of peers present in the peers array. This number also | 100 | * The number of peers present in the peers array. This number also |
101 | * represents the number of service connect operations in the ops array | 101 | * represents the number of service connect operations in the ops array |
@@ -180,7 +180,7 @@ op_done_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
180 | 180 | ||
181 | sc = peer_sc->sc; | 181 | sc = peer_sc->sc; |
182 | peer_sc->op_done_task_id = GNUNET_SCHEDULER_NO_TASK; | 182 | peer_sc->op_done_task_id = GNUNET_SCHEDULER_NO_TASK; |
183 | op = &sc->ops[peer_sc->peer_index]; | 183 | op = &sc->ops[peer_sc->peer_index]; |
184 | GNUNET_assert (NULL != *op); | 184 | GNUNET_assert (NULL != *op); |
185 | GNUNET_TESTBED_operation_done (*op); | 185 | GNUNET_TESTBED_operation_done (*op); |
186 | *op = NULL; | 186 | *op = NULL; |
@@ -202,7 +202,7 @@ iteration_completion_cb (void *cls, int success) | |||
202 | 202 | ||
203 | GNUNET_break (GNUNET_OK == success); | 203 | GNUNET_break (GNUNET_OK == success); |
204 | sc = peer_sc->sc; | 204 | sc = peer_sc->sc; |
205 | peer_sc->get_handle = NULL; | 205 | peer_sc->get_handle = NULL; |
206 | sc->num_completed++; | 206 | sc->num_completed++; |
207 | peer_sc->op_done_task_id = GNUNET_SCHEDULER_add_now (&op_done_task, peer_sc); | 207 | peer_sc->op_done_task_id = GNUNET_SCHEDULER_add_now (&op_done_task, peer_sc); |
208 | if (sc->num_completed == sc->num_peers) | 208 | if (sc->num_completed == sc->num_peers) |
@@ -239,7 +239,7 @@ iterator_cb (void *cls, const char *subsystem, | |||
239 | LOG_DEBUG ("Peer %u: [%s,%s] -> %lu\n", peer_sc->peer_index, | 239 | LOG_DEBUG ("Peer %u: [%s,%s] -> %lu\n", peer_sc->peer_index, |
240 | subsystem, name, (unsigned long) value); | 240 | subsystem, name, (unsigned long) value); |
241 | ret = sc->proc (sc->cb_cls, peer, | 241 | ret = sc->proc (sc->cb_cls, peer, |
242 | subsystem, name, value, is_persistent); | 242 | subsystem, name, value, is_persistent); |
243 | if (GNUNET_SYSERR == ret) | 243 | if (GNUNET_SYSERR == ret) |
244 | LOG_DEBUG ("Aborting iteration for peer %u\n", peer_sc->peer_index); | 244 | LOG_DEBUG ("Aborting iteration for peer %u\n", peer_sc->peer_index); |
245 | return ret; | 245 | return ret; |
@@ -283,11 +283,11 @@ service_connect_comp (void *cls, | |||
283 | * from GNUNET_TESTBED_service_connect() | 283 | * from GNUNET_TESTBED_service_connect() |
284 | * @return service handle to return in 'op_result', NULL on error | 284 | * @return service handle to return in 'op_result', NULL on error |
285 | */ | 285 | */ |
286 | static void * | 286 | static void * |
287 | statistics_ca (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg) | 287 | statistics_ca (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg) |
288 | { | 288 | { |
289 | struct PeerGetStatsContext *peer_sc = cls; | 289 | struct PeerGetStatsContext *peer_sc = cls; |
290 | 290 | ||
291 | LOG_DEBUG ("Connecting to statistics service of peer %u\n", | 291 | LOG_DEBUG ("Connecting to statistics service of peer %u\n", |
292 | peer_sc->peer_index); | 292 | peer_sc->peer_index); |
293 | return GNUNET_STATISTICS_create ("<testbed-api>", cfg); | 293 | return GNUNET_STATISTICS_create ("<testbed-api>", cfg); |
@@ -300,7 +300,7 @@ statistics_ca (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
300 | * @param cls the PeerGetStatsContext | 300 | * @param cls the PeerGetStatsContext |
301 | * @param op_result service handle returned from the connect adapter | 301 | * @param op_result service handle returned from the connect adapter |
302 | */ | 302 | */ |
303 | static void | 303 | static void |
304 | statistics_da (void *cls, void *op_result) | 304 | statistics_da (void *cls, void *op_result) |
305 | { | 305 | { |
306 | struct PeerGetStatsContext *peer_sc = cls; | 306 | struct PeerGetStatsContext *peer_sc = cls; |
@@ -331,7 +331,7 @@ opstart_get_stats (void *cls) | |||
331 | unsigned int peer; | 331 | unsigned int peer; |
332 | 332 | ||
333 | LOG_DEBUG ("Starting get_statistics operation\n"); | 333 | LOG_DEBUG ("Starting get_statistics operation\n"); |
334 | sc->ops = GNUNET_malloc (sc->num_peers * | 334 | sc->ops = GNUNET_malloc (sc->num_peers * |
335 | sizeof (struct GNUNET_TESTBED_Operation *)); | 335 | sizeof (struct GNUNET_TESTBED_Operation *)); |
336 | for (peer = 0; peer < sc->num_peers; peer++) | 336 | for (peer = 0; peer < sc->num_peers; peer++) |
337 | { | 337 | { |
@@ -343,7 +343,7 @@ opstart_get_stats (void *cls) | |||
343 | peer_sc = GNUNET_malloc (sizeof (struct PeerGetStatsContext)); | 343 | peer_sc = GNUNET_malloc (sizeof (struct PeerGetStatsContext)); |
344 | peer_sc->sc = sc; | 344 | peer_sc->sc = sc; |
345 | peer_sc->peer_index = peer; | 345 | peer_sc->peer_index = peer; |
346 | sc->ops[peer] = | 346 | sc->ops[peer] = |
347 | GNUNET_TESTBED_service_connect (sc, sc->peers[peer], "statistics", | 347 | GNUNET_TESTBED_service_connect (sc, sc->peers[peer], "statistics", |
348 | &service_connect_comp, | 348 | &service_connect_comp, |
349 | peer_sc, | 349 | peer_sc, |
@@ -364,7 +364,7 @@ oprelease_get_stats (void *cls) | |||
364 | { | 364 | { |
365 | struct GetStatsContext *sc = cls; | 365 | struct GetStatsContext *sc = cls; |
366 | unsigned int peer; | 366 | unsigned int peer; |
367 | 367 | ||
368 | LOG_DEBUG ("Cleaning up get_statistics operation\n"); | 368 | LOG_DEBUG ("Cleaning up get_statistics operation\n"); |
369 | if (GNUNET_SCHEDULER_NO_TASK != sc->call_completion_task_id) | 369 | if (GNUNET_SCHEDULER_NO_TASK != sc->call_completion_task_id) |
370 | GNUNET_SCHEDULER_cancel (sc->call_completion_task_id); | 370 | GNUNET_SCHEDULER_cancel (sc->call_completion_task_id); |
@@ -383,7 +383,7 @@ oprelease_get_stats (void *cls) | |||
383 | GNUNET_free_non_null (sc->subsystem); | 383 | GNUNET_free_non_null (sc->subsystem); |
384 | GNUNET_free_non_null (sc->name); | 384 | GNUNET_free_non_null (sc->name); |
385 | GNUNET_free (sc); | 385 | GNUNET_free (sc); |
386 | if (GNUNET_YES == | 386 | if (GNUNET_YES == |
387 | GNUNET_TESTBED_operation_queue_destroy_empty_ (no_wait_queue)) | 387 | GNUNET_TESTBED_operation_queue_destroy_empty_ (no_wait_queue)) |
388 | no_wait_queue = NULL; | 388 | no_wait_queue = NULL; |
389 | } | 389 | } |
@@ -415,7 +415,7 @@ GNUNET_TESTBED_get_statistics (unsigned int num_peers, | |||
415 | GNUNET_assert (NULL != proc); | 415 | GNUNET_assert (NULL != proc); |
416 | GNUNET_assert (NULL != cont); | 416 | GNUNET_assert (NULL != cont); |
417 | if (NULL == no_wait_queue) | 417 | if (NULL == no_wait_queue) |
418 | no_wait_queue = GNUNET_TESTBED_operation_queue_create_ | 418 | no_wait_queue = GNUNET_TESTBED_operation_queue_create_ |
419 | (OPERATION_QUEUE_TYPE_FIXED, UINT_MAX); | 419 | (OPERATION_QUEUE_TYPE_FIXED, UINT_MAX); |
420 | sc = GNUNET_malloc (sizeof (struct GetStatsContext)); | 420 | sc = GNUNET_malloc (sizeof (struct GetStatsContext)); |
421 | sc->peers = peers; | 421 | sc->peers = peers; |
diff --git a/src/testbed/testbed_api_testbed.c b/src/testbed/testbed_api_testbed.c index 2f5fc70e8..2d420c3e3 100644 --- a/src/testbed/testbed_api_testbed.c +++ b/src/testbed/testbed_api_testbed.c | |||
@@ -338,7 +338,7 @@ struct GNUNET_TESTBED_RunHandle | |||
338 | */ | 338 | */ |
339 | static uint32_t | 339 | static uint32_t |
340 | rcop_key (void *rcop) | 340 | rcop_key (void *rcop) |
341 | { | 341 | { |
342 | return * ((uint32_t *) &rcop); | 342 | return * ((uint32_t *) &rcop); |
343 | } | 343 | } |
344 | 344 | ||
@@ -397,10 +397,10 @@ static struct RunContextOperation * | |||
397 | search_rcop (struct GNUNET_TESTBED_RunHandle *rc, struct GNUNET_TESTBED_Operation *op) | 397 | search_rcop (struct GNUNET_TESTBED_RunHandle *rc, struct GNUNET_TESTBED_Operation *op) |
398 | { | 398 | { |
399 | struct SearchContext sc; | 399 | struct SearchContext sc; |
400 | 400 | ||
401 | sc.query = op; | 401 | sc.query = op; |
402 | sc.result = NULL; | 402 | sc.result = NULL; |
403 | if (GNUNET_SYSERR == | 403 | if (GNUNET_SYSERR == |
404 | GNUNET_CONTAINER_multihashmap32_get_multiple (rc->rcop_map, | 404 | GNUNET_CONTAINER_multihashmap32_get_multiple (rc->rcop_map, |
405 | rcop_key (op), | 405 | rcop_key (op), |
406 | &search_iterator, | 406 | &search_iterator, |
@@ -481,7 +481,7 @@ cleanup (void *cls) | |||
481 | 481 | ||
482 | 482 | ||
483 | /** | 483 | /** |
484 | * Iterator for cleaning up elements from rcop_map | 484 | * Iterator for cleaning up elements from rcop_map |
485 | * | 485 | * |
486 | * @param cls the RunContext | 486 | * @param cls the RunContext |
487 | * @param key the 32-bit key | 487 | * @param key the 32-bit key |
@@ -546,7 +546,7 @@ rc_cleanup_operations (struct GNUNET_TESTBED_RunHandle *rc) | |||
546 | rc->topology_operation = NULL; | 546 | rc->topology_operation = NULL; |
547 | } | 547 | } |
548 | /* cancel any exiting operations */ | 548 | /* cancel any exiting operations */ |
549 | GNUNET_assert (GNUNET_SYSERR != | 549 | GNUNET_assert (GNUNET_SYSERR != |
550 | GNUNET_CONTAINER_multihashmap32_iterate (rc->rcop_map, | 550 | GNUNET_CONTAINER_multihashmap32_iterate (rc->rcop_map, |
551 | &rcop_cleanup_iterator, | 551 | &rcop_cleanup_iterator, |
552 | rc)); | 552 | rc)); |
@@ -568,7 +568,7 @@ cancel_interrupt_task (struct GNUNET_TESTBED_RunHandle *rc) | |||
568 | 568 | ||
569 | /** | 569 | /** |
570 | * This callback will be called when all the operations are completed | 570 | * This callback will be called when all the operations are completed |
571 | * (done/cancelled) | 571 | * (done/cancelled) |
572 | * | 572 | * |
573 | * @param cls run context | 573 | * @param cls run context |
574 | */ | 574 | */ |
@@ -624,9 +624,9 @@ interrupt (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
624 | /* reschedule */ | 624 | /* reschedule */ |
625 | rc->interrupt_task = GNUNET_SCHEDULER_add_delayed | 625 | rc->interrupt_task = GNUNET_SCHEDULER_add_delayed |
626 | (GNUNET_TIME_UNIT_FOREVER_REL, &interrupt, rc); | 626 | (GNUNET_TIME_UNIT_FOREVER_REL, &interrupt, rc); |
627 | rc_cleanup_operations (rc); | 627 | rc_cleanup_operations (rc); |
628 | if ( (GNUNET_NO == rc->shutdown) | 628 | if ( (GNUNET_NO == rc->shutdown) |
629 | && (NULL != c) | 629 | && (NULL != c) |
630 | && (0 != (size = GNUNET_CONTAINER_multihashmap32_size (c->opc_map)))) | 630 | && (0 != (size = GNUNET_CONTAINER_multihashmap32_size (c->opc_map)))) |
631 | { | 631 | { |
632 | LOG (GNUNET_ERROR_TYPE_WARNING, "Shutdown postponed as there are " | 632 | LOG (GNUNET_ERROR_TYPE_WARNING, "Shutdown postponed as there are " |
@@ -917,7 +917,7 @@ call_cc: | |||
917 | { | 917 | { |
918 | unsigned long long number; | 918 | unsigned long long number; |
919 | unsigned int cap; | 919 | unsigned int cap; |
920 | GNUNET_assert (GNUNET_OK == | 920 | GNUNET_assert (GNUNET_OK == |
921 | GNUNET_CONFIGURATION_get_value_number (rc->cfg, TESTBED_CONFIG_SECTION, | 921 | GNUNET_CONFIGURATION_get_value_number (rc->cfg, TESTBED_CONFIG_SECTION, |
922 | SCALE_FREE_CAP, | 922 | SCALE_FREE_CAP, |
923 | &number)); | 923 | &number)); |
@@ -1199,7 +1199,7 @@ static void | |||
1199 | timeout_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 1199 | timeout_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
1200 | { | 1200 | { |
1201 | struct GNUNET_TESTBED_RunHandle *rc = cls; | 1201 | struct GNUNET_TESTBED_RunHandle *rc = cls; |
1202 | 1202 | ||
1203 | rc->timeout_task = GNUNET_SCHEDULER_NO_TASK; | 1203 | rc->timeout_task = GNUNET_SCHEDULER_NO_TASK; |
1204 | LOG (GNUNET_ERROR_TYPE_ERROR, _("Shutting down testbed due to timeout while setup.\n")); | 1204 | LOG (GNUNET_ERROR_TYPE_ERROR, _("Shutting down testbed due to timeout while setup.\n")); |
1205 | GNUNET_SCHEDULER_shutdown (); | 1205 | GNUNET_SCHEDULER_shutdown (); |
@@ -1246,7 +1246,7 @@ GNUNET_TESTBED_run (const char *host_filename, | |||
1246 | { | 1246 | { |
1247 | struct GNUNET_TESTBED_RunHandle *rc; | 1247 | struct GNUNET_TESTBED_RunHandle *rc; |
1248 | char *topology; | 1248 | char *topology; |
1249 | struct CompatibilityCheckContext *hc; | 1249 | struct CompatibilityCheckContext *hc; |
1250 | struct GNUNET_TIME_Relative timeout; | 1250 | struct GNUNET_TIME_Relative timeout; |
1251 | unsigned long long number; | 1251 | unsigned long long number; |
1252 | unsigned int hid; | 1252 | unsigned int hid; |
diff --git a/src/testbed/testbed_api_topology.c b/src/testbed/testbed_api_topology.c index d506ee7e3..b1b96ed56 100644 --- a/src/testbed/testbed_api_topology.c +++ b/src/testbed/testbed_api_topology.c | |||
@@ -89,7 +89,7 @@ struct RetryListEntry | |||
89 | * the prev pointer for the DLL | 89 | * the prev pointer for the DLL |
90 | */ | 90 | */ |
91 | struct RetryListEntry *prev; | 91 | struct RetryListEntry *prev; |
92 | 92 | ||
93 | /** | 93 | /** |
94 | * The link to be retired | 94 | * The link to be retired |
95 | */ | 95 | */ |
@@ -136,7 +136,7 @@ struct TopologyContext | |||
136 | * DLL tail for retry list | 136 | * DLL tail for retry list |
137 | */ | 137 | */ |
138 | struct RetryListEntry *rl_tail; | 138 | struct RetryListEntry *rl_tail; |
139 | 139 | ||
140 | /** | 140 | /** |
141 | * The number of peers | 141 | * The number of peers |
142 | */ | 142 | */ |
@@ -292,7 +292,7 @@ overlay_link_completed (void *cls, struct GNUNET_TESTBED_Operation *op, | |||
292 | tc->nlinks = 0; | 292 | tc->nlinks = 0; |
293 | while (NULL != (retry_entry = tc->rl_head)) | 293 | while (NULL != (retry_entry = tc->rl_head)) |
294 | { | 294 | { |
295 | link = retry_entry->link; | 295 | link = retry_entry->link; |
296 | link->op = | 296 | link->op = |
297 | GNUNET_TESTBED_overlay_connect (tc->op_cls, &overlay_link_completed, | 297 | GNUNET_TESTBED_overlay_connect (tc->op_cls, &overlay_link_completed, |
298 | link, tc->peers[link->A], | 298 | link, tc->peers[link->A], |
@@ -609,7 +609,7 @@ gen_scale_free (struct TopologyContext *tc, uint16_t cap, uint8_t m) | |||
609 | unsigned int redo_threshold; | 609 | unsigned int redo_threshold; |
610 | 610 | ||
611 | links = 0; | 611 | links = 0; |
612 | etaboff = 0; | 612 | etaboff = 0; |
613 | tc->link_array_size = tc->num_peers * m; | 613 | tc->link_array_size = tc->num_peers * m; |
614 | tc->link_array = GNUNET_malloc_large (sizeof (struct OverlayLink) * | 614 | tc->link_array = GNUNET_malloc_large (sizeof (struct OverlayLink) * |
615 | tc->link_array_size); | 615 | tc->link_array_size); |
@@ -657,7 +657,7 @@ gen_scale_free (struct TopologyContext *tc, uint16_t cap, uint8_t m) | |||
657 | goto redo; | 657 | goto redo; |
658 | make_link (&tc->link_array[links + cnt], random_peer, peer, tc); | 658 | make_link (&tc->link_array[links + cnt], random_peer, peer, tc); |
659 | deg[random_peer]++; | 659 | deg[random_peer]++; |
660 | deg[peer]++; | 660 | deg[peer]++; |
661 | used[cnt] = random_peer; | 661 | used[cnt] = random_peer; |
662 | } | 662 | } |
663 | for (cnt = 0; cnt < GNUNET_MIN (peer, m); cnt++) | 663 | for (cnt = 0; cnt < GNUNET_MIN (peer, m); cnt++) |
@@ -672,7 +672,7 @@ gen_scale_free (struct TopologyContext *tc, uint16_t cap, uint8_t m) | |||
672 | GNUNET_free (deg); | 672 | GNUNET_free (deg); |
673 | GNUNET_assert (links <= tc->link_array_size); | 673 | GNUNET_assert (links <= tc->link_array_size); |
674 | tc->link_array_size = links; | 674 | tc->link_array_size = links; |
675 | tc->link_array = | 675 | tc->link_array = |
676 | GNUNET_realloc (tc->link_array, | 676 | GNUNET_realloc (tc->link_array, |
677 | sizeof (struct OverlayLink) * tc->link_array_size); | 677 | sizeof (struct OverlayLink) * tc->link_array_size); |
678 | } | 678 | } |
@@ -982,7 +982,7 @@ GNUNET_TESTBED_overlay_configure_topology_va (void *op_cls, | |||
982 | { | 982 | { |
983 | uint16_t cap; | 983 | uint16_t cap; |
984 | uint8_t m; | 984 | uint8_t m; |
985 | 985 | ||
986 | cap = (uint16_t) va_arg (va, unsigned int); | 986 | cap = (uint16_t) va_arg (va, unsigned int); |
987 | m = (uint8_t) va_arg (va, unsigned int); | 987 | m = (uint8_t) va_arg (va, unsigned int); |
988 | gen_scale_free (tc, cap, m); | 988 | gen_scale_free (tc, cap, m); |
@@ -1074,7 +1074,7 @@ GNUNET_TESTBED_overlay_configure_topology (void *op_cls, | |||
1074 | GNUNET_assert (topo < GNUNET_TESTBED_TOPOLOGY_OPTION_END); | 1074 | GNUNET_assert (topo < GNUNET_TESTBED_TOPOLOGY_OPTION_END); |
1075 | va_start (vargs, topo); | 1075 | va_start (vargs, topo); |
1076 | op = GNUNET_TESTBED_overlay_configure_topology_va (op_cls, num_peers, peers, | 1076 | op = GNUNET_TESTBED_overlay_configure_topology_va (op_cls, num_peers, peers, |
1077 | max_connections, | 1077 | max_connections, |
1078 | comp_cb, comp_cb_cls, | 1078 | comp_cb, comp_cb_cls, |
1079 | topo, | 1079 | topo, |
1080 | vargs); | 1080 | vargs); |
diff --git a/src/testbed/testbed_logger_api.c b/src/testbed/testbed_logger_api.c index c520b1062..562902218 100644 --- a/src/testbed/testbed_logger_api.c +++ b/src/testbed/testbed_logger_api.c | |||
@@ -21,7 +21,7 @@ | |||
21 | /** | 21 | /** |
22 | * @file testbed/testbed_logger_api.c | 22 | * @file testbed/testbed_logger_api.c |
23 | * @brief Client-side routines for communicating with the tesbted logger service | 23 | * @brief Client-side routines for communicating with the tesbted logger service |
24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> | 24 | * @author Sree Harsha Totakura <sreeharsha@totakura.in> |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "platform.h" | 27 | #include "platform.h" |
@@ -158,7 +158,7 @@ static void | |||
158 | cancel_timeout_flush (struct GNUNET_TESTBED_LOGGER_Handle *h) | 158 | cancel_timeout_flush (struct GNUNET_TESTBED_LOGGER_Handle *h) |
159 | { | 159 | { |
160 | GNUNET_SCHEDULER_cancel (h->timeout_flush_task); | 160 | GNUNET_SCHEDULER_cancel (h->timeout_flush_task); |
161 | h->timeout_flush_task = GNUNET_SCHEDULER_NO_TASK; | 161 | h->timeout_flush_task = GNUNET_SCHEDULER_NO_TASK; |
162 | } | 162 | } |
163 | 163 | ||
164 | 164 | ||
@@ -310,7 +310,7 @@ dispatch_buffer (struct GNUNET_TESTBED_LOGGER_Handle *h) | |||
310 | msg = GNUNET_realloc (h->buf, msize); | 310 | msg = GNUNET_realloc (h->buf, msize); |
311 | h->buf = NULL; | 311 | h->buf = NULL; |
312 | memmove (&msg[1], msg, h->bs); | 312 | memmove (&msg[1], msg, h->bs); |
313 | h->bs = 0; | 313 | h->bs = 0; |
314 | msg->type = htons (GNUNET_MESSAGE_TYPE_TESTBED_LOGGER_MSG); | 314 | msg->type = htons (GNUNET_MESSAGE_TYPE_TESTBED_LOGGER_MSG); |
315 | msg->size = htons (msize); | 315 | msg->size = htons (msize); |
316 | queue_message (h, msg); | 316 | queue_message (h, msg); |
@@ -329,7 +329,7 @@ GNUNET_TESTBED_LOGGER_connect (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
329 | { | 329 | { |
330 | struct GNUNET_TESTBED_LOGGER_Handle *h; | 330 | struct GNUNET_TESTBED_LOGGER_Handle *h; |
331 | struct GNUNET_CLIENT_Connection *client; | 331 | struct GNUNET_CLIENT_Connection *client; |
332 | 332 | ||
333 | client = GNUNET_CLIENT_connect ("testbed-logger", cfg); | 333 | client = GNUNET_CLIENT_connect ("testbed-logger", cfg); |
334 | if (NULL == client) | 334 | if (NULL == client) |
335 | return NULL; | 335 | return NULL; |
@@ -374,7 +374,7 @@ GNUNET_TESTBED_LOGGER_disconnect (struct GNUNET_TESTBED_LOGGER_Handle *h) | |||
374 | void | 374 | void |
375 | GNUNET_TESTBED_LOGGER_write (struct GNUNET_TESTBED_LOGGER_Handle *h, | 375 | GNUNET_TESTBED_LOGGER_write (struct GNUNET_TESTBED_LOGGER_Handle *h, |
376 | const void *data, size_t size) | 376 | const void *data, size_t size) |
377 | { | 377 | { |
378 | size_t fit_size; | 378 | size_t fit_size; |
379 | 379 | ||
380 | GNUNET_assert (0 != size); | 380 | GNUNET_assert (0 != size); |
@@ -445,7 +445,7 @@ GNUNET_TESTBED_LOGGER_flush (struct GNUNET_TESTBED_LOGGER_Handle *h, | |||
445 | h->cb = cb; | 445 | h->cb = cb; |
446 | h->cb_cls = cb_cls; | 446 | h->cb_cls = cb_cls; |
447 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->timeout_flush_task); | 447 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == h->timeout_flush_task); |
448 | h->timeout_flush_task = | 448 | h->timeout_flush_task = |
449 | GNUNET_SCHEDULER_add_delayed (timeout, &timeout_flush, h); | 449 | GNUNET_SCHEDULER_add_delayed (timeout, &timeout_flush, h); |
450 | if (NULL == h->buf) | 450 | if (NULL == h->buf) |
451 | { | 451 | { |