diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-16 16:03:20 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-16 16:03:20 +0000 |
commit | 16a6919a9f98ee9fa1fee9dd262906c321004a19 (patch) | |
tree | e09d4fe5191dc329b3e1b667f2914f8313bcba59 /src | |
parent | 4d7904c62bb867c44e90b8e9f7cdbb4b283abc44 (diff) | |
download | gnunet-16a6919a9f98ee9fa1fee9dd262906c321004a19.tar.gz gnunet-16a6919a9f98ee9fa1fee9dd262906c321004a19.zip |
even nicer indentation, thanks to LRN's indent patch
Diffstat (limited to 'src')
195 files changed, 4155 insertions, 4235 deletions
diff --git a/src/arm/gnunet-arm.c b/src/arm/gnunet-arm.c index cf5e1592a..7e108cb41 100644 --- a/src/arm/gnunet-arm.c +++ b/src/arm/gnunet-arm.c | |||
@@ -138,7 +138,8 @@ static struct GNUNET_TIME_Relative timeout; | |||
138 | * @param cls closure, unused | 138 | * @param cls closure, unused |
139 | * @param tc context, unused | 139 | * @param tc context, unused |
140 | */ | 140 | */ |
141 | static void cps_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 141 | static void |
142 | cps_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
142 | 143 | ||
143 | 144 | ||
144 | /** | 145 | /** |
@@ -305,9 +306,8 @@ cps_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
305 | { | 306 | { |
306 | GNUNET_ARM_stop_service (h, "arm", | 307 | GNUNET_ARM_stop_service (h, "arm", |
307 | (0 == | 308 | (0 == |
308 | timeout. | 309 | timeout.rel_value) ? STOP_TIMEOUT_ARM : |
309 | rel_value) ? STOP_TIMEOUT_ARM : timeout, | 310 | timeout, &confirm_cb, "arm"); |
310 | &confirm_cb, "arm"); | ||
311 | return; | 311 | return; |
312 | } | 312 | } |
313 | break; | 313 | break; |
@@ -336,9 +336,8 @@ cps_loop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
336 | { | 336 | { |
337 | GNUNET_CLIENT_service_test (test, cfg, | 337 | GNUNET_CLIENT_service_test (test, cfg, |
338 | (0 == | 338 | (0 == |
339 | timeout. | 339 | timeout.rel_value) ? TEST_TIMEOUT : |
340 | rel_value) ? TEST_TIMEOUT : timeout, | 340 | timeout, &confirm_task, test); |
341 | &confirm_task, test); | ||
342 | return; | 341 | return; |
343 | } | 342 | } |
344 | break; | 343 | break; |
diff --git a/src/arm/gnunet-service-arm.c b/src/arm/gnunet-service-arm.c index ddccb7fa0..e85b2eb12 100644 --- a/src/arm/gnunet-service-arm.c +++ b/src/arm/gnunet-service-arm.c | |||
@@ -722,8 +722,8 @@ delayed_restart_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
722 | { | 722 | { |
723 | lowestRestartDelay = | 723 | lowestRestartDelay = |
724 | GNUNET_TIME_relative_min (lowestRestartDelay, | 724 | GNUNET_TIME_relative_min (lowestRestartDelay, |
725 | GNUNET_TIME_absolute_get_remaining (pos-> | 725 | GNUNET_TIME_absolute_get_remaining |
726 | restartAt)); | 726 | (pos->restartAt)); |
727 | } | 727 | } |
728 | } | 728 | } |
729 | pos = pos->next; | 729 | pos = pos->next; |
diff --git a/src/arm/gnunet-service-arm.h b/src/arm/gnunet-service-arm.h index bdb5d2c93..e8d125b92 100644 --- a/src/arm/gnunet-service-arm.h +++ b/src/arm/gnunet-service-arm.h | |||
@@ -35,8 +35,9 @@ | |||
35 | * @param lsocks -1 terminated list of listen sockets to pass (systemd style), or NULL | 35 | * @param lsocks -1 terminated list of listen sockets to pass (systemd style), or NULL |
36 | * @return GNUNET_OK on success | 36 | * @return GNUNET_OK on success |
37 | */ | 37 | */ |
38 | int start_service (struct GNUNET_SERVER_Client *client, const char *servicename, | 38 | int |
39 | const int *lsocks); | 39 | start_service (struct GNUNET_SERVER_Client *client, const char *servicename, |
40 | const int *lsocks); | ||
40 | 41 | ||
41 | /** | 42 | /** |
42 | * Stop listening for connections to a service. | 43 | * Stop listening for connections to a service. |
@@ -45,9 +46,10 @@ int start_service (struct GNUNET_SERVER_Client *client, const char *servicename, | |||
45 | * @return GNUNET_OK if we stopped to listen, GNUNET_NO if we were | 46 | * @return GNUNET_OK if we stopped to listen, GNUNET_NO if we were |
46 | * not listening | 47 | * not listening |
47 | */ | 48 | */ |
48 | int stop_listening (const char *serviceName); | 49 | int |
50 | stop_listening (const char *serviceName); | ||
49 | 51 | ||
50 | void prepareServices (const struct GNUNET_CONFIGURATION_Handle | 52 | void |
51 | *configurationHandle); | 53 | prepareServices (const struct GNUNET_CONFIGURATION_Handle *configurationHandle); |
52 | 54 | ||
53 | #endif | 55 | #endif |
diff --git a/src/arm/gnunet-service-arm_interceptor.c b/src/arm/gnunet-service-arm_interceptor.c index 6d417ba37..59f8ac30b 100644 --- a/src/arm/gnunet-service-arm_interceptor.c +++ b/src/arm/gnunet-service-arm_interceptor.c | |||
@@ -356,8 +356,8 @@ closeClientAndServiceSockets (struct ForwardedConnection *fc, int reason) | |||
356 | * @param cls callback data, struct ForwardedConnection for the communication between client and service | 356 | * @param cls callback data, struct ForwardedConnection for the communication between client and service |
357 | * @param tc context | 357 | * @param tc context |
358 | */ | 358 | */ |
359 | static void receiveFromClient (void *cls, | 359 | static void |
360 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 360 | receiveFromClient (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
361 | 361 | ||
362 | 362 | ||
363 | /** | 363 | /** |
@@ -366,15 +366,15 @@ static void receiveFromClient (void *cls, | |||
366 | * @param cls callback data, struct ForwardedConnection for the communication between client and service | 366 | * @param cls callback data, struct ForwardedConnection for the communication between client and service |
367 | * @param tc scheduler context | 367 | * @param tc scheduler context |
368 | */ | 368 | */ |
369 | static void receiveFromService (void *cls, | 369 | static void |
370 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 370 | receiveFromService (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
371 | 371 | ||
372 | 372 | ||
373 | /** | 373 | /** |
374 | * | 374 | * |
375 | */ | 375 | */ |
376 | static void start_forwarding (void *cls, | 376 | static void |
377 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 377 | start_forwarding (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
378 | 378 | ||
379 | 379 | ||
380 | 380 | ||
@@ -497,8 +497,7 @@ receiveFromService (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
497 | GNUNET_a2s (fc->listen_info->service_addr, | 497 | GNUNET_a2s (fc->listen_info->service_addr, |
498 | fc->listen_info->service_addr_len), | 498 | fc->listen_info->service_addr_len), |
499 | (unsigned long long) GNUNET_TIME_relative_min (fc->back_off, | 499 | (unsigned long long) GNUNET_TIME_relative_min (fc->back_off, |
500 | rem). | 500 | rem).rel_value); |
501 | rel_value); | ||
502 | #endif | 501 | #endif |
503 | rem = GNUNET_TIME_absolute_get_remaining (fc->timeout); | 502 | rem = GNUNET_TIME_absolute_get_remaining (fc->timeout); |
504 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == fc->start_task); | 503 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == fc->start_task); |
@@ -584,8 +583,7 @@ forwardToService (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
584 | GNUNET_a2s (fc->listen_info->service_addr, | 583 | GNUNET_a2s (fc->listen_info->service_addr, |
585 | fc->listen_info->service_addr_len), | 584 | fc->listen_info->service_addr_len), |
586 | (unsigned long long) GNUNET_TIME_relative_min (fc->back_off, | 585 | (unsigned long long) GNUNET_TIME_relative_min (fc->back_off, |
587 | rem). | 586 | rem).rel_value); |
588 | rel_value); | ||
589 | #endif | 587 | #endif |
590 | rem = GNUNET_TIME_absolute_get_remaining (fc->timeout); | 588 | rem = GNUNET_TIME_absolute_get_remaining (fc->timeout); |
591 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == fc->start_task); | 589 | GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == fc->start_task); |
@@ -913,8 +911,8 @@ stop_listening (const char *serviceName) | |||
913 | * @param cls callback data, struct ServiceListeningInfo describing a listen socket | 911 | * @param cls callback data, struct ServiceListeningInfo describing a listen socket |
914 | * @param tc context | 912 | * @param tc context |
915 | */ | 913 | */ |
916 | static void acceptConnection (void *cls, | 914 | static void |
917 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 915 | acceptConnection (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
918 | 916 | ||
919 | 917 | ||
920 | static void | 918 | static void |
@@ -948,8 +946,8 @@ accept_and_forward (struct ServiceListeningInfo *serviceListeningInfo) | |||
948 | return; | 946 | return; |
949 | } | 947 | } |
950 | GNUNET_break (GNUNET_OK == | 948 | GNUNET_break (GNUNET_OK == |
951 | GNUNET_NETWORK_socket_close (serviceListeningInfo-> | 949 | GNUNET_NETWORK_socket_close |
952 | listeningSocket)); | 950 | (serviceListeningInfo->listeningSocket)); |
953 | start_service (NULL, serviceListeningInfo->serviceName, NULL); | 951 | start_service (NULL, serviceListeningInfo->serviceName, NULL); |
954 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Service `%s' started\n"), | 952 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Service `%s' started\n"), |
955 | fc->listen_info->serviceName); | 953 | fc->listen_info->serviceName); |
diff --git a/src/arm/test_exponential_backoff.c b/src/arm/test_exponential_backoff.c index 04c52d0eb..3b68039b1 100644 --- a/src/arm/test_exponential_backoff.c +++ b/src/arm/test_exponential_backoff.c | |||
@@ -251,8 +251,8 @@ arm_notify_stop (void *cls, int success) | |||
251 | } | 251 | } |
252 | 252 | ||
253 | 253 | ||
254 | static void kill_task (void *cbData, | 254 | static void |
255 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 255 | kill_task (void *cbData, const struct GNUNET_SCHEDULER_TaskContext *tc); |
256 | 256 | ||
257 | 257 | ||
258 | static void | 258 | static void |
@@ -273,8 +273,8 @@ arm_notify (void *cls, int success) | |||
273 | } | 273 | } |
274 | 274 | ||
275 | 275 | ||
276 | static void kill_task (void *cbData, | 276 | static void |
277 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 277 | kill_task (void *cbData, const struct GNUNET_SCHEDULER_TaskContext *tc); |
278 | 278 | ||
279 | 279 | ||
280 | static void | 280 | static void |
diff --git a/src/chat/chat.c b/src/chat/chat.c index 74dde678c..fb47b6c15 100644 --- a/src/chat/chat.c +++ b/src/chat/chat.c | |||
@@ -148,7 +148,8 @@ struct GNUNET_CHAT_SendReceiptContext | |||
148 | /** | 148 | /** |
149 | * Ask client to send a join request. | 149 | * Ask client to send a join request. |
150 | */ | 150 | */ |
151 | static int rejoin_room (struct GNUNET_CHAT_Room *chat_room); | 151 | static int |
152 | rejoin_room (struct GNUNET_CHAT_Room *chat_room); | ||
152 | 153 | ||
153 | 154 | ||
154 | /** | 155 | /** |
@@ -404,9 +405,8 @@ process_result (struct GNUNET_CHAT_Room *room, | |||
404 | if (NULL != room->confirmation_callback) | 405 | if (NULL != room->confirmation_callback) |
405 | room->confirmation_callback (room->confirmation_cls, room, | 406 | room->confirmation_callback (room->confirmation_cls, room, |
406 | ntohl (receipt->sequence_number), | 407 | ntohl (receipt->sequence_number), |
407 | GNUNET_TIME_absolute_ntoh (receipt-> | 408 | GNUNET_TIME_absolute_ntoh |
408 | timestamp), | 409 | (receipt->timestamp), &receipt->target); |
409 | &receipt->target); | ||
410 | break; | 410 | break; |
411 | default: | 411 | default: |
412 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Unknown message type: '%u'\n"), | 412 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, _("Unknown message type: '%u'\n"), |
diff --git a/src/chat/gnunet-chat.c b/src/chat/gnunet-chat.c index c656d1cad..53884a299 100644 --- a/src/chat/gnunet-chat.c +++ b/src/chat/gnunet-chat.c | |||
@@ -76,7 +76,8 @@ free_user_list () | |||
76 | } | 76 | } |
77 | } | 77 | } |
78 | 78 | ||
79 | static int do_help (const char *args, const void *xtra); | 79 | static int |
80 | do_help (const char *args, const void *xtra); | ||
80 | 81 | ||
81 | 82 | ||
82 | /** | 83 | /** |
diff --git a/src/core/core_api.c b/src/core/core_api.c index 5ec48d68c..27754010a 100644 --- a/src/core/core_api.c +++ b/src/core/core_api.c | |||
@@ -371,7 +371,8 @@ struct GNUNET_CORE_TransmitHandle | |||
371 | * | 371 | * |
372 | * @param h our handle to the core service | 372 | * @param h our handle to the core service |
373 | */ | 373 | */ |
374 | static void reconnect (struct GNUNET_CORE_Handle *h); | 374 | static void |
375 | reconnect (struct GNUNET_CORE_Handle *h); | ||
375 | 376 | ||
376 | 377 | ||
377 | /** | 378 | /** |
@@ -515,8 +516,8 @@ reconnect_later (struct GNUNET_CORE_Handle *h) | |||
515 | * @param h core handle | 516 | * @param h core handle |
516 | * @param ignore_currently_down transmit message even if not initialized? | 517 | * @param ignore_currently_down transmit message even if not initialized? |
517 | */ | 518 | */ |
518 | static void trigger_next_request (struct GNUNET_CORE_Handle *h, | 519 | static void |
519 | int ignore_currently_down); | 520 | trigger_next_request (struct GNUNET_CORE_Handle *h, int ignore_currently_down); |
520 | 521 | ||
521 | 522 | ||
522 | /** | 523 | /** |
@@ -526,9 +527,8 @@ static void trigger_next_request (struct GNUNET_CORE_Handle *h, | |||
526 | * @param cls the transmit handle of the request that timed out | 527 | * @param cls the transmit handle of the request that timed out |
527 | * @param tc context, can be NULL (!) | 528 | * @param tc context, can be NULL (!) |
528 | */ | 529 | */ |
529 | static void transmission_timeout (void *cls, | 530 | static void |
530 | const struct GNUNET_SCHEDULER_TaskContext | 531 | transmission_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
531 | *tc); | ||
532 | 532 | ||
533 | 533 | ||
534 | /** | 534 | /** |
@@ -776,8 +776,8 @@ trigger_next_request (struct GNUNET_CORE_Handle *h, int ignore_currently_down) | |||
776 | } | 776 | } |
777 | if (h->control_pending_head != NULL) | 777 | if (h->control_pending_head != NULL) |
778 | msize = | 778 | msize = |
779 | ntohs (((struct GNUNET_MessageHeader *) &h->control_pending_head[1])-> | 779 | ntohs (((struct GNUNET_MessageHeader *) &h-> |
780 | size); | 780 | control_pending_head[1])->size); |
781 | else if (h->ready_peer_head != NULL) | 781 | else if (h->ready_peer_head != NULL) |
782 | msize = | 782 | msize = |
783 | h->ready_peer_head->pending_head->msize + sizeof (struct SendMessage); | 783 | h->ready_peer_head->pending_head->msize + sizeof (struct SendMessage); |
diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c index e97e9fe46..7385991a2 100644 --- a/src/core/gnunet-service-core.c +++ b/src/core/gnunet-service-core.c | |||
@@ -1807,7 +1807,8 @@ free_neighbour (struct Neighbour *n) | |||
1807 | * | 1807 | * |
1808 | * @param n neighbour to check. | 1808 | * @param n neighbour to check. |
1809 | */ | 1809 | */ |
1810 | static void process_encrypted_neighbour_queue (struct Neighbour *n); | 1810 | static void |
1811 | process_encrypted_neighbour_queue (struct Neighbour *n); | ||
1811 | 1812 | ||
1812 | 1813 | ||
1813 | /** | 1814 | /** |
@@ -1854,7 +1855,8 @@ do_encrypt (struct Neighbour *n, | |||
1854 | * | 1855 | * |
1855 | * @param n neighbour to consider discarding | 1856 | * @param n neighbour to consider discarding |
1856 | */ | 1857 | */ |
1857 | static void consider_free_neighbour (struct Neighbour *n); | 1858 | static void |
1859 | consider_free_neighbour (struct Neighbour *n); | ||
1858 | 1860 | ||
1859 | 1861 | ||
1860 | /** | 1862 | /** |
@@ -2006,9 +2008,9 @@ notify_encrypted_transmit_ready (void *cls, size_t size, void *buf) | |||
2006 | #if DEBUG_CORE | 2008 | #if DEBUG_CORE |
2007 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2009 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2008 | "Copied message of type %u and size %u into transport buffer for `%4s'\n", | 2010 | "Copied message of type %u and size %u into transport buffer for `%4s'\n", |
2009 | (unsigned int) ntohs (((struct GNUNET_MessageHeader *) &m[1])-> | 2011 | (unsigned int) |
2010 | type), (unsigned int) ret, | 2012 | ntohs (((struct GNUNET_MessageHeader *) &m[1])->type), |
2011 | GNUNET_i2s (&n->peer)); | 2013 | (unsigned int) ret, GNUNET_i2s (&n->peer)); |
2012 | #endif | 2014 | #endif |
2013 | process_encrypted_neighbour_queue (n); | 2015 | process_encrypted_neighbour_queue (n); |
2014 | } | 2016 | } |
@@ -2017,8 +2019,9 @@ notify_encrypted_transmit_ready (void *cls, size_t size, void *buf) | |||
2017 | #if DEBUG_CORE | 2019 | #if DEBUG_CORE |
2018 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2020 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2019 | "Transmission of message of type %u and size %u failed\n", | 2021 | "Transmission of message of type %u and size %u failed\n", |
2020 | (unsigned int) ntohs (((struct GNUNET_MessageHeader *) &m[1])-> | 2022 | (unsigned int) |
2021 | type), (unsigned int) m->size); | 2023 | ntohs (((struct GNUNET_MessageHeader *) &m[1])->type), |
2024 | (unsigned int) m->size); | ||
2022 | #endif | 2025 | #endif |
2023 | } | 2026 | } |
2024 | GNUNET_free (m); | 2027 | GNUNET_free (m); |
@@ -2038,7 +2041,8 @@ notify_encrypted_transmit_ready (void *cls, size_t size, void *buf) | |||
2038 | * | 2041 | * |
2039 | * @param n neighbour to check. | 2042 | * @param n neighbour to check. |
2040 | */ | 2043 | */ |
2041 | static void process_plaintext_neighbour_queue (struct Neighbour *n); | 2044 | static void |
2045 | process_plaintext_neighbour_queue (struct Neighbour *n); | ||
2042 | 2046 | ||
2043 | 2047 | ||
2044 | /** | 2048 | /** |
@@ -2071,9 +2075,8 @@ process_encrypted_neighbour_queue (struct Neighbour *n) | |||
2071 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2075 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2072 | "Asking transport for transmission of %u bytes to `%4s' in next %llu ms\n", | 2076 | "Asking transport for transmission of %u bytes to `%4s' in next %llu ms\n", |
2073 | (unsigned int) m->size, GNUNET_i2s (&n->peer), | 2077 | (unsigned int) m->size, GNUNET_i2s (&n->peer), |
2074 | (unsigned long long) GNUNET_TIME_absolute_get_remaining (m-> | 2078 | (unsigned long long) |
2075 | deadline). | 2079 | GNUNET_TIME_absolute_get_remaining (m->deadline).rel_value); |
2076 | rel_value); | ||
2077 | #endif | 2080 | #endif |
2078 | n->th = | 2081 | n->th = |
2079 | GNUNET_TRANSPORT_notify_transmit_ready (transport, &n->peer, m->size, | 2082 | GNUNET_TRANSPORT_notify_transmit_ready (transport, &n->peer, m->size, |
@@ -2436,8 +2439,8 @@ batch_message (struct Neighbour *n, char *buf, size_t size, | |||
2436 | (unsigned int) | 2439 | (unsigned int) |
2437 | ntohs (((const struct GNUNET_MessageHeader *) &pos[1])->type), | 2440 | ntohs (((const struct GNUNET_MessageHeader *) &pos[1])->type), |
2438 | (unsigned int) | 2441 | (unsigned int) |
2439 | ntohs (((const struct GNUNET_MessageHeader *) &pos[1])-> | 2442 | ntohs (((const struct GNUNET_MessageHeader *) |
2440 | size)); | 2443 | &pos[1])->size)); |
2441 | #endif | 2444 | #endif |
2442 | /* copy for encrypted transmission */ | 2445 | /* copy for encrypted transmission */ |
2443 | memcpy (&buf[ret], &pos[1], pos->size); | 2446 | memcpy (&buf[ret], &pos[1], pos->size); |
@@ -2448,9 +2451,8 @@ batch_message (struct Neighbour *n, char *buf, size_t size, | |||
2448 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 2451 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
2449 | "Adding plaintext message of size %u with deadline %llu ms to batch\n", | 2452 | "Adding plaintext message of size %u with deadline %llu ms to batch\n", |
2450 | (unsigned int) pos->size, | 2453 | (unsigned int) pos->size, |
2451 | (unsigned long long) GNUNET_TIME_absolute_get_remaining (pos-> | 2454 | (unsigned long long) |
2452 | deadline). | 2455 | GNUNET_TIME_absolute_get_remaining (pos->deadline).rel_value); |
2453 | rel_value); | ||
2454 | #endif | 2456 | #endif |
2455 | deadline->abs_value = | 2457 | deadline->abs_value = |
2456 | GNUNET_MIN (deadline->abs_value, pos->deadline.abs_value); | 2458 | GNUNET_MIN (deadline->abs_value, pos->deadline.abs_value); |
@@ -2548,7 +2550,8 @@ retry_plaintext_processing (void *cls, | |||
2548 | * | 2550 | * |
2549 | * @param n the other peer | 2551 | * @param n the other peer |
2550 | */ | 2552 | */ |
2551 | static void send_key (struct Neighbour *n); | 2553 | static void |
2554 | send_key (struct Neighbour *n); | ||
2552 | 2555 | ||
2553 | /** | 2556 | /** |
2554 | * Task that will retry "send_key" if our previous attempt failed | 2557 | * Task that will retry "send_key" if our previous attempt failed |
@@ -2734,9 +2737,9 @@ process_plaintext_neighbour_queue (struct Neighbour *n) | |||
2734 | * @param cls neighbour for the quota update | 2737 | * @param cls neighbour for the quota update |
2735 | * @param tc context | 2738 | * @param tc context |
2736 | */ | 2739 | */ |
2737 | static void neighbour_quota_update (void *cls, | 2740 | static void |
2738 | const struct GNUNET_SCHEDULER_TaskContext | 2741 | neighbour_quota_update (void *cls, |
2739 | *tc); | 2742 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
2740 | 2743 | ||
2741 | 2744 | ||
2742 | /** | 2745 | /** |
@@ -3269,9 +3272,9 @@ send_key (struct Neighbour *n) | |||
3269 | #if DEBUG_CORE | 3272 | #if DEBUG_CORE |
3270 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3273 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3271 | "Have %llu ms left for `%s' transmission.\n", | 3274 | "Have %llu ms left for `%s' transmission.\n", |
3272 | (unsigned long long) GNUNET_TIME_absolute_get_remaining (me-> | 3275 | (unsigned long long) |
3273 | deadline). | 3276 | GNUNET_TIME_absolute_get_remaining (me->deadline).rel_value, |
3274 | rel_value, "SET_KEY"); | 3277 | "SET_KEY"); |
3275 | #endif | 3278 | #endif |
3276 | trigger_processing: | 3279 | trigger_processing: |
3277 | /* trigger queue processing */ | 3280 | /* trigger queue processing */ |
@@ -3293,9 +3296,10 @@ trigger_processing: | |||
3293 | * @param ats performance data | 3296 | * @param ats performance data |
3294 | * @param ats_count number of entries in ats (excluding 0-termination) | 3297 | * @param ats_count number of entries in ats (excluding 0-termination) |
3295 | */ | 3298 | */ |
3296 | static void handle_set_key (struct Neighbour *n, const struct SetKeyMessage *m, | 3299 | static void |
3297 | const struct GNUNET_TRANSPORT_ATS_Information *ats, | 3300 | handle_set_key (struct Neighbour *n, const struct SetKeyMessage *m, |
3298 | uint32_t ats_count); | 3301 | const struct GNUNET_TRANSPORT_ATS_Information *ats, |
3302 | uint32_t ats_count); | ||
3299 | 3303 | ||
3300 | 3304 | ||
3301 | 3305 | ||
@@ -3843,8 +3847,8 @@ send_p2p_message_to_client (struct Neighbour *sender, struct Client *client, | |||
3843 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3847 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3844 | "Core service passes message from `%4s' of type %u to client.\n", | 3848 | "Core service passes message from `%4s' of type %u to client.\n", |
3845 | GNUNET_i2s (&sender->peer), | 3849 | GNUNET_i2s (&sender->peer), |
3846 | (unsigned int) ntohs (((const struct GNUNET_MessageHeader *) m)-> | 3850 | (unsigned int) |
3847 | type)); | 3851 | ntohs (((const struct GNUNET_MessageHeader *) m)->type)); |
3848 | #endif | 3852 | #endif |
3849 | ntm = (struct NotifyTrafficMessage *) buf; | 3853 | ntm = (struct NotifyTrafficMessage *) buf; |
3850 | ntm->header.size = htons (size); | 3854 | ntm->header.size = htons (size); |
diff --git a/src/core/test_core_api_preferences.c b/src/core/test_core_api_preferences.c index e5d5deb1b..8bc977df2 100644 --- a/src/core/test_core_api_preferences.c +++ b/src/core/test_core_api_preferences.c | |||
@@ -75,8 +75,8 @@ static GNUNET_SCHEDULER_TaskIdentifier ask_task; | |||
75 | static unsigned int total_reserve = 5; | 75 | static unsigned int total_reserve = 5; |
76 | 76 | ||
77 | 77 | ||
78 | static void process_hello (void *cls, | 78 | static void |
79 | const struct GNUNET_MessageHeader *message); | 79 | process_hello (void *cls, const struct GNUNET_MessageHeader *message); |
80 | 80 | ||
81 | static void | 81 | static void |
82 | terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 82 | terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
@@ -151,11 +151,10 @@ transmit_ready (void *cls, size_t size, void *buf) | |||
151 | return sizeof (struct GNUNET_MessageHeader); | 151 | return sizeof (struct GNUNET_MessageHeader); |
152 | } | 152 | } |
153 | 153 | ||
154 | static void preference_cb (void *cls, const struct GNUNET_PeerIdentity *peer, | 154 | static void |
155 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 155 | preference_cb (void *cls, const struct GNUNET_PeerIdentity *peer, |
156 | int32_t amount, | 156 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, int32_t amount, |
157 | struct GNUNET_TIME_Relative res_delay, | 157 | struct GNUNET_TIME_Relative res_delay, uint64_t preference); |
158 | uint64_t preference); | ||
159 | 158 | ||
160 | static void | 159 | static void |
161 | do_reserve (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 160 | do_reserve (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c index afe6ad269..47d1ae8ac 100644 --- a/src/core/test_core_api_reliability.c +++ b/src/core/test_core_api_reliability.c | |||
@@ -113,8 +113,8 @@ get_size (unsigned int iter) | |||
113 | return sizeof (struct TestMessage) + (ret % 60000); | 113 | return sizeof (struct TestMessage) + (ret % 60000); |
114 | } | 114 | } |
115 | 115 | ||
116 | static void process_hello (void *cls, | 116 | static void |
117 | const struct GNUNET_MessageHeader *message); | 117 | process_hello (void *cls, const struct GNUNET_MessageHeader *message); |
118 | 118 | ||
119 | static void | 119 | static void |
120 | terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 120 | terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
@@ -296,7 +296,8 @@ outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, | |||
296 | } | 296 | } |
297 | 297 | ||
298 | 298 | ||
299 | static size_t transmit_ready (void *cls, size_t size, void *buf); | 299 | static size_t |
300 | transmit_ready (void *cls, size_t size, void *buf); | ||
300 | 301 | ||
301 | static int | 302 | static int |
302 | process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, | 303 | process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, |
diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c index 88ba2c0f2..41d156c6b 100644 --- a/src/core/test_core_quota_compliance.c +++ b/src/core/test_core_quota_compliance.c | |||
@@ -114,8 +114,8 @@ struct TestMessage | |||
114 | uint32_t num; | 114 | uint32_t num; |
115 | }; | 115 | }; |
116 | 116 | ||
117 | static void process_hello (void *cls, | 117 | static void |
118 | const struct GNUNET_MessageHeader *message); | 118 | process_hello (void *cls, const struct GNUNET_MessageHeader *message); |
119 | 119 | ||
120 | static void | 120 | static void |
121 | terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 121 | terminate_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
@@ -424,7 +424,8 @@ outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, | |||
424 | } | 424 | } |
425 | 425 | ||
426 | 426 | ||
427 | static size_t transmit_ready (void *cls, size_t size, void *buf); | 427 | static size_t |
428 | transmit_ready (void *cls, size_t size, void *buf); | ||
428 | 429 | ||
429 | static int | 430 | static int |
430 | process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, | 431 | process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, |
diff --git a/src/datacache/perf_datacache.c b/src/datacache/perf_datacache.c index a5dc02362..131ca4b82 100644 --- a/src/datacache/perf_datacache.c +++ b/src/datacache/perf_datacache.c | |||
@@ -91,8 +91,8 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
91 | } | 91 | } |
92 | fprintf (stderr, "\n"); | 92 | fprintf (stderr, "\n"); |
93 | fprintf (stdout, "Stored %u items in %llums\n", ITERATIONS, | 93 | fprintf (stdout, "Stored %u items in %llums\n", ITERATIONS, |
94 | (unsigned long long) GNUNET_TIME_absolute_get_duration (start). | 94 | (unsigned long long) |
95 | rel_value); | 95 | GNUNET_TIME_absolute_get_duration (start).rel_value); |
96 | GNUNET_snprintf (gstr, sizeof (gstr), "DATACACHE-%s", plugin_name); | 96 | GNUNET_snprintf (gstr, sizeof (gstr), "DATACACHE-%s", plugin_name); |
97 | GAUGER (gstr, "Time to PUT item in datacache", | 97 | GAUGER (gstr, "Time to PUT item in datacache", |
98 | GNUNET_TIME_absolute_get_duration (start).rel_value / ITERATIONS, | 98 | GNUNET_TIME_absolute_get_duration (start).rel_value / ITERATIONS, |
@@ -111,8 +111,9 @@ run (void *cls, char *const *args, const char *cfgfile, | |||
111 | fprintf (stdout, | 111 | fprintf (stdout, |
112 | "Found %u/%u items in %llums (%u were deleted during storage processing)\n", | 112 | "Found %u/%u items in %llums (%u were deleted during storage processing)\n", |
113 | found, ITERATIONS, | 113 | found, ITERATIONS, |
114 | (unsigned long long) GNUNET_TIME_absolute_get_duration (start). | 114 | (unsigned long long) |
115 | rel_value, ITERATIONS - found); | 115 | GNUNET_TIME_absolute_get_duration (start).rel_value, |
116 | ITERATIONS - found); | ||
116 | if (found > 0) | 117 | if (found > 0) |
117 | GAUGER (gstr, "Time to GET item from datacache", | 118 | GAUGER (gstr, "Time to GET item from datacache", |
118 | GNUNET_TIME_absolute_get_duration (start).rel_value / found, | 119 | GNUNET_TIME_absolute_get_duration (start).rel_value / found, |
diff --git a/src/datastore/datastore_api.c b/src/datastore/datastore_api.c index ff49c106e..8a8f64eb3 100644 --- a/src/datastore/datastore_api.c +++ b/src/datastore/datastore_api.c | |||
@@ -480,7 +480,8 @@ make_queue_entry (struct GNUNET_DATASTORE_Handle *h, size_t msize, | |||
480 | * | 480 | * |
481 | * @param h handle to the datastore | 481 | * @param h handle to the datastore |
482 | */ | 482 | */ |
483 | static void process_queue (struct GNUNET_DATASTORE_Handle *h); | 483 | static void |
484 | process_queue (struct GNUNET_DATASTORE_Handle *h); | ||
484 | 485 | ||
485 | 486 | ||
486 | /** | 487 | /** |
diff --git a/src/datastore/gnunet-service-datastore.c b/src/datastore/gnunet-service-datastore.c index 8efb706c1..d6a0b3c81 100644 --- a/src/datastore/gnunet-service-datastore.c +++ b/src/datastore/gnunet-service-datastore.c | |||
@@ -276,8 +276,8 @@ static struct GNUNET_STATISTICS_GetHandle *stat_get; | |||
276 | * @param cls not used | 276 | * @param cls not used |
277 | * @param tc task context | 277 | * @param tc task context |
278 | */ | 278 | */ |
279 | static void delete_expired (void *cls, | 279 | static void |
280 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 280 | delete_expired (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
281 | 281 | ||
282 | 282 | ||
283 | /** | 283 | /** |
diff --git a/src/datastore/perf_datastore_api.c b/src/datastore/perf_datastore_api.c index cf9911329..07df6a691 100644 --- a/src/datastore/perf_datastore_api.c +++ b/src/datastore/perf_datastore_api.c | |||
@@ -104,8 +104,8 @@ struct CpsRunContext | |||
104 | 104 | ||
105 | 105 | ||
106 | 106 | ||
107 | static void run_continuation (void *cls, | 107 | static void |
108 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 108 | run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
109 | 109 | ||
110 | 110 | ||
111 | 111 | ||
diff --git a/src/datastore/perf_plugin_datastore.c b/src/datastore/perf_plugin_datastore.c index 1e2a29f14..36dc84656 100644 --- a/src/datastore/perf_plugin_datastore.c +++ b/src/datastore/perf_plugin_datastore.c | |||
@@ -145,7 +145,8 @@ putValue (struct GNUNET_DATASTORE_PluginFunctions *api, int i, int k) | |||
145 | stored_entries++; | 145 | stored_entries++; |
146 | } | 146 | } |
147 | 147 | ||
148 | static void test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 148 | static void |
149 | test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
149 | 150 | ||
150 | 151 | ||
151 | static int | 152 | static int |
diff --git a/src/datastore/plugin_datastore_mysql.c b/src/datastore/plugin_datastore_mysql.c index 63b065b0c..d6b6d6c62 100644 --- a/src/datastore/plugin_datastore_mysql.c +++ b/src/datastore/plugin_datastore_mysql.c | |||
@@ -1068,12 +1068,12 @@ mysql_plugin_get_key (void *cls, uint64_t offset, const GNUNET_HashCode * key, | |||
1068 | { | 1068 | { |
1069 | ret = | 1069 | ret = |
1070 | prepared_statement_run_select (plugin, | 1070 | prepared_statement_run_select (plugin, |
1071 | plugin->count_entry_by_hash_vhash_and_type, | 1071 | plugin-> |
1072 | 1, cbind, MYSQL_TYPE_BLOB, key, | 1072 | count_entry_by_hash_vhash_and_type, 1, |
1073 | hashSize, &hashSize, MYSQL_TYPE_BLOB, | 1073 | cbind, MYSQL_TYPE_BLOB, key, hashSize, |
1074 | vhash, hashSize2, &hashSize2, | 1074 | &hashSize, MYSQL_TYPE_BLOB, vhash, |
1075 | MYSQL_TYPE_LONG, &type, GNUNET_YES, | 1075 | hashSize2, &hashSize2, MYSQL_TYPE_LONG, |
1076 | -1); | 1076 | &type, GNUNET_YES, -1); |
1077 | } | 1077 | } |
1078 | else | 1078 | else |
1079 | { | 1079 | { |
diff --git a/src/datastore/test_datastore_api.c b/src/datastore/test_datastore_api.c index 3dff4a588..91350f203 100644 --- a/src/datastore/test_datastore_api.c +++ b/src/datastore/test_datastore_api.c | |||
@@ -134,8 +134,8 @@ struct CpsRunContext | |||
134 | }; | 134 | }; |
135 | 135 | ||
136 | 136 | ||
137 | static void run_continuation (void *cls, | 137 | static void |
138 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 138 | run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
139 | 139 | ||
140 | 140 | ||
141 | static void | 141 | static void |
diff --git a/src/datastore/test_datastore_api_management.c b/src/datastore/test_datastore_api_management.c index 230b7eb67..72348e28c 100644 --- a/src/datastore/test_datastore_api_management.c +++ b/src/datastore/test_datastore_api_management.c | |||
@@ -117,8 +117,8 @@ struct CpsRunContext | |||
117 | }; | 117 | }; |
118 | 118 | ||
119 | 119 | ||
120 | static void run_continuation (void *cls, | 120 | static void |
121 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 121 | run_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
122 | 122 | ||
123 | 123 | ||
124 | static void | 124 | static void |
diff --git a/src/datastore/test_plugin_datastore.c b/src/datastore/test_plugin_datastore.c index a34c4e38a..3a924c7b6 100644 --- a/src/datastore/test_plugin_datastore.c +++ b/src/datastore/test_plugin_datastore.c | |||
@@ -141,7 +141,8 @@ put_value (struct GNUNET_DATASTORE_PluginFunctions *api, int i, int k) | |||
141 | } | 141 | } |
142 | 142 | ||
143 | 143 | ||
144 | static void test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 144 | static void |
145 | test (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
145 | 146 | ||
146 | 147 | ||
147 | static uint64_t guid; | 148 | static uint64_t guid; |
diff --git a/src/dht/dht_api.c b/src/dht/dht_api.c index eded50efc..9c378dca1 100644 --- a/src/dht/dht_api.c +++ b/src/dht/dht_api.c | |||
@@ -203,7 +203,8 @@ struct GNUNET_DHT_Handle | |||
203 | /** | 203 | /** |
204 | * Transmit the next pending message, called by notify_transmit_ready | 204 | * Transmit the next pending message, called by notify_transmit_ready |
205 | */ | 205 | */ |
206 | static size_t transmit_pending (void *cls, size_t size, void *buf); | 206 | static size_t |
207 | transmit_pending (void *cls, size_t size, void *buf); | ||
207 | 208 | ||
208 | 209 | ||
209 | /** | 210 | /** |
@@ -211,8 +212,8 @@ static size_t transmit_pending (void *cls, size_t size, void *buf); | |||
211 | * a demultiplexer which handles numerous message types | 212 | * a demultiplexer which handles numerous message types |
212 | * | 213 | * |
213 | */ | 214 | */ |
214 | static void service_message_handler (void *cls, | 215 | static void |
215 | const struct GNUNET_MessageHeader *msg); | 216 | service_message_handler (void *cls, const struct GNUNET_MessageHeader *msg); |
216 | 217 | ||
217 | 218 | ||
218 | 219 | ||
@@ -273,7 +274,8 @@ add_request_to_pending (void *cls, const GNUNET_HashCode * key, void *value) | |||
273 | * Try to send messages from list of messages to send | 274 | * Try to send messages from list of messages to send |
274 | * @param handle DHT_Handle | 275 | * @param handle DHT_Handle |
275 | */ | 276 | */ |
276 | static void process_pending_messages (struct GNUNET_DHT_Handle *handle); | 277 | static void |
278 | process_pending_messages (struct GNUNET_DHT_Handle *handle); | ||
277 | 279 | ||
278 | 280 | ||
279 | /** | 281 | /** |
@@ -760,11 +762,9 @@ GNUNET_DHT_route_stop (struct GNUNET_DHT_RouteHandle *route_handle) | |||
760 | route_handle->message); | 762 | route_handle->message); |
761 | } | 763 | } |
762 | GNUNET_assert (GNUNET_YES == | 764 | GNUNET_assert (GNUNET_YES == |
763 | GNUNET_CONTAINER_multihashmap_remove (route_handle-> | 765 | GNUNET_CONTAINER_multihashmap_remove |
764 | dht_handle-> | 766 | (route_handle->dht_handle->active_requests, &route_handle->key, |
765 | active_requests, | 767 | route_handle)); |
766 | &route_handle->key, | ||
767 | route_handle)); | ||
768 | GNUNET_free (route_handle->message); | 768 | GNUNET_free (route_handle->message); |
769 | GNUNET_free (route_handle); | 769 | GNUNET_free (route_handle); |
770 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "DHT route stop request processed\n"); | 770 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "DHT route stop request processed\n"); |
diff --git a/src/dht/dhtlog.h b/src/dht/dhtlog.h index 476a4039e..cdab36305 100644 --- a/src/dht/dhtlog.h +++ b/src/dht/dhtlog.h | |||
@@ -373,14 +373,14 @@ struct GNUNET_DHTLOG_Plugin | |||
373 | * | 373 | * |
374 | * @param c a configuration to use | 374 | * @param c a configuration to use |
375 | */ | 375 | */ |
376 | struct GNUNET_DHTLOG_Handle *GNUNET_DHTLOG_connect (const struct | 376 | struct GNUNET_DHTLOG_Handle * |
377 | GNUNET_CONFIGURATION_Handle | 377 | GNUNET_DHTLOG_connect (const struct GNUNET_CONFIGURATION_Handle *c); |
378 | *c); | ||
379 | 378 | ||
380 | /** | 379 | /** |
381 | * Shutdown the module. | 380 | * Shutdown the module. |
382 | */ | 381 | */ |
383 | void GNUNET_DHTLOG_disconnect (struct GNUNET_DHTLOG_Handle *api); | 382 | void |
383 | GNUNET_DHTLOG_disconnect (struct GNUNET_DHTLOG_Handle *api); | ||
384 | 384 | ||
385 | 385 | ||
386 | #if 0 /* keep Emacsens' auto-indent happy */ | 386 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/dht/gnunet-dht-driver.c b/src/dht/gnunet-dht-driver.c index d58e49e3b..4f411f4a9 100644 --- a/src/dht/gnunet-dht-driver.c +++ b/src/dht/gnunet-dht-driver.c | |||
@@ -1244,12 +1244,14 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1244 | /** | 1244 | /** |
1245 | * Forward declaration. | 1245 | * Forward declaration. |
1246 | */ | 1246 | */ |
1247 | static void do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 1247 | static void |
1248 | do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
1248 | 1249 | ||
1249 | /** | 1250 | /** |
1250 | * Forward declaration. | 1251 | * Forward declaration. |
1251 | */ | 1252 | */ |
1252 | static void do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 1253 | static void |
1254 | do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
1253 | 1255 | ||
1254 | /** | 1256 | /** |
1255 | * Iterator over hash map entries. | 1257 | * Iterator over hash map entries. |
@@ -1465,8 +1467,8 @@ iterate_min_heap_peers (void *cls, struct GNUNET_CONTAINER_HeapNode *node, | |||
1465 | GNUNET_TESTING_daemons_connect (d1, d2, timeout, DEFAULT_RECONNECT_ATTEMPTS, | 1467 | GNUNET_TESTING_daemons_connect (d1, d2, timeout, DEFAULT_RECONNECT_ATTEMPTS, |
1466 | GNUNET_YES, NULL, NULL); | 1468 | GNUNET_YES, NULL, NULL); |
1467 | } | 1469 | } |
1468 | if (GNUNET_TIME_absolute_get_remaining (find_peer_context->endtime). | 1470 | if (GNUNET_TIME_absolute_get_remaining (find_peer_context->endtime).rel_value |
1469 | rel_value > 0) | 1471 | > 0) |
1470 | return GNUNET_YES; | 1472 | return GNUNET_YES; |
1471 | else | 1473 | else |
1472 | return GNUNET_NO; | 1474 | return GNUNET_NO; |
@@ -1475,10 +1477,10 @@ iterate_min_heap_peers (void *cls, struct GNUNET_CONTAINER_HeapNode *node, | |||
1475 | /** | 1477 | /** |
1476 | * Forward declaration. | 1478 | * Forward declaration. |
1477 | */ | 1479 | */ |
1478 | static void schedule_churn_find_peer_requests (void *cls, | 1480 | static void |
1479 | const struct | 1481 | schedule_churn_find_peer_requests (void *cls, |
1480 | GNUNET_SCHEDULER_TaskContext | 1482 | const struct GNUNET_SCHEDULER_TaskContext |
1481 | *tc); | 1483 | *tc); |
1482 | 1484 | ||
1483 | /** | 1485 | /** |
1484 | * Callback for iterating over all the peer connections of a peer group. | 1486 | * Callback for iterating over all the peer connections of a peer group. |
@@ -1555,12 +1557,11 @@ count_peers_churn_cb (void *cls, const struct GNUNET_PeerIdentity *first, | |||
1555 | */ | 1557 | */ |
1556 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1558 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1557 | "Out of %u peers, fewest connections is %d\n", | 1559 | "Out of %u peers, fewest connections is %d\n", |
1558 | GNUNET_CONTAINER_heap_get_size (find_peer_context-> | 1560 | GNUNET_CONTAINER_heap_get_size |
1559 | peer_min_heap), | 1561 | (find_peer_context->peer_min_heap), peer_count->count); |
1560 | peer_count->count); | ||
1561 | if ((peer_count->count == 0) && | 1562 | if ((peer_count->count == 0) && |
1562 | (GNUNET_TIME_absolute_get_remaining (find_peer_context->endtime). | 1563 | (GNUNET_TIME_absolute_get_remaining |
1563 | rel_value > 0)) | 1564 | (find_peer_context->endtime).rel_value > 0)) |
1564 | { | 1565 | { |
1565 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1566 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1566 | "Found peer with no connections, will choose some peer(s) at random to connect to!\n"); | 1567 | "Found peer with no connections, will choose some peer(s) at random to connect to!\n"); |
@@ -1570,8 +1571,9 @@ count_peers_churn_cb (void *cls, const struct GNUNET_PeerIdentity *first, | |||
1570 | GNUNET_SCHEDULER_add_now (&schedule_churn_find_peer_requests, | 1571 | GNUNET_SCHEDULER_add_now (&schedule_churn_find_peer_requests, |
1571 | find_peer_context); | 1572 | find_peer_context); |
1572 | } | 1573 | } |
1573 | else if ((GNUNET_TIME_absolute_get_remaining (find_peer_context->endtime). | 1574 | else if ((GNUNET_TIME_absolute_get_remaining |
1574 | rel_value > 0) && (find_peer_context->last_sent != 0)) | 1575 | (find_peer_context->endtime).rel_value > 0) && |
1576 | (find_peer_context->last_sent != 0)) | ||
1575 | { | 1577 | { |
1576 | GNUNET_SCHEDULER_add_now (&schedule_churn_find_peer_requests, | 1578 | GNUNET_SCHEDULER_add_now (&schedule_churn_find_peer_requests, |
1577 | find_peer_context); | 1579 | find_peer_context); |
@@ -1772,8 +1774,8 @@ churn_complete (void *cls, const char *emsg) | |||
1772 | } | 1774 | } |
1773 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1775 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1774 | "Added %d peers to heap, total size %d\n", count_added, | 1776 | "Added %d peers to heap, total size %d\n", count_added, |
1775 | GNUNET_CONTAINER_heap_get_size (find_peer_context-> | 1777 | GNUNET_CONTAINER_heap_get_size |
1776 | peer_min_heap)); | 1778 | (find_peer_context->peer_min_heap)); |
1777 | GNUNET_SCHEDULER_add_delayed (DEFAULT_PEER_DISCONNECT_TIMEOUT, | 1779 | GNUNET_SCHEDULER_add_delayed (DEFAULT_PEER_DISCONNECT_TIMEOUT, |
1778 | &schedule_churn_get_topology, | 1780 | &schedule_churn_get_topology, |
1779 | find_peer_context); | 1781 | find_peer_context); |
@@ -2262,14 +2264,14 @@ do_put (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
2262 | test_put->next); | 2264 | test_put->next); |
2263 | } | 2265 | } |
2264 | 2266 | ||
2265 | static void schedule_find_peer_requests (void *cls, | 2267 | static void |
2266 | const struct | 2268 | schedule_find_peer_requests (void *cls, |
2267 | GNUNET_SCHEDULER_TaskContext *tc); | 2269 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
2268 | 2270 | ||
2269 | #if HAVE_MALICIOUS | 2271 | #if HAVE_MALICIOUS |
2270 | static void setup_malicious_peers (void *cls, | 2272 | static void |
2271 | const struct GNUNET_SCHEDULER_TaskContext | 2273 | setup_malicious_peers (void *cls, |
2272 | *tc); | 2274 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
2273 | #endif | 2275 | #endif |
2274 | 2276 | ||
2275 | /** | 2277 | /** |
@@ -2322,8 +2324,8 @@ count_peers_cb (void *cls, const struct GNUNET_PeerIdentity *first, | |||
2322 | if ((find_peer_context->last_sent < 8) || | 2324 | if ((find_peer_context->last_sent < 8) || |
2323 | ((find_peer_context->current_peers < | 2325 | ((find_peer_context->current_peers < |
2324 | 2 * connection_estimate (num_peers, DEFAULT_BUCKET_SIZE)) && | 2326 | 2 * connection_estimate (num_peers, DEFAULT_BUCKET_SIZE)) && |
2325 | (GNUNET_TIME_absolute_get_remaining (find_peer_context->endtime). | 2327 | (GNUNET_TIME_absolute_get_remaining |
2326 | rel_value > 0) && | 2328 | (find_peer_context->endtime).rel_value > 0) && |
2327 | (find_peer_context->current_peers < target_total_connections))) | 2329 | (find_peer_context->current_peers < target_total_connections))) |
2328 | { | 2330 | { |
2329 | GNUNET_SCHEDULER_add_now (&schedule_find_peer_requests, | 2331 | GNUNET_SCHEDULER_add_now (&schedule_find_peer_requests, |
@@ -2424,11 +2426,9 @@ schedule_find_peer_requests (void *cls, | |||
2424 | peer_count = | 2426 | peer_count = |
2425 | GNUNET_CONTAINER_heap_remove_root (find_peer_ctx->peer_min_heap); | 2427 | GNUNET_CONTAINER_heap_remove_root (find_peer_ctx->peer_min_heap); |
2426 | GNUNET_assert (GNUNET_YES == | 2428 | GNUNET_assert (GNUNET_YES == |
2427 | GNUNET_CONTAINER_multihashmap_remove (find_peer_ctx-> | 2429 | GNUNET_CONTAINER_multihashmap_remove |
2428 | peer_hash, | 2430 | (find_peer_ctx->peer_hash, &peer_count->peer_id.hashPubKey, |
2429 | &peer_count->peer_id. | 2431 | peer_count)); |
2430 | hashPubKey, | ||
2431 | peer_count)); | ||
2432 | test_find_peer->daemon = | 2432 | test_find_peer->daemon = |
2433 | GNUNET_TESTING_daemon_get_by_id (pg, &peer_count->peer_id); | 2433 | GNUNET_TESTING_daemon_get_by_id (pg, &peer_count->peer_id); |
2434 | GNUNET_assert (test_find_peer->daemon != NULL); | 2434 | GNUNET_assert (test_find_peer->daemon != NULL); |
@@ -2879,17 +2879,14 @@ setup_malicious_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
2879 | 2879 | ||
2880 | #if ONLY_TESTING | 2880 | #if ONLY_TESTING |
2881 | /* Forward declaration */ | 2881 | /* Forward declaration */ |
2882 | static void topology_callback (void *cls, | 2882 | static void |
2883 | const struct GNUNET_PeerIdentity *first, | 2883 | topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, |
2884 | const struct GNUNET_PeerIdentity *second, | 2884 | const struct GNUNET_PeerIdentity *second, uint32_t distance, |
2885 | uint32_t distance, | 2885 | const struct GNUNET_CONFIGURATION_Handle *first_cfg, |
2886 | const struct GNUNET_CONFIGURATION_Handle | 2886 | const struct GNUNET_CONFIGURATION_Handle *second_cfg, |
2887 | *first_cfg, | 2887 | struct GNUNET_TESTING_Daemon *first_daemon, |
2888 | const struct GNUNET_CONFIGURATION_Handle | 2888 | struct GNUNET_TESTING_Daemon *second_daemon, |
2889 | *second_cfg, | 2889 | const char *emsg); |
2890 | struct GNUNET_TESTING_Daemon *first_daemon, | ||
2891 | struct GNUNET_TESTING_Daemon *second_daemon, | ||
2892 | const char *emsg); | ||
2893 | 2890 | ||
2894 | /** | 2891 | /** |
2895 | * Retry connecting two specific peers until they connect, | 2892 | * Retry connecting two specific peers until they connect, |
@@ -2993,12 +2990,12 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, | |||
2993 | /* Get duration in seconds */ | 2990 | /* Get duration in seconds */ |
2994 | duration = | 2991 | duration = |
2995 | GNUNET_TIME_absolute_get_difference (connect_last_time, | 2992 | GNUNET_TIME_absolute_get_difference (connect_last_time, |
2996 | GNUNET_TIME_absolute_get ()). | 2993 | GNUNET_TIME_absolute_get |
2997 | rel_value / 1000; | 2994 | ()).rel_value / 1000; |
2998 | total_duration = | 2995 | total_duration = |
2999 | GNUNET_TIME_absolute_get_difference (connect_start_time, | 2996 | GNUNET_TIME_absolute_get_difference (connect_start_time, |
3000 | GNUNET_TIME_absolute_get ()). | 2997 | GNUNET_TIME_absolute_get |
3001 | rel_value / 1000; | 2998 | ()).rel_value / 1000; |
3002 | 2999 | ||
3003 | failed_conns_per_sec_recent = | 3000 | failed_conns_per_sec_recent = |
3004 | (double) new_failed_connections / (double) duration; | 3001 | (double) new_failed_connections / (double) duration; |
@@ -3086,8 +3083,8 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, | |||
3086 | 3083 | ||
3087 | total_duration = | 3084 | total_duration = |
3088 | GNUNET_TIME_absolute_get_difference (connect_start_time, | 3085 | GNUNET_TIME_absolute_get_difference (connect_start_time, |
3089 | GNUNET_TIME_absolute_get ()). | 3086 | GNUNET_TIME_absolute_get |
3090 | rel_value / 1000; | 3087 | ()).rel_value / 1000; |
3091 | failed_conns_per_sec_total = | 3088 | failed_conns_per_sec_total = |
3092 | (long double) failed_connections / total_duration; | 3089 | (long double) failed_connections / total_duration; |
3093 | conns_per_sec_total = (long double) total_connections / total_duration; | 3090 | conns_per_sec_total = (long double) total_connections / total_duration; |
@@ -3299,14 +3296,16 @@ hostkey_callback (void *cls, const struct GNUNET_PeerIdentity *id, | |||
3299 | GNUNET_CONFIGURATION_have_value (config, "TESTING", "HOSTKEYSFILE")) | 3296 | GNUNET_CONFIGURATION_have_value (config, "TESTING", "HOSTKEYSFILE")) |
3300 | { | 3297 | { |
3301 | GAUGER_ID ("DHT_TESTING", "HOSTKEY_GENERATION", | 3298 | GAUGER_ID ("DHT_TESTING", "HOSTKEY_GENERATION", |
3302 | GNUNET_TIME_absolute_get_duration (hostkey_start_time). | 3299 | GNUNET_TIME_absolute_get_duration |
3303 | rel_value / (double) num_peers, "ms/hostkey", revision_str); | 3300 | (hostkey_start_time).rel_value / (double) num_peers, |
3301 | "ms/hostkey", revision_str); | ||
3304 | } | 3302 | } |
3305 | else | 3303 | else |
3306 | { | 3304 | { |
3307 | GAUGER_ID ("DHT_TESTING", "HOSTKEY_GENERATION_REAL", | 3305 | GAUGER_ID ("DHT_TESTING", "HOSTKEY_GENERATION_REAL", |
3308 | GNUNET_TIME_absolute_get_duration (hostkey_start_time). | 3306 | GNUNET_TIME_absolute_get_duration |
3309 | rel_value / (double) num_peers, "ms/hostkey", revision_str); | 3307 | (hostkey_start_time).rel_value / (double) num_peers, |
3308 | "ms/hostkey", revision_str); | ||
3310 | } | 3309 | } |
3311 | } | 3310 | } |
3312 | 3311 | ||
diff --git a/src/dht/gnunet-service-dht.c b/src/dht/gnunet-service-dht.c index 1721e73af..43a6c9bea 100644 --- a/src/dht/gnunet-service-dht.c +++ b/src/dht/gnunet-service-dht.c | |||
@@ -934,11 +934,13 @@ static struct GNUNET_BLOCK_Context *block_context; | |||
934 | /** | 934 | /** |
935 | * Forward declaration. | 935 | * Forward declaration. |
936 | */ | 936 | */ |
937 | static size_t send_generic_reply (void *cls, size_t size, void *buf); | 937 | static size_t |
938 | send_generic_reply (void *cls, size_t size, void *buf); | ||
938 | 939 | ||
939 | 940 | ||
940 | /** Declare here so retry_core_send is aware of it */ | 941 | /** Declare here so retry_core_send is aware of it */ |
941 | static size_t core_transmit_notify (void *cls, size_t size, void *buf); | 942 | static size_t |
943 | core_transmit_notify (void *cls, size_t size, void *buf); | ||
942 | 944 | ||
943 | /** | 945 | /** |
944 | * Convert unique ID to hash code. | 946 | * Convert unique ID to hash code. |
@@ -1160,7 +1162,8 @@ forward_result_message (const struct GNUNET_MessageHeader *msg, | |||
1160 | result_message->hop_count = htonl (msg_ctx->hop_count + 1); | 1162 | result_message->hop_count = htonl (msg_ctx->hop_count + 1); |
1161 | GNUNET_assert (GNUNET_OK == | 1163 | GNUNET_assert (GNUNET_OK == |
1162 | GNUNET_CONTAINER_bloomfilter_get_raw_data (msg_ctx->bloom, | 1164 | GNUNET_CONTAINER_bloomfilter_get_raw_data (msg_ctx->bloom, |
1163 | result_message->bloomfilter, | 1165 | result_message-> |
1166 | bloomfilter, | ||
1164 | DHT_BLOOM_SIZE)); | 1167 | DHT_BLOOM_SIZE)); |
1165 | result_message->unique_id = GNUNET_htonll (msg_ctx->unique_id); | 1168 | result_message->unique_id = GNUNET_htonll (msg_ctx->unique_id); |
1166 | memcpy (&result_message->key, &msg_ctx->key, sizeof (GNUNET_HashCode)); | 1169 | memcpy (&result_message->key, &msg_ctx->key, sizeof (GNUNET_HashCode)); |
@@ -1474,9 +1477,9 @@ find_peer_by_id (const struct GNUNET_PeerIdentity *peer) | |||
1474 | } | 1477 | } |
1475 | 1478 | ||
1476 | /* Forward declaration */ | 1479 | /* Forward declaration */ |
1477 | static void update_core_preference (void *cls, | 1480 | static void |
1478 | const struct GNUNET_SCHEDULER_TaskContext | 1481 | update_core_preference (void *cls, |
1479 | *tc); | 1482 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
1480 | /** | 1483 | /** |
1481 | * Function called with statistics about the given peer. | 1484 | * Function called with statistics about the given peer. |
1482 | * | 1485 | * |
@@ -1776,7 +1779,8 @@ forward_message (const struct GNUNET_MessageHeader *msg, struct PeerInfo *peer, | |||
1776 | if (msg_ctx->bloom != NULL) | 1779 | if (msg_ctx->bloom != NULL) |
1777 | GNUNET_assert (GNUNET_OK == | 1780 | GNUNET_assert (GNUNET_OK == |
1778 | GNUNET_CONTAINER_bloomfilter_get_raw_data (msg_ctx->bloom, | 1781 | GNUNET_CONTAINER_bloomfilter_get_raw_data (msg_ctx->bloom, |
1779 | route_message->bloomfilter, | 1782 | route_message-> |
1783 | bloomfilter, | ||
1780 | DHT_BLOOM_SIZE)); | 1784 | DHT_BLOOM_SIZE)); |
1781 | memcpy (&route_message->key, &msg_ctx->key, sizeof (GNUNET_HashCode)); | 1785 | memcpy (&route_message->key, &msg_ctx->key, sizeof (GNUNET_HashCode)); |
1782 | memcpy (&route_message[1], msg, ntohs (msg->size)); | 1786 | memcpy (&route_message[1], msg, ntohs (msg->size)); |
@@ -1885,8 +1889,8 @@ process_pending_messages (struct ClientList *client) | |||
1885 | 1889 | ||
1886 | client->transmit_handle = | 1890 | client->transmit_handle = |
1887 | GNUNET_SERVER_notify_transmit_ready (client->client_handle, | 1891 | GNUNET_SERVER_notify_transmit_ready (client->client_handle, |
1888 | ntohs (client->pending_head->msg-> | 1892 | ntohs (client->pending_head-> |
1889 | size), | 1893 | msg->size), |
1890 | GNUNET_TIME_UNIT_FOREVER_REL, | 1894 | GNUNET_TIME_UNIT_FOREVER_REL, |
1891 | &send_generic_reply, client); | 1895 | &send_generic_reply, client); |
1892 | } | 1896 | } |
@@ -2457,8 +2461,9 @@ datacache_get_iterator (void *cls, struct GNUNET_TIME_Absolute exp, | |||
2457 | * @param msg the message to be routed | 2461 | * @param msg the message to be routed |
2458 | * @param msg_ctx the context containing all pertinent information about the message | 2462 | * @param msg_ctx the context containing all pertinent information about the message |
2459 | */ | 2463 | */ |
2460 | static void route_message (const struct GNUNET_MessageHeader *msg, | 2464 | static void |
2461 | struct DHT_MessageContext *msg_ctx); | 2465 | route_message (const struct GNUNET_MessageHeader *msg, |
2466 | struct DHT_MessageContext *msg_ctx); | ||
2462 | 2467 | ||
2463 | 2468 | ||
2464 | /** | 2469 | /** |
@@ -2815,8 +2820,8 @@ handle_dht_find_peer (const struct GNUNET_MessageHeader *find_msg, | |||
2815 | * @param cls closure (a struct RepublishContext) | 2820 | * @param cls closure (a struct RepublishContext) |
2816 | * @param tc runtime context for this task | 2821 | * @param tc runtime context for this task |
2817 | */ | 2822 | */ |
2818 | static void republish_content (void *cls, | 2823 | static void |
2819 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 2824 | republish_content (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
2820 | 2825 | ||
2821 | /** | 2826 | /** |
2822 | * Server handler for initiating local dht put requests | 2827 | * Server handler for initiating local dht put requests |
@@ -3509,10 +3514,10 @@ select_peer (const GNUNET_HashCode * target, | |||
3509 | break; /* overflow case */ | 3514 | break; /* overflow case */ |
3510 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 3515 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
3511 | "Choose %d matching bits (%d bits match me) (%.2f percent) converge ret %llu\n", | 3516 | "Choose %d matching bits (%d bits match me) (%.2f percent) converge ret %llu\n", |
3512 | GNUNET_CRYPTO_hash_matching_bits (&sorted_closest[i]-> | 3517 | GNUNET_CRYPTO_hash_matching_bits (&sorted_closest[i]->id. |
3513 | id.hashPubKey, target), | 3518 | hashPubKey, target), |
3514 | GNUNET_CRYPTO_hash_matching_bits (&sorted_closest[i]-> | 3519 | GNUNET_CRYPTO_hash_matching_bits (&sorted_closest[i]->id. |
3515 | id.hashPubKey, | 3520 | hashPubKey, |
3516 | &my_identity.hashPubKey), | 3521 | &my_identity.hashPubKey), |
3517 | (temp_converge_distance / (double) total_distance) * 100, | 3522 | (temp_converge_distance / (double) total_distance) * 100, |
3518 | temp_converge_distance); | 3523 | temp_converge_distance); |
@@ -4473,7 +4478,8 @@ send_find_peer_message (void *cls, | |||
4473 | temp_bloom); | 4478 | temp_bloom); |
4474 | GNUNET_assert (GNUNET_OK == | 4479 | GNUNET_assert (GNUNET_OK == |
4475 | GNUNET_CONTAINER_bloomfilter_get_raw_data (temp_bloom, | 4480 | GNUNET_CONTAINER_bloomfilter_get_raw_data (temp_bloom, |
4476 | find_peer_msg->bloomfilter, | 4481 | find_peer_msg-> |
4482 | bloomfilter, | ||
4477 | DHT_BLOOM_SIZE)); | 4483 | DHT_BLOOM_SIZE)); |
4478 | GNUNET_CONTAINER_bloomfilter_free (temp_bloom); | 4484 | GNUNET_CONTAINER_bloomfilter_free (temp_bloom); |
4479 | memset (&msg_ctx, 0, sizeof (struct DHT_MessageContext)); | 4485 | memset (&msg_ctx, 0, sizeof (struct DHT_MessageContext)); |
diff --git a/src/dht/plugin_dhtlog_dummy.c b/src/dht/plugin_dhtlog_dummy.c index a411c5934..563d97e46 100644 --- a/src/dht/plugin_dhtlog_dummy.c +++ b/src/dht/plugin_dhtlog_dummy.c | |||
@@ -281,18 +281,18 @@ set_malicious (struct GNUNET_PeerIdentity *peer) | |||
281 | * | 281 | * |
282 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 282 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
283 | */ | 283 | */ |
284 | int insert_stat (const struct GNUNET_PeerIdentity *peer, | 284 | int |
285 | unsigned int route_requests, unsigned int route_forwards, | 285 | insert_stat (const struct GNUNET_PeerIdentity *peer, |
286 | unsigned int result_requests, unsigned int client_requests, | 286 | unsigned int route_requests, unsigned int route_forwards, |
287 | unsigned int result_forwards, unsigned int gets, | 287 | unsigned int result_requests, unsigned int client_requests, |
288 | unsigned int puts, unsigned int data_inserts, | 288 | unsigned int result_forwards, unsigned int gets, unsigned int puts, |
289 | unsigned int find_peer_requests, | 289 | unsigned int data_inserts, unsigned int find_peer_requests, |
290 | unsigned int find_peers_started, unsigned int gets_started, | 290 | unsigned int find_peers_started, unsigned int gets_started, |
291 | unsigned int puts_started, | 291 | unsigned int puts_started, |
292 | unsigned int find_peer_responses_received, | 292 | unsigned int find_peer_responses_received, |
293 | unsigned int get_responses_received, | 293 | unsigned int get_responses_received, |
294 | unsigned int find_peer_responses_sent, | 294 | unsigned int find_peer_responses_sent, |
295 | unsigned int get_responses_sent) | 295 | unsigned int get_responses_sent) |
296 | { | 296 | { |
297 | return GNUNET_OK; | 297 | return GNUNET_OK; |
298 | } | 298 | } |
diff --git a/src/dht/test_dht_api.c b/src/dht/test_dht_api.c index 9fc5c2d7a..f5bb05d8b 100644 --- a/src/dht/test_dht_api.c +++ b/src/dht/test_dht_api.c | |||
@@ -237,8 +237,8 @@ test_find_peer_processor (void *cls, const struct GNUNET_HELLO_Message *hello) | |||
237 | * @param cls closure | 237 | * @param cls closure |
238 | * @param tc context information (why was this task triggered now?) | 238 | * @param tc context information (why was this task triggered now?) |
239 | */ | 239 | */ |
240 | void retry_find_peer_stop (void *cls, | 240 | void |
241 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 241 | retry_find_peer_stop (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
242 | 242 | ||
243 | /** | 243 | /** |
244 | * Retry the find_peer task on timeout. | 244 | * Retry the find_peer task on timeout. |
diff --git a/src/dht/test_dht_twopeer.c b/src/dht/test_dht_twopeer.c index 50a27a093..63f200e7d 100644 --- a/src/dht/test_dht_twopeer.c +++ b/src/dht/test_dht_twopeer.c | |||
@@ -141,7 +141,8 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
141 | } | 141 | } |
142 | 142 | ||
143 | /* Forward declaration */ | 143 | /* Forward declaration */ |
144 | static void do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 144 | static void |
145 | do_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
145 | 146 | ||
146 | /** | 147 | /** |
147 | * Iterator called on each result obtained for a DHT | 148 | * Iterator called on each result obtained for a DHT |
@@ -199,8 +200,8 @@ get_result_iterator (void *cls, struct GNUNET_TIME_Absolute exp, | |||
199 | 200 | ||
200 | } | 201 | } |
201 | 202 | ||
202 | static void stop_retry_get (void *cls, | 203 | static void |
203 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 204 | stop_retry_get (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
204 | 205 | ||
205 | static void | 206 | static void |
206 | get_stop_finished (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 207 | get_stop_finished (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
diff --git a/src/dv/dv.h b/src/dv/dv.h index 3c62a22bc..1d4912f84 100644 --- a/src/dv/dv.h +++ b/src/dv/dv.h | |||
@@ -257,17 +257,17 @@ typedef struct | |||
257 | } p2p_dv_MESSAGE_Disconnect; | 257 | } p2p_dv_MESSAGE_Disconnect; |
258 | 258 | ||
259 | 259 | ||
260 | struct GNUNET_DV_Handle *GNUNET_DV_connect (const struct | 260 | struct GNUNET_DV_Handle * |
261 | GNUNET_CONFIGURATION_Handle *cfg, | 261 | GNUNET_DV_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, |
262 | GNUNET_DV_MessageReceivedHandler | 262 | GNUNET_DV_MessageReceivedHandler receive_handler, |
263 | receive_handler, | 263 | void *receive_handler_cls); |
264 | void *receive_handler_cls); | ||
265 | 264 | ||
266 | /** | 265 | /** |
267 | * Disconnect from the DV service | 266 | * Disconnect from the DV service |
268 | * | 267 | * |
269 | * @param handle the current handle to the service to disconnect | 268 | * @param handle the current handle to the service to disconnect |
270 | */ | 269 | */ |
271 | void GNUNET_DV_disconnect (struct GNUNET_DV_Handle *handle); | 270 | void |
271 | GNUNET_DV_disconnect (struct GNUNET_DV_Handle *handle); | ||
272 | 272 | ||
273 | #endif | 273 | #endif |
diff --git a/src/dv/dv_api.c b/src/dv/dv_api.c index 3450e5844..d4c07ecdc 100644 --- a/src/dv/dv_api.c +++ b/src/dv/dv_api.c | |||
@@ -180,7 +180,8 @@ try_connect (struct GNUNET_DV_Handle *ret) | |||
180 | return GNUNET_NO; | 180 | return GNUNET_NO; |
181 | } | 181 | } |
182 | 182 | ||
183 | static void process_pending_message (struct GNUNET_DV_Handle *handle); | 183 | static void |
184 | process_pending_message (struct GNUNET_DV_Handle *handle); | ||
184 | 185 | ||
185 | /** | 186 | /** |
186 | * Send complete, schedule next | 187 | * Send complete, schedule next |
@@ -284,8 +285,8 @@ process_pending_message (struct GNUNET_DV_Handle *handle) | |||
284 | if (NULL == | 285 | if (NULL == |
285 | (handle->th = | 286 | (handle->th = |
286 | GNUNET_CLIENT_notify_transmit_ready (handle->client, | 287 | GNUNET_CLIENT_notify_transmit_ready (handle->client, |
287 | ntohs (handle->current->msg->header. | 288 | ntohs (handle->current->msg-> |
288 | size), | 289 | header.size), |
289 | handle->current->msg->timeout, | 290 | handle->current->msg->timeout, |
290 | GNUNET_YES, &transmit_pending, | 291 | GNUNET_YES, &transmit_pending, |
291 | handle))) | 292 | handle))) |
diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c index 876d056ac..6699fef11 100644 --- a/src/dv/gnunet-service-dv.c +++ b/src/dv/gnunet-service-dv.c | |||
@@ -761,8 +761,8 @@ transmit_to_plugin (void *cls, size_t size, void *buf) | |||
761 | if (plugin_pending_head != NULL) | 761 | if (plugin_pending_head != NULL) |
762 | plugin_transmit_handle = | 762 | plugin_transmit_handle = |
763 | GNUNET_SERVER_notify_transmit_ready (client_handle, | 763 | GNUNET_SERVER_notify_transmit_ready (client_handle, |
764 | ntohs (plugin_pending_head-> | 764 | ntohs (plugin_pending_head->msg-> |
765 | msg->size), | 765 | size), |
766 | GNUNET_TIME_UNIT_FOREVER_REL, | 766 | GNUNET_TIME_UNIT_FOREVER_REL, |
767 | &transmit_to_plugin, NULL); | 767 | &transmit_to_plugin, NULL); |
768 | 768 | ||
@@ -858,7 +858,8 @@ send_to_plugin (const struct GNUNET_PeerIdentity *sender, | |||
858 | } | 858 | } |
859 | 859 | ||
860 | /* Declare here so retry_core_send is aware of it */ | 860 | /* Declare here so retry_core_send is aware of it */ |
861 | size_t core_transmit_notify (void *cls, size_t size, void *buf); | 861 | size_t |
862 | core_transmit_notify (void *cls, size_t size, void *buf); | ||
862 | 863 | ||
863 | /** | 864 | /** |
864 | * Try to send another message from our core sending list | 865 | * Try to send another message from our core sending list |
@@ -999,9 +1000,9 @@ send_message_via (const struct GNUNET_PeerIdentity *sender, | |||
999 | find_context.via = recipient; | 1000 | find_context.via = recipient; |
1000 | find_context.tid = 0; | 1001 | find_context.tid = 0; |
1001 | GNUNET_CONTAINER_multihashmap_get_multiple (extended_neighbors, | 1002 | GNUNET_CONTAINER_multihashmap_get_multiple (extended_neighbors, |
1002 | &send_context->distant_peer-> | 1003 | &send_context-> |
1003 | hashPubKey, &find_specific_id, | 1004 | distant_peer->hashPubKey, |
1004 | &find_context); | 1005 | &find_specific_id, &find_context); |
1005 | 1006 | ||
1006 | if (find_context.tid == 0) | 1007 | if (find_context.tid == 0) |
1007 | { | 1008 | { |
@@ -2071,19 +2072,16 @@ handle_dv_send_message (void *cls, struct GNUNET_SERVER_Client *client, | |||
2071 | } | 2072 | } |
2072 | 2073 | ||
2073 | /** Forward declarations **/ | 2074 | /** Forward declarations **/ |
2074 | static int handle_dv_gossip_message (void *cls, | 2075 | static int |
2075 | const struct GNUNET_PeerIdentity *peer, | 2076 | handle_dv_gossip_message (void *cls, const struct GNUNET_PeerIdentity *peer, |
2076 | const struct GNUNET_MessageHeader *message, | 2077 | const struct GNUNET_MessageHeader *message, |
2077 | const struct | 2078 | const struct GNUNET_TRANSPORT_ATS_Information *atsi); |
2078 | GNUNET_TRANSPORT_ATS_Information *atsi); | 2079 | |
2079 | 2080 | static int | |
2080 | static int handle_dv_disconnect_message (void *cls, | 2081 | handle_dv_disconnect_message (void *cls, const struct GNUNET_PeerIdentity *peer, |
2081 | const struct GNUNET_PeerIdentity *peer, | 2082 | const struct GNUNET_MessageHeader *message, |
2082 | const struct GNUNET_MessageHeader | 2083 | const struct GNUNET_TRANSPORT_ATS_Information |
2083 | *message, | 2084 | *atsi); |
2084 | const struct | ||
2085 | GNUNET_TRANSPORT_ATS_Information | ||
2086 | *atsi); | ||
2087 | /** End forward declarations **/ | 2085 | /** End forward declarations **/ |
2088 | 2086 | ||
2089 | 2087 | ||
@@ -2658,8 +2656,8 @@ addUpdateNeighbor (const struct GNUNET_PeerIdentity *peer, | |||
2658 | atsi[0].value = htonl (referrer->pending_messages[i].distance); | 2656 | atsi[0].value = htonl (referrer->pending_messages[i].distance); |
2659 | atsi[1].type = htonl (GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY); | 2657 | atsi[1].type = htonl (GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY); |
2660 | atsi[1].value = | 2658 | atsi[1].value = |
2661 | htonl ((uint32_t) referrer->pending_messages[i].latency. | 2659 | htonl ((uint32_t) referrer->pending_messages[i]. |
2662 | rel_value); | 2660 | latency.rel_value); |
2663 | atsi[2].type = htonl (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR); | 2661 | atsi[2].type = htonl (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR); |
2664 | atsi[2].value = htonl (0); | 2662 | atsi[2].value = htonl (0); |
2665 | handle_dv_data_message (NULL, &referrer->pending_messages[i].sender, | 2663 | handle_dv_data_message (NULL, &referrer->pending_messages[i].sender, |
diff --git a/src/dv/test_transport_api_dv.c b/src/dv/test_transport_api_dv.c index fee8eea81..e66caa4f6 100644 --- a/src/dv/test_transport_api_dv.c +++ b/src/dv/test_transport_api_dv.c | |||
@@ -382,8 +382,8 @@ end_badly (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
382 | } | 382 | } |
383 | } | 383 | } |
384 | 384 | ||
385 | static void send_other_messages (void *cls, | 385 | static void |
386 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 386 | send_other_messages (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
387 | 387 | ||
388 | /** | 388 | /** |
389 | * Get distance information from 'atsi'. | 389 | * Get distance information from 'atsi'. |
diff --git a/src/fs/fs.c b/src/fs/fs.c index e26a01996..fc1388a04 100644 --- a/src/fs/fs.c +++ b/src/fs/fs.c | |||
@@ -72,8 +72,8 @@ stop_job (struct GNUNET_FS_QueueEntry *qe) | |||
72 | qe->h->active_blocks -= qe->blocks; | 72 | qe->h->active_blocks -= qe->blocks; |
73 | qe->run_time = | 73 | qe->run_time = |
74 | GNUNET_TIME_relative_add (qe->run_time, | 74 | GNUNET_TIME_relative_add (qe->run_time, |
75 | GNUNET_TIME_absolute_get_duration (qe-> | 75 | GNUNET_TIME_absolute_get_duration |
76 | start_time)); | 76 | (qe->start_time)); |
77 | GNUNET_CONTAINER_DLL_remove (qe->h->running_head, qe->h->running_tail, qe); | 77 | GNUNET_CONTAINER_DLL_remove (qe->h->running_head, qe->h->running_tail, qe); |
78 | GNUNET_CONTAINER_DLL_insert_after (qe->h->pending_head, qe->h->pending_tail, | 78 | GNUNET_CONTAINER_DLL_insert_after (qe->h->pending_head, qe->h->pending_tail, |
79 | qe->h->pending_tail, qe); | 79 | qe->h->pending_tail, qe); |
@@ -638,12 +638,8 @@ read_start_time (struct GNUNET_BIO_ReadHandle *rh, | |||
638 | * the infromation | 638 | * the infromation |
639 | * @return NULL on error | 639 | * @return NULL on error |
640 | */ | 640 | */ |
641 | static struct GNUNET_FS_FileInformation *deserialize_file_information (struct | 641 | static struct GNUNET_FS_FileInformation * |
642 | GNUNET_FS_Handle | 642 | deserialize_file_information (struct GNUNET_FS_Handle *h, const char *filename); |
643 | *h, | ||
644 | const | ||
645 | char | ||
646 | *filename); | ||
647 | 643 | ||
648 | 644 | ||
649 | /** | 645 | /** |
@@ -1152,8 +1148,8 @@ GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation *fi) | |||
1152 | (GNUNET_OK != | 1148 | (GNUNET_OK != |
1153 | GNUNET_BIO_write_string (wh, | 1149 | GNUNET_BIO_write_string (wh, |
1154 | (fi->data.dir.entries == | 1150 | (fi->data.dir.entries == |
1155 | NULL) ? NULL : fi->data.dir.entries-> | 1151 | NULL) ? NULL : fi->data.dir. |
1156 | serialization))) | 1152 | entries->serialization))) |
1157 | { | 1153 | { |
1158 | GNUNET_break (0); | 1154 | GNUNET_break (0); |
1159 | goto cleanup; | 1155 | goto cleanup; |
@@ -1566,9 +1562,9 @@ read_download_request (struct GNUNET_BIO_ReadHandle *rh) | |||
1566 | (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &dr->num_children)) || | 1562 | (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &dr->num_children)) || |
1567 | (dr->num_children > CHK_PER_INODE) || | 1563 | (dr->num_children > CHK_PER_INODE) || |
1568 | (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &dr->depth)) || ((dr->depth == 0) | 1564 | (GNUNET_OK != GNUNET_BIO_read_int32 (rh, &dr->depth)) || ((dr->depth == 0) |
1569 | && (dr-> | 1565 | && |
1570 | num_children | 1566 | (dr->num_children |
1571 | > 0)) || | 1567 | > 0)) || |
1572 | ((dr->depth > 0) && (dr->num_children == 0))) | 1568 | ((dr->depth > 0) && (dr->num_children == 0))) |
1573 | { | 1569 | { |
1574 | GNUNET_break (0); | 1570 | GNUNET_break (0); |
@@ -2017,11 +2013,12 @@ cleanup: | |||
2017 | * @param search associated search | 2013 | * @param search associated search |
2018 | * @param serialization name under which the search was serialized | 2014 | * @param serialization name under which the search was serialized |
2019 | */ | 2015 | */ |
2020 | static void deserialize_download (struct GNUNET_FS_Handle *h, | 2016 | static void |
2021 | struct GNUNET_BIO_ReadHandle *rh, | 2017 | deserialize_download (struct GNUNET_FS_Handle *h, |
2022 | struct GNUNET_FS_DownloadContext *parent, | 2018 | struct GNUNET_BIO_ReadHandle *rh, |
2023 | struct GNUNET_FS_SearchResult *search, | 2019 | struct GNUNET_FS_DownloadContext *parent, |
2024 | const char *serialization); | 2020 | struct GNUNET_FS_SearchResult *search, |
2021 | const char *serialization); | ||
2025 | 2022 | ||
2026 | 2023 | ||
2027 | /** | 2024 | /** |
@@ -2032,16 +2029,11 @@ static void deserialize_download (struct GNUNET_FS_Handle *h, | |||
2032 | * @param psearch_result parent search result | 2029 | * @param psearch_result parent search result |
2033 | * @param serialization name under which the search was serialized | 2030 | * @param serialization name under which the search was serialized |
2034 | */ | 2031 | */ |
2035 | static struct GNUNET_FS_SearchContext *deserialize_search (struct | 2032 | static struct GNUNET_FS_SearchContext * |
2036 | GNUNET_FS_Handle *h, | 2033 | deserialize_search (struct GNUNET_FS_Handle *h, |
2037 | struct | 2034 | struct GNUNET_BIO_ReadHandle *rh, |
2038 | GNUNET_BIO_ReadHandle | 2035 | struct GNUNET_FS_SearchResult *psearch_result, |
2039 | *rh, | 2036 | const char *serialization); |
2040 | struct | ||
2041 | GNUNET_FS_SearchResult | ||
2042 | *psearch_result, | ||
2043 | const char | ||
2044 | *serialization); | ||
2045 | 2037 | ||
2046 | 2038 | ||
2047 | /** | 2039 | /** |
@@ -2203,7 +2195,8 @@ signal_download_resume (struct GNUNET_FS_DownloadContext *dc) | |||
2203 | * | 2195 | * |
2204 | * @param sc search being resumed | 2196 | * @param sc search being resumed |
2205 | */ | 2197 | */ |
2206 | static void signal_search_resume (struct GNUNET_FS_SearchContext *sc); | 2198 | static void |
2199 | signal_search_resume (struct GNUNET_FS_SearchContext *sc); | ||
2207 | 2200 | ||
2208 | 2201 | ||
2209 | /** | 2202 | /** |
@@ -2255,7 +2248,8 @@ signal_result_resume (void *cls, const GNUNET_HashCode * key, void *value) | |||
2255 | * | 2248 | * |
2256 | * @param sc search context to free | 2249 | * @param sc search context to free |
2257 | */ | 2250 | */ |
2258 | static void free_search_context (struct GNUNET_FS_SearchContext *sc); | 2251 | static void |
2252 | free_search_context (struct GNUNET_FS_SearchContext *sc); | ||
2259 | 2253 | ||
2260 | 2254 | ||
2261 | /** | 2255 | /** |
diff --git a/src/fs/fs.h b/src/fs/fs.h index 68bab5916..11cfc755e 100644 --- a/src/fs/fs.h +++ b/src/fs/fs.h | |||
@@ -759,17 +759,17 @@ struct GNUNET_FS_SearchResult | |||
759 | * @param blocks number of blocks this download has | 759 | * @param blocks number of blocks this download has |
760 | * @return queue handle | 760 | * @return queue handle |
761 | */ | 761 | */ |
762 | struct GNUNET_FS_QueueEntry *GNUNET_FS_queue_ (struct GNUNET_FS_Handle *h, | 762 | struct GNUNET_FS_QueueEntry * |
763 | GNUNET_FS_QueueStart start, | 763 | GNUNET_FS_queue_ (struct GNUNET_FS_Handle *h, GNUNET_FS_QueueStart start, |
764 | GNUNET_FS_QueueStop stop, | 764 | GNUNET_FS_QueueStop stop, void *cls, unsigned int blocks); |
765 | void *cls, unsigned int blocks); | ||
766 | 765 | ||
767 | 766 | ||
768 | /** | 767 | /** |
769 | * Dequeue a job from the queue. | 768 | * Dequeue a job from the queue. |
770 | * @param qh handle for the job | 769 | * @param qh handle for the job |
771 | */ | 770 | */ |
772 | void GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qh); | 771 | void |
772 | GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qh); | ||
773 | 773 | ||
774 | 774 | ||
775 | /** | 775 | /** |
@@ -788,9 +788,9 @@ void GNUNET_FS_dequeue_ (struct GNUNET_FS_QueueEntry *qh); | |||
788 | * @param emsg location for the reader to store an error message | 788 | * @param emsg location for the reader to store an error message |
789 | * @return number of bytes written, usually "max", 0 on error | 789 | * @return number of bytes written, usually "max", 0 on error |
790 | */ | 790 | */ |
791 | size_t GNUNET_FS_data_reader_file_ (void *cls, uint64_t offset, | 791 | size_t |
792 | size_t max, void *buf, | 792 | GNUNET_FS_data_reader_file_ (void *cls, uint64_t offset, size_t max, void *buf, |
793 | char **emsg); | 793 | char **emsg); |
794 | 794 | ||
795 | 795 | ||
796 | /** | 796 | /** |
@@ -799,7 +799,8 @@ size_t GNUNET_FS_data_reader_file_ (void *cls, uint64_t offset, | |||
799 | * @param filename file to read | 799 | * @param filename file to read |
800 | * @return closure to use | 800 | * @return closure to use |
801 | */ | 801 | */ |
802 | void *GNUNET_FS_make_file_reader_context_ (const char *filename); | 802 | void * |
803 | GNUNET_FS_make_file_reader_context_ (const char *filename); | ||
803 | 804 | ||
804 | 805 | ||
805 | 806 | ||
@@ -819,8 +820,9 @@ void *GNUNET_FS_make_file_reader_context_ (const char *filename); | |||
819 | * @param emsg location for the reader to store an error message | 820 | * @param emsg location for the reader to store an error message |
820 | * @return number of bytes written, usually "max", 0 on error | 821 | * @return number of bytes written, usually "max", 0 on error |
821 | */ | 822 | */ |
822 | size_t GNUNET_FS_data_reader_copy_ (void *cls, uint64_t offset, size_t max, | 823 | size_t |
823 | void *buf, char **emsg); | 824 | GNUNET_FS_data_reader_copy_ (void *cls, uint64_t offset, size_t max, void *buf, |
825 | char **emsg); | ||
824 | 826 | ||
825 | /** | 827 | /** |
826 | * Notification of FS that a search probe has made progress. | 828 | * Notification of FS that a search probe has made progress. |
@@ -837,9 +839,9 @@ size_t GNUNET_FS_data_reader_copy_ (void *cls, uint64_t offset, size_t max, | |||
837 | * will be passed to future callbacks in the respective | 839 | * will be passed to future callbacks in the respective |
838 | * field in the GNUNET_FS_ProgressInfo struct. | 840 | * field in the GNUNET_FS_ProgressInfo struct. |
839 | */ | 841 | */ |
840 | void *GNUNET_FS_search_probe_progress_ (void *cls, | 842 | void * |
841 | const struct GNUNET_FS_ProgressInfo | 843 | GNUNET_FS_search_probe_progress_ (void *cls, |
842 | *info); | 844 | const struct GNUNET_FS_ProgressInfo *info); |
843 | 845 | ||
844 | 846 | ||
845 | /** | 847 | /** |
@@ -848,8 +850,9 @@ void *GNUNET_FS_search_probe_progress_ (void *cls, | |||
848 | * @param cls "struct GNUNET_FS_PublishContext" identifies the upload | 850 | * @param cls "struct GNUNET_FS_PublishContext" identifies the upload |
849 | * @param tc task context | 851 | * @param tc task context |
850 | */ | 852 | */ |
851 | void GNUNET_FS_publish_main_ (void *cls, | 853 | void |
852 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 854 | GNUNET_FS_publish_main_ (void *cls, |
855 | const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
853 | 856 | ||
854 | 857 | ||
855 | /** | 858 | /** |
@@ -859,8 +862,8 @@ void GNUNET_FS_publish_main_ (void *cls, | |||
859 | * @param cls closure, unindex context | 862 | * @param cls closure, unindex context |
860 | * @param file_id computed hash, NULL on error | 863 | * @param file_id computed hash, NULL on error |
861 | */ | 864 | */ |
862 | void GNUNET_FS_unindex_process_hash_ (void *cls, | 865 | void |
863 | const GNUNET_HashCode * file_id); | 866 | GNUNET_FS_unindex_process_hash_ (void *cls, const GNUNET_HashCode * file_id); |
864 | 867 | ||
865 | 868 | ||
866 | /** | 869 | /** |
@@ -873,10 +876,11 @@ void GNUNET_FS_unindex_process_hash_ (void *cls, | |||
873 | * @param offset where in the file are we so far | 876 | * @param offset where in the file are we so far |
874 | * @return value returned from callback | 877 | * @return value returned from callback |
875 | */ | 878 | */ |
876 | void *GNUNET_FS_publish_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | 879 | void * |
877 | struct GNUNET_FS_PublishContext *sc, | 880 | GNUNET_FS_publish_make_status_ (struct GNUNET_FS_ProgressInfo *pi, |
878 | const struct GNUNET_FS_FileInformation *p, | 881 | struct GNUNET_FS_PublishContext *sc, |
879 | uint64_t offset); | 882 | const struct GNUNET_FS_FileInformation *p, |
883 | uint64_t offset); | ||
880 | 884 | ||
881 | 885 | ||
882 | /** | 886 | /** |
@@ -886,8 +890,9 @@ void *GNUNET_FS_publish_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | |||
886 | * @param pi structure to fill in | 890 | * @param pi structure to fill in |
887 | * @param dc overall download context | 891 | * @param dc overall download context |
888 | */ | 892 | */ |
889 | void GNUNET_FS_download_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | 893 | void |
890 | struct GNUNET_FS_DownloadContext *dc); | 894 | GNUNET_FS_download_make_status_ (struct GNUNET_FS_ProgressInfo *pi, |
895 | struct GNUNET_FS_DownloadContext *dc); | ||
891 | 896 | ||
892 | 897 | ||
893 | /** | 898 | /** |
@@ -897,9 +902,9 @@ void GNUNET_FS_download_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | |||
897 | * @param cls the 'struct GNUNET_FS_DownloadContext' | 902 | * @param cls the 'struct GNUNET_FS_DownloadContext' |
898 | * @param tc scheduler context | 903 | * @param tc scheduler context |
899 | */ | 904 | */ |
900 | void GNUNET_FS_download_start_task_ (void *cls, | 905 | void |
901 | const struct GNUNET_SCHEDULER_TaskContext | 906 | GNUNET_FS_download_start_task_ (void *cls, |
902 | *tc); | 907 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
903 | 908 | ||
904 | 909 | ||
905 | 910 | ||
@@ -911,9 +916,10 @@ void GNUNET_FS_download_start_task_ (void *cls, | |||
911 | * @param uc overall unindex context | 916 | * @param uc overall unindex context |
912 | * @param offset where we are in the file (for progress) | 917 | * @param offset where we are in the file (for progress) |
913 | */ | 918 | */ |
914 | void GNUNET_FS_unindex_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | 919 | void |
915 | struct GNUNET_FS_UnindexContext *uc, | 920 | GNUNET_FS_unindex_make_status_ (struct GNUNET_FS_ProgressInfo *pi, |
916 | uint64_t offset); | 921 | struct GNUNET_FS_UnindexContext *uc, |
922 | uint64_t offset); | ||
917 | 923 | ||
918 | /** | 924 | /** |
919 | * Fill in all of the generic fields for a search event and | 925 | * Fill in all of the generic fields for a search event and |
@@ -923,8 +929,9 @@ void GNUNET_FS_unindex_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | |||
923 | * @param sc overall search context | 929 | * @param sc overall search context |
924 | * @return value returned by the callback | 930 | * @return value returned by the callback |
925 | */ | 931 | */ |
926 | void *GNUNET_FS_search_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | 932 | void * |
927 | struct GNUNET_FS_SearchContext *sc); | 933 | GNUNET_FS_search_make_status_ (struct GNUNET_FS_ProgressInfo *pi, |
934 | struct GNUNET_FS_SearchContext *sc); | ||
928 | 935 | ||
929 | 936 | ||
930 | /** | 937 | /** |
@@ -932,7 +939,8 @@ void *GNUNET_FS_search_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | |||
932 | * | 939 | * |
933 | * @param uc context for the unindex operation. | 940 | * @param uc context for the unindex operation. |
934 | */ | 941 | */ |
935 | void GNUNET_FS_unindex_do_remove_ (struct GNUNET_FS_UnindexContext *uc); | 942 | void |
943 | GNUNET_FS_unindex_do_remove_ (struct GNUNET_FS_UnindexContext *uc); | ||
936 | 944 | ||
937 | /** | 945 | /** |
938 | * Build the request and actually initiate the search using the | 946 | * Build the request and actually initiate the search using the |
@@ -941,15 +949,16 @@ void GNUNET_FS_unindex_do_remove_ (struct GNUNET_FS_UnindexContext *uc); | |||
941 | * @param sc search context | 949 | * @param sc search context |
942 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 950 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
943 | */ | 951 | */ |
944 | int GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc); | 952 | int |
953 | GNUNET_FS_search_start_searching_ (struct GNUNET_FS_SearchContext *sc); | ||
945 | 954 | ||
946 | /** | 955 | /** |
947 | * Start the downloading process (by entering the queue). | 956 | * Start the downloading process (by entering the queue). |
948 | * | 957 | * |
949 | * @param dc our download context | 958 | * @param dc our download context |
950 | */ | 959 | */ |
951 | void GNUNET_FS_download_start_downloading_ (struct GNUNET_FS_DownloadContext | 960 | void |
952 | *dc); | 961 | GNUNET_FS_download_start_downloading_ (struct GNUNET_FS_DownloadContext *dc); |
953 | 962 | ||
954 | 963 | ||
955 | /** | 964 | /** |
@@ -957,7 +966,8 @@ void GNUNET_FS_download_start_downloading_ (struct GNUNET_FS_DownloadContext | |||
957 | * | 966 | * |
958 | * @param sr the search result | 967 | * @param sr the search result |
959 | */ | 968 | */ |
960 | void GNUNET_FS_search_start_probe_ (struct GNUNET_FS_SearchResult *sr); | 969 | void |
970 | GNUNET_FS_search_start_probe_ (struct GNUNET_FS_SearchResult *sr); | ||
961 | 971 | ||
962 | /** | 972 | /** |
963 | * Remove serialization/deserialization file from disk. | 973 | * Remove serialization/deserialization file from disk. |
@@ -966,8 +976,9 @@ void GNUNET_FS_search_start_probe_ (struct GNUNET_FS_SearchResult *sr); | |||
966 | * @param ext component of the path | 976 | * @param ext component of the path |
967 | * @param ent entity identifier | 977 | * @param ent entity identifier |
968 | */ | 978 | */ |
969 | void GNUNET_FS_remove_sync_file_ (struct GNUNET_FS_Handle *h, const char *ext, | 979 | void |
970 | const char *ent); | 980 | GNUNET_FS_remove_sync_file_ (struct GNUNET_FS_Handle *h, const char *ext, |
981 | const char *ent); | ||
971 | 982 | ||
972 | 983 | ||
973 | /** | 984 | /** |
@@ -977,8 +988,9 @@ void GNUNET_FS_remove_sync_file_ (struct GNUNET_FS_Handle *h, const char *ext, | |||
977 | * @param ext component of the path | 988 | * @param ext component of the path |
978 | * @param uni unique name of parent | 989 | * @param uni unique name of parent |
979 | */ | 990 | */ |
980 | void GNUNET_FS_remove_sync_dir_ (struct GNUNET_FS_Handle *h, const char *ext, | 991 | void |
981 | const char *uni); | 992 | GNUNET_FS_remove_sync_dir_ (struct GNUNET_FS_Handle *h, const char *ext, |
993 | const char *uni); | ||
982 | 994 | ||
983 | 995 | ||
984 | /** | 996 | /** |
@@ -989,7 +1001,8 @@ void GNUNET_FS_remove_sync_dir_ (struct GNUNET_FS_Handle *h, const char *ext, | |||
989 | * | 1001 | * |
990 | * @param fi the struct to sync | 1002 | * @param fi the struct to sync |
991 | */ | 1003 | */ |
992 | void GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation *f); | 1004 | void |
1005 | GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation *f); | ||
993 | 1006 | ||
994 | /** | 1007 | /** |
995 | * Synchronize this publishing struct with its mirror | 1008 | * Synchronize this publishing struct with its mirror |
@@ -999,7 +1012,8 @@ void GNUNET_FS_file_information_sync_ (struct GNUNET_FS_FileInformation *f); | |||
999 | * | 1012 | * |
1000 | * @param pc the struct to sync | 1013 | * @param pc the struct to sync |
1001 | */ | 1014 | */ |
1002 | void GNUNET_FS_publish_sync_ (struct GNUNET_FS_PublishContext *pc); | 1015 | void |
1016 | GNUNET_FS_publish_sync_ (struct GNUNET_FS_PublishContext *pc); | ||
1003 | 1017 | ||
1004 | /** | 1018 | /** |
1005 | * Synchronize this unindex struct with its mirror | 1019 | * Synchronize this unindex struct with its mirror |
@@ -1009,7 +1023,8 @@ void GNUNET_FS_publish_sync_ (struct GNUNET_FS_PublishContext *pc); | |||
1009 | * | 1023 | * |
1010 | * @param uc the struct to sync | 1024 | * @param uc the struct to sync |
1011 | */ | 1025 | */ |
1012 | void GNUNET_FS_unindex_sync_ (struct GNUNET_FS_UnindexContext *uc); | 1026 | void |
1027 | GNUNET_FS_unindex_sync_ (struct GNUNET_FS_UnindexContext *uc); | ||
1013 | 1028 | ||
1014 | /** | 1029 | /** |
1015 | * Synchronize this search struct with its mirror | 1030 | * Synchronize this search struct with its mirror |
@@ -1019,7 +1034,8 @@ void GNUNET_FS_unindex_sync_ (struct GNUNET_FS_UnindexContext *uc); | |||
1019 | * | 1034 | * |
1020 | * @param sc the struct to sync | 1035 | * @param sc the struct to sync |
1021 | */ | 1036 | */ |
1022 | void GNUNET_FS_search_sync_ (struct GNUNET_FS_SearchContext *sc); | 1037 | void |
1038 | GNUNET_FS_search_sync_ (struct GNUNET_FS_SearchContext *sc); | ||
1023 | 1039 | ||
1024 | /** | 1040 | /** |
1025 | * Synchronize this search result with its mirror | 1041 | * Synchronize this search result with its mirror |
@@ -1029,7 +1045,8 @@ void GNUNET_FS_search_sync_ (struct GNUNET_FS_SearchContext *sc); | |||
1029 | * | 1045 | * |
1030 | * @param sr the struct to sync | 1046 | * @param sr the struct to sync |
1031 | */ | 1047 | */ |
1032 | void GNUNET_FS_search_result_sync_ (struct GNUNET_FS_SearchResult *sr); | 1048 | void |
1049 | GNUNET_FS_search_result_sync_ (struct GNUNET_FS_SearchResult *sr); | ||
1033 | 1050 | ||
1034 | /** | 1051 | /** |
1035 | * Synchronize this download struct with its mirror | 1052 | * Synchronize this download struct with its mirror |
@@ -1039,7 +1056,8 @@ void GNUNET_FS_search_result_sync_ (struct GNUNET_FS_SearchResult *sr); | |||
1039 | * | 1056 | * |
1040 | * @param dc the struct to sync | 1057 | * @param dc the struct to sync |
1041 | */ | 1058 | */ |
1042 | void GNUNET_FS_download_sync_ (struct GNUNET_FS_DownloadContext *dc); | 1059 | void |
1060 | GNUNET_FS_download_sync_ (struct GNUNET_FS_DownloadContext *dc); | ||
1043 | 1061 | ||
1044 | /** | 1062 | /** |
1045 | * Create SUSPEND event for the given publish operation | 1063 | * Create SUSPEND event for the given publish operation |
@@ -1047,7 +1065,8 @@ void GNUNET_FS_download_sync_ (struct GNUNET_FS_DownloadContext *dc); | |||
1047 | * | 1065 | * |
1048 | * @param cls the 'struct GNUNET_FS_PublishContext' to signal for | 1066 | * @param cls the 'struct GNUNET_FS_PublishContext' to signal for |
1049 | */ | 1067 | */ |
1050 | void GNUNET_FS_publish_signal_suspend_ (void *cls); | 1068 | void |
1069 | GNUNET_FS_publish_signal_suspend_ (void *cls); | ||
1051 | 1070 | ||
1052 | /** | 1071 | /** |
1053 | * Create SUSPEND event for the given search operation | 1072 | * Create SUSPEND event for the given search operation |
@@ -1055,7 +1074,8 @@ void GNUNET_FS_publish_signal_suspend_ (void *cls); | |||
1055 | * | 1074 | * |
1056 | * @param cls the 'struct GNUNET_FS_SearchContext' to signal for | 1075 | * @param cls the 'struct GNUNET_FS_SearchContext' to signal for |
1057 | */ | 1076 | */ |
1058 | void GNUNET_FS_search_signal_suspend_ (void *cls); | 1077 | void |
1078 | GNUNET_FS_search_signal_suspend_ (void *cls); | ||
1059 | 1079 | ||
1060 | /** | 1080 | /** |
1061 | * Create SUSPEND event for the given download operation | 1081 | * Create SUSPEND event for the given download operation |
@@ -1063,7 +1083,8 @@ void GNUNET_FS_search_signal_suspend_ (void *cls); | |||
1063 | * | 1083 | * |
1064 | * @param cls the 'struct GNUNET_FS_DownloadContext' to signal for | 1084 | * @param cls the 'struct GNUNET_FS_DownloadContext' to signal for |
1065 | */ | 1085 | */ |
1066 | void GNUNET_FS_download_signal_suspend_ (void *cls); | 1086 | void |
1087 | GNUNET_FS_download_signal_suspend_ (void *cls); | ||
1067 | 1088 | ||
1068 | /** | 1089 | /** |
1069 | * Create SUSPEND event for the given unindex operation | 1090 | * Create SUSPEND event for the given unindex operation |
@@ -1071,7 +1092,8 @@ void GNUNET_FS_download_signal_suspend_ (void *cls); | |||
1071 | * | 1092 | * |
1072 | * @param cls the 'struct GNUNET_FS_UnindexContext' to signal for | 1093 | * @param cls the 'struct GNUNET_FS_UnindexContext' to signal for |
1073 | */ | 1094 | */ |
1074 | void GNUNET_FS_unindex_signal_suspend_ (void *cls); | 1095 | void |
1096 | GNUNET_FS_unindex_signal_suspend_ (void *cls); | ||
1075 | 1097 | ||
1076 | /** | 1098 | /** |
1077 | * Function signature of the functions that can be called | 1099 | * Function signature of the functions that can be called |
@@ -1118,9 +1140,9 @@ struct TopLevelActivity | |||
1118 | * @param ssf_cls closure for ssf | 1140 | * @param ssf_cls closure for ssf |
1119 | * @return fresh top-level activity handle | 1141 | * @return fresh top-level activity handle |
1120 | */ | 1142 | */ |
1121 | struct TopLevelActivity *GNUNET_FS_make_top (struct GNUNET_FS_Handle *h, | 1143 | struct TopLevelActivity * |
1122 | SuspendSignalFunction ssf, | 1144 | GNUNET_FS_make_top (struct GNUNET_FS_Handle *h, SuspendSignalFunction ssf, |
1123 | void *ssf_cls); | 1145 | void *ssf_cls); |
1124 | 1146 | ||
1125 | 1147 | ||
1126 | /** | 1148 | /** |
@@ -1129,8 +1151,8 @@ struct TopLevelActivity *GNUNET_FS_make_top (struct GNUNET_FS_Handle *h, | |||
1129 | * @param h global fs handle | 1151 | * @param h global fs handle |
1130 | * @param top top level activity entry | 1152 | * @param top top level activity entry |
1131 | */ | 1153 | */ |
1132 | void GNUNET_FS_end_top (struct GNUNET_FS_Handle *h, | 1154 | void |
1133 | struct TopLevelActivity *top); | 1155 | GNUNET_FS_end_top (struct GNUNET_FS_Handle *h, struct TopLevelActivity *top); |
1134 | 1156 | ||
1135 | 1157 | ||
1136 | 1158 | ||
@@ -1736,7 +1758,8 @@ struct DownloadRequest | |||
1736 | * | 1758 | * |
1737 | * @param dr request to free | 1759 | * @param dr request to free |
1738 | */ | 1760 | */ |
1739 | void GNUNET_FS_free_download_request_ (struct DownloadRequest *dr); | 1761 | void |
1762 | GNUNET_FS_free_download_request_ (struct DownloadRequest *dr); | ||
1740 | 1763 | ||
1741 | 1764 | ||
1742 | /** | 1765 | /** |
diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index a3c5b9b62..89de277da 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c | |||
@@ -143,7 +143,8 @@ GNUNET_FS_download_make_status_ (struct GNUNET_FS_ProgressInfo *pi, | |||
143 | * @param buf where the callee should write the message | 143 | * @param buf where the callee should write the message |
144 | * @return number of bytes written to buf | 144 | * @return number of bytes written to buf |
145 | */ | 145 | */ |
146 | static size_t transmit_download_request (void *cls, size_t size, void *buf); | 146 | static size_t |
147 | transmit_download_request (void *cls, size_t size, void *buf); | ||
147 | 148 | ||
148 | 149 | ||
149 | /** | 150 | /** |
@@ -194,8 +195,9 @@ struct ProcessResultClosure | |||
194 | * @param value value in the hash map (a 'struct DownloadRequest') | 195 | * @param value value in the hash map (a 'struct DownloadRequest') |
195 | * @return GNUNET_YES (we should continue to iterate); unless serious error | 196 | * @return GNUNET_YES (we should continue to iterate); unless serious error |
196 | */ | 197 | */ |
197 | static int process_result_with_request (void *cls, const GNUNET_HashCode * key, | 198 | static int |
198 | void *value); | 199 | process_result_with_request (void *cls, const GNUNET_HashCode * key, |
200 | void *value); | ||
199 | 201 | ||
200 | 202 | ||
201 | /** | 203 | /** |
@@ -261,7 +263,8 @@ encrypt_existing_match (struct GNUNET_FS_DownloadContext *dc, | |||
261 | * | 263 | * |
262 | * @param dc download context that is having trouble | 264 | * @param dc download context that is having trouble |
263 | */ | 265 | */ |
264 | static void try_reconnect (struct GNUNET_FS_DownloadContext *dc); | 266 | static void |
267 | try_reconnect (struct GNUNET_FS_DownloadContext *dc); | ||
265 | 268 | ||
266 | 269 | ||
267 | /** | 270 | /** |
@@ -275,10 +278,11 @@ static void try_reconnect (struct GNUNET_FS_DownloadContext *dc); | |||
275 | * @param length number of bytes in data | 278 | * @param length number of bytes in data |
276 | * @param data contents of the file (or NULL if they were not inlined) | 279 | * @param data contents of the file (or NULL if they were not inlined) |
277 | */ | 280 | */ |
278 | static void trigger_recursive_download (void *cls, const char *filename, | 281 | static void |
279 | const struct GNUNET_FS_Uri *uri, | 282 | trigger_recursive_download (void *cls, const char *filename, |
280 | const struct GNUNET_CONTAINER_MetaData | 283 | const struct GNUNET_FS_Uri *uri, |
281 | *meta, size_t length, const void *data); | 284 | const struct GNUNET_CONTAINER_MetaData *meta, |
285 | size_t length, const void *data); | ||
282 | 286 | ||
283 | 287 | ||
284 | /** | 288 | /** |
@@ -940,8 +944,8 @@ process_result_with_request (void *cls, const GNUNET_HashCode * key, | |||
940 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 944 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
941 | "Received block `%s' matching pending request at depth %u and offset %llu/%llu\n", | 945 | "Received block `%s' matching pending request at depth %u and offset %llu/%llu\n", |
942 | GNUNET_h2s (key), dr->depth, (unsigned long long) dr->offset, | 946 | GNUNET_h2s (key), dr->depth, (unsigned long long) dr->offset, |
943 | (unsigned long long) GNUNET_ntohll (dc->uri->data.chk. | 947 | (unsigned long long) GNUNET_ntohll (dc->uri->data. |
944 | file_length)); | 948 | chk.file_length)); |
945 | 949 | ||
946 | #endif | 950 | #endif |
947 | bs = GNUNET_FS_tree_calculate_block_size (GNUNET_ntohll | 951 | bs = GNUNET_FS_tree_calculate_block_size (GNUNET_ntohll |
@@ -953,8 +957,8 @@ process_result_with_request (void *cls, const GNUNET_HashCode * key, | |||
953 | _ | 957 | _ |
954 | ("Internal error or bogus download URI (expected %u bytes at depth %u and offset %llu/%llu, got %u bytes)\n"), | 958 | ("Internal error or bogus download URI (expected %u bytes at depth %u and offset %llu/%llu, got %u bytes)\n"), |
955 | bs, dr->depth, (unsigned long long) dr->offset, | 959 | bs, dr->depth, (unsigned long long) dr->offset, |
956 | (unsigned long long) GNUNET_ntohll (dc->uri->data.chk. | 960 | (unsigned long long) GNUNET_ntohll (dc->uri->data. |
957 | file_length), | 961 | chk.file_length), |
958 | prc->size); | 962 | prc->size); |
959 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "%s", dc->emsg); | 963 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "%s", dc->emsg); |
960 | while (dr->parent != NULL) | 964 | while (dr->parent != NULL) |
@@ -1077,8 +1081,8 @@ process_result_with_request (void *cls, const GNUNET_HashCode * key, | |||
1077 | #if DEBUG_DOWNLOAD | 1081 | #if DEBUG_DOWNLOAD |
1078 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1082 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1079 | "Download completed, truncating file to desired length %llu\n", | 1083 | "Download completed, truncating file to desired length %llu\n", |
1080 | (unsigned long long) GNUNET_ntohll (dc->uri->data.chk. | 1084 | (unsigned long long) GNUNET_ntohll (dc->uri->data. |
1081 | file_length)); | 1085 | chk.file_length)); |
1082 | #endif | 1086 | #endif |
1083 | /* truncate file to size (since we store IBlocks at the end) */ | 1087 | /* truncate file to size (since we store IBlocks at the end) */ |
1084 | if (dc->filename != NULL) | 1088 | if (dc->filename != NULL) |
@@ -1757,8 +1761,7 @@ GNUNET_FS_download_start_task_ (void *cls, | |||
1757 | GNUNET_DISK_OPEN_READWRITE | | 1761 | GNUNET_DISK_OPEN_READWRITE | |
1758 | GNUNET_DISK_OPEN_CREATE | | 1762 | GNUNET_DISK_OPEN_CREATE | |
1759 | ((0 == | 1763 | ((0 == |
1760 | GNUNET_FS_uri_chk_get_file_size (dc-> | 1764 | GNUNET_FS_uri_chk_get_file_size (dc->uri)) ? |
1761 | uri)) ? | ||
1762 | GNUNET_DISK_OPEN_TRUNCATE : 0), | 1765 | GNUNET_DISK_OPEN_TRUNCATE : 0), |
1763 | GNUNET_DISK_PERM_USER_READ | | 1766 | GNUNET_DISK_PERM_USER_READ | |
1764 | GNUNET_DISK_PERM_USER_WRITE | | 1767 | GNUNET_DISK_PERM_USER_WRITE | |
diff --git a/src/fs/fs_file_information.c b/src/fs/fs_file_information.c index 6809e3055..a67b22036 100644 --- a/src/fs/fs_file_information.c +++ b/src/fs/fs_file_information.c | |||
@@ -638,8 +638,8 @@ GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, | |||
638 | no = GNUNET_NO; | 638 | no = GNUNET_NO; |
639 | if (GNUNET_OK != | 639 | if (GNUNET_OK != |
640 | proc (proc_cls, dir, | 640 | proc (proc_cls, dir, |
641 | (dir->is_directory) ? dir->data.dir.dir_size : dir->data.file. | 641 | (dir->is_directory) ? dir->data.dir.dir_size : dir->data. |
642 | file_size, dir->meta, &dir->keywords, &dir->bo, | 642 | file.file_size, dir->meta, &dir->keywords, &dir->bo, |
643 | (dir->is_directory) ? &no : &dir->data.file.do_index, | 643 | (dir->is_directory) ? &no : &dir->data.file.do_index, |
644 | &dir->client_info)) | 644 | &dir->client_info)) |
645 | return; | 645 | return; |
@@ -651,8 +651,8 @@ GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, | |||
651 | no = GNUNET_NO; | 651 | no = GNUNET_NO; |
652 | if (GNUNET_OK != | 652 | if (GNUNET_OK != |
653 | proc (proc_cls, pos, | 653 | proc (proc_cls, pos, |
654 | (pos->is_directory) ? pos->data.dir.dir_size : pos->data.file. | 654 | (pos->is_directory) ? pos->data.dir.dir_size : pos->data. |
655 | file_size, pos->meta, &pos->keywords, &pos->bo, | 655 | file.file_size, pos->meta, &pos->keywords, &pos->bo, |
656 | (dir->is_directory) ? &no : &dir->data.file.do_index, | 656 | (dir->is_directory) ? &no : &dir->data.file.do_index, |
657 | &pos->client_info)) | 657 | &pos->client_info)) |
658 | break; | 658 | break; |
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c index 746f4f099..94641e934 100644 --- a/src/fs/fs_publish.c +++ b/src/fs/fs_publish.c | |||
@@ -179,8 +179,8 @@ signal_publish_completion (struct GNUNET_FS_FileInformation *p, | |||
179 | pi.value.publish.specifics.completed.chk_uri = p->chk_uri; | 179 | pi.value.publish.specifics.completed.chk_uri = p->chk_uri; |
180 | p->client_info = | 180 | p->client_info = |
181 | GNUNET_FS_publish_make_status_ (&pi, pc, p, | 181 | GNUNET_FS_publish_make_status_ (&pi, pc, p, |
182 | GNUNET_ntohll (p->chk_uri->data.chk. | 182 | GNUNET_ntohll (p->chk_uri->data. |
183 | file_length)); | 183 | chk.file_length)); |
184 | } | 184 | } |
185 | 185 | ||
186 | 186 | ||
@@ -1333,8 +1333,8 @@ struct PublishKskContext | |||
1333 | * @param cls closure of type "struct PublishKskContext*" | 1333 | * @param cls closure of type "struct PublishKskContext*" |
1334 | * @param tc unused | 1334 | * @param tc unused |
1335 | */ | 1335 | */ |
1336 | static void publish_ksk_cont (void *cls, | 1336 | static void |
1337 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 1337 | publish_ksk_cont (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
1338 | 1338 | ||
1339 | 1339 | ||
1340 | /** | 1340 | /** |
diff --git a/src/fs/fs_search.c b/src/fs/fs_search.c index 89a8c5582..0c47eb173 100644 --- a/src/fs/fs_search.c +++ b/src/fs/fs_search.c | |||
@@ -440,15 +440,10 @@ process_ksk_result (struct GNUNET_FS_SearchContext *sc, | |||
440 | * @param psearch parent search result (for namespace update searches) | 440 | * @param psearch parent search result (for namespace update searches) |
441 | * @return context that can be used to control the search | 441 | * @return context that can be used to control the search |
442 | */ | 442 | */ |
443 | static struct GNUNET_FS_SearchContext *search_start (struct GNUNET_FS_Handle *h, | 443 | static struct GNUNET_FS_SearchContext * |
444 | const struct GNUNET_FS_Uri | 444 | search_start (struct GNUNET_FS_Handle *h, const struct GNUNET_FS_Uri *uri, |
445 | *uri, uint32_t anonymity, | 445 | uint32_t anonymity, enum GNUNET_FS_SearchOptions options, |
446 | enum | 446 | void *cctx, struct GNUNET_FS_SearchResult *psearch); |
447 | GNUNET_FS_SearchOptions | ||
448 | options, void *cctx, | ||
449 | struct | ||
450 | GNUNET_FS_SearchResult | ||
451 | *psearch); | ||
452 | 447 | ||
453 | 448 | ||
454 | /** | 449 | /** |
@@ -813,7 +808,8 @@ process_result (struct GNUNET_FS_SearchContext *sc, enum GNUNET_BLOCK_Type type, | |||
813 | * | 808 | * |
814 | * @param sc the search to reconnec | 809 | * @param sc the search to reconnec |
815 | */ | 810 | */ |
816 | static void try_reconnect (struct GNUNET_FS_SearchContext *sc); | 811 | static void |
812 | try_reconnect (struct GNUNET_FS_SearchContext *sc); | ||
817 | 813 | ||
818 | 814 | ||
819 | /** | 815 | /** |
@@ -855,8 +851,8 @@ receive_results (void *cls, const struct GNUNET_MessageHeader *msg) | |||
855 | * | 851 | * |
856 | * @param sc context for the search | 852 | * @param sc context for the search |
857 | */ | 853 | */ |
858 | static void schedule_transmit_search_request (struct GNUNET_FS_SearchContext | 854 | static void |
859 | *sc); | 855 | schedule_transmit_search_request (struct GNUNET_FS_SearchContext *sc); |
860 | 856 | ||
861 | 857 | ||
862 | /** | 858 | /** |
diff --git a/src/fs/fs_test_lib.h b/src/fs/fs_test_lib.h index fa822e265..ad1d96bf0 100644 --- a/src/fs/fs_test_lib.h +++ b/src/fs/fs_test_lib.h | |||
@@ -53,11 +53,12 @@ struct GNUNET_FS_TestDaemon; | |||
53 | * 'GNUNET_FS_TEST_daemons_stop'! | 53 | * 'GNUNET_FS_TEST_daemons_stop'! |
54 | * @param cont_cls closure for cont | 54 | * @param cont_cls closure for cont |
55 | */ | 55 | */ |
56 | void GNUNET_FS_TEST_daemons_start (const char *template_cfg_file, | 56 | void |
57 | struct GNUNET_TIME_Relative timeout, | 57 | GNUNET_FS_TEST_daemons_start (const char *template_cfg_file, |
58 | unsigned int total, | 58 | struct GNUNET_TIME_Relative timeout, |
59 | struct GNUNET_FS_TestDaemon **daemons, | 59 | unsigned int total, |
60 | GNUNET_SCHEDULER_Task cont, void *cont_cls); | 60 | struct GNUNET_FS_TestDaemon **daemons, |
61 | GNUNET_SCHEDULER_Task cont, void *cont_cls); | ||
61 | 62 | ||
62 | 63 | ||
63 | /** | 64 | /** |
@@ -70,11 +71,11 @@ void GNUNET_FS_TEST_daemons_start (const char *template_cfg_file, | |||
70 | * @param cont function to call when done | 71 | * @param cont function to call when done |
71 | * @param cont_cls closure for cont | 72 | * @param cont_cls closure for cont |
72 | */ | 73 | */ |
73 | void GNUNET_FS_TEST_daemons_connect (struct GNUNET_FS_TestDaemon *daemon1, | 74 | void |
74 | struct GNUNET_FS_TestDaemon *daemon2, | 75 | GNUNET_FS_TEST_daemons_connect (struct GNUNET_FS_TestDaemon *daemon1, |
75 | struct GNUNET_TIME_Relative timeout, | 76 | struct GNUNET_FS_TestDaemon *daemon2, |
76 | GNUNET_SCHEDULER_Task cont, | 77 | struct GNUNET_TIME_Relative timeout, |
77 | void *cont_cls); | 78 | GNUNET_SCHEDULER_Task cont, void *cont_cls); |
78 | 79 | ||
79 | 80 | ||
80 | /** | 81 | /** |
@@ -83,9 +84,8 @@ void GNUNET_FS_TEST_daemons_connect (struct GNUNET_FS_TestDaemon *daemon1, | |||
83 | * @param daemons array with the daemons (must contain at least one) | 84 | * @param daemons array with the daemons (must contain at least one) |
84 | * @return peer group | 85 | * @return peer group |
85 | */ | 86 | */ |
86 | struct GNUNET_TESTING_PeerGroup *GNUNET_FS_TEST_get_group (struct | 87 | struct GNUNET_TESTING_PeerGroup * |
87 | GNUNET_FS_TestDaemon | 88 | GNUNET_FS_TEST_get_group (struct GNUNET_FS_TestDaemon **daemons); |
88 | **daemons); | ||
89 | 89 | ||
90 | 90 | ||
91 | 91 | ||
@@ -96,9 +96,9 @@ struct GNUNET_TESTING_PeerGroup *GNUNET_FS_TEST_get_group (struct | |||
96 | * @param off which configuration to get | 96 | * @param off which configuration to get |
97 | * @return peer configuration | 97 | * @return peer configuration |
98 | */ | 98 | */ |
99 | const struct GNUNET_CONFIGURATION_Handle | 99 | const struct GNUNET_CONFIGURATION_Handle * |
100 | *GNUNET_FS_TEST_get_configuration (struct GNUNET_FS_TestDaemon **daemons, | 100 | GNUNET_FS_TEST_get_configuration (struct GNUNET_FS_TestDaemon **daemons, |
101 | unsigned int off); | 101 | unsigned int off); |
102 | 102 | ||
103 | /** | 103 | /** |
104 | * Stop daemons used for testing. | 104 | * Stop daemons used for testing. |
@@ -106,8 +106,9 @@ const struct GNUNET_CONFIGURATION_Handle | |||
106 | * @param total number of daemons to stop | 106 | * @param total number of daemons to stop |
107 | * @param daemons array with the daemons (values will be clobbered) | 107 | * @param daemons array with the daemons (values will be clobbered) |
108 | */ | 108 | */ |
109 | void GNUNET_FS_TEST_daemons_stop (unsigned int total, | 109 | void |
110 | struct GNUNET_FS_TestDaemon **daemons); | 110 | GNUNET_FS_TEST_daemons_stop (unsigned int total, |
111 | struct GNUNET_FS_TestDaemon **daemons); | ||
111 | 112 | ||
112 | 113 | ||
113 | /** | 114 | /** |
@@ -136,12 +137,12 @@ typedef void (*GNUNET_FS_TEST_UriContinuation) (void *cls, | |||
136 | * @param cont function to call when done | 137 | * @param cont function to call when done |
137 | * @param cont_cls closure for cont | 138 | * @param cont_cls closure for cont |
138 | */ | 139 | */ |
139 | void GNUNET_FS_TEST_publish (struct GNUNET_FS_TestDaemon *daemon, | 140 | void |
140 | struct GNUNET_TIME_Relative timeout, | 141 | GNUNET_FS_TEST_publish (struct GNUNET_FS_TestDaemon *daemon, |
141 | uint32_t anonymity, int do_index, uint64_t size, | 142 | struct GNUNET_TIME_Relative timeout, uint32_t anonymity, |
142 | uint32_t seed, unsigned int verbose, | 143 | int do_index, uint64_t size, uint32_t seed, |
143 | GNUNET_FS_TEST_UriContinuation cont, | 144 | unsigned int verbose, |
144 | void *cont_cls); | 145 | GNUNET_FS_TEST_UriContinuation cont, void *cont_cls); |
145 | 146 | ||
146 | 147 | ||
147 | /** | 148 | /** |
@@ -157,12 +158,12 @@ void GNUNET_FS_TEST_publish (struct GNUNET_FS_TestDaemon *daemon, | |||
157 | * @param cont function to call when done | 158 | * @param cont function to call when done |
158 | * @param cont_cls closure for cont | 159 | * @param cont_cls closure for cont |
159 | */ | 160 | */ |
160 | void GNUNET_FS_TEST_download (struct GNUNET_FS_TestDaemon *daemon, | 161 | void |
161 | struct GNUNET_TIME_Relative timeout, | 162 | GNUNET_FS_TEST_download (struct GNUNET_FS_TestDaemon *daemon, |
162 | uint32_t anonymity, uint32_t seed, | 163 | struct GNUNET_TIME_Relative timeout, |
163 | const struct GNUNET_FS_Uri *uri, | 164 | uint32_t anonymity, uint32_t seed, |
164 | unsigned int verbose, GNUNET_SCHEDULER_Task cont, | 165 | const struct GNUNET_FS_Uri *uri, unsigned int verbose, |
165 | void *cont_cls); | 166 | GNUNET_SCHEDULER_Task cont, void *cont_cls); |
166 | 167 | ||
167 | 168 | ||
168 | 169 | ||
diff --git a/src/fs/fs_tree.c b/src/fs/fs_tree.c index 0a0db7a10..58d0f0127 100644 --- a/src/fs/fs_tree.c +++ b/src/fs/fs_tree.c | |||
@@ -395,8 +395,7 @@ GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te) | |||
395 | if (NULL != te->proc) | 395 | if (NULL != te->proc) |
396 | te->proc (te->cls, mychk, te->publish_offset, te->current_depth, | 396 | te->proc (te->cls, mychk, te->publish_offset, te->current_depth, |
397 | (0 == | 397 | (0 == |
398 | te-> | 398 | te->current_depth) ? GNUNET_BLOCK_TYPE_FS_DBLOCK : |
399 | current_depth) ? GNUNET_BLOCK_TYPE_FS_DBLOCK : | ||
400 | GNUNET_BLOCK_TYPE_FS_IBLOCK, enc, pt_size); | 399 | GNUNET_BLOCK_TYPE_FS_IBLOCK, enc, pt_size); |
401 | if (NULL != te->progress) | 400 | if (NULL != te->progress) |
402 | te->progress (te->cls, te->publish_offset, pt_block, pt_size, | 401 | te->progress (te->cls, te->publish_offset, pt_block, pt_size, |
diff --git a/src/fs/fs_tree.h b/src/fs/fs_tree.h index 532c9e9aa..b39a47cd3 100644 --- a/src/fs/fs_tree.h +++ b/src/fs/fs_tree.h | |||
@@ -40,7 +40,8 @@ | |||
40 | * @param flen file length for which to compute the depth | 40 | * @param flen file length for which to compute the depth |
41 | * @return depth of the tree, always > 0. A depth of 1 means only a DBLOCK. | 41 | * @return depth of the tree, always > 0. A depth of 1 means only a DBLOCK. |
42 | */ | 42 | */ |
43 | unsigned int GNUNET_FS_compute_depth (uint64_t flen); | 43 | unsigned int |
44 | GNUNET_FS_compute_depth (uint64_t flen); | ||
44 | 45 | ||
45 | 46 | ||
46 | /** | 47 | /** |
@@ -52,7 +53,8 @@ unsigned int GNUNET_FS_compute_depth (uint64_t flen); | |||
52 | * @param depth depth of the block. depth==0 is a DBLOCK. | 53 | * @param depth depth of the block. depth==0 is a DBLOCK. |
53 | * @return number of bytes of payload a subtree of this depth may correspond to | 54 | * @return number of bytes of payload a subtree of this depth may correspond to |
54 | */ | 55 | */ |
55 | uint64_t GNUNET_FS_tree_compute_tree_size (unsigned int depth); | 56 | uint64_t |
57 | GNUNET_FS_tree_compute_tree_size (unsigned int depth); | ||
56 | 58 | ||
57 | 59 | ||
58 | /** | 60 | /** |
@@ -66,8 +68,9 @@ uint64_t GNUNET_FS_tree_compute_tree_size (unsigned int depth); | |||
66 | * @param depth depth of the node in the tree, 0 for DBLOCK | 68 | * @param depth depth of the node in the tree, 0 for DBLOCK |
67 | * @return number of bytes stored in this node | 69 | * @return number of bytes stored in this node |
68 | */ | 70 | */ |
69 | size_t GNUNET_FS_tree_calculate_block_size (uint64_t fsize, uint64_t offset, | 71 | size_t |
70 | unsigned int depth); | 72 | GNUNET_FS_tree_calculate_block_size (uint64_t fsize, uint64_t offset, |
73 | unsigned int depth); | ||
71 | 74 | ||
72 | 75 | ||
73 | /** | 76 | /** |
@@ -134,18 +137,12 @@ typedef void (*GNUNET_FS_TreeProgressCallback) (void *cls, uint64_t offset, | |||
134 | * @param cont function to call when done | 137 | * @param cont function to call when done |
135 | * @return tree encoder context | 138 | * @return tree encoder context |
136 | */ | 139 | */ |
137 | struct GNUNET_FS_TreeEncoder *GNUNET_FS_tree_encoder_create (struct | 140 | struct GNUNET_FS_TreeEncoder * |
138 | GNUNET_FS_Handle | 141 | GNUNET_FS_tree_encoder_create (struct GNUNET_FS_Handle *h, uint64_t size, |
139 | *h, uint64_t size, | 142 | void *cls, GNUNET_FS_DataReader reader, |
140 | void *cls, | 143 | GNUNET_FS_TreeBlockProcessor proc, |
141 | GNUNET_FS_DataReader | 144 | GNUNET_FS_TreeProgressCallback progress, |
142 | reader, | 145 | GNUNET_SCHEDULER_Task cont); |
143 | GNUNET_FS_TreeBlockProcessor | ||
144 | proc, | ||
145 | GNUNET_FS_TreeProgressCallback | ||
146 | progress, | ||
147 | GNUNET_SCHEDULER_Task | ||
148 | cont); | ||
149 | 146 | ||
150 | 147 | ||
151 | /** | 148 | /** |
@@ -156,7 +153,8 @@ struct GNUNET_FS_TreeEncoder *GNUNET_FS_tree_encoder_create (struct | |||
156 | * | 153 | * |
157 | * @param te tree encoder to use | 154 | * @param te tree encoder to use |
158 | */ | 155 | */ |
159 | void GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te); | 156 | void |
157 | GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te); | ||
160 | 158 | ||
161 | 159 | ||
162 | /** | 160 | /** |
@@ -170,8 +168,9 @@ void GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder *te); | |||
170 | * prior to completion and prior to an internal error, | 168 | * prior to completion and prior to an internal error, |
171 | * both "*uri" and "*emsg" will be set to NULL). | 169 | * both "*uri" and "*emsg" will be set to NULL). |
172 | */ | 170 | */ |
173 | void GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder *te, | 171 | void |
174 | struct GNUNET_FS_Uri **uri, char **emsg); | 172 | GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder *te, |
173 | struct GNUNET_FS_Uri **uri, char **emsg); | ||
175 | 174 | ||
176 | 175 | ||
177 | #if 0 | 176 | #if 0 |
@@ -185,8 +184,9 @@ void GNUNET_FS_tree_encoder_finish (struct GNUNET_FS_TreeEncoder *te, | |||
185 | * @param data set to the resume data | 184 | * @param data set to the resume data |
186 | * @param size set to the size of the resume data | 185 | * @param size set to the size of the resume data |
187 | */ | 186 | */ |
188 | void GNUNET_FS_tree_encoder_resume_get_data (const struct GNUNET_FS_TreeEncoder | 187 | void |
189 | *te, void **data, size_t * size); | 188 | GNUNET_FS_tree_encoder_resume_get_data (const struct GNUNET_FS_TreeEncoder *te, |
189 | void **data, size_t * size); | ||
190 | 190 | ||
191 | 191 | ||
192 | /** | 192 | /** |
@@ -197,8 +197,9 @@ void GNUNET_FS_tree_encoder_resume_get_data (const struct GNUNET_FS_TreeEncoder | |||
197 | * @param data the resume data | 197 | * @param data the resume data |
198 | * @param size the size of the resume data | 198 | * @param size the size of the resume data |
199 | */ | 199 | */ |
200 | void GNUNET_FS_tree_encoder_resume (struct GNUNET_FS_TreeEncoder *te, | 200 | void |
201 | const void *data, size_t size); | 201 | GNUNET_FS_tree_encoder_resume (struct GNUNET_FS_TreeEncoder *te, |
202 | const void *data, size_t size); | ||
202 | #endif | 203 | #endif |
203 | 204 | ||
204 | #endif | 205 | #endif |
diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c index 22dab4955..206a8adca 100644 --- a/src/fs/fs_uri.c +++ b/src/fs/fs_uri.c | |||
@@ -1834,8 +1834,8 @@ uri_loc_to_string (const struct GNUNET_FS_Uri *uri) | |||
1834 | GNUNET_asprintf (&ret, "%s%s%s.%s.%llu.%s.%s.%llu", GNUNET_FS_URI_PREFIX, | 1834 | GNUNET_asprintf (&ret, "%s%s%s.%s.%llu.%s.%s.%llu", GNUNET_FS_URI_PREFIX, |
1835 | GNUNET_FS_URI_LOC_INFIX, (const char *) &keyhash, | 1835 | GNUNET_FS_URI_LOC_INFIX, (const char *) &keyhash, |
1836 | (const char *) &queryhash, | 1836 | (const char *) &queryhash, |
1837 | (unsigned long long) GNUNET_ntohll (uri->data.loc.fi. | 1837 | (unsigned long long) GNUNET_ntohll (uri->data.loc. |
1838 | file_length), peerId, | 1838 | fi.file_length), peerId, |
1839 | peerSig, | 1839 | peerSig, |
1840 | (unsigned long long) uri->data.loc.expirationTime.abs_value); | 1840 | (unsigned long long) uri->data.loc.expirationTime.abs_value); |
1841 | GNUNET_free (peerSig); | 1841 | GNUNET_free (peerSig); |
diff --git a/src/fs/gnunet-download.c b/src/fs/gnunet-download.c index 9f18cb99c..748a8f09c 100644 --- a/src/fs/gnunet-download.c +++ b/src/fs/gnunet-download.c | |||
@@ -106,8 +106,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) | |||
106 | s = GNUNET_STRINGS_relative_time_to_string (info->value.download.eta); | 106 | s = GNUNET_STRINGS_relative_time_to_string (info->value.download.eta); |
107 | t = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * | 107 | t = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * |
108 | 1000LL / | 108 | 1000LL / |
109 | (info->value.download.duration. | 109 | (info->value.download. |
110 | rel_value + 1)); | 110 | duration.rel_value + 1)); |
111 | fprintf (stdout, | 111 | fprintf (stdout, |
112 | _("Downloading `%s' at %llu/%llu (%s remaining, %s/s)\n"), | 112 | _("Downloading `%s' at %llu/%llu (%s remaining, %s/s)\n"), |
113 | info->value.download.filename, | 113 | info->value.download.filename, |
@@ -124,8 +124,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) | |||
124 | break; | 124 | break; |
125 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: | 125 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: |
126 | s = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * 1000 / | 126 | s = GNUNET_STRINGS_byte_size_fancy (info->value.download.completed * 1000 / |
127 | (info->value.download.duration. | 127 | (info->value.download. |
128 | rel_value + 1)); | 128 | duration.rel_value + 1)); |
129 | fprintf (stdout, _("Downloading `%s' done (%s/s).\n"), | 129 | fprintf (stdout, _("Downloading `%s' done (%s/s).\n"), |
130 | info->value.download.filename, s); | 130 | info->value.download.filename, s); |
131 | GNUNET_free (s); | 131 | GNUNET_free (s); |
diff --git a/src/fs/gnunet-publish.c b/src/fs/gnunet-publish.c index a67886f7d..7edad6979 100644 --- a/src/fs/gnunet-publish.c +++ b/src/fs/gnunet-publish.c | |||
@@ -133,8 +133,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) | |||
133 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 133 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
134 | fprintf (stdout, _("Publishing `%s' done.\n"), | 134 | fprintf (stdout, _("Publishing `%s' done.\n"), |
135 | info->value.publish.filename); | 135 | info->value.publish.filename); |
136 | s = GNUNET_FS_uri_to_string (info->value.publish.specifics.completed. | 136 | s = GNUNET_FS_uri_to_string (info->value.publish.specifics. |
137 | chk_uri); | 137 | completed.chk_uri); |
138 | fprintf (stdout, _("URI is `%s'.\n"), s); | 138 | fprintf (stdout, _("URI is `%s'.\n"), s); |
139 | GNUNET_free (s); | 139 | GNUNET_free (s); |
140 | if (info->value.publish.pctx == NULL) | 140 | if (info->value.publish.pctx == NULL) |
diff --git a/src/fs/gnunet-search.c b/src/fs/gnunet-search.c index c82a0794c..eb5345833 100644 --- a/src/fs/gnunet-search.c +++ b/src/fs/gnunet-search.c | |||
@@ -150,8 +150,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) | |||
150 | uri = GNUNET_FS_uri_to_string (info->value.search.specifics.result.uri); | 150 | uri = GNUNET_FS_uri_to_string (info->value.search.specifics.result.uri); |
151 | printf ("#%u:\n", cnt++); | 151 | printf ("#%u:\n", cnt++); |
152 | filename = | 152 | filename = |
153 | GNUNET_CONTAINER_meta_data_get_by_type (info->value.search.specifics. | 153 | GNUNET_CONTAINER_meta_data_get_by_type (info->value.search. |
154 | result.meta, | 154 | specifics.result.meta, |
155 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME); | 155 | EXTRACTOR_METATYPE_GNUNET_ORIGINAL_FILENAME); |
156 | if (filename != NULL) | 156 | if (filename != NULL) |
157 | { | 157 | { |
@@ -162,8 +162,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *info) | |||
162 | else | 162 | else |
163 | printf ("gnunet-download %s\n", uri); | 163 | printf ("gnunet-download %s\n", uri); |
164 | if (verbose) | 164 | if (verbose) |
165 | GNUNET_CONTAINER_meta_data_iterate (info->value.search.specifics.result. | 165 | GNUNET_CONTAINER_meta_data_iterate (info->value.search.specifics. |
166 | meta, &item_printer, NULL); | 166 | result.meta, &item_printer, NULL); |
167 | printf ("\n"); | 167 | printf ("\n"); |
168 | fflush (stdout); | 168 | fflush (stdout); |
169 | GNUNET_free_non_null (filename); | 169 | GNUNET_free_non_null (filename); |
diff --git a/src/fs/gnunet-service-fs.h b/src/fs/gnunet-service-fs.h index 56604185f..bee814318 100644 --- a/src/fs/gnunet-service-fs.h +++ b/src/fs/gnunet-service-fs.h | |||
@@ -167,7 +167,8 @@ extern int GSF_enable_randomized_delays; | |||
167 | * GNUNET_NO to process normally (load normal) | 167 | * GNUNET_NO to process normally (load normal) |
168 | * GNUNET_SYSERR to process for free (load low) | 168 | * GNUNET_SYSERR to process for free (load low) |
169 | */ | 169 | */ |
170 | int GSF_test_get_load_too_high_ (uint32_t priority); | 170 | int |
171 | GSF_test_get_load_too_high_ (uint32_t priority); | ||
171 | 172 | ||
172 | 173 | ||
173 | /** | 174 | /** |
@@ -176,7 +177,8 @@ int GSF_test_get_load_too_high_ (uint32_t priority); | |||
176 | * | 177 | * |
177 | * @param start time when the datastore request was issued | 178 | * @param start time when the datastore request was issued |
178 | */ | 179 | */ |
179 | void GSF_update_datastore_delay_ (struct GNUNET_TIME_Absolute start); | 180 | void |
181 | GSF_update_datastore_delay_ (struct GNUNET_TIME_Absolute start); | ||
180 | 182 | ||
181 | 183 | ||
182 | 184 | ||
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c index 1e93a475e..96d906c5b 100644 --- a/src/fs/gnunet-service-fs_cp.c +++ b/src/fs/gnunet-service-fs_cp.c | |||
@@ -383,7 +383,8 @@ GSF_get_peer_performance_data_ (struct GSF_ConnectedPeer *cp) | |||
383 | * @param buf where to copy the message | 383 | * @param buf where to copy the message |
384 | * @return number of bytes copied to buf | 384 | * @return number of bytes copied to buf |
385 | */ | 385 | */ |
386 | static size_t peer_transmit_ready_cb (void *cls, size_t size, void *buf); | 386 | static size_t |
387 | peer_transmit_ready_cb (void *cls, size_t size, void *buf); | ||
387 | 388 | ||
388 | 389 | ||
389 | 390 | ||
@@ -400,12 +401,11 @@ static size_t peer_transmit_ready_cb (void *cls, size_t size, void *buf); | |||
400 | * long should the client wait until re-trying? | 401 | * long should the client wait until re-trying? |
401 | * @param preference current traffic preference for the given peer | 402 | * @param preference current traffic preference for the given peer |
402 | */ | 403 | */ |
403 | static void core_reserve_callback (void *cls, | 404 | static void |
404 | const struct GNUNET_PeerIdentity *peer, | 405 | core_reserve_callback (void *cls, const struct GNUNET_PeerIdentity *peer, |
405 | struct GNUNET_BANDWIDTH_Value32NBO | 406 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
406 | bandwidth_out, int32_t amount, | 407 | int32_t amount, struct GNUNET_TIME_Relative res_delay, |
407 | struct GNUNET_TIME_Relative res_delay, | 408 | uint64_t preference); |
408 | uint64_t preference); | ||
409 | 409 | ||
410 | 410 | ||
411 | /** | 411 | /** |
@@ -491,9 +491,8 @@ peer_transmit_ready_cb (void *cls, size_t size, void *buf) | |||
491 | GNUNET_assert (0 < cp->ppd.pending_replies--); | 491 | GNUNET_assert (0 < cp->ppd.pending_replies--); |
492 | } | 492 | } |
493 | GNUNET_LOAD_update (cp->ppd.transmission_delay, | 493 | GNUNET_LOAD_update (cp->ppd.transmission_delay, |
494 | GNUNET_TIME_absolute_get_duration (pth-> | 494 | GNUNET_TIME_absolute_get_duration |
495 | transmission_request_start_time). | 495 | (pth->transmission_request_start_time).rel_value); |
496 | rel_value); | ||
497 | ret = pth->gmc (pth->gmc_cls, size, buf); | 496 | ret = pth->gmc (pth->gmc_cls, size, buf); |
498 | GNUNET_assert (NULL == pth->cth); | 497 | GNUNET_assert (NULL == pth->cth); |
499 | for (pos = cp->pth_head; pos != NULL; pos = pos->next) | 498 | for (pos = cp->pth_head; pos != NULL; pos = pos->next) |
@@ -1732,9 +1731,9 @@ GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp, | |||
1732 | #if DEBUG_FS && 0 | 1731 | #if DEBUG_FS && 0 |
1733 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1732 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1734 | "Migration already blocked for another %llu ms\n", | 1733 | "Migration already blocked for another %llu ms\n", |
1735 | (unsigned long long) GNUNET_TIME_absolute_get_remaining (cp-> | 1734 | (unsigned long long) |
1736 | last_migration_block). | 1735 | GNUNET_TIME_absolute_get_remaining |
1737 | rel_value); | 1736 | (cp->last_migration_block).rel_value); |
1738 | #endif | 1737 | #endif |
1739 | return; /* already blocked */ | 1738 | return; /* already blocked */ |
1740 | } | 1739 | } |
diff --git a/src/fs/gnunet-service-fs_cp.h b/src/fs/gnunet-service-fs_cp.h index 84165d8b7..3f25363f1 100644 --- a/src/fs/gnunet-service-fs_cp.h +++ b/src/fs/gnunet-service-fs_cp.h | |||
@@ -170,11 +170,9 @@ struct GSF_PeerTransmitHandle; | |||
170 | * @param atsi performance data for the connection | 170 | * @param atsi performance data for the connection |
171 | * @return handle to connected peer entry | 171 | * @return handle to connected peer entry |
172 | */ | 172 | */ |
173 | struct GSF_ConnectedPeer *GSF_peer_connect_handler_ (const struct | 173 | struct GSF_ConnectedPeer * |
174 | GNUNET_PeerIdentity *peer, | 174 | GSF_peer_connect_handler_ (const struct GNUNET_PeerIdentity *peer, |
175 | const struct | 175 | const struct GNUNET_TRANSPORT_ATS_Information *atsi); |
176 | GNUNET_TRANSPORT_ATS_Information | ||
177 | *atsi); | ||
178 | 176 | ||
179 | 177 | ||
180 | /** | 178 | /** |
@@ -183,8 +181,8 @@ struct GSF_ConnectedPeer *GSF_peer_connect_handler_ (const struct | |||
183 | * @param peer peer's identity | 181 | * @param peer peer's identity |
184 | * @return NULL if this peer is not currently connected | 182 | * @return NULL if this peer is not currently connected |
185 | */ | 183 | */ |
186 | struct GSF_ConnectedPeer *GSF_peer_get_ (const struct GNUNET_PeerIdentity | 184 | struct GSF_ConnectedPeer * |
187 | *peer); | 185 | GSF_peer_get_ (const struct GNUNET_PeerIdentity *peer); |
188 | 186 | ||
189 | 187 | ||
190 | /** | 188 | /** |
@@ -201,13 +199,10 @@ struct GSF_ConnectedPeer *GSF_peer_get_ (const struct GNUNET_PeerIdentity | |||
201 | * @param gmc_cls closure for gmc | 199 | * @param gmc_cls closure for gmc |
202 | * @return handle to cancel request | 200 | * @return handle to cancel request |
203 | */ | 201 | */ |
204 | struct GSF_PeerTransmitHandle *GSF_peer_transmit_ (struct GSF_ConnectedPeer *cp, | 202 | struct GSF_PeerTransmitHandle * |
205 | int is_query, | 203 | GSF_peer_transmit_ (struct GSF_ConnectedPeer *cp, int is_query, |
206 | uint32_t priority, | 204 | uint32_t priority, struct GNUNET_TIME_Relative timeout, |
207 | struct GNUNET_TIME_Relative | 205 | size_t size, GSF_GetMessageCallback gmc, void *gmc_cls); |
208 | timeout, size_t size, | ||
209 | GSF_GetMessageCallback gmc, | ||
210 | void *gmc_cls); | ||
211 | 206 | ||
212 | 207 | ||
213 | /** | 208 | /** |
@@ -215,7 +210,8 @@ struct GSF_PeerTransmitHandle *GSF_peer_transmit_ (struct GSF_ConnectedPeer *cp, | |||
215 | * | 210 | * |
216 | * @param pth request to cancel | 211 | * @param pth request to cancel |
217 | */ | 212 | */ |
218 | void GSF_peer_transmit_cancel_ (struct GSF_PeerTransmitHandle *pth); | 213 | void |
214 | GSF_peer_transmit_cancel_ (struct GSF_PeerTransmitHandle *pth); | ||
219 | 215 | ||
220 | 216 | ||
221 | /** | 217 | /** |
@@ -225,9 +221,10 @@ void GSF_peer_transmit_cancel_ (struct GSF_PeerTransmitHandle *pth); | |||
225 | * @param request_time time at which the original query was transmitted | 221 | * @param request_time time at which the original query was transmitted |
226 | * @param request_priority priority of the original request | 222 | * @param request_priority priority of the original request |
227 | */ | 223 | */ |
228 | void GSF_peer_update_performance_ (struct GSF_ConnectedPeer *cp, | 224 | void |
229 | struct GNUNET_TIME_Absolute request_time, | 225 | GSF_peer_update_performance_ (struct GSF_ConnectedPeer *cp, |
230 | uint32_t request_priority); | 226 | struct GNUNET_TIME_Absolute request_time, |
227 | uint32_t request_priority); | ||
231 | 228 | ||
232 | 229 | ||
233 | /** | 230 | /** |
@@ -237,9 +234,9 @@ void GSF_peer_update_performance_ (struct GSF_ConnectedPeer *cp, | |||
237 | * @param cp responding peer (will be updated) | 234 | * @param cp responding peer (will be updated) |
238 | * @param initiator_client local client on responsible for query | 235 | * @param initiator_client local client on responsible for query |
239 | */ | 236 | */ |
240 | void GSF_peer_update_responder_client_ (struct GSF_ConnectedPeer *cp, | 237 | void |
241 | struct GSF_LocalClient | 238 | GSF_peer_update_responder_client_ (struct GSF_ConnectedPeer *cp, |
242 | *initiator_client); | 239 | struct GSF_LocalClient *initiator_client); |
243 | 240 | ||
244 | 241 | ||
245 | /** | 242 | /** |
@@ -249,9 +246,10 @@ void GSF_peer_update_responder_client_ (struct GSF_ConnectedPeer *cp, | |||
249 | * @param cp responding peer (will be updated) | 246 | * @param cp responding peer (will be updated) |
250 | * @param initiator_peer other peer responsible for query | 247 | * @param initiator_peer other peer responsible for query |
251 | */ | 248 | */ |
252 | void GSF_peer_update_responder_peer_ (struct GSF_ConnectedPeer *cp, | 249 | void |
253 | const struct GSF_ConnectedPeer | 250 | GSF_peer_update_responder_peer_ (struct GSF_ConnectedPeer *cp, |
254 | *initiator_peer); | 251 | const struct GSF_ConnectedPeer |
252 | *initiator_peer); | ||
255 | 253 | ||
256 | 254 | ||
257 | /** | 255 | /** |
@@ -265,13 +263,12 @@ void GSF_peer_update_responder_peer_ (struct GSF_ConnectedPeer *cp, | |||
265 | * unless we see some further activity from it | 263 | * unless we see some further activity from it |
266 | * @param atsi status information | 264 | * @param atsi status information |
267 | */ | 265 | */ |
268 | void GSF_peer_status_handler_ (void *cls, | 266 | void |
269 | const struct GNUNET_PeerIdentity *peer, | 267 | GSF_peer_status_handler_ (void *cls, const struct GNUNET_PeerIdentity *peer, |
270 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, | 268 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in, |
271 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, | 269 | struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out, |
272 | struct GNUNET_TIME_Absolute timeout, | 270 | struct GNUNET_TIME_Absolute timeout, |
273 | const struct GNUNET_TRANSPORT_ATS_Information | 271 | const struct GNUNET_TRANSPORT_ATS_Information *atsi); |
274 | *atsi); | ||
275 | 272 | ||
276 | 273 | ||
277 | /** | 274 | /** |
@@ -285,11 +282,12 @@ void GSF_peer_status_handler_ (void *cls, | |||
285 | * @return GNUNET_OK to keep the connection open, | 282 | * @return GNUNET_OK to keep the connection open, |
286 | * GNUNET_SYSERR to close it (signal serious error) | 283 | * GNUNET_SYSERR to close it (signal serious error) |
287 | */ | 284 | */ |
288 | int GSF_handle_p2p_migration_stop_ (void *cls, | 285 | int |
289 | const struct GNUNET_PeerIdentity *other, | 286 | GSF_handle_p2p_migration_stop_ (void *cls, |
290 | const struct GNUNET_MessageHeader *message, | 287 | const struct GNUNET_PeerIdentity *other, |
291 | const struct | 288 | const struct GNUNET_MessageHeader *message, |
292 | GNUNET_TRANSPORT_ATS_Information *atsi); | 289 | const struct GNUNET_TRANSPORT_ATS_Information |
290 | *atsi); | ||
293 | 291 | ||
294 | 292 | ||
295 | /** | 293 | /** |
@@ -303,11 +301,9 @@ int GSF_handle_p2p_migration_stop_ (void *cls, | |||
303 | * @param message the actual message | 301 | * @param message the actual message |
304 | * @return pending request handle, NULL on error | 302 | * @return pending request handle, NULL on error |
305 | */ | 303 | */ |
306 | struct GSF_PendingRequest *GSF_handle_p2p_query_ (const struct | 304 | struct GSF_PendingRequest * |
307 | GNUNET_PeerIdentity *other, | 305 | GSF_handle_p2p_query_ (const struct GNUNET_PeerIdentity *other, |
308 | const struct | 306 | const struct GNUNET_MessageHeader *message); |
309 | GNUNET_MessageHeader | ||
310 | *message); | ||
311 | 307 | ||
312 | 308 | ||
313 | /** | 309 | /** |
@@ -316,9 +312,8 @@ struct GSF_PendingRequest *GSF_handle_p2p_query_ (const struct | |||
316 | * @param cp peer to query | 312 | * @param cp peer to query |
317 | * @return performance data record for the peer | 313 | * @return performance data record for the peer |
318 | */ | 314 | */ |
319 | struct GSF_PeerPerformanceData *GSF_get_peer_performance_data_ (struct | 315 | struct GSF_PeerPerformanceData * |
320 | GSF_ConnectedPeer | 316 | GSF_get_peer_performance_data_ (struct GSF_ConnectedPeer *cp); |
321 | *cp); | ||
322 | 317 | ||
323 | 318 | ||
324 | /** | 319 | /** |
@@ -328,8 +323,9 @@ struct GSF_PeerPerformanceData *GSF_get_peer_performance_data_ (struct | |||
328 | * @param cp peer to ask | 323 | * @param cp peer to ask |
329 | * @param block_time until when to block | 324 | * @param block_time until when to block |
330 | */ | 325 | */ |
331 | void GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp, | 326 | void |
332 | struct GNUNET_TIME_Relative block_time); | 327 | GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp, |
328 | struct GNUNET_TIME_Relative block_time); | ||
333 | 329 | ||
334 | 330 | ||
335 | /** | 331 | /** |
@@ -339,8 +335,9 @@ void GSF_block_peer_migration_ (struct GSF_ConnectedPeer *cp, | |||
339 | * @param cls unused | 335 | * @param cls unused |
340 | * @param peer identity of peer that connected | 336 | * @param peer identity of peer that connected |
341 | */ | 337 | */ |
342 | void GSF_peer_disconnect_handler_ (void *cls, | 338 | void |
343 | const struct GNUNET_PeerIdentity *peer); | 339 | GSF_peer_disconnect_handler_ (void *cls, |
340 | const struct GNUNET_PeerIdentity *peer); | ||
344 | 341 | ||
345 | 342 | ||
346 | /** | 343 | /** |
@@ -349,7 +346,8 @@ void GSF_peer_disconnect_handler_ (void *cls, | |||
349 | * | 346 | * |
350 | * @param lc handle to the local client (henceforth invalid) | 347 | * @param lc handle to the local client (henceforth invalid) |
351 | */ | 348 | */ |
352 | void GSF_handle_local_client_disconnect_ (const struct GSF_LocalClient *lc); | 349 | void |
350 | GSF_handle_local_client_disconnect_ (const struct GSF_LocalClient *lc); | ||
353 | 351 | ||
354 | 352 | ||
355 | /** | 353 | /** |
@@ -361,8 +359,9 @@ void GSF_handle_local_client_disconnect_ (const struct GSF_LocalClient *lc); | |||
361 | * @param cp peer to reserve bandwidth from | 359 | * @param cp peer to reserve bandwidth from |
362 | * @param pref preference change | 360 | * @param pref preference change |
363 | */ | 361 | */ |
364 | void GSF_connected_peer_change_preference_ (struct GSF_ConnectedPeer *cp, | 362 | void |
365 | uint64_t pref); | 363 | GSF_connected_peer_change_preference_ (struct GSF_ConnectedPeer *cp, |
364 | uint64_t pref); | ||
366 | 365 | ||
367 | 366 | ||
368 | /** | 367 | /** |
@@ -371,8 +370,9 @@ void GSF_connected_peer_change_preference_ (struct GSF_ConnectedPeer *cp, | |||
371 | * @param cp peer to reserve bandwidth from | 370 | * @param cp peer to reserve bandwidth from |
372 | * @param id identity to set (written to) | 371 | * @param id identity to set (written to) |
373 | */ | 372 | */ |
374 | void GSF_connected_peer_get_identity_ (const struct GSF_ConnectedPeer *cp, | 373 | void |
375 | struct GNUNET_PeerIdentity *id); | 374 | GSF_connected_peer_get_identity_ (const struct GSF_ConnectedPeer *cp, |
375 | struct GNUNET_PeerIdentity *id); | ||
376 | 376 | ||
377 | 377 | ||
378 | /** | 378 | /** |
@@ -381,19 +381,22 @@ void GSF_connected_peer_get_identity_ (const struct GSF_ConnectedPeer *cp, | |||
381 | * @param it function to call for each peer | 381 | * @param it function to call for each peer |
382 | * @param it_cls closure for it | 382 | * @param it_cls closure for it |
383 | */ | 383 | */ |
384 | void GSF_iterate_connected_peers_ (GSF_ConnectedPeerIterator it, void *it_cls); | 384 | void |
385 | GSF_iterate_connected_peers_ (GSF_ConnectedPeerIterator it, void *it_cls); | ||
385 | 386 | ||
386 | 387 | ||
387 | /** | 388 | /** |
388 | * Initialize peer management subsystem. | 389 | * Initialize peer management subsystem. |
389 | */ | 390 | */ |
390 | void GSF_connected_peer_init_ (void); | 391 | void |
392 | GSF_connected_peer_init_ (void); | ||
391 | 393 | ||
392 | 394 | ||
393 | /** | 395 | /** |
394 | * Shutdown peer management subsystem. | 396 | * Shutdown peer management subsystem. |
395 | */ | 397 | */ |
396 | void GSF_connected_peer_done_ (void); | 398 | void |
399 | GSF_connected_peer_done_ (void); | ||
397 | 400 | ||
398 | 401 | ||
399 | #endif | 402 | #endif |
diff --git a/src/fs/gnunet-service-fs_indexing.c b/src/fs/gnunet-service-fs_indexing.c index c7bff3a9d..ab3f77abe 100644 --- a/src/fs/gnunet-service-fs_indexing.c +++ b/src/fs/gnunet-service-fs_indexing.c | |||
@@ -228,8 +228,7 @@ signal_index_ok (struct IndexInfo *ii) | |||
228 | ("Index request received for file `%s' is already indexed as `%s'. Permitting anyway.\n"), | 228 | ("Index request received for file `%s' is already indexed as `%s'. Permitting anyway.\n"), |
229 | ii->filename, | 229 | ii->filename, |
230 | (const char *) GNUNET_CONTAINER_multihashmap_get (ifm, | 230 | (const char *) GNUNET_CONTAINER_multihashmap_get (ifm, |
231 | &ii-> | 231 | &ii->file_id)); |
232 | file_id)); | ||
233 | GNUNET_SERVER_transmit_context_append_data (ii->tc, NULL, 0, | 232 | GNUNET_SERVER_transmit_context_append_data (ii->tc, NULL, 0, |
234 | GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK); | 233 | GNUNET_MESSAGE_TYPE_FS_INDEX_START_OK); |
235 | GNUNET_SERVER_transmit_context_run (ii->tc, GNUNET_TIME_UNIT_MINUTES); | 234 | GNUNET_SERVER_transmit_context_run (ii->tc, GNUNET_TIME_UNIT_MINUTES); |
@@ -447,8 +446,8 @@ GNUNET_FS_handle_unindex (void *cls, struct GNUNET_SERVER_Client *client, | |||
447 | prev->next = next; | 446 | prev->next = next; |
448 | GNUNET_break (GNUNET_OK == | 447 | GNUNET_break (GNUNET_OK == |
449 | GNUNET_CONTAINER_multihashmap_remove (ifm, &pos->file_id, | 448 | GNUNET_CONTAINER_multihashmap_remove (ifm, &pos->file_id, |
450 | (void *) pos-> | 449 | (void *) |
451 | filename)); | 450 | pos->filename)); |
452 | GNUNET_free (pos); | 451 | GNUNET_free (pos); |
453 | found = GNUNET_YES; | 452 | found = GNUNET_YES; |
454 | } | 453 | } |
diff --git a/src/fs/gnunet-service-fs_indexing.h b/src/fs/gnunet-service-fs_indexing.h index a5c8f6593..4295b2011 100644 --- a/src/fs/gnunet-service-fs_indexing.h +++ b/src/fs/gnunet-service-fs_indexing.h | |||
@@ -54,14 +54,14 @@ | |||
54 | * @param cont_cls closure for cont | 54 | * @param cont_cls closure for cont |
55 | * @return GNUNET_OK on success | 55 | * @return GNUNET_OK on success |
56 | */ | 56 | */ |
57 | int GNUNET_FS_handle_on_demand_block (const GNUNET_HashCode * key, | 57 | int |
58 | uint32_t size, const void *data, | 58 | GNUNET_FS_handle_on_demand_block (const GNUNET_HashCode * key, uint32_t size, |
59 | enum GNUNET_BLOCK_Type type, | 59 | const void *data, enum GNUNET_BLOCK_Type type, |
60 | uint32_t priority, uint32_t anonymity, | 60 | uint32_t priority, uint32_t anonymity, |
61 | struct GNUNET_TIME_Absolute expiration, | 61 | struct GNUNET_TIME_Absolute expiration, |
62 | uint64_t uid, | 62 | uint64_t uid, |
63 | GNUNET_DATASTORE_DatumProcessor cont, | 63 | GNUNET_DATASTORE_DatumProcessor cont, |
64 | void *cont_cls); | 64 | void *cont_cls); |
65 | 65 | ||
66 | /** | 66 | /** |
67 | * Handle INDEX_START-message. | 67 | * Handle INDEX_START-message. |
@@ -70,9 +70,9 @@ int GNUNET_FS_handle_on_demand_block (const GNUNET_HashCode * key, | |||
70 | * @param client identification of the client | 70 | * @param client identification of the client |
71 | * @param message the actual message | 71 | * @param message the actual message |
72 | */ | 72 | */ |
73 | void GNUNET_FS_handle_index_start (void *cls, | 73 | void |
74 | struct GNUNET_SERVER_Client *client, | 74 | GNUNET_FS_handle_index_start (void *cls, struct GNUNET_SERVER_Client *client, |
75 | const struct GNUNET_MessageHeader *message); | 75 | const struct GNUNET_MessageHeader *message); |
76 | 76 | ||
77 | 77 | ||
78 | /** | 78 | /** |
@@ -82,10 +82,9 @@ void GNUNET_FS_handle_index_start (void *cls, | |||
82 | * @param client identification of the client | 82 | * @param client identification of the client |
83 | * @param message the actual message | 83 | * @param message the actual message |
84 | */ | 84 | */ |
85 | void GNUNET_FS_handle_index_list_get (void *cls, | 85 | void |
86 | struct GNUNET_SERVER_Client *client, | 86 | GNUNET_FS_handle_index_list_get (void *cls, struct GNUNET_SERVER_Client *client, |
87 | const struct GNUNET_MessageHeader | 87 | const struct GNUNET_MessageHeader *message); |
88 | *message); | ||
89 | 88 | ||
90 | 89 | ||
91 | /** | 90 | /** |
@@ -95,8 +94,9 @@ void GNUNET_FS_handle_index_list_get (void *cls, | |||
95 | * @param client identification of the client | 94 | * @param client identification of the client |
96 | * @param message the actual message | 95 | * @param message the actual message |
97 | */ | 96 | */ |
98 | void GNUNET_FS_handle_unindex (void *cls, struct GNUNET_SERVER_Client *client, | 97 | void |
99 | const struct GNUNET_MessageHeader *message); | 98 | GNUNET_FS_handle_unindex (void *cls, struct GNUNET_SERVER_Client *client, |
99 | const struct GNUNET_MessageHeader *message); | ||
100 | 100 | ||
101 | 101 | ||
102 | /** | 102 | /** |
@@ -106,14 +106,16 @@ void GNUNET_FS_handle_unindex (void *cls, struct GNUNET_SERVER_Client *client, | |||
106 | * @param d datastore to use | 106 | * @param d datastore to use |
107 | * @return GNUNET_OK on success | 107 | * @return GNUNET_OK on success |
108 | */ | 108 | */ |
109 | int GNUNET_FS_indexing_init (const struct GNUNET_CONFIGURATION_Handle *c, | 109 | int |
110 | struct GNUNET_DATASTORE_Handle *d); | 110 | GNUNET_FS_indexing_init (const struct GNUNET_CONFIGURATION_Handle *c, |
111 | struct GNUNET_DATASTORE_Handle *d); | ||
111 | 112 | ||
112 | 113 | ||
113 | /** | 114 | /** |
114 | * Shutdown the module. | 115 | * Shutdown the module. |
115 | */ | 116 | */ |
116 | void GNUNET_FS_indexing_done (void); | 117 | void |
118 | GNUNET_FS_indexing_done (void); | ||
117 | 119 | ||
118 | 120 | ||
119 | #endif | 121 | #endif |
diff --git a/src/fs/gnunet-service-fs_lc.h b/src/fs/gnunet-service-fs_lc.h index 6b79690f1..c625edf0b 100644 --- a/src/fs/gnunet-service-fs_lc.h +++ b/src/fs/gnunet-service-fs_lc.h | |||
@@ -36,8 +36,8 @@ | |||
36 | * @param client handle of the client | 36 | * @param client handle of the client |
37 | * @return handle to local client entry | 37 | * @return handle to local client entry |
38 | */ | 38 | */ |
39 | struct GSF_LocalClient *GSF_local_client_lookup_ (struct GNUNET_SERVER_Client | 39 | struct GSF_LocalClient * |
40 | *client); | 40 | GSF_local_client_lookup_ (struct GNUNET_SERVER_Client *client); |
41 | 41 | ||
42 | 42 | ||
43 | /** | 43 | /** |
@@ -50,12 +50,10 @@ struct GSF_LocalClient *GSF_local_client_lookup_ (struct GNUNET_SERVER_Client | |||
50 | * @param message the actual message | 50 | * @param message the actual message |
51 | * @return pending request handle for the request, NULL on error | 51 | * @return pending request handle for the request, NULL on error |
52 | */ | 52 | */ |
53 | struct GSF_PendingRequest *GSF_local_client_start_search_handler_ (struct | 53 | struct GSF_PendingRequest * |
54 | GNUNET_SERVER_Client | 54 | GSF_local_client_start_search_handler_ (struct GNUNET_SERVER_Client *client, |
55 | *client, | 55 | const struct GNUNET_MessageHeader |
56 | const struct | 56 | *message); |
57 | GNUNET_MessageHeader | ||
58 | *message); | ||
59 | 57 | ||
60 | 58 | ||
61 | /** | 59 | /** |
@@ -66,8 +64,9 @@ struct GSF_PendingRequest *GSF_local_client_start_search_handler_ (struct | |||
66 | * @param lc recipient | 64 | * @param lc recipient |
67 | * @param msg message to transmit to client | 65 | * @param msg message to transmit to client |
68 | */ | 66 | */ |
69 | void GSF_local_client_transmit_ (struct GSF_LocalClient *lc, | 67 | void |
70 | const struct GNUNET_MessageHeader *msg); | 68 | GSF_local_client_transmit_ (struct GSF_LocalClient *lc, |
69 | const struct GNUNET_MessageHeader *msg); | ||
71 | 70 | ||
72 | 71 | ||
73 | /** | 72 | /** |
@@ -76,8 +75,8 @@ void GSF_local_client_transmit_ (struct GSF_LocalClient *lc, | |||
76 | * @param cls unused | 75 | * @param cls unused |
77 | * @param client handle of the client | 76 | * @param client handle of the client |
78 | */ | 77 | */ |
79 | void GSF_client_disconnect_handler_ (void *cls, | 78 | void |
80 | struct GNUNET_SERVER_Client *client); | 79 | GSF_client_disconnect_handler_ (void *cls, struct GNUNET_SERVER_Client *client); |
81 | 80 | ||
82 | 81 | ||
83 | #endif | 82 | #endif |
diff --git a/src/fs/gnunet-service-fs_pe.c b/src/fs/gnunet-service-fs_pe.c index 58fb11cee..d1a8a1163 100644 --- a/src/fs/gnunet-service-fs_pe.c +++ b/src/fs/gnunet-service-fs_pe.c | |||
@@ -207,9 +207,9 @@ static unsigned long long plan_count; | |||
207 | * @param cls the 'struct GSF_ConnectedPeer' for transmission | 207 | * @param cls the 'struct GSF_ConnectedPeer' for transmission |
208 | * @param tc scheduler context | 208 | * @param tc scheduler context |
209 | */ | 209 | */ |
210 | static void schedule_peer_transmission (void *cls, | 210 | static void |
211 | const struct | 211 | schedule_peer_transmission (void *cls, |
212 | GNUNET_SCHEDULER_TaskContext *tc); | 212 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
213 | 213 | ||
214 | 214 | ||
215 | /** | 215 | /** |
@@ -243,8 +243,8 @@ plan (struct PeerPlan *pp, struct GSF_RequestPlan *rp) | |||
243 | #endif | 243 | #endif |
244 | 244 | ||
245 | GNUNET_assert (rp->hn == NULL); | 245 | GNUNET_assert (rp->hn == NULL); |
246 | if (GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission). | 246 | if (GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission).rel_value |
247 | rel_value == 0) | 247 | == 0) |
248 | rp->hn = GNUNET_CONTAINER_heap_insert (pp->priority_heap, rp, rp->priority); | 248 | rp->hn = GNUNET_CONTAINER_heap_insert (pp->priority_heap, rp, rp->priority); |
249 | else | 249 | else |
250 | rp->hn = | 250 | rp->hn = |
@@ -359,8 +359,8 @@ schedule_peer_transmission (void *cls, | |||
359 | } | 359 | } |
360 | /* move ready requests to priority queue */ | 360 | /* move ready requests to priority queue */ |
361 | while ((NULL != (rp = GNUNET_CONTAINER_heap_peek (pp->delay_heap))) && | 361 | while ((NULL != (rp = GNUNET_CONTAINER_heap_peek (pp->delay_heap))) && |
362 | (GNUNET_TIME_absolute_get_remaining (rp->earliest_transmission). | 362 | (GNUNET_TIME_absolute_get_remaining |
363 | rel_value == 0)) | 363 | (rp->earliest_transmission).rel_value == 0)) |
364 | { | 364 | { |
365 | GNUNET_assert (rp == GNUNET_CONTAINER_heap_remove_root (pp->delay_heap)); | 365 | GNUNET_assert (rp == GNUNET_CONTAINER_heap_remove_root (pp->delay_heap)); |
366 | rp->hn = GNUNET_CONTAINER_heap_insert (pp->priority_heap, rp, rp->priority); | 366 | rp->hn = GNUNET_CONTAINER_heap_insert (pp->priority_heap, rp, rp->priority); |
@@ -380,9 +380,9 @@ schedule_peer_transmission (void *cls, | |||
380 | #if DEBUG_FS | 380 | #if DEBUG_FS |
381 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 381 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
382 | "Sleeping for %llu ms before retrying requests on plan %p.\n", | 382 | "Sleeping for %llu ms before retrying requests on plan %p.\n", |
383 | (unsigned long long) GNUNET_TIME_absolute_get_remaining (rp-> | 383 | (unsigned long long) |
384 | earliest_transmission). | 384 | GNUNET_TIME_absolute_get_remaining |
385 | rel_value, pp); | 385 | (rp->earliest_transmission).rel_value, pp); |
386 | #endif | 386 | #endif |
387 | pp->task = | 387 | pp->task = |
388 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining | 388 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_absolute_get_remaining |
diff --git a/src/fs/gnunet-service-fs_pe.h b/src/fs/gnunet-service-fs_pe.h index cfaeabe22..23787908e 100644 --- a/src/fs/gnunet-service-fs_pe.h +++ b/src/fs/gnunet-service-fs_pe.h | |||
@@ -35,8 +35,8 @@ | |||
35 | * @param cp peer with the entry | 35 | * @param cp peer with the entry |
36 | * @param pr request with the entry | 36 | * @param pr request with the entry |
37 | */ | 37 | */ |
38 | void GSF_plan_add_ (struct GSF_ConnectedPeer *cp, | 38 | void |
39 | struct GSF_PendingRequest *pr); | 39 | GSF_plan_add_ (struct GSF_ConnectedPeer *cp, struct GSF_PendingRequest *pr); |
40 | 40 | ||
41 | 41 | ||
42 | /** | 42 | /** |
@@ -45,7 +45,8 @@ void GSF_plan_add_ (struct GSF_ConnectedPeer *cp, | |||
45 | * | 45 | * |
46 | * @param cp connected peer | 46 | * @param cp connected peer |
47 | */ | 47 | */ |
48 | void GSF_plan_notify_peer_disconnect_ (const struct GSF_ConnectedPeer *cp); | 48 | void |
49 | GSF_plan_notify_peer_disconnect_ (const struct GSF_ConnectedPeer *cp); | ||
49 | 50 | ||
50 | 51 | ||
51 | /** | 52 | /** |
@@ -54,19 +55,22 @@ void GSF_plan_notify_peer_disconnect_ (const struct GSF_ConnectedPeer *cp); | |||
54 | * | 55 | * |
55 | * @param pr request that is done | 56 | * @param pr request that is done |
56 | */ | 57 | */ |
57 | void GSF_plan_notify_request_done_ (struct GSF_PendingRequest *pr); | 58 | void |
59 | GSF_plan_notify_request_done_ (struct GSF_PendingRequest *pr); | ||
58 | 60 | ||
59 | 61 | ||
60 | /** | 62 | /** |
61 | * Initialize plan subsystem. | 63 | * Initialize plan subsystem. |
62 | */ | 64 | */ |
63 | void GSF_plan_init (void); | 65 | void |
66 | GSF_plan_init (void); | ||
64 | 67 | ||
65 | 68 | ||
66 | /** | 69 | /** |
67 | * Shutdown plan subsystem. | 70 | * Shutdown plan subsystem. |
68 | */ | 71 | */ |
69 | void GSF_plan_done (void); | 72 | void |
73 | GSF_plan_done (void); | ||
70 | 74 | ||
71 | 75 | ||
72 | #endif | 76 | #endif |
diff --git a/src/fs/gnunet-service-fs_pr.c b/src/fs/gnunet-service-fs_pr.c index 7b6290bbb..e5cb1f03c 100644 --- a/src/fs/gnunet-service-fs_pr.c +++ b/src/fs/gnunet-service-fs_pr.c | |||
@@ -817,9 +817,8 @@ process_reply (void *cls, const GNUNET_HashCode * key, void *value) | |||
817 | /* short cut: stop processing early, no BF-update, etc. */ | 817 | /* short cut: stop processing early, no BF-update, etc. */ |
818 | update_request_performance_data (prq, pr); | 818 | update_request_performance_data (prq, pr); |
819 | GNUNET_LOAD_update (GSF_rt_entry_lifetime, | 819 | GNUNET_LOAD_update (GSF_rt_entry_lifetime, |
820 | GNUNET_TIME_absolute_get_duration (pr->public_data. | 820 | GNUNET_TIME_absolute_get_duration (pr-> |
821 | start_time). | 821 | public_data.start_time).rel_value); |
822 | rel_value); | ||
823 | /* pass on to other peers / local clients */ | 822 | /* pass on to other peers / local clients */ |
824 | pr->rh (pr->rh_cls, prq->eval, pr, prq->anonymity_level, prq->expiration, | 823 | pr->rh (pr->rh_cls, prq->eval, pr, prq->anonymity_level, prq->expiration, |
825 | prq->type, prq->data, prq->size); | 824 | prq->type, prq->data, prq->size); |
@@ -1101,9 +1100,8 @@ warn_delay_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1101 | 1100 | ||
1102 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1101 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1103 | _("Datastore lookup already took %llu ms!\n"), | 1102 | _("Datastore lookup already took %llu ms!\n"), |
1104 | (unsigned long long) GNUNET_TIME_absolute_get_duration (pr-> | 1103 | (unsigned long long) |
1105 | qe_start). | 1104 | GNUNET_TIME_absolute_get_duration (pr->qe_start).rel_value); |
1106 | rel_value); | ||
1107 | pr->warn_task = | 1105 | pr->warn_task = |
1108 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, &warn_delay_task, | 1106 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, &warn_delay_task, |
1109 | pr); | 1107 | pr); |
@@ -1123,9 +1121,8 @@ odc_warn_delay_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1123 | 1121 | ||
1124 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1122 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1125 | _("On-demand lookup already took %llu ms!\n"), | 1123 | _("On-demand lookup already took %llu ms!\n"), |
1126 | (unsigned long long) GNUNET_TIME_absolute_get_duration (pr-> | 1124 | (unsigned long long) |
1127 | qe_start). | 1125 | GNUNET_TIME_absolute_get_duration (pr->qe_start).rel_value); |
1128 | rel_value); | ||
1129 | pr->warn_task = | 1126 | pr->warn_task = |
1130 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, | 1127 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_MINUTES, |
1131 | &odc_warn_delay_task, pr); | 1128 | &odc_warn_delay_task, pr); |
@@ -1257,12 +1254,12 @@ process_local_reply (void *cls, const GNUNET_HashCode * key, size_t size, | |||
1257 | GNUNET_BLOCK_TYPE_FS_DBLOCK ? | 1254 | GNUNET_BLOCK_TYPE_FS_DBLOCK ? |
1258 | GNUNET_BLOCK_TYPE_ANY : pr->public_data.type, | 1255 | GNUNET_BLOCK_TYPE_ANY : pr->public_data.type, |
1259 | (0 != | 1256 | (0 != |
1260 | (GSF_PRO_PRIORITY_UNLIMITED & pr-> | 1257 | (GSF_PRO_PRIORITY_UNLIMITED & |
1261 | public_data.options)) ? UINT_MAX : 1 | 1258 | pr->public_data.options)) ? UINT_MAX : 1 |
1262 | /* queue priority */ , | 1259 | /* queue priority */ , |
1263 | (0 != | 1260 | (0 != |
1264 | (GSF_PRO_PRIORITY_UNLIMITED & pr-> | 1261 | (GSF_PRO_PRIORITY_UNLIMITED & |
1265 | public_data.options)) ? UINT_MAX : 1 | 1262 | pr->public_data.options)) ? UINT_MAX : 1 |
1266 | /* max queue size */ , | 1263 | /* max queue size */ , |
1267 | GNUNET_TIME_UNIT_FOREVER_REL, | 1264 | GNUNET_TIME_UNIT_FOREVER_REL, |
1268 | &process_local_reply, pr); | 1265 | &process_local_reply, pr); |
@@ -1298,12 +1295,12 @@ process_local_reply (void *cls, const GNUNET_HashCode * key, size_t size, | |||
1298 | GNUNET_BLOCK_TYPE_FS_DBLOCK ? | 1295 | GNUNET_BLOCK_TYPE_FS_DBLOCK ? |
1299 | GNUNET_BLOCK_TYPE_ANY : pr->public_data.type, | 1296 | GNUNET_BLOCK_TYPE_ANY : pr->public_data.type, |
1300 | (0 != | 1297 | (0 != |
1301 | (GSF_PRO_PRIORITY_UNLIMITED & pr-> | 1298 | (GSF_PRO_PRIORITY_UNLIMITED & |
1302 | public_data.options)) ? UINT_MAX : 1 | 1299 | pr->public_data.options)) ? UINT_MAX : 1 |
1303 | /* queue priority */ , | 1300 | /* queue priority */ , |
1304 | (0 != | 1301 | (0 != |
1305 | (GSF_PRO_PRIORITY_UNLIMITED & pr-> | 1302 | (GSF_PRO_PRIORITY_UNLIMITED & |
1306 | public_data.options)) ? UINT_MAX : 1 | 1303 | pr->public_data.options)) ? UINT_MAX : 1 |
1307 | /* max queue size */ , | 1304 | /* max queue size */ , |
1308 | GNUNET_TIME_UNIT_FOREVER_REL, | 1305 | GNUNET_TIME_UNIT_FOREVER_REL, |
1309 | &process_local_reply, pr); | 1306 | &process_local_reply, pr); |
@@ -1357,12 +1354,12 @@ process_local_reply (void *cls, const GNUNET_HashCode * key, size_t size, | |||
1357 | GNUNET_BLOCK_TYPE_FS_DBLOCK ? | 1354 | GNUNET_BLOCK_TYPE_FS_DBLOCK ? |
1358 | GNUNET_BLOCK_TYPE_ANY : pr->public_data.type, | 1355 | GNUNET_BLOCK_TYPE_ANY : pr->public_data.type, |
1359 | (0 != | 1356 | (0 != |
1360 | (GSF_PRO_PRIORITY_UNLIMITED & pr->public_data. | 1357 | (GSF_PRO_PRIORITY_UNLIMITED & pr-> |
1361 | options)) ? UINT_MAX : 1 | 1358 | public_data.options)) ? UINT_MAX : 1 |
1362 | /* queue priority */ , | 1359 | /* queue priority */ , |
1363 | (0 != | 1360 | (0 != |
1364 | (GSF_PRO_PRIORITY_UNLIMITED & pr->public_data. | 1361 | (GSF_PRO_PRIORITY_UNLIMITED & pr-> |
1365 | options)) ? UINT_MAX : 1 | 1362 | public_data.options)) ? UINT_MAX : 1 |
1366 | /* max queue size */ , | 1363 | /* max queue size */ , |
1367 | GNUNET_TIME_UNIT_FOREVER_REL, | 1364 | GNUNET_TIME_UNIT_FOREVER_REL, |
1368 | &process_local_reply, pr); | 1365 | &process_local_reply, pr); |
@@ -1413,12 +1410,12 @@ GSF_local_lookup_ (struct GSF_PendingRequest *pr, | |||
1413 | GNUNET_BLOCK_TYPE_FS_DBLOCK ? | 1410 | GNUNET_BLOCK_TYPE_FS_DBLOCK ? |
1414 | GNUNET_BLOCK_TYPE_ANY : pr->public_data.type, | 1411 | GNUNET_BLOCK_TYPE_ANY : pr->public_data.type, |
1415 | (0 != | 1412 | (0 != |
1416 | (GSF_PRO_PRIORITY_UNLIMITED & pr->public_data. | 1413 | (GSF_PRO_PRIORITY_UNLIMITED & pr-> |
1417 | options)) ? UINT_MAX : 1 | 1414 | public_data.options)) ? UINT_MAX : 1 |
1418 | /* queue priority */ , | 1415 | /* queue priority */ , |
1419 | (0 != | 1416 | (0 != |
1420 | (GSF_PRO_PRIORITY_UNLIMITED & pr->public_data. | 1417 | (GSF_PRO_PRIORITY_UNLIMITED & pr-> |
1421 | options)) ? UINT_MAX : 1 | 1418 | public_data.options)) ? UINT_MAX : 1 |
1422 | /* max queue size */ , | 1419 | /* max queue size */ , |
1423 | GNUNET_TIME_UNIT_FOREVER_REL, | 1420 | GNUNET_TIME_UNIT_FOREVER_REL, |
1424 | &process_local_reply, pr); | 1421 | &process_local_reply, pr); |
diff --git a/src/fs/gnunet-service-fs_pr.h b/src/fs/gnunet-service-fs_pr.h index f2e7bcf62..b68989be7 100644 --- a/src/fs/gnunet-service-fs_pr.h +++ b/src/fs/gnunet-service-fs_pr.h | |||
@@ -201,33 +201,19 @@ typedef void (*GSF_PendingRequestReplyHandler) (void *cls, | |||
201 | * @param rh_cls closure for rh | 201 | * @param rh_cls closure for rh |
202 | * @return handle for the new pending request | 202 | * @return handle for the new pending request |
203 | */ | 203 | */ |
204 | struct GSF_PendingRequest *GSF_pending_request_create_ (enum | 204 | struct GSF_PendingRequest * |
205 | GSF_PendingRequestOptions | 205 | GSF_pending_request_create_ (enum GSF_PendingRequestOptions options, |
206 | options, | 206 | enum GNUNET_BLOCK_Type type, |
207 | enum GNUNET_BLOCK_Type | 207 | const GNUNET_HashCode * query, |
208 | type, | 208 | const GNUNET_HashCode * namespace, |
209 | const GNUNET_HashCode * | 209 | const struct GNUNET_PeerIdentity *target, |
210 | query, | 210 | const char *bf_data, size_t bf_size, |
211 | const GNUNET_HashCode * | 211 | uint32_t mingle, uint32_t anonymity_level, |
212 | namespace, | 212 | uint32_t priority, int32_t ttl, |
213 | const struct | 213 | GNUNET_PEER_Id sender_pid, |
214 | GNUNET_PeerIdentity | 214 | const GNUNET_HashCode * replies_seen, |
215 | *target, | 215 | unsigned int replies_seen_count, |
216 | const char *bf_data, | 216 | GSF_PendingRequestReplyHandler rh, void *rh_cls); |
217 | size_t bf_size, | ||
218 | uint32_t mingle, | ||
219 | uint32_t | ||
220 | anonymity_level, | ||
221 | uint32_t priority, | ||
222 | int32_t ttl, | ||
223 | GNUNET_PEER_Id | ||
224 | sender_pid, | ||
225 | const GNUNET_HashCode * | ||
226 | replies_seen, | ||
227 | unsigned int | ||
228 | replies_seen_count, | ||
229 | GSF_PendingRequestReplyHandler | ||
230 | rh, void *rh_cls); | ||
231 | 217 | ||
232 | 218 | ||
233 | /** | 219 | /** |
@@ -238,9 +224,10 @@ struct GSF_PendingRequest *GSF_pending_request_create_ (enum | |||
238 | * @param replies_seen hash codes of replies that we've seen | 224 | * @param replies_seen hash codes of replies that we've seen |
239 | * @param replies_seen_count size of the replies_seen array | 225 | * @param replies_seen_count size of the replies_seen array |
240 | */ | 226 | */ |
241 | void GSF_pending_request_update_ (struct GSF_PendingRequest *pr, | 227 | void |
242 | const GNUNET_HashCode * replies_seen, | 228 | GSF_pending_request_update_ (struct GSF_PendingRequest *pr, |
243 | unsigned int replies_seen_count); | 229 | const GNUNET_HashCode * replies_seen, |
230 | unsigned int replies_seen_count); | ||
244 | 231 | ||
245 | 232 | ||
246 | /** | 233 | /** |
@@ -249,9 +236,8 @@ void GSF_pending_request_update_ (struct GSF_PendingRequest *pr, | |||
249 | * @param pr pending request | 236 | * @param pr pending request |
250 | * @return associated public data | 237 | * @return associated public data |
251 | */ | 238 | */ |
252 | struct GSF_PendingRequestData *GSF_pending_request_get_data_ (struct | 239 | struct GSF_PendingRequestData * |
253 | GSF_PendingRequest | 240 | GSF_pending_request_get_data_ (struct GSF_PendingRequest *pr); |
254 | *pr); | ||
255 | 241 | ||
256 | 242 | ||
257 | /** | 243 | /** |
@@ -263,8 +249,9 @@ struct GSF_PendingRequestData *GSF_pending_request_get_data_ (struct | |||
263 | * @param pra another pending request | 249 | * @param pra another pending request |
264 | * @return GNUNET_OK if the requests are compatible | 250 | * @return GNUNET_OK if the requests are compatible |
265 | */ | 251 | */ |
266 | int GSF_pending_request_is_compatible_ (struct GSF_PendingRequest *pra, | 252 | int |
267 | struct GSF_PendingRequest *prb); | 253 | GSF_pending_request_is_compatible_ (struct GSF_PendingRequest *pra, |
254 | struct GSF_PendingRequest *prb); | ||
268 | 255 | ||
269 | 256 | ||
270 | /** | 257 | /** |
@@ -276,9 +263,9 @@ int GSF_pending_request_is_compatible_ (struct GSF_PendingRequest *pra, | |||
276 | * @param buf where to copy the message (can be NULL) | 263 | * @param buf where to copy the message (can be NULL) |
277 | * @return number of bytes needed (if buf_size too small) or used | 264 | * @return number of bytes needed (if buf_size too small) or used |
278 | */ | 265 | */ |
279 | size_t GSF_pending_request_get_message_ (struct GSF_PendingRequest | 266 | size_t |
280 | *pr, size_t buf_size, | 267 | GSF_pending_request_get_message_ (struct GSF_PendingRequest *pr, |
281 | void *buf); | 268 | size_t buf_size, void *buf); |
282 | 269 | ||
283 | 270 | ||
284 | /** | 271 | /** |
@@ -287,8 +274,8 @@ size_t GSF_pending_request_get_message_ (struct GSF_PendingRequest | |||
287 | * @param pr request to cancel | 274 | * @param pr request to cancel |
288 | * @param full_cleanup fully purge the request | 275 | * @param full_cleanup fully purge the request |
289 | */ | 276 | */ |
290 | void GSF_pending_request_cancel_ (struct GSF_PendingRequest *pr, | 277 | void |
291 | int full_cleanup); | 278 | GSF_pending_request_cancel_ (struct GSF_PendingRequest *pr, int full_cleanup); |
292 | 279 | ||
293 | 280 | ||
294 | /** | 281 | /** |
@@ -311,7 +298,8 @@ typedef int (*GSF_PendingRequestIterator) (void *cls, | |||
311 | * @param it function to call for each request | 298 | * @param it function to call for each request |
312 | * @param cls closure for it | 299 | * @param cls closure for it |
313 | */ | 300 | */ |
314 | void GSF_iterate_pending_requests_ (GSF_PendingRequestIterator it, void *cls); | 301 | void |
302 | GSF_iterate_pending_requests_ (GSF_PendingRequestIterator it, void *cls); | ||
315 | 303 | ||
316 | 304 | ||
317 | /** | 305 | /** |
@@ -327,8 +315,9 @@ void GSF_iterate_pending_requests_ (GSF_PendingRequestIterator it, void *cls); | |||
327 | * GNUNET_SYSERR if the message was malformed (close connection, | 315 | * GNUNET_SYSERR if the message was malformed (close connection, |
328 | * do not cache under any circumstances) | 316 | * do not cache under any circumstances) |
329 | */ | 317 | */ |
330 | int GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp, | 318 | int |
331 | const struct GNUNET_MessageHeader *message); | 319 | GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp, |
320 | const struct GNUNET_MessageHeader *message); | ||
332 | 321 | ||
333 | 322 | ||
334 | /** | 323 | /** |
@@ -336,7 +325,8 @@ int GSF_handle_p2p_content_ (struct GSF_ConnectedPeer *cp, | |||
336 | * | 325 | * |
337 | * @param pr the pending request to process | 326 | * @param pr the pending request to process |
338 | */ | 327 | */ |
339 | void GSF_dht_lookup_ (struct GSF_PendingRequest *pr); | 328 | void |
329 | GSF_dht_lookup_ (struct GSF_PendingRequest *pr); | ||
340 | 330 | ||
341 | 331 | ||
342 | /** | 332 | /** |
@@ -360,20 +350,23 @@ typedef void (*GSF_LocalLookupContinuation) (void *cls, | |||
360 | * @param cont function to call at the end | 350 | * @param cont function to call at the end |
361 | * @param cont_cls closure for cont | 351 | * @param cont_cls closure for cont |
362 | */ | 352 | */ |
363 | void GSF_local_lookup_ (struct GSF_PendingRequest *pr, | 353 | void |
364 | GSF_LocalLookupContinuation cont, void *cont_cls); | 354 | GSF_local_lookup_ (struct GSF_PendingRequest *pr, |
355 | GSF_LocalLookupContinuation cont, void *cont_cls); | ||
365 | 356 | ||
366 | 357 | ||
367 | /** | 358 | /** |
368 | * Setup the subsystem. | 359 | * Setup the subsystem. |
369 | */ | 360 | */ |
370 | void GSF_pending_request_init_ (void); | 361 | void |
362 | GSF_pending_request_init_ (void); | ||
371 | 363 | ||
372 | 364 | ||
373 | /** | 365 | /** |
374 | * Shutdown the subsystem. | 366 | * Shutdown the subsystem. |
375 | */ | 367 | */ |
376 | void GSF_pending_request_done_ (void); | 368 | void |
369 | GSF_pending_request_done_ (void); | ||
377 | 370 | ||
378 | 371 | ||
379 | #endif | 372 | #endif |
diff --git a/src/fs/gnunet-service-fs_push.c b/src/fs/gnunet-service-fs_push.c index 6d8c05999..fb05366af 100644 --- a/src/fs/gnunet-service-fs_push.c +++ b/src/fs/gnunet-service-fs_push.c | |||
@@ -191,7 +191,8 @@ delete_migration_block (struct MigrationReadyBlock *mb) | |||
191 | /** | 191 | /** |
192 | * Find content for migration to this peer. | 192 | * Find content for migration to this peer. |
193 | */ | 193 | */ |
194 | static void find_content (struct MigrationReadyPeer *mrp); | 194 | static void |
195 | find_content (struct MigrationReadyPeer *mrp); | ||
195 | 196 | ||
196 | 197 | ||
197 | /** | 198 | /** |
@@ -343,7 +344,8 @@ score_content (struct MigrationReadyPeer *peer, | |||
343 | * If the migration task is not currently running, consider | 344 | * If the migration task is not currently running, consider |
344 | * (re)scheduling it with the appropriate delay. | 345 | * (re)scheduling it with the appropriate delay. |
345 | */ | 346 | */ |
346 | static void consider_gathering (void); | 347 | static void |
348 | consider_gathering (void); | ||
347 | 349 | ||
348 | 350 | ||
349 | /** | 351 | /** |
@@ -421,9 +423,9 @@ find_content (struct MigrationReadyPeer *mrp) | |||
421 | * @param cls unused | 423 | * @param cls unused |
422 | * @param tc scheduler context (also unused) | 424 | * @param tc scheduler context (also unused) |
423 | */ | 425 | */ |
424 | static void gather_migration_blocks (void *cls, | 426 | static void |
425 | const struct GNUNET_SCHEDULER_TaskContext | 427 | gather_migration_blocks (void *cls, |
426 | *tc); | 428 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
427 | 429 | ||
428 | 430 | ||
429 | /** | 431 | /** |
diff --git a/src/fs/gnunet-service-fs_push.h b/src/fs/gnunet-service-fs_push.h index 40e1252be..7967b04cd 100644 --- a/src/fs/gnunet-service-fs_push.h +++ b/src/fs/gnunet-service-fs_push.h | |||
@@ -32,13 +32,15 @@ | |||
32 | /** | 32 | /** |
33 | * Setup the module. | 33 | * Setup the module. |
34 | */ | 34 | */ |
35 | void GSF_push_init_ (void); | 35 | void |
36 | GSF_push_init_ (void); | ||
36 | 37 | ||
37 | 38 | ||
38 | /** | 39 | /** |
39 | * Shutdown the module. | 40 | * Shutdown the module. |
40 | */ | 41 | */ |
41 | void GSF_push_done_ (void); | 42 | void |
43 | GSF_push_done_ (void); | ||
42 | 44 | ||
43 | 45 | ||
44 | /** | 46 | /** |
@@ -47,7 +49,8 @@ void GSF_push_done_ (void); | |||
47 | * | 49 | * |
48 | * @param peer handle for the peer that connected | 50 | * @param peer handle for the peer that connected |
49 | */ | 51 | */ |
50 | void GSF_push_start_ (struct GSF_ConnectedPeer *peer); | 52 | void |
53 | GSF_push_start_ (struct GSF_ConnectedPeer *peer); | ||
51 | 54 | ||
52 | 55 | ||
53 | /** | 56 | /** |
@@ -56,7 +59,8 @@ void GSF_push_start_ (struct GSF_ConnectedPeer *peer); | |||
56 | * | 59 | * |
57 | * @param peer handle for the peer that disconnected | 60 | * @param peer handle for the peer that disconnected |
58 | */ | 61 | */ |
59 | void GSF_push_stop_ (struct GSF_ConnectedPeer *peer); | 62 | void |
63 | GSF_push_stop_ (struct GSF_ConnectedPeer *peer); | ||
60 | 64 | ||
61 | 65 | ||
62 | #endif | 66 | #endif |
diff --git a/src/fs/gnunet-service-fs_put.c b/src/fs/gnunet-service-fs_put.c index ec2344b37..4b4925d22 100644 --- a/src/fs/gnunet-service-fs_put.c +++ b/src/fs/gnunet-service-fs_put.c | |||
@@ -86,9 +86,9 @@ static struct PutOperator operators[] = { | |||
86 | * @param cls type of blocks to gather | 86 | * @param cls type of blocks to gather |
87 | * @param tc scheduler context (unused) | 87 | * @param tc scheduler context (unused) |
88 | */ | 88 | */ |
89 | static void gather_dht_put_blocks (void *cls, | 89 | static void |
90 | const struct GNUNET_SCHEDULER_TaskContext | 90 | gather_dht_put_blocks (void *cls, |
91 | *tc); | 91 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
92 | 92 | ||
93 | 93 | ||
94 | /** | 94 | /** |
diff --git a/src/fs/gnunet-service-fs_put.h b/src/fs/gnunet-service-fs_put.h index 21c3c3baf..59b1f83e3 100644 --- a/src/fs/gnunet-service-fs_put.h +++ b/src/fs/gnunet-service-fs_put.h | |||
@@ -32,13 +32,15 @@ | |||
32 | /** | 32 | /** |
33 | * Setup the module. | 33 | * Setup the module. |
34 | */ | 34 | */ |
35 | void GSF_put_init_ (void); | 35 | void |
36 | GSF_put_init_ (void); | ||
36 | 37 | ||
37 | 38 | ||
38 | /** | 39 | /** |
39 | * Shutdown the module. | 40 | * Shutdown the module. |
40 | */ | 41 | */ |
41 | void GSF_put_done_ (void); | 42 | void |
43 | GSF_put_done_ (void); | ||
42 | 44 | ||
43 | 45 | ||
44 | #endif | 46 | #endif |
diff --git a/src/fs/perf_gnunet_service_fs_p2p.c b/src/fs/perf_gnunet_service_fs_p2p.c index 0737ea949..0bf05d0ce 100644 --- a/src/fs/perf_gnunet_service_fs_p2p.c +++ b/src/fs/perf_gnunet_service_fs_p2p.c | |||
@@ -129,7 +129,8 @@ print_stat (void *cls, const char *subsystem, const char *name, uint64_t value, | |||
129 | /** | 129 | /** |
130 | * Function that gathers stats from all daemons. | 130 | * Function that gathers stats from all daemons. |
131 | */ | 131 | */ |
132 | static void stat_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 132 | static void |
133 | stat_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
133 | 134 | ||
134 | 135 | ||
135 | /** | 136 | /** |
@@ -206,8 +207,7 @@ do_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
206 | sm->stat = | 207 | sm->stat = |
207 | GNUNET_STATISTICS_create ("<driver>", | 208 | GNUNET_STATISTICS_create ("<driver>", |
208 | GNUNET_FS_TEST_get_configuration (daemons, | 209 | GNUNET_FS_TEST_get_configuration (daemons, |
209 | sm-> | 210 | sm->daemon)); |
210 | daemon)); | ||
211 | GNUNET_SCHEDULER_add_now (&stat_run, sm); | 211 | GNUNET_SCHEDULER_add_now (&stat_run, sm); |
212 | } | 212 | } |
213 | else | 213 | else |
diff --git a/src/fs/perf_gnunet_service_fs_p2p_trust.c b/src/fs/perf_gnunet_service_fs_p2p_trust.c index 5a8d4242a..3432714b3 100644 --- a/src/fs/perf_gnunet_service_fs_p2p_trust.c +++ b/src/fs/perf_gnunet_service_fs_p2p_trust.c | |||
@@ -162,7 +162,8 @@ print_stat (void *cls, const char *subsystem, const char *name, uint64_t value, | |||
162 | /** | 162 | /** |
163 | * Function that gathers stats from all daemons. | 163 | * Function that gathers stats from all daemons. |
164 | */ | 164 | */ |
165 | static void stat_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 165 | static void |
166 | stat_run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
166 | 167 | ||
167 | 168 | ||
168 | /** | 169 | /** |
@@ -244,8 +245,7 @@ do_report (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
244 | sm->stat = | 245 | sm->stat = |
245 | GNUNET_STATISTICS_create ("<driver>", | 246 | GNUNET_STATISTICS_create ("<driver>", |
246 | GNUNET_FS_TEST_get_configuration (daemons, | 247 | GNUNET_FS_TEST_get_configuration (daemons, |
247 | sm-> | 248 | sm->daemon)); |
248 | daemon)); | ||
249 | GNUNET_SCHEDULER_add_now (&stat_run, sm); | 249 | GNUNET_SCHEDULER_add_now (&stat_run, sm); |
250 | } | 250 | } |
251 | else | 251 | else |
diff --git a/src/fs/test_fs_download.c b/src/fs/test_fs_download.c index 34625ff2e..10f4c0ce4 100644 --- a/src/fs/test_fs_download.c +++ b/src/fs/test_fs_download.c | |||
@@ -140,42 +140,42 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
140 | (unsigned long long) event->value.publish.completed, | 140 | (unsigned long long) event->value.publish.completed, |
141 | (unsigned long long) event->value.publish.size, | 141 | (unsigned long long) event->value.publish.size, |
142 | event->value.publish.specifics.progress.depth, | 142 | event->value.publish.specifics.progress.depth, |
143 | (unsigned long long) event->value.publish.specifics.progress. | 143 | (unsigned long long) event->value.publish.specifics. |
144 | offset); | 144 | progress.offset); |
145 | #endif | 145 | #endif |
146 | break; | 146 | break; |
147 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 147 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
148 | printf ("Publishing complete, %llu kb/s.\n", | 148 | printf ("Publishing complete, %llu kb/s.\n", |
149 | (unsigned long long) (FILESIZE * 1000LL / | 149 | (unsigned long long) (FILESIZE * 1000LL / |
150 | (1 + | 150 | (1 + |
151 | GNUNET_TIME_absolute_get_duration (start). | 151 | GNUNET_TIME_absolute_get_duration |
152 | rel_value) / 1024LL)); | 152 | (start).rel_value) / 1024LL)); |
153 | GAUGER ("FS", "Publishing speed (insertion)", | 153 | GAUGER ("FS", "Publishing speed (insertion)", |
154 | (unsigned long long) (FILESIZE * 1000LL / | 154 | (unsigned long long) (FILESIZE * 1000LL / |
155 | (1 + | 155 | (1 + |
156 | GNUNET_TIME_absolute_get_duration (start). | 156 | GNUNET_TIME_absolute_get_duration |
157 | rel_value) / 1024LL), "kb/s"); | 157 | (start).rel_value) / 1024LL), "kb/s"); |
158 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); | 158 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); |
159 | start = GNUNET_TIME_absolute_get (); | 159 | start = GNUNET_TIME_absolute_get (); |
160 | download = | 160 | download = |
161 | GNUNET_FS_download_start (fs, | 161 | GNUNET_FS_download_start (fs, |
162 | event->value.publish.specifics.completed. | 162 | event->value.publish.specifics. |
163 | chk_uri, NULL, fn, NULL, 0, FILESIZE, 1, | 163 | completed.chk_uri, NULL, fn, NULL, 0, |
164 | GNUNET_FS_DOWNLOAD_OPTION_NONE, "download", | 164 | FILESIZE, 1, GNUNET_FS_DOWNLOAD_OPTION_NONE, |
165 | NULL); | 165 | "download", NULL); |
166 | GNUNET_assert (download != NULL); | 166 | GNUNET_assert (download != NULL); |
167 | break; | 167 | break; |
168 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: | 168 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: |
169 | printf ("Download complete, %llu kb/s.\n", | 169 | printf ("Download complete, %llu kb/s.\n", |
170 | (unsigned long long) (FILESIZE * 1000LL / | 170 | (unsigned long long) (FILESIZE * 1000LL / |
171 | (1 + | 171 | (1 + |
172 | GNUNET_TIME_absolute_get_duration (start). | 172 | GNUNET_TIME_absolute_get_duration |
173 | rel_value) / 1024LL)); | 173 | (start).rel_value) / 1024LL)); |
174 | GAUGER ("FS", "Local download speed (inserted)", | 174 | GAUGER ("FS", "Local download speed (inserted)", |
175 | (unsigned long long) (FILESIZE * 1000LL / | 175 | (unsigned long long) (FILESIZE * 1000LL / |
176 | (1 + | 176 | (1 + |
177 | GNUNET_TIME_absolute_get_duration (start). | 177 | GNUNET_TIME_absolute_get_duration |
178 | rel_value) / 1024LL), "kb/s"); | 178 | (start).rel_value) / 1024LL), "kb/s"); |
179 | GNUNET_SCHEDULER_add_now (&abort_download_task, NULL); | 179 | GNUNET_SCHEDULER_add_now (&abort_download_task, NULL); |
180 | break; | 180 | break; |
181 | case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: | 181 | case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: |
@@ -185,8 +185,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
185 | (unsigned long long) event->value.download.completed, | 185 | (unsigned long long) event->value.download.completed, |
186 | (unsigned long long) event->value.download.size, | 186 | (unsigned long long) event->value.download.size, |
187 | event->value.download.specifics.progress.depth, | 187 | event->value.download.specifics.progress.depth, |
188 | (unsigned long long) event->value.download.specifics.progress. | 188 | (unsigned long long) event->value.download.specifics. |
189 | offset); | 189 | progress.offset); |
190 | #endif | 190 | #endif |
191 | break; | 191 | break; |
192 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | 192 | case GNUNET_FS_STATUS_PUBLISH_ERROR: |
diff --git a/src/fs/test_fs_download_indexed.c b/src/fs/test_fs_download_indexed.c index 5b1752e63..1811b325d 100644 --- a/src/fs/test_fs_download_indexed.c +++ b/src/fs/test_fs_download_indexed.c | |||
@@ -141,42 +141,42 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
141 | (unsigned long long) event->value.publish.completed, | 141 | (unsigned long long) event->value.publish.completed, |
142 | (unsigned long long) event->value.publish.size, | 142 | (unsigned long long) event->value.publish.size, |
143 | event->value.publish.specifics.progress.depth, | 143 | event->value.publish.specifics.progress.depth, |
144 | (unsigned long long) event->value.publish.specifics.progress. | 144 | (unsigned long long) event->value.publish.specifics. |
145 | offset); | 145 | progress.offset); |
146 | #endif | 146 | #endif |
147 | break; | 147 | break; |
148 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 148 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
149 | printf ("Publishing complete, %llu kbps.\n", | 149 | printf ("Publishing complete, %llu kbps.\n", |
150 | (unsigned long long) (FILESIZE * 1000LL / | 150 | (unsigned long long) (FILESIZE * 1000LL / |
151 | (1 + | 151 | (1 + |
152 | GNUNET_TIME_absolute_get_duration (start). | 152 | GNUNET_TIME_absolute_get_duration |
153 | rel_value) / 1024LL)); | 153 | (start).rel_value) / 1024LL)); |
154 | GAUGER ("FS", "Publishing speed (indexing)", | 154 | GAUGER ("FS", "Publishing speed (indexing)", |
155 | (unsigned long long) (FILESIZE * 1000LL / | 155 | (unsigned long long) (FILESIZE * 1000LL / |
156 | (1 + | 156 | (1 + |
157 | GNUNET_TIME_absolute_get_duration (start). | 157 | GNUNET_TIME_absolute_get_duration |
158 | rel_value) / 1024LL), "kb/s"); | 158 | (start).rel_value) / 1024LL), "kb/s"); |
159 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); | 159 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); |
160 | start = GNUNET_TIME_absolute_get (); | 160 | start = GNUNET_TIME_absolute_get (); |
161 | download = | 161 | download = |
162 | GNUNET_FS_download_start (fs, | 162 | GNUNET_FS_download_start (fs, |
163 | event->value.publish.specifics.completed. | 163 | event->value.publish.specifics. |
164 | chk_uri, NULL, fn, NULL, 0, FILESIZE, 1, | 164 | completed.chk_uri, NULL, fn, NULL, 0, |
165 | GNUNET_FS_DOWNLOAD_OPTION_NONE, "download", | 165 | FILESIZE, 1, GNUNET_FS_DOWNLOAD_OPTION_NONE, |
166 | NULL); | 166 | "download", NULL); |
167 | GNUNET_assert (download != NULL); | 167 | GNUNET_assert (download != NULL); |
168 | break; | 168 | break; |
169 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: | 169 | case GNUNET_FS_STATUS_DOWNLOAD_COMPLETED: |
170 | printf ("Download complete, %llu kbps.\n", | 170 | printf ("Download complete, %llu kbps.\n", |
171 | (unsigned long long) (FILESIZE * 1000LL / | 171 | (unsigned long long) (FILESIZE * 1000LL / |
172 | (1 + | 172 | (1 + |
173 | GNUNET_TIME_absolute_get_duration (start). | 173 | GNUNET_TIME_absolute_get_duration |
174 | rel_value) / 1024LL)); | 174 | (start).rel_value) / 1024LL)); |
175 | GAUGER ("FS", "Local download speed (indexed)", | 175 | GAUGER ("FS", "Local download speed (indexed)", |
176 | (unsigned long long) (FILESIZE * 1000LL / | 176 | (unsigned long long) (FILESIZE * 1000LL / |
177 | (1 + | 177 | (1 + |
178 | GNUNET_TIME_absolute_get_duration (start). | 178 | GNUNET_TIME_absolute_get_duration |
179 | rel_value) / 1024LL), "kb/s"); | 179 | (start).rel_value) / 1024LL), "kb/s"); |
180 | GNUNET_SCHEDULER_add_now (&abort_download_task, NULL); | 180 | GNUNET_SCHEDULER_add_now (&abort_download_task, NULL); |
181 | break; | 181 | break; |
182 | case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: | 182 | case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: |
@@ -186,8 +186,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
186 | (unsigned long long) event->value.download.completed, | 186 | (unsigned long long) event->value.download.completed, |
187 | (unsigned long long) event->value.download.size, | 187 | (unsigned long long) event->value.download.size, |
188 | event->value.download.specifics.progress.depth, | 188 | event->value.download.specifics.progress.depth, |
189 | (unsigned long long) event->value.download.specifics.progress. | 189 | (unsigned long long) event->value.download.specifics. |
190 | offset); | 190 | progress.offset); |
191 | #endif | 191 | #endif |
192 | break; | 192 | break; |
193 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | 193 | case GNUNET_FS_STATUS_PUBLISH_ERROR: |
diff --git a/src/fs/test_fs_download_persistence.c b/src/fs/test_fs_download_persistence.c index 5b2a53f80..c7a0a8b7c 100644 --- a/src/fs/test_fs_download_persistence.c +++ b/src/fs/test_fs_download_persistence.c | |||
@@ -123,8 +123,8 @@ abort_download_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
123 | } | 123 | } |
124 | 124 | ||
125 | 125 | ||
126 | static void *progress_cb (void *cls, | 126 | static void * |
127 | const struct GNUNET_FS_ProgressInfo *event); | 127 | progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event); |
128 | 128 | ||
129 | 129 | ||
130 | static void | 130 | static void |
@@ -171,16 +171,16 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
171 | (unsigned long long) event->value.publish.completed, | 171 | (unsigned long long) event->value.publish.completed, |
172 | (unsigned long long) event->value.publish.size, | 172 | (unsigned long long) event->value.publish.size, |
173 | event->value.publish.specifics.progress.depth, | 173 | event->value.publish.specifics.progress.depth, |
174 | (unsigned long long) event->value.publish.specifics.progress. | 174 | (unsigned long long) event->value.publish.specifics. |
175 | offset); | 175 | progress.offset); |
176 | #endif | 176 | #endif |
177 | break; | 177 | break; |
178 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 178 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
179 | printf ("Publishing complete, %llu kbps.\n", | 179 | printf ("Publishing complete, %llu kbps.\n", |
180 | (unsigned long long) (FILESIZE * 1000LL / | 180 | (unsigned long long) (FILESIZE * 1000LL / |
181 | (1 + | 181 | (1 + |
182 | GNUNET_TIME_absolute_get_duration (start). | 182 | GNUNET_TIME_absolute_get_duration |
183 | rel_value) / 1024LL)); | 183 | (start).rel_value) / 1024LL)); |
184 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); | 184 | fn = GNUNET_DISK_mktemp ("gnunet-download-test-dst"); |
185 | start = GNUNET_TIME_absolute_get (); | 185 | start = GNUNET_TIME_absolute_get (); |
186 | GNUNET_assert (download == NULL); | 186 | GNUNET_assert (download == NULL); |
@@ -194,8 +194,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
194 | printf ("Download complete, %llu kbps.\n", | 194 | printf ("Download complete, %llu kbps.\n", |
195 | (unsigned long long) (FILESIZE * 1000LL / | 195 | (unsigned long long) (FILESIZE * 1000LL / |
196 | (1 + | 196 | (1 + |
197 | GNUNET_TIME_absolute_get_duration (start). | 197 | GNUNET_TIME_absolute_get_duration |
198 | rel_value) / 1024LL)); | 198 | (start).rel_value) / 1024LL)); |
199 | GNUNET_SCHEDULER_add_now (&abort_download_task, NULL); | 199 | GNUNET_SCHEDULER_add_now (&abort_download_task, NULL); |
200 | break; | 200 | break; |
201 | case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: | 201 | case GNUNET_FS_STATUS_DOWNLOAD_PROGRESS: |
@@ -206,8 +206,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
206 | (unsigned long long) event->value.download.completed, | 206 | (unsigned long long) event->value.download.completed, |
207 | (unsigned long long) event->value.download.size, | 207 | (unsigned long long) event->value.download.size, |
208 | event->value.download.specifics.progress.depth, | 208 | event->value.download.specifics.progress.depth, |
209 | (unsigned long long) event->value.download.specifics.progress. | 209 | (unsigned long long) event->value.download.specifics. |
210 | offset); | 210 | progress.offset); |
211 | #endif | 211 | #endif |
212 | break; | 212 | break; |
213 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | 213 | case GNUNET_FS_STATUS_PUBLISH_ERROR: |
diff --git a/src/fs/test_fs_list_indexed.c b/src/fs/test_fs_list_indexed.c index 87afa12e1..b86506f8d 100644 --- a/src/fs/test_fs_list_indexed.c +++ b/src/fs/test_fs_list_indexed.c | |||
@@ -110,8 +110,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
110 | printf ("Publish complete, %llu kbps.\n", | 110 | printf ("Publish complete, %llu kbps.\n", |
111 | (unsigned long long) (FILESIZE * 1000 / | 111 | (unsigned long long) (FILESIZE * 1000 / |
112 | (1 + | 112 | (1 + |
113 | GNUNET_TIME_absolute_get_duration (start). | 113 | GNUNET_TIME_absolute_get_duration |
114 | rel_value) / 1024)); | 114 | (start).rel_value) / 1024)); |
115 | if (0 == strcmp ("list_indexed-context-dir", event->value.publish.cctx)) | 115 | if (0 == strcmp ("list_indexed-context-dir", event->value.publish.cctx)) |
116 | GNUNET_SCHEDULER_add_continuation (&list_indexed_task, NULL, | 116 | GNUNET_SCHEDULER_add_continuation (&list_indexed_task, NULL, |
117 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 117 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
@@ -125,8 +125,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
125 | (unsigned long long) event->value.publish.completed, | 125 | (unsigned long long) event->value.publish.completed, |
126 | (unsigned long long) event->value.publish.size, | 126 | (unsigned long long) event->value.publish.size, |
127 | event->value.publish.specifics.progress.depth, | 127 | event->value.publish.specifics.progress.depth, |
128 | (unsigned long long) event->value.publish.specifics.progress. | 128 | (unsigned long long) event->value.publish.specifics. |
129 | offset); | 129 | progress.offset); |
130 | #endif | 130 | #endif |
131 | break; | 131 | break; |
132 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | 132 | case GNUNET_FS_STATUS_PUBLISH_ERROR: |
diff --git a/src/fs/test_fs_publish.c b/src/fs/test_fs_publish.c index 797c4c9a8..3db0a7c62 100644 --- a/src/fs/test_fs_publish.c +++ b/src/fs/test_fs_publish.c | |||
@@ -98,8 +98,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
98 | printf ("Publish complete, %llu kbps.\n", | 98 | printf ("Publish complete, %llu kbps.\n", |
99 | (unsigned long long) (FILESIZE * 1000 / | 99 | (unsigned long long) (FILESIZE * 1000 / |
100 | (1 + | 100 | (1 + |
101 | GNUNET_TIME_absolute_get_duration (start). | 101 | GNUNET_TIME_absolute_get_duration |
102 | rel_value) / 1024)); | 102 | (start).rel_value) / 1024)); |
103 | if (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) | 103 | if (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) |
104 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, | 104 | GNUNET_SCHEDULER_add_continuation (&abort_publish_task, NULL, |
105 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 105 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
@@ -112,8 +112,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
112 | (unsigned long long) event->value.publish.completed, | 112 | (unsigned long long) event->value.publish.completed, |
113 | (unsigned long long) event->value.publish.size, | 113 | (unsigned long long) event->value.publish.size, |
114 | event->value.publish.specifics.progress.depth, | 114 | event->value.publish.specifics.progress.depth, |
115 | (unsigned long long) event->value.publish.specifics.progress. | 115 | (unsigned long long) event->value.publish.specifics. |
116 | offset); | 116 | progress.offset); |
117 | #endif | 117 | #endif |
118 | break; | 118 | break; |
119 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | 119 | case GNUNET_FS_STATUS_PUBLISH_ERROR: |
diff --git a/src/fs/test_fs_publish_persistence.c b/src/fs/test_fs_publish_persistence.c index f69ac5d9a..704c2a4c0 100644 --- a/src/fs/test_fs_publish_persistence.c +++ b/src/fs/test_fs_publish_persistence.c | |||
@@ -97,8 +97,8 @@ abort_publish_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
97 | } | 97 | } |
98 | 98 | ||
99 | 99 | ||
100 | static void *progress_cb (void *cls, | 100 | static void * |
101 | const struct GNUNET_FS_ProgressInfo *event); | 101 | progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event); |
102 | 102 | ||
103 | 103 | ||
104 | static void | 104 | static void |
@@ -149,8 +149,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
149 | printf ("Publish complete, %llu kbps.\n", | 149 | printf ("Publish complete, %llu kbps.\n", |
150 | (unsigned long long) (FILESIZE * 1000LL / | 150 | (unsigned long long) (FILESIZE * 1000LL / |
151 | (1 + | 151 | (1 + |
152 | GNUNET_TIME_absolute_get_duration (start). | 152 | GNUNET_TIME_absolute_get_duration |
153 | rel_value) / 1024)); | 153 | (start).rel_value) / 1024)); |
154 | if (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) | 154 | if (0 == strcmp ("publish-context-dir", event->value.publish.cctx)) |
155 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); | 155 | GNUNET_SCHEDULER_add_now (&abort_publish_task, NULL); |
156 | break; | 156 | break; |
@@ -163,8 +163,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
163 | (unsigned long long) event->value.publish.completed, | 163 | (unsigned long long) event->value.publish.completed, |
164 | (unsigned long long) event->value.publish.size, | 164 | (unsigned long long) event->value.publish.size, |
165 | event->value.publish.specifics.progress.depth, | 165 | event->value.publish.specifics.progress.depth, |
166 | (unsigned long long) event->value.publish.specifics.progress. | 166 | (unsigned long long) event->value.publish.specifics. |
167 | offset); | 167 | progress.offset); |
168 | #endif | 168 | #endif |
169 | break; | 169 | break; |
170 | case GNUNET_FS_STATUS_PUBLISH_SUSPEND: | 170 | case GNUNET_FS_STATUS_PUBLISH_SUSPEND: |
@@ -175,8 +175,9 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
175 | if (NULL == publish) | 175 | if (NULL == publish) |
176 | { | 176 | { |
177 | GNUNET_assert (GNUNET_YES == | 177 | GNUNET_assert (GNUNET_YES == |
178 | GNUNET_FS_file_information_is_directory (event->value. | 178 | GNUNET_FS_file_information_is_directory (event-> |
179 | publish.fi)); | 179 | value.publish. |
180 | fi)); | ||
180 | publish = event->value.publish.pc; | 181 | publish = event->value.publish.pc; |
181 | return "publish-context-dir"; | 182 | return "publish-context-dir"; |
182 | } | 183 | } |
diff --git a/src/fs/test_fs_search.c b/src/fs/test_fs_search.c index 3961017cf..d8e592b6f 100644 --- a/src/fs/test_fs_search.c +++ b/src/fs/test_fs_search.c | |||
@@ -101,8 +101,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
101 | (unsigned long long) event->value.publish.completed, | 101 | (unsigned long long) event->value.publish.completed, |
102 | (unsigned long long) event->value.publish.size, | 102 | (unsigned long long) event->value.publish.size, |
103 | event->value.publish.specifics.progress.depth, | 103 | event->value.publish.specifics.progress.depth, |
104 | (unsigned long long) event->value.publish.specifics.progress. | 104 | (unsigned long long) event->value.publish.specifics. |
105 | offset); | 105 | progress.offset); |
106 | #endif | 106 | #endif |
107 | break; | 107 | break; |
108 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 108 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
diff --git a/src/fs/test_fs_search_persistence.c b/src/fs/test_fs_search_persistence.c index 5c5a6f140..6eb18dafb 100644 --- a/src/fs/test_fs_search_persistence.c +++ b/src/fs/test_fs_search_persistence.c | |||
@@ -86,8 +86,8 @@ abort_search_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
86 | } | 86 | } |
87 | 87 | ||
88 | 88 | ||
89 | static void *progress_cb (void *cls, | 89 | static void * |
90 | const struct GNUNET_FS_ProgressInfo *event); | 90 | progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event); |
91 | 91 | ||
92 | 92 | ||
93 | static void | 93 | static void |
@@ -140,8 +140,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
140 | (unsigned long long) event->value.publish.completed, | 140 | (unsigned long long) event->value.publish.completed, |
141 | (unsigned long long) event->value.publish.size, | 141 | (unsigned long long) event->value.publish.size, |
142 | event->value.publish.specifics.progress.depth, | 142 | event->value.publish.specifics.progress.depth, |
143 | (unsigned long long) event->value.publish.specifics.progress. | 143 | (unsigned long long) event->value.publish.specifics. |
144 | offset); | 144 | progress.offset); |
145 | #endif | 145 | #endif |
146 | break; | 146 | break; |
147 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 147 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
diff --git a/src/fs/test_fs_unindex.c b/src/fs/test_fs_unindex.c index 177b687ca..99913fbcf 100644 --- a/src/fs/test_fs_unindex.c +++ b/src/fs/test_fs_unindex.c | |||
@@ -100,16 +100,16 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
100 | (unsigned long long) event->value.publish.completed, | 100 | (unsigned long long) event->value.publish.completed, |
101 | (unsigned long long) event->value.publish.size, | 101 | (unsigned long long) event->value.publish.size, |
102 | event->value.publish.specifics.progress.depth, | 102 | event->value.publish.specifics.progress.depth, |
103 | (unsigned long long) event->value.publish.specifics.progress. | 103 | (unsigned long long) event->value.publish.specifics. |
104 | offset); | 104 | progress.offset); |
105 | #endif | 105 | #endif |
106 | break; | 106 | break; |
107 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 107 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
108 | printf ("Publishing complete, %llu kbps.\n", | 108 | printf ("Publishing complete, %llu kbps.\n", |
109 | (unsigned long long) (FILESIZE * 1000 / | 109 | (unsigned long long) (FILESIZE * 1000 / |
110 | (1 + | 110 | (1 + |
111 | GNUNET_TIME_absolute_get_duration (start). | 111 | GNUNET_TIME_absolute_get_duration |
112 | rel_value) / 1024)); | 112 | (start).rel_value) / 1024)); |
113 | start = GNUNET_TIME_absolute_get (); | 113 | start = GNUNET_TIME_absolute_get (); |
114 | unindex = GNUNET_FS_unindex_start (fs, fn, "unindex"); | 114 | unindex = GNUNET_FS_unindex_start (fs, fn, "unindex"); |
115 | GNUNET_assert (unindex != NULL); | 115 | GNUNET_assert (unindex != NULL); |
@@ -118,8 +118,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
118 | printf ("Unindex complete, %llu kbps.\n", | 118 | printf ("Unindex complete, %llu kbps.\n", |
119 | (unsigned long long) (FILESIZE * 1000 / | 119 | (unsigned long long) (FILESIZE * 1000 / |
120 | (1 + | 120 | (1 + |
121 | GNUNET_TIME_absolute_get_duration (start). | 121 | GNUNET_TIME_absolute_get_duration |
122 | rel_value) / 1024)); | 122 | (start).rel_value) / 1024)); |
123 | GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL, | 123 | GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL, |
124 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 124 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
125 | break; | 125 | break; |
@@ -130,8 +130,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
130 | (unsigned long long) event->value.unindex.completed, | 130 | (unsigned long long) event->value.unindex.completed, |
131 | (unsigned long long) event->value.unindex.size, | 131 | (unsigned long long) event->value.unindex.size, |
132 | event->value.unindex.specifics.progress.depth, | 132 | event->value.unindex.specifics.progress.depth, |
133 | (unsigned long long) event->value.unindex.specifics.progress. | 133 | (unsigned long long) event->value.unindex.specifics. |
134 | offset); | 134 | progress.offset); |
135 | #endif | 135 | #endif |
136 | break; | 136 | break; |
137 | case GNUNET_FS_STATUS_PUBLISH_ERROR: | 137 | case GNUNET_FS_STATUS_PUBLISH_ERROR: |
diff --git a/src/fs/test_fs_unindex_persistence.c b/src/fs/test_fs_unindex_persistence.c index 4fcd1445f..e81400817 100644 --- a/src/fs/test_fs_unindex_persistence.c +++ b/src/fs/test_fs_unindex_persistence.c | |||
@@ -94,8 +94,8 @@ abort_unindex_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
94 | } | 94 | } |
95 | 95 | ||
96 | 96 | ||
97 | static void *progress_cb (void *cls, | 97 | static void * |
98 | const struct GNUNET_FS_ProgressInfo *event); | 98 | progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event); |
99 | 99 | ||
100 | 100 | ||
101 | static void | 101 | static void |
@@ -141,16 +141,16 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
141 | (unsigned long long) event->value.publish.completed, | 141 | (unsigned long long) event->value.publish.completed, |
142 | (unsigned long long) event->value.publish.size, | 142 | (unsigned long long) event->value.publish.size, |
143 | event->value.publish.specifics.progress.depth, | 143 | event->value.publish.specifics.progress.depth, |
144 | (unsigned long long) event->value.publish.specifics.progress. | 144 | (unsigned long long) event->value.publish.specifics. |
145 | offset); | 145 | progress.offset); |
146 | #endif | 146 | #endif |
147 | break; | 147 | break; |
148 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: | 148 | case GNUNET_FS_STATUS_PUBLISH_COMPLETED: |
149 | printf ("Publishing complete, %llu kbps.\n", | 149 | printf ("Publishing complete, %llu kbps.\n", |
150 | (unsigned long long) (FILESIZE * 1000 / | 150 | (unsigned long long) (FILESIZE * 1000 / |
151 | (1 + | 151 | (1 + |
152 | GNUNET_TIME_absolute_get_duration (start). | 152 | GNUNET_TIME_absolute_get_duration |
153 | rel_value) / 1024)); | 153 | (start).rel_value) / 1024)); |
154 | start = GNUNET_TIME_absolute_get (); | 154 | start = GNUNET_TIME_absolute_get (); |
155 | unindex = GNUNET_FS_unindex_start (fs, fn, "unindex"); | 155 | unindex = GNUNET_FS_unindex_start (fs, fn, "unindex"); |
156 | GNUNET_assert (unindex != NULL); | 156 | GNUNET_assert (unindex != NULL); |
@@ -159,8 +159,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
159 | printf ("Unindex complete, %llu kbps.\n", | 159 | printf ("Unindex complete, %llu kbps.\n", |
160 | (unsigned long long) (FILESIZE * 1000 / | 160 | (unsigned long long) (FILESIZE * 1000 / |
161 | (1 + | 161 | (1 + |
162 | GNUNET_TIME_absolute_get_duration (start). | 162 | GNUNET_TIME_absolute_get_duration |
163 | rel_value) / 1024)); | 163 | (start).rel_value) / 1024)); |
164 | GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL, | 164 | GNUNET_SCHEDULER_add_continuation (&abort_unindex_task, NULL, |
165 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); | 165 | GNUNET_SCHEDULER_REASON_PREREQ_DONE); |
166 | break; | 166 | break; |
@@ -172,8 +172,8 @@ progress_cb (void *cls, const struct GNUNET_FS_ProgressInfo *event) | |||
172 | (unsigned long long) event->value.unindex.completed, | 172 | (unsigned long long) event->value.unindex.completed, |
173 | (unsigned long long) event->value.unindex.size, | 173 | (unsigned long long) event->value.unindex.size, |
174 | event->value.unindex.specifics.progress.depth, | 174 | event->value.unindex.specifics.progress.depth, |
175 | (unsigned long long) event->value.unindex.specifics.progress. | 175 | (unsigned long long) event->value.unindex.specifics. |
176 | offset); | 176 | progress.offset); |
177 | #endif | 177 | #endif |
178 | break; | 178 | break; |
179 | case GNUNET_FS_STATUS_PUBLISH_SUSPEND: | 179 | case GNUNET_FS_STATUS_PUBLISH_SUSPEND: |
diff --git a/src/hostlist/hostlist-client.c b/src/hostlist/hostlist-client.c index c049dceea..f6a47f4d9 100644 --- a/src/hostlist/hostlist-client.c +++ b/src/hostlist/hostlist-client.c | |||
@@ -476,7 +476,8 @@ download_get_url () | |||
476 | * Method to save hostlist to a file during hostlist client shutdown | 476 | * Method to save hostlist to a file during hostlist client shutdown |
477 | * @param shutdown set if called because of shutdown, entries in linked list will be destroyed | 477 | * @param shutdown set if called because of shutdown, entries in linked list will be destroyed |
478 | */ | 478 | */ |
479 | static void save_hostlist_file (int shutdown); | 479 | static void |
480 | save_hostlist_file (int shutdown); | ||
480 | 481 | ||
481 | 482 | ||
482 | /** | 483 | /** |
@@ -708,8 +709,8 @@ clean_up () | |||
708 | * @param cls closure, unused | 709 | * @param cls closure, unused |
709 | * @param tc task context, unused | 710 | * @param tc task context, unused |
710 | */ | 711 | */ |
711 | static void task_download (void *cls, | 712 | static void |
712 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 713 | task_download (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
713 | 714 | ||
714 | 715 | ||
715 | /** | 716 | /** |
diff --git a/src/hostlist/hostlist-client.h b/src/hostlist/hostlist-client.h index c6561c820..3def865e4 100644 --- a/src/hostlist/hostlist-client.h +++ b/src/hostlist/hostlist-client.h | |||
@@ -89,17 +89,19 @@ | |||
89 | * @param learn set if client is learning new hostlists | 89 | * @param learn set if client is learning new hostlists |
90 | * @return GNUNET_OK on success | 90 | * @return GNUNET_OK on success |
91 | */ | 91 | */ |
92 | int GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c, | 92 | int |
93 | struct GNUNET_STATISTICS_Handle *st, | 93 | GNUNET_HOSTLIST_client_start (const struct GNUNET_CONFIGURATION_Handle *c, |
94 | GNUNET_CORE_ConnectEventHandler *ch, | 94 | struct GNUNET_STATISTICS_Handle *st, |
95 | GNUNET_CORE_DisconnectEventHandler *dh, | 95 | GNUNET_CORE_ConnectEventHandler *ch, |
96 | GNUNET_CORE_MessageCallback *msgh, int learn); | 96 | GNUNET_CORE_DisconnectEventHandler *dh, |
97 | GNUNET_CORE_MessageCallback *msgh, int learn); | ||
97 | 98 | ||
98 | 99 | ||
99 | /** | 100 | /** |
100 | * Stop downloading hostlists from hostlist servers as necessary. | 101 | * Stop downloading hostlists from hostlist servers as necessary. |
101 | */ | 102 | */ |
102 | void GNUNET_HOSTLIST_client_stop (void); | 103 | void |
104 | GNUNET_HOSTLIST_client_stop (void); | ||
103 | 105 | ||
104 | 106 | ||
105 | #endif | 107 | #endif |
diff --git a/src/hostlist/hostlist-server.c b/src/hostlist/hostlist-server.c index e48b6a4ac..bfe0b4b0e 100644 --- a/src/hostlist/hostlist-server.c +++ b/src/hostlist/hostlist-server.c | |||
@@ -448,8 +448,8 @@ process_notify (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
448 | * Function that queries MHD's select sets and | 448 | * Function that queries MHD's select sets and |
449 | * starts the task waiting for them. | 449 | * starts the task waiting for them. |
450 | */ | 450 | */ |
451 | static GNUNET_SCHEDULER_TaskIdentifier prepare_daemon (struct MHD_Daemon | 451 | static GNUNET_SCHEDULER_TaskIdentifier |
452 | *daemon_handle); | 452 | prepare_daemon (struct MHD_Daemon *daemon_handle); |
453 | 453 | ||
454 | 454 | ||
455 | /** | 455 | /** |
diff --git a/src/hostlist/hostlist-server.h b/src/hostlist/hostlist-server.h index b5960b39c..e0f8eb4a6 100644 --- a/src/hostlist/hostlist-server.h +++ b/src/hostlist/hostlist-server.h | |||
@@ -38,18 +38,20 @@ | |||
38 | * | 38 | * |
39 | * @return GNUNET_OK on success | 39 | * @return GNUNET_OK on success |
40 | */ | 40 | */ |
41 | int GNUNET_HOSTLIST_server_start (const struct GNUNET_CONFIGURATION_Handle *c, | 41 | int |
42 | struct GNUNET_STATISTICS_Handle *st, | 42 | GNUNET_HOSTLIST_server_start (const struct GNUNET_CONFIGURATION_Handle *c, |
43 | struct GNUNET_CORE_Handle *core, | 43 | struct GNUNET_STATISTICS_Handle *st, |
44 | GNUNET_CORE_ConnectEventHandler *server_ch, | 44 | struct GNUNET_CORE_Handle *core, |
45 | GNUNET_CORE_DisconnectEventHandler *server_dh, | 45 | GNUNET_CORE_ConnectEventHandler *server_ch, |
46 | int advertise); | 46 | GNUNET_CORE_DisconnectEventHandler *server_dh, |
47 | int advertise); | ||
47 | 48 | ||
48 | 49 | ||
49 | /** | 50 | /** |
50 | * Stop server offering our hostlist. | 51 | * Stop server offering our hostlist. |
51 | */ | 52 | */ |
52 | void GNUNET_HOSTLIST_server_stop (void); | 53 | void |
54 | GNUNET_HOSTLIST_server_stop (void); | ||
53 | 55 | ||
54 | 56 | ||
55 | #endif | 57 | #endif |
diff --git a/src/include/gnunet_arm_service.h b/src/include/gnunet_arm_service.h index 76529ede4..6d52773de 100644 --- a/src/include/gnunet_arm_service.h +++ b/src/include/gnunet_arm_service.h | |||
@@ -73,9 +73,9 @@ struct GNUNET_ARM_Handle; | |||
73 | * @param service service that *this* process is implementing/providing, can be NULL | 73 | * @param service service that *this* process is implementing/providing, can be NULL |
74 | * @return context to use for further ARM operations, NULL on error | 74 | * @return context to use for further ARM operations, NULL on error |
75 | */ | 75 | */ |
76 | struct GNUNET_ARM_Handle *GNUNET_ARM_connect (const struct | 76 | struct GNUNET_ARM_Handle * |
77 | GNUNET_CONFIGURATION_Handle *cfg, | 77 | GNUNET_ARM_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, |
78 | const char *service); | 78 | const char *service); |
79 | 79 | ||
80 | 80 | ||
81 | /** | 81 | /** |
@@ -83,7 +83,8 @@ struct GNUNET_ARM_Handle *GNUNET_ARM_connect (const struct | |||
83 | * | 83 | * |
84 | * @param h the handle that was being used | 84 | * @param h the handle that was being used |
85 | */ | 85 | */ |
86 | void GNUNET_ARM_disconnect (struct GNUNET_ARM_Handle *h); | 86 | void |
87 | GNUNET_ARM_disconnect (struct GNUNET_ARM_Handle *h); | ||
87 | 88 | ||
88 | 89 | ||
89 | /** | 90 | /** |
@@ -104,10 +105,10 @@ void GNUNET_ARM_disconnect (struct GNUNET_ARM_Handle *h); | |||
104 | * @param cb callback to invoke when service is ready | 105 | * @param cb callback to invoke when service is ready |
105 | * @param cb_cls closure for callback | 106 | * @param cb_cls closure for callback |
106 | */ | 107 | */ |
107 | void GNUNET_ARM_start_service (struct GNUNET_ARM_Handle *h, | 108 | void |
108 | const char *service_name, | 109 | GNUNET_ARM_start_service (struct GNUNET_ARM_Handle *h, const char *service_name, |
109 | struct GNUNET_TIME_Relative timeout, | 110 | struct GNUNET_TIME_Relative timeout, |
110 | GNUNET_ARM_Callback cb, void *cb_cls); | 111 | GNUNET_ARM_Callback cb, void *cb_cls); |
111 | 112 | ||
112 | 113 | ||
113 | /** | 114 | /** |
@@ -121,10 +122,10 @@ void GNUNET_ARM_start_service (struct GNUNET_ARM_Handle *h, | |||
121 | * @param cb callback to invoke when service is ready | 122 | * @param cb callback to invoke when service is ready |
122 | * @param cb_cls closure for callback | 123 | * @param cb_cls closure for callback |
123 | */ | 124 | */ |
124 | void GNUNET_ARM_stop_service (struct GNUNET_ARM_Handle *h, | 125 | void |
125 | const char *service_name, | 126 | GNUNET_ARM_stop_service (struct GNUNET_ARM_Handle *h, const char *service_name, |
126 | struct GNUNET_TIME_Relative timeout, | 127 | struct GNUNET_TIME_Relative timeout, |
127 | GNUNET_ARM_Callback cb, void *cb_cls); | 128 | GNUNET_ARM_Callback cb, void *cb_cls); |
128 | 129 | ||
129 | 130 | ||
130 | 131 | ||
diff --git a/src/include/gnunet_ats_service.h b/src/include/gnunet_ats_service.h index dd648dd75..1de3d1041 100644 --- a/src/include/gnunet_ats_service.h +++ b/src/include/gnunet_ats_service.h | |||
@@ -83,10 +83,10 @@ typedef void (*GNUNET_TRANSPORT_ATS_AllocationNotification) (void *cls, | |||
83 | * @param alloc_cb_cls closure for 'alloc_cb' | 83 | * @param alloc_cb_cls closure for 'alloc_cb' |
84 | * @return ats context | 84 | * @return ats context |
85 | */ | 85 | */ |
86 | struct GNUNET_ATS_Handle *GNUNET_ATS_init (const struct | 86 | struct GNUNET_ATS_Handle * |
87 | GNUNET_CONFIGURATION_Handle *cfg, | 87 | GNUNET_ATS_init (const struct GNUNET_CONFIGURATION_Handle *cfg, |
88 | GNUNET_TRANSPORT_ATS_AllocationNotification | 88 | GNUNET_TRANSPORT_ATS_AllocationNotification alloc_cb, |
89 | alloc_cb, void *alloc_cb_cls); | 89 | void *alloc_cb_cls); |
90 | 90 | ||
91 | 91 | ||
92 | /** | 92 | /** |
@@ -94,7 +94,8 @@ struct GNUNET_ATS_Handle *GNUNET_ATS_init (const struct | |||
94 | * | 94 | * |
95 | * @param atc handle | 95 | * @param atc handle |
96 | */ | 96 | */ |
97 | void GNUNET_ATS_shutdown (struct GNUNET_ATS_Handle *atc); | 97 | void |
98 | GNUNET_ATS_shutdown (struct GNUNET_ATS_Handle *atc); | ||
98 | 99 | ||
99 | 100 | ||
100 | /** | 101 | /** |
@@ -140,15 +141,11 @@ struct GNUNET_ATS_SuggestionContext; | |||
140 | * @param cb function to call with the address | 141 | * @param cb function to call with the address |
141 | * @param cb_cls closure for cb | 142 | * @param cb_cls closure for cb |
142 | */ | 143 | */ |
143 | struct GNUNET_ATS_SuggestionContext *GNUNET_ATS_suggest_address (struct | 144 | struct GNUNET_ATS_SuggestionContext * |
144 | GNUNET_ATS_Handle | 145 | GNUNET_ATS_suggest_address (struct GNUNET_ATS_Handle *atc, |
145 | *atc, | 146 | const struct GNUNET_PeerIdentity *peer, |
146 | const struct | 147 | GNUNET_ATS_AddressSuggestionCallback cb, |
147 | GNUNET_PeerIdentity | 148 | void *cb_cls); |
148 | *peer, | ||
149 | GNUNET_ATS_AddressSuggestionCallback | ||
150 | cb, | ||
151 | void *cb_cls); | ||
152 | 149 | ||
153 | 150 | ||
154 | /** | 151 | /** |
@@ -156,8 +153,8 @@ struct GNUNET_ATS_SuggestionContext *GNUNET_ATS_suggest_address (struct | |||
156 | * | 153 | * |
157 | * @param asc handle of the request to cancel | 154 | * @param asc handle of the request to cancel |
158 | */ | 155 | */ |
159 | void GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SuggestionContext | 156 | void |
160 | *asc); | 157 | GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SuggestionContext *asc); |
161 | 158 | ||
162 | 159 | ||
163 | /** | 160 | /** |
@@ -174,12 +171,13 @@ void GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SuggestionContext | |||
174 | * @param ats performance data for the connection | 171 | * @param ats performance data for the connection |
175 | * @param ats_count number of performance records in 'ats' | 172 | * @param ats_count number of performance records in 'ats' |
176 | */ | 173 | */ |
177 | void GNUNET_ATS_peer_connect (struct GNUNET_ATS_Handle *atc, | 174 | void |
178 | const struct GNUNET_PeerIdentity *peer, | 175 | GNUNET_ATS_peer_connect (struct GNUNET_ATS_Handle *atc, |
179 | const char *plugin_name, struct Session *session, | 176 | const struct GNUNET_PeerIdentity *peer, |
180 | const void *plugin_addr, size_t plugin_addr_len, | 177 | const char *plugin_name, struct Session *session, |
181 | const struct GNUNET_TRANSPORT_ATS_Information | 178 | const void *plugin_addr, size_t plugin_addr_len, |
182 | *ats, uint32_t ats_count); | 179 | const struct GNUNET_TRANSPORT_ATS_Information *ats, |
180 | uint32_t ats_count); | ||
183 | 181 | ||
184 | 182 | ||
185 | /** | 183 | /** |
@@ -190,8 +188,9 @@ void GNUNET_ATS_peer_connect (struct GNUNET_ATS_Handle *atc, | |||
190 | * @param atc handle | 188 | * @param atc handle |
191 | * @param peer identity of the peer | 189 | * @param peer identity of the peer |
192 | */ | 190 | */ |
193 | void GNUNET_ATS_peer_disconnect (struct GNUNET_ATS_Handle *atc, | 191 | void |
194 | const struct GNUNET_PeerIdentity *peer); | 192 | GNUNET_ATS_peer_disconnect (struct GNUNET_ATS_Handle *atc, |
193 | const struct GNUNET_PeerIdentity *peer); | ||
195 | 194 | ||
196 | 195 | ||
197 | /** | 196 | /** |
@@ -201,9 +200,10 @@ void GNUNET_ATS_peer_disconnect (struct GNUNET_ATS_Handle *atc, | |||
201 | * @param peer identity of the peer | 200 | * @param peer identity of the peer |
202 | * @param session session handle that is no longer valid | 201 | * @param session session handle that is no longer valid |
203 | */ | 202 | */ |
204 | void GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc, | 203 | void |
205 | const struct GNUNET_PeerIdentity *peer, | 204 | GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc, |
206 | const struct Session *session); | 205 | const struct GNUNET_PeerIdentity *peer, |
206 | const struct Session *session); | ||
207 | 207 | ||
208 | 208 | ||
209 | /** | 209 | /** |
@@ -224,14 +224,14 @@ void GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc, | |||
224 | * @param ats performance data for the address | 224 | * @param ats performance data for the address |
225 | * @param ats_count number of performance records in 'ats' | 225 | * @param ats_count number of performance records in 'ats' |
226 | */ | 226 | */ |
227 | void GNUNET_ATS_address_update (struct GNUNET_ATS_Handle *atc, | 227 | void |
228 | const struct GNUNET_PeerIdentity *peer, | 228 | GNUNET_ATS_address_update (struct GNUNET_ATS_Handle *atc, |
229 | struct GNUNET_TIME_Absolute valid_until, | 229 | const struct GNUNET_PeerIdentity *peer, |
230 | const char *plugin_name, | 230 | struct GNUNET_TIME_Absolute valid_until, |
231 | struct Session *session, | 231 | const char *plugin_name, struct Session *session, |
232 | const void *plugin_addr, size_t plugin_addr_len, | 232 | const void *plugin_addr, size_t plugin_addr_len, |
233 | const struct GNUNET_TRANSPORT_ATS_Information | 233 | const struct GNUNET_TRANSPORT_ATS_Information *ats, |
234 | *ats, uint32_t ats_count); | 234 | uint32_t ats_count); |
235 | 235 | ||
236 | 236 | ||
237 | #endif | 237 | #endif |
diff --git a/src/include/gnunet_bandwidth_lib.h b/src/include/gnunet_bandwidth_lib.h index e78d16552..75f71b32c 100644 --- a/src/include/gnunet_bandwidth_lib.h +++ b/src/include/gnunet_bandwidth_lib.h | |||
@@ -89,8 +89,8 @@ struct GNUNET_BANDWIDTH_Tracker | |||
89 | * @param bytes_per_second value to create | 89 | * @param bytes_per_second value to create |
90 | * @return the new bandwidth value | 90 | * @return the new bandwidth value |
91 | */ | 91 | */ |
92 | struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_init (uint32_t | 92 | struct GNUNET_BANDWIDTH_Value32NBO |
93 | bytes_per_second); | 93 | GNUNET_BANDWIDTH_value_init (uint32_t bytes_per_second); |
94 | 94 | ||
95 | 95 | ||
96 | /** | 96 | /** |
@@ -107,12 +107,11 @@ struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_init (uint32_t | |||
107 | * @param deadline when is the deadline | 107 | * @param deadline when is the deadline |
108 | * @return number of bytes available at bps until deadline | 108 | * @return number of bytes available at bps until deadline |
109 | */ | 109 | */ |
110 | uint64_t GNUNET_BANDWIDTH_value_get_available_until (struct | 110 | uint64_t |
111 | GNUNET_BANDWIDTH_Value32NBO | 111 | GNUNET_BANDWIDTH_value_get_available_until (struct GNUNET_BANDWIDTH_Value32NBO |
112 | bps, | 112 | bps, |
113 | struct | 113 | struct GNUNET_TIME_Relative |
114 | GNUNET_TIME_Relative | 114 | deadline); |
115 | deadline); | ||
116 | 115 | ||
117 | 116 | ||
118 | /** | 117 | /** |
@@ -123,11 +122,9 @@ uint64_t GNUNET_BANDWIDTH_value_get_available_until (struct | |||
123 | * @param size number of bytes we want to have available | 122 | * @param size number of bytes we want to have available |
124 | * @return how long it would take | 123 | * @return how long it would take |
125 | */ | 124 | */ |
126 | struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_value_get_delay_for (struct | 125 | struct GNUNET_TIME_Relative |
127 | GNUNET_BANDWIDTH_Value32NBO | 126 | GNUNET_BANDWIDTH_value_get_delay_for (struct GNUNET_BANDWIDTH_Value32NBO bps, |
128 | bps, | 127 | uint64_t size); |
129 | uint64_t | ||
130 | size); | ||
131 | 128 | ||
132 | 129 | ||
133 | 130 | ||
@@ -138,12 +135,9 @@ struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_value_get_delay_for (struct | |||
138 | * @param b2 second value | 135 | * @param b2 second value |
139 | * @return the min of b1 and b2 | 136 | * @return the min of b1 and b2 |
140 | */ | 137 | */ |
141 | struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_min (struct | 138 | struct GNUNET_BANDWIDTH_Value32NBO |
142 | GNUNET_BANDWIDTH_Value32NBO | 139 | GNUNET_BANDWIDTH_value_min (struct GNUNET_BANDWIDTH_Value32NBO b1, |
143 | b1, | 140 | struct GNUNET_BANDWIDTH_Value32NBO b2); |
144 | struct | ||
145 | GNUNET_BANDWIDTH_Value32NBO | ||
146 | b2); | ||
147 | 141 | ||
148 | 142 | ||
149 | /** | 143 | /** |
@@ -160,10 +154,10 @@ struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_min (struct | |||
160 | * @param max_carry_s maximum number of seconds unused bandwidth | 154 | * @param max_carry_s maximum number of seconds unused bandwidth |
161 | * may accumulate before it expires | 155 | * may accumulate before it expires |
162 | */ | 156 | */ |
163 | void GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av, | 157 | void |
164 | struct GNUNET_BANDWIDTH_Value32NBO | 158 | GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av, |
165 | bytes_per_second_limit, | 159 | struct GNUNET_BANDWIDTH_Value32NBO |
166 | uint32_t max_carry_s); | 160 | bytes_per_second_limit, uint32_t max_carry_s); |
167 | 161 | ||
168 | 162 | ||
169 | /** | 163 | /** |
@@ -177,8 +171,9 @@ void GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av, | |||
177 | * @param size number of bytes consumed | 171 | * @param size number of bytes consumed |
178 | * @return GNUNET_YES if this consumption is above the limit | 172 | * @return GNUNET_YES if this consumption is above the limit |
179 | */ | 173 | */ |
180 | int GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av, | 174 | int |
181 | ssize_t size); | 175 | GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av, |
176 | ssize_t size); | ||
182 | 177 | ||
183 | 178 | ||
184 | /** | 179 | /** |
@@ -190,10 +185,9 @@ int GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av, | |||
190 | * @param size number of bytes we would like to consume | 185 | * @param size number of bytes we would like to consume |
191 | * @return time to wait for consumption to be OK | 186 | * @return time to wait for consumption to be OK |
192 | */ | 187 | */ |
193 | struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_tracker_get_delay (struct | 188 | struct GNUNET_TIME_Relative |
194 | GNUNET_BANDWIDTH_Tracker | 189 | GNUNET_BANDWIDTH_tracker_get_delay (struct GNUNET_BANDWIDTH_Tracker *av, |
195 | *av, | 190 | size_t size); |
196 | size_t size); | ||
197 | 191 | ||
198 | 192 | ||
199 | /** | 193 | /** |
@@ -203,9 +197,8 @@ struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_tracker_get_delay (struct | |||
203 | * @param av tracker to query | 197 | * @param av tracker to query |
204 | * @return number of bytes available for consumption right now | 198 | * @return number of bytes available for consumption right now |
205 | */ | 199 | */ |
206 | int64_t GNUNET_BANDWIDTH_tracker_get_available (struct | 200 | int64_t |
207 | GNUNET_BANDWIDTH_Tracker | 201 | GNUNET_BANDWIDTH_tracker_get_available (struct GNUNET_BANDWIDTH_Tracker *av); |
208 | *av); | ||
209 | 202 | ||
210 | 203 | ||
211 | /** | 204 | /** |
@@ -214,9 +207,10 @@ int64_t GNUNET_BANDWIDTH_tracker_get_available (struct | |||
214 | * @param av tracker to initialize | 207 | * @param av tracker to initialize |
215 | * @param bytes_per_second_limit new limit to assume | 208 | * @param bytes_per_second_limit new limit to assume |
216 | */ | 209 | */ |
217 | void GNUNET_BANDWIDTH_tracker_update_quota (struct GNUNET_BANDWIDTH_Tracker *av, | 210 | void |
218 | struct GNUNET_BANDWIDTH_Value32NBO | 211 | GNUNET_BANDWIDTH_tracker_update_quota (struct GNUNET_BANDWIDTH_Tracker *av, |
219 | bytes_per_second_limit); | 212 | struct GNUNET_BANDWIDTH_Value32NBO |
213 | bytes_per_second_limit); | ||
220 | 214 | ||
221 | 215 | ||
222 | #if 0 /* keep Emacsens' auto-indent happy */ | 216 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_bio_lib.h b/src/include/gnunet_bio_lib.h index 74512ec40..de356d1e5 100644 --- a/src/include/gnunet_bio_lib.h +++ b/src/include/gnunet_bio_lib.h | |||
@@ -49,7 +49,8 @@ struct GNUNET_BIO_ReadHandle; | |||
49 | * @param fn file name to be opened | 49 | * @param fn file name to be opened |
50 | * @return IO handle on success, NULL on error | 50 | * @return IO handle on success, NULL on error |
51 | */ | 51 | */ |
52 | struct GNUNET_BIO_ReadHandle *GNUNET_BIO_read_open (const char *fn); | 52 | struct GNUNET_BIO_ReadHandle * |
53 | GNUNET_BIO_read_open (const char *fn); | ||
53 | 54 | ||
54 | 55 | ||
55 | /** | 56 | /** |
@@ -60,7 +61,8 @@ struct GNUNET_BIO_ReadHandle *GNUNET_BIO_read_open (const char *fn); | |||
60 | * @param emsg set to the error message | 61 | * @param emsg set to the error message |
61 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 62 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
62 | */ | 63 | */ |
63 | int GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg); | 64 | int |
65 | GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg); | ||
64 | 66 | ||
65 | 67 | ||
66 | /** | 68 | /** |
@@ -72,8 +74,9 @@ int GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg); | |||
72 | * @param len the number of bytes to read | 74 | * @param len the number of bytes to read |
73 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 75 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
74 | */ | 76 | */ |
75 | int GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, const char *what, | 77 | int |
76 | void *result, size_t len); | 78 | GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, const char *what, |
79 | void *result, size_t len); | ||
77 | 80 | ||
78 | 81 | ||
79 | /** | 82 | /** |
@@ -86,8 +89,9 @@ int GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, const char *what, | |||
86 | * @param len the number of bytes to read | 89 | * @param len the number of bytes to read |
87 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 90 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
88 | */ | 91 | */ |
89 | int GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, const char *file, | 92 | int |
90 | int line, void *result, size_t len); | 93 | GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, const char *file, int line, |
94 | void *result, size_t len); | ||
91 | 95 | ||
92 | /** | 96 | /** |
93 | * Read 0-terminated string from a file. | 97 | * Read 0-terminated string from a file. |
@@ -99,8 +103,9 @@ int GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, const char *file, | |||
99 | * @param maxLen maximum allowed length for the string | 103 | * @param maxLen maximum allowed length for the string |
100 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 104 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
101 | */ | 105 | */ |
102 | int GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what, | 106 | int |
103 | char **result, size_t maxLen); | 107 | GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what, |
108 | char **result, size_t maxLen); | ||
104 | 109 | ||
105 | 110 | ||
106 | /** | 111 | /** |
@@ -111,9 +116,9 @@ int GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what, | |||
111 | * @param result the buffer to store a pointer to the (allocated) metadata | 116 | * @param result the buffer to store a pointer to the (allocated) metadata |
112 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 117 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
113 | */ | 118 | */ |
114 | int GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, | 119 | int |
115 | const char *what, | 120 | GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, const char *what, |
116 | struct GNUNET_CONTAINER_MetaData **result); | 121 | struct GNUNET_CONTAINER_MetaData **result); |
117 | 122 | ||
118 | 123 | ||
119 | /** | 124 | /** |
@@ -144,8 +149,9 @@ int GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, | |||
144 | * @param i address of 32-bit integer to read | 149 | * @param i address of 32-bit integer to read |
145 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 150 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
146 | */ | 151 | */ |
147 | int GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, const char *file, | 152 | int |
148 | int line, int32_t * i); | 153 | GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, const char *file, |
154 | int line, int32_t * i); | ||
149 | 155 | ||
150 | 156 | ||
151 | /** | 157 | /** |
@@ -166,8 +172,9 @@ int GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, const char *file, | |||
166 | * @param i address of 64-bit integer to read | 172 | * @param i address of 64-bit integer to read |
167 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 173 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
168 | */ | 174 | */ |
169 | int GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h, const char *file, | 175 | int |
170 | int line, int64_t * i); | 176 | GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h, const char *file, |
177 | int line, int64_t * i); | ||
171 | 178 | ||
172 | 179 | ||
173 | /** | 180 | /** |
@@ -190,7 +197,8 @@ struct GNUNET_BIO_WriteHandle; | |||
190 | * @param fn file name to be opened | 197 | * @param fn file name to be opened |
191 | * @return IO handle on success, NULL on error | 198 | * @return IO handle on success, NULL on error |
192 | */ | 199 | */ |
193 | struct GNUNET_BIO_WriteHandle *GNUNET_BIO_write_open (const char *fn); | 200 | struct GNUNET_BIO_WriteHandle * |
201 | GNUNET_BIO_write_open (const char *fn); | ||
194 | 202 | ||
195 | 203 | ||
196 | /** | 204 | /** |
@@ -199,7 +207,8 @@ struct GNUNET_BIO_WriteHandle *GNUNET_BIO_write_open (const char *fn); | |||
199 | * @param h file handle | 207 | * @param h file handle |
200 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 208 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
201 | */ | 209 | */ |
202 | int GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h); | 210 | int |
211 | GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h); | ||
203 | 212 | ||
204 | 213 | ||
205 | /** | 214 | /** |
@@ -210,8 +219,9 @@ int GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h); | |||
210 | * @param n number of bytes to write | 219 | * @param n number of bytes to write |
211 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 220 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
212 | */ | 221 | */ |
213 | int GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const void *buffer, | 222 | int |
214 | size_t n); | 223 | GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const void *buffer, |
224 | size_t n); | ||
215 | 225 | ||
216 | 226 | ||
217 | /** | 227 | /** |
@@ -221,7 +231,8 @@ int GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const void *buffer, | |||
221 | * @param s string to write (can be NULL) | 231 | * @param s string to write (can be NULL) |
222 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 232 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
223 | */ | 233 | */ |
224 | int GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, const char *s); | 234 | int |
235 | GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, const char *s); | ||
225 | 236 | ||
226 | 237 | ||
227 | 238 | ||
@@ -233,8 +244,9 @@ int GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, const char *s); | |||
233 | * @param m metadata to write | 244 | * @param m metadata to write |
234 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 245 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
235 | */ | 246 | */ |
236 | int GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, | 247 | int |
237 | const struct GNUNET_CONTAINER_MetaData *m); | 248 | GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, |
249 | const struct GNUNET_CONTAINER_MetaData *m); | ||
238 | 250 | ||
239 | 251 | ||
240 | 252 | ||
@@ -264,7 +276,8 @@ int GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, | |||
264 | * @param i address of 32-bit integer to write | 276 | * @param i address of 32-bit integer to write |
265 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 277 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
266 | */ | 278 | */ |
267 | int GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, int32_t i); | 279 | int |
280 | GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, int32_t i); | ||
268 | 281 | ||
269 | 282 | ||
270 | /** | 283 | /** |
@@ -274,7 +287,8 @@ int GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, int32_t i); | |||
274 | * @param i address of 64-bit integer to write | 287 | * @param i address of 64-bit integer to write |
275 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 288 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
276 | */ | 289 | */ |
277 | int GNUNET_BIO_write_int64 (struct GNUNET_BIO_WriteHandle *h, int64_t i); | 290 | int |
291 | GNUNET_BIO_write_int64 (struct GNUNET_BIO_WriteHandle *h, int64_t i); | ||
278 | 292 | ||
279 | 293 | ||
280 | #if 0 /* keep Emacsens' auto-indent happy */ | 294 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_block_lib.h b/src/include/gnunet_block_lib.h index 51b8254d0..66b2490c0 100644 --- a/src/include/gnunet_block_lib.h +++ b/src/include/gnunet_block_lib.h | |||
@@ -161,8 +161,9 @@ struct GNUNET_BLOCK_Context; | |||
161 | * @param mingle_number number for hash permutation | 161 | * @param mingle_number number for hash permutation |
162 | * @param hc where to store the result. | 162 | * @param hc where to store the result. |
163 | */ | 163 | */ |
164 | void GNUNET_BLOCK_mingle_hash (const GNUNET_HashCode * in, | 164 | void |
165 | uint32_t mingle_number, GNUNET_HashCode * hc); | 165 | GNUNET_BLOCK_mingle_hash (const GNUNET_HashCode * in, uint32_t mingle_number, |
166 | GNUNET_HashCode * hc); | ||
166 | 167 | ||
167 | 168 | ||
168 | /** | 169 | /** |
@@ -171,9 +172,8 @@ void GNUNET_BLOCK_mingle_hash (const GNUNET_HashCode * in, | |||
171 | * @param cfg configuration to use | 172 | * @param cfg configuration to use |
172 | * @return NULL on error | 173 | * @return NULL on error |
173 | */ | 174 | */ |
174 | struct GNUNET_BLOCK_Context *GNUNET_BLOCK_context_create (const struct | 175 | struct GNUNET_BLOCK_Context * |
175 | GNUNET_CONFIGURATION_Handle | 176 | GNUNET_BLOCK_context_create (const struct GNUNET_CONFIGURATION_Handle *cfg); |
176 | *cfg); | ||
177 | 177 | ||
178 | 178 | ||
179 | /** | 179 | /** |
@@ -181,7 +181,8 @@ struct GNUNET_BLOCK_Context *GNUNET_BLOCK_context_create (const struct | |||
181 | * | 181 | * |
182 | * @param ctx context to destroy | 182 | * @param ctx context to destroy |
183 | */ | 183 | */ |
184 | void GNUNET_BLOCK_context_destroy (struct GNUNET_BLOCK_Context *ctx); | 184 | void |
185 | GNUNET_BLOCK_context_destroy (struct GNUNET_BLOCK_Context *ctx); | ||
185 | 186 | ||
186 | 187 | ||
187 | /** | 188 | /** |
@@ -202,23 +203,14 @@ void GNUNET_BLOCK_context_destroy (struct GNUNET_BLOCK_Context *ctx); | |||
202 | * @param reply_block_size number of bytes in reply block | 203 | * @param reply_block_size number of bytes in reply block |
203 | * @return characterization of result | 204 | * @return characterization of result |
204 | */ | 205 | */ |
205 | enum GNUNET_BLOCK_EvaluationResult GNUNET_BLOCK_evaluate (struct | 206 | enum GNUNET_BLOCK_EvaluationResult |
206 | GNUNET_BLOCK_Context | 207 | GNUNET_BLOCK_evaluate (struct GNUNET_BLOCK_Context *ctx, |
207 | *ctx, | 208 | enum GNUNET_BLOCK_Type type, |
208 | enum GNUNET_BLOCK_Type | 209 | const GNUNET_HashCode * query, |
209 | type, | 210 | struct GNUNET_CONTAINER_BloomFilter **bf, |
210 | const GNUNET_HashCode | 211 | int32_t bf_mutator, const void *xquery, |
211 | * query, | 212 | size_t xquery_size, const void *reply_block, |
212 | struct | 213 | size_t reply_block_size); |
213 | GNUNET_CONTAINER_BloomFilter | ||
214 | **bf, | ||
215 | int32_t bf_mutator, | ||
216 | const void *xquery, | ||
217 | size_t xquery_size, | ||
218 | const void | ||
219 | *reply_block, | ||
220 | size_t | ||
221 | reply_block_size); | ||
222 | 214 | ||
223 | 215 | ||
224 | /** | 216 | /** |
@@ -234,9 +226,10 @@ enum GNUNET_BLOCK_EvaluationResult GNUNET_BLOCK_evaluate (struct | |||
234 | * GNUNET_SYSERR if type not supported | 226 | * GNUNET_SYSERR if type not supported |
235 | * (or if extracting a key from a block of this type does not work) | 227 | * (or if extracting a key from a block of this type does not work) |
236 | */ | 228 | */ |
237 | int GNUNET_BLOCK_get_key (struct GNUNET_BLOCK_Context *ctx, | 229 | int |
238 | enum GNUNET_BLOCK_Type type, const void *block, | 230 | GNUNET_BLOCK_get_key (struct GNUNET_BLOCK_Context *ctx, |
239 | size_t block_size, GNUNET_HashCode * key); | 231 | enum GNUNET_BLOCK_Type type, const void *block, |
232 | size_t block_size, GNUNET_HashCode * key); | ||
240 | 233 | ||
241 | 234 | ||
242 | #if 0 /* keep Emacsens' auto-indent happy */ | 235 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_chat_service.h b/src/include/gnunet_chat_service.h index d9c3ec76f..5eb0daf3f 100644 --- a/src/include/gnunet_chat_service.h +++ b/src/include/gnunet_chat_service.h | |||
@@ -183,26 +183,19 @@ typedef int (*GNUNET_CHAT_MessageConfirmation) (void *cls, | |||
183 | * @param me member ID (pseudonym) | 183 | * @param me member ID (pseudonym) |
184 | * @return NULL on error | 184 | * @return NULL on error |
185 | */ | 185 | */ |
186 | struct GNUNET_CHAT_Room *GNUNET_CHAT_join_room (const struct | 186 | struct GNUNET_CHAT_Room * |
187 | GNUNET_CONFIGURATION_Handle | 187 | GNUNET_CHAT_join_room (const struct GNUNET_CONFIGURATION_Handle *cfg, |
188 | *cfg, const char *nick_name, | 188 | const char *nick_name, |
189 | struct GNUNET_CONTAINER_MetaData | 189 | struct GNUNET_CONTAINER_MetaData *member_info, |
190 | *member_info, | 190 | const char *room_name, |
191 | const char *room_name, | 191 | enum GNUNET_CHAT_MsgOptions msg_options, |
192 | enum GNUNET_CHAT_MsgOptions | 192 | GNUNET_CHAT_JoinCallback joinCallback, void *join_cls, |
193 | msg_options, | 193 | GNUNET_CHAT_MessageCallback messageCallback, |
194 | GNUNET_CHAT_JoinCallback | 194 | void *message_cls, |
195 | joinCallback, void *join_cls, | 195 | GNUNET_CHAT_MemberListCallback memberCallback, |
196 | GNUNET_CHAT_MessageCallback | 196 | void *member_cls, |
197 | messageCallback, | 197 | GNUNET_CHAT_MessageConfirmation confirmationCallback, |
198 | void *message_cls, | 198 | void *confirmation_cls, GNUNET_HashCode * me); |
199 | GNUNET_CHAT_MemberListCallback | ||
200 | memberCallback, | ||
201 | void *member_cls, | ||
202 | GNUNET_CHAT_MessageConfirmation | ||
203 | confirmationCallback, | ||
204 | void *confirmation_cls, | ||
205 | GNUNET_HashCode * me); | ||
206 | 199 | ||
207 | /** | 200 | /** |
208 | * Send a message. | 201 | * Send a message. |
@@ -213,18 +206,18 @@ struct GNUNET_CHAT_Room *GNUNET_CHAT_join_room (const struct | |||
213 | * @param receiver use NULL to send to everyone in the room | 206 | * @param receiver use NULL to send to everyone in the room |
214 | * @param sequence_number where to write the sequence id of the message | 207 | * @param sequence_number where to write the sequence id of the message |
215 | */ | 208 | */ |
216 | void GNUNET_CHAT_send_message (struct GNUNET_CHAT_Room *room, | 209 | void |
217 | const char *message, | 210 | GNUNET_CHAT_send_message (struct GNUNET_CHAT_Room *room, const char *message, |
218 | enum GNUNET_CHAT_MsgOptions options, | 211 | enum GNUNET_CHAT_MsgOptions options, |
219 | const struct | 212 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded |
220 | GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded | 213 | *receiver, uint32_t * sequence_number); |
221 | *receiver, uint32_t * sequence_number); | ||
222 | 214 | ||
223 | 215 | ||
224 | /** | 216 | /** |
225 | * Leave a chat room. | 217 | * Leave a chat room. |
226 | */ | 218 | */ |
227 | void GNUNET_CHAT_leave_room (struct GNUNET_CHAT_Room *chat_room); | 219 | void |
220 | GNUNET_CHAT_leave_room (struct GNUNET_CHAT_Room *chat_room); | ||
228 | 221 | ||
229 | 222 | ||
230 | #if 0 | 223 | #if 0 |
@@ -241,9 +234,10 @@ typedef int (*GNUNET_CHAT_RoomIterator) (const char *room, const char *topic, | |||
241 | * List all of the (publically visible) chat rooms. | 234 | * List all of the (publically visible) chat rooms. |
242 | * @return number of rooms on success, GNUNET_SYSERR if iterator aborted | 235 | * @return number of rooms on success, GNUNET_SYSERR if iterator aborted |
243 | */ | 236 | */ |
244 | int GNUNET_CHAT_list_rooms (struct GNUNET_GE_Context *ectx, | 237 | int |
245 | struct GNUNET_GC_Configuration *cfg, | 238 | GNUNET_CHAT_list_rooms (struct GNUNET_GE_Context *ectx, |
246 | GNUNET_CHAT_RoomIterator it, void *cls); | 239 | struct GNUNET_GC_Configuration *cfg, |
240 | GNUNET_CHAT_RoomIterator it, void *cls); | ||
247 | #endif | 241 | #endif |
248 | 242 | ||
249 | 243 | ||
diff --git a/src/include/gnunet_client_lib.h b/src/include/gnunet_client_lib.h index 3fad01222..ed033d031 100644 --- a/src/include/gnunet_client_lib.h +++ b/src/include/gnunet_client_lib.h | |||
@@ -53,11 +53,9 @@ struct GNUNET_CLIENT_Connection; | |||
53 | * @param cfg configuration to use | 53 | * @param cfg configuration to use |
54 | * @return NULL on error (service unknown to configuration) | 54 | * @return NULL on error (service unknown to configuration) |
55 | */ | 55 | */ |
56 | struct GNUNET_CLIENT_Connection *GNUNET_CLIENT_connect (const char | 56 | struct GNUNET_CLIENT_Connection * |
57 | *service_name, | 57 | GNUNET_CLIENT_connect (const char *service_name, |
58 | const struct | 58 | const struct GNUNET_CONFIGURATION_Handle *cfg); |
59 | GNUNET_CONFIGURATION_Handle | ||
60 | *cfg); | ||
61 | 59 | ||
62 | 60 | ||
63 | /** | 61 | /** |
@@ -66,8 +64,9 @@ struct GNUNET_CLIENT_Connection *GNUNET_CLIENT_connect (const char | |||
66 | * @param h client handle | 64 | * @param h client handle |
67 | * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default | 65 | * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default |
68 | */ | 66 | */ |
69 | void GNUNET_CLIENT_ignore_shutdown (struct GNUNET_CLIENT_Connection *h, | 67 | void |
70 | int do_ignore); | 68 | GNUNET_CLIENT_ignore_shutdown (struct GNUNET_CLIENT_Connection *h, |
69 | int do_ignore); | ||
71 | 70 | ||
72 | 71 | ||
73 | 72 | ||
@@ -86,8 +85,9 @@ void GNUNET_CLIENT_ignore_shutdown (struct GNUNET_CLIENT_Connection *h, | |||
86 | * @param finish_pending_write should a transmission already passed to the | 85 | * @param finish_pending_write should a transmission already passed to the |
87 | * handle be completed? | 86 | * handle be completed? |
88 | */ | 87 | */ |
89 | void GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock, | 88 | void |
90 | int finish_pending_write); | 89 | GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock, |
90 | int finish_pending_write); | ||
91 | 91 | ||
92 | /** | 92 | /** |
93 | * Type of a function to call when we receive a message | 93 | * Type of a function to call when we receive a message |
@@ -120,10 +120,10 @@ typedef void (*GNUNET_CLIENT_ShutdownTask) (void *cls, int reason); | |||
120 | * @param handler_cls closure for handler | 120 | * @param handler_cls closure for handler |
121 | * @param timeout how long to wait until timing out | 121 | * @param timeout how long to wait until timing out |
122 | */ | 122 | */ |
123 | void GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock, | 123 | void |
124 | GNUNET_CLIENT_MessageHandler handler, | 124 | GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock, |
125 | void *handler_cls, | 125 | GNUNET_CLIENT_MessageHandler handler, void *handler_cls, |
126 | struct GNUNET_TIME_Relative timeout); | 126 | struct GNUNET_TIME_Relative timeout); |
127 | 127 | ||
128 | 128 | ||
129 | /** | 129 | /** |
@@ -152,20 +152,13 @@ struct GNUNET_CLIENT_TransmitHandle; | |||
152 | * non-NULL if the notify callback was queued (can be used to cancel | 152 | * non-NULL if the notify callback was queued (can be used to cancel |
153 | * using GNUNET_CONNECTION_notify_transmit_ready_cancel) | 153 | * using GNUNET_CONNECTION_notify_transmit_ready_cancel) |
154 | */ | 154 | */ |
155 | struct GNUNET_CLIENT_TransmitHandle *GNUNET_CLIENT_notify_transmit_ready (struct | 155 | struct GNUNET_CLIENT_TransmitHandle * |
156 | GNUNET_CLIENT_Connection | 156 | GNUNET_CLIENT_notify_transmit_ready (struct GNUNET_CLIENT_Connection *sock, |
157 | *sock, | 157 | size_t size, |
158 | size_t | 158 | struct GNUNET_TIME_Relative timeout, |
159 | size, | 159 | int auto_retry, |
160 | struct | 160 | GNUNET_CONNECTION_TransmitReadyNotify |
161 | GNUNET_TIME_Relative | 161 | notify, void *notify_cls); |
162 | timeout, | ||
163 | int | ||
164 | auto_retry, | ||
165 | GNUNET_CONNECTION_TransmitReadyNotify | ||
166 | notify, | ||
167 | void | ||
168 | *notify_cls); | ||
169 | 162 | ||
170 | 163 | ||
171 | /** | 164 | /** |
@@ -173,9 +166,9 @@ struct GNUNET_CLIENT_TransmitHandle *GNUNET_CLIENT_notify_transmit_ready (struct | |||
173 | * | 166 | * |
174 | * @param th handle from the original request. | 167 | * @param th handle from the original request. |
175 | */ | 168 | */ |
176 | void GNUNET_CLIENT_notify_transmit_ready_cancel (struct | 169 | void |
177 | GNUNET_CLIENT_TransmitHandle | 170 | GNUNET_CLIENT_notify_transmit_ready_cancel (struct GNUNET_CLIENT_TransmitHandle |
178 | *th); | 171 | *th); |
179 | 172 | ||
180 | 173 | ||
181 | /** | 174 | /** |
@@ -199,14 +192,13 @@ void GNUNET_CLIENT_notify_transmit_ready_cancel (struct | |||
199 | * @return GNUNET_OK on success, GNUNET_SYSERR if a request | 192 | * @return GNUNET_OK on success, GNUNET_SYSERR if a request |
200 | * is already pending | 193 | * is already pending |
201 | */ | 194 | */ |
202 | int GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection | 195 | int |
203 | *sock, | 196 | GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection *sock, |
204 | const struct GNUNET_MessageHeader | 197 | const struct GNUNET_MessageHeader *hdr, |
205 | *hdr, | 198 | struct GNUNET_TIME_Relative timeout, |
206 | struct GNUNET_TIME_Relative | 199 | int auto_retry, |
207 | timeout, int auto_retry, | 200 | GNUNET_CLIENT_MessageHandler rn, |
208 | GNUNET_CLIENT_MessageHandler rn, | 201 | void *rn_cls); |
209 | void *rn_cls); | ||
210 | 202 | ||
211 | 203 | ||
212 | /** | 204 | /** |
@@ -220,10 +212,11 @@ int GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection | |||
220 | * or "TIMEOUT" (service not known to be running)) | 212 | * or "TIMEOUT" (service not known to be running)) |
221 | * @param task_cls closure for task | 213 | * @param task_cls closure for task |
222 | */ | 214 | */ |
223 | void GNUNET_CLIENT_service_test (const char *service, | 215 | void |
224 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 216 | GNUNET_CLIENT_service_test (const char *service, |
225 | struct GNUNET_TIME_Relative timeout, | 217 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
226 | GNUNET_SCHEDULER_Task task, void *task_cls); | 218 | struct GNUNET_TIME_Relative timeout, |
219 | GNUNET_SCHEDULER_Task task, void *task_cls); | ||
227 | 220 | ||
228 | 221 | ||
229 | #if 0 /* keep Emacsens' auto-indent happy */ | 222 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index f884d9a24..2636824d3 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h | |||
@@ -168,7 +168,8 @@ typedef void (*GNUNET_Logger) (void *cls, enum GNUNET_ErrorType kind, | |||
168 | * @param message what is the message (format string) | 168 | * @param message what is the message (format string) |
169 | * @param ... arguments for format string | 169 | * @param ... arguments for format string |
170 | */ | 170 | */ |
171 | void GNUNET_log (enum GNUNET_ErrorType kind, const char *message, ...); | 171 | void |
172 | GNUNET_log (enum GNUNET_ErrorType kind, const char *message, ...); | ||
172 | 173 | ||
173 | 174 | ||
174 | 175 | ||
@@ -181,8 +182,9 @@ void GNUNET_log (enum GNUNET_ErrorType kind, const char *message, ...); | |||
181 | * @param message what is the message (format string) | 182 | * @param message what is the message (format string) |
182 | * @param ... arguments for format string | 183 | * @param ... arguments for format string |
183 | */ | 184 | */ |
184 | void GNUNET_log_from (enum GNUNET_ErrorType kind, const char *comp, | 185 | void |
185 | const char *message, ...); | 186 | GNUNET_log_from (enum GNUNET_ErrorType kind, const char *comp, |
187 | const char *message, ...); | ||
186 | 188 | ||
187 | 189 | ||
188 | /** | 190 | /** |
@@ -191,7 +193,8 @@ void GNUNET_log_from (enum GNUNET_ErrorType kind, const char *comp, | |||
191 | * @param n number of log calls to ignore | 193 | * @param n number of log calls to ignore |
192 | * @param check_reset GNUNET_YES to assert that the log skip counter is currently zero | 194 | * @param check_reset GNUNET_YES to assert that the log skip counter is currently zero |
193 | */ | 195 | */ |
194 | void GNUNET_log_skip (unsigned int n, int check_reset); | 196 | void |
197 | GNUNET_log_skip (unsigned int n, int check_reset); | ||
195 | 198 | ||
196 | 199 | ||
197 | /** | 200 | /** |
@@ -202,8 +205,8 @@ void GNUNET_log_skip (unsigned int n, int check_reset); | |||
202 | * @param logfile change logging to logfile (use NULL to keep stderr) | 205 | * @param logfile change logging to logfile (use NULL to keep stderr) |
203 | * @return GNUNET_OK on success, GNUNET_SYSERR if logfile could not be opened | 206 | * @return GNUNET_OK on success, GNUNET_SYSERR if logfile could not be opened |
204 | */ | 207 | */ |
205 | int GNUNET_log_setup (const char *comp, const char *loglevel, | 208 | int |
206 | const char *logfile); | 209 | GNUNET_log_setup (const char *comp, const char *loglevel, const char *logfile); |
207 | 210 | ||
208 | 211 | ||
209 | /** | 212 | /** |
@@ -212,7 +215,8 @@ int GNUNET_log_setup (const char *comp, const char *loglevel, | |||
212 | * @param logger log function | 215 | * @param logger log function |
213 | * @param logger_cls closure for logger | 216 | * @param logger_cls closure for logger |
214 | */ | 217 | */ |
215 | void GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls); | 218 | void |
219 | GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls); | ||
216 | 220 | ||
217 | 221 | ||
218 | /** | 222 | /** |
@@ -221,7 +225,8 @@ void GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls); | |||
221 | * @param logger log function | 225 | * @param logger log function |
222 | * @param logger_cls closure for logger | 226 | * @param logger_cls closure for logger |
223 | */ | 227 | */ |
224 | void GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls); | 228 | void |
229 | GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls); | ||
225 | 230 | ||
226 | 231 | ||
227 | /** | 232 | /** |
@@ -232,7 +237,8 @@ void GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls); | |||
232 | * @param hc the hash code | 237 | * @param hc the hash code |
233 | * @return string | 238 | * @return string |
234 | */ | 239 | */ |
235 | const char *GNUNET_h2s (const GNUNET_HashCode * hc); | 240 | const char * |
241 | GNUNET_h2s (const GNUNET_HashCode * hc); | ||
236 | 242 | ||
237 | 243 | ||
238 | /** | 244 | /** |
@@ -244,7 +250,8 @@ const char *GNUNET_h2s (const GNUNET_HashCode * hc); | |||
244 | * @param hc the hash code | 250 | * @param hc the hash code |
245 | * @return string | 251 | * @return string |
246 | */ | 252 | */ |
247 | const char *GNUNET_h2s_full (const GNUNET_HashCode * hc); | 253 | const char * |
254 | GNUNET_h2s_full (const GNUNET_HashCode * hc); | ||
248 | 255 | ||
249 | 256 | ||
250 | /** | 257 | /** |
@@ -256,7 +263,8 @@ const char *GNUNET_h2s_full (const GNUNET_HashCode * hc); | |||
256 | * @return string form of the pid; will be overwritten by next | 263 | * @return string form of the pid; will be overwritten by next |
257 | * call to GNUNET_i2s. | 264 | * call to GNUNET_i2s. |
258 | */ | 265 | */ |
259 | const char *GNUNET_i2s (const struct GNUNET_PeerIdentity *pid); | 266 | const char * |
267 | GNUNET_i2s (const struct GNUNET_PeerIdentity *pid); | ||
260 | 268 | ||
261 | 269 | ||
262 | /** | 270 | /** |
@@ -269,7 +277,8 @@ const char *GNUNET_i2s (const struct GNUNET_PeerIdentity *pid); | |||
269 | * @return nicely formatted string for the address | 277 | * @return nicely formatted string for the address |
270 | * will be overwritten by next call to GNUNET_a2s. | 278 | * will be overwritten by next call to GNUNET_a2s. |
271 | */ | 279 | */ |
272 | const char *GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen); | 280 | const char * |
281 | GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen); | ||
273 | 282 | ||
274 | /** | 283 | /** |
275 | * Convert error type to string. | 284 | * Convert error type to string. |
@@ -277,7 +286,8 @@ const char *GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen); | |||
277 | * @param kind type to convert | 286 | * @param kind type to convert |
278 | * @return string corresponding to the type | 287 | * @return string corresponding to the type |
279 | */ | 288 | */ |
280 | const char *GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); | 289 | const char * |
290 | GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); | ||
281 | 291 | ||
282 | 292 | ||
283 | /** | 293 | /** |
@@ -327,14 +337,16 @@ const char *GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); | |||
327 | * @param n the value in network byte order | 337 | * @param n the value in network byte order |
328 | * @return the same value in host byte order | 338 | * @return the same value in host byte order |
329 | */ | 339 | */ |
330 | unsigned long long GNUNET_ntohll (unsigned long long n); | 340 | unsigned long long |
341 | GNUNET_ntohll (unsigned long long n); | ||
331 | 342 | ||
332 | /** | 343 | /** |
333 | * Convert a long long to network-byte-order. | 344 | * Convert a long long to network-byte-order. |
334 | * @param n the value in host byte order | 345 | * @param n the value in host byte order |
335 | * @return the same value in network byte order | 346 | * @return the same value in network byte order |
336 | */ | 347 | */ |
337 | unsigned long long GNUNET_htonll (unsigned long long n); | 348 | unsigned long long |
349 | GNUNET_htonll (unsigned long long n); | ||
338 | 350 | ||
339 | 351 | ||
340 | /* ************************* allocation functions ****************** */ | 352 | /* ************************* allocation functions ****************** */ |
@@ -468,7 +480,8 @@ unsigned long long GNUNET_htonll (unsigned long long n); | |||
468 | * @param ... data for format string | 480 | * @param ... data for format string |
469 | * @return number of bytes written to buf or negative value on error | 481 | * @return number of bytes written to buf or negative value on error |
470 | */ | 482 | */ |
471 | int GNUNET_snprintf (char *buf, size_t size, const char *format, ...); | 483 | int |
484 | GNUNET_snprintf (char *buf, size_t size, const char *format, ...); | ||
472 | 485 | ||
473 | 486 | ||
474 | /** | 487 | /** |
@@ -479,7 +492,8 @@ int GNUNET_snprintf (char *buf, size_t size, const char *format, ...); | |||
479 | * @param ... data for format string | 492 | * @param ... data for format string |
480 | * @return number of bytes in "*buf" excluding 0-termination | 493 | * @return number of bytes in "*buf" excluding 0-termination |
481 | */ | 494 | */ |
482 | int GNUNET_asprintf (char **buf, const char *format, ...); | 495 | int |
496 | GNUNET_asprintf (char **buf, const char *format, ...); | ||
483 | 497 | ||
484 | 498 | ||
485 | /* ************** internal implementations, use macros above! ************** */ | 499 | /* ************** internal implementations, use macros above! ************** */ |
@@ -495,7 +509,8 @@ int GNUNET_asprintf (char **buf, const char *format, ...); | |||
495 | * @param linenumber line where this call is being made (for debugging) | 509 | * @param linenumber line where this call is being made (for debugging) |
496 | * @return allocated memory, never NULL | 510 | * @return allocated memory, never NULL |
497 | */ | 511 | */ |
498 | void *GNUNET_xmalloc_ (size_t size, const char *filename, int linenumber); | 512 | void * |
513 | GNUNET_xmalloc_ (size_t size, const char *filename, int linenumber); | ||
499 | 514 | ||
500 | 515 | ||
501 | 516 | ||
@@ -510,8 +525,9 @@ void *GNUNET_xmalloc_ (size_t size, const char *filename, int linenumber); | |||
510 | * @param linenumber line where this call is being made (for debugging) | 525 | * @param linenumber line where this call is being made (for debugging) |
511 | * @return allocated memory, never NULL | 526 | * @return allocated memory, never NULL |
512 | */ | 527 | */ |
513 | void *GNUNET_xmemdup_ (const void *buf, size_t size, const char *filename, | 528 | void * |
514 | int linenumber); | 529 | GNUNET_xmemdup_ (const void *buf, size_t size, const char *filename, |
530 | int linenumber); | ||
515 | 531 | ||
516 | 532 | ||
517 | /** | 533 | /** |
@@ -526,15 +542,15 @@ void *GNUNET_xmemdup_ (const void *buf, size_t size, const char *filename, | |||
526 | * @param linenumber line where this call is being made (for debugging) | 542 | * @param linenumber line where this call is being made (for debugging) |
527 | * @return pointer to size bytes of memory, NULL if we do not have enough memory | 543 | * @return pointer to size bytes of memory, NULL if we do not have enough memory |
528 | */ | 544 | */ |
529 | void *GNUNET_xmalloc_unchecked_ (size_t size, const char *filename, | 545 | void * |
530 | int linenumber); | 546 | GNUNET_xmalloc_unchecked_ (size_t size, const char *filename, int linenumber); |
531 | 547 | ||
532 | /** | 548 | /** |
533 | * Reallocate memory. Checks the return value, aborts if no more | 549 | * Reallocate memory. Checks the return value, aborts if no more |
534 | * memory is available. | 550 | * memory is available. |
535 | */ | 551 | */ |
536 | void *GNUNET_xrealloc_ (void *ptr, size_t n, const char *filename, | 552 | void * |
537 | int linenumber); | 553 | GNUNET_xrealloc_ (void *ptr, size_t n, const char *filename, int linenumber); |
538 | 554 | ||
539 | /** | 555 | /** |
540 | * Free memory. Merely a wrapper for the case that we | 556 | * Free memory. Merely a wrapper for the case that we |
@@ -545,7 +561,8 @@ void *GNUNET_xrealloc_ (void *ptr, size_t n, const char *filename, | |||
545 | * @param filename where is this call being made (for debugging) | 561 | * @param filename where is this call being made (for debugging) |
546 | * @param linenumber line where this call is being made (for debugging) | 562 | * @param linenumber line where this call is being made (for debugging) |
547 | */ | 563 | */ |
548 | void GNUNET_xfree_ (void *ptr, const char *filename, int linenumber); | 564 | void |
565 | GNUNET_xfree_ (void *ptr, const char *filename, int linenumber); | ||
549 | 566 | ||
550 | 567 | ||
551 | /** | 568 | /** |
@@ -555,7 +572,8 @@ void GNUNET_xfree_ (void *ptr, const char *filename, int linenumber); | |||
555 | * @param linenumber line where this call is being made (for debugging) | 572 | * @param linenumber line where this call is being made (for debugging) |
556 | * @return the duplicated string | 573 | * @return the duplicated string |
557 | */ | 574 | */ |
558 | char *GNUNET_xstrdup_ (const char *str, const char *filename, int linenumber); | 575 | char * |
576 | GNUNET_xstrdup_ (const char *str, const char *filename, int linenumber); | ||
559 | 577 | ||
560 | /** | 578 | /** |
561 | * Dup partially a string. Don't call GNUNET_xstrndup_ directly. Use the GNUNET_strndup macro. | 579 | * Dup partially a string. Don't call GNUNET_xstrndup_ directly. Use the GNUNET_strndup macro. |
@@ -565,8 +583,9 @@ char *GNUNET_xstrdup_ (const char *str, const char *filename, int linenumber); | |||
565 | * @param linenumber line where this call is being made (for debugging) | 583 | * @param linenumber line where this call is being made (for debugging) |
566 | * @return the duplicated string | 584 | * @return the duplicated string |
567 | */ | 585 | */ |
568 | char *GNUNET_xstrndup_ (const char *str, size_t len, const char *filename, | 586 | char * |
569 | int linenumber); | 587 | GNUNET_xstrndup_ (const char *str, size_t len, const char *filename, |
588 | int linenumber); | ||
570 | 589 | ||
571 | /** | 590 | /** |
572 | * Grow an array, the new elements are zeroed out. | 591 | * Grow an array, the new elements are zeroed out. |
@@ -583,9 +602,9 @@ char *GNUNET_xstrndup_ (const char *str, size_t len, const char *filename, | |||
583 | * @param filename where is this call being made (for debugging) | 602 | * @param filename where is this call being made (for debugging) |
584 | * @param linenumber line where this call is being made (for debugging) | 603 | * @param linenumber line where this call is being made (for debugging) |
585 | */ | 604 | */ |
586 | void GNUNET_xgrow_ (void **old, size_t elementSize, unsigned int *oldCount, | 605 | void |
587 | unsigned int newCount, const char *filename, | 606 | GNUNET_xgrow_ (void **old, size_t elementSize, unsigned int *oldCount, |
588 | int linenumber); | 607 | unsigned int newCount, const char *filename, int linenumber); |
589 | 608 | ||
590 | 609 | ||
591 | 610 | ||
diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h index 24705f0fb..7167d8bd6 100644 --- a/src/include/gnunet_configuration_lib.h +++ b/src/include/gnunet_configuration_lib.h | |||
@@ -49,7 +49,8 @@ struct GNUNET_CONFIGURATION_Handle; | |||
49 | * Create a new configuration object. | 49 | * Create a new configuration object. |
50 | * @return fresh configuration object | 50 | * @return fresh configuration object |
51 | */ | 51 | */ |
52 | struct GNUNET_CONFIGURATION_Handle *GNUNET_CONFIGURATION_create (void); | 52 | struct GNUNET_CONFIGURATION_Handle * |
53 | GNUNET_CONFIGURATION_create (void); | ||
53 | 54 | ||
54 | 55 | ||
55 | /** | 56 | /** |
@@ -58,9 +59,8 @@ struct GNUNET_CONFIGURATION_Handle *GNUNET_CONFIGURATION_create (void); | |||
58 | * @param cfg configuration to duplicate | 59 | * @param cfg configuration to duplicate |
59 | * @return duplicate configuration | 60 | * @return duplicate configuration |
60 | */ | 61 | */ |
61 | struct GNUNET_CONFIGURATION_Handle *GNUNET_CONFIGURATION_dup (const struct | 62 | struct GNUNET_CONFIGURATION_Handle * |
62 | GNUNET_CONFIGURATION_Handle | 63 | GNUNET_CONFIGURATION_dup (const struct GNUNET_CONFIGURATION_Handle *cfg); |
63 | *cfg); | ||
64 | 64 | ||
65 | 65 | ||
66 | /** | 66 | /** |
@@ -68,7 +68,8 @@ struct GNUNET_CONFIGURATION_Handle *GNUNET_CONFIGURATION_dup (const struct | |||
68 | * | 68 | * |
69 | * @param cfg configuration to destroy | 69 | * @param cfg configuration to destroy |
70 | */ | 70 | */ |
71 | void GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg); | 71 | void |
72 | GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg); | ||
72 | 73 | ||
73 | 74 | ||
74 | /** | 75 | /** |
@@ -80,8 +81,9 @@ void GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg); | |||
80 | * @param filename name of the configuration file, NULL to load defaults | 81 | * @param filename name of the configuration file, NULL to load defaults |
81 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 82 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
82 | */ | 83 | */ |
83 | int GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg, | 84 | int |
84 | const char *filename); | 85 | GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg, |
86 | const char *filename); | ||
85 | 87 | ||
86 | 88 | ||
87 | /** | 89 | /** |
@@ -92,8 +94,9 @@ int GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
92 | * @param filename name of the configuration file | 94 | * @param filename name of the configuration file |
93 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 95 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
94 | */ | 96 | */ |
95 | int GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg, | 97 | int |
96 | const char *filename); | 98 | GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg, |
99 | const char *filename); | ||
97 | 100 | ||
98 | 101 | ||
99 | /** | 102 | /** |
@@ -103,8 +106,9 @@ int GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
103 | * @param filename where to write the configuration | 106 | * @param filename where to write the configuration |
104 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 107 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
105 | */ | 108 | */ |
106 | int GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, | 109 | int |
107 | const char *filename); | 110 | GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, |
111 | const char *filename); | ||
108 | 112 | ||
109 | /** | 113 | /** |
110 | * Write only configuration entries that have been changed to configuration file | 114 | * Write only configuration entries that have been changed to configuration file |
@@ -113,10 +117,11 @@ int GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
113 | * @param filename where to write the configuration diff between default and new | 117 | * @param filename where to write the configuration diff between default and new |
114 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 118 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
115 | */ | 119 | */ |
116 | int GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle | 120 | int |
117 | *cfgDefault, | 121 | GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle |
118 | const struct GNUNET_CONFIGURATION_Handle | 122 | *cfgDefault, |
119 | *cfgNew, const char *filename); | 123 | const struct GNUNET_CONFIGURATION_Handle |
124 | *cfgNew, const char *filename); | ||
120 | 125 | ||
121 | /** | 126 | /** |
122 | * Test if there are configuration options that were | 127 | * Test if there are configuration options that were |
@@ -125,8 +130,8 @@ int GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle | |||
125 | * @param cfg configuration to inspect | 130 | * @param cfg configuration to inspect |
126 | * @return GNUNET_NO if clean, GNUNET_YES if dirty, GNUNET_SYSERR on error (i.e. last save failed) | 131 | * @return GNUNET_NO if clean, GNUNET_YES if dirty, GNUNET_SYSERR on error (i.e. last save failed) |
127 | */ | 132 | */ |
128 | int GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle | 133 | int |
129 | *cfg); | 134 | GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg); |
130 | 135 | ||
131 | 136 | ||
132 | /** | 137 | /** |
@@ -159,9 +164,10 @@ typedef void (*GNUNET_CONFIGURATION_Section_Iterator) (void *cls, | |||
159 | * @param iter function to call on each option | 164 | * @param iter function to call on each option |
160 | * @param iter_cls closure for iter | 165 | * @param iter_cls closure for iter |
161 | */ | 166 | */ |
162 | void GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle | 167 | void |
163 | *cfg, GNUNET_CONFIGURATION_Iterator iter, | 168 | GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg, |
164 | void *iter_cls); | 169 | GNUNET_CONFIGURATION_Iterator iter, |
170 | void *iter_cls); | ||
165 | 171 | ||
166 | 172 | ||
167 | /** | 173 | /** |
@@ -171,10 +177,11 @@ void GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle | |||
171 | * @param iter function to call on each section | 177 | * @param iter function to call on each section |
172 | * @param iter_cls closure for iter | 178 | * @param iter_cls closure for iter |
173 | */ | 179 | */ |
174 | void GNUNET_CONFIGURATION_iterate_sections (const struct | 180 | void |
175 | GNUNET_CONFIGURATION_Handle *cfg, | 181 | GNUNET_CONFIGURATION_iterate_sections (const struct GNUNET_CONFIGURATION_Handle |
176 | GNUNET_CONFIGURATION_Section_Iterator | 182 | *cfg, |
177 | iter, void *iter_cls); | 183 | GNUNET_CONFIGURATION_Section_Iterator |
184 | iter, void *iter_cls); | ||
178 | 185 | ||
179 | 186 | ||
180 | /** | 187 | /** |
@@ -183,8 +190,9 @@ void GNUNET_CONFIGURATION_iterate_sections (const struct | |||
183 | * @param cfg configuration to inspect | 190 | * @param cfg configuration to inspect |
184 | * @param section name of the section to remove | 191 | * @param section name of the section to remove |
185 | */ | 192 | */ |
186 | void GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle | 193 | void |
187 | *cfg, const char *section); | 194 | GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle *cfg, |
195 | const char *section); | ||
188 | 196 | ||
189 | /** | 197 | /** |
190 | * Get a configuration value that should be a number. | 198 | * Get a configuration value that should be a number. |
@@ -195,11 +203,11 @@ void GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle | |||
195 | * @param number where to store the numeric value of the option | 203 | * @param number where to store the numeric value of the option |
196 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 204 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
197 | */ | 205 | */ |
198 | int GNUNET_CONFIGURATION_get_value_number (const struct | 206 | int |
199 | GNUNET_CONFIGURATION_Handle *cfg, | 207 | GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Handle |
200 | const char *section, | 208 | *cfg, const char *section, |
201 | const char *option, | 209 | const char *option, |
202 | unsigned long long *number); | 210 | unsigned long long *number); |
203 | 211 | ||
204 | 212 | ||
205 | /** | 213 | /** |
@@ -211,11 +219,11 @@ int GNUNET_CONFIGURATION_get_value_number (const struct | |||
211 | * @param time set to the time value stored in the configuration | 219 | * @param time set to the time value stored in the configuration |
212 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 220 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
213 | */ | 221 | */ |
214 | int GNUNET_CONFIGURATION_get_value_time (const struct | 222 | int |
215 | GNUNET_CONFIGURATION_Handle *cfg, | 223 | GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle |
216 | const char *section, | 224 | *cfg, const char *section, |
217 | const char *option, | 225 | const char *option, |
218 | struct GNUNET_TIME_Relative *time); | 226 | struct GNUNET_TIME_Relative *time); |
219 | 227 | ||
220 | 228 | ||
221 | /** | 229 | /** |
@@ -226,9 +234,9 @@ int GNUNET_CONFIGURATION_get_value_time (const struct | |||
226 | * @param option option of interest | 234 | * @param option option of interest |
227 | * @return GNUNET_YES if so, GNUNET_NO if not. | 235 | * @return GNUNET_YES if so, GNUNET_NO if not. |
228 | */ | 236 | */ |
229 | int GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle | 237 | int |
230 | *cfg, const char *section, | 238 | GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg, |
231 | const char *option); | 239 | const char *section, const char *option); |
232 | 240 | ||
233 | 241 | ||
234 | /** | 242 | /** |
@@ -241,10 +249,10 @@ int GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle | |||
241 | * value, or NULL if option is not specified | 249 | * value, or NULL if option is not specified |
242 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 250 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
243 | */ | 251 | */ |
244 | int GNUNET_CONFIGURATION_get_value_string (const struct | 252 | int |
245 | GNUNET_CONFIGURATION_Handle *cfg, | 253 | GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle |
246 | const char *section, | 254 | *cfg, const char *section, |
247 | const char *option, char **value); | 255 | const char *option, char **value); |
248 | 256 | ||
249 | 257 | ||
250 | /** | 258 | /** |
@@ -258,10 +266,11 @@ int GNUNET_CONFIGURATION_get_value_string (const struct | |||
258 | * value, or NULL if option is not specified | 266 | * value, or NULL if option is not specified |
259 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 267 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
260 | */ | 268 | */ |
261 | int GNUNET_CONFIGURATION_get_value_filename (const struct | 269 | int |
262 | GNUNET_CONFIGURATION_Handle *cfg, | 270 | GNUNET_CONFIGURATION_get_value_filename (const struct |
263 | const char *section, | 271 | GNUNET_CONFIGURATION_Handle *cfg, |
264 | const char *option, char **value); | 272 | const char *section, |
273 | const char *option, char **value); | ||
265 | 274 | ||
266 | /** | 275 | /** |
267 | * Iterate over the set of filenames stored in a configuration value. | 276 | * Iterate over the set of filenames stored in a configuration value. |
@@ -273,12 +282,13 @@ int GNUNET_CONFIGURATION_get_value_filename (const struct | |||
273 | * @param cb_cls closure for cb | 282 | * @param cb_cls closure for cb |
274 | * @return number of filenames iterated over, -1 on error | 283 | * @return number of filenames iterated over, -1 on error |
275 | */ | 284 | */ |
276 | int GNUNET_CONFIGURATION_iterate_value_filenames (const struct | 285 | int |
277 | GNUNET_CONFIGURATION_Handle | 286 | GNUNET_CONFIGURATION_iterate_value_filenames (const struct |
278 | *cfg, const char *section, | 287 | GNUNET_CONFIGURATION_Handle *cfg, |
279 | const char *option, | 288 | const char *section, |
280 | GNUNET_FileNameCallback cb, | 289 | const char *option, |
281 | void *cb_cls); | 290 | GNUNET_FileNameCallback cb, |
291 | void *cb_cls); | ||
282 | 292 | ||
283 | /** | 293 | /** |
284 | * Iterate over values of a section in the configuration. | 294 | * Iterate over values of a section in the configuration. |
@@ -288,11 +298,12 @@ int GNUNET_CONFIGURATION_iterate_value_filenames (const struct | |||
288 | * @param iter function to call on each option | 298 | * @param iter function to call on each option |
289 | * @param iter_cls closure for iter | 299 | * @param iter_cls closure for iter |
290 | */ | 300 | */ |
291 | void GNUNET_CONFIGURATION_iterate_section_values (const struct | 301 | void |
292 | GNUNET_CONFIGURATION_Handle | 302 | GNUNET_CONFIGURATION_iterate_section_values (const struct |
293 | *cfg, const char *section, | 303 | GNUNET_CONFIGURATION_Handle *cfg, |
294 | GNUNET_CONFIGURATION_Iterator | 304 | const char *section, |
295 | iter, void *iter_cls); | 305 | GNUNET_CONFIGURATION_Iterator iter, |
306 | void *iter_cls); | ||
296 | 307 | ||
297 | /** | 308 | /** |
298 | * Get a configuration value that should be in a set of | 309 | * Get a configuration value that should be in a set of |
@@ -306,12 +317,11 @@ void GNUNET_CONFIGURATION_iterate_section_values (const struct | |||
306 | * or NULL if option is not specified and no default given | 317 | * or NULL if option is not specified and no default given |
307 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 318 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
308 | */ | 319 | */ |
309 | int GNUNET_CONFIGURATION_get_value_choice (const struct | 320 | int |
310 | GNUNET_CONFIGURATION_Handle *cfg, | 321 | GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle |
311 | const char *section, | 322 | *cfg, const char *section, |
312 | const char *option, | 323 | const char *option, const char **choices, |
313 | const char **choices, | 324 | const char **value); |
314 | const char **value); | ||
315 | 325 | ||
316 | /** | 326 | /** |
317 | * Get a configuration value that should be in a set of | 327 | * Get a configuration value that should be in a set of |
@@ -322,10 +332,10 @@ int GNUNET_CONFIGURATION_get_value_choice (const struct | |||
322 | * @param option option of interest | 332 | * @param option option of interest |
323 | * @return GNUNET_YES, GNUNET_NO or if option has no valid value, GNUNET_SYSERR | 333 | * @return GNUNET_YES, GNUNET_NO or if option has no valid value, GNUNET_SYSERR |
324 | */ | 334 | */ |
325 | int GNUNET_CONFIGURATION_get_value_yesno (const struct | 335 | int |
326 | GNUNET_CONFIGURATION_Handle *cfg, | 336 | GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle |
327 | const char *section, | 337 | *cfg, const char *section, |
328 | const char *option); | 338 | const char *option); |
329 | 339 | ||
330 | /** | 340 | /** |
331 | * Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR" | 341 | * Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR" |
@@ -336,9 +346,9 @@ int GNUNET_CONFIGURATION_get_value_yesno (const struct | |||
336 | * @param orig string to $-expand (will be freed!) | 346 | * @param orig string to $-expand (will be freed!) |
337 | * @return $-expanded string | 347 | * @return $-expanded string |
338 | */ | 348 | */ |
339 | char *GNUNET_CONFIGURATION_expand_dollar (const struct | 349 | char * |
340 | GNUNET_CONFIGURATION_Handle *cfg, | 350 | GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle |
341 | char *orig); | 351 | *cfg, char *orig); |
342 | 352 | ||
343 | 353 | ||
344 | /** | 354 | /** |
@@ -349,10 +359,10 @@ char *GNUNET_CONFIGURATION_expand_dollar (const struct | |||
349 | * @param option option of interest | 359 | * @param option option of interest |
350 | * @param number value to set | 360 | * @param number value to set |
351 | */ | 361 | */ |
352 | void GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle | 362 | void |
353 | *cfg, const char *section, | 363 | GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle *cfg, |
354 | const char *option, | 364 | const char *section, const char *option, |
355 | unsigned long long number); | 365 | unsigned long long number); |
356 | 366 | ||
357 | 367 | ||
358 | /** | 368 | /** |
@@ -363,10 +373,10 @@ void GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle | |||
363 | * @param option option of interest | 373 | * @param option option of interest |
364 | * @param value value to set | 374 | * @param value value to set |
365 | */ | 375 | */ |
366 | void GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle | 376 | void |
367 | *cfg, const char *section, | 377 | GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle *cfg, |
368 | const char *option, | 378 | const char *section, const char *option, |
369 | const char *value); | 379 | const char *value); |
370 | 380 | ||
371 | /** | 381 | /** |
372 | * Remove a filename from a configuration value that | 382 | * Remove a filename from a configuration value that |
@@ -379,11 +389,11 @@ void GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle | |||
379 | * @return GNUNET_OK on success, | 389 | * @return GNUNET_OK on success, |
380 | * GNUNET_SYSERR if the filename is not in the list | 390 | * GNUNET_SYSERR if the filename is not in the list |
381 | */ | 391 | */ |
382 | int GNUNET_CONFIGURATION_remove_value_filename (struct | 392 | int |
383 | GNUNET_CONFIGURATION_Handle | 393 | GNUNET_CONFIGURATION_remove_value_filename (struct GNUNET_CONFIGURATION_Handle |
384 | *cfg, const char *section, | 394 | *cfg, const char *section, |
385 | const char *option, | 395 | const char *option, |
386 | const char *value); | 396 | const char *value); |
387 | 397 | ||
388 | /** | 398 | /** |
389 | * Append a filename to a configuration value that | 399 | * Append a filename to a configuration value that |
@@ -396,11 +406,11 @@ int GNUNET_CONFIGURATION_remove_value_filename (struct | |||
396 | * @return GNUNET_OK on success, | 406 | * @return GNUNET_OK on success, |
397 | * GNUNET_SYSERR if the filename already in the list | 407 | * GNUNET_SYSERR if the filename already in the list |
398 | */ | 408 | */ |
399 | int GNUNET_CONFIGURATION_append_value_filename (struct | 409 | int |
400 | GNUNET_CONFIGURATION_Handle | 410 | GNUNET_CONFIGURATION_append_value_filename (struct GNUNET_CONFIGURATION_Handle |
401 | *cfg, const char *section, | 411 | *cfg, const char *section, |
402 | const char *option, | 412 | const char *option, |
403 | const char *value); | 413 | const char *value); |
404 | 414 | ||
405 | 415 | ||
406 | #if 0 /* keep Emacsens' auto-indent happy */ | 416 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_connection_lib.h b/src/include/gnunet_connection_lib.h index af10c5966..f7a6e5078 100644 --- a/src/include/gnunet_connection_lib.h +++ b/src/include/gnunet_connection_lib.h | |||
@@ -111,7 +111,8 @@ typedef void (*GNUNET_CONNECTION_Receiver) (void *cls, const void *buf, | |||
111 | * | 111 | * |
112 | * @param sock the connection to set persistent | 112 | * @param sock the connection to set persistent |
113 | */ | 113 | */ |
114 | void GNUNET_CONNECTION_persist_ (struct GNUNET_CONNECTION_Handle *sock); | 114 | void |
115 | GNUNET_CONNECTION_persist_ (struct GNUNET_CONNECTION_Handle *sock); | ||
115 | 116 | ||
116 | /** | 117 | /** |
117 | * Disable the "CORK" feature for communication with the given socket, | 118 | * Disable the "CORK" feature for communication with the given socket, |
@@ -124,7 +125,8 @@ void GNUNET_CONNECTION_persist_ (struct GNUNET_CONNECTION_Handle *sock); | |||
124 | * @param sock the connection to make flushing and blocking | 125 | * @param sock the connection to make flushing and blocking |
125 | * @return GNUNET_OK on success | 126 | * @return GNUNET_OK on success |
126 | */ | 127 | */ |
127 | int GNUNET_CONNECTION_disable_corking (struct GNUNET_CONNECTION_Handle *sock); | 128 | int |
129 | GNUNET_CONNECTION_disable_corking (struct GNUNET_CONNECTION_Handle *sock); | ||
128 | 130 | ||
129 | 131 | ||
130 | /** | 132 | /** |
@@ -135,9 +137,8 @@ int GNUNET_CONNECTION_disable_corking (struct GNUNET_CONNECTION_Handle *sock); | |||
135 | * @param osSocket existing socket to box | 137 | * @param osSocket existing socket to box |
136 | * @return the boxed socket handle | 138 | * @return the boxed socket handle |
137 | */ | 139 | */ |
138 | struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_existing (struct | 140 | struct GNUNET_CONNECTION_Handle * |
139 | GNUNET_NETWORK_Handle | 141 | GNUNET_CONNECTION_create_from_existing (struct GNUNET_NETWORK_Handle *osSocket); |
140 | *osSocket); | ||
141 | 142 | ||
142 | 143 | ||
143 | /** | 144 | /** |
@@ -149,10 +150,10 @@ struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_existing (struct | |||
149 | * @param lsock listen socket | 150 | * @param lsock listen socket |
150 | * @return the socket handle, NULL on error (for example, access refused) | 151 | * @return the socket handle, NULL on error (for example, access refused) |
151 | */ | 152 | */ |
152 | struct GNUNET_CONNECTION_Handle | 153 | struct GNUNET_CONNECTION_Handle * |
153 | *GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access, | 154 | GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access, |
154 | void *access_cls, | 155 | void *access_cls, |
155 | struct GNUNET_NETWORK_Handle *lsock); | 156 | struct GNUNET_NETWORK_Handle *lsock); |
156 | 157 | ||
157 | 158 | ||
158 | /** | 159 | /** |
@@ -165,15 +166,10 @@ struct GNUNET_CONNECTION_Handle | |||
165 | * @param port port to connect to | 166 | * @param port port to connect to |
166 | * @return the socket handle | 167 | * @return the socket handle |
167 | */ | 168 | */ |
168 | struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_connect (const | 169 | struct GNUNET_CONNECTION_Handle * |
169 | struct | 170 | GNUNET_CONNECTION_create_from_connect (const struct GNUNET_CONFIGURATION_Handle |
170 | GNUNET_CONFIGURATION_Handle | 171 | *cfg, const char *hostname, |
171 | *cfg, | 172 | uint16_t port); |
172 | const | ||
173 | char | ||
174 | *hostname, | ||
175 | uint16_t | ||
176 | port); | ||
177 | 173 | ||
178 | 174 | ||
179 | /** | 175 | /** |
@@ -185,11 +181,10 @@ struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_connect (const | |||
185 | * @param unixpath path to connect to) | 181 | * @param unixpath path to connect to) |
186 | * @return the socket handle, NULL on systems without UNIX support | 182 | * @return the socket handle, NULL on systems without UNIX support |
187 | */ | 183 | */ |
188 | struct GNUNET_CONNECTION_Handle | 184 | struct GNUNET_CONNECTION_Handle * |
189 | *GNUNET_CONNECTION_create_from_connect_to_unixpath (const struct | 185 | GNUNET_CONNECTION_create_from_connect_to_unixpath (const struct |
190 | GNUNET_CONFIGURATION_Handle | 186 | GNUNET_CONFIGURATION_Handle |
191 | *cfg, | 187 | *cfg, const char *unixpath); |
192 | const char *unixpath); | ||
193 | 188 | ||
194 | 189 | ||
195 | 190 | ||
@@ -204,14 +199,10 @@ struct GNUNET_CONNECTION_Handle | |||
204 | * @param addrlen length of server address | 199 | * @param addrlen length of server address |
205 | * @return the socket handle | 200 | * @return the socket handle |
206 | */ | 201 | */ |
207 | struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_sockaddr (int | 202 | struct GNUNET_CONNECTION_Handle * |
208 | af_family, | 203 | GNUNET_CONNECTION_create_from_sockaddr (int af_family, |
209 | const | 204 | const struct sockaddr *serv_addr, |
210 | struct | 205 | socklen_t addrlen); |
211 | sockaddr | ||
212 | *serv_addr, | ||
213 | socklen_t | ||
214 | addrlen); | ||
215 | 206 | ||
216 | /** | 207 | /** |
217 | * Check if socket is valid (no fatal errors have happened so far). | 208 | * Check if socket is valid (no fatal errors have happened so far). |
@@ -221,7 +212,8 @@ struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_sockaddr (int | |||
221 | * @param sock socket to check | 212 | * @param sock socket to check |
222 | * @return GNUNET_YES if valid, GNUNET_NO otherwise | 213 | * @return GNUNET_YES if valid, GNUNET_NO otherwise |
223 | */ | 214 | */ |
224 | int GNUNET_CONNECTION_check (struct GNUNET_CONNECTION_Handle *sock); | 215 | int |
216 | GNUNET_CONNECTION_check (struct GNUNET_CONNECTION_Handle *sock); | ||
225 | 217 | ||
226 | 218 | ||
227 | /** | 219 | /** |
@@ -232,8 +224,9 @@ int GNUNET_CONNECTION_check (struct GNUNET_CONNECTION_Handle *sock); | |||
232 | * @param addrlen where to store the length of the address | 224 | * @param addrlen where to store the length of the address |
233 | * @return GNUNET_OK on success | 225 | * @return GNUNET_OK on success |
234 | */ | 226 | */ |
235 | int GNUNET_CONNECTION_get_address (struct GNUNET_CONNECTION_Handle *sock, | 227 | int |
236 | void **addr, size_t * addrlen); | 228 | GNUNET_CONNECTION_get_address (struct GNUNET_CONNECTION_Handle *sock, |
229 | void **addr, size_t * addrlen); | ||
237 | 230 | ||
238 | 231 | ||
239 | /** | 232 | /** |
@@ -249,8 +242,9 @@ int GNUNET_CONNECTION_get_address (struct GNUNET_CONNECTION_Handle *sock, | |||
249 | * read from the application; all other transmissions should be | 242 | * read from the application; all other transmissions should be |
250 | * aborted using 'GNUNET_CONNECTION_notify_transmit_ready_cancel'). | 243 | * aborted using 'GNUNET_CONNECTION_notify_transmit_ready_cancel'). |
251 | */ | 244 | */ |
252 | void GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock, | 245 | void |
253 | int finish_pending_write); | 246 | GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock, |
247 | int finish_pending_write); | ||
254 | 248 | ||
255 | 249 | ||
256 | /** | 250 | /** |
@@ -266,10 +260,11 @@ void GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock, | |||
266 | * @param receiver function to call with received data | 260 | * @param receiver function to call with received data |
267 | * @param receiver_cls closure for receiver | 261 | * @param receiver_cls closure for receiver |
268 | */ | 262 | */ |
269 | void GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *sock, | 263 | void |
270 | size_t max, struct GNUNET_TIME_Relative timeout, | 264 | GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *sock, size_t max, |
271 | GNUNET_CONNECTION_Receiver receiver, | 265 | struct GNUNET_TIME_Relative timeout, |
272 | void *receiver_cls); | 266 | GNUNET_CONNECTION_Receiver receiver, |
267 | void *receiver_cls); | ||
273 | 268 | ||
274 | 269 | ||
275 | /** | 270 | /** |
@@ -280,7 +275,8 @@ void GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *sock, | |||
280 | * @param sock socket handle | 275 | * @param sock socket handle |
281 | * @return closure of the original receiver callback closure | 276 | * @return closure of the original receiver callback closure |
282 | */ | 277 | */ |
283 | void *GNUNET_CONNECTION_receive_cancel (struct GNUNET_CONNECTION_Handle *sock); | 278 | void * |
279 | GNUNET_CONNECTION_receive_cancel (struct GNUNET_CONNECTION_Handle *sock); | ||
284 | 280 | ||
285 | 281 | ||
286 | /** | 282 | /** |
@@ -333,13 +329,12 @@ struct GNUNET_CONNECTION_TransmitHandle; | |||
333 | * @return non-NULL if the notify callback was queued, | 329 | * @return non-NULL if the notify callback was queued, |
334 | * NULL if we are already going to notify someone else (busy) | 330 | * NULL if we are already going to notify someone else (busy) |
335 | */ | 331 | */ |
336 | struct GNUNET_CONNECTION_TransmitHandle | 332 | struct GNUNET_CONNECTION_TransmitHandle * |
337 | *GNUNET_CONNECTION_notify_transmit_ready (struct GNUNET_CONNECTION_Handle | 333 | GNUNET_CONNECTION_notify_transmit_ready (struct GNUNET_CONNECTION_Handle *sock, |
338 | *sock, size_t size, | 334 | size_t size, |
339 | struct GNUNET_TIME_Relative | 335 | struct GNUNET_TIME_Relative timeout, |
340 | timeout, | 336 | GNUNET_CONNECTION_TransmitReadyNotify |
341 | GNUNET_CONNECTION_TransmitReadyNotify | 337 | notify, void *notify_cls); |
342 | notify, void *notify_cls); | ||
343 | 338 | ||
344 | 339 | ||
345 | /** | 340 | /** |
@@ -348,9 +343,10 @@ struct GNUNET_CONNECTION_TransmitHandle | |||
348 | * | 343 | * |
349 | * @param h handle for notification to cancel | 344 | * @param h handle for notification to cancel |
350 | */ | 345 | */ |
351 | void GNUNET_CONNECTION_notify_transmit_ready_cancel (struct | 346 | void |
352 | GNUNET_CONNECTION_TransmitHandle | 347 | GNUNET_CONNECTION_notify_transmit_ready_cancel (struct |
353 | *h); | 348 | GNUNET_CONNECTION_TransmitHandle |
349 | *h); | ||
354 | 350 | ||
355 | 351 | ||
356 | /** | 352 | /** |
@@ -359,8 +355,9 @@ void GNUNET_CONNECTION_notify_transmit_ready_cancel (struct | |||
359 | * @param sock socket handle | 355 | * @param sock socket handle |
360 | * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default | 356 | * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default |
361 | */ | 357 | */ |
362 | void GNUNET_CONNECTION_ignore_shutdown (struct GNUNET_CONNECTION_Handle *sock, | 358 | void |
363 | int do_ignore); | 359 | GNUNET_CONNECTION_ignore_shutdown (struct GNUNET_CONNECTION_Handle *sock, |
360 | int do_ignore); | ||
364 | 361 | ||
365 | 362 | ||
366 | #if 0 /* keep Emacsens' auto-indent happy */ | 363 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h index fde31ed34..cad85d016 100644 --- a/src/include/gnunet_container_lib.h +++ b/src/include/gnunet_container_lib.h | |||
@@ -75,13 +75,9 @@ typedef int (*GNUNET_HashCodeIterator) (void *cls, GNUNET_HashCode * next); | |||
75 | * element (number of bits set per element in the set) | 75 | * element (number of bits set per element in the set) |
76 | * @return the bloomfilter | 76 | * @return the bloomfilter |
77 | */ | 77 | */ |
78 | struct GNUNET_CONTAINER_BloomFilter *GNUNET_CONTAINER_bloomfilter_load (const | 78 | struct GNUNET_CONTAINER_BloomFilter * |
79 | char | 79 | GNUNET_CONTAINER_bloomfilter_load (const char *filename, size_t size, |
80 | *filename, | 80 | unsigned int k); |
81 | size_t | ||
82 | size, | ||
83 | unsigned | ||
84 | int k); | ||
85 | 81 | ||
86 | 82 | ||
87 | /** | 83 | /** |
@@ -97,13 +93,9 @@ struct GNUNET_CONTAINER_BloomFilter *GNUNET_CONTAINER_bloomfilter_load (const | |||
97 | * element (number of bits set per element in the set) | 93 | * element (number of bits set per element in the set) |
98 | * @return the bloomfilter | 94 | * @return the bloomfilter |
99 | */ | 95 | */ |
100 | struct GNUNET_CONTAINER_BloomFilter *GNUNET_CONTAINER_bloomfilter_init (const | 96 | struct GNUNET_CONTAINER_BloomFilter * |
101 | char | 97 | GNUNET_CONTAINER_bloomfilter_init (const char *data, size_t size, |
102 | *data, | 98 | unsigned int k); |
103 | size_t | ||
104 | size, | ||
105 | unsigned | ||
106 | int k); | ||
107 | 99 | ||
108 | 100 | ||
109 | /** | 101 | /** |
@@ -114,9 +106,10 @@ struct GNUNET_CONTAINER_BloomFilter *GNUNET_CONTAINER_bloomfilter_init (const | |||
114 | * @param size the size of the given data array | 106 | * @param size the size of the given data array |
115 | * @return GNUNET_SYSERR if the data array of the wrong size | 107 | * @return GNUNET_SYSERR if the data array of the wrong size |
116 | */ | 108 | */ |
117 | int GNUNET_CONTAINER_bloomfilter_get_raw_data (const struct | 109 | int |
118 | GNUNET_CONTAINER_BloomFilter *bf, | 110 | GNUNET_CONTAINER_bloomfilter_get_raw_data (const struct |
119 | char *data, size_t size); | 111 | GNUNET_CONTAINER_BloomFilter *bf, |
112 | char *data, size_t size); | ||
120 | 113 | ||
121 | 114 | ||
122 | /** | 115 | /** |
@@ -125,8 +118,9 @@ int GNUNET_CONTAINER_bloomfilter_get_raw_data (const struct | |||
125 | * @param bf the filter | 118 | * @param bf the filter |
126 | * @return GNUNET_YES if the element is in the filter, GNUNET_NO if not | 119 | * @return GNUNET_YES if the element is in the filter, GNUNET_NO if not |
127 | */ | 120 | */ |
128 | int GNUNET_CONTAINER_bloomfilter_test (const struct GNUNET_CONTAINER_BloomFilter | 121 | int |
129 | *bf, const GNUNET_HashCode * e); | 122 | GNUNET_CONTAINER_bloomfilter_test (const struct GNUNET_CONTAINER_BloomFilter |
123 | *bf, const GNUNET_HashCode * e); | ||
130 | 124 | ||
131 | 125 | ||
132 | /** | 126 | /** |
@@ -134,8 +128,9 @@ int GNUNET_CONTAINER_bloomfilter_test (const struct GNUNET_CONTAINER_BloomFilter | |||
134 | * @param bf the filter | 128 | * @param bf the filter |
135 | * @param e the element | 129 | * @param e the element |
136 | */ | 130 | */ |
137 | void GNUNET_CONTAINER_bloomfilter_add (struct GNUNET_CONTAINER_BloomFilter *bf, | 131 | void |
138 | const GNUNET_HashCode * e); | 132 | GNUNET_CONTAINER_bloomfilter_add (struct GNUNET_CONTAINER_BloomFilter *bf, |
133 | const GNUNET_HashCode * e); | ||
139 | 134 | ||
140 | 135 | ||
141 | /** | 136 | /** |
@@ -143,8 +138,9 @@ void GNUNET_CONTAINER_bloomfilter_add (struct GNUNET_CONTAINER_BloomFilter *bf, | |||
143 | * @param bf the filter | 138 | * @param bf the filter |
144 | * @param e the element to remove | 139 | * @param e the element to remove |
145 | */ | 140 | */ |
146 | void GNUNET_CONTAINER_bloomfilter_remove (struct GNUNET_CONTAINER_BloomFilter | 141 | void |
147 | *bf, const GNUNET_HashCode * e); | 142 | GNUNET_CONTAINER_bloomfilter_remove (struct GNUNET_CONTAINER_BloomFilter *bf, |
143 | const GNUNET_HashCode * e); | ||
148 | 144 | ||
149 | 145 | ||
150 | /** | 146 | /** |
@@ -153,10 +149,9 @@ void GNUNET_CONTAINER_bloomfilter_remove (struct GNUNET_CONTAINER_BloomFilter | |||
153 | * @param bf the filter | 149 | * @param bf the filter |
154 | * @return copy of bf | 150 | * @return copy of bf |
155 | */ | 151 | */ |
156 | struct GNUNET_CONTAINER_BloomFilter *GNUNET_CONTAINER_bloomfilter_copy (const | 152 | struct GNUNET_CONTAINER_BloomFilter * |
157 | struct | 153 | GNUNET_CONTAINER_bloomfilter_copy (const struct GNUNET_CONTAINER_BloomFilter |
158 | GNUNET_CONTAINER_BloomFilter | 154 | *bf); |
159 | *bf); | ||
160 | 155 | ||
161 | 156 | ||
162 | 157 | ||
@@ -166,8 +161,8 @@ struct GNUNET_CONTAINER_BloomFilter *GNUNET_CONTAINER_bloomfilter_copy (const | |||
166 | * free the space on the drive) | 161 | * free the space on the drive) |
167 | * @param bf the filter | 162 | * @param bf the filter |
168 | */ | 163 | */ |
169 | void GNUNET_CONTAINER_bloomfilter_free (struct GNUNET_CONTAINER_BloomFilter | 164 | void |
170 | *bf); | 165 | GNUNET_CONTAINER_bloomfilter_free (struct GNUNET_CONTAINER_BloomFilter *bf); |
171 | 166 | ||
172 | 167 | ||
173 | /** | 168 | /** |
@@ -176,17 +171,17 @@ void GNUNET_CONTAINER_bloomfilter_free (struct GNUNET_CONTAINER_BloomFilter | |||
176 | * @param bf the filter | 171 | * @param bf the filter |
177 | * @return number of bytes used for the data of the bloom filter | 172 | * @return number of bytes used for the data of the bloom filter |
178 | */ | 173 | */ |
179 | size_t GNUNET_CONTAINER_bloomfilter_get_size (const struct | 174 | size_t |
180 | GNUNET_CONTAINER_BloomFilter | 175 | GNUNET_CONTAINER_bloomfilter_get_size (const struct GNUNET_CONTAINER_BloomFilter |
181 | *bf); | 176 | *bf); |
182 | 177 | ||
183 | 178 | ||
184 | /** | 179 | /** |
185 | * Reset a bloom filter to empty. | 180 | * Reset a bloom filter to empty. |
186 | * @param bf the filter | 181 | * @param bf the filter |
187 | */ | 182 | */ |
188 | void GNUNET_CONTAINER_bloomfilter_clear (struct GNUNET_CONTAINER_BloomFilter | 183 | void |
189 | *bf); | 184 | GNUNET_CONTAINER_bloomfilter_clear (struct GNUNET_CONTAINER_BloomFilter *bf); |
190 | 185 | ||
191 | /** | 186 | /** |
192 | * Or the entries of the given raw data array with the | 187 | * Or the entries of the given raw data array with the |
@@ -199,8 +194,9 @@ void GNUNET_CONTAINER_bloomfilter_clear (struct GNUNET_CONTAINER_BloomFilter | |||
199 | * @param size size of data | 194 | * @param size size of data |
200 | * @return GNUNET_OK on success | 195 | * @return GNUNET_OK on success |
201 | */ | 196 | */ |
202 | int GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf, | 197 | int |
203 | const char *data, size_t size); | 198 | GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf, |
199 | const char *data, size_t size); | ||
204 | 200 | ||
205 | /** | 201 | /** |
206 | * Or the entries of the given raw data array with the | 202 | * Or the entries of the given raw data array with the |
@@ -212,9 +208,10 @@ int GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf, | |||
212 | * @param to_or the bloomfilter to or-in | 208 | * @param to_or the bloomfilter to or-in |
213 | * @param size number of bytes in data | 209 | * @param size number of bytes in data |
214 | */ | 210 | */ |
215 | int GNUNET_CONTAINER_bloomfilter_or2 (struct GNUNET_CONTAINER_BloomFilter *bf, | 211 | int |
216 | const struct GNUNET_CONTAINER_BloomFilter | 212 | GNUNET_CONTAINER_bloomfilter_or2 (struct GNUNET_CONTAINER_BloomFilter *bf, |
217 | *to_or, size_t size); | 213 | const struct GNUNET_CONTAINER_BloomFilter |
214 | *to_or, size_t size); | ||
218 | 215 | ||
219 | /** | 216 | /** |
220 | * Resize a bloom filter. Note that this operation | 217 | * Resize a bloom filter. Note that this operation |
@@ -227,10 +224,11 @@ int GNUNET_CONTAINER_bloomfilter_or2 (struct GNUNET_CONTAINER_BloomFilter *bf, | |||
227 | * @param size the new size for the filter | 224 | * @param size the new size for the filter |
228 | * @param k the new number of GNUNET_CRYPTO_hash-function to apply per element | 225 | * @param k the new number of GNUNET_CRYPTO_hash-function to apply per element |
229 | */ | 226 | */ |
230 | void GNUNET_CONTAINER_bloomfilter_resize (struct GNUNET_CONTAINER_BloomFilter | 227 | void |
231 | *bf, GNUNET_HashCodeIterator iterator, | 228 | GNUNET_CONTAINER_bloomfilter_resize (struct GNUNET_CONTAINER_BloomFilter *bf, |
232 | void *iterator_cls, size_t size, | 229 | GNUNET_HashCodeIterator iterator, |
233 | unsigned int k); | 230 | void *iterator_cls, size_t size, |
231 | unsigned int k); | ||
234 | 232 | ||
235 | /* ****************** metadata ******************* */ | 233 | /* ****************** metadata ******************* */ |
236 | 234 | ||
@@ -244,7 +242,8 @@ struct GNUNET_CONTAINER_MetaData; | |||
244 | * | 242 | * |
245 | * @return empty meta-data container | 243 | * @return empty meta-data container |
246 | */ | 244 | */ |
247 | struct GNUNET_CONTAINER_MetaData *GNUNET_CONTAINER_meta_data_create (void); | 245 | struct GNUNET_CONTAINER_MetaData * |
246 | GNUNET_CONTAINER_meta_data_create (void); | ||
248 | 247 | ||
249 | /** | 248 | /** |
250 | * Duplicate a MetaData token. | 249 | * Duplicate a MetaData token. |
@@ -252,17 +251,17 @@ struct GNUNET_CONTAINER_MetaData *GNUNET_CONTAINER_meta_data_create (void); | |||
252 | * @param md what to duplicate | 251 | * @param md what to duplicate |
253 | * @return duplicate meta-data container | 252 | * @return duplicate meta-data container |
254 | */ | 253 | */ |
255 | struct GNUNET_CONTAINER_MetaData *GNUNET_CONTAINER_meta_data_duplicate (const | 254 | struct GNUNET_CONTAINER_MetaData * |
256 | struct | 255 | GNUNET_CONTAINER_meta_data_duplicate (const struct GNUNET_CONTAINER_MetaData |
257 | GNUNET_CONTAINER_MetaData | 256 | *md); |
258 | *md); | ||
259 | 257 | ||
260 | /** | 258 | /** |
261 | * Free meta data. | 259 | * Free meta data. |
262 | * | 260 | * |
263 | * @param md what to free | 261 | * @param md what to free |
264 | */ | 262 | */ |
265 | void GNUNET_CONTAINER_meta_data_destroy (struct GNUNET_CONTAINER_MetaData *md); | 263 | void |
264 | GNUNET_CONTAINER_meta_data_destroy (struct GNUNET_CONTAINER_MetaData *md); | ||
266 | 265 | ||
267 | /** | 266 | /** |
268 | * Test if two MDs are equal. We consider them equal if | 267 | * Test if two MDs are equal. We consider them equal if |
@@ -274,10 +273,11 @@ void GNUNET_CONTAINER_meta_data_destroy (struct GNUNET_CONTAINER_MetaData *md); | |||
274 | * @param md2 other value to check | 273 | * @param md2 other value to check |
275 | * @return GNUNET_YES if they are equal | 274 | * @return GNUNET_YES if they are equal |
276 | */ | 275 | */ |
277 | int GNUNET_CONTAINER_meta_data_test_equal (const struct | 276 | int |
278 | GNUNET_CONTAINER_MetaData *md1, | 277 | GNUNET_CONTAINER_meta_data_test_equal (const struct GNUNET_CONTAINER_MetaData |
279 | const struct | 278 | *md1, |
280 | GNUNET_CONTAINER_MetaData *md2); | 279 | const struct GNUNET_CONTAINER_MetaData |
280 | *md2); | ||
281 | 281 | ||
282 | 282 | ||
283 | /** | 283 | /** |
@@ -297,12 +297,13 @@ int GNUNET_CONTAINER_meta_data_test_equal (const struct | |||
297 | * @return GNUNET_OK on success, GNUNET_SYSERR if this entry already exists | 297 | * @return GNUNET_OK on success, GNUNET_SYSERR if this entry already exists |
298 | * data_mime_type and plugin_name are not considered for "exists" checks | 298 | * data_mime_type and plugin_name are not considered for "exists" checks |
299 | */ | 299 | */ |
300 | int GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md, | 300 | int |
301 | const char *plugin_name, | 301 | GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md, |
302 | enum EXTRACTOR_MetaType type, | 302 | const char *plugin_name, |
303 | enum EXTRACTOR_MetaFormat format, | 303 | enum EXTRACTOR_MetaType type, |
304 | const char *data_mime_type, | 304 | enum EXTRACTOR_MetaFormat format, |
305 | const char *data, size_t data_len); | 305 | const char *data_mime_type, const char *data, |
306 | size_t data_len); | ||
306 | 307 | ||
307 | 308 | ||
308 | /** | 309 | /** |
@@ -312,9 +313,9 @@ int GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md, | |||
312 | * @param md metadata to extend | 313 | * @param md metadata to extend |
313 | * @param in metadata to merge | 314 | * @param in metadata to merge |
314 | */ | 315 | */ |
315 | void GNUNET_CONTAINER_meta_data_merge (struct GNUNET_CONTAINER_MetaData *md, | 316 | void |
316 | const struct GNUNET_CONTAINER_MetaData | 317 | GNUNET_CONTAINER_meta_data_merge (struct GNUNET_CONTAINER_MetaData *md, |
317 | *in); | 318 | const struct GNUNET_CONTAINER_MetaData *in); |
318 | 319 | ||
319 | 320 | ||
320 | /** | 321 | /** |
@@ -327,9 +328,10 @@ void GNUNET_CONTAINER_meta_data_merge (struct GNUNET_CONTAINER_MetaData *md, | |||
327 | * @param data_len number of bytes in data | 328 | * @param data_len number of bytes in data |
328 | * @return GNUNET_OK on success, GNUNET_SYSERR if the item does not exist in md | 329 | * @return GNUNET_OK on success, GNUNET_SYSERR if the item does not exist in md |
329 | */ | 330 | */ |
330 | int GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md, | 331 | int |
331 | enum EXTRACTOR_MetaType type, | 332 | GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md, |
332 | const char *data, size_t data_len); | 333 | enum EXTRACTOR_MetaType type, |
334 | const char *data, size_t data_len); | ||
333 | 335 | ||
334 | 336 | ||
335 | /** | 337 | /** |
@@ -337,7 +339,8 @@ int GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md, | |||
337 | * | 339 | * |
338 | * @param md metadata to manipulate | 340 | * @param md metadata to manipulate |
339 | */ | 341 | */ |
340 | void GNUNET_CONTAINER_meta_data_clear (struct GNUNET_CONTAINER_MetaData *md); | 342 | void |
343 | GNUNET_CONTAINER_meta_data_clear (struct GNUNET_CONTAINER_MetaData *md); | ||
341 | 344 | ||
342 | 345 | ||
343 | /** | 346 | /** |
@@ -346,9 +349,9 @@ void GNUNET_CONTAINER_meta_data_clear (struct GNUNET_CONTAINER_MetaData *md); | |||
346 | * | 349 | * |
347 | * @param md metadata to modify | 350 | * @param md metadata to modify |
348 | */ | 351 | */ |
349 | void GNUNET_CONTAINER_meta_data_add_publication_date (struct | 352 | void |
350 | GNUNET_CONTAINER_MetaData | 353 | GNUNET_CONTAINER_meta_data_add_publication_date (struct |
351 | *md); | 354 | GNUNET_CONTAINER_MetaData *md); |
352 | 355 | ||
353 | 356 | ||
354 | /** | 357 | /** |
@@ -359,9 +362,10 @@ void GNUNET_CONTAINER_meta_data_add_publication_date (struct | |||
359 | * @param iter_cls closure for iterator | 362 | * @param iter_cls closure for iterator |
360 | * @return number of entries | 363 | * @return number of entries |
361 | */ | 364 | */ |
362 | int GNUNET_CONTAINER_meta_data_iterate (const struct GNUNET_CONTAINER_MetaData | 365 | int |
363 | *md, EXTRACTOR_MetaDataProcessor iter, | 366 | GNUNET_CONTAINER_meta_data_iterate (const struct GNUNET_CONTAINER_MetaData *md, |
364 | void *iter_cls); | 367 | EXTRACTOR_MetaDataProcessor iter, |
368 | void *iter_cls); | ||
365 | 369 | ||
366 | /** | 370 | /** |
367 | * Get the first MD entry of the given type. Caller | 371 | * Get the first MD entry of the given type. Caller |
@@ -373,9 +377,9 @@ int GNUNET_CONTAINER_meta_data_iterate (const struct GNUNET_CONTAINER_MetaData | |||
373 | * @param type type to look for | 377 | * @param type type to look for |
374 | * @return NULL if no entry was found | 378 | * @return NULL if no entry was found |
375 | */ | 379 | */ |
376 | char *GNUNET_CONTAINER_meta_data_get_by_type (const struct | 380 | char * |
377 | GNUNET_CONTAINER_MetaData *md, | 381 | GNUNET_CONTAINER_meta_data_get_by_type (const struct GNUNET_CONTAINER_MetaData |
378 | enum EXTRACTOR_MetaType type); | 382 | *md, enum EXTRACTOR_MetaType type); |
379 | 383 | ||
380 | 384 | ||
381 | /** | 385 | /** |
@@ -389,9 +393,10 @@ char *GNUNET_CONTAINER_meta_data_get_by_type (const struct | |||
389 | * @return NULL if we do not have any such entry, | 393 | * @return NULL if we do not have any such entry, |
390 | * otherwise client is responsible for freeing the value! | 394 | * otherwise client is responsible for freeing the value! |
391 | */ | 395 | */ |
392 | char *GNUNET_CONTAINER_meta_data_get_first_by_types (const struct | 396 | char * |
393 | GNUNET_CONTAINER_MetaData | 397 | GNUNET_CONTAINER_meta_data_get_first_by_types (const struct |
394 | *md, ...); | 398 | GNUNET_CONTAINER_MetaData *md, |
399 | ...); | ||
395 | 400 | ||
396 | /** | 401 | /** |
397 | * Get a thumbnail from the meta-data (if present). Only matches meta | 402 | * Get a thumbnail from the meta-data (if present). Only matches meta |
@@ -402,9 +407,9 @@ char *GNUNET_CONTAINER_meta_data_get_first_by_types (const struct | |||
402 | * freed by the caller! | 407 | * freed by the caller! |
403 | * @return number of bytes in thumbnail, 0 if not available | 408 | * @return number of bytes in thumbnail, 0 if not available |
404 | */ | 409 | */ |
405 | size_t GNUNET_CONTAINER_meta_data_get_thumbnail (const struct | 410 | size_t |
406 | GNUNET_CONTAINER_MetaData *md, | 411 | GNUNET_CONTAINER_meta_data_get_thumbnail (const struct GNUNET_CONTAINER_MetaData |
407 | unsigned char **thumb); | 412 | *md, unsigned char **thumb); |
408 | 413 | ||
409 | 414 | ||
410 | 415 | ||
@@ -445,7 +450,7 @@ enum GNUNET_CONTAINER_MetaDataSerializationOptions | |||
445 | * -1 on error (typically: not enough | 450 | * -1 on error (typically: not enough |
446 | * space) | 451 | * space) |
447 | */ | 452 | */ |
448 | ssize_t | 453 | ssize_t |
449 | GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData | 454 | GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData |
450 | *md, char **target, size_t max, | 455 | *md, char **target, size_t max, |
451 | enum | 456 | enum |
@@ -459,7 +464,7 @@ GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData | |||
459 | * @param md metadata to inspect | 464 | * @param md metadata to inspect |
460 | * @return number of bytes needed for serialization, -1 on error | 465 | * @return number of bytes needed for serialization, -1 on error |
461 | */ | 466 | */ |
462 | ssize_t | 467 | ssize_t |
463 | GNUNET_CONTAINER_meta_data_get_serialized_size (const struct | 468 | GNUNET_CONTAINER_meta_data_get_serialized_size (const struct |
464 | GNUNET_CONTAINER_MetaData *md); | 469 | GNUNET_CONTAINER_MetaData *md); |
465 | 470 | ||
@@ -472,11 +477,8 @@ GNUNET_CONTAINER_meta_data_get_serialized_size (const struct | |||
472 | * @return MD on success, NULL on error (i.e. | 477 | * @return MD on success, NULL on error (i.e. |
473 | * bad format) | 478 | * bad format) |
474 | */ | 479 | */ |
475 | struct GNUNET_CONTAINER_MetaData *GNUNET_CONTAINER_meta_data_deserialize (const | 480 | struct GNUNET_CONTAINER_MetaData * |
476 | char | 481 | GNUNET_CONTAINER_meta_data_deserialize (const char *input, size_t size); |
477 | *input, | ||
478 | size_t | ||
479 | size); | ||
480 | 482 | ||
481 | 483 | ||
482 | /* ******************************* HashMap **************************** */ | 484 | /* ******************************* HashMap **************************** */ |
@@ -541,8 +543,8 @@ typedef int (*GNUNET_CONTAINER_HashMapIterator) (void *cls, | |||
541 | * @param len initial size (map will grow as needed) | 543 | * @param len initial size (map will grow as needed) |
542 | * @return NULL on error | 544 | * @return NULL on error |
543 | */ | 545 | */ |
544 | struct GNUNET_CONTAINER_MultiHashMap | 546 | struct GNUNET_CONTAINER_MultiHashMap * |
545 | *GNUNET_CONTAINER_multihashmap_create (unsigned int len); | 547 | GNUNET_CONTAINER_multihashmap_create (unsigned int len); |
546 | 548 | ||
547 | 549 | ||
548 | /** | 550 | /** |
@@ -551,8 +553,9 @@ struct GNUNET_CONTAINER_MultiHashMap | |||
551 | * | 553 | * |
552 | * @param map the map | 554 | * @param map the map |
553 | */ | 555 | */ |
554 | void GNUNET_CONTAINER_multihashmap_destroy (struct GNUNET_CONTAINER_MultiHashMap | 556 | void |
555 | *map); | 557 | GNUNET_CONTAINER_multihashmap_destroy (struct GNUNET_CONTAINER_MultiHashMap |
558 | *map); | ||
556 | 559 | ||
557 | 560 | ||
558 | /** | 561 | /** |
@@ -565,9 +568,9 @@ void GNUNET_CONTAINER_multihashmap_destroy (struct GNUNET_CONTAINER_MultiHashMap | |||
565 | * happen to be NULL; use "contains" to test for | 568 | * happen to be NULL; use "contains" to test for |
566 | * key-value pairs with value NULL | 569 | * key-value pairs with value NULL |
567 | */ | 570 | */ |
568 | void *GNUNET_CONTAINER_multihashmap_get (const struct | 571 | void * |
569 | GNUNET_CONTAINER_MultiHashMap *map, | 572 | GNUNET_CONTAINER_multihashmap_get (const struct GNUNET_CONTAINER_MultiHashMap |
570 | const GNUNET_HashCode * key); | 573 | *map, const GNUNET_HashCode * key); |
571 | 574 | ||
572 | 575 | ||
573 | /** | 576 | /** |
@@ -581,9 +584,9 @@ void *GNUNET_CONTAINER_multihashmap_get (const struct | |||
581 | * @return GNUNET_YES on success, GNUNET_NO if the key-value pair | 584 | * @return GNUNET_YES on success, GNUNET_NO if the key-value pair |
582 | * is not in the map | 585 | * is not in the map |
583 | */ | 586 | */ |
584 | int GNUNET_CONTAINER_multihashmap_remove (struct GNUNET_CONTAINER_MultiHashMap | 587 | int |
585 | *map, const GNUNET_HashCode * key, | 588 | GNUNET_CONTAINER_multihashmap_remove (struct GNUNET_CONTAINER_MultiHashMap *map, |
586 | void *value); | 589 | const GNUNET_HashCode * key, void *value); |
587 | 590 | ||
588 | /** | 591 | /** |
589 | * Remove all entries for the given key from the map. | 592 | * Remove all entries for the given key from the map. |
@@ -593,10 +596,9 @@ int GNUNET_CONTAINER_multihashmap_remove (struct GNUNET_CONTAINER_MultiHashMap | |||
593 | * @param key identifies values to be removed | 596 | * @param key identifies values to be removed |
594 | * @return number of values removed | 597 | * @return number of values removed |
595 | */ | 598 | */ |
596 | int GNUNET_CONTAINER_multihashmap_remove_all (struct | 599 | int |
597 | GNUNET_CONTAINER_MultiHashMap | 600 | GNUNET_CONTAINER_multihashmap_remove_all (struct GNUNET_CONTAINER_MultiHashMap |
598 | *map, | 601 | *map, const GNUNET_HashCode * key); |
599 | const GNUNET_HashCode * key); | ||
600 | 602 | ||
601 | 603 | ||
602 | /** | 604 | /** |
@@ -608,9 +610,10 @@ int GNUNET_CONTAINER_multihashmap_remove_all (struct | |||
608 | * @return GNUNET_YES if such a value exists, | 610 | * @return GNUNET_YES if such a value exists, |
609 | * GNUNET_NO if not | 611 | * GNUNET_NO if not |
610 | */ | 612 | */ |
611 | int GNUNET_CONTAINER_multihashmap_contains (const struct | 613 | int |
612 | GNUNET_CONTAINER_MultiHashMap *map, | 614 | GNUNET_CONTAINER_multihashmap_contains (const struct |
613 | const GNUNET_HashCode * key); | 615 | GNUNET_CONTAINER_MultiHashMap *map, |
616 | const GNUNET_HashCode * key); | ||
614 | 617 | ||
615 | 618 | ||
616 | /** | 619 | /** |
@@ -623,11 +626,11 @@ int GNUNET_CONTAINER_multihashmap_contains (const struct | |||
623 | * @return GNUNET_YES if such a value exists, | 626 | * @return GNUNET_YES if such a value exists, |
624 | * GNUNET_NO if not | 627 | * GNUNET_NO if not |
625 | */ | 628 | */ |
626 | int GNUNET_CONTAINER_multihashmap_contains_value (const struct | 629 | int |
627 | GNUNET_CONTAINER_MultiHashMap | 630 | GNUNET_CONTAINER_multihashmap_contains_value (const struct |
628 | *map, | 631 | GNUNET_CONTAINER_MultiHashMap |
629 | const GNUNET_HashCode * key, | 632 | *map, const GNUNET_HashCode * key, |
630 | const void *value); | 633 | const void *value); |
631 | 634 | ||
632 | 635 | ||
633 | /** | 636 | /** |
@@ -642,11 +645,11 @@ int GNUNET_CONTAINER_multihashmap_contains_value (const struct | |||
642 | * GNUNET_SYSERR if UNIQUE_ONLY was the option and the | 645 | * GNUNET_SYSERR if UNIQUE_ONLY was the option and the |
643 | * value already exists | 646 | * value already exists |
644 | */ | 647 | */ |
645 | int GNUNET_CONTAINER_multihashmap_put (struct GNUNET_CONTAINER_MultiHashMap | 648 | int |
646 | *map, const GNUNET_HashCode * key, | 649 | GNUNET_CONTAINER_multihashmap_put (struct GNUNET_CONTAINER_MultiHashMap *map, |
647 | void *value, | 650 | const GNUNET_HashCode * key, void *value, |
648 | enum GNUNET_CONTAINER_MultiHashMapOption | 651 | enum GNUNET_CONTAINER_MultiHashMapOption |
649 | opt); | 652 | opt); |
650 | 653 | ||
651 | /** | 654 | /** |
652 | * Get the number of key-value pairs in the map. | 655 | * Get the number of key-value pairs in the map. |
@@ -654,9 +657,9 @@ int GNUNET_CONTAINER_multihashmap_put (struct GNUNET_CONTAINER_MultiHashMap | |||
654 | * @param map the map | 657 | * @param map the map |
655 | * @return the number of key value pairs | 658 | * @return the number of key value pairs |
656 | */ | 659 | */ |
657 | unsigned int GNUNET_CONTAINER_multihashmap_size (const struct | 660 | unsigned int |
658 | GNUNET_CONTAINER_MultiHashMap | 661 | GNUNET_CONTAINER_multihashmap_size (const struct GNUNET_CONTAINER_MultiHashMap |
659 | *map); | 662 | *map); |
660 | 663 | ||
661 | 664 | ||
662 | /** | 665 | /** |
@@ -668,10 +671,11 @@ unsigned int GNUNET_CONTAINER_multihashmap_size (const struct | |||
668 | * @return the number of key value pairs processed, | 671 | * @return the number of key value pairs processed, |
669 | * GNUNET_SYSERR if it aborted iteration | 672 | * GNUNET_SYSERR if it aborted iteration |
670 | */ | 673 | */ |
671 | int GNUNET_CONTAINER_multihashmap_iterate (const struct | 674 | int |
672 | GNUNET_CONTAINER_MultiHashMap *map, | 675 | GNUNET_CONTAINER_multihashmap_iterate (const struct |
673 | GNUNET_CONTAINER_HashMapIterator it, | 676 | GNUNET_CONTAINER_MultiHashMap *map, |
674 | void *it_cls); | 677 | GNUNET_CONTAINER_HashMapIterator it, |
678 | void *it_cls); | ||
675 | 679 | ||
676 | 680 | ||
677 | /** | 681 | /** |
@@ -684,12 +688,12 @@ int GNUNET_CONTAINER_multihashmap_iterate (const struct | |||
684 | * @return the number of key value pairs processed, | 688 | * @return the number of key value pairs processed, |
685 | * GNUNET_SYSERR if it aborted iteration | 689 | * GNUNET_SYSERR if it aborted iteration |
686 | */ | 690 | */ |
687 | int GNUNET_CONTAINER_multihashmap_get_multiple (const struct | 691 | int |
688 | GNUNET_CONTAINER_MultiHashMap | 692 | GNUNET_CONTAINER_multihashmap_get_multiple (const struct |
689 | *map, | 693 | GNUNET_CONTAINER_MultiHashMap *map, |
690 | const GNUNET_HashCode * key, | 694 | const GNUNET_HashCode * key, |
691 | GNUNET_CONTAINER_HashMapIterator | 695 | GNUNET_CONTAINER_HashMapIterator it, |
692 | it, void *it_cls); | 696 | void *it_cls); |
693 | 697 | ||
694 | 698 | ||
695 | /* ******************** doubly-linked list *************** */ | 699 | /* ******************** doubly-linked list *************** */ |
@@ -864,9 +868,8 @@ struct GNUNET_CONTAINER_HeapNode; | |||
864 | * @param order how should the heap be sorted? | 868 | * @param order how should the heap be sorted? |
865 | * @return handle to the heap | 869 | * @return handle to the heap |
866 | */ | 870 | */ |
867 | struct GNUNET_CONTAINER_Heap *GNUNET_CONTAINER_heap_create (enum | 871 | struct GNUNET_CONTAINER_Heap * |
868 | GNUNET_CONTAINER_HeapOrder | 872 | GNUNET_CONTAINER_heap_create (enum GNUNET_CONTAINER_HeapOrder order); |
869 | order); | ||
870 | 873 | ||
871 | 874 | ||
872 | /** | 875 | /** |
@@ -875,7 +878,8 @@ struct GNUNET_CONTAINER_Heap *GNUNET_CONTAINER_heap_create (enum | |||
875 | * | 878 | * |
876 | * @param heap heap to destroy | 879 | * @param heap heap to destroy |
877 | */ | 880 | */ |
878 | void GNUNET_CONTAINER_heap_destroy (struct GNUNET_CONTAINER_Heap *heap); | 881 | void |
882 | GNUNET_CONTAINER_heap_destroy (struct GNUNET_CONTAINER_Heap *heap); | ||
879 | 883 | ||
880 | 884 | ||
881 | /** | 885 | /** |
@@ -884,7 +888,8 @@ void GNUNET_CONTAINER_heap_destroy (struct GNUNET_CONTAINER_Heap *heap); | |||
884 | * @param heap heap to inspect | 888 | * @param heap heap to inspect |
885 | * @return NULL if heap is empty | 889 | * @return NULL if heap is empty |
886 | */ | 890 | */ |
887 | void *GNUNET_CONTAINER_heap_peek (const struct GNUNET_CONTAINER_Heap *heap); | 891 | void * |
892 | GNUNET_CONTAINER_heap_peek (const struct GNUNET_CONTAINER_Heap *heap); | ||
888 | 893 | ||
889 | 894 | ||
890 | /** | 895 | /** |
@@ -893,8 +898,8 @@ void *GNUNET_CONTAINER_heap_peek (const struct GNUNET_CONTAINER_Heap *heap); | |||
893 | * @param heap the heap to get the size of | 898 | * @param heap the heap to get the size of |
894 | * @return number of elements stored | 899 | * @return number of elements stored |
895 | */ | 900 | */ |
896 | unsigned int GNUNET_CONTAINER_heap_get_size (const struct GNUNET_CONTAINER_Heap | 901 | unsigned int |
897 | *heap); | 902 | GNUNET_CONTAINER_heap_get_size (const struct GNUNET_CONTAINER_Heap *heap); |
898 | 903 | ||
899 | 904 | ||
900 | /** | 905 | /** |
@@ -903,9 +908,9 @@ unsigned int GNUNET_CONTAINER_heap_get_size (const struct GNUNET_CONTAINER_Heap | |||
903 | * @param node the node to get the cost of | 908 | * @param node the node to get the cost of |
904 | * @return cost of the node | 909 | * @return cost of the node |
905 | */ | 910 | */ |
906 | GNUNET_CONTAINER_HeapCostType GNUNET_CONTAINER_heap_node_get_cost (const struct | 911 | GNUNET_CONTAINER_HeapCostType |
907 | GNUNET_CONTAINER_HeapNode | 912 | GNUNET_CONTAINER_heap_node_get_cost (const struct GNUNET_CONTAINER_HeapNode |
908 | *node); | 913 | *node); |
909 | 914 | ||
910 | /** | 915 | /** |
911 | * Iterator for heap | 916 | * Iterator for heap |
@@ -931,9 +936,10 @@ typedef int (*GNUNET_CONTAINER_HeapIterator) (void *cls, | |||
931 | * @param iterator function to call on each entry | 936 | * @param iterator function to call on each entry |
932 | * @param iterator_cls closure for iterator | 937 | * @param iterator_cls closure for iterator |
933 | */ | 938 | */ |
934 | void GNUNET_CONTAINER_heap_iterate (const struct GNUNET_CONTAINER_Heap *heap, | 939 | void |
935 | GNUNET_CONTAINER_HeapIterator iterator, | 940 | GNUNET_CONTAINER_heap_iterate (const struct GNUNET_CONTAINER_Heap *heap, |
936 | void *iterator_cls); | 941 | GNUNET_CONTAINER_HeapIterator iterator, |
942 | void *iterator_cls); | ||
937 | 943 | ||
938 | 944 | ||
939 | /** | 945 | /** |
@@ -948,8 +954,9 @@ void GNUNET_CONTAINER_heap_iterate (const struct GNUNET_CONTAINER_Heap *heap, | |||
948 | * NULL if the heap is empty. | 954 | * NULL if the heap is empty. |
949 | * | 955 | * |
950 | */ | 956 | */ |
951 | void *GNUNET_CONTAINER_heap_get_random (struct GNUNET_CONTAINER_Heap *heap, | 957 | void * |
952 | uint32_t max); | 958 | GNUNET_CONTAINER_heap_get_random (struct GNUNET_CONTAINER_Heap *heap, |
959 | uint32_t max); | ||
953 | 960 | ||
954 | 961 | ||
955 | /** | 962 | /** |
@@ -963,7 +970,8 @@ void *GNUNET_CONTAINER_heap_get_random (struct GNUNET_CONTAINER_Heap *heap, | |||
963 | * @return data stored at the next random node in the walk; | 970 | * @return data stored at the next random node in the walk; |
964 | * NULL if the tree is empty. | 971 | * NULL if the tree is empty. |
965 | */ | 972 | */ |
966 | void *GNUNET_CONTAINER_heap_walk_get_next (struct GNUNET_CONTAINER_Heap *heap); | 973 | void * |
974 | GNUNET_CONTAINER_heap_walk_get_next (struct GNUNET_CONTAINER_Heap *heap); | ||
967 | 975 | ||
968 | 976 | ||
969 | /** | 977 | /** |
@@ -974,12 +982,9 @@ void *GNUNET_CONTAINER_heap_walk_get_next (struct GNUNET_CONTAINER_Heap *heap); | |||
974 | * @param cost cost for the element | 982 | * @param cost cost for the element |
975 | * @return node for the new element | 983 | * @return node for the new element |
976 | */ | 984 | */ |
977 | struct GNUNET_CONTAINER_HeapNode *GNUNET_CONTAINER_heap_insert (struct | 985 | struct GNUNET_CONTAINER_HeapNode * |
978 | GNUNET_CONTAINER_Heap | 986 | GNUNET_CONTAINER_heap_insert (struct GNUNET_CONTAINER_Heap *heap, void *element, |
979 | *heap, | 987 | GNUNET_CONTAINER_HeapCostType cost); |
980 | void *element, | ||
981 | GNUNET_CONTAINER_HeapCostType | ||
982 | cost); | ||
983 | 988 | ||
984 | 989 | ||
985 | /** | 990 | /** |
@@ -988,7 +993,8 @@ struct GNUNET_CONTAINER_HeapNode *GNUNET_CONTAINER_heap_insert (struct | |||
988 | * @param heap heap to modify | 993 | * @param heap heap to modify |
989 | * @return element data stored at the root node | 994 | * @return element data stored at the root node |
990 | */ | 995 | */ |
991 | void *GNUNET_CONTAINER_heap_remove_root (struct GNUNET_CONTAINER_Heap *heap); | 996 | void * |
997 | GNUNET_CONTAINER_heap_remove_root (struct GNUNET_CONTAINER_Heap *heap); | ||
992 | 998 | ||
993 | 999 | ||
994 | /** | 1000 | /** |
@@ -997,8 +1003,8 @@ void *GNUNET_CONTAINER_heap_remove_root (struct GNUNET_CONTAINER_Heap *heap); | |||
997 | * @param node node to remove | 1003 | * @param node node to remove |
998 | * @return element data stored at the node, NULL if heap is empty | 1004 | * @return element data stored at the node, NULL if heap is empty |
999 | */ | 1005 | */ |
1000 | void *GNUNET_CONTAINER_heap_remove_node (struct GNUNET_CONTAINER_HeapNode | 1006 | void * |
1001 | *node); | 1007 | GNUNET_CONTAINER_heap_remove_node (struct GNUNET_CONTAINER_HeapNode *node); |
1002 | 1008 | ||
1003 | 1009 | ||
1004 | /** | 1010 | /** |
@@ -1008,9 +1014,10 @@ void *GNUNET_CONTAINER_heap_remove_node (struct GNUNET_CONTAINER_HeapNode | |||
1008 | * @param node node for which the cost is to be changed | 1014 | * @param node node for which the cost is to be changed |
1009 | * @param new_cost new cost for the node | 1015 | * @param new_cost new cost for the node |
1010 | */ | 1016 | */ |
1011 | void GNUNET_CONTAINER_heap_update_cost (struct GNUNET_CONTAINER_Heap *heap, | 1017 | void |
1012 | struct GNUNET_CONTAINER_HeapNode *node, | 1018 | GNUNET_CONTAINER_heap_update_cost (struct GNUNET_CONTAINER_Heap *heap, |
1013 | GNUNET_CONTAINER_HeapCostType new_cost); | 1019 | struct GNUNET_CONTAINER_HeapNode *node, |
1020 | GNUNET_CONTAINER_HeapCostType new_cost); | ||
1014 | 1021 | ||
1015 | 1022 | ||
1016 | /* ******************** Singly linked list *************** */ | 1023 | /* ******************** Singly linked list *************** */ |
@@ -1057,9 +1064,10 @@ struct GNUNET_CONTAINER_SList_Iterator; | |||
1057 | * @param buf payload buffer | 1064 | * @param buf payload buffer |
1058 | * @param len length of the buffer | 1065 | * @param len length of the buffer |
1059 | */ | 1066 | */ |
1060 | void GNUNET_CONTAINER_slist_add (struct GNUNET_CONTAINER_SList *l, | 1067 | void |
1061 | enum GNUNET_CONTAINER_SListDisposition disp, | 1068 | GNUNET_CONTAINER_slist_add (struct GNUNET_CONTAINER_SList *l, |
1062 | const void *buf, size_t len); | 1069 | enum GNUNET_CONTAINER_SListDisposition disp, |
1070 | const void *buf, size_t len); | ||
1063 | 1071 | ||
1064 | 1072 | ||
1065 | /** | 1073 | /** |
@@ -1069,9 +1077,10 @@ void GNUNET_CONTAINER_slist_add (struct GNUNET_CONTAINER_SList *l, | |||
1069 | * @param buf payload buffer | 1077 | * @param buf payload buffer |
1070 | * @param len length of the buffer | 1078 | * @param len length of the buffer |
1071 | */ | 1079 | */ |
1072 | void GNUNET_CONTAINER_slist_add_end (struct GNUNET_CONTAINER_SList *l, | 1080 | void |
1073 | enum GNUNET_CONTAINER_SListDisposition | 1081 | GNUNET_CONTAINER_slist_add_end (struct GNUNET_CONTAINER_SList *l, |
1074 | disp, const void *buf, size_t len); | 1082 | enum GNUNET_CONTAINER_SListDisposition disp, |
1083 | const void *buf, size_t len); | ||
1075 | 1084 | ||
1076 | 1085 | ||
1077 | /** | 1086 | /** |
@@ -1079,22 +1088,25 @@ void GNUNET_CONTAINER_slist_add_end (struct GNUNET_CONTAINER_SList *l, | |||
1079 | * @param dst list to append to | 1088 | * @param dst list to append to |
1080 | * @param src source | 1089 | * @param src source |
1081 | */ | 1090 | */ |
1082 | void GNUNET_CONTAINER_slist_append (struct GNUNET_CONTAINER_SList *dst, | 1091 | void |
1083 | struct GNUNET_CONTAINER_SList *src); | 1092 | GNUNET_CONTAINER_slist_append (struct GNUNET_CONTAINER_SList *dst, |
1093 | struct GNUNET_CONTAINER_SList *src); | ||
1084 | 1094 | ||
1085 | 1095 | ||
1086 | /** | 1096 | /** |
1087 | * Create a new singly linked list | 1097 | * Create a new singly linked list |
1088 | * @return the new list | 1098 | * @return the new list |
1089 | */ | 1099 | */ |
1090 | struct GNUNET_CONTAINER_SList *GNUNET_CONTAINER_slist_create (void); | 1100 | struct GNUNET_CONTAINER_SList * |
1101 | GNUNET_CONTAINER_slist_create (void); | ||
1091 | 1102 | ||
1092 | 1103 | ||
1093 | /** | 1104 | /** |
1094 | * Destroy a singly linked list | 1105 | * Destroy a singly linked list |
1095 | * @param l the list to be destroyed | 1106 | * @param l the list to be destroyed |
1096 | */ | 1107 | */ |
1097 | void GNUNET_CONTAINER_slist_destroy (struct GNUNET_CONTAINER_SList *l); | 1108 | void |
1109 | GNUNET_CONTAINER_slist_destroy (struct GNUNET_CONTAINER_SList *l); | ||
1098 | 1110 | ||
1099 | 1111 | ||
1100 | /** | 1112 | /** |
@@ -1103,9 +1115,8 @@ void GNUNET_CONTAINER_slist_destroy (struct GNUNET_CONTAINER_SList *l); | |||
1103 | * @param l list | 1115 | * @param l list |
1104 | * @return iterator pointing to the beginning, free using "GNUNET_free" | 1116 | * @return iterator pointing to the beginning, free using "GNUNET_free" |
1105 | */ | 1117 | */ |
1106 | struct GNUNET_CONTAINER_SList_Iterator *GNUNET_CONTAINER_slist_begin (struct | 1118 | struct GNUNET_CONTAINER_SList_Iterator * |
1107 | GNUNET_CONTAINER_SList | 1119 | GNUNET_CONTAINER_slist_begin (struct GNUNET_CONTAINER_SList *l); |
1108 | *l); | ||
1109 | 1120 | ||
1110 | 1121 | ||
1111 | /** | 1122 | /** |
@@ -1113,7 +1124,8 @@ struct GNUNET_CONTAINER_SList_Iterator *GNUNET_CONTAINER_slist_begin (struct | |||
1113 | * | 1124 | * |
1114 | * @param l list | 1125 | * @param l list |
1115 | */ | 1126 | */ |
1116 | void GNUNET_CONTAINER_slist_clear (struct GNUNET_CONTAINER_SList *l); | 1127 | void |
1128 | GNUNET_CONTAINER_slist_clear (struct GNUNET_CONTAINER_SList *l); | ||
1117 | 1129 | ||
1118 | 1130 | ||
1119 | /** | 1131 | /** |
@@ -1122,8 +1134,9 @@ void GNUNET_CONTAINER_slist_clear (struct GNUNET_CONTAINER_SList *l); | |||
1122 | * @param buf payload buffer to find | 1134 | * @param buf payload buffer to find |
1123 | * @param len length of the payload (number of bytes in buf) | 1135 | * @param len length of the payload (number of bytes in buf) |
1124 | */ | 1136 | */ |
1125 | int GNUNET_CONTAINER_slist_contains (const struct GNUNET_CONTAINER_SList *l, | 1137 | int |
1126 | const void *buf, size_t len); | 1138 | GNUNET_CONTAINER_slist_contains (const struct GNUNET_CONTAINER_SList *l, |
1139 | const void *buf, size_t len); | ||
1127 | 1140 | ||
1128 | 1141 | ||
1129 | /** | 1142 | /** |
@@ -1131,14 +1144,16 @@ int GNUNET_CONTAINER_slist_contains (const struct GNUNET_CONTAINER_SList *l, | |||
1131 | * @param l list | 1144 | * @param l list |
1132 | * @return number of elements in the list | 1145 | * @return number of elements in the list |
1133 | */ | 1146 | */ |
1134 | int GNUNET_CONTAINER_slist_count (const struct GNUNET_CONTAINER_SList *l); | 1147 | int |
1148 | GNUNET_CONTAINER_slist_count (const struct GNUNET_CONTAINER_SList *l); | ||
1135 | 1149 | ||
1136 | 1150 | ||
1137 | /** | 1151 | /** |
1138 | * Remove an element from the list | 1152 | * Remove an element from the list |
1139 | * @param i iterator that points to the element to be removed | 1153 | * @param i iterator that points to the element to be removed |
1140 | */ | 1154 | */ |
1141 | void GNUNET_CONTAINER_slist_erase (struct GNUNET_CONTAINER_SList_Iterator *i); | 1155 | void |
1156 | GNUNET_CONTAINER_slist_erase (struct GNUNET_CONTAINER_SList_Iterator *i); | ||
1142 | 1157 | ||
1143 | 1158 | ||
1144 | /** | 1159 | /** |
@@ -1148,10 +1163,10 @@ void GNUNET_CONTAINER_slist_erase (struct GNUNET_CONTAINER_SList_Iterator *i); | |||
1148 | * @param buf payload buffer | 1163 | * @param buf payload buffer |
1149 | * @param len length of the payload | 1164 | * @param len length of the payload |
1150 | */ | 1165 | */ |
1151 | void GNUNET_CONTAINER_slist_insert (struct GNUNET_CONTAINER_SList_Iterator | 1166 | void |
1152 | *before, | 1167 | GNUNET_CONTAINER_slist_insert (struct GNUNET_CONTAINER_SList_Iterator *before, |
1153 | enum GNUNET_CONTAINER_SListDisposition disp, | 1168 | enum GNUNET_CONTAINER_SListDisposition disp, |
1154 | const void *buf, size_t len); | 1169 | const void *buf, size_t len); |
1155 | 1170 | ||
1156 | 1171 | ||
1157 | /** | 1172 | /** |
@@ -1159,7 +1174,8 @@ void GNUNET_CONTAINER_slist_insert (struct GNUNET_CONTAINER_SList_Iterator | |||
1159 | * @param i iterator | 1174 | * @param i iterator |
1160 | * @return GNUNET_YES on success, GNUNET_NO if the end has been reached | 1175 | * @return GNUNET_YES on success, GNUNET_NO if the end has been reached |
1161 | */ | 1176 | */ |
1162 | int GNUNET_CONTAINER_slist_next (struct GNUNET_CONTAINER_SList_Iterator *i); | 1177 | int |
1178 | GNUNET_CONTAINER_slist_next (struct GNUNET_CONTAINER_SList_Iterator *i); | ||
1163 | 1179 | ||
1164 | 1180 | ||
1165 | /** | 1181 | /** |
@@ -1168,7 +1184,8 @@ int GNUNET_CONTAINER_slist_next (struct GNUNET_CONTAINER_SList_Iterator *i); | |||
1168 | * @return GNUNET_YES if the end has been reached, GNUNET_NO if the iterator | 1184 | * @return GNUNET_YES if the end has been reached, GNUNET_NO if the iterator |
1169 | * points to a valid element | 1185 | * points to a valid element |
1170 | */ | 1186 | */ |
1171 | int GNUNET_CONTAINER_slist_end (struct GNUNET_CONTAINER_SList_Iterator *i); | 1187 | int |
1188 | GNUNET_CONTAINER_slist_end (struct GNUNET_CONTAINER_SList_Iterator *i); | ||
1172 | 1189 | ||
1173 | 1190 | ||
1174 | /** | 1191 | /** |
@@ -1178,16 +1195,17 @@ int GNUNET_CONTAINER_slist_end (struct GNUNET_CONTAINER_SList_Iterator *i); | |||
1178 | * @param len set to the payload length | 1195 | * @param len set to the payload length |
1179 | * @return payload | 1196 | * @return payload |
1180 | */ | 1197 | */ |
1181 | void *GNUNET_CONTAINER_slist_get (const struct GNUNET_CONTAINER_SList_Iterator | 1198 | void * |
1182 | *i, size_t * len); | 1199 | GNUNET_CONTAINER_slist_get (const struct GNUNET_CONTAINER_SList_Iterator *i, |
1200 | size_t * len); | ||
1183 | 1201 | ||
1184 | 1202 | ||
1185 | /** | 1203 | /** |
1186 | * Release an iterator | 1204 | * Release an iterator |
1187 | * @param i iterator | 1205 | * @param i iterator |
1188 | */ | 1206 | */ |
1189 | void GNUNET_CONTAINER_slist_iter_destroy (struct GNUNET_CONTAINER_SList_Iterator | 1207 | void |
1190 | *i); | 1208 | GNUNET_CONTAINER_slist_iter_destroy (struct GNUNET_CONTAINER_SList_Iterator *i); |
1191 | 1209 | ||
1192 | 1210 | ||
1193 | #if 0 /* keep Emacsens' auto-indent happy */ | 1211 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_core_service.h b/src/include/gnunet_core_service.h index 94272a30a..083276804 100644 --- a/src/include/gnunet_core_service.h +++ b/src/include/gnunet_core_service.h | |||
@@ -219,27 +219,18 @@ typedef void (*GNUNET_CORE_StartupCallback) (void *cls, | |||
219 | * @return handle to the core service (only useful for disconnect until 'init' is called), | 219 | * @return handle to the core service (only useful for disconnect until 'init' is called), |
220 | * NULL on error (in this case, init is never called) | 220 | * NULL on error (in this case, init is never called) |
221 | */ | 221 | */ |
222 | struct GNUNET_CORE_Handle *GNUNET_CORE_connect (const struct | 222 | struct GNUNET_CORE_Handle * |
223 | GNUNET_CONFIGURATION_Handle | 223 | GNUNET_CORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, |
224 | *cfg, unsigned int queue_size, | 224 | unsigned int queue_size, void *cls, |
225 | void *cls, | 225 | GNUNET_CORE_StartupCallback init, |
226 | GNUNET_CORE_StartupCallback | 226 | GNUNET_CORE_ConnectEventHandler connects, |
227 | init, | 227 | GNUNET_CORE_DisconnectEventHandler disconnects, |
228 | GNUNET_CORE_ConnectEventHandler | 228 | GNUNET_CORE_PeerStatusEventHandler status_events, |
229 | connects, | 229 | GNUNET_CORE_MessageCallback inbound_notify, |
230 | GNUNET_CORE_DisconnectEventHandler | 230 | int inbound_hdr_only, |
231 | disconnects, | 231 | GNUNET_CORE_MessageCallback outbound_notify, |
232 | GNUNET_CORE_PeerStatusEventHandler | 232 | int outbound_hdr_only, |
233 | status_events, | 233 | const struct GNUNET_CORE_MessageHandler *handlers); |
234 | GNUNET_CORE_MessageCallback | ||
235 | inbound_notify, | ||
236 | int inbound_hdr_only, | ||
237 | GNUNET_CORE_MessageCallback | ||
238 | outbound_notify, | ||
239 | int outbound_hdr_only, | ||
240 | const struct | ||
241 | GNUNET_CORE_MessageHandler | ||
242 | *handlers); | ||
243 | 234 | ||
244 | 235 | ||
245 | /** | 236 | /** |
@@ -249,7 +240,8 @@ struct GNUNET_CORE_Handle *GNUNET_CORE_connect (const struct | |||
249 | * | 240 | * |
250 | * @param handle connection to core to disconnect | 241 | * @param handle connection to core to disconnect |
251 | */ | 242 | */ |
252 | void GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle); | 243 | void |
244 | GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle); | ||
253 | 245 | ||
254 | 246 | ||
255 | /** | 247 | /** |
@@ -290,17 +282,11 @@ typedef void (*GNUNET_CORE_ControlContinuation) (void *cls, int success); | |||
290 | * @param cont_cls closure for cont | 282 | * @param cont_cls closure for cont |
291 | * @return NULL on error (cont will not be called), otherwise handle for cancellation | 283 | * @return NULL on error (cont will not be called), otherwise handle for cancellation |
292 | */ | 284 | */ |
293 | struct GNUNET_CORE_PeerRequestHandle *GNUNET_CORE_peer_request_connect (struct | 285 | struct GNUNET_CORE_PeerRequestHandle * |
294 | GNUNET_CORE_Handle | 286 | GNUNET_CORE_peer_request_connect (struct GNUNET_CORE_Handle *h, |
295 | *h, | 287 | const struct GNUNET_PeerIdentity *peer, |
296 | const | 288 | GNUNET_CORE_ControlContinuation cont, |
297 | struct | 289 | void *cont_cls); |
298 | GNUNET_PeerIdentity | ||
299 | *peer, | ||
300 | GNUNET_CORE_ControlContinuation | ||
301 | cont, | ||
302 | void | ||
303 | *cont_cls); | ||
304 | 290 | ||
305 | 291 | ||
306 | /** | 292 | /** |
@@ -309,9 +295,9 @@ struct GNUNET_CORE_PeerRequestHandle *GNUNET_CORE_peer_request_connect (struct | |||
309 | * | 295 | * |
310 | * @param req request handle that was returned for the original request | 296 | * @param req request handle that was returned for the original request |
311 | */ | 297 | */ |
312 | void GNUNET_CORE_peer_request_connect_cancel (struct | 298 | void |
313 | GNUNET_CORE_PeerRequestHandle | 299 | GNUNET_CORE_peer_request_connect_cancel (struct GNUNET_CORE_PeerRequestHandle |
314 | *req); | 300 | *req); |
315 | 301 | ||
316 | 302 | ||
317 | /** | 303 | /** |
@@ -372,15 +358,14 @@ struct GNUNET_CORE_InformationRequestContext; | |||
372 | * @param info_cls closure for info | 358 | * @param info_cls closure for info |
373 | * @return NULL on error | 359 | * @return NULL on error |
374 | */ | 360 | */ |
375 | struct GNUNET_CORE_InformationRequestContext | 361 | struct GNUNET_CORE_InformationRequestContext * |
376 | *GNUNET_CORE_peer_change_preference (struct GNUNET_CORE_Handle *h, | 362 | GNUNET_CORE_peer_change_preference (struct GNUNET_CORE_Handle *h, |
377 | const struct GNUNET_PeerIdentity *peer, | 363 | const struct GNUNET_PeerIdentity *peer, |
378 | struct GNUNET_TIME_Relative timeout, | 364 | struct GNUNET_TIME_Relative timeout, |
379 | struct GNUNET_BANDWIDTH_Value32NBO | 365 | struct GNUNET_BANDWIDTH_Value32NBO bw_out, |
380 | bw_out, int32_t amount, | 366 | int32_t amount, uint64_t preference, |
381 | uint64_t preference, | 367 | GNUNET_CORE_PeerConfigurationInfoCallback |
382 | GNUNET_CORE_PeerConfigurationInfoCallback | 368 | info, void *info_cls); |
383 | info, void *info_cls); | ||
384 | 369 | ||
385 | 370 | ||
386 | /** | 371 | /** |
@@ -394,9 +379,10 @@ struct GNUNET_CORE_InformationRequestContext | |||
394 | * | 379 | * |
395 | * @param irc context returned by the original GNUNET_CORE_peer_get_info call | 380 | * @param irc context returned by the original GNUNET_CORE_peer_get_info call |
396 | */ | 381 | */ |
397 | void GNUNET_CORE_peer_change_preference_cancel (struct | 382 | void |
398 | GNUNET_CORE_InformationRequestContext | 383 | GNUNET_CORE_peer_change_preference_cancel (struct |
399 | *irc); | 384 | GNUNET_CORE_InformationRequestContext |
385 | *irc); | ||
400 | 386 | ||
401 | 387 | ||
402 | /** | 388 | /** |
@@ -407,9 +393,10 @@ void GNUNET_CORE_peer_change_preference_cancel (struct | |||
407 | * @param cb_cls closure for peer_cb | 393 | * @param cb_cls closure for peer_cb |
408 | * @return GNUNET_OK on success, GNUNET_SYSERR on errors | 394 | * @return GNUNET_OK on success, GNUNET_SYSERR on errors |
409 | */ | 395 | */ |
410 | int GNUNET_CORE_iterate_peers (const struct GNUNET_CONFIGURATION_Handle *cfg, | 396 | int |
411 | GNUNET_CORE_ConnectEventHandler peer_cb, | 397 | GNUNET_CORE_iterate_peers (const struct GNUNET_CONFIGURATION_Handle *cfg, |
412 | void *cb_cls); | 398 | GNUNET_CORE_ConnectEventHandler peer_cb, |
399 | void *cb_cls); | ||
413 | 400 | ||
414 | /** | 401 | /** |
415 | * Iterate over all currently connected peers. | 402 | * Iterate over all currently connected peers. |
@@ -424,10 +411,11 @@ int GNUNET_CORE_iterate_peers (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
424 | * | 411 | * |
425 | * @return GNUNET_OK if iterating, GNUNET_SYSERR on error | 412 | * @return GNUNET_OK if iterating, GNUNET_SYSERR on error |
426 | */ | 413 | */ |
427 | int GNUNET_CORE_is_peer_connected (const struct GNUNET_CONFIGURATION_Handle | 414 | int |
428 | *cfg, struct GNUNET_PeerIdentity *peer, | 415 | GNUNET_CORE_is_peer_connected (const struct GNUNET_CONFIGURATION_Handle *cfg, |
429 | GNUNET_CORE_ConnectEventHandler peer_cb, | 416 | struct GNUNET_PeerIdentity *peer, |
430 | void *cb_cls); | 417 | GNUNET_CORE_ConnectEventHandler peer_cb, |
418 | void *cb_cls); | ||
431 | 419 | ||
432 | 420 | ||
433 | /** | 421 | /** |
@@ -464,25 +452,14 @@ struct GNUNET_CORE_TransmitHandle; | |||
464 | * NULL if we can not even queue the request (insufficient | 452 | * NULL if we can not even queue the request (insufficient |
465 | * memory); if NULL is returned, "notify" will NOT be called. | 453 | * memory); if NULL is returned, "notify" will NOT be called. |
466 | */ | 454 | */ |
467 | struct GNUNET_CORE_TransmitHandle *GNUNET_CORE_notify_transmit_ready (struct | 455 | struct GNUNET_CORE_TransmitHandle * |
468 | GNUNET_CORE_Handle | 456 | GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle, int cork, |
469 | *handle, | 457 | uint32_t priority, |
470 | int cork, | 458 | struct GNUNET_TIME_Relative maxdelay, |
471 | uint32_t | 459 | const struct GNUNET_PeerIdentity *target, |
472 | priority, | 460 | size_t notify_size, |
473 | struct | 461 | GNUNET_CONNECTION_TransmitReadyNotify notify, |
474 | GNUNET_TIME_Relative | 462 | void *notify_cls); |
475 | maxdelay, | ||
476 | const | ||
477 | struct | ||
478 | GNUNET_PeerIdentity | ||
479 | *target, | ||
480 | size_t | ||
481 | notify_size, | ||
482 | GNUNET_CONNECTION_TransmitReadyNotify | ||
483 | notify, | ||
484 | void | ||
485 | *notify_cls); | ||
486 | 463 | ||
487 | 464 | ||
488 | /** | 465 | /** |
@@ -490,8 +467,9 @@ struct GNUNET_CORE_TransmitHandle *GNUNET_CORE_notify_transmit_ready (struct | |||
490 | * | 467 | * |
491 | * @param th handle that was returned by "notify_transmit_ready". | 468 | * @param th handle that was returned by "notify_transmit_ready". |
492 | */ | 469 | */ |
493 | void GNUNET_CORE_notify_transmit_ready_cancel (struct GNUNET_CORE_TransmitHandle | 470 | void |
494 | *th); | 471 | GNUNET_CORE_notify_transmit_ready_cancel (struct GNUNET_CORE_TransmitHandle |
472 | *th); | ||
495 | 473 | ||
496 | 474 | ||
497 | #if 0 /* keep Emacsens' auto-indent happy */ | 475 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index 30a7d9ee0..d5a1685d1 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h | |||
@@ -231,7 +231,8 @@ struct GNUNET_CRYPTO_AuthKey | |||
231 | * @param len the length of the buffer in bytes | 231 | * @param len the length of the buffer in bytes |
232 | * @return the resulting CRC32 checksum | 232 | * @return the resulting CRC32 checksum |
233 | */ | 233 | */ |
234 | int32_t GNUNET_CRYPTO_crc32_n (const void *buf, size_t len); | 234 | int32_t |
235 | GNUNET_CRYPTO_crc32_n (const void *buf, size_t len); | ||
235 | 236 | ||
236 | 237 | ||
237 | /** | 238 | /** |
@@ -241,7 +242,8 @@ int32_t GNUNET_CRYPTO_crc32_n (const void *buf, size_t len); | |||
241 | * @param i the upper limit (exclusive) for the random number | 242 | * @param i the upper limit (exclusive) for the random number |
242 | * @return a random value in the interval [0,i) (exclusive). | 243 | * @return a random value in the interval [0,i) (exclusive). |
243 | */ | 244 | */ |
244 | uint32_t GNUNET_CRYPTO_random_u32 (enum GNUNET_CRYPTO_Quality mode, uint32_t i); | 245 | uint32_t |
246 | GNUNET_CRYPTO_random_u32 (enum GNUNET_CRYPTO_Quality mode, uint32_t i); | ||
245 | 247 | ||
246 | 248 | ||
247 | /** | 249 | /** |
@@ -251,8 +253,8 @@ uint32_t GNUNET_CRYPTO_random_u32 (enum GNUNET_CRYPTO_Quality mode, uint32_t i); | |||
251 | * @param max value returned will be in range [0,max) (exclusive) | 253 | * @param max value returned will be in range [0,max) (exclusive) |
252 | * @return random 64-bit number | 254 | * @return random 64-bit number |
253 | */ | 255 | */ |
254 | uint64_t GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode, | 256 | uint64_t |
255 | uint64_t max); | 257 | GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode, uint64_t max); |
256 | 258 | ||
257 | 259 | ||
258 | /** | 260 | /** |
@@ -262,8 +264,8 @@ uint64_t GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode, | |||
262 | * @param n the size of the array | 264 | * @param n the size of the array |
263 | * @return the permutation array (allocated from heap) | 265 | * @return the permutation array (allocated from heap) |
264 | */ | 266 | */ |
265 | unsigned int *GNUNET_CRYPTO_random_permute (enum GNUNET_CRYPTO_Quality mode, | 267 | unsigned int * |
266 | unsigned int n); | 268 | GNUNET_CRYPTO_random_permute (enum GNUNET_CRYPTO_Quality mode, unsigned int n); |
267 | 269 | ||
268 | 270 | ||
269 | /** | 271 | /** |
@@ -271,8 +273,8 @@ unsigned int *GNUNET_CRYPTO_random_permute (enum GNUNET_CRYPTO_Quality mode, | |||
271 | * | 273 | * |
272 | * @param key key to initialize | 274 | * @param key key to initialize |
273 | */ | 275 | */ |
274 | void GNUNET_CRYPTO_aes_create_session_key (struct GNUNET_CRYPTO_AesSessionKey | 276 | void |
275 | *key); | 277 | GNUNET_CRYPTO_aes_create_session_key (struct GNUNET_CRYPTO_AesSessionKey *key); |
276 | 278 | ||
277 | /** | 279 | /** |
278 | * Check that a new session key is well-formed. | 280 | * Check that a new session key is well-formed. |
@@ -280,8 +282,9 @@ void GNUNET_CRYPTO_aes_create_session_key (struct GNUNET_CRYPTO_AesSessionKey | |||
280 | * @param key key to check | 282 | * @param key key to check |
281 | * @return GNUNET_OK if the key is valid | 283 | * @return GNUNET_OK if the key is valid |
282 | */ | 284 | */ |
283 | int GNUNET_CRYPTO_aes_check_session_key (const struct | 285 | int |
284 | GNUNET_CRYPTO_AesSessionKey *key); | 286 | GNUNET_CRYPTO_aes_check_session_key (const struct GNUNET_CRYPTO_AesSessionKey |
287 | *key); | ||
285 | 288 | ||
286 | 289 | ||
287 | /** | 290 | /** |
@@ -295,12 +298,11 @@ int GNUNET_CRYPTO_aes_check_session_key (const struct | |||
295 | * for streams. | 298 | * for streams. |
296 | * @return the size of the encrypted block, -1 for errors | 299 | * @return the size of the encrypted block, -1 for errors |
297 | */ | 300 | */ |
298 | ssize_t GNUNET_CRYPTO_aes_encrypt (const void *block, size_t len, | 301 | ssize_t |
299 | const struct GNUNET_CRYPTO_AesSessionKey | 302 | GNUNET_CRYPTO_aes_encrypt (const void *block, size_t len, |
300 | *sessionkey, | 303 | const struct GNUNET_CRYPTO_AesSessionKey *sessionkey, |
301 | const struct | 304 | const struct GNUNET_CRYPTO_AesInitializationVector |
302 | GNUNET_CRYPTO_AesInitializationVector *iv, | 305 | *iv, void *result); |
303 | void *result); | ||
304 | 306 | ||
305 | 307 | ||
306 | /** | 308 | /** |
@@ -313,12 +315,11 @@ ssize_t GNUNET_CRYPTO_aes_encrypt (const void *block, size_t len, | |||
313 | * @param result address to store the result at | 315 | * @param result address to store the result at |
314 | * @return -1 on failure, size of decrypted block on success | 316 | * @return -1 on failure, size of decrypted block on success |
315 | */ | 317 | */ |
316 | ssize_t GNUNET_CRYPTO_aes_decrypt (const void *block, size_t size, | 318 | ssize_t |
317 | const struct GNUNET_CRYPTO_AesSessionKey | 319 | GNUNET_CRYPTO_aes_decrypt (const void *block, size_t size, |
318 | *sessionkey, | 320 | const struct GNUNET_CRYPTO_AesSessionKey *sessionkey, |
319 | const struct | 321 | const struct GNUNET_CRYPTO_AesInitializationVector |
320 | GNUNET_CRYPTO_AesInitializationVector *iv, | 322 | *iv, void *result); |
321 | void *result); | ||
322 | 323 | ||
323 | 324 | ||
324 | /** | 325 | /** |
@@ -329,11 +330,10 @@ ssize_t GNUNET_CRYPTO_aes_decrypt (const void *block, size_t size, | |||
329 | * @param salt_len size of the salt | 330 | * @param salt_len size of the salt |
330 | * @param ... pairs of void * & size_t for context chunks, terminated by NULL | 331 | * @param ... pairs of void * & size_t for context chunks, terminated by NULL |
331 | */ | 332 | */ |
332 | void GNUNET_CRYPTO_aes_derive_iv (struct GNUNET_CRYPTO_AesInitializationVector | 333 | void |
333 | *iv, | 334 | GNUNET_CRYPTO_aes_derive_iv (struct GNUNET_CRYPTO_AesInitializationVector *iv, |
334 | const struct GNUNET_CRYPTO_AesSessionKey | 335 | const struct GNUNET_CRYPTO_AesSessionKey *skey, |
335 | *skey, const void *salt, size_t salt_len, | 336 | const void *salt, size_t salt_len, ...); |
336 | ...); | ||
337 | 337 | ||
338 | 338 | ||
339 | /** | 339 | /** |
@@ -344,11 +344,10 @@ void GNUNET_CRYPTO_aes_derive_iv (struct GNUNET_CRYPTO_AesInitializationVector | |||
344 | * @param salt_len size of the salt | 344 | * @param salt_len size of the salt |
345 | * @param argp pairs of void * & size_t for context chunks, terminated by NULL | 345 | * @param argp pairs of void * & size_t for context chunks, terminated by NULL |
346 | */ | 346 | */ |
347 | void GNUNET_CRYPTO_aes_derive_iv_v (struct GNUNET_CRYPTO_AesInitializationVector | 347 | void |
348 | *iv, | 348 | GNUNET_CRYPTO_aes_derive_iv_v (struct GNUNET_CRYPTO_AesInitializationVector *iv, |
349 | const struct GNUNET_CRYPTO_AesSessionKey | 349 | const struct GNUNET_CRYPTO_AesSessionKey *skey, |
350 | *skey, const void *salt, size_t salt_len, | 350 | const void *salt, size_t salt_len, va_list argp); |
351 | va_list argp); | ||
352 | 351 | ||
353 | 352 | ||
354 | /** | 353 | /** |
@@ -357,8 +356,9 @@ void GNUNET_CRYPTO_aes_derive_iv_v (struct GNUNET_CRYPTO_AesInitializationVector | |||
357 | * @param result where to store the encoding (struct GNUNET_CRYPTO_HashAsciiEncoded can be | 356 | * @param result where to store the encoding (struct GNUNET_CRYPTO_HashAsciiEncoded can be |
358 | * safely cast to char*, a '\\0' termination is set). | 357 | * safely cast to char*, a '\\0' termination is set). |
359 | */ | 358 | */ |
360 | void GNUNET_CRYPTO_hash_to_enc (const GNUNET_HashCode * block, | 359 | void |
361 | struct GNUNET_CRYPTO_HashAsciiEncoded *result); | 360 | GNUNET_CRYPTO_hash_to_enc (const GNUNET_HashCode * block, |
361 | struct GNUNET_CRYPTO_HashAsciiEncoded *result); | ||
362 | 362 | ||
363 | 363 | ||
364 | /** | 364 | /** |
@@ -367,7 +367,8 @@ void GNUNET_CRYPTO_hash_to_enc (const GNUNET_HashCode * block, | |||
367 | * @param result where to store the GNUNET_CRYPTO_hash code | 367 | * @param result where to store the GNUNET_CRYPTO_hash code |
368 | * @return GNUNET_OK on success, GNUNET_SYSERR if result has the wrong encoding | 368 | * @return GNUNET_OK on success, GNUNET_SYSERR if result has the wrong encoding |
369 | */ | 369 | */ |
370 | int GNUNET_CRYPTO_hash_from_string (const char *enc, GNUNET_HashCode * result); | 370 | int |
371 | GNUNET_CRYPTO_hash_from_string (const char *enc, GNUNET_HashCode * result); | ||
371 | 372 | ||
372 | 373 | ||
373 | /** | 374 | /** |
@@ -381,8 +382,9 @@ int GNUNET_CRYPTO_hash_from_string (const char *enc, GNUNET_HashCode * result); | |||
381 | * @param b some hash code | 382 | * @param b some hash code |
382 | * @return number between 0 and UINT32_MAX | 383 | * @return number between 0 and UINT32_MAX |
383 | */ | 384 | */ |
384 | uint32_t GNUNET_CRYPTO_hash_distance_u32 (const GNUNET_HashCode * a, | 385 | uint32_t |
385 | const GNUNET_HashCode * b); | 386 | GNUNET_CRYPTO_hash_distance_u32 (const GNUNET_HashCode * a, |
387 | const GNUNET_HashCode * b); | ||
386 | 388 | ||
387 | 389 | ||
388 | /** | 390 | /** |
@@ -392,7 +394,8 @@ uint32_t GNUNET_CRYPTO_hash_distance_u32 (const GNUNET_HashCode * a, | |||
392 | * @param size size of the block | 394 | * @param size size of the block |
393 | * @param ret pointer to where to write the hashcode | 395 | * @param ret pointer to where to write the hashcode |
394 | */ | 396 | */ |
395 | void GNUNET_CRYPTO_hash (const void *block, size_t size, GNUNET_HashCode * ret); | 397 | void |
398 | GNUNET_CRYPTO_hash (const void *block, size_t size, GNUNET_HashCode * ret); | ||
396 | 399 | ||
397 | 400 | ||
398 | /** | 401 | /** |
@@ -403,9 +406,10 @@ void GNUNET_CRYPTO_hash (const void *block, size_t size, GNUNET_HashCode * ret); | |||
403 | * @param plaintext_len length of plaintext | 406 | * @param plaintext_len length of plaintext |
404 | * @param hmac where to store the hmac | 407 | * @param hmac where to store the hmac |
405 | */ | 408 | */ |
406 | void GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key, | 409 | void |
407 | const void *plaintext, size_t plaintext_len, | 410 | GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key, |
408 | GNUNET_HashCode * hmac); | 411 | const void *plaintext, size_t plaintext_len, |
412 | GNUNET_HashCode * hmac); | ||
409 | 413 | ||
410 | 414 | ||
411 | /** | 415 | /** |
@@ -435,16 +439,11 @@ struct GNUNET_CRYPTO_FileHashContext; | |||
435 | * @param callback_cls closure for callback | 439 | * @param callback_cls closure for callback |
436 | * @return NULL on (immediate) errror | 440 | * @return NULL on (immediate) errror |
437 | */ | 441 | */ |
438 | struct GNUNET_CRYPTO_FileHashContext *GNUNET_CRYPTO_hash_file (enum | 442 | struct GNUNET_CRYPTO_FileHashContext * |
439 | GNUNET_SCHEDULER_Priority | 443 | GNUNET_CRYPTO_hash_file (enum GNUNET_SCHEDULER_Priority priority, |
440 | priority, | 444 | const char *filename, size_t blocksize, |
441 | const char | 445 | GNUNET_CRYPTO_HashCompletedCallback callback, |
442 | *filename, | 446 | void *callback_cls); |
443 | size_t blocksize, | ||
444 | GNUNET_CRYPTO_HashCompletedCallback | ||
445 | callback, | ||
446 | void | ||
447 | *callback_cls); | ||
448 | 447 | ||
449 | 448 | ||
450 | /** | 449 | /** |
@@ -452,7 +451,8 @@ struct GNUNET_CRYPTO_FileHashContext *GNUNET_CRYPTO_hash_file (enum | |||
452 | * | 451 | * |
453 | * @param fhc operation to cancel (callback must not yet have been invoked) | 452 | * @param fhc operation to cancel (callback must not yet have been invoked) |
454 | */ | 453 | */ |
455 | void GNUNET_CRYPTO_hash_file_cancel (struct GNUNET_CRYPTO_FileHashContext *fhc); | 454 | void |
455 | GNUNET_CRYPTO_hash_file_cancel (struct GNUNET_CRYPTO_FileHashContext *fhc); | ||
456 | 456 | ||
457 | 457 | ||
458 | /** | 458 | /** |
@@ -461,8 +461,9 @@ void GNUNET_CRYPTO_hash_file_cancel (struct GNUNET_CRYPTO_FileHashContext *fhc); | |||
461 | * @param mode desired quality level | 461 | * @param mode desired quality level |
462 | * @param result hash code that is randomized | 462 | * @param result hash code that is randomized |
463 | */ | 463 | */ |
464 | void GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode, | 464 | void |
465 | GNUNET_HashCode * result); | 465 | GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode, |
466 | GNUNET_HashCode * result); | ||
466 | 467 | ||
467 | 468 | ||
468 | /** | 469 | /** |
@@ -472,9 +473,10 @@ void GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode, | |||
472 | * @param b some hash code | 473 | * @param b some hash code |
473 | * @param result set to b - a | 474 | * @param result set to b - a |
474 | */ | 475 | */ |
475 | void GNUNET_CRYPTO_hash_difference (const GNUNET_HashCode * a, | 476 | void |
476 | const GNUNET_HashCode * b, | 477 | GNUNET_CRYPTO_hash_difference (const GNUNET_HashCode * a, |
477 | GNUNET_HashCode * result); | 478 | const GNUNET_HashCode * b, |
479 | GNUNET_HashCode * result); | ||
478 | 480 | ||
479 | 481 | ||
480 | /** | 482 | /** |
@@ -484,9 +486,10 @@ void GNUNET_CRYPTO_hash_difference (const GNUNET_HashCode * a, | |||
484 | * @param delta some hash code | 486 | * @param delta some hash code |
485 | * @param result set to a + delta | 487 | * @param result set to a + delta |
486 | */ | 488 | */ |
487 | void GNUNET_CRYPTO_hash_sum (const GNUNET_HashCode * a, | 489 | void |
488 | const GNUNET_HashCode * delta, | 490 | GNUNET_CRYPTO_hash_sum (const GNUNET_HashCode * a, |
489 | GNUNET_HashCode * result); | 491 | const GNUNET_HashCode * delta, |
492 | GNUNET_HashCode * result); | ||
490 | 493 | ||
491 | 494 | ||
492 | /** | 495 | /** |
@@ -496,9 +499,9 @@ void GNUNET_CRYPTO_hash_sum (const GNUNET_HashCode * a, | |||
496 | * @param b some hash code | 499 | * @param b some hash code |
497 | * @param result set to a ^ b | 500 | * @param result set to a ^ b |
498 | */ | 501 | */ |
499 | void GNUNET_CRYPTO_hash_xor (const GNUNET_HashCode * a, | 502 | void |
500 | const GNUNET_HashCode * b, | 503 | GNUNET_CRYPTO_hash_xor (const GNUNET_HashCode * a, const GNUNET_HashCode * b, |
501 | GNUNET_HashCode * result); | 504 | GNUNET_HashCode * result); |
502 | 505 | ||
503 | 506 | ||
504 | /** | 507 | /** |
@@ -508,10 +511,11 @@ void GNUNET_CRYPTO_hash_xor (const GNUNET_HashCode * a, | |||
508 | * @param skey set to a valid session key | 511 | * @param skey set to a valid session key |
509 | * @param iv set to a valid initialization vector | 512 | * @param iv set to a valid initialization vector |
510 | */ | 513 | */ |
511 | void GNUNET_CRYPTO_hash_to_aes_key (const GNUNET_HashCode * hc, | 514 | void |
512 | struct GNUNET_CRYPTO_AesSessionKey *skey, | 515 | GNUNET_CRYPTO_hash_to_aes_key (const GNUNET_HashCode * hc, |
513 | struct GNUNET_CRYPTO_AesInitializationVector | 516 | struct GNUNET_CRYPTO_AesSessionKey *skey, |
514 | *iv); | 517 | struct GNUNET_CRYPTO_AesInitializationVector |
518 | *iv); | ||
515 | 519 | ||
516 | 520 | ||
517 | /** | 521 | /** |
@@ -521,7 +525,8 @@ void GNUNET_CRYPTO_hash_to_aes_key (const GNUNET_HashCode * hc, | |||
521 | * @param bit index into the hashcode, [0...159] | 525 | * @param bit index into the hashcode, [0...159] |
522 | * @return Bit \a bit from hashcode \a code, -1 for invalid index | 526 | * @return Bit \a bit from hashcode \a code, -1 for invalid index |
523 | */ | 527 | */ |
524 | int GNUNET_CRYPTO_hash_get_bit (const GNUNET_HashCode * code, unsigned int bit); | 528 | int |
529 | GNUNET_CRYPTO_hash_get_bit (const GNUNET_HashCode * code, unsigned int bit); | ||
525 | 530 | ||
526 | /** | 531 | /** |
527 | * Determine how many low order bits match in two | 532 | * Determine how many low order bits match in two |
@@ -535,8 +540,9 @@ int GNUNET_CRYPTO_hash_get_bit (const GNUNET_HashCode * code, unsigned int bit); | |||
535 | * | 540 | * |
536 | * @return the number of bits that match | 541 | * @return the number of bits that match |
537 | */ | 542 | */ |
538 | unsigned int GNUNET_CRYPTO_hash_matching_bits (const GNUNET_HashCode * first, | 543 | unsigned int |
539 | const GNUNET_HashCode * second); | 544 | GNUNET_CRYPTO_hash_matching_bits (const GNUNET_HashCode * first, |
545 | const GNUNET_HashCode * second); | ||
540 | 546 | ||
541 | 547 | ||
542 | /** | 548 | /** |
@@ -547,8 +553,8 @@ unsigned int GNUNET_CRYPTO_hash_matching_bits (const GNUNET_HashCode * first, | |||
547 | * @param h2 some hash code | 553 | * @param h2 some hash code |
548 | * @return 1 if h1 > h2, -1 if h1 < h2 and 0 if h1 == h2. | 554 | * @return 1 if h1 > h2, -1 if h1 < h2 and 0 if h1 == h2. |
549 | */ | 555 | */ |
550 | int GNUNET_CRYPTO_hash_cmp (const GNUNET_HashCode * h1, | 556 | int |
551 | const GNUNET_HashCode * h2); | 557 | GNUNET_CRYPTO_hash_cmp (const GNUNET_HashCode * h1, const GNUNET_HashCode * h2); |
552 | 558 | ||
553 | 559 | ||
554 | /** | 560 | /** |
@@ -560,9 +566,10 @@ int GNUNET_CRYPTO_hash_cmp (const GNUNET_HashCode * h1, | |||
560 | * @param target some hash code | 566 | * @param target some hash code |
561 | * @return -1 if h1 is closer, 1 if h2 is closer and 0 if h1==h2. | 567 | * @return -1 if h1 is closer, 1 if h2 is closer and 0 if h1==h2. |
562 | */ | 568 | */ |
563 | int GNUNET_CRYPTO_hash_xorcmp (const GNUNET_HashCode * h1, | 569 | int |
564 | const GNUNET_HashCode * h2, | 570 | GNUNET_CRYPTO_hash_xorcmp (const GNUNET_HashCode * h1, |
565 | const GNUNET_HashCode * target); | 571 | const GNUNET_HashCode * h2, |
572 | const GNUNET_HashCode * target); | ||
566 | 573 | ||
567 | 574 | ||
568 | /** | 575 | /** |
@@ -573,10 +580,11 @@ int GNUNET_CRYPTO_hash_xorcmp (const GNUNET_HashCode * h1, | |||
573 | * @param salt_len size of the salt | 580 | * @param salt_len size of the salt |
574 | * @param argp pair of void * & size_t for context chunks, terminated by NULL | 581 | * @param argp pair of void * & size_t for context chunks, terminated by NULL |
575 | */ | 582 | */ |
576 | void GNUNET_CRYPTO_hmac_derive_key_v (struct GNUNET_CRYPTO_AuthKey *key, | 583 | void |
577 | const struct GNUNET_CRYPTO_AesSessionKey | 584 | GNUNET_CRYPTO_hmac_derive_key_v (struct GNUNET_CRYPTO_AuthKey *key, |
578 | *rkey, const void *salt, size_t salt_len, | 585 | const struct GNUNET_CRYPTO_AesSessionKey *rkey, |
579 | va_list argp); | 586 | const void *salt, size_t salt_len, |
587 | va_list argp); | ||
580 | 588 | ||
581 | 589 | ||
582 | /** | 590 | /** |
@@ -587,10 +595,10 @@ void GNUNET_CRYPTO_hmac_derive_key_v (struct GNUNET_CRYPTO_AuthKey *key, | |||
587 | * @param salt_len size of the salt | 595 | * @param salt_len size of the salt |
588 | * @param ... pair of void * & size_t for context chunks, terminated by NULL | 596 | * @param ... pair of void * & size_t for context chunks, terminated by NULL |
589 | */ | 597 | */ |
590 | void GNUNET_CRYPTO_hmac_derive_key (struct GNUNET_CRYPTO_AuthKey *key, | 598 | void |
591 | const struct GNUNET_CRYPTO_AesSessionKey | 599 | GNUNET_CRYPTO_hmac_derive_key (struct GNUNET_CRYPTO_AuthKey *key, |
592 | *rkey, const void *salt, size_t salt_len, | 600 | const struct GNUNET_CRYPTO_AesSessionKey *rkey, |
593 | ...); | 601 | const void *salt, size_t salt_len, ...); |
594 | 602 | ||
595 | /** | 603 | /** |
596 | * @brief Derive key | 604 | * @brief Derive key |
@@ -604,9 +612,10 @@ void GNUNET_CRYPTO_hmac_derive_key (struct GNUNET_CRYPTO_AuthKey *key, | |||
604 | * @param skm_len length of skm | 612 | * @param skm_len length of skm |
605 | * @return GNUNET_YES on success | 613 | * @return GNUNET_YES on success |
606 | */ | 614 | */ |
607 | int GNUNET_CRYPTO_hkdf (void *result, size_t out_len, int xtr_algo, | 615 | int |
608 | int prf_algo, const void *xts, size_t xts_len, | 616 | GNUNET_CRYPTO_hkdf (void *result, size_t out_len, int xtr_algo, int prf_algo, |
609 | const void *skm, size_t skm_len, ...); | 617 | const void *xts, size_t xts_len, const void *skm, |
618 | size_t skm_len, ...); | ||
610 | 619 | ||
611 | 620 | ||
612 | /** | 621 | /** |
@@ -622,9 +631,10 @@ int GNUNET_CRYPTO_hkdf (void *result, size_t out_len, int xtr_algo, | |||
622 | * @param argp va_list of void * & size_t pairs for context chunks | 631 | * @param argp va_list of void * & size_t pairs for context chunks |
623 | * @return GNUNET_YES on success | 632 | * @return GNUNET_YES on success |
624 | */ | 633 | */ |
625 | int GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len, int xtr_algo, | 634 | int |
626 | int prf_algo, const void *xts, size_t xts_len, | 635 | GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len, int xtr_algo, int prf_algo, |
627 | const void *skm, size_t skm_len, va_list argp); | 636 | const void *xts, size_t xts_len, const void *skm, |
637 | size_t skm_len, va_list argp); | ||
628 | 638 | ||
629 | 639 | ||
630 | /** | 640 | /** |
@@ -638,9 +648,10 @@ int GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len, int xtr_algo, | |||
638 | * @param argp va_list of void * & size_t pairs for context chunks | 648 | * @param argp va_list of void * & size_t pairs for context chunks |
639 | * @return GNUNET_YES on success | 649 | * @return GNUNET_YES on success |
640 | */ | 650 | */ |
641 | int GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts, | 651 | int |
642 | size_t xts_len, const void *skm, size_t skm_len, | 652 | GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts, |
643 | va_list argp); | 653 | size_t xts_len, const void *skm, size_t skm_len, |
654 | va_list argp); | ||
644 | 655 | ||
645 | 656 | ||
646 | /** | 657 | /** |
@@ -654,8 +665,9 @@ int GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts, | |||
654 | * @param ... void * & size_t pairs for context chunks | 665 | * @param ... void * & size_t pairs for context chunks |
655 | * @return GNUNET_YES on success | 666 | * @return GNUNET_YES on success |
656 | */ | 667 | */ |
657 | int GNUNET_CRYPTO_kdf (void *result, size_t out_len, const void *xts, | 668 | int |
658 | size_t xts_len, const void *skm, size_t skm_len, ...); | 669 | GNUNET_CRYPTO_kdf (void *result, size_t out_len, const void *xts, |
670 | size_t xts_len, const void *skm, size_t skm_len, ...); | ||
659 | 671 | ||
660 | 672 | ||
661 | /** | 673 | /** |
@@ -663,7 +675,8 @@ int GNUNET_CRYPTO_kdf (void *result, size_t out_len, const void *xts, | |||
663 | * | 675 | * |
664 | * @return fresh private key | 676 | * @return fresh private key |
665 | */ | 677 | */ |
666 | struct GNUNET_CRYPTO_RsaPrivateKey *GNUNET_CRYPTO_rsa_key_create (void); | 678 | struct GNUNET_CRYPTO_RsaPrivateKey * |
679 | GNUNET_CRYPTO_rsa_key_create (void); | ||
667 | 680 | ||
668 | /** | 681 | /** |
669 | * Decode the private key from the data-format back | 682 | * Decode the private key from the data-format back |
@@ -672,9 +685,8 @@ struct GNUNET_CRYPTO_RsaPrivateKey *GNUNET_CRYPTO_rsa_key_create (void); | |||
672 | * @param buf the buffer where the private key data is stored | 685 | * @param buf the buffer where the private key data is stored |
673 | * @param len the length of the data in 'buffer' | 686 | * @param len the length of the data in 'buffer' |
674 | */ | 687 | */ |
675 | struct GNUNET_CRYPTO_RsaPrivateKey *GNUNET_CRYPTO_rsa_decode_key (const char | 688 | struct GNUNET_CRYPTO_RsaPrivateKey * |
676 | *buf, | 689 | GNUNET_CRYPTO_rsa_decode_key (const char *buf, uint16_t len); |
677 | uint16_t len); | ||
678 | 690 | ||
679 | /** | 691 | /** |
680 | * Create a new private key by reading it from a file. If the | 692 | * Create a new private key by reading it from a file. If the |
@@ -690,8 +702,8 @@ struct GNUNET_CRYPTO_RsaPrivateKey *GNUNET_CRYPTO_rsa_decode_key (const char | |||
690 | * @return new private key, NULL on error (for example, | 702 | * @return new private key, NULL on error (for example, |
691 | * permission denied) | 703 | * permission denied) |
692 | */ | 704 | */ |
693 | struct GNUNET_CRYPTO_RsaPrivateKey | 705 | struct GNUNET_CRYPTO_RsaPrivateKey * |
694 | *GNUNET_CRYPTO_rsa_key_create_from_file (const char *filename); | 706 | GNUNET_CRYPTO_rsa_key_create_from_file (const char *filename); |
695 | 707 | ||
696 | 708 | ||
697 | /** | 709 | /** |
@@ -701,15 +713,16 @@ struct GNUNET_CRYPTO_RsaPrivateKey | |||
701 | * @param hc "random" input to PRNG | 713 | * @param hc "random" input to PRNG |
702 | * @return some private key purely dependent on input | 714 | * @return some private key purely dependent on input |
703 | */ | 715 | */ |
704 | struct GNUNET_CRYPTO_RsaPrivateKey | 716 | struct GNUNET_CRYPTO_RsaPrivateKey * |
705 | *GNUNET_CRYPTO_rsa_key_create_from_hash (const GNUNET_HashCode * hc); | 717 | GNUNET_CRYPTO_rsa_key_create_from_hash (const GNUNET_HashCode * hc); |
706 | 718 | ||
707 | 719 | ||
708 | /** | 720 | /** |
709 | * Free memory occupied by the private key. | 721 | * Free memory occupied by the private key. |
710 | * @param hostkey pointer to the memory to free | 722 | * @param hostkey pointer to the memory to free |
711 | */ | 723 | */ |
712 | void GNUNET_CRYPTO_rsa_key_free (struct GNUNET_CRYPTO_RsaPrivateKey *hostkey); | 724 | void |
725 | GNUNET_CRYPTO_rsa_key_free (struct GNUNET_CRYPTO_RsaPrivateKey *hostkey); | ||
713 | 726 | ||
714 | 727 | ||
715 | /** | 728 | /** |
@@ -718,11 +731,11 @@ void GNUNET_CRYPTO_rsa_key_free (struct GNUNET_CRYPTO_RsaPrivateKey *hostkey); | |||
718 | * @param priv the private key | 731 | * @param priv the private key |
719 | * @param pub where to write the public key | 732 | * @param pub where to write the public key |
720 | */ | 733 | */ |
721 | void GNUNET_CRYPTO_rsa_key_get_public (const struct GNUNET_CRYPTO_RsaPrivateKey | 734 | void |
722 | *priv, | 735 | GNUNET_CRYPTO_rsa_key_get_public (const struct GNUNET_CRYPTO_RsaPrivateKey |
723 | struct | 736 | *priv, |
724 | GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded | 737 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded |
725 | *pub); | 738 | *pub); |
726 | 739 | ||
727 | 740 | ||
728 | /** | 741 | /** |
@@ -735,11 +748,11 @@ void GNUNET_CRYPTO_rsa_key_get_public (const struct GNUNET_CRYPTO_RsaPrivateKey | |||
735 | * @param target where to store the encrypted block | 748 | * @param target where to store the encrypted block |
736 | * @return GNUNET_SYSERR on error, GNUNET_OK if ok | 749 | * @return GNUNET_SYSERR on error, GNUNET_OK if ok |
737 | */ | 750 | */ |
738 | int GNUNET_CRYPTO_rsa_encrypt (const void *block, size_t size, | 751 | int |
739 | const struct | 752 | GNUNET_CRYPTO_rsa_encrypt (const void *block, size_t size, |
740 | GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded | 753 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded |
741 | *publicKey, | 754 | *publicKey, |
742 | struct GNUNET_CRYPTO_RsaEncryptedData *target); | 755 | struct GNUNET_CRYPTO_RsaEncryptedData *target); |
743 | 756 | ||
744 | 757 | ||
745 | /** | 758 | /** |
@@ -751,10 +764,10 @@ int GNUNET_CRYPTO_rsa_encrypt (const void *block, size_t size, | |||
751 | * @param max how many bytes of a result are expected? Must be exact. | 764 | * @param max how many bytes of a result are expected? Must be exact. |
752 | * @return the size of the decrypted block (that is, size) or -1 on error | 765 | * @return the size of the decrypted block (that is, size) or -1 on error |
753 | */ | 766 | */ |
754 | ssize_t GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey | 767 | ssize_t |
755 | *key, | 768 | GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey *key, |
756 | const struct GNUNET_CRYPTO_RsaEncryptedData | 769 | const struct GNUNET_CRYPTO_RsaEncryptedData *block, |
757 | *block, void *result, size_t max); | 770 | void *result, size_t max); |
758 | 771 | ||
759 | 772 | ||
760 | /** | 773 | /** |
@@ -765,9 +778,10 @@ ssize_t GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey | |||
765 | * @param sig where to write the signature | 778 | * @param sig where to write the signature |
766 | * @return GNUNET_SYSERR on error, GNUNET_OK on success | 779 | * @return GNUNET_SYSERR on error, GNUNET_OK on success |
767 | */ | 780 | */ |
768 | int GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *key, | 781 | int |
769 | const struct GNUNET_CRYPTO_RsaSignaturePurpose | 782 | GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *key, |
770 | *purpose, struct GNUNET_CRYPTO_RsaSignature *sig); | 783 | const struct GNUNET_CRYPTO_RsaSignaturePurpose *purpose, |
784 | struct GNUNET_CRYPTO_RsaSignature *sig); | ||
771 | 785 | ||
772 | 786 | ||
773 | /** | 787 | /** |
@@ -780,13 +794,13 @@ int GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *key, | |||
780 | * @param publicKey public key of the signer | 794 | * @param publicKey public key of the signer |
781 | * @return GNUNET_OK if ok, GNUNET_SYSERR if invalid | 795 | * @return GNUNET_OK if ok, GNUNET_SYSERR if invalid |
782 | */ | 796 | */ |
783 | int GNUNET_CRYPTO_rsa_verify (uint32_t purpose, | 797 | int |
784 | const struct GNUNET_CRYPTO_RsaSignaturePurpose | 798 | GNUNET_CRYPTO_rsa_verify (uint32_t purpose, |
785 | *validate, | 799 | const struct GNUNET_CRYPTO_RsaSignaturePurpose |
786 | const struct GNUNET_CRYPTO_RsaSignature *sig, | 800 | *validate, |
787 | const struct | 801 | const struct GNUNET_CRYPTO_RsaSignature *sig, |
788 | GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded | 802 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded |
789 | *publicKey); | 803 | *publicKey); |
790 | 804 | ||
791 | 805 | ||
792 | 806 | ||
@@ -795,7 +809,8 @@ int GNUNET_CRYPTO_rsa_verify (uint32_t purpose, | |||
795 | * where strong entropy gathering is not desired | 809 | * where strong entropy gathering is not desired |
796 | * (for example, for hostkey generation). | 810 | * (for example, for hostkey generation). |
797 | */ | 811 | */ |
798 | void GNUNET_CRYPTO_random_disable_entropy_gathering (void); | 812 | void |
813 | GNUNET_CRYPTO_random_disable_entropy_gathering (void); | ||
799 | 814 | ||
800 | #if 0 /* keep Emacsens' auto-indent happy */ | 815 | #if 0 /* keep Emacsens' auto-indent happy */ |
801 | { | 816 | { |
diff --git a/src/include/gnunet_datacache_lib.h b/src/include/gnunet_datacache_lib.h index 46d22d5ec..84cb4d600 100644 --- a/src/include/gnunet_datacache_lib.h +++ b/src/include/gnunet_datacache_lib.h | |||
@@ -56,10 +56,9 @@ struct GNUNET_DATACACHE_Handle; | |||
56 | * @param section section in the configuration that contains our options | 56 | * @param section section in the configuration that contains our options |
57 | * @return handle to use to access the service | 57 | * @return handle to use to access the service |
58 | */ | 58 | */ |
59 | struct GNUNET_DATACACHE_Handle *GNUNET_DATACACHE_create (const struct | 59 | struct GNUNET_DATACACHE_Handle * |
60 | GNUNET_CONFIGURATION_Handle | 60 | GNUNET_DATACACHE_create (const struct GNUNET_CONFIGURATION_Handle *cfg, |
61 | *cfg, | 61 | const char *section); |
62 | const char *section); | ||
63 | 62 | ||
64 | 63 | ||
65 | /** | 64 | /** |
@@ -67,7 +66,8 @@ struct GNUNET_DATACACHE_Handle *GNUNET_DATACACHE_create (const struct | |||
67 | * | 66 | * |
68 | * @param h handle to the datastore | 67 | * @param h handle to the datastore |
69 | */ | 68 | */ |
70 | void GNUNET_DATACACHE_destroy (struct GNUNET_DATACACHE_Handle *h); | 69 | void |
70 | GNUNET_DATACACHE_destroy (struct GNUNET_DATACACHE_Handle *h); | ||
71 | 71 | ||
72 | 72 | ||
73 | /** | 73 | /** |
@@ -99,10 +99,11 @@ typedef int (*GNUNET_DATACACHE_Iterator) (void *cls, | |||
99 | * @param discard_time when to discard the value in any case | 99 | * @param discard_time when to discard the value in any case |
100 | * @return GNUNET_OK on success, GNUNET_SYSERR on error (full, etc.) | 100 | * @return GNUNET_OK on success, GNUNET_SYSERR on error (full, etc.) |
101 | */ | 101 | */ |
102 | int GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h, | 102 | int |
103 | const GNUNET_HashCode * key, size_t size, | 103 | GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h, |
104 | const char *data, enum GNUNET_BLOCK_Type type, | 104 | const GNUNET_HashCode * key, size_t size, |
105 | struct GNUNET_TIME_Absolute discard_time); | 105 | const char *data, enum GNUNET_BLOCK_Type type, |
106 | struct GNUNET_TIME_Absolute discard_time); | ||
106 | 107 | ||
107 | 108 | ||
108 | /** | 109 | /** |
@@ -116,11 +117,10 @@ int GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h, | |||
116 | * @param iter_cls closure for iter | 117 | * @param iter_cls closure for iter |
117 | * @return the number of results found | 118 | * @return the number of results found |
118 | */ | 119 | */ |
119 | unsigned int GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h, | 120 | unsigned int |
120 | const GNUNET_HashCode * key, | 121 | GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h, |
121 | enum GNUNET_BLOCK_Type type, | 122 | const GNUNET_HashCode * key, enum GNUNET_BLOCK_Type type, |
122 | GNUNET_DATACACHE_Iterator iter, | 123 | GNUNET_DATACACHE_Iterator iter, void *iter_cls); |
123 | void *iter_cls); | ||
124 | 124 | ||
125 | 125 | ||
126 | #if 0 /* keep Emacsens' auto-indent happy */ | 126 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_datastore_service.h b/src/include/gnunet_datastore_service.h index 584537f39..3d2cc35c9 100644 --- a/src/include/gnunet_datastore_service.h +++ b/src/include/gnunet_datastore_service.h | |||
@@ -63,9 +63,8 @@ struct GNUNET_DATASTORE_Handle; | |||
63 | * @param cfg configuration to use | 63 | * @param cfg configuration to use |
64 | * @return handle to use to access the service | 64 | * @return handle to use to access the service |
65 | */ | 65 | */ |
66 | struct GNUNET_DATASTORE_Handle *GNUNET_DATASTORE_connect (const struct | 66 | struct GNUNET_DATASTORE_Handle * |
67 | GNUNET_CONFIGURATION_Handle | 67 | GNUNET_DATASTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); |
68 | *cfg); | ||
69 | 68 | ||
70 | 69 | ||
71 | /** | 70 | /** |
@@ -75,7 +74,8 @@ struct GNUNET_DATASTORE_Handle *GNUNET_DATASTORE_connect (const struct | |||
75 | * @param h handle to the datastore | 74 | * @param h handle to the datastore |
76 | * @param drop set to GNUNET_YES to delete all data in datastore (!) | 75 | * @param drop set to GNUNET_YES to delete all data in datastore (!) |
77 | */ | 76 | */ |
78 | void GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, int drop); | 77 | void |
78 | GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, int drop); | ||
79 | 79 | ||
80 | 80 | ||
81 | /** | 81 | /** |
@@ -112,21 +112,13 @@ typedef void (*GNUNET_DATASTORE_ContinuationWithStatus) (void *cls, | |||
112 | * cancel; note that even if NULL is returned, the callback will be invoked | 112 | * cancel; note that even if NULL is returned, the callback will be invoked |
113 | * (or rather, will already have been invoked) | 113 | * (or rather, will already have been invoked) |
114 | */ | 114 | */ |
115 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_reserve (struct | 115 | struct GNUNET_DATASTORE_QueueEntry * |
116 | GNUNET_DATASTORE_Handle | 116 | GNUNET_DATASTORE_reserve (struct GNUNET_DATASTORE_Handle *h, uint64_t amount, |
117 | *h, | 117 | uint32_t entries, unsigned int queue_priority, |
118 | uint64_t amount, | 118 | unsigned int max_queue_size, |
119 | uint32_t entries, | 119 | struct GNUNET_TIME_Relative timeout, |
120 | unsigned int | 120 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
121 | queue_priority, | 121 | void *cont_cls); |
122 | unsigned int | ||
123 | max_queue_size, | ||
124 | struct | ||
125 | GNUNET_TIME_Relative | ||
126 | timeout, | ||
127 | GNUNET_DATASTORE_ContinuationWithStatus | ||
128 | cont, | ||
129 | void *cont_cls); | ||
130 | 122 | ||
131 | 123 | ||
132 | /** | 124 | /** |
@@ -155,29 +147,17 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_reserve (struct | |||
155 | * cancel; note that even if NULL is returned, the callback will be invoked | 147 | * cancel; note that even if NULL is returned, the callback will be invoked |
156 | * (or rather, will already have been invoked) | 148 | * (or rather, will already have been invoked) |
157 | */ | 149 | */ |
158 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_put (struct | 150 | struct GNUNET_DATASTORE_QueueEntry * |
159 | GNUNET_DATASTORE_Handle | 151 | GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h, uint32_t rid, |
160 | *h, uint32_t rid, | 152 | const GNUNET_HashCode * key, size_t size, |
161 | const GNUNET_HashCode | 153 | const void *data, enum GNUNET_BLOCK_Type type, |
162 | * key, size_t size, | 154 | uint32_t priority, uint32_t anonymity, |
163 | const void *data, | 155 | uint32_t replication, |
164 | enum GNUNET_BLOCK_Type | 156 | struct GNUNET_TIME_Absolute expiration, |
165 | type, | 157 | unsigned int queue_priority, unsigned int max_queue_size, |
166 | uint32_t priority, | 158 | struct GNUNET_TIME_Relative timeout, |
167 | uint32_t anonymity, | 159 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
168 | uint32_t replication, | 160 | void *cont_cls); |
169 | struct | ||
170 | GNUNET_TIME_Absolute | ||
171 | expiration, | ||
172 | unsigned int | ||
173 | queue_priority, | ||
174 | unsigned int | ||
175 | max_queue_size, | ||
176 | struct | ||
177 | GNUNET_TIME_Relative | ||
178 | timeout, | ||
179 | GNUNET_DATASTORE_ContinuationWithStatus | ||
180 | cont, void *cont_cls); | ||
181 | 161 | ||
182 | 162 | ||
183 | /** | 163 | /** |
@@ -201,24 +181,13 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_put (struct | |||
201 | * cancel; note that even if NULL is returned, the callback will be invoked | 181 | * cancel; note that even if NULL is returned, the callback will be invoked |
202 | * (or rather, will already have been invoked) | 182 | * (or rather, will already have been invoked) |
203 | */ | 183 | */ |
204 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_release_reserve (struct | 184 | struct GNUNET_DATASTORE_QueueEntry * |
205 | GNUNET_DATASTORE_Handle | 185 | GNUNET_DATASTORE_release_reserve (struct GNUNET_DATASTORE_Handle *h, |
206 | *h, | 186 | uint32_t rid, unsigned int queue_priority, |
207 | uint32_t | 187 | unsigned int max_queue_size, |
208 | rid, | 188 | struct GNUNET_TIME_Relative timeout, |
209 | unsigned | 189 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
210 | int | 190 | void *cont_cls); |
211 | queue_priority, | ||
212 | unsigned | ||
213 | int | ||
214 | max_queue_size, | ||
215 | struct | ||
216 | GNUNET_TIME_Relative | ||
217 | timeout, | ||
218 | GNUNET_DATASTORE_ContinuationWithStatus | ||
219 | cont, | ||
220 | void | ||
221 | *cont_cls); | ||
222 | 191 | ||
223 | 192 | ||
224 | /** | 193 | /** |
@@ -238,23 +207,15 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_release_reserve (struct | |||
238 | * cancel; note that even if NULL is returned, the callback will be invoked | 207 | * cancel; note that even if NULL is returned, the callback will be invoked |
239 | * (or rather, will already have been invoked) | 208 | * (or rather, will already have been invoked) |
240 | */ | 209 | */ |
241 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_update (struct | 210 | struct GNUNET_DATASTORE_QueueEntry * |
242 | GNUNET_DATASTORE_Handle | 211 | GNUNET_DATASTORE_update (struct GNUNET_DATASTORE_Handle *h, uint64_t uid, |
243 | *h, uint64_t uid, | 212 | uint32_t priority, |
244 | uint32_t priority, | 213 | struct GNUNET_TIME_Absolute expiration, |
245 | struct | 214 | unsigned int queue_priority, |
246 | GNUNET_TIME_Absolute | 215 | unsigned int max_queue_size, |
247 | expiration, | 216 | struct GNUNET_TIME_Relative timeout, |
248 | unsigned int | 217 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
249 | queue_priority, | 218 | void *cont_cls); |
250 | unsigned int | ||
251 | max_queue_size, | ||
252 | struct | ||
253 | GNUNET_TIME_Relative | ||
254 | timeout, | ||
255 | GNUNET_DATASTORE_ContinuationWithStatus | ||
256 | cont, | ||
257 | void *cont_cls); | ||
258 | 219 | ||
259 | 220 | ||
260 | /** | 221 | /** |
@@ -278,23 +239,14 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_update (struct | |||
278 | * cancel; note that even if NULL is returned, the callback will be invoked | 239 | * cancel; note that even if NULL is returned, the callback will be invoked |
279 | * (or rather, will already have been invoked) | 240 | * (or rather, will already have been invoked) |
280 | */ | 241 | */ |
281 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_remove (struct | 242 | struct GNUNET_DATASTORE_QueueEntry * |
282 | GNUNET_DATASTORE_Handle | 243 | GNUNET_DATASTORE_remove (struct GNUNET_DATASTORE_Handle *h, |
283 | *h, | 244 | const GNUNET_HashCode * key, size_t size, |
284 | const | 245 | const void *data, unsigned int queue_priority, |
285 | GNUNET_HashCode * | 246 | unsigned int max_queue_size, |
286 | key, size_t size, | 247 | struct GNUNET_TIME_Relative timeout, |
287 | const void *data, | 248 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
288 | unsigned int | 249 | void *cont_cls); |
289 | queue_priority, | ||
290 | unsigned int | ||
291 | max_queue_size, | ||
292 | struct | ||
293 | GNUNET_TIME_Relative | ||
294 | timeout, | ||
295 | GNUNET_DATASTORE_ContinuationWithStatus | ||
296 | cont, | ||
297 | void *cont_cls); | ||
298 | 250 | ||
299 | 251 | ||
300 | /** | 252 | /** |
@@ -342,26 +294,14 @@ typedef void (*GNUNET_DATASTORE_DatumProcessor) (void *cls, | |||
342 | * @return NULL if the entry was not queued, otherwise a handle that can be used to | 294 | * @return NULL if the entry was not queued, otherwise a handle that can be used to |
343 | * cancel | 295 | * cancel |
344 | */ | 296 | */ |
345 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_key (struct | 297 | struct GNUNET_DATASTORE_QueueEntry * |
346 | GNUNET_DATASTORE_Handle | 298 | GNUNET_DATASTORE_get_key (struct GNUNET_DATASTORE_Handle *h, uint64_t offset, |
347 | *h, | 299 | const GNUNET_HashCode * key, |
348 | uint64_t offset, | 300 | enum GNUNET_BLOCK_Type type, |
349 | const | 301 | unsigned int queue_priority, |
350 | GNUNET_HashCode * | 302 | unsigned int max_queue_size, |
351 | key, | 303 | struct GNUNET_TIME_Relative timeout, |
352 | enum | 304 | GNUNET_DATASTORE_DatumProcessor proc, void *proc_cls); |
353 | GNUNET_BLOCK_Type | ||
354 | type, | ||
355 | unsigned int | ||
356 | queue_priority, | ||
357 | unsigned int | ||
358 | max_queue_size, | ||
359 | struct | ||
360 | GNUNET_TIME_Relative | ||
361 | timeout, | ||
362 | GNUNET_DATASTORE_DatumProcessor | ||
363 | proc, | ||
364 | void *proc_cls); | ||
365 | 305 | ||
366 | 306 | ||
367 | /** | 307 | /** |
@@ -388,27 +328,15 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_key (struct | |||
388 | * @return NULL if the entry was not queued, otherwise a handle that can be used to | 328 | * @return NULL if the entry was not queued, otherwise a handle that can be used to |
389 | * cancel | 329 | * cancel |
390 | */ | 330 | */ |
391 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_zero_anonymity (struct | 331 | struct GNUNET_DATASTORE_QueueEntry * |
392 | GNUNET_DATASTORE_Handle | 332 | GNUNET_DATASTORE_get_zero_anonymity (struct GNUNET_DATASTORE_Handle *h, |
393 | *h, | 333 | uint64_t offset, |
394 | uint64_t | 334 | unsigned int queue_priority, |
395 | offset, | 335 | unsigned int max_queue_size, |
396 | unsigned | 336 | struct GNUNET_TIME_Relative timeout, |
397 | int | 337 | enum GNUNET_BLOCK_Type type, |
398 | queue_priority, | 338 | GNUNET_DATASTORE_DatumProcessor proc, |
399 | unsigned | 339 | void *proc_cls); |
400 | int | ||
401 | max_queue_size, | ||
402 | struct | ||
403 | GNUNET_TIME_Relative | ||
404 | timeout, | ||
405 | enum | ||
406 | GNUNET_BLOCK_Type | ||
407 | type, | ||
408 | GNUNET_DATASTORE_DatumProcessor | ||
409 | proc, | ||
410 | void | ||
411 | *proc_cls); | ||
412 | 340 | ||
413 | 341 | ||
414 | /** | 342 | /** |
@@ -430,22 +358,13 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_zero_anonymity (struct | |||
430 | * @return NULL if the entry was not queued, otherwise a handle that can be used to | 358 | * @return NULL if the entry was not queued, otherwise a handle that can be used to |
431 | * cancel | 359 | * cancel |
432 | */ | 360 | */ |
433 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_for_replication (struct | 361 | struct GNUNET_DATASTORE_QueueEntry * |
434 | GNUNET_DATASTORE_Handle | 362 | GNUNET_DATASTORE_get_for_replication (struct GNUNET_DATASTORE_Handle *h, |
435 | *h, | 363 | unsigned int queue_priority, |
436 | unsigned | 364 | unsigned int max_queue_size, |
437 | int | 365 | struct GNUNET_TIME_Relative timeout, |
438 | queue_priority, | 366 | GNUNET_DATASTORE_DatumProcessor proc, |
439 | unsigned | 367 | void *proc_cls); |
440 | int | ||
441 | max_queue_size, | ||
442 | struct | ||
443 | GNUNET_TIME_Relative | ||
444 | timeout, | ||
445 | GNUNET_DATASTORE_DatumProcessor | ||
446 | proc, | ||
447 | void | ||
448 | *proc_cls); | ||
449 | 368 | ||
450 | 369 | ||
451 | 370 | ||
@@ -455,7 +374,8 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_for_replication (struct | |||
455 | * | 374 | * |
456 | * @param qe operation to cancel | 375 | * @param qe operation to cancel |
457 | */ | 376 | */ |
458 | void GNUNET_DATASTORE_cancel (struct GNUNET_DATASTORE_QueueEntry *qe); | 377 | void |
378 | GNUNET_DATASTORE_cancel (struct GNUNET_DATASTORE_QueueEntry *qe); | ||
459 | 379 | ||
460 | 380 | ||
461 | #if 0 /* keep Emacsens' auto-indent happy */ | 381 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_dht_service.h b/src/include/gnunet_dht_service.h index 46929c366..55038d99a 100644 --- a/src/include/gnunet_dht_service.h +++ b/src/include/gnunet_dht_service.h | |||
@@ -123,9 +123,9 @@ enum GNUNET_DHT_RouteOption | |||
123 | * processing multiple GET/FIND requests in parallel | 123 | * processing multiple GET/FIND requests in parallel |
124 | * @return NULL on error | 124 | * @return NULL on error |
125 | */ | 125 | */ |
126 | struct GNUNET_DHT_Handle *GNUNET_DHT_connect (const struct | 126 | struct GNUNET_DHT_Handle * |
127 | GNUNET_CONFIGURATION_Handle *cfg, | 127 | GNUNET_DHT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, |
128 | unsigned int ht_len); | 128 | unsigned int ht_len); |
129 | 129 | ||
130 | 130 | ||
131 | /** | 131 | /** |
@@ -133,7 +133,8 @@ struct GNUNET_DHT_Handle *GNUNET_DHT_connect (const struct | |||
133 | * | 133 | * |
134 | * @param handle connection to shut down | 134 | * @param handle connection to shut down |
135 | */ | 135 | */ |
136 | void GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *handle); | 136 | void |
137 | GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *handle); | ||
137 | 138 | ||
138 | 139 | ||
139 | /* *************** Standard API: get and put ******************* */ | 140 | /* *************** Standard API: get and put ******************* */ |
@@ -154,14 +155,14 @@ void GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *handle); | |||
154 | * @param cont continuation to call when done (transmitting request to service) | 155 | * @param cont continuation to call when done (transmitting request to service) |
155 | * @param cont_cls closure for cont | 156 | * @param cont_cls closure for cont |
156 | */ | 157 | */ |
157 | void GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, | 158 | void |
158 | const GNUNET_HashCode * key, | 159 | GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, const GNUNET_HashCode * key, |
159 | uint32_t desired_replication_level, | 160 | uint32_t desired_replication_level, |
160 | enum GNUNET_DHT_RouteOption options, | 161 | enum GNUNET_DHT_RouteOption options, |
161 | enum GNUNET_BLOCK_Type type, size_t size, const char *data, | 162 | enum GNUNET_BLOCK_Type type, size_t size, const char *data, |
162 | struct GNUNET_TIME_Absolute exp, | 163 | struct GNUNET_TIME_Absolute exp, |
163 | struct GNUNET_TIME_Relative timeout, | 164 | struct GNUNET_TIME_Relative timeout, GNUNET_SCHEDULER_Task cont, |
164 | GNUNET_SCHEDULER_Task cont, void *cont_cls); | 165 | void *cont_cls); |
165 | 166 | ||
166 | 167 | ||
167 | /** | 168 | /** |
@@ -211,23 +212,16 @@ typedef void (*GNUNET_DHT_GetIterator) (void *cls, | |||
211 | * | 212 | * |
212 | * @return handle to stop the async get | 213 | * @return handle to stop the async get |
213 | */ | 214 | */ |
214 | struct GNUNET_DHT_GetHandle *GNUNET_DHT_get_start (struct GNUNET_DHT_Handle | 215 | struct GNUNET_DHT_GetHandle * |
215 | *handle, | 216 | GNUNET_DHT_get_start (struct GNUNET_DHT_Handle *handle, |
216 | struct GNUNET_TIME_Relative | 217 | struct GNUNET_TIME_Relative timeout, |
217 | timeout, | 218 | enum GNUNET_BLOCK_Type type, const GNUNET_HashCode * key, |
218 | enum GNUNET_BLOCK_Type type, | 219 | uint32_t desired_replication_level, |
219 | const GNUNET_HashCode * key, | 220 | enum GNUNET_DHT_RouteOption options, |
220 | uint32_t | 221 | const struct GNUNET_CONTAINER_BloomFilter *bf, |
221 | desired_replication_level, | 222 | int32_t bf_mutator, const void *xquery, |
222 | enum GNUNET_DHT_RouteOption | 223 | size_t xquery_size, GNUNET_DHT_GetIterator iter, |
223 | options, | 224 | void *iter_cls); |
224 | const struct | ||
225 | GNUNET_CONTAINER_BloomFilter | ||
226 | *bf, int32_t bf_mutator, | ||
227 | const void *xquery, | ||
228 | size_t xquery_size, | ||
229 | GNUNET_DHT_GetIterator iter, | ||
230 | void *iter_cls); | ||
231 | 225 | ||
232 | 226 | ||
233 | /** | 227 | /** |
@@ -238,7 +232,8 @@ struct GNUNET_DHT_GetHandle *GNUNET_DHT_get_start (struct GNUNET_DHT_Handle | |||
238 | * On return get_handle will no longer be valid, caller | 232 | * On return get_handle will no longer be valid, caller |
239 | * must not use again!!! | 233 | * must not use again!!! |
240 | */ | 234 | */ |
241 | void GNUNET_DHT_get_stop (struct GNUNET_DHT_GetHandle *get_handle); | 235 | void |
236 | GNUNET_DHT_get_stop (struct GNUNET_DHT_GetHandle *get_handle); | ||
242 | 237 | ||
243 | 238 | ||
244 | /* ******** Special high-level API for finding peers *********** */ | 239 | /* ******** Special high-level API for finding peers *********** */ |
@@ -267,21 +262,12 @@ typedef void (*GNUNET_DHT_FindPeerProcessor) (void *cls, | |||
267 | * @param proc_cls closure for proc | 262 | * @param proc_cls closure for proc |
268 | * @return handle to stop the async get, NULL on error | 263 | * @return handle to stop the async get, NULL on error |
269 | */ | 264 | */ |
270 | struct GNUNET_DHT_FindPeerHandle *GNUNET_DHT_find_peer_start (struct | 265 | struct GNUNET_DHT_FindPeerHandle * |
271 | GNUNET_DHT_Handle | 266 | GNUNET_DHT_find_peer_start (struct GNUNET_DHT_Handle *handle, |
272 | *handle, | 267 | struct GNUNET_TIME_Relative timeout, |
273 | struct | 268 | const GNUNET_HashCode * key, |
274 | GNUNET_TIME_Relative | 269 | enum GNUNET_DHT_RouteOption options, |
275 | timeout, | 270 | GNUNET_DHT_FindPeerProcessor proc, void *proc_cls); |
276 | const | ||
277 | GNUNET_HashCode * | ||
278 | key, | ||
279 | enum | ||
280 | GNUNET_DHT_RouteOption | ||
281 | options, | ||
282 | GNUNET_DHT_FindPeerProcessor | ||
283 | proc, | ||
284 | void *proc_cls); | ||
285 | 271 | ||
286 | 272 | ||
287 | /** | 273 | /** |
@@ -289,8 +275,8 @@ struct GNUNET_DHT_FindPeerHandle *GNUNET_DHT_find_peer_start (struct | |||
289 | * | 275 | * |
290 | * @param find_peer_handle GET operation to stop. | 276 | * @param find_peer_handle GET operation to stop. |
291 | */ | 277 | */ |
292 | void GNUNET_DHT_find_peer_stop (struct GNUNET_DHT_FindPeerHandle | 278 | void |
293 | *find_peer_handle); | 279 | GNUNET_DHT_find_peer_stop (struct GNUNET_DHT_FindPeerHandle *find_peer_handle); |
294 | 280 | ||
295 | 281 | ||
296 | 282 | ||
@@ -337,25 +323,15 @@ typedef void (*GNUNET_DHT_ReplyProcessor) (void *cls, | |||
337 | * @param cont_cls closure for cont | 323 | * @param cont_cls closure for cont |
338 | * @return handle to stop the request, NULL if the request is "fire and forget" | 324 | * @return handle to stop the request, NULL if the request is "fire and forget" |
339 | */ | 325 | */ |
340 | struct GNUNET_DHT_RouteHandle *GNUNET_DHT_route_start (struct GNUNET_DHT_Handle | 326 | struct GNUNET_DHT_RouteHandle * |
341 | *handle, | 327 | GNUNET_DHT_route_start (struct GNUNET_DHT_Handle *handle, |
342 | const GNUNET_HashCode * | 328 | const GNUNET_HashCode * key, |
343 | key, | 329 | uint32_t desired_replication_level, |
344 | uint32_t | 330 | enum GNUNET_DHT_RouteOption options, |
345 | desired_replication_level, | 331 | const struct GNUNET_MessageHeader *enc, |
346 | enum | 332 | struct GNUNET_TIME_Relative timeout, |
347 | GNUNET_DHT_RouteOption | 333 | GNUNET_DHT_ReplyProcessor iter, void *iter_cls, |
348 | options, | 334 | GNUNET_SCHEDULER_Task cont, void *cont_cls); |
349 | const struct | ||
350 | GNUNET_MessageHeader | ||
351 | *enc, | ||
352 | struct | ||
353 | GNUNET_TIME_Relative | ||
354 | timeout, | ||
355 | GNUNET_DHT_ReplyProcessor | ||
356 | iter, void *iter_cls, | ||
357 | GNUNET_SCHEDULER_Task | ||
358 | cont, void *cont_cls); | ||
359 | 335 | ||
360 | 336 | ||
361 | 337 | ||
@@ -364,7 +340,8 @@ struct GNUNET_DHT_RouteHandle *GNUNET_DHT_route_start (struct GNUNET_DHT_Handle | |||
364 | * | 340 | * |
365 | * @param route_handle operation to stop. | 341 | * @param route_handle operation to stop. |
366 | */ | 342 | */ |
367 | void GNUNET_DHT_route_stop (struct GNUNET_DHT_RouteHandle *route_handle); | 343 | void |
344 | GNUNET_DHT_route_stop (struct GNUNET_DHT_RouteHandle *route_handle); | ||
368 | 345 | ||
369 | 346 | ||
370 | /* ***** Special API for controlling DHT routing maintenance ******* */ | 347 | /* ***** Special API for controlling DHT routing maintenance ******* */ |
@@ -381,8 +358,9 @@ void GNUNET_DHT_route_stop (struct GNUNET_DHT_RouteHandle *route_handle); | |||
381 | * @param cont_cls closure for cont | 358 | * @param cont_cls closure for cont |
382 | * @param handle handle to the DHT service | 359 | * @param handle handle to the DHT service |
383 | */ | 360 | */ |
384 | void GNUNET_DHT_find_peers (struct GNUNET_DHT_Handle *handle, | 361 | void |
385 | GNUNET_SCHEDULER_Task cont, void *cont_cls); | 362 | GNUNET_DHT_find_peers (struct GNUNET_DHT_Handle *handle, |
363 | GNUNET_SCHEDULER_Task cont, void *cont_cls); | ||
386 | 364 | ||
387 | /* ***** Special API for testing robustness with malicious peers ******* */ | 365 | /* ***** Special API for testing robustness with malicious peers ******* */ |
388 | 366 | ||
@@ -402,9 +380,9 @@ void GNUNET_DHT_find_peers (struct GNUNET_DHT_Handle *handle, | |||
402 | * @param cont_cls closure for cont | 380 | * @param cont_cls closure for cont |
403 | * | 381 | * |
404 | */ | 382 | */ |
405 | void GNUNET_DHT_set_malicious_dropper (struct GNUNET_DHT_Handle *handle, | 383 | void |
406 | GNUNET_SCHEDULER_Task cont, | 384 | GNUNET_DHT_set_malicious_dropper (struct GNUNET_DHT_Handle *handle, |
407 | void *cont_cls); | 385 | GNUNET_SCHEDULER_Task cont, void *cont_cls); |
408 | 386 | ||
409 | 387 | ||
410 | /** | 388 | /** |
@@ -416,10 +394,10 @@ void GNUNET_DHT_set_malicious_dropper (struct GNUNET_DHT_Handle *handle, | |||
416 | * @param cont continuation to call when done (transmitting request to service) | 394 | * @param cont continuation to call when done (transmitting request to service) |
417 | * @param cont_cls closure for cont | 395 | * @param cont_cls closure for cont |
418 | */ | 396 | */ |
419 | void GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle, | 397 | void |
420 | struct GNUNET_TIME_Relative frequency, | 398 | GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle, |
421 | GNUNET_SCHEDULER_Task cont, | 399 | struct GNUNET_TIME_Relative frequency, |
422 | void *cont_cls); | 400 | GNUNET_SCHEDULER_Task cont, void *cont_cls); |
423 | 401 | ||
424 | 402 | ||
425 | /** | 403 | /** |
@@ -431,10 +409,10 @@ void GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle, | |||
431 | * @param cont continuation to call when done (transmitting request to service) | 409 | * @param cont continuation to call when done (transmitting request to service) |
432 | * @param cont_cls closure for cont | 410 | * @param cont_cls closure for cont |
433 | */ | 411 | */ |
434 | void GNUNET_DHT_set_malicious_getter (struct GNUNET_DHT_Handle *handle, | 412 | void |
435 | struct GNUNET_TIME_Relative frequency, | 413 | GNUNET_DHT_set_malicious_getter (struct GNUNET_DHT_Handle *handle, |
436 | GNUNET_SCHEDULER_Task cont, | 414 | struct GNUNET_TIME_Relative frequency, |
437 | void *cont_cls); | 415 | GNUNET_SCHEDULER_Task cont, void *cont_cls); |
438 | 416 | ||
439 | 417 | ||
440 | #endif | 418 | #endif |
diff --git a/src/include/gnunet_disk_lib.h b/src/include/gnunet_disk_lib.h index f5fae80c9..abca17370 100644 --- a/src/include/gnunet_disk_lib.h +++ b/src/include/gnunet_disk_lib.h | |||
@@ -262,7 +262,8 @@ enum GNUNET_DISK_PipeEnd | |||
262 | * @param part a file on the partition to check | 262 | * @param part a file on the partition to check |
263 | * @return -1 on errors, otherwise the number of free blocks | 263 | * @return -1 on errors, otherwise the number of free blocks |
264 | */ | 264 | */ |
265 | long GNUNET_DISK_get_blocks_available (const char *part); | 265 | long |
266 | GNUNET_DISK_get_blocks_available (const char *part); | ||
266 | 267 | ||
267 | 268 | ||
268 | /** | 269 | /** |
@@ -271,7 +272,8 @@ long GNUNET_DISK_get_blocks_available (const char *part); | |||
271 | * @param h handle to check | 272 | * @param h handle to check |
272 | * @return GNUNET_YES if invalid, GNUNET_NO if valid | 273 | * @return GNUNET_YES if invalid, GNUNET_NO if valid |
273 | */ | 274 | */ |
274 | int GNUNET_DISK_handle_invalid (const struct GNUNET_DISK_FileHandle *h); | 275 | int |
276 | GNUNET_DISK_handle_invalid (const struct GNUNET_DISK_FileHandle *h); | ||
275 | 277 | ||
276 | 278 | ||
277 | /** | 279 | /** |
@@ -282,7 +284,8 @@ int GNUNET_DISK_handle_invalid (const struct GNUNET_DISK_FileHandle *h); | |||
282 | * @return GNUNET_YES if yes, GNUNET_NO if not a file, GNUNET_SYSERR if something | 284 | * @return GNUNET_YES if yes, GNUNET_NO if not a file, GNUNET_SYSERR if something |
283 | * else (will print an error message in that case, too). | 285 | * else (will print an error message in that case, too). |
284 | */ | 286 | */ |
285 | int GNUNET_DISK_file_test (const char *fil); | 287 | int |
288 | GNUNET_DISK_file_test (const char *fil); | ||
286 | 289 | ||
287 | 290 | ||
288 | /** | 291 | /** |
@@ -292,8 +295,9 @@ int GNUNET_DISK_file_test (const char *fil); | |||
292 | * @param whence specification to which position the offset parameter relates to | 295 | * @param whence specification to which position the offset parameter relates to |
293 | * @return the new position on success, GNUNET_SYSERR otherwise | 296 | * @return the new position on success, GNUNET_SYSERR otherwise |
294 | */ | 297 | */ |
295 | off_t GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, | 298 | off_t |
296 | off_t offset, enum GNUNET_DISK_Seek whence); | 299 | GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, off_t offset, |
300 | enum GNUNET_DISK_Seek whence); | ||
297 | 301 | ||
298 | 302 | ||
299 | /** | 303 | /** |
@@ -308,8 +312,9 @@ off_t GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, | |||
308 | * included? | 312 | * included? |
309 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 313 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
310 | */ | 314 | */ |
311 | int GNUNET_DISK_file_size (const char *filename, uint64_t * size, | 315 | int |
312 | int includeSymLinks); | 316 | GNUNET_DISK_file_size (const char *filename, uint64_t * size, |
317 | int includeSymLinks); | ||
313 | 318 | ||
314 | 319 | ||
315 | /** | 320 | /** |
@@ -327,8 +332,9 @@ int GNUNET_DISK_file_size (const char *filename, uint64_t * size, | |||
327 | * @param ino set to the inode ID | 332 | * @param ino set to the inode ID |
328 | * @return GNUNET_OK on success | 333 | * @return GNUNET_OK on success |
329 | */ | 334 | */ |
330 | int GNUNET_DISK_file_get_identifiers (const char *filename, uint64_t * dev, | 335 | int |
331 | uint64_t * ino); | 336 | GNUNET_DISK_file_get_identifiers (const char *filename, uint64_t * dev, |
337 | uint64_t * ino); | ||
332 | 338 | ||
333 | 339 | ||
334 | /** | 340 | /** |
@@ -342,7 +348,8 @@ int GNUNET_DISK_file_get_identifiers (const char *filename, uint64_t * dev, | |||
342 | * @return NULL on error, otherwise name of fresh | 348 | * @return NULL on error, otherwise name of fresh |
343 | * file on disk in directory for temporary files | 349 | * file on disk in directory for temporary files |
344 | */ | 350 | */ |
345 | char *GNUNET_DISK_mktemp (const char *t); | 351 | char * |
352 | GNUNET_DISK_mktemp (const char *t); | ||
346 | 353 | ||
347 | 354 | ||
348 | /** | 355 | /** |
@@ -357,12 +364,9 @@ char *GNUNET_DISK_mktemp (const char *t); | |||
357 | * call (because of flags) | 364 | * call (because of flags) |
358 | * @return IO handle on success, NULL on error | 365 | * @return IO handle on success, NULL on error |
359 | */ | 366 | */ |
360 | struct GNUNET_DISK_FileHandle *GNUNET_DISK_file_open (const char *fn, | 367 | struct GNUNET_DISK_FileHandle * |
361 | enum GNUNET_DISK_OpenFlags | 368 | GNUNET_DISK_file_open (const char *fn, enum GNUNET_DISK_OpenFlags flags, |
362 | flags, | 369 | enum GNUNET_DISK_AccessPermissions perm); |
363 | enum | ||
364 | GNUNET_DISK_AccessPermissions | ||
365 | perm); | ||
366 | 370 | ||
367 | /** | 371 | /** |
368 | * Creates an interprocess channel | 372 | * Creates an interprocess channel |
@@ -371,8 +375,8 @@ struct GNUNET_DISK_FileHandle *GNUNET_DISK_file_open (const char *fn, | |||
371 | * @param inherit_write 1 to make write handle inheritable, 0 otherwise (NT only) | 375 | * @param inherit_write 1 to make write handle inheritable, 0 otherwise (NT only) |
372 | * @return handle to the new pipe, NULL on error | 376 | * @return handle to the new pipe, NULL on error |
373 | */ | 377 | */ |
374 | struct GNUNET_DISK_PipeHandle *GNUNET_DISK_pipe (int blocking, int inherit_read, | 378 | struct GNUNET_DISK_PipeHandle * |
375 | int inherit_write); | 379 | GNUNET_DISK_pipe (int blocking, int inherit_read, int inherit_write); |
376 | 380 | ||
377 | 381 | ||
378 | /** | 382 | /** |
@@ -380,7 +384,8 @@ struct GNUNET_DISK_PipeHandle *GNUNET_DISK_pipe (int blocking, int inherit_read, | |||
380 | * @param p pipe | 384 | * @param p pipe |
381 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 385 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
382 | */ | 386 | */ |
383 | int GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p); | 387 | int |
388 | GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p); | ||
384 | 389 | ||
385 | /** | 390 | /** |
386 | * Closes one half of an interprocess channel | 391 | * Closes one half of an interprocess channel |
@@ -389,8 +394,9 @@ int GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p); | |||
389 | * @param end which end of the pipe to close | 394 | * @param end which end of the pipe to close |
390 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 395 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
391 | */ | 396 | */ |
392 | int GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, | 397 | int |
393 | enum GNUNET_DISK_PipeEnd end); | 398 | GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, |
399 | enum GNUNET_DISK_PipeEnd end); | ||
394 | 400 | ||
395 | /** | 401 | /** |
396 | * Close an open file. | 402 | * Close an open file. |
@@ -398,7 +404,8 @@ int GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, | |||
398 | * @param h file handle | 404 | * @param h file handle |
399 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 405 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
400 | */ | 406 | */ |
401 | int GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h); | 407 | int |
408 | GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h); | ||
402 | 409 | ||
403 | 410 | ||
404 | /** | 411 | /** |
@@ -408,12 +415,9 @@ int GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h); | |||
408 | * @param n end to access | 415 | * @param n end to access |
409 | * @return handle for the respective end | 416 | * @return handle for the respective end |
410 | */ | 417 | */ |
411 | const struct GNUNET_DISK_FileHandle *GNUNET_DISK_pipe_handle (const struct | 418 | const struct GNUNET_DISK_FileHandle * |
412 | GNUNET_DISK_PipeHandle | 419 | GNUNET_DISK_pipe_handle (const struct GNUNET_DISK_PipeHandle *p, |
413 | *p, | 420 | enum GNUNET_DISK_PipeEnd n); |
414 | enum | ||
415 | GNUNET_DISK_PipeEnd | ||
416 | n); | ||
417 | 421 | ||
418 | /** | 422 | /** |
419 | * Read the contents of a binary file into a buffer. | 423 | * Read the contents of a binary file into a buffer. |
@@ -422,8 +426,9 @@ const struct GNUNET_DISK_FileHandle *GNUNET_DISK_pipe_handle (const struct | |||
422 | * @param len the maximum number of bytes to read | 426 | * @param len the maximum number of bytes to read |
423 | * @return the number of bytes read on success, GNUNET_SYSERR on failure | 427 | * @return the number of bytes read on success, GNUNET_SYSERR on failure |
424 | */ | 428 | */ |
425 | ssize_t GNUNET_DISK_file_read (const struct GNUNET_DISK_FileHandle *h, | 429 | ssize_t |
426 | void *result, size_t len); | 430 | GNUNET_DISK_file_read (const struct GNUNET_DISK_FileHandle *h, void *result, |
431 | size_t len); | ||
427 | 432 | ||
428 | 433 | ||
429 | /** | 434 | /** |
@@ -434,7 +439,8 @@ ssize_t GNUNET_DISK_file_read (const struct GNUNET_DISK_FileHandle *h, | |||
434 | * @param len the maximum number of bytes to read | 439 | * @param len the maximum number of bytes to read |
435 | * @return number of bytes read, GNUNET_SYSERR on failure | 440 | * @return number of bytes read, GNUNET_SYSERR on failure |
436 | */ | 441 | */ |
437 | ssize_t GNUNET_DISK_fn_read (const char *fn, void *result, size_t len); | 442 | ssize_t |
443 | GNUNET_DISK_fn_read (const char *fn, void *result, size_t len); | ||
438 | 444 | ||
439 | 445 | ||
440 | /** | 446 | /** |
@@ -445,8 +451,9 @@ ssize_t GNUNET_DISK_fn_read (const char *fn, void *result, size_t len); | |||
445 | * @param n number of bytes to write | 451 | * @param n number of bytes to write |
446 | * @return number of bytes written on success, GNUNET_SYSERR on error | 452 | * @return number of bytes written on success, GNUNET_SYSERR on error |
447 | */ | 453 | */ |
448 | ssize_t GNUNET_DISK_file_write (const struct GNUNET_DISK_FileHandle *h, | 454 | ssize_t |
449 | const void *buffer, size_t n); | 455 | GNUNET_DISK_file_write (const struct GNUNET_DISK_FileHandle *h, |
456 | const void *buffer, size_t n); | ||
450 | 457 | ||
451 | 458 | ||
452 | /** | 459 | /** |
@@ -459,8 +466,9 @@ ssize_t GNUNET_DISK_file_write (const struct GNUNET_DISK_FileHandle *h, | |||
459 | * @param mode file permissions | 466 | * @param mode file permissions |
460 | * @return number of bytes written on success, GNUNET_SYSERR on error | 467 | * @return number of bytes written on success, GNUNET_SYSERR on error |
461 | */ | 468 | */ |
462 | ssize_t GNUNET_DISK_fn_write (const char *fn, const void *buffer, size_t n, | 469 | ssize_t |
463 | enum GNUNET_DISK_AccessPermissions mode); | 470 | GNUNET_DISK_fn_write (const char *fn, const void *buffer, size_t n, |
471 | enum GNUNET_DISK_AccessPermissions mode); | ||
464 | 472 | ||
465 | 473 | ||
466 | /** | 474 | /** |
@@ -470,7 +478,8 @@ ssize_t GNUNET_DISK_fn_write (const char *fn, const void *buffer, size_t n, | |||
470 | * @param dst destination file name | 478 | * @param dst destination file name |
471 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 479 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
472 | */ | 480 | */ |
473 | int GNUNET_DISK_file_copy (const char *src, const char *dst); | 481 | int |
482 | GNUNET_DISK_file_copy (const char *src, const char *dst); | ||
474 | 483 | ||
475 | 484 | ||
476 | /** | 485 | /** |
@@ -481,9 +490,10 @@ int GNUNET_DISK_file_copy (const char *src, const char *dst); | |||
481 | * @param callback_cls closure for callback | 490 | * @param callback_cls closure for callback |
482 | * @return the number of files found, -1 on error | 491 | * @return the number of files found, -1 on error |
483 | */ | 492 | */ |
484 | int GNUNET_DISK_directory_scan (const char *dirName, | 493 | int |
485 | GNUNET_FileNameCallback callback, | 494 | GNUNET_DISK_directory_scan (const char *dirName, |
486 | void *callback_cls); | 495 | GNUNET_FileNameCallback callback, |
496 | void *callback_cls); | ||
487 | 497 | ||
488 | 498 | ||
489 | /** | 499 | /** |
@@ -521,8 +531,9 @@ typedef void (*GNUNET_DISK_DirectoryIteratorCallback) (void *cls, | |||
521 | * GNUNET_NO if this was the last entry (and iteration is complete), | 531 | * GNUNET_NO if this was the last entry (and iteration is complete), |
522 | * GNUNET_SYSERR if "can" was YES | 532 | * GNUNET_SYSERR if "can" was YES |
523 | */ | 533 | */ |
524 | int GNUNET_DISK_directory_iterator_next (struct GNUNET_DISK_DirectoryIterator | 534 | int |
525 | *iter, int can); | 535 | GNUNET_DISK_directory_iterator_next (struct GNUNET_DISK_DirectoryIterator *iter, |
536 | int can); | ||
526 | 537 | ||
527 | 538 | ||
528 | /** | 539 | /** |
@@ -536,10 +547,11 @@ int GNUNET_DISK_directory_iterator_next (struct GNUNET_DISK_DirectoryIterator | |||
536 | * @param callback the method to call for each file | 547 | * @param callback the method to call for each file |
537 | * @param callback_cls closure for callback | 548 | * @param callback_cls closure for callback |
538 | */ | 549 | */ |
539 | void GNUNET_DISK_directory_iterator_start (enum GNUNET_SCHEDULER_Priority prio, | 550 | void |
540 | const char *dirName, | 551 | GNUNET_DISK_directory_iterator_start (enum GNUNET_SCHEDULER_Priority prio, |
541 | GNUNET_DISK_DirectoryIteratorCallback | 552 | const char *dirName, |
542 | callback, void *callback_cls); | 553 | GNUNET_DISK_DirectoryIteratorCallback |
554 | callback, void *callback_cls); | ||
543 | 555 | ||
544 | 556 | ||
545 | /** | 557 | /** |
@@ -550,7 +562,8 @@ void GNUNET_DISK_directory_iterator_start (enum GNUNET_SCHEDULER_Priority prio, | |||
550 | * @returns GNUNET_OK on success, GNUNET_SYSERR on failure, | 562 | * @returns GNUNET_OK on success, GNUNET_SYSERR on failure, |
551 | * GNUNET_NO if directory exists but is not writeable | 563 | * GNUNET_NO if directory exists but is not writeable |
552 | */ | 564 | */ |
553 | int GNUNET_DISK_directory_create_for_file (const char *filename); | 565 | int |
566 | GNUNET_DISK_directory_create_for_file (const char *filename); | ||
554 | 567 | ||
555 | 568 | ||
556 | /** | 569 | /** |
@@ -563,7 +576,8 @@ int GNUNET_DISK_directory_create_for_file (const char *filename); | |||
563 | * @return GNUNET_YES if yes, GNUNET_NO if does not exist, GNUNET_SYSERR | 576 | * @return GNUNET_YES if yes, GNUNET_NO if does not exist, GNUNET_SYSERR |
564 | * on any error and if exists but not directory | 577 | * on any error and if exists but not directory |
565 | */ | 578 | */ |
566 | int GNUNET_DISK_directory_test (const char *fil); | 579 | int |
580 | GNUNET_DISK_directory_test (const char *fil); | ||
567 | 581 | ||
568 | 582 | ||
569 | /** | 583 | /** |
@@ -573,7 +587,8 @@ int GNUNET_DISK_directory_test (const char *fil); | |||
573 | * @param fileName the file to remove | 587 | * @param fileName the file to remove |
574 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 588 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
575 | */ | 589 | */ |
576 | int GNUNET_DISK_directory_remove (const char *fileName); | 590 | int |
591 | GNUNET_DISK_directory_remove (const char *fileName); | ||
577 | 592 | ||
578 | 593 | ||
579 | /** | 594 | /** |
@@ -582,7 +597,8 @@ int GNUNET_DISK_directory_remove (const char *fileName); | |||
582 | * @param dir the directory to create | 597 | * @param dir the directory to create |
583 | * @returns GNUNET_SYSERR on failure, GNUNET_OK otherwise | 598 | * @returns GNUNET_SYSERR on failure, GNUNET_OK otherwise |
584 | */ | 599 | */ |
585 | int GNUNET_DISK_directory_create (const char *dir); | 600 | int |
601 | GNUNET_DISK_directory_create (const char *dir); | ||
586 | 602 | ||
587 | 603 | ||
588 | /** | 604 | /** |
@@ -594,8 +610,9 @@ int GNUNET_DISK_directory_create (const char *dir); | |||
594 | * @param excl GNUNET_YES for an exclusive lock | 610 | * @param excl GNUNET_YES for an exclusive lock |
595 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 611 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
596 | */ | 612 | */ |
597 | int GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, off_t lockStart, | 613 | int |
598 | off_t lockEnd, int excl); | 614 | GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, off_t lockStart, |
615 | off_t lockEnd, int excl); | ||
599 | 616 | ||
600 | 617 | ||
601 | /** | 618 | /** |
@@ -605,15 +622,17 @@ int GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, off_t lockStart, | |||
605 | * @param unlockEnd absolute position until where to unlock | 622 | * @param unlockEnd absolute position until where to unlock |
606 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 623 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
607 | */ | 624 | */ |
608 | int GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, | 625 | int |
609 | off_t unlockStart, off_t unlockEnd); | 626 | GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, off_t unlockStart, |
627 | off_t unlockEnd); | ||
610 | 628 | ||
611 | 629 | ||
612 | /** | 630 | /** |
613 | * @brief Removes special characters as ':' from a filename. | 631 | * @brief Removes special characters as ':' from a filename. |
614 | * @param fn the filename to canonicalize | 632 | * @param fn the filename to canonicalize |
615 | */ | 633 | */ |
616 | void GNUNET_DISK_filename_canonicalize (char *fn); | 634 | void |
635 | GNUNET_DISK_filename_canonicalize (char *fn); | ||
617 | 636 | ||
618 | 637 | ||
619 | /** | 638 | /** |
@@ -622,7 +641,8 @@ void GNUNET_DISK_filename_canonicalize (char *fn); | |||
622 | * @param user new owner of the file | 641 | * @param user new owner of the file |
623 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 642 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
624 | */ | 643 | */ |
625 | int GNUNET_DISK_file_change_owner (const char *filename, const char *user); | 644 | int |
645 | GNUNET_DISK_file_change_owner (const char *filename, const char *user); | ||
626 | 646 | ||
627 | 647 | ||
628 | /** | 648 | /** |
@@ -639,8 +659,9 @@ int GNUNET_DISK_file_change_owner (const char *filename, const char *user); | |||
639 | * private directory name. | 659 | * private directory name. |
640 | * @return the constructed filename | 660 | * @return the constructed filename |
641 | */ | 661 | */ |
642 | char *GNUNET_DISK_get_home_filename (const struct GNUNET_CONFIGURATION_Handle | 662 | char * |
643 | *cfg, const char *serviceName, ...); | 663 | GNUNET_DISK_get_home_filename (const struct GNUNET_CONFIGURATION_Handle *cfg, |
664 | const char *serviceName, ...); | ||
644 | 665 | ||
645 | 666 | ||
646 | /** | 667 | /** |
@@ -656,9 +677,10 @@ struct GNUNET_DISK_MapHandle; | |||
656 | * @param len size of the mapping | 677 | * @param len size of the mapping |
657 | * @return pointer to the mapped memory region, NULL on failure | 678 | * @return pointer to the mapped memory region, NULL on failure |
658 | */ | 679 | */ |
659 | void *GNUNET_DISK_file_map (const struct GNUNET_DISK_FileHandle *h, | 680 | void * |
660 | struct GNUNET_DISK_MapHandle **m, | 681 | GNUNET_DISK_file_map (const struct GNUNET_DISK_FileHandle *h, |
661 | enum GNUNET_DISK_MapType access, size_t len); | 682 | struct GNUNET_DISK_MapHandle **m, |
683 | enum GNUNET_DISK_MapType access, size_t len); | ||
662 | 684 | ||
663 | /** | 685 | /** |
664 | * Unmap a file | 686 | * Unmap a file |
@@ -666,14 +688,16 @@ void *GNUNET_DISK_file_map (const struct GNUNET_DISK_FileHandle *h, | |||
666 | * @param h mapping handle | 688 | * @param h mapping handle |
667 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 689 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
668 | */ | 690 | */ |
669 | int GNUNET_DISK_file_unmap (struct GNUNET_DISK_MapHandle *h); | 691 | int |
692 | GNUNET_DISK_file_unmap (struct GNUNET_DISK_MapHandle *h); | ||
670 | 693 | ||
671 | /** | 694 | /** |
672 | * Write file changes to disk | 695 | * Write file changes to disk |
673 | * @param h handle to an open file | 696 | * @param h handle to an open file |
674 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 697 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
675 | */ | 698 | */ |
676 | int GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h); | 699 | int |
700 | GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h); | ||
677 | 701 | ||
678 | /** | 702 | /** |
679 | * Creates a named pipe/FIFO and opens it | 703 | * Creates a named pipe/FIFO and opens it |
@@ -682,13 +706,9 @@ int GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h); | |||
682 | * @param perm access permissions | 706 | * @param perm access permissions |
683 | * @return pipe handle on success, NULL on error | 707 | * @return pipe handle on success, NULL on error |
684 | */ | 708 | */ |
685 | struct GNUNET_DISK_FileHandle *GNUNET_DISK_npipe_create (char **fn, | 709 | struct GNUNET_DISK_FileHandle * |
686 | enum | 710 | GNUNET_DISK_npipe_create (char **fn, enum GNUNET_DISK_OpenFlags flags, |
687 | GNUNET_DISK_OpenFlags | 711 | enum GNUNET_DISK_AccessPermissions perm); |
688 | flags, | ||
689 | enum | ||
690 | GNUNET_DISK_AccessPermissions | ||
691 | perm); | ||
692 | 712 | ||
693 | /** | 713 | /** |
694 | * Opens already existing named pipe/FIFO | 714 | * Opens already existing named pipe/FIFO |
@@ -698,20 +718,17 @@ struct GNUNET_DISK_FileHandle *GNUNET_DISK_npipe_create (char **fn, | |||
698 | * @param perm access permissions | 718 | * @param perm access permissions |
699 | * @return pipe handle on success, NULL on error | 719 | * @return pipe handle on success, NULL on error |
700 | */ | 720 | */ |
701 | struct GNUNET_DISK_FileHandle *GNUNET_DISK_npipe_open (const char *fn, | 721 | struct GNUNET_DISK_FileHandle * |
702 | enum | 722 | GNUNET_DISK_npipe_open (const char *fn, enum GNUNET_DISK_OpenFlags flags, |
703 | GNUNET_DISK_OpenFlags | 723 | enum GNUNET_DISK_AccessPermissions perm); |
704 | flags, | ||
705 | enum | ||
706 | GNUNET_DISK_AccessPermissions | ||
707 | perm); | ||
708 | 724 | ||
709 | /** | 725 | /** |
710 | * Closes a named pipe/FIFO | 726 | * Closes a named pipe/FIFO |
711 | * @param pipe named pipe | 727 | * @param pipe named pipe |
712 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 728 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
713 | */ | 729 | */ |
714 | int GNUNET_DISK_npipe_close (struct GNUNET_DISK_FileHandle *pipe); | 730 | int |
731 | GNUNET_DISK_npipe_close (struct GNUNET_DISK_FileHandle *pipe); | ||
715 | 732 | ||
716 | #if 0 /* keep Emacsens' auto-indent happy */ | 733 | #if 0 /* keep Emacsens' auto-indent happy */ |
717 | { | 734 | { |
diff --git a/src/include/gnunet_dv_service.h b/src/include/gnunet_dv_service.h index 2bb2319b9..3454ebc24 100644 --- a/src/include/gnunet_dv_service.h +++ b/src/include/gnunet_dv_service.h | |||
@@ -68,12 +68,13 @@ struct GNUNET_DV_Handle; | |||
68 | * @param cont_cls closure for continuation | 68 | * @param cont_cls closure for continuation |
69 | * | 69 | * |
70 | */ | 70 | */ |
71 | int GNUNET_DV_send (struct GNUNET_DV_Handle *dv_handle, | 71 | int |
72 | const struct GNUNET_PeerIdentity *target, | 72 | GNUNET_DV_send (struct GNUNET_DV_Handle *dv_handle, |
73 | const char *msgbuf, size_t msgbuf_size, | 73 | const struct GNUNET_PeerIdentity *target, const char *msgbuf, |
74 | unsigned int priority, struct GNUNET_TIME_Relative timeout, | 74 | size_t msgbuf_size, unsigned int priority, |
75 | const void *addr, size_t addrlen, | 75 | struct GNUNET_TIME_Relative timeout, const void *addr, |
76 | GNUNET_TRANSPORT_TransmitContinuation cont, void *cont_cls); | 76 | size_t addrlen, GNUNET_TRANSPORT_TransmitContinuation cont, |
77 | void *cont_cls); | ||
77 | 78 | ||
78 | 79 | ||
79 | 80 | ||
diff --git a/src/include/gnunet_fragmentation_lib.h b/src/include/gnunet_fragmentation_lib.h index 1f1f85321..06022e093 100644 --- a/src/include/gnunet_fragmentation_lib.h +++ b/src/include/gnunet_fragmentation_lib.h | |||
@@ -80,22 +80,14 @@ typedef void (*GNUNET_FRAGMENT_MessageProcessor) (void *cls, | |||
80 | * @param proc_cls closure for proc | 80 | * @param proc_cls closure for proc |
81 | * @return the fragmentation context | 81 | * @return the fragmentation context |
82 | */ | 82 | */ |
83 | struct GNUNET_FRAGMENT_Context *GNUNET_FRAGMENT_context_create (struct | 83 | struct GNUNET_FRAGMENT_Context * |
84 | GNUNET_STATISTICS_Handle | 84 | GNUNET_FRAGMENT_context_create (struct GNUNET_STATISTICS_Handle *stats, |
85 | *stats, | 85 | uint16_t mtu, |
86 | uint16_t mtu, | 86 | struct GNUNET_BANDWIDTH_Tracker *tracker, |
87 | struct | 87 | struct GNUNET_TIME_Relative delay, |
88 | GNUNET_BANDWIDTH_Tracker | 88 | const struct GNUNET_MessageHeader *msg, |
89 | *tracker, | 89 | GNUNET_FRAGMENT_MessageProcessor proc, |
90 | struct | 90 | void *proc_cls); |
91 | GNUNET_TIME_Relative | ||
92 | delay, | ||
93 | const struct | ||
94 | GNUNET_MessageHeader | ||
95 | *msg, | ||
96 | GNUNET_FRAGMENT_MessageProcessor | ||
97 | proc, | ||
98 | void *proc_cls); | ||
99 | 91 | ||
100 | 92 | ||
101 | /** | 93 | /** |
@@ -105,8 +97,8 @@ struct GNUNET_FRAGMENT_Context *GNUNET_FRAGMENT_context_create (struct | |||
105 | * | 97 | * |
106 | * @param fc fragmentation context | 98 | * @param fc fragmentation context |
107 | */ | 99 | */ |
108 | void GNUNET_FRAGMENT_context_transmission_done (struct GNUNET_FRAGMENT_Context | 100 | void |
109 | *fc); | 101 | GNUNET_FRAGMENT_context_transmission_done (struct GNUNET_FRAGMENT_Context *fc); |
110 | 102 | ||
111 | 103 | ||
112 | /** | 104 | /** |
@@ -120,8 +112,9 @@ void GNUNET_FRAGMENT_context_transmission_done (struct GNUNET_FRAGMENT_Context | |||
120 | * GNUNET_NO if more messages are pending | 112 | * GNUNET_NO if more messages are pending |
121 | * GNUNET_SYSERR if this ack is not valid for this fc | 113 | * GNUNET_SYSERR if this ack is not valid for this fc |
122 | */ | 114 | */ |
123 | int GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc, | 115 | int |
124 | const struct GNUNET_MessageHeader *msg); | 116 | GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc, |
117 | const struct GNUNET_MessageHeader *msg); | ||
125 | 118 | ||
126 | 119 | ||
127 | /** | 120 | /** |
@@ -132,9 +125,8 @@ int GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc, | |||
132 | * @return average delay between transmission and ACK for the | 125 | * @return average delay between transmission and ACK for the |
133 | * last message, FOREVER if the message was not fully transmitted | 126 | * last message, FOREVER if the message was not fully transmitted |
134 | */ | 127 | */ |
135 | struct GNUNET_TIME_Relative GNUNET_FRAGMENT_context_destroy (struct | 128 | struct GNUNET_TIME_Relative |
136 | GNUNET_FRAGMENT_Context | 129 | GNUNET_FRAGMENT_context_destroy (struct GNUNET_FRAGMENT_Context *fc); |
137 | *fc); | ||
138 | 130 | ||
139 | 131 | ||
140 | /** | 132 | /** |
@@ -171,18 +163,12 @@ typedef void (*GNUNET_DEFRAGMENT_AckProcessor) (void *cls, uint32_t id, | |||
171 | * back to the other side) | 163 | * back to the other side) |
172 | * @return the defragmentation context | 164 | * @return the defragmentation context |
173 | */ | 165 | */ |
174 | struct GNUNET_DEFRAGMENT_Context *GNUNET_DEFRAGMENT_context_create (struct | 166 | struct GNUNET_DEFRAGMENT_Context * |
175 | GNUNET_STATISTICS_Handle | 167 | GNUNET_DEFRAGMENT_context_create (struct GNUNET_STATISTICS_Handle *stats, |
176 | *stats, | 168 | uint16_t mtu, unsigned int num_msgs, |
177 | uint16_t | 169 | void *cls, |
178 | mtu, | 170 | GNUNET_FRAGMENT_MessageProcessor proc, |
179 | unsigned int | 171 | GNUNET_DEFRAGMENT_AckProcessor ackp); |
180 | num_msgs, | ||
181 | void *cls, | ||
182 | GNUNET_FRAGMENT_MessageProcessor | ||
183 | proc, | ||
184 | GNUNET_DEFRAGMENT_AckProcessor | ||
185 | ackp); | ||
186 | 172 | ||
187 | 173 | ||
188 | /** | 174 | /** |
@@ -190,7 +176,8 @@ struct GNUNET_DEFRAGMENT_Context *GNUNET_DEFRAGMENT_context_create (struct | |||
190 | * | 176 | * |
191 | * @param dc defragmentation context | 177 | * @param dc defragmentation context |
192 | */ | 178 | */ |
193 | void GNUNET_DEFRAGMENT_context_destroy (struct GNUNET_DEFRAGMENT_Context *dc); | 179 | void |
180 | GNUNET_DEFRAGMENT_context_destroy (struct GNUNET_DEFRAGMENT_Context *dc); | ||
194 | 181 | ||
195 | 182 | ||
196 | /** | 183 | /** |
@@ -200,8 +187,9 @@ void GNUNET_DEFRAGMENT_context_destroy (struct GNUNET_DEFRAGMENT_Context *dc); | |||
200 | * @param msg the message that was received | 187 | * @param msg the message that was received |
201 | * @return GNUNET_OK on success, GNUNET_NO if this was a duplicate, GNUNET_SYSERR on error | 188 | * @return GNUNET_OK on success, GNUNET_NO if this was a duplicate, GNUNET_SYSERR on error |
202 | */ | 189 | */ |
203 | int GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc, | 190 | int |
204 | const struct GNUNET_MessageHeader *msg); | 191 | GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc, |
192 | const struct GNUNET_MessageHeader *msg); | ||
205 | 193 | ||
206 | 194 | ||
207 | #if 0 /* keep Emacsens' auto-indent happy */ | 195 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h index 2962a9cf2..e8026a66f 100644 --- a/src/include/gnunet_fs_service.h +++ b/src/include/gnunet_fs_service.h | |||
@@ -89,8 +89,8 @@ typedef int (*GNUNET_FS_KeywordIterator) (void *cls, const char *keyword, | |||
89 | * @param uri uri to convert to a unique key | 89 | * @param uri uri to convert to a unique key |
90 | * @param key wherer to store the unique key | 90 | * @param key wherer to store the unique key |
91 | */ | 91 | */ |
92 | void GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, | 92 | void |
93 | GNUNET_HashCode * key); | 93 | GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, GNUNET_HashCode * key); |
94 | 94 | ||
95 | /** | 95 | /** |
96 | * Convert a URI to a UTF-8 String. | 96 | * Convert a URI to a UTF-8 String. |
@@ -98,7 +98,8 @@ void GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, | |||
98 | * @param uri uri to convert to a string | 98 | * @param uri uri to convert to a string |
99 | * @return the UTF-8 string | 99 | * @return the UTF-8 string |
100 | */ | 100 | */ |
101 | char *GNUNET_FS_uri_to_string (const struct GNUNET_FS_Uri *uri); | 101 | char * |
102 | GNUNET_FS_uri_to_string (const struct GNUNET_FS_Uri *uri); | ||
102 | 103 | ||
103 | /** | 104 | /** |
104 | * Convert keyword URI to a human readable format | 105 | * Convert keyword URI to a human readable format |
@@ -107,7 +108,8 @@ char *GNUNET_FS_uri_to_string (const struct GNUNET_FS_Uri *uri); | |||
107 | * @param uri ksk uri to convert to a string | 108 | * @param uri ksk uri to convert to a string |
108 | * @return string with the keywords | 109 | * @return string with the keywords |
109 | */ | 110 | */ |
110 | char *GNUNET_FS_uri_ksk_to_string_fancy (const struct GNUNET_FS_Uri *uri); | 111 | char * |
112 | GNUNET_FS_uri_ksk_to_string_fancy (const struct GNUNET_FS_Uri *uri); | ||
111 | 113 | ||
112 | 114 | ||
113 | /** | 115 | /** |
@@ -118,8 +120,9 @@ char *GNUNET_FS_uri_ksk_to_string_fancy (const struct GNUNET_FS_Uri *uri); | |||
118 | * @param keyword keyword to add | 120 | * @param keyword keyword to add |
119 | * @param is_mandatory is this keyword mandatory? | 121 | * @param is_mandatory is this keyword mandatory? |
120 | */ | 122 | */ |
121 | void GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri, | 123 | void |
122 | const char *keyword, int is_mandatory); | 124 | GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri, const char *keyword, |
125 | int is_mandatory); | ||
123 | 126 | ||
124 | 127 | ||
125 | /** | 128 | /** |
@@ -129,8 +132,9 @@ void GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri, | |||
129 | * @param uri ksk uri to modify | 132 | * @param uri ksk uri to modify |
130 | * @param keyword keyword to add | 133 | * @param keyword keyword to add |
131 | */ | 134 | */ |
132 | void GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri, | 135 | void |
133 | const char *keyword); | 136 | GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri, |
137 | const char *keyword); | ||
134 | 138 | ||
135 | 139 | ||
136 | /** | 140 | /** |
@@ -140,14 +144,16 @@ void GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri, | |||
140 | * @param emsg where to store the parser error message (if any) | 144 | * @param emsg where to store the parser error message (if any) |
141 | * @return NULL on error | 145 | * @return NULL on error |
142 | */ | 146 | */ |
143 | struct GNUNET_FS_Uri *GNUNET_FS_uri_parse (const char *uri, char **emsg); | 147 | struct GNUNET_FS_Uri * |
148 | GNUNET_FS_uri_parse (const char *uri, char **emsg); | ||
144 | 149 | ||
145 | /** | 150 | /** |
146 | * Free URI. | 151 | * Free URI. |
147 | * | 152 | * |
148 | * @param uri uri to free | 153 | * @param uri uri to free |
149 | */ | 154 | */ |
150 | void GNUNET_FS_uri_destroy (struct GNUNET_FS_Uri *uri); | 155 | void |
156 | GNUNET_FS_uri_destroy (struct GNUNET_FS_Uri *uri); | ||
151 | 157 | ||
152 | 158 | ||
153 | /** | 159 | /** |
@@ -156,8 +162,8 @@ void GNUNET_FS_uri_destroy (struct GNUNET_FS_Uri *uri); | |||
156 | * @param uri ksk uri to get the number of keywords from | 162 | * @param uri ksk uri to get the number of keywords from |
157 | * @return 0 if this is not a keyword URI | 163 | * @return 0 if this is not a keyword URI |
158 | */ | 164 | */ |
159 | unsigned int GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri | 165 | unsigned int |
160 | *uri); | 166 | GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri *uri); |
161 | 167 | ||
162 | 168 | ||
163 | /** | 169 | /** |
@@ -169,9 +175,10 @@ unsigned int GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri | |||
169 | * @return -1 if this is not a keyword URI, otherwise number of | 175 | * @return -1 if this is not a keyword URI, otherwise number of |
170 | * keywords iterated over until iterator aborted | 176 | * keywords iterated over until iterator aborted |
171 | */ | 177 | */ |
172 | int GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri, | 178 | int |
173 | GNUNET_FS_KeywordIterator iterator, | 179 | GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri, |
174 | void *iterator_cls); | 180 | GNUNET_FS_KeywordIterator iterator, |
181 | void *iterator_cls); | ||
175 | 182 | ||
176 | 183 | ||
177 | /** | 184 | /** |
@@ -181,8 +188,9 @@ int GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri, | |||
181 | * @param peer where to store the identify of the peer (presumably) offering the content | 188 | * @param peer where to store the identify of the peer (presumably) offering the content |
182 | * @return GNUNET_SYSERR if this is not a location URI, otherwise GNUNET_OK | 189 | * @return GNUNET_SYSERR if this is not a location URI, otherwise GNUNET_OK |
183 | */ | 190 | */ |
184 | int GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, | 191 | int |
185 | struct GNUNET_PeerIdentity *peer); | 192 | GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, |
193 | struct GNUNET_PeerIdentity *peer); | ||
186 | 194 | ||
187 | 195 | ||
188 | /** | 196 | /** |
@@ -191,8 +199,8 @@ int GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, | |||
191 | * @param uri location URI to get the content URI from | 199 | * @param uri location URI to get the content URI from |
192 | * @return NULL if argument is not a location URI | 200 | * @return NULL if argument is not a location URI |
193 | */ | 201 | */ |
194 | struct GNUNET_FS_Uri *GNUNET_FS_uri_loc_get_uri (const struct GNUNET_FS_Uri | 202 | struct GNUNET_FS_Uri * |
195 | *uri); | 203 | GNUNET_FS_uri_loc_get_uri (const struct GNUNET_FS_Uri *uri); |
196 | 204 | ||
197 | 205 | ||
198 | /** | 206 | /** |
@@ -201,9 +209,8 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_loc_get_uri (const struct GNUNET_FS_Uri | |||
201 | * @param uri location URI to get the expiration from | 209 | * @param uri location URI to get the expiration from |
202 | * @return expiration time of the URI | 210 | * @return expiration time of the URI |
203 | */ | 211 | */ |
204 | struct GNUNET_TIME_Absolute GNUNET_FS_uri_loc_get_expiration (const struct | 212 | struct GNUNET_TIME_Absolute |
205 | GNUNET_FS_Uri | 213 | GNUNET_FS_uri_loc_get_expiration (const struct GNUNET_FS_Uri *uri); |
206 | *uri); | ||
207 | 214 | ||
208 | 215 | ||
209 | /** | 216 | /** |
@@ -214,13 +221,10 @@ struct GNUNET_TIME_Absolute GNUNET_FS_uri_loc_get_expiration (const struct | |||
214 | * @param expiration_time how long will the content be offered? | 221 | * @param expiration_time how long will the content be offered? |
215 | * @return the location URI, NULL on error | 222 | * @return the location URI, NULL on error |
216 | */ | 223 | */ |
217 | struct GNUNET_FS_Uri *GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri | 224 | struct GNUNET_FS_Uri * |
218 | *baseUri, | 225 | GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri, |
219 | const struct | 226 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
220 | GNUNET_CONFIGURATION_Handle | 227 | struct GNUNET_TIME_Absolute expiration_time); |
221 | *cfg, | ||
222 | struct GNUNET_TIME_Absolute | ||
223 | expiration_time); | ||
224 | 228 | ||
225 | 229 | ||
226 | /** | 230 | /** |
@@ -231,8 +235,8 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri | |||
231 | * @param uri the URI to canonicalize | 235 | * @param uri the URI to canonicalize |
232 | * @return canonicalized version of the URI, NULL on error | 236 | * @return canonicalized version of the URI, NULL on error |
233 | */ | 237 | */ |
234 | struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_canonicalize (const struct GNUNET_FS_Uri | 238 | struct GNUNET_FS_Uri * |
235 | *uri); | 239 | GNUNET_FS_uri_ksk_canonicalize (const struct GNUNET_FS_Uri *uri); |
236 | 240 | ||
237 | 241 | ||
238 | /** | 242 | /** |
@@ -244,8 +248,9 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_canonicalize (const struct GNUNET_FS_Uri | |||
244 | * @param u2 second uri | 248 | * @param u2 second uri |
245 | * @return merged URI, NULL on error | 249 | * @return merged URI, NULL on error |
246 | */ | 250 | */ |
247 | struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1, | 251 | struct GNUNET_FS_Uri * |
248 | const struct GNUNET_FS_Uri *u2); | 252 | GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1, |
253 | const struct GNUNET_FS_Uri *u2); | ||
249 | 254 | ||
250 | 255 | ||
251 | /** | 256 | /** |
@@ -254,7 +259,8 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1, | |||
254 | * @param uri the URI to duplicate | 259 | * @param uri the URI to duplicate |
255 | * @return copy of the URI | 260 | * @return copy of the URI |
256 | */ | 261 | */ |
257 | struct GNUNET_FS_Uri *GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri); | 262 | struct GNUNET_FS_Uri * |
263 | GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri); | ||
258 | 264 | ||
259 | 265 | ||
260 | /** | 266 | /** |
@@ -274,8 +280,8 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri); | |||
274 | * @return an FS URI for the given keywords, NULL | 280 | * @return an FS URI for the given keywords, NULL |
275 | * if keywords is not legal (i.e. empty). | 281 | * if keywords is not legal (i.e. empty). |
276 | */ | 282 | */ |
277 | struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create (const char *keywords, | 283 | struct GNUNET_FS_Uri * |
278 | char **emsg); | 284 | GNUNET_FS_uri_ksk_create (const char *keywords, char **emsg); |
279 | 285 | ||
280 | 286 | ||
281 | /** | 287 | /** |
@@ -295,8 +301,8 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create (const char *keywords, | |||
295 | * @return an FS URI for the given keywords, NULL | 301 | * @return an FS URI for the given keywords, NULL |
296 | * if keywords is not legal (i.e. empty). | 302 | * if keywords is not legal (i.e. empty). |
297 | */ | 303 | */ |
298 | struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create_from_args (unsigned int argc, | 304 | struct GNUNET_FS_Uri * |
299 | const char **argv); | 305 | GNUNET_FS_uri_ksk_create_from_args (unsigned int argc, const char **argv); |
300 | 306 | ||
301 | 307 | ||
302 | /** | 308 | /** |
@@ -306,8 +312,9 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create_from_args (unsigned int argc, | |||
306 | * @param u2 the other URI | 312 | * @param u2 the other URI |
307 | * @return GNUNET_YES if the URIs are equal | 313 | * @return GNUNET_YES if the URIs are equal |
308 | */ | 314 | */ |
309 | int GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, | 315 | int |
310 | const struct GNUNET_FS_Uri *u2); | 316 | GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, |
317 | const struct GNUNET_FS_Uri *u2); | ||
311 | 318 | ||
312 | 319 | ||
313 | /** | 320 | /** |
@@ -316,7 +323,8 @@ int GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, | |||
316 | * @param uri the uri to check | 323 | * @param uri the uri to check |
317 | * @return GNUNET_YES if this is an SKS uri | 324 | * @return GNUNET_YES if this is an SKS uri |
318 | */ | 325 | */ |
319 | int GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri); | 326 | int |
327 | GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri); | ||
320 | 328 | ||
321 | 329 | ||
322 | /** | 330 | /** |
@@ -333,8 +341,9 @@ struct GNUNET_FS_Namespace; | |||
333 | * @param emsg where to store an error message | 341 | * @param emsg where to store an error message |
334 | * @return an FS URI for the given namespace and identifier | 342 | * @return an FS URI for the given namespace and identifier |
335 | */ | 343 | */ |
336 | struct GNUNET_FS_Uri *GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns, | 344 | struct GNUNET_FS_Uri * |
337 | const char *id, char **emsg); | 345 | GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns, const char *id, |
346 | char **emsg); | ||
338 | 347 | ||
339 | 348 | ||
340 | /** | 349 | /** |
@@ -344,8 +353,8 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns, | |||
344 | * @param id identifier | 353 | * @param id identifier |
345 | * @return an FS URI for the given namespace and identifier | 354 | * @return an FS URI for the given namespace and identifier |
346 | */ | 355 | */ |
347 | struct GNUNET_FS_Uri *GNUNET_FS_uri_sks_create_from_nsid (GNUNET_HashCode * | 356 | struct GNUNET_FS_Uri * |
348 | nsid, const char *id); | 357 | GNUNET_FS_uri_sks_create_from_nsid (GNUNET_HashCode * nsid, const char *id); |
349 | 358 | ||
350 | 359 | ||
351 | /** | 360 | /** |
@@ -356,8 +365,9 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_sks_create_from_nsid (GNUNET_HashCode * | |||
356 | * @param nsid where to store the ID of the namespace | 365 | * @param nsid where to store the ID of the namespace |
357 | * @return GNUNET_OK on success | 366 | * @return GNUNET_OK on success |
358 | */ | 367 | */ |
359 | int GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, | 368 | int |
360 | GNUNET_HashCode * nsid); | 369 | GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, |
370 | GNUNET_HashCode * nsid); | ||
361 | 371 | ||
362 | 372 | ||
363 | /** | 373 | /** |
@@ -366,7 +376,8 @@ int GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, | |||
366 | * @param uri the sks uri | 376 | * @param uri the sks uri |
367 | * @return NULL on error (not a valid SKS URI) | 377 | * @return NULL on error (not a valid SKS URI) |
368 | */ | 378 | */ |
369 | char *GNUNET_FS_uri_sks_get_content_id (const struct GNUNET_FS_Uri *uri); | 379 | char * |
380 | GNUNET_FS_uri_sks_get_content_id (const struct GNUNET_FS_Uri *uri); | ||
370 | 381 | ||
371 | 382 | ||
372 | /** | 383 | /** |
@@ -377,8 +388,9 @@ char *GNUNET_FS_uri_sks_get_content_id (const struct GNUNET_FS_Uri *uri); | |||
377 | * @param uri SKS uri to convert | 388 | * @param uri SKS uri to convert |
378 | * @return NULL on error (not an SKS URI) | 389 | * @return NULL on error (not an SKS URI) |
379 | */ | 390 | */ |
380 | char *GNUNET_FS_uri_sks_to_string_fancy (struct GNUNET_CONFIGURATION_Handle | 391 | char * |
381 | *cfg, const struct GNUNET_FS_Uri *uri); | 392 | GNUNET_FS_uri_sks_to_string_fancy (struct GNUNET_CONFIGURATION_Handle *cfg, |
393 | const struct GNUNET_FS_Uri *uri); | ||
382 | 394 | ||
383 | 395 | ||
384 | /** | 396 | /** |
@@ -387,7 +399,8 @@ char *GNUNET_FS_uri_sks_to_string_fancy (struct GNUNET_CONFIGURATION_Handle | |||
387 | * @param uri the uri | 399 | * @param uri the uri |
388 | * @return GNUNET_YES if this is a KSK uri | 400 | * @return GNUNET_YES if this is a KSK uri |
389 | */ | 401 | */ |
390 | int GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri); | 402 | int |
403 | GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri); | ||
391 | 404 | ||
392 | 405 | ||
393 | /** | 406 | /** |
@@ -396,7 +409,8 @@ int GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri); | |||
396 | * @param uri the uri to check | 409 | * @param uri the uri to check |
397 | * @return GNUNET_YES if this is a CHK uri | 410 | * @return GNUNET_YES if this is a CHK uri |
398 | */ | 411 | */ |
399 | int GNUNET_FS_uri_test_chk (const struct GNUNET_FS_Uri *uri); | 412 | int |
413 | GNUNET_FS_uri_test_chk (const struct GNUNET_FS_Uri *uri); | ||
400 | 414 | ||
401 | 415 | ||
402 | /** | 416 | /** |
@@ -406,7 +420,8 @@ int GNUNET_FS_uri_test_chk (const struct GNUNET_FS_Uri *uri); | |||
406 | * @param uri the CHK (or LOC) URI to inspect | 420 | * @param uri the CHK (or LOC) URI to inspect |
407 | * @return size of the file as specified in the CHK URI | 421 | * @return size of the file as specified in the CHK URI |
408 | */ | 422 | */ |
409 | uint64_t GNUNET_FS_uri_chk_get_file_size (const struct GNUNET_FS_Uri *uri); | 423 | uint64_t |
424 | GNUNET_FS_uri_chk_get_file_size (const struct GNUNET_FS_Uri *uri); | ||
410 | 425 | ||
411 | 426 | ||
412 | /** | 427 | /** |
@@ -415,7 +430,8 @@ uint64_t GNUNET_FS_uri_chk_get_file_size (const struct GNUNET_FS_Uri *uri); | |||
415 | * @param uri the uri to check | 430 | * @param uri the uri to check |
416 | * @return GNUNET_YES if this is a LOC uri | 431 | * @return GNUNET_YES if this is a LOC uri |
417 | */ | 432 | */ |
418 | int GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri); | 433 | int |
434 | GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri); | ||
419 | 435 | ||
420 | 436 | ||
421 | /** | 437 | /** |
@@ -426,9 +442,9 @@ int GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri); | |||
426 | * @param md metadata to use | 442 | * @param md metadata to use |
427 | * @return NULL on error, otherwise a KSK URI | 443 | * @return NULL on error, otherwise a KSK URI |
428 | */ | 444 | */ |
429 | struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create_from_meta_data (const struct | 445 | struct GNUNET_FS_Uri * |
430 | GNUNET_CONTAINER_MetaData | 446 | GNUNET_FS_uri_ksk_create_from_meta_data (const struct GNUNET_CONTAINER_MetaData |
431 | *md); | 447 | *md); |
432 | 448 | ||
433 | 449 | ||
434 | /* ******************** command-line option parsing API *********************** */ | 450 | /* ******************** command-line option parsing API *********************** */ |
@@ -445,10 +461,10 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create_from_meta_data (const struct | |||
445 | * @param value command line argument given | 461 | * @param value command line argument given |
446 | * @return GNUNET_OK on success | 462 | * @return GNUNET_OK on success |
447 | */ | 463 | */ |
448 | int GNUNET_FS_getopt_set_keywords (struct | 464 | int |
449 | GNUNET_GETOPT_CommandLineProcessorContext | 465 | GNUNET_FS_getopt_set_keywords (struct GNUNET_GETOPT_CommandLineProcessorContext |
450 | *ctx, void *scls, const char *option, | 466 | *ctx, void *scls, const char *option, |
451 | const char *value); | 467 | const char *value); |
452 | 468 | ||
453 | 469 | ||
454 | /** | 470 | /** |
@@ -463,10 +479,10 @@ int GNUNET_FS_getopt_set_keywords (struct | |||
463 | * @param value command line argument given | 479 | * @param value command line argument given |
464 | * @return GNUNET_OK on success | 480 | * @return GNUNET_OK on success |
465 | */ | 481 | */ |
466 | int GNUNET_FS_getopt_set_metadata (struct | 482 | int |
467 | GNUNET_GETOPT_CommandLineProcessorContext | 483 | GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext |
468 | *ctx, void *scls, const char *option, | 484 | *ctx, void *scls, const char *option, |
469 | const char *value); | 485 | const char *value); |
470 | 486 | ||
471 | 487 | ||
472 | 488 | ||
@@ -1621,7 +1637,8 @@ struct GNUNET_FS_BlockOptions | |||
1621 | /** | 1637 | /** |
1622 | * Return the current year (i.e. '2011'). | 1638 | * Return the current year (i.e. '2011'). |
1623 | */ | 1639 | */ |
1624 | unsigned int GNUNET_FS_get_current_year (void); | 1640 | unsigned int |
1641 | GNUNET_FS_get_current_year (void); | ||
1625 | 1642 | ||
1626 | 1643 | ||
1627 | /** | 1644 | /** |
@@ -1630,7 +1647,8 @@ unsigned int GNUNET_FS_get_current_year (void); | |||
1630 | * @param year a year (after 1970, please ;-)). | 1647 | * @param year a year (after 1970, please ;-)). |
1631 | * @return absolute time for January 1st of that year. | 1648 | * @return absolute time for January 1st of that year. |
1632 | */ | 1649 | */ |
1633 | struct GNUNET_TIME_Absolute GNUNET_FS_year_to_time (unsigned int year); | 1650 | struct GNUNET_TIME_Absolute |
1651 | GNUNET_FS_year_to_time (unsigned int year); | ||
1634 | 1652 | ||
1635 | 1653 | ||
1636 | /** | 1654 | /** |
@@ -1650,12 +1668,10 @@ struct GNUNET_FS_Handle; | |||
1650 | * @param ... list of optional options, terminated with GNUNET_FS_OPTIONS_END | 1668 | * @param ... list of optional options, terminated with GNUNET_FS_OPTIONS_END |
1651 | * @return NULL on error | 1669 | * @return NULL on error |
1652 | */ | 1670 | */ |
1653 | struct GNUNET_FS_Handle *GNUNET_FS_start (const struct | 1671 | struct GNUNET_FS_Handle * |
1654 | GNUNET_CONFIGURATION_Handle *cfg, | 1672 | GNUNET_FS_start (const struct GNUNET_CONFIGURATION_Handle *cfg, |
1655 | const char *client_name, | 1673 | const char *client_name, GNUNET_FS_ProgressCallback upcb, |
1656 | GNUNET_FS_ProgressCallback upcb, | 1674 | void *upcb_cls, enum GNUNET_FS_Flags flags, ...); |
1657 | void *upcb_cls, | ||
1658 | enum GNUNET_FS_Flags flags, ...); | ||
1659 | 1675 | ||
1660 | 1676 | ||
1661 | /** | 1677 | /** |
@@ -1665,7 +1681,8 @@ struct GNUNET_FS_Handle *GNUNET_FS_start (const struct | |||
1665 | * | 1681 | * |
1666 | * @param h handle that was returned from GNUNET_FS_start | 1682 | * @param h handle that was returned from GNUNET_FS_start |
1667 | */ | 1683 | */ |
1668 | void GNUNET_FS_stop (struct GNUNET_FS_Handle *h); | 1684 | void |
1685 | GNUNET_FS_stop (struct GNUNET_FS_Handle *h); | ||
1669 | 1686 | ||
1670 | 1687 | ||
1671 | /** | 1688 | /** |
@@ -1677,10 +1694,10 @@ void GNUNET_FS_stop (struct GNUNET_FS_Handle *h); | |||
1677 | * @return GNUNET_SYSERR on error, otherwise the number | 1694 | * @return GNUNET_SYSERR on error, otherwise the number |
1678 | * of meta-data items obtained | 1695 | * of meta-data items obtained |
1679 | */ | 1696 | */ |
1680 | int GNUNET_FS_meta_data_extract_from_file (struct GNUNET_CONTAINER_MetaData *md, | 1697 | int |
1681 | const char *filename, | 1698 | GNUNET_FS_meta_data_extract_from_file (struct GNUNET_CONTAINER_MetaData *md, |
1682 | struct EXTRACTOR_PluginList | 1699 | const char *filename, |
1683 | *extractors); | 1700 | struct EXTRACTOR_PluginList *extractors); |
1684 | 1701 | ||
1685 | 1702 | ||
1686 | /** | 1703 | /** |
@@ -1721,8 +1738,8 @@ typedef int (*GNUNET_FS_FileInformationProcessor) (void *cls, | |||
1721 | * can be passed to "GNUNET_FS_file_information_recover" | 1738 | * can be passed to "GNUNET_FS_file_information_recover" |
1722 | * to read this fi-struct from disk. | 1739 | * to read this fi-struct from disk. |
1723 | */ | 1740 | */ |
1724 | const char *GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation | 1741 | const char * |
1725 | *s); | 1742 | GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation *s); |
1726 | 1743 | ||
1727 | 1744 | ||
1728 | 1745 | ||
@@ -1740,17 +1757,17 @@ const char *GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation | |||
1740 | * @param bo block options | 1757 | * @param bo block options |
1741 | * @return publish structure entry for the file | 1758 | * @return publish structure entry for the file |
1742 | */ | 1759 | */ |
1743 | struct GNUNET_FS_FileInformation | 1760 | struct GNUNET_FS_FileInformation * |
1744 | *GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h, | 1761 | GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h, |
1745 | void *client_info, | 1762 | void *client_info, |
1746 | const char *filename, | 1763 | const char *filename, |
1747 | const struct GNUNET_FS_Uri | 1764 | const struct GNUNET_FS_Uri |
1748 | *keywords, | 1765 | *keywords, |
1749 | const struct | 1766 | const struct |
1750 | GNUNET_CONTAINER_MetaData | 1767 | GNUNET_CONTAINER_MetaData *meta, |
1751 | *meta, int do_index, | 1768 | int do_index, |
1752 | const struct | 1769 | const struct GNUNET_FS_BlockOptions |
1753 | GNUNET_FS_BlockOptions *bo); | 1770 | *bo); |
1754 | 1771 | ||
1755 | 1772 | ||
1756 | /** | 1773 | /** |
@@ -1769,17 +1786,17 @@ struct GNUNET_FS_FileInformation | |||
1769 | * @param bo block options | 1786 | * @param bo block options |
1770 | * @return publish structure entry for the file | 1787 | * @return publish structure entry for the file |
1771 | */ | 1788 | */ |
1772 | struct GNUNET_FS_FileInformation | 1789 | struct GNUNET_FS_FileInformation * |
1773 | *GNUNET_FS_file_information_create_from_data (struct GNUNET_FS_Handle *h, | 1790 | GNUNET_FS_file_information_create_from_data (struct GNUNET_FS_Handle *h, |
1774 | void *client_info, | 1791 | void *client_info, uint64_t length, |
1775 | uint64_t length, void *data, | 1792 | void *data, |
1776 | const struct GNUNET_FS_Uri | 1793 | const struct GNUNET_FS_Uri |
1777 | *keywords, | 1794 | *keywords, |
1778 | const struct | 1795 | const struct |
1779 | GNUNET_CONTAINER_MetaData | 1796 | GNUNET_CONTAINER_MetaData *meta, |
1780 | *meta, int do_index, | 1797 | int do_index, |
1781 | const struct | 1798 | const struct GNUNET_FS_BlockOptions |
1782 | GNUNET_FS_BlockOptions *bo); | 1799 | *bo); |
1783 | 1800 | ||
1784 | 1801 | ||
1785 | /** | 1802 | /** |
@@ -1818,19 +1835,19 @@ typedef size_t (*GNUNET_FS_DataReader) (void *cls, uint64_t offset, size_t max, | |||
1818 | * @param bo block options | 1835 | * @param bo block options |
1819 | * @return publish structure entry for the file | 1836 | * @return publish structure entry for the file |
1820 | */ | 1837 | */ |
1821 | struct GNUNET_FS_FileInformation | 1838 | struct GNUNET_FS_FileInformation * |
1822 | *GNUNET_FS_file_information_create_from_reader (struct GNUNET_FS_Handle *h, | 1839 | GNUNET_FS_file_information_create_from_reader (struct GNUNET_FS_Handle *h, |
1823 | void *client_info, | 1840 | void *client_info, |
1824 | uint64_t length, | 1841 | uint64_t length, |
1825 | GNUNET_FS_DataReader reader, | 1842 | GNUNET_FS_DataReader reader, |
1826 | void *reader_cls, | 1843 | void *reader_cls, |
1827 | const struct GNUNET_FS_Uri | 1844 | const struct GNUNET_FS_Uri |
1828 | *keywords, | 1845 | *keywords, |
1829 | const struct | 1846 | const struct |
1830 | GNUNET_CONTAINER_MetaData | 1847 | GNUNET_CONTAINER_MetaData *meta, |
1831 | *meta, int do_index, | 1848 | int do_index, |
1832 | const struct | 1849 | const struct |
1833 | GNUNET_FS_BlockOptions *bo); | 1850 | GNUNET_FS_BlockOptions *bo); |
1834 | 1851 | ||
1835 | 1852 | ||
1836 | /** | 1853 | /** |
@@ -1890,11 +1907,12 @@ typedef int (*GNUNET_FS_DirectoryScanner) (void *cls, | |||
1890 | * @param emsg where to store an error message (on errors) | 1907 | * @param emsg where to store an error message (on errors) |
1891 | * @return GNUNET_OK on success | 1908 | * @return GNUNET_OK on success |
1892 | */ | 1909 | */ |
1893 | int GNUNET_FS_directory_scanner_default (void *cls, struct GNUNET_FS_Handle *h, | 1910 | int |
1894 | const char *dirname, int do_index, | 1911 | GNUNET_FS_directory_scanner_default (void *cls, struct GNUNET_FS_Handle *h, |
1895 | const struct GNUNET_FS_BlockOptions | 1912 | const char *dirname, int do_index, |
1896 | *bo, GNUNET_FS_FileProcessor proc, | 1913 | const struct GNUNET_FS_BlockOptions *bo, |
1897 | void *proc_cls, char **emsg); | 1914 | GNUNET_FS_FileProcessor proc, |
1915 | void *proc_cls, char **emsg); | ||
1898 | 1916 | ||
1899 | 1917 | ||
1900 | /** | 1918 | /** |
@@ -1917,17 +1935,16 @@ int GNUNET_FS_directory_scanner_default (void *cls, struct GNUNET_FS_Handle *h, | |||
1917 | * @param emsg where to store an error message | 1935 | * @param emsg where to store an error message |
1918 | * @return publish structure entry for the directory, NULL on error | 1936 | * @return publish structure entry for the directory, NULL on error |
1919 | */ | 1937 | */ |
1920 | struct GNUNET_FS_FileInformation | 1938 | struct GNUNET_FS_FileInformation * |
1921 | *GNUNET_FS_file_information_create_from_directory (struct GNUNET_FS_Handle | 1939 | GNUNET_FS_file_information_create_from_directory (struct GNUNET_FS_Handle *h, |
1922 | *h, void *client_info, | 1940 | void *client_info, |
1923 | const char *filename, | 1941 | const char *filename, |
1924 | GNUNET_FS_DirectoryScanner | 1942 | GNUNET_FS_DirectoryScanner |
1925 | scanner, | 1943 | scanner, void *scanner_cls, |
1926 | void *scanner_cls, | 1944 | int do_index, |
1927 | int do_index, | 1945 | const struct |
1928 | const struct | 1946 | GNUNET_FS_BlockOptions *bo, |
1929 | GNUNET_FS_BlockOptions | 1947 | char **emsg); |
1930 | *bo, char **emsg); | ||
1931 | 1948 | ||
1932 | 1949 | ||
1933 | /** | 1950 | /** |
@@ -1944,17 +1961,16 @@ struct GNUNET_FS_FileInformation | |||
1944 | * @param bo block options | 1961 | * @param bo block options |
1945 | * @return publish structure entry for the directory , NULL on error | 1962 | * @return publish structure entry for the directory , NULL on error |
1946 | */ | 1963 | */ |
1947 | struct GNUNET_FS_FileInformation | 1964 | struct GNUNET_FS_FileInformation * |
1948 | *GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle | 1965 | GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle *h, |
1949 | *h, void *client_info, | 1966 | void *client_info, |
1950 | const struct | 1967 | const struct GNUNET_FS_Uri |
1951 | GNUNET_FS_Uri *keywords, | 1968 | *keywords, |
1952 | const struct | 1969 | const struct |
1953 | GNUNET_CONTAINER_MetaData | 1970 | GNUNET_CONTAINER_MetaData |
1954 | *meta, | 1971 | *meta, |
1955 | const struct | 1972 | const struct |
1956 | GNUNET_FS_BlockOptions | 1973 | GNUNET_FS_BlockOptions *bo); |
1957 | *bo); | ||
1958 | 1974 | ||
1959 | 1975 | ||
1960 | /** | 1976 | /** |
@@ -1963,8 +1979,9 @@ struct GNUNET_FS_FileInformation | |||
1963 | * @param ent check if this FI represents a directory | 1979 | * @param ent check if this FI represents a directory |
1964 | * @return GNUNET_YES if so, GNUNET_NO if not | 1980 | * @return GNUNET_YES if so, GNUNET_NO if not |
1965 | */ | 1981 | */ |
1966 | int GNUNET_FS_file_information_is_directory (const struct | 1982 | int |
1967 | GNUNET_FS_FileInformation *ent); | 1983 | GNUNET_FS_file_information_is_directory (const struct GNUNET_FS_FileInformation |
1984 | *ent); | ||
1968 | 1985 | ||
1969 | 1986 | ||
1970 | /** | 1987 | /** |
@@ -1978,8 +1995,9 @@ int GNUNET_FS_file_information_is_directory (const struct | |||
1978 | * must not include "dir" in its structure | 1995 | * must not include "dir" in its structure |
1979 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 1996 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
1980 | */ | 1997 | */ |
1981 | int GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir, | 1998 | int |
1982 | struct GNUNET_FS_FileInformation *ent); | 1999 | GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir, |
2000 | struct GNUNET_FS_FileInformation *ent); | ||
1983 | 2001 | ||
1984 | 2002 | ||
1985 | /** | 2003 | /** |
@@ -1996,9 +2014,10 @@ int GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir, | |||
1996 | * @param proc function to call on each entry | 2014 | * @param proc function to call on each entry |
1997 | * @param proc_cls closure for proc | 2015 | * @param proc_cls closure for proc |
1998 | */ | 2016 | */ |
1999 | void GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, | 2017 | void |
2000 | GNUNET_FS_FileInformationProcessor | 2018 | GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, |
2001 | proc, void *proc_cls); | 2019 | GNUNET_FS_FileInformationProcessor proc, |
2020 | void *proc_cls); | ||
2002 | 2021 | ||
2003 | 2022 | ||
2004 | /** | 2023 | /** |
@@ -2011,9 +2030,10 @@ void GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, | |||
2011 | * values are ignored | 2030 | * values are ignored |
2012 | * @param cleaner_cls closure for cleaner | 2031 | * @param cleaner_cls closure for cleaner |
2013 | */ | 2032 | */ |
2014 | void GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi, | 2033 | void |
2015 | GNUNET_FS_FileInformationProcessor | 2034 | GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi, |
2016 | cleaner, void *cleaner_cls); | 2035 | GNUNET_FS_FileInformationProcessor cleaner, |
2036 | void *cleaner_cls); | ||
2017 | 2037 | ||
2018 | 2038 | ||
2019 | /** | 2039 | /** |
@@ -2047,19 +2067,12 @@ enum GNUNET_FS_PublishOptions | |||
2047 | * @param options options for the publication | 2067 | * @param options options for the publication |
2048 | * @return context that can be used to control the publish operation | 2068 | * @return context that can be used to control the publish operation |
2049 | */ | 2069 | */ |
2050 | struct GNUNET_FS_PublishContext *GNUNET_FS_publish_start (struct | 2070 | struct GNUNET_FS_PublishContext * |
2051 | GNUNET_FS_Handle *h, | 2071 | GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h, |
2052 | struct | 2072 | struct GNUNET_FS_FileInformation *fi, |
2053 | GNUNET_FS_FileInformation | 2073 | struct GNUNET_FS_Namespace *namespace, const char *nid, |
2054 | *fi, | 2074 | const char *nuid, |
2055 | struct | 2075 | enum GNUNET_FS_PublishOptions options); |
2056 | GNUNET_FS_Namespace | ||
2057 | *namespace, | ||
2058 | const char *nid, | ||
2059 | const char *nuid, | ||
2060 | enum | ||
2061 | GNUNET_FS_PublishOptions | ||
2062 | options); | ||
2063 | 2076 | ||
2064 | 2077 | ||
2065 | /** | 2078 | /** |
@@ -2070,7 +2083,8 @@ struct GNUNET_FS_PublishContext *GNUNET_FS_publish_start (struct | |||
2070 | * | 2083 | * |
2071 | * @param pc context for the publication to stop | 2084 | * @param pc context for the publication to stop |
2072 | */ | 2085 | */ |
2073 | void GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc); | 2086 | void |
2087 | GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc); | ||
2074 | 2088 | ||
2075 | 2089 | ||
2076 | /** | 2090 | /** |
@@ -2098,13 +2112,14 @@ typedef void (*GNUNET_FS_PublishContinuation) (void *cls, | |||
2098 | * @param cont continuation | 2112 | * @param cont continuation |
2099 | * @param cont_cls closure for cont | 2113 | * @param cont_cls closure for cont |
2100 | */ | 2114 | */ |
2101 | void GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, | 2115 | void |
2102 | const struct GNUNET_FS_Uri *ksk_uri, | 2116 | GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, |
2103 | const struct GNUNET_CONTAINER_MetaData *meta, | 2117 | const struct GNUNET_FS_Uri *ksk_uri, |
2104 | const struct GNUNET_FS_Uri *uri, | 2118 | const struct GNUNET_CONTAINER_MetaData *meta, |
2105 | const struct GNUNET_FS_BlockOptions *bo, | 2119 | const struct GNUNET_FS_Uri *uri, |
2106 | enum GNUNET_FS_PublishOptions options, | 2120 | const struct GNUNET_FS_BlockOptions *bo, |
2107 | GNUNET_FS_PublishContinuation cont, void *cont_cls); | 2121 | enum GNUNET_FS_PublishOptions options, |
2122 | GNUNET_FS_PublishContinuation cont, void *cont_cls); | ||
2108 | 2123 | ||
2109 | 2124 | ||
2110 | /** | 2125 | /** |
@@ -2121,14 +2136,15 @@ void GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, | |||
2121 | * @param cont continuation | 2136 | * @param cont continuation |
2122 | * @param cont_cls closure for cont | 2137 | * @param cont_cls closure for cont |
2123 | */ | 2138 | */ |
2124 | void GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, | 2139 | void |
2125 | struct GNUNET_FS_Namespace *namespace, | 2140 | GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, |
2126 | const char *identifier, const char *update, | 2141 | struct GNUNET_FS_Namespace *namespace, |
2127 | const struct GNUNET_CONTAINER_MetaData *meta, | 2142 | const char *identifier, const char *update, |
2128 | const struct GNUNET_FS_Uri *uri, | 2143 | const struct GNUNET_CONTAINER_MetaData *meta, |
2129 | const struct GNUNET_FS_BlockOptions *bo, | 2144 | const struct GNUNET_FS_Uri *uri, |
2130 | enum GNUNET_FS_PublishOptions options, | 2145 | const struct GNUNET_FS_BlockOptions *bo, |
2131 | GNUNET_FS_PublishContinuation cont, void *cont_cls); | 2146 | enum GNUNET_FS_PublishOptions options, |
2147 | GNUNET_FS_PublishContinuation cont, void *cont_cls); | ||
2132 | 2148 | ||
2133 | 2149 | ||
2134 | /** | 2150 | /** |
@@ -2154,10 +2170,11 @@ typedef int (*GNUNET_FS_IndexedFileProcessor) (void *cls, const char *filename, | |||
2154 | * error) or "PREREQ_DONE" (on success) | 2170 | * error) or "PREREQ_DONE" (on success) |
2155 | * @param cont_cls closure for cont | 2171 | * @param cont_cls closure for cont |
2156 | */ | 2172 | */ |
2157 | void GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h, | 2173 | void |
2158 | GNUNET_FS_IndexedFileProcessor iterator, | 2174 | GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h, |
2159 | void *iterator_cls, | 2175 | GNUNET_FS_IndexedFileProcessor iterator, |
2160 | GNUNET_SCHEDULER_Task cont, void *cont_cls); | 2176 | void *iterator_cls, GNUNET_SCHEDULER_Task cont, |
2177 | void *cont_cls); | ||
2161 | 2178 | ||
2162 | 2179 | ||
2163 | /** | 2180 | /** |
@@ -2168,10 +2185,9 @@ void GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h, | |||
2168 | * @param cctx initial value for the client context | 2185 | * @param cctx initial value for the client context |
2169 | * @return NULL on error, otherwise handle | 2186 | * @return NULL on error, otherwise handle |
2170 | */ | 2187 | */ |
2171 | struct GNUNET_FS_UnindexContext *GNUNET_FS_unindex_start (struct | 2188 | struct GNUNET_FS_UnindexContext * |
2172 | GNUNET_FS_Handle *h, | 2189 | GNUNET_FS_unindex_start (struct GNUNET_FS_Handle *h, const char *filename, |
2173 | const char *filename, | 2190 | void *cctx); |
2174 | void *cctx); | ||
2175 | 2191 | ||
2176 | 2192 | ||
2177 | /** | 2193 | /** |
@@ -2179,7 +2195,8 @@ struct GNUNET_FS_UnindexContext *GNUNET_FS_unindex_start (struct | |||
2179 | * | 2195 | * |
2180 | * @param uc handle | 2196 | * @param uc handle |
2181 | */ | 2197 | */ |
2182 | void GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc); | 2198 | void |
2199 | GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc); | ||
2183 | 2200 | ||
2184 | 2201 | ||
2185 | /** | 2202 | /** |
@@ -2194,15 +2211,15 @@ void GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc); | |||
2194 | * @param cont continuation | 2211 | * @param cont continuation |
2195 | * @param cont_cls closure for cont | 2212 | * @param cont_cls closure for cont |
2196 | */ | 2213 | */ |
2197 | void GNUNET_FS_namespace_advertise (struct GNUNET_FS_Handle *h, | 2214 | void |
2198 | struct GNUNET_FS_Uri *ksk_uri, | 2215 | GNUNET_FS_namespace_advertise (struct GNUNET_FS_Handle *h, |
2199 | struct GNUNET_FS_Namespace *namespace, | 2216 | struct GNUNET_FS_Uri *ksk_uri, |
2200 | const struct GNUNET_CONTAINER_MetaData | 2217 | struct GNUNET_FS_Namespace *namespace, |
2201 | *meta, | 2218 | const struct GNUNET_CONTAINER_MetaData *meta, |
2202 | const struct GNUNET_FS_BlockOptions *bo, | 2219 | const struct GNUNET_FS_BlockOptions *bo, |
2203 | const char *rootEntry, | 2220 | const char *rootEntry, |
2204 | GNUNET_FS_PublishContinuation cont, | 2221 | GNUNET_FS_PublishContinuation cont, |
2205 | void *cont_cls); | 2222 | void *cont_cls); |
2206 | 2223 | ||
2207 | 2224 | ||
2208 | /** | 2225 | /** |
@@ -2213,8 +2230,8 @@ void GNUNET_FS_namespace_advertise (struct GNUNET_FS_Handle *h, | |||
2213 | * @param name name to use for the namespace | 2230 | * @param name name to use for the namespace |
2214 | * @return handle to the namespace, NULL on error | 2231 | * @return handle to the namespace, NULL on error |
2215 | */ | 2232 | */ |
2216 | struct GNUNET_FS_Namespace *GNUNET_FS_namespace_create (struct GNUNET_FS_Handle | 2233 | struct GNUNET_FS_Namespace * |
2217 | *h, const char *name); | 2234 | GNUNET_FS_namespace_create (struct GNUNET_FS_Handle *h, const char *name); |
2218 | 2235 | ||
2219 | 2236 | ||
2220 | /** | 2237 | /** |
@@ -2228,8 +2245,8 @@ struct GNUNET_FS_Namespace *GNUNET_FS_namespace_create (struct GNUNET_FS_Handle | |||
2228 | * | 2245 | * |
2229 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 2246 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
2230 | */ | 2247 | */ |
2231 | int GNUNET_FS_namespace_delete (struct GNUNET_FS_Namespace *namespace, | 2248 | int |
2232 | int freeze); | 2249 | GNUNET_FS_namespace_delete (struct GNUNET_FS_Namespace *namespace, int freeze); |
2233 | 2250 | ||
2234 | 2251 | ||
2235 | /** | 2252 | /** |
@@ -2254,9 +2271,9 @@ typedef void (*GNUNET_FS_NamespaceInfoProcessor) (void *cls, const char *name, | |||
2254 | * @param cb function to call on each known namespace | 2271 | * @param cb function to call on each known namespace |
2255 | * @param cb_cls closure for cb | 2272 | * @param cb_cls closure for cb |
2256 | */ | 2273 | */ |
2257 | void GNUNET_FS_namespace_list (struct GNUNET_FS_Handle *h, | 2274 | void |
2258 | GNUNET_FS_NamespaceInfoProcessor cb, | 2275 | GNUNET_FS_namespace_list (struct GNUNET_FS_Handle *h, |
2259 | void *cb_cls); | 2276 | GNUNET_FS_NamespaceInfoProcessor cb, void *cb_cls); |
2260 | 2277 | ||
2261 | 2278 | ||
2262 | /** | 2279 | /** |
@@ -2296,10 +2313,11 @@ typedef void (*GNUNET_FS_IdentifierProcessor) (void *cls, const char *last_id, | |||
2296 | * @param ip function to call on each updateable identifier | 2313 | * @param ip function to call on each updateable identifier |
2297 | * @param ip_cls closure for ip | 2314 | * @param ip_cls closure for ip |
2298 | */ | 2315 | */ |
2299 | void GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Namespace *namespace, | 2316 | void |
2300 | const char *next_id, | 2317 | GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Namespace *namespace, |
2301 | GNUNET_FS_IdentifierProcessor ip, | 2318 | const char *next_id, |
2302 | void *ip_cls); | 2319 | GNUNET_FS_IdentifierProcessor ip, |
2320 | void *ip_cls); | ||
2303 | 2321 | ||
2304 | 2322 | ||
2305 | /** | 2323 | /** |
@@ -2331,14 +2349,10 @@ enum GNUNET_FS_SearchOptions | |||
2331 | * @param cctx initial value for the client context | 2349 | * @param cctx initial value for the client context |
2332 | * @return context that can be used to control the search | 2350 | * @return context that can be used to control the search |
2333 | */ | 2351 | */ |
2334 | struct GNUNET_FS_SearchContext *GNUNET_FS_search_start (struct GNUNET_FS_Handle | 2352 | struct GNUNET_FS_SearchContext * |
2335 | *h, | 2353 | GNUNET_FS_search_start (struct GNUNET_FS_Handle *h, |
2336 | const struct | 2354 | const struct GNUNET_FS_Uri *uri, uint32_t anonymity, |
2337 | GNUNET_FS_Uri *uri, | 2355 | enum GNUNET_FS_SearchOptions options, void *cctx); |
2338 | uint32_t anonymity, | ||
2339 | enum | ||
2340 | GNUNET_FS_SearchOptions | ||
2341 | options, void *cctx); | ||
2342 | 2356 | ||
2343 | 2357 | ||
2344 | /** | 2358 | /** |
@@ -2346,7 +2360,8 @@ struct GNUNET_FS_SearchContext *GNUNET_FS_search_start (struct GNUNET_FS_Handle | |||
2346 | * | 2360 | * |
2347 | * @param sc context for the search that should be paused | 2361 | * @param sc context for the search that should be paused |
2348 | */ | 2362 | */ |
2349 | void GNUNET_FS_search_pause (struct GNUNET_FS_SearchContext *sc); | 2363 | void |
2364 | GNUNET_FS_search_pause (struct GNUNET_FS_SearchContext *sc); | ||
2350 | 2365 | ||
2351 | 2366 | ||
2352 | /** | 2367 | /** |
@@ -2354,7 +2369,8 @@ void GNUNET_FS_search_pause (struct GNUNET_FS_SearchContext *sc); | |||
2354 | * | 2369 | * |
2355 | * @param sc context for the search that should be resumed | 2370 | * @param sc context for the search that should be resumed |
2356 | */ | 2371 | */ |
2357 | void GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc); | 2372 | void |
2373 | GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc); | ||
2358 | 2374 | ||
2359 | 2375 | ||
2360 | /** | 2376 | /** |
@@ -2362,7 +2378,8 @@ void GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc); | |||
2362 | * | 2378 | * |
2363 | * @param sc context for the search that should be stopped | 2379 | * @param sc context for the search that should be stopped |
2364 | */ | 2380 | */ |
2365 | void GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc); | 2381 | void |
2382 | GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc); | ||
2366 | 2383 | ||
2367 | 2384 | ||
2368 | 2385 | ||
@@ -2437,26 +2454,14 @@ enum GNUNET_FS_DownloadOptions | |||
2437 | * for top-level downloads; useful for manually-triggered recursive downloads) | 2454 | * for top-level downloads; useful for manually-triggered recursive downloads) |
2438 | * @return context that can be used to control this download | 2455 | * @return context that can be used to control this download |
2439 | */ | 2456 | */ |
2440 | struct GNUNET_FS_DownloadContext *GNUNET_FS_download_start (struct | 2457 | struct GNUNET_FS_DownloadContext * |
2441 | GNUNET_FS_Handle *h, | 2458 | GNUNET_FS_download_start (struct GNUNET_FS_Handle *h, |
2442 | const struct | 2459 | const struct GNUNET_FS_Uri *uri, |
2443 | GNUNET_FS_Uri *uri, | 2460 | const struct GNUNET_CONTAINER_MetaData *meta, |
2444 | const struct | 2461 | const char *filename, const char *tempname, |
2445 | GNUNET_CONTAINER_MetaData | 2462 | uint64_t offset, uint64_t length, uint32_t anonymity, |
2446 | *meta, | 2463 | enum GNUNET_FS_DownloadOptions options, void *cctx, |
2447 | const char | 2464 | struct GNUNET_FS_DownloadContext *parent); |
2448 | *filename, | ||
2449 | const char | ||
2450 | *tempname, | ||
2451 | uint64_t offset, | ||
2452 | uint64_t length, | ||
2453 | uint32_t anonymity, | ||
2454 | enum | ||
2455 | GNUNET_FS_DownloadOptions | ||
2456 | options, void *cctx, | ||
2457 | struct | ||
2458 | GNUNET_FS_DownloadContext | ||
2459 | *parent); | ||
2460 | 2465 | ||
2461 | 2466 | ||
2462 | /** | 2467 | /** |
@@ -2493,29 +2498,14 @@ struct GNUNET_FS_DownloadContext *GNUNET_FS_download_start (struct | |||
2493 | * @param cctx initial value for the client context for this download | 2498 | * @param cctx initial value for the client context for this download |
2494 | * @return context that can be used to control this download | 2499 | * @return context that can be used to control this download |
2495 | */ | 2500 | */ |
2496 | struct GNUNET_FS_DownloadContext *GNUNET_FS_download_start_from_search (struct | 2501 | struct GNUNET_FS_DownloadContext * |
2497 | GNUNET_FS_Handle | 2502 | GNUNET_FS_download_start_from_search (struct GNUNET_FS_Handle *h, |
2498 | *h, | 2503 | struct GNUNET_FS_SearchResult *sr, |
2499 | struct | 2504 | const char *filename, |
2500 | GNUNET_FS_SearchResult | 2505 | const char *tempname, uint64_t offset, |
2501 | *sr, | 2506 | uint64_t length, uint32_t anonymity, |
2502 | const | 2507 | enum GNUNET_FS_DownloadOptions options, |
2503 | char | 2508 | void *cctx); |
2504 | *filename, | ||
2505 | const | ||
2506 | char | ||
2507 | *tempname, | ||
2508 | uint64_t | ||
2509 | offset, | ||
2510 | uint64_t | ||
2511 | length, | ||
2512 | uint32_t | ||
2513 | anonymity, | ||
2514 | enum | ||
2515 | GNUNET_FS_DownloadOptions | ||
2516 | options, | ||
2517 | void | ||
2518 | *cctx); | ||
2519 | 2509 | ||
2520 | 2510 | ||
2521 | /** | 2511 | /** |
@@ -2524,8 +2514,8 @@ struct GNUNET_FS_DownloadContext *GNUNET_FS_download_start_from_search (struct | |||
2524 | * @param dc handle for the download | 2514 | * @param dc handle for the download |
2525 | * @param do_delete delete files of incomplete downloads | 2515 | * @param do_delete delete files of incomplete downloads |
2526 | */ | 2516 | */ |
2527 | void GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, | 2517 | void |
2528 | int do_delete); | 2518 | GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, int do_delete); |
2529 | 2519 | ||
2530 | 2520 | ||
2531 | 2521 | ||
@@ -2543,8 +2533,9 @@ void GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, | |||
2543 | * @return GNUNET_YES if it is, GNUNET_NO if it is not, GNUNET_SYSERR if | 2533 | * @return GNUNET_YES if it is, GNUNET_NO if it is not, GNUNET_SYSERR if |
2544 | * we have no mime-type information (treat as 'GNUNET_NO') | 2534 | * we have no mime-type information (treat as 'GNUNET_NO') |
2545 | */ | 2535 | */ |
2546 | int GNUNET_FS_meta_data_test_for_directory (const struct | 2536 | int |
2547 | GNUNET_CONTAINER_MetaData *md); | 2537 | GNUNET_FS_meta_data_test_for_directory (const struct GNUNET_CONTAINER_MetaData |
2538 | *md); | ||
2548 | 2539 | ||
2549 | 2540 | ||
2550 | /** | 2541 | /** |
@@ -2553,7 +2544,8 @@ int GNUNET_FS_meta_data_test_for_directory (const struct | |||
2553 | * | 2544 | * |
2554 | * @param md metadata to add mimetype to | 2545 | * @param md metadata to add mimetype to |
2555 | */ | 2546 | */ |
2556 | void GNUNET_FS_meta_data_make_directory (struct GNUNET_CONTAINER_MetaData *md); | 2547 | void |
2548 | GNUNET_FS_meta_data_make_directory (struct GNUNET_CONTAINER_MetaData *md); | ||
2557 | 2549 | ||
2558 | 2550 | ||
2559 | /** | 2551 | /** |
@@ -2562,8 +2554,9 @@ void GNUNET_FS_meta_data_make_directory (struct GNUNET_CONTAINER_MetaData *md); | |||
2562 | * @param md given meta data | 2554 | * @param md given meta data |
2563 | * @return NULL if meta data is useless for suggesting a filename | 2555 | * @return NULL if meta data is useless for suggesting a filename |
2564 | */ | 2556 | */ |
2565 | char *GNUNET_FS_meta_data_suggest_filename (const struct | 2557 | char * |
2566 | GNUNET_CONTAINER_MetaData *md); | 2558 | GNUNET_FS_meta_data_suggest_filename (const struct GNUNET_CONTAINER_MetaData |
2559 | *md); | ||
2567 | 2560 | ||
2568 | 2561 | ||
2569 | /** | 2562 | /** |
@@ -2610,10 +2603,11 @@ typedef void (*GNUNET_FS_DirectoryEntryProcessor) (void *cls, | |||
2610 | * GNUNET_NO if this could be part of a directory (but not 100% OK) | 2603 | * GNUNET_NO if this could be part of a directory (but not 100% OK) |
2611 | * GNUNET_SYSERR if 'data' does not represent a directory | 2604 | * GNUNET_SYSERR if 'data' does not represent a directory |
2612 | */ | 2605 | */ |
2613 | int GNUNET_FS_directory_list_contents (size_t size, const void *data, | 2606 | int |
2614 | uint64_t offset, | 2607 | GNUNET_FS_directory_list_contents (size_t size, const void *data, |
2615 | GNUNET_FS_DirectoryEntryProcessor dep, | 2608 | uint64_t offset, |
2616 | void *dep_cls); | 2609 | GNUNET_FS_DirectoryEntryProcessor dep, |
2610 | void *dep_cls); | ||
2617 | 2611 | ||
2618 | 2612 | ||
2619 | /** | 2613 | /** |
@@ -2626,10 +2620,9 @@ struct GNUNET_FS_DirectoryBuilder; | |||
2626 | * | 2620 | * |
2627 | * @param mdir metadata for the directory | 2621 | * @param mdir metadata for the directory |
2628 | */ | 2622 | */ |
2629 | struct GNUNET_FS_DirectoryBuilder *GNUNET_FS_directory_builder_create (const | 2623 | struct GNUNET_FS_DirectoryBuilder * |
2630 | struct | 2624 | GNUNET_FS_directory_builder_create (const struct GNUNET_CONTAINER_MetaData |
2631 | GNUNET_CONTAINER_MetaData | 2625 | *mdir); |
2632 | *mdir); | ||
2633 | 2626 | ||
2634 | 2627 | ||
2635 | /** | 2628 | /** |
@@ -2642,10 +2635,11 @@ struct GNUNET_FS_DirectoryBuilder *GNUNET_FS_directory_builder_create (const | |||
2642 | * data must point to exactly the number of bytes specified | 2635 | * data must point to exactly the number of bytes specified |
2643 | * by the uri | 2636 | * by the uri |
2644 | */ | 2637 | */ |
2645 | void GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld, | 2638 | void |
2646 | const struct GNUNET_FS_Uri *uri, | 2639 | GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld, |
2647 | const struct GNUNET_CONTAINER_MetaData | 2640 | const struct GNUNET_FS_Uri *uri, |
2648 | *md, const void *data); | 2641 | const struct GNUNET_CONTAINER_MetaData *md, |
2642 | const void *data); | ||
2649 | 2643 | ||
2650 | 2644 | ||
2651 | /** | 2645 | /** |
@@ -2658,8 +2652,9 @@ void GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld, | |||
2658 | * @param rdata set to the encoded directory | 2652 | * @param rdata set to the encoded directory |
2659 | * @return GNUNET_OK on success | 2653 | * @return GNUNET_OK on success |
2660 | */ | 2654 | */ |
2661 | int GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld, | 2655 | int |
2662 | size_t * rsize, void **rdata); | 2656 | GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld, |
2657 | size_t * rsize, void **rdata); | ||
2663 | 2658 | ||
2664 | 2659 | ||
2665 | #if 0 /* keep Emacsens' auto-indent happy */ | 2660 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_getopt_lib.h b/src/include/gnunet_getopt_lib.h index 0fb7ec84e..e6afa2b3c 100644 --- a/src/include/gnunet_getopt_lib.h +++ b/src/include/gnunet_getopt_lib.h | |||
@@ -207,9 +207,10 @@ struct GNUNET_GETOPT_CommandLineOption | |||
207 | * @return index into argv with first non-option | 207 | * @return index into argv with first non-option |
208 | * argument, or GNUNET_SYSERR on error | 208 | * argument, or GNUNET_SYSERR on error |
209 | */ | 209 | */ |
210 | int GNUNET_GETOPT_run (const char *binaryOptions, | 210 | int |
211 | const struct GNUNET_GETOPT_CommandLineOption *allOptions, | 211 | GNUNET_GETOPT_run (const char *binaryOptions, |
212 | unsigned int argc, char *const *argv); | 212 | const struct GNUNET_GETOPT_CommandLineOption *allOptions, |
213 | unsigned int argc, char *const *argv); | ||
213 | 214 | ||
214 | 215 | ||
215 | /** | 216 | /** |
@@ -225,9 +226,9 @@ int GNUNET_GETOPT_run (const char *binaryOptions, | |||
225 | * @param value actual value of the option as a string. | 226 | * @param value actual value of the option as a string. |
226 | * @return GNUNET_OK if parsing the value worked | 227 | * @return GNUNET_OK if parsing the value worked |
227 | */ | 228 | */ |
228 | int GNUNET_GETOPT_set_ulong (struct GNUNET_GETOPT_CommandLineProcessorContext | 229 | int |
229 | *ctx, void *scls, const char *option, | 230 | GNUNET_GETOPT_set_ulong (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, |
230 | const char *value); | 231 | void *scls, const char *option, const char *value); |
231 | 232 | ||
232 | 233 | ||
233 | /** | 234 | /** |
@@ -243,9 +244,9 @@ int GNUNET_GETOPT_set_ulong (struct GNUNET_GETOPT_CommandLineProcessorContext | |||
243 | * @param value actual value of the option as a string. | 244 | * @param value actual value of the option as a string. |
244 | * @return GNUNET_OK if parsing the value worked | 245 | * @return GNUNET_OK if parsing the value worked |
245 | */ | 246 | */ |
246 | int GNUNET_GETOPT_set_uint (struct GNUNET_GETOPT_CommandLineProcessorContext | 247 | int |
247 | *ctx, void *scls, const char *option, | 248 | GNUNET_GETOPT_set_uint (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, |
248 | const char *value); | 249 | void *scls, const char *option, const char *value); |
249 | 250 | ||
250 | 251 | ||
251 | /** | 252 | /** |
@@ -262,9 +263,9 @@ int GNUNET_GETOPT_set_uint (struct GNUNET_GETOPT_CommandLineProcessorContext | |||
262 | * @param value not used (NULL) | 263 | * @param value not used (NULL) |
263 | * @return GNUNET_OK | 264 | * @return GNUNET_OK |
264 | */ | 265 | */ |
265 | int GNUNET_GETOPT_set_one (struct GNUNET_GETOPT_CommandLineProcessorContext | 266 | int |
266 | *ctx, void *scls, const char *option, | 267 | GNUNET_GETOPT_set_one (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, |
267 | const char *value); | 268 | void *scls, const char *option, const char *value); |
268 | 269 | ||
269 | 270 | ||
270 | /** | 271 | /** |
@@ -281,9 +282,9 @@ int GNUNET_GETOPT_set_one (struct GNUNET_GETOPT_CommandLineProcessorContext | |||
281 | * @param value actual value of the option (a string) | 282 | * @param value actual value of the option (a string) |
282 | * @return GNUNET_OK | 283 | * @return GNUNET_OK |
283 | */ | 284 | */ |
284 | int GNUNET_GETOPT_set_string (struct GNUNET_GETOPT_CommandLineProcessorContext | 285 | int |
285 | *ctx, void *scls, const char *option, | 286 | GNUNET_GETOPT_set_string (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, |
286 | const char *value); | 287 | void *scls, const char *option, const char *value); |
287 | 288 | ||
288 | /** | 289 | /** |
289 | * Set an option of type 'unsigned int' from the command line. Each | 290 | * Set an option of type 'unsigned int' from the command line. Each |
@@ -299,10 +300,10 @@ int GNUNET_GETOPT_set_string (struct GNUNET_GETOPT_CommandLineProcessorContext | |||
299 | * @param value not used (NULL) | 300 | * @param value not used (NULL) |
300 | * @return GNUNET_OK | 301 | * @return GNUNET_OK |
301 | */ | 302 | */ |
302 | int GNUNET_GETOPT_increment_value (struct | 303 | int |
303 | GNUNET_GETOPT_CommandLineProcessorContext | 304 | GNUNET_GETOPT_increment_value (struct GNUNET_GETOPT_CommandLineProcessorContext |
304 | *ctx, void *scls, const char *option, | 305 | *ctx, void *scls, const char *option, |
305 | const char *value); | 306 | const char *value); |
306 | 307 | ||
307 | 308 | ||
308 | /* *************** internal prototypes - use macros above! ************* */ | 309 | /* *************** internal prototypes - use macros above! ************* */ |
@@ -316,9 +317,10 @@ int GNUNET_GETOPT_increment_value (struct | |||
316 | * @param value not used (NULL) | 317 | * @param value not used (NULL) |
317 | * @return GNUNET_SYSERR (do not continue) | 318 | * @return GNUNET_SYSERR (do not continue) |
318 | */ | 319 | */ |
319 | int GNUNET_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext | 320 | int |
320 | *ctx, void *scls, const char *option, | 321 | GNUNET_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext |
321 | const char *value); | 322 | *ctx, void *scls, const char *option, |
323 | const char *value); | ||
322 | 324 | ||
323 | /** | 325 | /** |
324 | * Print out program version (implements --version). | 326 | * Print out program version (implements --version). |
@@ -329,10 +331,10 @@ int GNUNET_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext | |||
329 | * @param value not used (NULL) | 331 | * @param value not used (NULL) |
330 | * @return GNUNET_SYSERR (do not continue) | 332 | * @return GNUNET_SYSERR (do not continue) |
331 | */ | 333 | */ |
332 | int GNUNET_GETOPT_print_version_ (struct | 334 | int |
333 | GNUNET_GETOPT_CommandLineProcessorContext | 335 | GNUNET_GETOPT_print_version_ (struct GNUNET_GETOPT_CommandLineProcessorContext |
334 | *ctx, void *scls, const char *option, | 336 | *ctx, void *scls, const char *option, |
335 | const char *value); | 337 | const char *value); |
336 | 338 | ||
337 | #if 0 /* keep Emacsens' auto-indent happy */ | 339 | #if 0 /* keep Emacsens' auto-indent happy */ |
338 | { | 340 | { |
diff --git a/src/include/gnunet_hello_lib.h b/src/include/gnunet_hello_lib.h index 3c44b5048..556b41d3c 100644 --- a/src/include/gnunet_hello_lib.h +++ b/src/include/gnunet_hello_lib.h | |||
@@ -60,11 +60,11 @@ struct GNUNET_HELLO_Message; | |||
60 | * @return number of bytes copied, 0 if | 60 | * @return number of bytes copied, 0 if |
61 | * the target buffer was not big enough. | 61 | * the target buffer was not big enough. |
62 | */ | 62 | */ |
63 | size_t GNUNET_HELLO_add_address (const char *tname, | 63 | size_t |
64 | struct GNUNET_TIME_Absolute | 64 | GNUNET_HELLO_add_address (const char *tname, |
65 | expiration, const void *addr, | 65 | struct GNUNET_TIME_Absolute expiration, |
66 | uint16_t addr_len, char *target, | 66 | const void *addr, uint16_t addr_len, char *target, |
67 | size_t max); | 67 | size_t max); |
68 | 68 | ||
69 | 69 | ||
70 | /** | 70 | /** |
@@ -90,11 +90,11 @@ typedef size_t (*GNUNET_HELLO_GenerateAddressListCallback) (void *cls, | |||
90 | * | 90 | * |
91 | * @return the hello message | 91 | * @return the hello message |
92 | */ | 92 | */ |
93 | struct GNUNET_HELLO_Message *GNUNET_HELLO_create (const struct | 93 | struct GNUNET_HELLO_Message * |
94 | GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded | 94 | GNUNET_HELLO_create (const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded |
95 | *publicKey, | 95 | *publicKey, |
96 | GNUNET_HELLO_GenerateAddressListCallback | 96 | GNUNET_HELLO_GenerateAddressListCallback addrgen, |
97 | addrgen, void *addrgen_cls); | 97 | void *addrgen_cls); |
98 | 98 | ||
99 | 99 | ||
100 | /** | 100 | /** |
@@ -102,7 +102,8 @@ struct GNUNET_HELLO_Message *GNUNET_HELLO_create (const struct | |||
102 | * @param hello to inspect | 102 | * @param hello to inspect |
103 | * @return the size, 0 if HELLO is invalid | 103 | * @return the size, 0 if HELLO is invalid |
104 | */ | 104 | */ |
105 | uint16_t GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello); | 105 | uint16_t |
106 | GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello); | ||
106 | 107 | ||
107 | 108 | ||
108 | /** | 109 | /** |
@@ -114,10 +115,9 @@ uint16_t GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello); | |||
114 | * @param h2 the second HELLO message | 115 | * @param h2 the second HELLO message |
115 | * @return the combined hello message | 116 | * @return the combined hello message |
116 | */ | 117 | */ |
117 | struct GNUNET_HELLO_Message *GNUNET_HELLO_merge (const struct | 118 | struct GNUNET_HELLO_Message * |
118 | GNUNET_HELLO_Message *h1, | 119 | GNUNET_HELLO_merge (const struct GNUNET_HELLO_Message *h1, |
119 | const struct | 120 | const struct GNUNET_HELLO_Message *h2); |
120 | GNUNET_HELLO_Message *h2); | ||
121 | 121 | ||
122 | 122 | ||
123 | /** | 123 | /** |
@@ -136,12 +136,10 @@ struct GNUNET_HELLO_Message *GNUNET_HELLO_merge (const struct | |||
136 | * zero if the some addresses with expirations >= now | 136 | * zero if the some addresses with expirations >= now |
137 | * do not match at all | 137 | * do not match at all |
138 | */ | 138 | */ |
139 | struct GNUNET_TIME_Absolute GNUNET_HELLO_equals (const struct | 139 | struct GNUNET_TIME_Absolute |
140 | GNUNET_HELLO_Message *h1, | 140 | GNUNET_HELLO_equals (const struct GNUNET_HELLO_Message *h1, |
141 | const struct | 141 | const struct GNUNET_HELLO_Message *h2, |
142 | GNUNET_HELLO_Message *h2, | 142 | struct GNUNET_TIME_Absolute now); |
143 | struct GNUNET_TIME_Absolute | ||
144 | now); | ||
145 | 143 | ||
146 | 144 | ||
147 | /** | 145 | /** |
@@ -174,13 +172,10 @@ typedef int (*GNUNET_HELLO_AddressIterator) (void *cls, const char *tname, | |||
174 | * @param it_cls closure for it | 172 | * @param it_cls closure for it |
175 | * @return the modified HELLO or NULL | 173 | * @return the modified HELLO or NULL |
176 | */ | 174 | */ |
177 | struct GNUNET_HELLO_Message *GNUNET_HELLO_iterate_addresses (const struct | 175 | struct GNUNET_HELLO_Message * |
178 | GNUNET_HELLO_Message | 176 | GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg, |
179 | *msg, | 177 | int return_modified, |
180 | int | 178 | GNUNET_HELLO_AddressIterator it, void *it_cls); |
181 | return_modified, | ||
182 | GNUNET_HELLO_AddressIterator | ||
183 | it, void *it_cls); | ||
184 | 179 | ||
185 | 180 | ||
186 | /** | 181 | /** |
@@ -194,14 +189,15 @@ struct GNUNET_HELLO_Message *GNUNET_HELLO_iterate_addresses (const struct | |||
194 | * @param it iterator to call on each address | 189 | * @param it iterator to call on each address |
195 | * @param it_cls closure for it | 190 | * @param it_cls closure for it |
196 | */ | 191 | */ |
197 | void GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message | 192 | void |
198 | *new_hello, | 193 | GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message |
199 | const struct GNUNET_HELLO_Message | 194 | *new_hello, |
200 | *old_hello, | 195 | const struct GNUNET_HELLO_Message |
201 | struct GNUNET_TIME_Absolute | 196 | *old_hello, |
202 | expiration_limit, | 197 | struct GNUNET_TIME_Absolute |
203 | GNUNET_HELLO_AddressIterator it, | 198 | expiration_limit, |
204 | void *it_cls); | 199 | GNUNET_HELLO_AddressIterator it, |
200 | void *it_cls); | ||
205 | 201 | ||
206 | 202 | ||
207 | /** | 203 | /** |
@@ -211,9 +207,10 @@ void GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message | |||
211 | * @param publicKey where to copy the public key information, can be NULL | 207 | * @param publicKey where to copy the public key information, can be NULL |
212 | * @return GNUNET_SYSERR if the HELLO was malformed | 208 | * @return GNUNET_SYSERR if the HELLO was malformed |
213 | */ | 209 | */ |
214 | int GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, | 210 | int |
215 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded | 211 | GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, |
216 | *publicKey); | 212 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded |
213 | *publicKey); | ||
217 | 214 | ||
218 | 215 | ||
219 | /** | 216 | /** |
@@ -223,8 +220,9 @@ int GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, | |||
223 | * @param peer where to store the peer's identity | 220 | * @param peer where to store the peer's identity |
224 | * @return GNUNET_SYSERR if the HELLO was malformed | 221 | * @return GNUNET_SYSERR if the HELLO was malformed |
225 | */ | 222 | */ |
226 | int GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, | 223 | int |
227 | struct GNUNET_PeerIdentity *peer); | 224 | GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, |
225 | struct GNUNET_PeerIdentity *peer); | ||
228 | 226 | ||
229 | 227 | ||
230 | /** | 228 | /** |
@@ -235,9 +233,8 @@ int GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, | |||
235 | * | 233 | * |
236 | * @return header or NULL if the HELLO was malformed | 234 | * @return header or NULL if the HELLO was malformed |
237 | */ | 235 | */ |
238 | struct GNUNET_MessageHeader *GNUNET_HELLO_get_header (struct | 236 | struct GNUNET_MessageHeader * |
239 | GNUNET_HELLO_Message | 237 | GNUNET_HELLO_get_header (struct GNUNET_HELLO_Message *hello); |
240 | *hello); | ||
241 | 238 | ||
242 | /* ifndef GNUNET_HELLO_LIB_H */ | 239 | /* ifndef GNUNET_HELLO_LIB_H */ |
243 | #endif | 240 | #endif |
diff --git a/src/include/gnunet_load_lib.h b/src/include/gnunet_load_lib.h index d56522d40..6dfe80cb2 100644 --- a/src/include/gnunet_load_lib.h +++ b/src/include/gnunet_load_lib.h | |||
@@ -51,8 +51,8 @@ struct GNUNET_LOAD_Value; | |||
51 | * frequency, 0-load values will be added to the load | 51 | * frequency, 0-load values will be added to the load |
52 | * @return the new load value | 52 | * @return the new load value |
53 | */ | 53 | */ |
54 | struct GNUNET_LOAD_Value *GNUNET_LOAD_value_init (struct GNUNET_TIME_Relative | 54 | struct GNUNET_LOAD_Value * |
55 | autodecline); | 55 | GNUNET_LOAD_value_init (struct GNUNET_TIME_Relative autodecline); |
56 | 56 | ||
57 | 57 | ||
58 | /** | 58 | /** |
@@ -61,8 +61,9 @@ struct GNUNET_LOAD_Value *GNUNET_LOAD_value_init (struct GNUNET_TIME_Relative | |||
61 | * @param load load to update | 61 | * @param load load to update |
62 | * @param autodecline frequency of load decline | 62 | * @param autodecline frequency of load decline |
63 | */ | 63 | */ |
64 | void GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load, | 64 | void |
65 | struct GNUNET_TIME_Relative autodecline); | 65 | GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load, |
66 | struct GNUNET_TIME_Relative autodecline); | ||
66 | 67 | ||
67 | 68 | ||
68 | /** | 69 | /** |
@@ -82,7 +83,8 @@ void GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load, | |||
82 | * 100 if the latest updates were so large | 83 | * 100 if the latest updates were so large |
83 | * that we could not do proper calculations | 84 | * that we could not do proper calculations |
84 | */ | 85 | */ |
85 | double GNUNET_LOAD_get_load (struct GNUNET_LOAD_Value *load); | 86 | double |
87 | GNUNET_LOAD_get_load (struct GNUNET_LOAD_Value *load); | ||
86 | 88 | ||
87 | 89 | ||
88 | /** | 90 | /** |
@@ -91,7 +93,8 @@ double GNUNET_LOAD_get_load (struct GNUNET_LOAD_Value *load); | |||
91 | * @param load load handle | 93 | * @param load load handle |
92 | * @return zero if update was never called | 94 | * @return zero if update was never called |
93 | */ | 95 | */ |
94 | double GNUNET_LOAD_get_average (struct GNUNET_LOAD_Value *load); | 96 | double |
97 | GNUNET_LOAD_get_average (struct GNUNET_LOAD_Value *load); | ||
95 | 98 | ||
96 | 99 | ||
97 | /** | 100 | /** |
@@ -100,7 +103,8 @@ double GNUNET_LOAD_get_average (struct GNUNET_LOAD_Value *load); | |||
100 | * @param load to update | 103 | * @param load to update |
101 | * @param data latest measurement value (for example, delay) | 104 | * @param data latest measurement value (for example, delay) |
102 | */ | 105 | */ |
103 | void GNUNET_LOAD_update (struct GNUNET_LOAD_Value *load, uint64_t data); | 106 | void |
107 | GNUNET_LOAD_update (struct GNUNET_LOAD_Value *load, uint64_t data); | ||
104 | 108 | ||
105 | 109 | ||
106 | #if 0 /* keep Emacsens' auto-indent happy */ | 110 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_mesh_service.h b/src/include/gnunet_mesh_service.h index 507b766d1..bea706478 100644 --- a/src/include/gnunet_mesh_service.h +++ b/src/include/gnunet_mesh_service.h | |||
@@ -138,17 +138,11 @@ typedef uint32_t GNUNET_MESH_ApplicationType; | |||
138 | * @return handle to the mesh service | 138 | * @return handle to the mesh service |
139 | * NULL on error (in this case, init is never called) | 139 | * NULL on error (in this case, init is never called) |
140 | */ | 140 | */ |
141 | struct GNUNET_MESH_Handle *GNUNET_MESH_connect (const struct | 141 | struct GNUNET_MESH_Handle * |
142 | GNUNET_CONFIGURATION_Handle | 142 | GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls, |
143 | *cfg, void *cls, | 143 | GNUNET_MESH_TunnelEndHandler cleaner, |
144 | GNUNET_MESH_TunnelEndHandler | 144 | const struct GNUNET_MESH_MessageHandler *handlers, |
145 | cleaner, | 145 | const GNUNET_MESH_ApplicationType *stypes); |
146 | const struct | ||
147 | GNUNET_MESH_MessageHandler | ||
148 | *handlers, | ||
149 | const | ||
150 | GNUNET_MESH_ApplicationType | ||
151 | *stypes); | ||
152 | 146 | ||
153 | /** | 147 | /** |
154 | * Get the peer on the other side of this tunnel if it is just one. Return NULL otherwise | 148 | * Get the peer on the other side of this tunnel if it is just one. Return NULL otherwise |
@@ -156,9 +150,8 @@ struct GNUNET_MESH_Handle *GNUNET_MESH_connect (const struct | |||
156 | * @param tunnel the tunnel | 150 | * @param tunnel the tunnel |
157 | * @return the peer or NULL | 151 | * @return the peer or NULL |
158 | */ | 152 | */ |
159 | const struct GNUNET_PeerIdentity *GNUNET_MESH_get_peer (const struct | 153 | const struct GNUNET_PeerIdentity * |
160 | GNUNET_MESH_Tunnel | 154 | GNUNET_MESH_get_peer (const struct GNUNET_MESH_Tunnel *tunnel); |
161 | *tunnel); | ||
162 | 155 | ||
163 | 156 | ||
164 | /** | 157 | /** |
@@ -166,7 +159,8 @@ const struct GNUNET_PeerIdentity *GNUNET_MESH_get_peer (const struct | |||
166 | * | 159 | * |
167 | * @param handle connection to mesh to disconnect | 160 | * @param handle connection to mesh to disconnect |
168 | */ | 161 | */ |
169 | void GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle); | 162 | void |
163 | GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle); | ||
170 | 164 | ||
171 | 165 | ||
172 | 166 | ||
@@ -220,23 +214,15 @@ struct GNUNET_MESH_PeerRequestHandle; | |||
220 | * @param handler_cls closure for handler | 214 | * @param handler_cls closure for handler |
221 | * @return NULL on error (handler will not be called), otherwise handle for cancellation | 215 | * @return NULL on error (handler will not be called), otherwise handle for cancellation |
222 | */ | 216 | */ |
223 | struct GNUNET_MESH_Tunnel *GNUNET_MESH_peer_request_connect_any (struct | 217 | struct GNUNET_MESH_Tunnel * |
224 | GNUNET_MESH_Handle | 218 | GNUNET_MESH_peer_request_connect_any (struct GNUNET_MESH_Handle *h, |
225 | *h, | 219 | struct GNUNET_TIME_Relative timeout, |
226 | struct | 220 | unsigned int num_peers, |
227 | GNUNET_TIME_Relative | 221 | const struct GNUNET_PeerIdentity *peers, |
228 | timeout, | 222 | GNUNET_MESH_TunnelConnectHandler |
229 | unsigned int | 223 | connect_handler, |
230 | num_peers, | 224 | GNUNET_MESH_TunnelDisconnectHandler |
231 | const struct | 225 | disconnect_handler, void *handler_cls); |
232 | GNUNET_PeerIdentity | ||
233 | *peers, | ||
234 | GNUNET_MESH_TunnelConnectHandler | ||
235 | connect_handler, | ||
236 | GNUNET_MESH_TunnelDisconnectHandler | ||
237 | disconnect_handler, | ||
238 | void | ||
239 | *handler_cls); | ||
240 | 226 | ||
241 | 227 | ||
242 | /** | 228 | /** |
@@ -256,23 +242,15 @@ struct GNUNET_MESH_Tunnel *GNUNET_MESH_peer_request_connect_any (struct | |||
256 | * @param handler_cls closure for handler | 242 | * @param handler_cls closure for handler |
257 | * @return NULL on error (handler will not be called), otherwise handle for cancellation | 243 | * @return NULL on error (handler will not be called), otherwise handle for cancellation |
258 | */ | 244 | */ |
259 | struct GNUNET_MESH_Tunnel *GNUNET_MESH_peer_request_connect_all (struct | 245 | struct GNUNET_MESH_Tunnel * |
260 | GNUNET_MESH_Handle | 246 | GNUNET_MESH_peer_request_connect_all (struct GNUNET_MESH_Handle *h, |
261 | *h, | 247 | struct GNUNET_TIME_Relative timeout, |
262 | struct | 248 | unsigned int num_peers, |
263 | GNUNET_TIME_Relative | 249 | const struct GNUNET_PeerIdentity *peers, |
264 | timeout, | 250 | GNUNET_MESH_TunnelConnectHandler |
265 | unsigned int | 251 | connect_handler, |
266 | num_peers, | 252 | GNUNET_MESH_TunnelDisconnectHandler |
267 | const struct | 253 | disconnect_handler, void *handler_cls); |
268 | GNUNET_PeerIdentity | ||
269 | *peers, | ||
270 | GNUNET_MESH_TunnelConnectHandler | ||
271 | connect_handler, | ||
272 | GNUNET_MESH_TunnelDisconnectHandler | ||
273 | disconnect_handler, | ||
274 | void | ||
275 | *handler_cls); | ||
276 | 254 | ||
277 | 255 | ||
278 | /** | 256 | /** |
@@ -283,10 +261,10 @@ struct GNUNET_MESH_Tunnel *GNUNET_MESH_peer_request_connect_all (struct | |||
283 | * @param timeout how long to try to establish a connection | 261 | * @param timeout how long to try to establish a connection |
284 | * @param peer peer to add | 262 | * @param peer peer to add |
285 | */ | 263 | */ |
286 | void GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, | 264 | void |
287 | struct GNUNET_TIME_Relative timeout, | 265 | GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, |
288 | const struct GNUNET_PeerIdentity | 266 | struct GNUNET_TIME_Relative timeout, |
289 | *peer); | 267 | const struct GNUNET_PeerIdentity *peer); |
290 | 268 | ||
291 | 269 | ||
292 | /** | 270 | /** |
@@ -296,9 +274,9 @@ void GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, | |||
296 | * @param tunnel handle to existing tunnel | 274 | * @param tunnel handle to existing tunnel |
297 | * @param peer peer to remove | 275 | * @param peer peer to remove |
298 | */ | 276 | */ |
299 | void GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, | 277 | void |
300 | const struct GNUNET_PeerIdentity | 278 | GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, |
301 | *peer); | 279 | const struct GNUNET_PeerIdentity *peer); |
302 | 280 | ||
303 | 281 | ||
304 | /** | 282 | /** |
@@ -318,20 +296,15 @@ void GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, | |||
318 | * @param handler_cls closure for handler | 296 | * @param handler_cls closure for handler |
319 | * @return NULL on error (handler will not be called), otherwise handle for cancellation | 297 | * @return NULL on error (handler will not be called), otherwise handle for cancellation |
320 | */ | 298 | */ |
321 | struct GNUNET_MESH_Tunnel *GNUNET_MESH_peer_request_connect_by_type (struct | 299 | struct GNUNET_MESH_Tunnel * |
322 | GNUNET_MESH_Handle | 300 | GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Handle *h, |
323 | *h, | 301 | struct GNUNET_TIME_Relative timeout, |
324 | struct | 302 | GNUNET_MESH_ApplicationType app_type, |
325 | GNUNET_TIME_Relative | 303 | GNUNET_MESH_TunnelConnectHandler |
326 | timeout, | 304 | connect_handler, |
327 | GNUNET_MESH_ApplicationType | 305 | GNUNET_MESH_TunnelDisconnectHandler |
328 | app_type, | 306 | disconnect_handler, |
329 | GNUNET_MESH_TunnelConnectHandler | 307 | void *handler_cls); |
330 | connect_handler, | ||
331 | GNUNET_MESH_TunnelDisconnectHandler | ||
332 | disconnect_handler, | ||
333 | void | ||
334 | *handler_cls); | ||
335 | 308 | ||
336 | 309 | ||
337 | /** | 310 | /** |
@@ -340,7 +313,8 @@ struct GNUNET_MESH_Tunnel *GNUNET_MESH_peer_request_connect_by_type (struct | |||
340 | * | 313 | * |
341 | * @param req request handle that was returned for the original request | 314 | * @param req request handle that was returned for the original request |
342 | */ | 315 | */ |
343 | void GNUNET_MESH_peer_request_connect_cancel (struct GNUNET_MESH_Tunnel *req); | 316 | void |
317 | GNUNET_MESH_peer_request_connect_cancel (struct GNUNET_MESH_Tunnel *req); | ||
344 | 318 | ||
345 | 319 | ||
346 | /** | 320 | /** |
@@ -370,25 +344,14 @@ struct GNUNET_MESH_TransmitHandle; | |||
370 | * NULL if we can not even queue the request (insufficient | 344 | * NULL if we can not even queue the request (insufficient |
371 | * memory); if NULL is returned, "notify" will NOT be called. | 345 | * memory); if NULL is returned, "notify" will NOT be called. |
372 | */ | 346 | */ |
373 | struct GNUNET_MESH_TransmitHandle *GNUNET_MESH_notify_transmit_ready (struct | 347 | struct GNUNET_MESH_TransmitHandle * |
374 | GNUNET_MESH_Tunnel | 348 | GNUNET_MESH_notify_transmit_ready (struct GNUNET_MESH_Tunnel *tunnel, int cork, |
375 | *tunnel, | 349 | uint32_t priority, |
376 | int cork, | 350 | struct GNUNET_TIME_Relative maxdelay, |
377 | uint32_t | 351 | const struct GNUNET_PeerIdentity *target, |
378 | priority, | 352 | size_t notify_size, |
379 | struct | 353 | GNUNET_CONNECTION_TransmitReadyNotify notify, |
380 | GNUNET_TIME_Relative | 354 | void *notify_cls); |
381 | maxdelay, | ||
382 | const | ||
383 | struct | ||
384 | GNUNET_PeerIdentity | ||
385 | *target, | ||
386 | size_t | ||
387 | notify_size, | ||
388 | GNUNET_CONNECTION_TransmitReadyNotify | ||
389 | notify, | ||
390 | void | ||
391 | *notify_cls); | ||
392 | 355 | ||
393 | 356 | ||
394 | /** | 357 | /** |
@@ -396,19 +359,23 @@ struct GNUNET_MESH_TransmitHandle *GNUNET_MESH_notify_transmit_ready (struct | |||
396 | * | 359 | * |
397 | * @param th handle that was returned by "notify_transmit_ready". | 360 | * @param th handle that was returned by "notify_transmit_ready". |
398 | */ | 361 | */ |
399 | void GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle | 362 | void |
400 | *th); | 363 | GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle |
401 | 364 | *th); | |
402 | void GNUNET_MESH_tunnel_set_head (struct GNUNET_MESH_Tunnel *tunnel, | 365 | |
403 | void *head); | 366 | void |
404 | void GNUNET_MESH_tunnel_set_tail (struct GNUNET_MESH_Tunnel *tunnel, | 367 | GNUNET_MESH_tunnel_set_head (struct GNUNET_MESH_Tunnel *tunnel, void *head); |
405 | void *tail); | 368 | void |
406 | void *GNUNET_MESH_tunnel_get_head (struct GNUNET_MESH_Tunnel *tunnel); | 369 | GNUNET_MESH_tunnel_set_tail (struct GNUNET_MESH_Tunnel *tunnel, void *tail); |
407 | void *GNUNET_MESH_tunnel_get_tail (struct GNUNET_MESH_Tunnel *tunnel); | 370 | void * |
408 | 371 | GNUNET_MESH_tunnel_get_head (struct GNUNET_MESH_Tunnel *tunnel); | |
409 | void GNUNET_MESH_tunnel_set_data (struct GNUNET_MESH_Tunnel *tunnel, | 372 | void * |
410 | void *data); | 373 | GNUNET_MESH_tunnel_get_tail (struct GNUNET_MESH_Tunnel *tunnel); |
411 | void *GNUNET_MESH_tunnel_get_data (struct GNUNET_MESH_Tunnel *tunnel); | 374 | |
375 | void | ||
376 | GNUNET_MESH_tunnel_set_data (struct GNUNET_MESH_Tunnel *tunnel, void *data); | ||
377 | void * | ||
378 | GNUNET_MESH_tunnel_get_data (struct GNUNET_MESH_Tunnel *tunnel); | ||
412 | 379 | ||
413 | #if 0 /* keep Emacsens' auto-indent happy */ | 380 | #if 0 /* keep Emacsens' auto-indent happy */ |
414 | { | 381 | { |
diff --git a/src/include/gnunet_mesh_service_new.h b/src/include/gnunet_mesh_service_new.h index 89b1c881e..83addfce5 100644 --- a/src/include/gnunet_mesh_service_new.h +++ b/src/include/gnunet_mesh_service_new.h | |||
@@ -140,17 +140,11 @@ typedef uint32_t GNUNET_MESH_ApplicationType; | |||
140 | * @return handle to the mesh service NULL on error | 140 | * @return handle to the mesh service NULL on error |
141 | * (in this case, init is never called) | 141 | * (in this case, init is never called) |
142 | */ | 142 | */ |
143 | struct GNUNET_MESH_Handle *GNUNET_MESH_connect (const struct | 143 | struct GNUNET_MESH_Handle * |
144 | GNUNET_CONFIGURATION_Handle | 144 | GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls, |
145 | *cfg, void *cls, | 145 | GNUNET_MESH_TunnelEndHandler cleaner, |
146 | GNUNET_MESH_TunnelEndHandler | 146 | const struct GNUNET_MESH_MessageHandler *handlers, |
147 | cleaner, | 147 | const GNUNET_MESH_ApplicationType *stypes); |
148 | const struct | ||
149 | GNUNET_MESH_MessageHandler | ||
150 | *handlers, | ||
151 | const | ||
152 | GNUNET_MESH_ApplicationType | ||
153 | *stypes); | ||
154 | 148 | ||
155 | 149 | ||
156 | /** | 150 | /** |
@@ -158,7 +152,8 @@ struct GNUNET_MESH_Handle *GNUNET_MESH_connect (const struct | |||
158 | * | 152 | * |
159 | * @param handle connection to mesh to disconnect | 153 | * @param handle connection to mesh to disconnect |
160 | */ | 154 | */ |
161 | void GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle); | 155 | void |
156 | GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle); | ||
162 | 157 | ||
163 | 158 | ||
164 | /** | 159 | /** |
@@ -198,20 +193,19 @@ typedef void (*GNUNET_MESH_TunnelConnectHandler) (void *cls, | |||
198 | * @param disconnect_handler function to call when peers are disconnected | 193 | * @param disconnect_handler function to call when peers are disconnected |
199 | * @param handler_cls closure for connect/disconnect handlers | 194 | * @param handler_cls closure for connect/disconnect handlers |
200 | */ | 195 | */ |
201 | struct GNUNET_MESH_Tunnel *GNUNET_MESH_tunnel_create (struct GNUNET_MESH_Handle | 196 | struct GNUNET_MESH_Tunnel * |
202 | *h, | 197 | GNUNET_MESH_tunnel_create (struct GNUNET_MESH_Handle *h, |
203 | GNUNET_MESH_TunnelConnectHandler | 198 | GNUNET_MESH_TunnelConnectHandler connect_handler, |
204 | connect_handler, | 199 | GNUNET_MESH_TunnelDisconnectHandler |
205 | GNUNET_MESH_TunnelDisconnectHandler | 200 | disconnect_handler, void *handler_cls); |
206 | disconnect_handler, | ||
207 | void *handler_cls); | ||
208 | 201 | ||
209 | /** | 202 | /** |
210 | * Destroy an existing tunnel. | 203 | * Destroy an existing tunnel. |
211 | * | 204 | * |
212 | * @param tun tunnel handle | 205 | * @param tun tunnel handle |
213 | */ | 206 | */ |
214 | void GNUNET_MESH_tunnel_destroy (struct GNUNET_MESH_Tunnel *tun); | 207 | void |
208 | GNUNET_MESH_tunnel_destroy (struct GNUNET_MESH_Tunnel *tun); | ||
215 | 209 | ||
216 | 210 | ||
217 | /** | 211 | /** |
@@ -222,10 +216,10 @@ void GNUNET_MESH_tunnel_destroy (struct GNUNET_MESH_Tunnel *tun); | |||
222 | * @param timeout how long to try to establish a connection | 216 | * @param timeout how long to try to establish a connection |
223 | * @param peer peer to add | 217 | * @param peer peer to add |
224 | */ | 218 | */ |
225 | void GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, | 219 | void |
226 | struct GNUNET_TIME_Relative timeout, | 220 | GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, |
227 | const struct GNUNET_PeerIdentity | 221 | struct GNUNET_TIME_Relative timeout, |
228 | *peer); | 222 | const struct GNUNET_PeerIdentity *peer); |
229 | 223 | ||
230 | 224 | ||
231 | /** | 225 | /** |
@@ -235,9 +229,9 @@ void GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, | |||
235 | * @param tunnel handle to existing tunnel | 229 | * @param tunnel handle to existing tunnel |
236 | * @param peer peer to remove | 230 | * @param peer peer to remove |
237 | */ | 231 | */ |
238 | void GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, | 232 | void |
239 | const struct GNUNET_PeerIdentity | 233 | GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, |
240 | *peer); | 234 | const struct GNUNET_PeerIdentity *peer); |
241 | 235 | ||
242 | 236 | ||
243 | /** | 237 | /** |
@@ -249,12 +243,10 @@ void GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, | |||
249 | * @param app_type application type that must be supported by the peer | 243 | * @param app_type application type that must be supported by the peer |
250 | * (MESH should discover peer in proximity handling this type) | 244 | * (MESH should discover peer in proximity handling this type) |
251 | */ | 245 | */ |
252 | void GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Tunnel | 246 | void |
253 | *tunnel, | 247 | GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Tunnel *tunnel, |
254 | struct GNUNET_TIME_Relative | 248 | struct GNUNET_TIME_Relative timeout, |
255 | timeout, | 249 | GNUNET_MESH_ApplicationType app_type); |
256 | GNUNET_MESH_ApplicationType | ||
257 | app_type); | ||
258 | 250 | ||
259 | 251 | ||
260 | /** | 252 | /** |
@@ -283,25 +275,14 @@ struct GNUNET_MESH_TransmitHandle; | |||
283 | * NULL if we can not even queue the request (insufficient | 275 | * NULL if we can not even queue the request (insufficient |
284 | * memory); if NULL is returned, "notify" will NOT be called. | 276 | * memory); if NULL is returned, "notify" will NOT be called. |
285 | */ | 277 | */ |
286 | struct GNUNET_MESH_TransmitHandle *GNUNET_MESH_notify_transmit_ready (struct | 278 | struct GNUNET_MESH_TransmitHandle * |
287 | GNUNET_MESH_Tunnel | 279 | GNUNET_MESH_notify_transmit_ready (struct GNUNET_MESH_Tunnel *tunnel, int cork, |
288 | *tunnel, | 280 | uint32_t priority, |
289 | int cork, | 281 | struct GNUNET_TIME_Relative maxdelay, |
290 | uint32_t | 282 | const struct GNUNET_PeerIdentity *target, |
291 | priority, | 283 | size_t notify_size, |
292 | struct | 284 | GNUNET_CONNECTION_TransmitReadyNotify notify, |
293 | GNUNET_TIME_Relative | 285 | void *notify_cls); |
294 | maxdelay, | ||
295 | const | ||
296 | struct | ||
297 | GNUNET_PeerIdentity | ||
298 | *target, | ||
299 | size_t | ||
300 | notify_size, | ||
301 | GNUNET_CONNECTION_TransmitReadyNotify | ||
302 | notify, | ||
303 | void | ||
304 | *notify_cls); | ||
305 | 286 | ||
306 | 287 | ||
307 | /** | 288 | /** |
@@ -309,8 +290,9 @@ struct GNUNET_MESH_TransmitHandle *GNUNET_MESH_notify_transmit_ready (struct | |||
309 | * | 290 | * |
310 | * @param th handle that was returned by "notify_transmit_ready". | 291 | * @param th handle that was returned by "notify_transmit_ready". |
311 | */ | 292 | */ |
312 | void GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle | 293 | void |
313 | *th); | 294 | GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle |
295 | *th); | ||
314 | 296 | ||
315 | 297 | ||
316 | #if 0 /* keep Emacsens' auto-indent happy */ | 298 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_nat_lib.h b/src/include/gnunet_nat_lib.h index 30eb50dd8..c521a560c 100644 --- a/src/include/gnunet_nat_lib.h +++ b/src/include/gnunet_nat_lib.h | |||
@@ -86,17 +86,13 @@ struct GNUNET_NAT_Handle; | |||
86 | * @param callback_cls closure for callback | 86 | * @param callback_cls closure for callback |
87 | * @return NULL on error, otherwise handle that can be used to unregister | 87 | * @return NULL on error, otherwise handle that can be used to unregister |
88 | */ | 88 | */ |
89 | struct GNUNET_NAT_Handle *GNUNET_NAT_register (const struct | 89 | struct GNUNET_NAT_Handle * |
90 | GNUNET_CONFIGURATION_Handle *cfg, | 90 | GNUNET_NAT_register (const struct GNUNET_CONFIGURATION_Handle *cfg, int is_tcp, |
91 | int is_tcp, uint16_t adv_port, | 91 | uint16_t adv_port, unsigned int num_addrs, |
92 | unsigned int num_addrs, | 92 | const struct sockaddr **addrs, const socklen_t * addrlens, |
93 | const struct sockaddr **addrs, | 93 | GNUNET_NAT_AddressCallback address_callback, |
94 | const socklen_t * addrlens, | 94 | GNUNET_NAT_ReversalCallback reversal_callback, |
95 | GNUNET_NAT_AddressCallback | 95 | void *callback_cls); |
96 | address_callback, | ||
97 | GNUNET_NAT_ReversalCallback | ||
98 | reversal_callback, | ||
99 | void *callback_cls); | ||
100 | 96 | ||
101 | 97 | ||
102 | /** | 98 | /** |
@@ -109,8 +105,9 @@ struct GNUNET_NAT_Handle *GNUNET_NAT_register (const struct | |||
109 | * GNUNET_NO if the address is not plausible, | 105 | * GNUNET_NO if the address is not plausible, |
110 | * GNUNET_SYSERR if the address is malformed | 106 | * GNUNET_SYSERR if the address is malformed |
111 | */ | 107 | */ |
112 | int GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, const void *addr, | 108 | int |
113 | socklen_t addrlen); | 109 | GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, const void *addr, |
110 | socklen_t addrlen); | ||
114 | 111 | ||
115 | 112 | ||
116 | /** | 113 | /** |
@@ -121,8 +118,9 @@ int GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, const void *addr, | |||
121 | * @param h handle (used for configuration) | 118 | * @param h handle (used for configuration) |
122 | * @param sa the address of the peer (IPv4-only) | 119 | * @param sa the address of the peer (IPv4-only) |
123 | */ | 120 | */ |
124 | void GNUNET_NAT_run_client (struct GNUNET_NAT_Handle *h, | 121 | void |
125 | const struct sockaddr_in *sa); | 122 | GNUNET_NAT_run_client (struct GNUNET_NAT_Handle *h, |
123 | const struct sockaddr_in *sa); | ||
126 | 124 | ||
127 | 125 | ||
128 | 126 | ||
@@ -132,7 +130,8 @@ void GNUNET_NAT_run_client (struct GNUNET_NAT_Handle *h, | |||
132 | * | 130 | * |
133 | * @param h the handle to stop | 131 | * @param h the handle to stop |
134 | */ | 132 | */ |
135 | void GNUNET_NAT_unregister (struct GNUNET_NAT_Handle *h); | 133 | void |
134 | GNUNET_NAT_unregister (struct GNUNET_NAT_Handle *h); | ||
136 | 135 | ||
137 | 136 | ||
138 | /** | 137 | /** |
@@ -163,12 +162,10 @@ typedef void (*GNUNET_NAT_TestCallback) (void *cls, int success); | |||
163 | * @param report_cls closure for report | 162 | * @param report_cls closure for report |
164 | * @return handle to cancel NAT test | 163 | * @return handle to cancel NAT test |
165 | */ | 164 | */ |
166 | struct GNUNET_NAT_Test *GNUNET_NAT_test_start (const struct | 165 | struct GNUNET_NAT_Test * |
167 | GNUNET_CONFIGURATION_Handle *cfg, | 166 | GNUNET_NAT_test_start (const struct GNUNET_CONFIGURATION_Handle *cfg, |
168 | int is_tcp, uint16_t bnd_port, | 167 | int is_tcp, uint16_t bnd_port, uint16_t adv_port, |
169 | uint16_t adv_port, | 168 | GNUNET_NAT_TestCallback report, void *report_cls); |
170 | GNUNET_NAT_TestCallback report, | ||
171 | void *report_cls); | ||
172 | 169 | ||
173 | 170 | ||
174 | /** | 171 | /** |
@@ -176,7 +173,8 @@ struct GNUNET_NAT_Test *GNUNET_NAT_test_start (const struct | |||
176 | * | 173 | * |
177 | * @param tst test to stop. | 174 | * @param tst test to stop. |
178 | */ | 175 | */ |
179 | void GNUNET_NAT_test_stop (struct GNUNET_NAT_Test *tst); | 176 | void |
177 | GNUNET_NAT_test_stop (struct GNUNET_NAT_Test *tst); | ||
180 | 178 | ||
181 | 179 | ||
182 | /** | 180 | /** |
@@ -203,13 +201,9 @@ struct GNUNET_NAT_ExternalHandle; | |||
203 | * @param cb_cls closure for 'cb' | 201 | * @param cb_cls closure for 'cb' |
204 | * @return handle for cancellation (can only be used until 'cb' is called), NULL on error | 202 | * @return handle for cancellation (can only be used until 'cb' is called), NULL on error |
205 | */ | 203 | */ |
206 | struct GNUNET_NAT_ExternalHandle *GNUNET_NAT_mini_get_external_ipv4 (struct | 204 | struct GNUNET_NAT_ExternalHandle * |
207 | GNUNET_TIME_Relative | 205 | GNUNET_NAT_mini_get_external_ipv4 (struct GNUNET_TIME_Relative timeout, |
208 | timeout, | 206 | GNUNET_NAT_IPCallback cb, void *cb_cls); |
209 | GNUNET_NAT_IPCallback | ||
210 | cb, | ||
211 | void | ||
212 | *cb_cls); | ||
213 | 207 | ||
214 | 208 | ||
215 | /** | 209 | /** |
@@ -217,8 +211,8 @@ struct GNUNET_NAT_ExternalHandle *GNUNET_NAT_mini_get_external_ipv4 (struct | |||
217 | * | 211 | * |
218 | * @param eh operation to cancel | 212 | * @param eh operation to cancel |
219 | */ | 213 | */ |
220 | void GNUNET_NAT_mini_get_external_ipv4_cancel (struct GNUNET_NAT_ExternalHandle | 214 | void |
221 | *eh); | 215 | GNUNET_NAT_mini_get_external_ipv4_cancel (struct GNUNET_NAT_ExternalHandle *eh); |
222 | 216 | ||
223 | 217 | ||
224 | /** | 218 | /** |
@@ -240,10 +234,9 @@ struct GNUNET_NAT_MiniHandle; | |||
240 | * @param ac_cls closure for 'ac' | 234 | * @param ac_cls closure for 'ac' |
241 | * @return NULL on error | 235 | * @return NULL on error |
242 | */ | 236 | */ |
243 | struct GNUNET_NAT_MiniHandle *GNUNET_NAT_mini_map_start (uint16_t port, | 237 | struct GNUNET_NAT_MiniHandle * |
244 | int is_tcp, | 238 | GNUNET_NAT_mini_map_start (uint16_t port, int is_tcp, |
245 | GNUNET_NAT_AddressCallback | 239 | GNUNET_NAT_AddressCallback ac, void *ac_cls); |
246 | ac, void *ac_cls); | ||
247 | 240 | ||
248 | 241 | ||
249 | /** | 242 | /** |
@@ -254,7 +247,8 @@ struct GNUNET_NAT_MiniHandle *GNUNET_NAT_mini_map_start (uint16_t port, | |||
254 | * | 247 | * |
255 | * @param mini the handle | 248 | * @param mini the handle |
256 | */ | 249 | */ |
257 | void GNUNET_NAT_mini_map_stop (struct GNUNET_NAT_MiniHandle *mini); | 250 | void |
251 | GNUNET_NAT_mini_map_stop (struct GNUNET_NAT_MiniHandle *mini); | ||
258 | 252 | ||
259 | 253 | ||
260 | #endif | 254 | #endif |
diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h index 0f38b855f..65b2042d5 100644 --- a/src/include/gnunet_network_lib.h +++ b/src/include/gnunet_network_lib.h | |||
@@ -83,13 +83,10 @@ struct GNUNET_NETWORK_FDSet | |||
83 | * @param address_len length of address | 83 | * @param address_len length of address |
84 | * @return client socket | 84 | * @return client socket |
85 | */ | 85 | */ |
86 | struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_accept (const struct | 86 | struct GNUNET_NETWORK_Handle * |
87 | GNUNET_NETWORK_Handle | 87 | GNUNET_NETWORK_socket_accept (const struct GNUNET_NETWORK_Handle *desc, |
88 | *desc, | 88 | struct sockaddr *address, |
89 | struct sockaddr | 89 | socklen_t * address_len); |
90 | *address, | ||
91 | socklen_t * | ||
92 | address_len); | ||
93 | 90 | ||
94 | 91 | ||
95 | /** | 92 | /** |
@@ -98,7 +95,8 @@ struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_accept (const struct | |||
98 | * @param fd socket to box | 95 | * @param fd socket to box |
99 | * @return NULL on error (including not supported on target platform) | 96 | * @return NULL on error (including not supported on target platform) |
100 | */ | 97 | */ |
101 | struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_box_native (int fd); | 98 | struct GNUNET_NETWORK_Handle * |
99 | GNUNET_NETWORK_socket_box_native (int fd); | ||
102 | 100 | ||
103 | 101 | ||
104 | /** | 102 | /** |
@@ -109,9 +107,10 @@ struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_box_native (int fd); | |||
109 | * @param address_len length of address | 107 | * @param address_len length of address |
110 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 108 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
111 | */ | 109 | */ |
112 | int GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc, | 110 | int |
113 | const struct sockaddr *address, | 111 | GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc, |
114 | socklen_t address_len); | 112 | const struct sockaddr *address, |
113 | socklen_t address_len); | ||
115 | 114 | ||
116 | /** | 115 | /** |
117 | * Close a socket. | 116 | * Close a socket. |
@@ -119,7 +118,8 @@ int GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc, | |||
119 | * @param desc socket to close | 118 | * @param desc socket to close |
120 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 119 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
121 | */ | 120 | */ |
122 | int GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc); | 121 | int |
122 | GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc); | ||
123 | 123 | ||
124 | 124 | ||
125 | /** | 125 | /** |
@@ -130,9 +130,10 @@ int GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc); | |||
130 | * @param address_len of address | 130 | * @param address_len of address |
131 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 131 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
132 | */ | 132 | */ |
133 | int GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc, | 133 | int |
134 | const struct sockaddr *address, | 134 | GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc, |
135 | socklen_t address_len); | 135 | const struct sockaddr *address, |
136 | socklen_t address_len); | ||
136 | 137 | ||
137 | 138 | ||
138 | /** | 139 | /** |
@@ -145,9 +146,10 @@ int GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc, | |||
145 | * @param optlen length of optval | 146 | * @param optlen length of optval |
146 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 147 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
147 | */ | 148 | */ |
148 | int GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc, | 149 | int |
149 | int level, int optname, void *optval, | 150 | GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc, |
150 | socklen_t * optlen); | 151 | int level, int optname, void *optval, |
152 | socklen_t * optlen); | ||
151 | 153 | ||
152 | 154 | ||
153 | /** | 155 | /** |
@@ -157,16 +159,18 @@ int GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc, | |||
157 | * @param backlog length of the listen queue | 159 | * @param backlog length of the listen queue |
158 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 160 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
159 | */ | 161 | */ |
160 | int GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc, | 162 | int |
161 | int backlog); | 163 | GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc, |
164 | int backlog); | ||
162 | 165 | ||
163 | 166 | ||
164 | /** | 167 | /** |
165 | * How much data is available to be read on this descriptor? | 168 | * How much data is available to be read on this descriptor? |
166 | * @param desc socket | 169 | * @param desc socket |
167 | */ | 170 | */ |
168 | ssize_t GNUNET_NETWORK_socket_recvfrom_amount (const struct | 171 | ssize_t |
169 | GNUNET_NETWORK_Handle *desc); | 172 | GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle |
173 | *desc); | ||
170 | 174 | ||
171 | 175 | ||
172 | /** | 176 | /** |
@@ -178,12 +182,10 @@ ssize_t GNUNET_NETWORK_socket_recvfrom_amount (const struct | |||
178 | * to be filled in by recvfrom | 182 | * to be filled in by recvfrom |
179 | * @param addrlen length of the addr | 183 | * @param addrlen length of the addr |
180 | */ | 184 | */ |
181 | ssize_t GNUNET_NETWORK_socket_recvfrom (const struct | 185 | ssize_t |
182 | GNUNET_NETWORK_Handle | 186 | GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle *desc, |
183 | *desc, void *buffer, | 187 | void *buffer, size_t length, |
184 | size_t length, | 188 | struct sockaddr *src_addr, socklen_t * addrlen); |
185 | struct sockaddr *src_addr, | ||
186 | socklen_t * addrlen); | ||
187 | 189 | ||
188 | 190 | ||
189 | /** | 191 | /** |
@@ -194,8 +196,9 @@ ssize_t GNUNET_NETWORK_socket_recvfrom (const struct | |||
194 | * @param length length of buffer | 196 | * @param length length of buffer |
195 | * @return number of bytes read | 197 | * @return number of bytes read |
196 | */ | 198 | */ |
197 | ssize_t GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc, | 199 | ssize_t |
198 | void *buffer, size_t length); | 200 | GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc, |
201 | void *buffer, size_t length); | ||
199 | 202 | ||
200 | 203 | ||
201 | /** | 204 | /** |
@@ -206,10 +209,11 @@ ssize_t GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc, | |||
206 | * @param timeout relative value when to return | 209 | * @param timeout relative value when to return |
207 | * @return number of selected sockets, GNUNET_SYSERR on error | 210 | * @return number of selected sockets, GNUNET_SYSERR on error |
208 | */ | 211 | */ |
209 | int GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds, | 212 | int |
210 | struct GNUNET_NETWORK_FDSet *wfds, | 213 | GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds, |
211 | struct GNUNET_NETWORK_FDSet *efds, | 214 | struct GNUNET_NETWORK_FDSet *wfds, |
212 | struct GNUNET_TIME_Relative timeout); | 215 | struct GNUNET_NETWORK_FDSet *efds, |
216 | struct GNUNET_TIME_Relative timeout); | ||
213 | 217 | ||
214 | 218 | ||
215 | /** | 219 | /** |
@@ -220,8 +224,9 @@ int GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds, | |||
220 | * @param length size of the buffer | 224 | * @param length size of the buffer |
221 | * @return number of bytes sent, GNUNET_SYSERR on error | 225 | * @return number of bytes sent, GNUNET_SYSERR on error |
222 | */ | 226 | */ |
223 | ssize_t GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc, | 227 | ssize_t |
224 | const void *buffer, size_t length); | 228 | GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc, |
229 | const void *buffer, size_t length); | ||
225 | 230 | ||
226 | 231 | ||
227 | /** | 232 | /** |
@@ -235,10 +240,11 @@ ssize_t GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc, | |||
235 | * @param dest_len length of address | 240 | * @param dest_len length of address |
236 | * @return number of bytes sent, GNUNET_SYSERR on error | 241 | * @return number of bytes sent, GNUNET_SYSERR on error |
237 | */ | 242 | */ |
238 | ssize_t GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc, | 243 | ssize_t |
239 | const void *message, size_t length, | 244 | GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc, |
240 | const struct sockaddr *dest_addr, | 245 | const void *message, size_t length, |
241 | socklen_t dest_len); | 246 | const struct sockaddr *dest_addr, |
247 | socklen_t dest_len); | ||
242 | 248 | ||
243 | 249 | ||
244 | /** | 250 | /** |
@@ -251,10 +257,10 @@ ssize_t GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc, | |||
251 | * @param option_len size of option_value | 257 | * @param option_len size of option_value |
252 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 258 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
253 | */ | 259 | */ |
254 | int GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd, | 260 | int |
255 | int level, int option_name, | 261 | GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd, int level, |
256 | const void *option_value, | 262 | int option_name, const void *option_value, |
257 | socklen_t option_len); | 263 | socklen_t option_len); |
258 | 264 | ||
259 | 265 | ||
260 | /** | 266 | /** |
@@ -264,8 +270,8 @@ int GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd, | |||
264 | * @param how type of shutdown | 270 | * @param how type of shutdown |
265 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 271 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
266 | */ | 272 | */ |
267 | int GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc, | 273 | int |
268 | int how); | 274 | GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc, int how); |
269 | 275 | ||
270 | 276 | ||
271 | /** | 277 | /** |
@@ -277,7 +283,8 @@ int GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc, | |||
277 | * @param desc socket | 283 | * @param desc socket |
278 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 284 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
279 | */ | 285 | */ |
280 | int GNUNET_NETWORK_socket_disable_corking (struct GNUNET_NETWORK_Handle *desc); | 286 | int |
287 | GNUNET_NETWORK_socket_disable_corking (struct GNUNET_NETWORK_Handle *desc); | ||
281 | 288 | ||
282 | 289 | ||
283 | /** | 290 | /** |
@@ -290,9 +297,8 @@ int GNUNET_NETWORK_socket_disable_corking (struct GNUNET_NETWORK_Handle *desc); | |||
290 | * @param protocol network protocol | 297 | * @param protocol network protocol |
291 | * @return new socket, NULL on error | 298 | * @return new socket, NULL on error |
292 | */ | 299 | */ |
293 | struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_create (int domain, | 300 | struct GNUNET_NETWORK_Handle * |
294 | int type, | 301 | GNUNET_NETWORK_socket_create (int domain, int type, int protocol); |
295 | int protocol); | ||
296 | 302 | ||
297 | 303 | ||
298 | /** | 304 | /** |
@@ -300,7 +306,8 @@ struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_create (int domain, | |||
300 | * | 306 | * |
301 | * @param fds fd set to clear | 307 | * @param fds fd set to clear |
302 | */ | 308 | */ |
303 | void GNUNET_NETWORK_fdset_zero (struct GNUNET_NETWORK_FDSet *fds); | 309 | void |
310 | GNUNET_NETWORK_fdset_zero (struct GNUNET_NETWORK_FDSet *fds); | ||
304 | 311 | ||
305 | 312 | ||
306 | /** | 313 | /** |
@@ -308,8 +315,9 @@ void GNUNET_NETWORK_fdset_zero (struct GNUNET_NETWORK_FDSet *fds); | |||
308 | * @param fds fd set | 315 | * @param fds fd set |
309 | * @param desc socket to add | 316 | * @param desc socket to add |
310 | */ | 317 | */ |
311 | void GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds, | 318 | void |
312 | const struct GNUNET_NETWORK_Handle *desc); | 319 | GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds, |
320 | const struct GNUNET_NETWORK_Handle *desc); | ||
313 | 321 | ||
314 | 322 | ||
315 | #ifdef __MINGW32__ | 323 | #ifdef __MINGW32__ |
@@ -319,9 +327,9 @@ void GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds, | |||
319 | * @param fds fd set | 327 | * @param fds fd set |
320 | * @param h the file handle to add | 328 | * @param h the file handle to add |
321 | */ | 329 | */ |
322 | void GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct | 330 | void |
323 | GNUNET_NETWORK_FDSet | 331 | GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct GNUNET_NETWORK_FDSet |
324 | *fds, HANDLE h); | 332 | *fds, HANDLE h); |
325 | #endif | 333 | #endif |
326 | 334 | ||
327 | 335 | ||
@@ -331,8 +339,9 @@ void GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct | |||
331 | * @param desc socket | 339 | * @param desc socket |
332 | * @return GNUNET_YES if the socket is in the set | 340 | * @return GNUNET_YES if the socket is in the set |
333 | */ | 341 | */ |
334 | int GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds, | 342 | int |
335 | const struct GNUNET_NETWORK_Handle *desc); | 343 | GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds, |
344 | const struct GNUNET_NETWORK_Handle *desc); | ||
336 | 345 | ||
337 | 346 | ||
338 | /** | 347 | /** |
@@ -340,8 +349,9 @@ int GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds, | |||
340 | * @param dst the fd set to add to | 349 | * @param dst the fd set to add to |
341 | * @param src the fd set to add from | 350 | * @param src the fd set to add from |
342 | */ | 351 | */ |
343 | void GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst, | 352 | void |
344 | const struct GNUNET_NETWORK_FDSet *src); | 353 | GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst, |
354 | const struct GNUNET_NETWORK_FDSet *src); | ||
345 | 355 | ||
346 | 356 | ||
347 | /** | 357 | /** |
@@ -349,8 +359,9 @@ void GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst, | |||
349 | * @param to destination | 359 | * @param to destination |
350 | * @param from source | 360 | * @param from source |
351 | */ | 361 | */ |
352 | void GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to, | 362 | void |
353 | const struct GNUNET_NETWORK_FDSet *from); | 363 | GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to, |
364 | const struct GNUNET_NETWORK_FDSet *from); | ||
354 | 365 | ||
355 | 366 | ||
356 | /** | 367 | /** |
@@ -359,7 +370,8 @@ void GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to, | |||
359 | * @param desc wrapper to process | 370 | * @param desc wrapper to process |
360 | * @return POSIX file descriptor | 371 | * @return POSIX file descriptor |
361 | */ | 372 | */ |
362 | int GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc); | 373 | int |
374 | GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc); | ||
363 | 375 | ||
364 | 376 | ||
365 | /** | 377 | /** |
@@ -368,8 +380,9 @@ int GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc); | |||
368 | * @param from native source set | 380 | * @param from native source set |
369 | * @param nfds the biggest socket number in from + 1 | 381 | * @param nfds the biggest socket number in from + 1 |
370 | */ | 382 | */ |
371 | void GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to, | 383 | void |
372 | const fd_set * from, int nfds); | 384 | GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to, |
385 | const fd_set * from, int nfds); | ||
373 | 386 | ||
374 | 387 | ||
375 | /** | 388 | /** |
@@ -378,7 +391,8 @@ void GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to, | |||
378 | * @param to destination | 391 | * @param to destination |
379 | * @param nfd native FD to set | 392 | * @param nfd native FD to set |
380 | */ | 393 | */ |
381 | void GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to, int nfd); | 394 | void |
395 | GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to, int nfd); | ||
382 | 396 | ||
383 | 397 | ||
384 | /** | 398 | /** |
@@ -388,8 +402,9 @@ void GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to, int nfd); | |||
388 | * @param nfd native FD to test, -1 for none | 402 | * @param nfd native FD to test, -1 for none |
389 | * @return GNUNET_YES if to contains nfd | 403 | * @return GNUNET_YES if to contains nfd |
390 | */ | 404 | */ |
391 | int GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to, | 405 | int |
392 | int nfd); | 406 | GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to, |
407 | int nfd); | ||
393 | 408 | ||
394 | 409 | ||
395 | /** | 410 | /** |
@@ -397,8 +412,9 @@ int GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to, | |||
397 | * @param fds fd set | 412 | * @param fds fd set |
398 | * @param h the file handle to add | 413 | * @param h the file handle to add |
399 | */ | 414 | */ |
400 | void GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds, | 415 | void |
401 | const struct GNUNET_DISK_FileHandle *h); | 416 | GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds, |
417 | const struct GNUNET_DISK_FileHandle *h); | ||
402 | 418 | ||
403 | 419 | ||
404 | /** | 420 | /** |
@@ -407,8 +423,9 @@ void GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds, | |||
407 | * @param h file handle | 423 | * @param h file handle |
408 | * @return GNUNET_YES if the file handle is part of the set | 424 | * @return GNUNET_YES if the file handle is part of the set |
409 | */ | 425 | */ |
410 | int GNUNET_NETWORK_fdset_handle_isset (const struct GNUNET_NETWORK_FDSet *fds, | 426 | int |
411 | const struct GNUNET_DISK_FileHandle *h); | 427 | GNUNET_NETWORK_fdset_handle_isset (const struct GNUNET_NETWORK_FDSet *fds, |
428 | const struct GNUNET_DISK_FileHandle *h); | ||
412 | 429 | ||
413 | 430 | ||
414 | /** | 431 | /** |
@@ -417,22 +434,25 @@ int GNUNET_NETWORK_fdset_handle_isset (const struct GNUNET_NETWORK_FDSet *fds, | |||
417 | * @param fds2 second fd set | 434 | * @param fds2 second fd set |
418 | * @return GNUNET_YES if they do overlap, GNUNET_NO otherwise | 435 | * @return GNUNET_YES if they do overlap, GNUNET_NO otherwise |
419 | */ | 436 | */ |
420 | int GNUNET_NETWORK_fdset_overlap (const struct GNUNET_NETWORK_FDSet *fds1, | 437 | int |
421 | const struct GNUNET_NETWORK_FDSet *fds2); | 438 | GNUNET_NETWORK_fdset_overlap (const struct GNUNET_NETWORK_FDSet *fds1, |
439 | const struct GNUNET_NETWORK_FDSet *fds2); | ||
422 | 440 | ||
423 | 441 | ||
424 | /** | 442 | /** |
425 | * Creates an fd set | 443 | * Creates an fd set |
426 | * @return a new fd set | 444 | * @return a new fd set |
427 | */ | 445 | */ |
428 | struct GNUNET_NETWORK_FDSet *GNUNET_NETWORK_fdset_create (void); | 446 | struct GNUNET_NETWORK_FDSet * |
447 | GNUNET_NETWORK_fdset_create (void); | ||
429 | 448 | ||
430 | 449 | ||
431 | /** | 450 | /** |
432 | * Releases the associated memory of an fd set | 451 | * Releases the associated memory of an fd set |
433 | * @param fds fd set | 452 | * @param fds fd set |
434 | */ | 453 | */ |
435 | void GNUNET_NETWORK_fdset_destroy (struct GNUNET_NETWORK_FDSet *fds); | 454 | void |
455 | GNUNET_NETWORK_fdset_destroy (struct GNUNET_NETWORK_FDSet *fds); | ||
436 | 456 | ||
437 | 457 | ||
438 | #if 0 /* keep Emacsens' auto-indent happy */ | 458 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_nse_service.h b/src/include/gnunet_nse_service.h index 91711ef5b..451f2a2dc 100644 --- a/src/include/gnunet_nse_service.h +++ b/src/include/gnunet_nse_service.h | |||
@@ -84,10 +84,9 @@ typedef void (*GNUNET_NSE_Callback) (void *cls, | |||
84 | * | 84 | * |
85 | * @return handle to use | 85 | * @return handle to use |
86 | */ | 86 | */ |
87 | struct GNUNET_NSE_Handle *GNUNET_NSE_connect (const struct | 87 | struct GNUNET_NSE_Handle * |
88 | GNUNET_CONFIGURATION_Handle *cfg, | 88 | GNUNET_NSE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, |
89 | GNUNET_NSE_Callback func, | 89 | GNUNET_NSE_Callback func, void *func_cls); |
90 | void *func_cls); | ||
91 | 90 | ||
92 | 91 | ||
93 | /** | 92 | /** |
@@ -96,7 +95,8 @@ struct GNUNET_NSE_Handle *GNUNET_NSE_connect (const struct | |||
96 | * @param h handle to destroy | 95 | * @param h handle to destroy |
97 | * | 96 | * |
98 | */ | 97 | */ |
99 | void GNUNET_NSE_disconnect (struct GNUNET_NSE_Handle *h); | 98 | void |
99 | GNUNET_NSE_disconnect (struct GNUNET_NSE_Handle *h); | ||
100 | 100 | ||
101 | 101 | ||
102 | #if 0 /* keep Emacsens' auto-indent happy */ | 102 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h index d2474d2d8..9d611af9b 100644 --- a/src/include/gnunet_os_lib.h +++ b/src/include/gnunet_os_lib.h | |||
@@ -135,8 +135,8 @@ enum GNUNET_OS_ProcessStatusType | |||
135 | * @param dirkind what kind of directory is desired? | 135 | * @param dirkind what kind of directory is desired? |
136 | * @return a pointer to the dir path (to be freed by the caller) | 136 | * @return a pointer to the dir path (to be freed by the caller) |
137 | */ | 137 | */ |
138 | char *GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind | 138 | char * |
139 | dirkind); | 139 | GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind dirkind); |
140 | 140 | ||
141 | 141 | ||
142 | /** | 142 | /** |
@@ -160,8 +160,9 @@ typedef int (*GNUNET_OS_NetworkInterfaceProcessor) (void *cls, const char *name, | |||
160 | * @param proc the callback function | 160 | * @param proc the callback function |
161 | * @param proc_cls closure for proc | 161 | * @param proc_cls closure for proc |
162 | */ | 162 | */ |
163 | void GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor | 163 | void |
164 | proc, void *proc_cls); | 164 | GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc, |
165 | void *proc_cls); | ||
165 | 166 | ||
166 | /** | 167 | /** |
167 | * @brief Get maximum string length returned by gethostname() | 168 | * @brief Get maximum string length returned by gethostname() |
@@ -183,7 +184,8 @@ void GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor | |||
183 | * | 184 | * |
184 | * @return pointer to the process sturcutre for this process | 185 | * @return pointer to the process sturcutre for this process |
185 | */ | 186 | */ |
186 | struct GNUNET_OS_Process *GNUNET_OS_process_current (void); | 187 | struct GNUNET_OS_Process * |
188 | GNUNET_OS_process_current (void); | ||
187 | 189 | ||
188 | 190 | ||
189 | /** | 191 | /** |
@@ -193,7 +195,8 @@ struct GNUNET_OS_Process *GNUNET_OS_process_current (void); | |||
193 | * @param sig signal | 195 | * @param sig signal |
194 | * @return 0 on success, -1 on error | 196 | * @return 0 on success, -1 on error |
195 | */ | 197 | */ |
196 | int GNUNET_OS_process_kill (struct GNUNET_OS_Process *proc, int sig); | 198 | int |
199 | GNUNET_OS_process_kill (struct GNUNET_OS_Process *proc, int sig); | ||
197 | 200 | ||
198 | 201 | ||
199 | /** | 202 | /** |
@@ -201,7 +204,8 @@ int GNUNET_OS_process_kill (struct GNUNET_OS_Process *proc, int sig); | |||
201 | * | 204 | * |
202 | * @param proc pointer to process structure | 205 | * @param proc pointer to process structure |
203 | */ | 206 | */ |
204 | void GNUNET_OS_process_close (struct GNUNET_OS_Process *proc); | 207 | void |
208 | GNUNET_OS_process_close (struct GNUNET_OS_Process *proc); | ||
205 | 209 | ||
206 | /** | 210 | /** |
207 | * Get the pid of the process in question | 211 | * Get the pid of the process in question |
@@ -210,7 +214,8 @@ void GNUNET_OS_process_close (struct GNUNET_OS_Process *proc); | |||
210 | * | 214 | * |
211 | * @return the current process id | 215 | * @return the current process id |
212 | */ | 216 | */ |
213 | pid_t GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc); | 217 | pid_t |
218 | GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc); | ||
214 | 219 | ||
215 | /** | 220 | /** |
216 | * Set process priority | 221 | * Set process priority |
@@ -219,8 +224,9 @@ pid_t GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc); | |||
219 | * @param prio priority value | 224 | * @param prio priority value |
220 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 225 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
221 | */ | 226 | */ |
222 | int GNUNET_OS_set_process_priority (struct GNUNET_OS_Process *proc, | 227 | int |
223 | enum GNUNET_SCHEDULER_Priority prio); | 228 | GNUNET_OS_set_process_priority (struct GNUNET_OS_Process *proc, |
229 | enum GNUNET_SCHEDULER_Priority prio); | ||
224 | 230 | ||
225 | 231 | ||
226 | /** | 232 | /** |
@@ -232,11 +238,10 @@ int GNUNET_OS_set_process_priority (struct GNUNET_OS_Process *proc, | |||
232 | * @param ... NULL-terminated list of arguments to the process | 238 | * @param ... NULL-terminated list of arguments to the process |
233 | * @return pointer to process structure of the new process, NULL on error | 239 | * @return pointer to process structure of the new process, NULL on error |
234 | */ | 240 | */ |
235 | struct GNUNET_OS_Process *GNUNET_OS_start_process (struct GNUNET_DISK_PipeHandle | 241 | struct GNUNET_OS_Process * |
236 | *pipe_stdin, | 242 | GNUNET_OS_start_process (struct GNUNET_DISK_PipeHandle *pipe_stdin, |
237 | struct GNUNET_DISK_PipeHandle | 243 | struct GNUNET_DISK_PipeHandle *pipe_stdout, |
238 | *pipe_stdout, | 244 | const char *filename, ...); |
239 | const char *filename, ...); | ||
240 | 245 | ||
241 | 246 | ||
242 | /** | 247 | /** |
@@ -248,14 +253,10 @@ struct GNUNET_OS_Process *GNUNET_OS_start_process (struct GNUNET_DISK_PipeHandle | |||
248 | * @param va NULL-terminated list of arguments to the process | 253 | * @param va NULL-terminated list of arguments to the process |
249 | * @return pointer to process structure of the new process, NULL on error | 254 | * @return pointer to process structure of the new process, NULL on error |
250 | */ | 255 | */ |
251 | struct GNUNET_OS_Process *GNUNET_OS_start_process_va (struct | 256 | struct GNUNET_OS_Process * |
252 | GNUNET_DISK_PipeHandle | 257 | GNUNET_OS_start_process_va (struct GNUNET_DISK_PipeHandle *pipe_stdin, |
253 | *pipe_stdin, | 258 | struct GNUNET_DISK_PipeHandle *pipe_stdout, |
254 | struct | 259 | const char *filename, va_list va); |
255 | GNUNET_DISK_PipeHandle | ||
256 | *pipe_stdout, | ||
257 | const char *filename, | ||
258 | va_list va); | ||
259 | 260 | ||
260 | /** | 261 | /** |
261 | * Start a process. | 262 | * Start a process. |
@@ -267,9 +268,9 @@ struct GNUNET_OS_Process *GNUNET_OS_start_process_va (struct | |||
267 | * including the process name as the first argument | 268 | * including the process name as the first argument |
268 | * @return pointer to process structure of the new process, NULL on error | 269 | * @return pointer to process structure of the new process, NULL on error |
269 | */ | 270 | */ |
270 | struct GNUNET_OS_Process *GNUNET_OS_start_process_v (const int *lsocks, | 271 | struct GNUNET_OS_Process * |
271 | const char *filename, | 272 | GNUNET_OS_start_process_v (const int *lsocks, const char *filename, |
272 | char *const argv[]); | 273 | char *const argv[]); |
273 | 274 | ||
274 | 275 | ||
275 | /** | 276 | /** |
@@ -290,7 +291,8 @@ typedef void (*GNUNET_OS_LineProcessor) (void *cls, const char *line); | |||
290 | * | 291 | * |
291 | * @param cmd handle to the process | 292 | * @param cmd handle to the process |
292 | */ | 293 | */ |
293 | void GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd); | 294 | void |
295 | GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd); | ||
294 | 296 | ||
295 | 297 | ||
296 | /** | 298 | /** |
@@ -304,12 +306,10 @@ void GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd); | |||
304 | * @param ... arguments to command | 306 | * @param ... arguments to command |
305 | * @return NULL on error | 307 | * @return NULL on error |
306 | */ | 308 | */ |
307 | struct GNUNET_OS_CommandHandle *GNUNET_OS_command_run (GNUNET_OS_LineProcessor | 309 | struct GNUNET_OS_CommandHandle * |
308 | proc, void *proc_cls, | 310 | GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc, void *proc_cls, |
309 | struct | 311 | struct GNUNET_TIME_Relative timeout, const char *binary, |
310 | GNUNET_TIME_Relative | 312 | ...); |
311 | timeout, | ||
312 | const char *binary, ...); | ||
313 | 313 | ||
314 | 314 | ||
315 | /** | 315 | /** |
@@ -320,9 +320,10 @@ struct GNUNET_OS_CommandHandle *GNUNET_OS_command_run (GNUNET_OS_LineProcessor | |||
320 | * @param code return code/signal number | 320 | * @param code return code/signal number |
321 | * @return GNUNET_OK on success, GNUNET_NO if the process is still running, GNUNET_SYSERR otherwise | 321 | * @return GNUNET_OK on success, GNUNET_NO if the process is still running, GNUNET_SYSERR otherwise |
322 | */ | 322 | */ |
323 | int GNUNET_OS_process_status (struct GNUNET_OS_Process *proc, | 323 | int |
324 | enum GNUNET_OS_ProcessStatusType *type, | 324 | GNUNET_OS_process_status (struct GNUNET_OS_Process *proc, |
325 | unsigned long *code); | 325 | enum GNUNET_OS_ProcessStatusType *type, |
326 | unsigned long *code); | ||
326 | 327 | ||
327 | 328 | ||
328 | /** | 329 | /** |
@@ -335,16 +336,17 @@ int GNUNET_OS_process_status (struct GNUNET_OS_Process *proc, | |||
335 | * @param proc pointer to process structure of the process to wait for | 336 | * @param proc pointer to process structure of the process to wait for |
336 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 337 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
337 | */ | 338 | */ |
338 | int GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc); | 339 | int |
340 | GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc); | ||
339 | 341 | ||
340 | 342 | ||
341 | /** | 343 | /** |
342 | * Connects this process to its parent via pipe | 344 | * Connects this process to its parent via pipe |
343 | */ | 345 | */ |
344 | void GNUNET_OS_install_parent_control_handler (void *cls, | 346 | void |
345 | const struct | 347 | GNUNET_OS_install_parent_control_handler (void *cls, |
346 | GNUNET_SCHEDULER_TaskContext | 348 | const struct |
347 | *tc); | 349 | GNUNET_SCHEDULER_TaskContext *tc); |
348 | 350 | ||
349 | 351 | ||
350 | /** | 352 | /** |
@@ -358,7 +360,8 @@ void GNUNET_OS_install_parent_control_handler (void *cls, | |||
358 | * GNUNET_NO if not SUID (but binary exists) | 360 | * GNUNET_NO if not SUID (but binary exists) |
359 | * GNUNET_SYSERR on error (no such binary or not executable) | 361 | * GNUNET_SYSERR on error (no such binary or not executable) |
360 | */ | 362 | */ |
361 | int GNUNET_OS_check_helper_binary (const char *binary); | 363 | int |
364 | GNUNET_OS_check_helper_binary (const char *binary); | ||
362 | 365 | ||
363 | 366 | ||
364 | #if 0 /* keep Emacsens' auto-indent happy */ | 367 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_peer_lib.h b/src/include/gnunet_peer_lib.h index da364dd44..89413aa59 100644 --- a/src/include/gnunet_peer_lib.h +++ b/src/include/gnunet_peer_lib.h | |||
@@ -53,7 +53,8 @@ typedef unsigned int GNUNET_PEER_Id; | |||
53 | * @param pid identity to find | 53 | * @param pid identity to find |
54 | * @return the interned identity or 0. | 54 | * @return the interned identity or 0. |
55 | */ | 55 | */ |
56 | GNUNET_PEER_Id GNUNET_PEER_search (const struct GNUNET_PeerIdentity *pid); | 56 | GNUNET_PEER_Id |
57 | GNUNET_PEER_search (const struct GNUNET_PeerIdentity *pid); | ||
57 | 58 | ||
58 | 59 | ||
59 | /** | 60 | /** |
@@ -63,7 +64,8 @@ GNUNET_PEER_Id GNUNET_PEER_search (const struct GNUNET_PeerIdentity *pid); | |||
63 | * @param pid identity to intern | 64 | * @param pid identity to intern |
64 | * @return the interned identity. | 65 | * @return the interned identity. |
65 | */ | 66 | */ |
66 | GNUNET_PEER_Id GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid); | 67 | GNUNET_PEER_Id |
68 | GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid); | ||
67 | 69 | ||
68 | 70 | ||
69 | /** | 71 | /** |
@@ -72,7 +74,8 @@ GNUNET_PEER_Id GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid); | |||
72 | * @param id identity to change the RC of | 74 | * @param id identity to change the RC of |
73 | * @param delta how much to change the RC | 75 | * @param delta how much to change the RC |
74 | */ | 76 | */ |
75 | void GNUNET_PEER_change_rc (GNUNET_PEER_Id id, int delta); | 77 | void |
78 | GNUNET_PEER_change_rc (GNUNET_PEER_Id id, int delta); | ||
76 | 79 | ||
77 | 80 | ||
78 | /** | 81 | /** |
@@ -81,7 +84,8 @@ void GNUNET_PEER_change_rc (GNUNET_PEER_Id id, int delta); | |||
81 | * @param ids array of PIDs to decrement the RCs of | 84 | * @param ids array of PIDs to decrement the RCs of |
82 | * @param count size of the ids array | 85 | * @param count size of the ids array |
83 | */ | 86 | */ |
84 | void GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id *ids, unsigned int count); | 87 | void |
88 | GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id *ids, unsigned int count); | ||
85 | 89 | ||
86 | 90 | ||
87 | /** | 91 | /** |
@@ -90,7 +94,8 @@ void GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id *ids, unsigned int count); | |||
90 | * @param id interned PID to convert | 94 | * @param id interned PID to convert |
91 | * @param pid where to write the normal peer identity | 95 | * @param pid where to write the normal peer identity |
92 | */ | 96 | */ |
93 | void GNUNET_PEER_resolve (GNUNET_PEER_Id id, struct GNUNET_PeerIdentity *pid); | 97 | void |
98 | GNUNET_PEER_resolve (GNUNET_PEER_Id id, struct GNUNET_PeerIdentity *pid); | ||
94 | 99 | ||
95 | 100 | ||
96 | /* ifndef GNUNET_PEER_LIB_H */ | 101 | /* ifndef GNUNET_PEER_LIB_H */ |
diff --git a/src/include/gnunet_peerinfo_service.h b/src/include/gnunet_peerinfo_service.h index 2013eb60f..50bbc458a 100644 --- a/src/include/gnunet_peerinfo_service.h +++ b/src/include/gnunet_peerinfo_service.h | |||
@@ -54,9 +54,8 @@ struct GNUNET_PEERINFO_Handle; | |||
54 | * @return NULL on error (configuration related, actual connection | 54 | * @return NULL on error (configuration related, actual connection |
55 | * etablishment may happen asynchronously). | 55 | * etablishment may happen asynchronously). |
56 | */ | 56 | */ |
57 | struct GNUNET_PEERINFO_Handle *GNUNET_PEERINFO_connect (const struct | 57 | struct GNUNET_PEERINFO_Handle * |
58 | GNUNET_CONFIGURATION_Handle | 58 | GNUNET_PEERINFO_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); |
59 | *cfg); | ||
60 | 59 | ||
61 | 60 | ||
62 | 61 | ||
@@ -69,7 +68,8 @@ struct GNUNET_PEERINFO_Handle *GNUNET_PEERINFO_connect (const struct | |||
69 | * | 68 | * |
70 | * @param h handle to disconnect | 69 | * @param h handle to disconnect |
71 | */ | 70 | */ |
72 | void GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h); | 71 | void |
72 | GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h); | ||
73 | 73 | ||
74 | 74 | ||
75 | /** | 75 | /** |
@@ -83,8 +83,9 @@ void GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h); | |||
83 | * @param h handle to the peerinfo service | 83 | * @param h handle to the peerinfo service |
84 | * @param hello the verified (!) HELLO message | 84 | * @param hello the verified (!) HELLO message |
85 | */ | 85 | */ |
86 | void GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h, | 86 | void |
87 | const struct GNUNET_HELLO_Message *hello); | 87 | GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h, |
88 | const struct GNUNET_HELLO_Message *hello); | ||
88 | 89 | ||
89 | 90 | ||
90 | /** | 91 | /** |
@@ -126,19 +127,12 @@ struct GNUNET_PEERINFO_IteratorContext; | |||
126 | * @return NULL on error (in this case, 'callback' is never called!), | 127 | * @return NULL on error (in this case, 'callback' is never called!), |
127 | * otherwise an iterator context | 128 | * otherwise an iterator context |
128 | */ | 129 | */ |
129 | struct GNUNET_PEERINFO_IteratorContext *GNUNET_PEERINFO_iterate (struct | 130 | struct GNUNET_PEERINFO_IteratorContext * |
130 | GNUNET_PEERINFO_Handle | 131 | GNUNET_PEERINFO_iterate (struct GNUNET_PEERINFO_Handle *h, |
131 | *h, | 132 | const struct GNUNET_PeerIdentity *peer, |
132 | const struct | 133 | struct GNUNET_TIME_Relative timeout, |
133 | GNUNET_PeerIdentity | 134 | GNUNET_PEERINFO_Processor callback, |
134 | *peer, | 135 | void *callback_cls); |
135 | struct | ||
136 | GNUNET_TIME_Relative | ||
137 | timeout, | ||
138 | GNUNET_PEERINFO_Processor | ||
139 | callback, | ||
140 | void | ||
141 | *callback_cls); | ||
142 | 136 | ||
143 | 137 | ||
144 | 138 | ||
@@ -147,8 +141,8 @@ struct GNUNET_PEERINFO_IteratorContext *GNUNET_PEERINFO_iterate (struct | |||
147 | * | 141 | * |
148 | * @param ic context of the iterator to cancel | 142 | * @param ic context of the iterator to cancel |
149 | */ | 143 | */ |
150 | void GNUNET_PEERINFO_iterate_cancel (struct GNUNET_PEERINFO_IteratorContext | 144 | void |
151 | *ic); | 145 | GNUNET_PEERINFO_iterate_cancel (struct GNUNET_PEERINFO_IteratorContext *ic); |
152 | 146 | ||
153 | 147 | ||
154 | 148 | ||
@@ -170,13 +164,9 @@ struct GNUNET_PEERINFO_NotifyContext; | |||
170 | * @param callback_cls closure for callback | 164 | * @param callback_cls closure for callback |
171 | * @return NULL on error | 165 | * @return NULL on error |
172 | */ | 166 | */ |
173 | struct GNUNET_PEERINFO_NotifyContext *GNUNET_PEERINFO_notify (const struct | 167 | struct GNUNET_PEERINFO_NotifyContext * |
174 | GNUNET_CONFIGURATION_Handle | 168 | GNUNET_PEERINFO_notify (const struct GNUNET_CONFIGURATION_Handle *cfg, |
175 | *cfg, | 169 | GNUNET_PEERINFO_Processor callback, void *callback_cls); |
176 | GNUNET_PEERINFO_Processor | ||
177 | callback, | ||
178 | void | ||
179 | *callback_cls); | ||
180 | 170 | ||
181 | 171 | ||
182 | /** | 172 | /** |
@@ -184,7 +174,8 @@ struct GNUNET_PEERINFO_NotifyContext *GNUNET_PEERINFO_notify (const struct | |||
184 | * | 174 | * |
185 | * @param nc context to stop notifying | 175 | * @param nc context to stop notifying |
186 | */ | 176 | */ |
187 | void GNUNET_PEERINFO_notify_cancel (struct GNUNET_PEERINFO_NotifyContext *nc); | 177 | void |
178 | GNUNET_PEERINFO_notify_cancel (struct GNUNET_PEERINFO_NotifyContext *nc); | ||
188 | 179 | ||
189 | 180 | ||
190 | #if 0 /* keep Emacsens' auto-indent happy */ | 181 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_plugin_lib.h b/src/include/gnunet_plugin_lib.h index 9608abd4c..fbc7e2617 100644 --- a/src/include/gnunet_plugin_lib.h +++ b/src/include/gnunet_plugin_lib.h | |||
@@ -59,7 +59,8 @@ typedef void *(*GNUNET_PLUGIN_Callback) (void *arg); | |||
59 | * @param library_name name of the plugin to test if it is installed | 59 | * @param library_name name of the plugin to test if it is installed |
60 | * @return GNUNET_YES if the plugin exists, GNUNET_NO if not | 60 | * @return GNUNET_YES if the plugin exists, GNUNET_NO if not |
61 | */ | 61 | */ |
62 | int GNUNET_PLUGIN_test (const char *library_name); | 62 | int |
63 | GNUNET_PLUGIN_test (const char *library_name); | ||
63 | 64 | ||
64 | /** | 65 | /** |
65 | * Setup plugin (runs the "init" callback and returns whatever "init" | 66 | * Setup plugin (runs the "init" callback and returns whatever "init" |
@@ -73,7 +74,8 @@ int GNUNET_PLUGIN_test (const char *library_name); | |||
73 | * @param arg argument to the plugin initialization function | 74 | * @param arg argument to the plugin initialization function |
74 | * @return whatever the initialization function returned, NULL on error | 75 | * @return whatever the initialization function returned, NULL on error |
75 | */ | 76 | */ |
76 | void *GNUNET_PLUGIN_load (const char *library_name, void *arg); | 77 | void * |
78 | GNUNET_PLUGIN_load (const char *library_name, void *arg); | ||
77 | 79 | ||
78 | 80 | ||
79 | /** | 81 | /** |
@@ -85,7 +87,8 @@ void *GNUNET_PLUGIN_load (const char *library_name, void *arg); | |||
85 | * @return whatever the shutdown function returned, typically NULL | 87 | * @return whatever the shutdown function returned, typically NULL |
86 | * or a "char *" representing the error message | 88 | * or a "char *" representing the error message |
87 | */ | 89 | */ |
88 | void *GNUNET_PLUGIN_unload (const char *library_name, void *arg); | 90 | void * |
91 | GNUNET_PLUGIN_unload (const char *library_name, void *arg); | ||
89 | 92 | ||
90 | 93 | ||
91 | #if 0 /* keep Emacsens' auto-indent happy */ | 94 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_program_lib.h b/src/include/gnunet_program_lib.h index 8881bfa9d..48d5280ee 100644 --- a/src/include/gnunet_program_lib.h +++ b/src/include/gnunet_program_lib.h | |||
@@ -66,10 +66,11 @@ typedef void (*GNUNET_PROGRAM_Main) (void *cls, char *const *args, | |||
66 | * @param task_cls closure for task | 66 | * @param task_cls closure for task |
67 | * @return GNUNET_SYSERR on error, GNUNET_OK on success | 67 | * @return GNUNET_SYSERR on error, GNUNET_OK on success |
68 | */ | 68 | */ |
69 | int GNUNET_PROGRAM_run (int argc, char *const *argv, const char *binaryName, | 69 | int |
70 | const char *binaryHelp, | 70 | GNUNET_PROGRAM_run (int argc, char *const *argv, const char *binaryName, |
71 | const struct GNUNET_GETOPT_CommandLineOption *options, | 71 | const char *binaryHelp, |
72 | GNUNET_PROGRAM_Main task, void *task_cls); | 72 | const struct GNUNET_GETOPT_CommandLineOption *options, |
73 | GNUNET_PROGRAM_Main task, void *task_cls); | ||
73 | 74 | ||
74 | 75 | ||
75 | 76 | ||
diff --git a/src/include/gnunet_pseudonym_lib.h b/src/include/gnunet_pseudonym_lib.h index 7a9373cc4..138375fe1 100644 --- a/src/include/gnunet_pseudonym_lib.h +++ b/src/include/gnunet_pseudonym_lib.h | |||
@@ -61,8 +61,9 @@ typedef int (*GNUNET_PSEUDONYM_Iterator) (void *cls, | |||
61 | * @param delta by how much should the rating be changed? | 61 | * @param delta by how much should the rating be changed? |
62 | * @return new rating of the namespace | 62 | * @return new rating of the namespace |
63 | */ | 63 | */ |
64 | int GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg, | 64 | int |
65 | const GNUNET_HashCode * nsid, int delta); | 65 | GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg, |
66 | const GNUNET_HashCode * nsid, int delta); | ||
66 | 67 | ||
67 | /** | 68 | /** |
68 | * Add a pseudonym to the set of known pseudonyms. | 69 | * Add a pseudonym to the set of known pseudonyms. |
@@ -73,9 +74,10 @@ int GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
73 | * @param id the pseudonym identifier | 74 | * @param id the pseudonym identifier |
74 | * @param meta metadata for the pseudonym | 75 | * @param meta metadata for the pseudonym |
75 | */ | 76 | */ |
76 | void GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg, | 77 | void |
77 | const GNUNET_HashCode * id, | 78 | GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg, |
78 | const struct GNUNET_CONTAINER_MetaData *meta); | 79 | const GNUNET_HashCode * id, |
80 | const struct GNUNET_CONTAINER_MetaData *meta); | ||
79 | 81 | ||
80 | 82 | ||
81 | /** | 83 | /** |
@@ -86,41 +88,44 @@ void GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
86 | * @param closure closure for iterator | 88 | * @param closure closure for iterator |
87 | * @return number of pseudonyms found | 89 | * @return number of pseudonyms found |
88 | */ | 90 | */ |
89 | int GNUNET_PSEUDONYM_list_all (const struct GNUNET_CONFIGURATION_Handle *cfg, | 91 | int |
90 | GNUNET_PSEUDONYM_Iterator iterator, | 92 | GNUNET_PSEUDONYM_list_all (const struct GNUNET_CONFIGURATION_Handle *cfg, |
91 | void *closure); | 93 | GNUNET_PSEUDONYM_Iterator iterator, void *closure); |
92 | 94 | ||
93 | /** | 95 | /** |
94 | * Register callback to be invoked whenever we discover | 96 | * Register callback to be invoked whenever we discover |
95 | * a new pseudonym. | 97 | * a new pseudonym. |
96 | */ | 98 | */ |
97 | int GNUNET_PSEUDONYM_discovery_callback_register (const struct | 99 | int |
98 | GNUNET_CONFIGURATION_Handle | 100 | GNUNET_PSEUDONYM_discovery_callback_register (const struct |
99 | *cfg, | 101 | GNUNET_CONFIGURATION_Handle *cfg, |
100 | GNUNET_PSEUDONYM_Iterator | 102 | GNUNET_PSEUDONYM_Iterator |
101 | iterator, void *closure); | 103 | iterator, void *closure); |
102 | 104 | ||
103 | /** | 105 | /** |
104 | * Unregister namespace discovery callback. | 106 | * Unregister namespace discovery callback. |
105 | */ | 107 | */ |
106 | int GNUNET_PSEUDONYM_discovery_callback_unregister (GNUNET_PSEUDONYM_Iterator | 108 | int |
107 | iterator, void *closure); | 109 | GNUNET_PSEUDONYM_discovery_callback_unregister (GNUNET_PSEUDONYM_Iterator |
110 | iterator, void *closure); | ||
108 | 111 | ||
109 | /** | 112 | /** |
110 | * Return the unique, human readable name for the given pseudonym. | 113 | * Return the unique, human readable name for the given pseudonym. |
111 | * | 114 | * |
112 | * @return NULL on failure (should never happen) | 115 | * @return NULL on failure (should never happen) |
113 | */ | 116 | */ |
114 | char *GNUNET_PSEUDONYM_id_to_name (const struct GNUNET_CONFIGURATION_Handle | 117 | char * |
115 | *cfg, const GNUNET_HashCode * pseudo); | 118 | GNUNET_PSEUDONYM_id_to_name (const struct GNUNET_CONFIGURATION_Handle *cfg, |
119 | const GNUNET_HashCode * pseudo); | ||
116 | 120 | ||
117 | /** | 121 | /** |
118 | * Get the pseudonym ID belonging to the given human readable name. | 122 | * Get the pseudonym ID belonging to the given human readable name. |
119 | * | 123 | * |
120 | * @return GNUNET_OK on success | 124 | * @return GNUNET_OK on success |
121 | */ | 125 | */ |
122 | int GNUNET_PSEUDONYM_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg, | 126 | int |
123 | const char *hname, GNUNET_HashCode * psid); | 127 | GNUNET_PSEUDONYM_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg, |
128 | const char *hname, GNUNET_HashCode * psid); | ||
124 | 129 | ||
125 | 130 | ||
126 | #if 0 /* keep Emacsens' auto-indent happy */ | 131 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_resolver_service.h b/src/include/gnunet_resolver_service.h index f24bf5c5e..e55a014e6 100644 --- a/src/include/gnunet_resolver_service.h +++ b/src/include/gnunet_resolver_service.h | |||
@@ -63,13 +63,15 @@ struct GNUNET_RESOLVER_RequestHandle; | |||
63 | * | 63 | * |
64 | * @param cfg configuration to use | 64 | * @param cfg configuration to use |
65 | */ | 65 | */ |
66 | void GNUNET_RESOLVER_connect (const struct GNUNET_CONFIGURATION_Handle *c); | 66 | void |
67 | GNUNET_RESOLVER_connect (const struct GNUNET_CONFIGURATION_Handle *c); | ||
67 | 68 | ||
68 | 69 | ||
69 | /** | 70 | /** |
70 | * Destroy the connection to the resolver service. | 71 | * Destroy the connection to the resolver service. |
71 | */ | 72 | */ |
72 | void GNUNET_RESOLVER_disconnect (void); | 73 | void |
74 | GNUNET_RESOLVER_disconnect (void); | ||
73 | 75 | ||
74 | 76 | ||
75 | /** | 77 | /** |
@@ -82,16 +84,11 @@ void GNUNET_RESOLVER_disconnect (void); | |||
82 | * @param timeout how long to try resolving | 84 | * @param timeout how long to try resolving |
83 | * @return handle that can be used to cancel the request, NULL on error | 85 | * @return handle that can be used to cancel the request, NULL on error |
84 | */ | 86 | */ |
85 | struct GNUNET_RESOLVER_RequestHandle *GNUNET_RESOLVER_ip_get (const char | 87 | struct GNUNET_RESOLVER_RequestHandle * |
86 | *hostname, | 88 | GNUNET_RESOLVER_ip_get (const char *hostname, int domain, |
87 | int domain, | 89 | struct GNUNET_TIME_Relative timeout, |
88 | struct | 90 | GNUNET_RESOLVER_AddressCallback callback, |
89 | GNUNET_TIME_Relative | 91 | void *callback_cls); |
90 | timeout, | ||
91 | GNUNET_RESOLVER_AddressCallback | ||
92 | callback, | ||
93 | void | ||
94 | *callback_cls); | ||
95 | 92 | ||
96 | 93 | ||
97 | /** | 94 | /** |
@@ -104,15 +101,11 @@ struct GNUNET_RESOLVER_RequestHandle *GNUNET_RESOLVER_ip_get (const char | |||
104 | * @param timeout how long to try resolving | 101 | * @param timeout how long to try resolving |
105 | * @return handle that can be used to cancel the request, NULL on error | 102 | * @return handle that can be used to cancel the request, NULL on error |
106 | */ | 103 | */ |
107 | struct GNUNET_RESOLVER_RequestHandle *GNUNET_RESOLVER_hostname_resolve (int | 104 | struct GNUNET_RESOLVER_RequestHandle * |
108 | domain, | 105 | GNUNET_RESOLVER_hostname_resolve (int domain, |
109 | struct | 106 | struct GNUNET_TIME_Relative timeout, |
110 | GNUNET_TIME_Relative | 107 | GNUNET_RESOLVER_AddressCallback callback, |
111 | timeout, | 108 | void *cls); |
112 | GNUNET_RESOLVER_AddressCallback | ||
113 | callback, | ||
114 | void | ||
115 | *cls); | ||
116 | 109 | ||
117 | 110 | ||
118 | /** | 111 | /** |
@@ -130,7 +123,8 @@ typedef void (*GNUNET_RESOLVER_HostnameCallback) (void *cls, | |||
130 | * | 123 | * |
131 | * @return local hostname, caller must free | 124 | * @return local hostname, caller must free |
132 | */ | 125 | */ |
133 | char *GNUNET_RESOLVER_local_fqdn_get (void); | 126 | char * |
127 | GNUNET_RESOLVER_local_fqdn_get (void); | ||
134 | 128 | ||
135 | 129 | ||
136 | /** | 130 | /** |
@@ -145,19 +139,12 @@ char *GNUNET_RESOLVER_local_fqdn_get (void); | |||
145 | * @param cls closure for callback | 139 | * @param cls closure for callback |
146 | * @return handle that can be used to cancel the request, NULL on error | 140 | * @return handle that can be used to cancel the request, NULL on error |
147 | */ | 141 | */ |
148 | struct GNUNET_RESOLVER_RequestHandle *GNUNET_RESOLVER_hostname_get (const struct | 142 | struct GNUNET_RESOLVER_RequestHandle * |
149 | sockaddr | 143 | GNUNET_RESOLVER_hostname_get (const struct sockaddr *sa, socklen_t salen, |
150 | *sa, | 144 | int do_resolve, |
151 | socklen_t | 145 | struct GNUNET_TIME_Relative timeout, |
152 | salen, | 146 | GNUNET_RESOLVER_HostnameCallback callback, |
153 | int | 147 | void *cls); |
154 | do_resolve, | ||
155 | struct | ||
156 | GNUNET_TIME_Relative | ||
157 | timeout, | ||
158 | GNUNET_RESOLVER_HostnameCallback | ||
159 | callback, | ||
160 | void *cls); | ||
161 | 148 | ||
162 | 149 | ||
163 | /** | 150 | /** |
@@ -168,7 +155,8 @@ struct GNUNET_RESOLVER_RequestHandle *GNUNET_RESOLVER_hostname_get (const struct | |||
168 | * | 155 | * |
169 | * @param rh handle of request to cancel | 156 | * @param rh handle of request to cancel |
170 | */ | 157 | */ |
171 | void GNUNET_RESOLVER_request_cancel (struct GNUNET_RESOLVER_RequestHandle *rh); | 158 | void |
159 | GNUNET_RESOLVER_request_cancel (struct GNUNET_RESOLVER_RequestHandle *rh); | ||
172 | 160 | ||
173 | 161 | ||
174 | #if 0 /* keep Emacsens' auto-indent happy */ | 162 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h index 9ab3a3a84..0f80b9cee 100644 --- a/src/include/gnunet_scheduler_lib.h +++ b/src/include/gnunet_scheduler_lib.h | |||
@@ -224,7 +224,8 @@ typedef int (*GNUNET_SCHEDULER_select) (void *cls, | |||
224 | * @param task task to run first (and immediately) | 224 | * @param task task to run first (and immediately) |
225 | * @param task_cls closure of task | 225 | * @param task_cls closure of task |
226 | */ | 226 | */ |
227 | void GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls); | 227 | void |
228 | GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls); | ||
228 | 229 | ||
229 | 230 | ||
230 | /** | 231 | /** |
@@ -234,7 +235,8 @@ void GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls); | |||
234 | * priorities and prerequisite tasks). Note that tasks | 235 | * priorities and prerequisite tasks). Note that tasks |
235 | * scheduled AFTER this call may still be delayed arbitrarily. | 236 | * scheduled AFTER this call may still be delayed arbitrarily. |
236 | */ | 237 | */ |
237 | void GNUNET_SCHEDULER_shutdown (); | 238 | void |
239 | GNUNET_SCHEDULER_shutdown (); | ||
238 | 240 | ||
239 | 241 | ||
240 | /** | 242 | /** |
@@ -248,7 +250,8 @@ void GNUNET_SCHEDULER_shutdown (); | |||
248 | * all priority levels | 250 | * all priority levels |
249 | * @return number of tasks pending right now | 251 | * @return number of tasks pending right now |
250 | */ | 252 | */ |
251 | unsigned int GNUNET_SCHEDULER_get_load (enum GNUNET_SCHEDULER_Priority p); | 253 | unsigned int |
254 | GNUNET_SCHEDULER_get_load (enum GNUNET_SCHEDULER_Priority p); | ||
252 | 255 | ||
253 | 256 | ||
254 | /** | 257 | /** |
@@ -258,7 +261,8 @@ unsigned int GNUNET_SCHEDULER_get_load (enum GNUNET_SCHEDULER_Priority p); | |||
258 | * | 261 | * |
259 | * * @return reason(s) why the current task is run | 262 | * * @return reason(s) why the current task is run |
260 | */ | 263 | */ |
261 | enum GNUNET_SCHEDULER_Reason GNUNET_SCHEDULER_get_reason (); | 264 | enum GNUNET_SCHEDULER_Reason |
265 | GNUNET_SCHEDULER_get_reason (); | ||
262 | 266 | ||
263 | 267 | ||
264 | /** | 268 | /** |
@@ -268,7 +272,8 @@ enum GNUNET_SCHEDULER_Reason GNUNET_SCHEDULER_get_reason (); | |||
268 | * * @param task id of the task to cancel | 272 | * * @param task id of the task to cancel |
269 | * @return the closure of the callback of the cancelled task | 273 | * @return the closure of the callback of the cancelled task |
270 | */ | 274 | */ |
271 | void *GNUNET_SCHEDULER_cancel (GNUNET_SCHEDULER_TaskIdentifier task); | 275 | void * |
276 | GNUNET_SCHEDULER_cancel (GNUNET_SCHEDULER_TaskIdentifier task); | ||
272 | 277 | ||
273 | 278 | ||
274 | /** | 279 | /** |
@@ -280,9 +285,9 @@ void *GNUNET_SCHEDULER_cancel (GNUNET_SCHEDULER_TaskIdentifier task); | |||
280 | * @param task_cls closure of task | 285 | * @param task_cls closure of task |
281 | * @param reason reason for task invocation | 286 | * @param reason reason for task invocation |
282 | */ | 287 | */ |
283 | void GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_Task task, | 288 | void |
284 | void *task_cls, | 289 | GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_Task task, void *task_cls, |
285 | enum GNUNET_SCHEDULER_Reason reason); | 290 | enum GNUNET_SCHEDULER_Reason reason); |
286 | 291 | ||
287 | 292 | ||
288 | /** | 293 | /** |
@@ -315,13 +320,9 @@ GNUNET_SCHEDULER_add_after (GNUNET_SCHEDULER_TaskIdentifier prerequisite_task, | |||
315 | * @return unique task identifier for the job | 320 | * @return unique task identifier for the job |
316 | * only valid until "task" is started! | 321 | * only valid until "task" is started! |
317 | */ | 322 | */ |
318 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_with_priority (enum | 323 | GNUNET_SCHEDULER_TaskIdentifier |
319 | GNUNET_SCHEDULER_Priority | 324 | GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio, |
320 | prio, | 325 | GNUNET_SCHEDULER_Task task, void *task_cls); |
321 | GNUNET_SCHEDULER_Task | ||
322 | task, | ||
323 | void | ||
324 | *task_cls); | ||
325 | 326 | ||
326 | 327 | ||
327 | /** | 328 | /** |
@@ -333,8 +334,8 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_with_priority (enum | |||
333 | * @return unique task identifier for the job | 334 | * @return unique task identifier for the job |
334 | * only valid until "task" is started! | 335 | * only valid until "task" is started! |
335 | */ | 336 | */ |
336 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task | 337 | GNUNET_SCHEDULER_TaskIdentifier |
337 | task, void *task_cls); | 338 | GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task task, void *task_cls); |
338 | 339 | ||
339 | 340 | ||
340 | /** | 341 | /** |
@@ -351,12 +352,10 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task | |||
351 | * @return unique task identifier for the job | 352 | * @return unique task identifier for the job |
352 | * only valid until "task" is started! | 353 | * only valid until "task" is started! |
353 | */ | 354 | */ |
354 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_now_with_lifeness (int | 355 | GNUNET_SCHEDULER_TaskIdentifier |
355 | lifeness, | 356 | GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness, |
356 | GNUNET_SCHEDULER_Task | 357 | GNUNET_SCHEDULER_Task task, |
357 | task, | 358 | void *task_cls); |
358 | void | ||
359 | *task_cls); | ||
360 | 359 | ||
361 | 360 | ||
362 | /** | 361 | /** |
@@ -371,12 +370,9 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_now_with_lifeness (int | |||
371 | * @return unique task identifier for the job | 370 | * @return unique task identifier for the job |
372 | * only valid until "task" is started! | 371 | * only valid until "task" is started! |
373 | */ | 372 | */ |
374 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_delayed (struct | 373 | GNUNET_SCHEDULER_TaskIdentifier |
375 | GNUNET_TIME_Relative | 374 | GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay, |
376 | delay, | 375 | GNUNET_SCHEDULER_Task task, void *task_cls); |
377 | GNUNET_SCHEDULER_Task | ||
378 | task, | ||
379 | void *task_cls); | ||
380 | 376 | ||
381 | 377 | ||
382 | /** | 378 | /** |
@@ -395,15 +391,10 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_delayed (struct | |||
395 | * @return unique task identifier for the job | 391 | * @return unique task identifier for the job |
396 | * only valid until "task" is started! | 392 | * only valid until "task" is started! |
397 | */ | 393 | */ |
398 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_read_net (struct | 394 | GNUNET_SCHEDULER_TaskIdentifier |
399 | GNUNET_TIME_Relative | 395 | GNUNET_SCHEDULER_add_read_net (struct GNUNET_TIME_Relative delay, |
400 | delay, | 396 | struct GNUNET_NETWORK_Handle *rfd, |
401 | struct | 397 | GNUNET_SCHEDULER_Task task, void *task_cls); |
402 | GNUNET_NETWORK_Handle | ||
403 | *rfd, | ||
404 | GNUNET_SCHEDULER_Task | ||
405 | task, | ||
406 | void *task_cls); | ||
407 | 398 | ||
408 | 399 | ||
409 | /** | 400 | /** |
@@ -422,15 +413,10 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_read_net (struct | |||
422 | * @return unique task identifier for the job | 413 | * @return unique task identifier for the job |
423 | * only valid until "task" is started! | 414 | * only valid until "task" is started! |
424 | */ | 415 | */ |
425 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_write_net (struct | 416 | GNUNET_SCHEDULER_TaskIdentifier |
426 | GNUNET_TIME_Relative | 417 | GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay, |
427 | delay, | 418 | struct GNUNET_NETWORK_Handle *wfd, |
428 | struct | 419 | GNUNET_SCHEDULER_Task task, void *task_cls); |
429 | GNUNET_NETWORK_Handle | ||
430 | *wfd, | ||
431 | GNUNET_SCHEDULER_Task | ||
432 | task, | ||
433 | void *task_cls); | ||
434 | 420 | ||
435 | 421 | ||
436 | /** | 422 | /** |
@@ -449,15 +435,10 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_write_net (struct | |||
449 | * @return unique task identifier for the job | 435 | * @return unique task identifier for the job |
450 | * only valid until "task" is started! | 436 | * only valid until "task" is started! |
451 | */ | 437 | */ |
452 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_read_file (struct | 438 | GNUNET_SCHEDULER_TaskIdentifier |
453 | GNUNET_TIME_Relative | 439 | GNUNET_SCHEDULER_add_read_file (struct GNUNET_TIME_Relative delay, |
454 | delay, | 440 | const struct GNUNET_DISK_FileHandle *rfd, |
455 | const struct | 441 | GNUNET_SCHEDULER_Task task, void *task_cls); |
456 | GNUNET_DISK_FileHandle | ||
457 | *rfd, | ||
458 | GNUNET_SCHEDULER_Task | ||
459 | task, | ||
460 | void *task_cls); | ||
461 | 442 | ||
462 | 443 | ||
463 | /** | 444 | /** |
@@ -476,16 +457,10 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_read_file (struct | |||
476 | * @return unique task identifier for the job | 457 | * @return unique task identifier for the job |
477 | * only valid until "task" is started! | 458 | * only valid until "task" is started! |
478 | */ | 459 | */ |
479 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_write_file (struct | 460 | GNUNET_SCHEDULER_TaskIdentifier |
480 | GNUNET_TIME_Relative | 461 | GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay, |
481 | delay, | 462 | const struct GNUNET_DISK_FileHandle *wfd, |
482 | const struct | 463 | GNUNET_SCHEDULER_Task task, void *task_cls); |
483 | GNUNET_DISK_FileHandle | ||
484 | *wfd, | ||
485 | GNUNET_SCHEDULER_Task | ||
486 | task, | ||
487 | void | ||
488 | *task_cls); | ||
489 | 464 | ||
490 | 465 | ||
491 | /** | 466 | /** |
@@ -520,23 +495,13 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_write_file (struct | |||
520 | * @return unique task identifier for the job | 495 | * @return unique task identifier for the job |
521 | * only valid until "task" is started! | 496 | * only valid until "task" is started! |
522 | */ | 497 | */ |
523 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_select (enum | 498 | GNUNET_SCHEDULER_TaskIdentifier |
524 | GNUNET_SCHEDULER_Priority | 499 | GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio, |
525 | prio, | 500 | GNUNET_SCHEDULER_TaskIdentifier prerequisite_task, |
526 | GNUNET_SCHEDULER_TaskIdentifier | 501 | struct GNUNET_TIME_Relative delay, |
527 | prerequisite_task, | 502 | const struct GNUNET_NETWORK_FDSet *rs, |
528 | struct | 503 | const struct GNUNET_NETWORK_FDSet *ws, |
529 | GNUNET_TIME_Relative | 504 | GNUNET_SCHEDULER_Task task, void *task_cls); |
530 | delay, | ||
531 | const struct | ||
532 | GNUNET_NETWORK_FDSet | ||
533 | *rs, | ||
534 | const struct | ||
535 | GNUNET_NETWORK_FDSet | ||
536 | *ws, | ||
537 | GNUNET_SCHEDULER_Task | ||
538 | task, | ||
539 | void *task_cls); | ||
540 | 505 | ||
541 | /** | 506 | /** |
542 | * Sets the select function to use in the scheduler (scheduler_select). | 507 | * Sets the select function to use in the scheduler (scheduler_select). |
@@ -544,8 +509,9 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_select (enum | |||
544 | * @param new_select new select function to use (NULL to reset to default) | 509 | * @param new_select new select function to use (NULL to reset to default) |
545 | * @param new_select_cls closure for 'new_select' | 510 | * @param new_select_cls closure for 'new_select' |
546 | */ | 511 | */ |
547 | void GNUNET_SCHEDULER_set_select (GNUNET_SCHEDULER_select new_select, | 512 | void |
548 | void *new_select_cls); | 513 | GNUNET_SCHEDULER_set_select (GNUNET_SCHEDULER_select new_select, |
514 | void *new_select_cls); | ||
549 | 515 | ||
550 | 516 | ||
551 | #if 0 /* keep Emacsens' auto-indent happy */ | 517 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_server_lib.h b/src/include/gnunet_server_lib.h index d9663ac82..3d8130c60 100644 --- a/src/include/gnunet_server_lib.h +++ b/src/include/gnunet_server_lib.h | |||
@@ -122,12 +122,12 @@ struct GNUNET_SERVER_MessageHandler | |||
122 | * @return handle for the new server, NULL on error | 122 | * @return handle for the new server, NULL on error |
123 | * (typically, "port" already in use) | 123 | * (typically, "port" already in use) |
124 | */ | 124 | */ |
125 | struct GNUNET_SERVER_Handle | 125 | struct GNUNET_SERVER_Handle * |
126 | *GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access, | 126 | GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access, |
127 | void *access_cls, | 127 | void *access_cls, |
128 | struct GNUNET_NETWORK_Handle **lsocks, | 128 | struct GNUNET_NETWORK_Handle **lsocks, |
129 | struct GNUNET_TIME_Relative | 129 | struct GNUNET_TIME_Relative idle_timeout, |
130 | idle_timeout, int require_found); | 130 | int require_found); |
131 | 131 | ||
132 | /** | 132 | /** |
133 | * Create a new server. | 133 | * Create a new server. |
@@ -142,14 +142,12 @@ struct GNUNET_SERVER_Handle | |||
142 | * @return handle for the new server, NULL on error | 142 | * @return handle for the new server, NULL on error |
143 | * (typically, "port" already in use) | 143 | * (typically, "port" already in use) |
144 | */ | 144 | */ |
145 | struct GNUNET_SERVER_Handle *GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck | 145 | struct GNUNET_SERVER_Handle * |
146 | access, void *access_cls, | 146 | GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck access, void *access_cls, |
147 | struct sockaddr *const | 147 | struct sockaddr *const *serverAddr, |
148 | *serverAddr, | 148 | const socklen_t * socklen, |
149 | const socklen_t * socklen, | 149 | struct GNUNET_TIME_Relative idle_timeout, |
150 | struct GNUNET_TIME_Relative | 150 | int require_found); |
151 | idle_timeout, | ||
152 | int require_found); | ||
153 | 151 | ||
154 | 152 | ||
155 | /** | 153 | /** |
@@ -157,7 +155,8 @@ struct GNUNET_SERVER_Handle *GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck | |||
157 | * | 155 | * |
158 | * @param s server to destroy | 156 | * @param s server to destroy |
159 | */ | 157 | */ |
160 | void GNUNET_SERVER_destroy (struct GNUNET_SERVER_Handle *s); | 158 | void |
159 | GNUNET_SERVER_destroy (struct GNUNET_SERVER_Handle *s); | ||
161 | 160 | ||
162 | 161 | ||
163 | /** | 162 | /** |
@@ -173,9 +172,10 @@ void GNUNET_SERVER_destroy (struct GNUNET_SERVER_Handle *s); | |||
173 | * the handlers array must exist until removed | 172 | * the handlers array must exist until removed |
174 | * (or server is destroyed). | 173 | * (or server is destroyed). |
175 | */ | 174 | */ |
176 | void GNUNET_SERVER_add_handlers (struct GNUNET_SERVER_Handle *server, | 175 | void |
177 | const struct GNUNET_SERVER_MessageHandler | 176 | GNUNET_SERVER_add_handlers (struct GNUNET_SERVER_Handle *server, |
178 | *handlers); | 177 | const struct GNUNET_SERVER_MessageHandler |
178 | *handlers); | ||
179 | 179 | ||
180 | 180 | ||
181 | /** | 181 | /** |
@@ -193,12 +193,12 @@ void GNUNET_SERVER_add_handlers (struct GNUNET_SERVER_Handle *server, | |||
193 | * GNUNET_CONNECTION_notify_transmit_ready_cancel. | 193 | * GNUNET_CONNECTION_notify_transmit_ready_cancel. |
194 | * NULL if we are already going to notify someone else (busy) | 194 | * NULL if we are already going to notify someone else (busy) |
195 | */ | 195 | */ |
196 | struct GNUNET_CONNECTION_TransmitHandle | 196 | struct GNUNET_CONNECTION_TransmitHandle * |
197 | *GNUNET_SERVER_notify_transmit_ready (struct GNUNET_SERVER_Client *client, | 197 | GNUNET_SERVER_notify_transmit_ready (struct GNUNET_SERVER_Client *client, |
198 | size_t size, | 198 | size_t size, |
199 | struct GNUNET_TIME_Relative timeout, | 199 | struct GNUNET_TIME_Relative timeout, |
200 | GNUNET_CONNECTION_TransmitReadyNotify | 200 | GNUNET_CONNECTION_TransmitReadyNotify |
201 | callback, void *callback_cls); | 201 | callback, void *callback_cls); |
202 | 202 | ||
203 | 203 | ||
204 | /** | 204 | /** |
@@ -207,7 +207,8 @@ struct GNUNET_CONNECTION_TransmitHandle | |||
207 | * | 207 | * |
208 | * @param client the client to set the persistent flag on | 208 | * @param client the client to set the persistent flag on |
209 | */ | 209 | */ |
210 | void GNUNET_SERVER_client_persist_ (struct GNUNET_SERVER_Client *client); | 210 | void |
211 | GNUNET_SERVER_client_persist_ (struct GNUNET_SERVER_Client *client); | ||
211 | 212 | ||
212 | /** | 213 | /** |
213 | * Resume receiving from this client, we are done processing the | 214 | * Resume receiving from this client, we are done processing the |
@@ -221,8 +222,8 @@ void GNUNET_SERVER_client_persist_ (struct GNUNET_SERVER_Client *client); | |||
221 | * GNUNET_SYSERR to close the connection (signal | 222 | * GNUNET_SYSERR to close the connection (signal |
222 | * serious error) | 223 | * serious error) |
223 | */ | 224 | */ |
224 | void GNUNET_SERVER_receive_done (struct GNUNET_SERVER_Client *client, | 225 | void |
225 | int success); | 226 | GNUNET_SERVER_receive_done (struct GNUNET_SERVER_Client *client, int success); |
226 | 227 | ||
227 | 228 | ||
228 | /** | 229 | /** |
@@ -233,8 +234,9 @@ void GNUNET_SERVER_receive_done (struct GNUNET_SERVER_Client *client, | |||
233 | * @param client the client to update | 234 | * @param client the client to update |
234 | * @param timeout new timeout for activities on the socket | 235 | * @param timeout new timeout for activities on the socket |
235 | */ | 236 | */ |
236 | void GNUNET_SERVER_client_set_timeout (struct GNUNET_SERVER_Client *client, | 237 | void |
237 | struct GNUNET_TIME_Relative timeout); | 238 | GNUNET_SERVER_client_set_timeout (struct GNUNET_SERVER_Client *client, |
239 | struct GNUNET_TIME_Relative timeout); | ||
238 | 240 | ||
239 | 241 | ||
240 | /** | 242 | /** |
@@ -244,8 +246,9 @@ void GNUNET_SERVER_client_set_timeout (struct GNUNET_SERVER_Client *client, | |||
244 | * | 246 | * |
245 | * @param client client for which to disable the warning | 247 | * @param client client for which to disable the warning |
246 | */ | 248 | */ |
247 | void GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client | 249 | void |
248 | *client); | 250 | GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client |
251 | *client); | ||
249 | 252 | ||
250 | 253 | ||
251 | /** | 254 | /** |
@@ -263,9 +266,10 @@ void GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client | |||
263 | * GNUNET_SYSERR if the connection to the | 266 | * GNUNET_SYSERR if the connection to the |
264 | * client should be shut down | 267 | * client should be shut down |
265 | */ | 268 | */ |
266 | int GNUNET_SERVER_inject (struct GNUNET_SERVER_Handle *server, | 269 | int |
267 | struct GNUNET_SERVER_Client *sender, | 270 | GNUNET_SERVER_inject (struct GNUNET_SERVER_Handle *server, |
268 | const struct GNUNET_MessageHeader *message); | 271 | struct GNUNET_SERVER_Client *sender, |
272 | const struct GNUNET_MessageHeader *message); | ||
269 | 273 | ||
270 | 274 | ||
271 | /** | 275 | /** |
@@ -280,12 +284,9 @@ int GNUNET_SERVER_inject (struct GNUNET_SERVER_Handle *server, | |||
280 | * @return the client handle (client should call | 284 | * @return the client handle (client should call |
281 | * "client_drop" on the return value eventually) | 285 | * "client_drop" on the return value eventually) |
282 | */ | 286 | */ |
283 | struct GNUNET_SERVER_Client *GNUNET_SERVER_connect_socket (struct | 287 | struct GNUNET_SERVER_Client * |
284 | GNUNET_SERVER_Handle | 288 | GNUNET_SERVER_connect_socket (struct GNUNET_SERVER_Handle *server, |
285 | *server, | 289 | struct GNUNET_CONNECTION_Handle *connection); |
286 | struct | ||
287 | GNUNET_CONNECTION_Handle | ||
288 | *connection); | ||
289 | 290 | ||
290 | 291 | ||
291 | /** | 292 | /** |
@@ -295,7 +296,8 @@ struct GNUNET_SERVER_Client *GNUNET_SERVER_connect_socket (struct | |||
295 | * | 296 | * |
296 | * @param client the client to keep | 297 | * @param client the client to keep |
297 | */ | 298 | */ |
298 | void GNUNET_SERVER_client_keep (struct GNUNET_SERVER_Client *client); | 299 | void |
300 | GNUNET_SERVER_client_keep (struct GNUNET_SERVER_Client *client); | ||
299 | 301 | ||
300 | 302 | ||
301 | /** | 303 | /** |
@@ -306,7 +308,8 @@ void GNUNET_SERVER_client_keep (struct GNUNET_SERVER_Client *client); | |||
306 | * | 308 | * |
307 | * @param client the client to drop | 309 | * @param client the client to drop |
308 | */ | 310 | */ |
309 | void GNUNET_SERVER_client_drop (struct GNUNET_SERVER_Client *client); | 311 | void |
312 | GNUNET_SERVER_client_drop (struct GNUNET_SERVER_Client *client); | ||
310 | 313 | ||
311 | 314 | ||
312 | /** | 315 | /** |
@@ -317,8 +320,9 @@ void GNUNET_SERVER_client_drop (struct GNUNET_SERVER_Client *client); | |||
317 | * @param addrlen where to store the length of the address | 320 | * @param addrlen where to store the length of the address |
318 | * @return GNUNET_OK on success | 321 | * @return GNUNET_OK on success |
319 | */ | 322 | */ |
320 | int GNUNET_SERVER_client_get_address (struct GNUNET_SERVER_Client *client, | 323 | int |
321 | void **addr, size_t * addrlen); | 324 | GNUNET_SERVER_client_get_address (struct GNUNET_SERVER_Client *client, |
325 | void **addr, size_t * addrlen); | ||
322 | 326 | ||
323 | 327 | ||
324 | /** | 328 | /** |
@@ -348,9 +352,10 @@ typedef void (*GNUNET_SERVER_DisconnectCallback) (void *cls, | |||
348 | * @param callback function to call on disconnect | 352 | * @param callback function to call on disconnect |
349 | * @param callback_cls closure for callback | 353 | * @param callback_cls closure for callback |
350 | */ | 354 | */ |
351 | void GNUNET_SERVER_disconnect_notify (struct GNUNET_SERVER_Handle *server, | 355 | void |
352 | GNUNET_SERVER_DisconnectCallback callback, | 356 | GNUNET_SERVER_disconnect_notify (struct GNUNET_SERVER_Handle *server, |
353 | void *callback_cls); | 357 | GNUNET_SERVER_DisconnectCallback callback, |
358 | void *callback_cls); | ||
354 | 359 | ||
355 | 360 | ||
356 | /** | 361 | /** |
@@ -360,10 +365,10 @@ void GNUNET_SERVER_disconnect_notify (struct GNUNET_SERVER_Handle *server, | |||
360 | * @param callback function to call on disconnect | 365 | * @param callback function to call on disconnect |
361 | * @param callback_cls closure for callback | 366 | * @param callback_cls closure for callback |
362 | */ | 367 | */ |
363 | void GNUNET_SERVER_disconnect_notify_cancel (struct GNUNET_SERVER_Handle | 368 | void |
364 | *server, | 369 | GNUNET_SERVER_disconnect_notify_cancel (struct GNUNET_SERVER_Handle *server, |
365 | GNUNET_SERVER_DisconnectCallback | 370 | GNUNET_SERVER_DisconnectCallback |
366 | callback, void *callback_cls); | 371 | callback, void *callback_cls); |
367 | 372 | ||
368 | 373 | ||
369 | /** | 374 | /** |
@@ -374,7 +379,8 @@ void GNUNET_SERVER_disconnect_notify_cancel (struct GNUNET_SERVER_Handle | |||
374 | * | 379 | * |
375 | * @param client the client to disconnect from | 380 | * @param client the client to disconnect from |
376 | */ | 381 | */ |
377 | void GNUNET_SERVER_client_disconnect (struct GNUNET_SERVER_Client *client); | 382 | void |
383 | GNUNET_SERVER_client_disconnect (struct GNUNET_SERVER_Client *client); | ||
378 | 384 | ||
379 | 385 | ||
380 | /** | 386 | /** |
@@ -388,8 +394,8 @@ void GNUNET_SERVER_client_disconnect (struct GNUNET_SERVER_Client *client); | |||
388 | * @param h server handle | 394 | * @param h server handle |
389 | * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default | 395 | * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default |
390 | */ | 396 | */ |
391 | void GNUNET_SERVER_ignore_shutdown (struct GNUNET_SERVER_Handle *h, | 397 | void |
392 | int do_ignore); | 398 | GNUNET_SERVER_ignore_shutdown (struct GNUNET_SERVER_Handle *h, int do_ignore); |
393 | 399 | ||
394 | 400 | ||
395 | 401 | ||
@@ -401,7 +407,8 @@ void GNUNET_SERVER_ignore_shutdown (struct GNUNET_SERVER_Handle *h, | |||
401 | * @param client handle to the client | 407 | * @param client handle to the client |
402 | * @return GNUNET_OK on success | 408 | * @return GNUNET_OK on success |
403 | */ | 409 | */ |
404 | int GNUNET_SERVER_client_disable_corking (struct GNUNET_SERVER_Client *client); | 410 | int |
411 | GNUNET_SERVER_client_disable_corking (struct GNUNET_SERVER_Client *client); | ||
405 | 412 | ||
406 | 413 | ||
407 | /** | 414 | /** |
@@ -419,9 +426,8 @@ struct GNUNET_SERVER_TransmitContext; | |||
419 | * @param client client to create the context for. | 426 | * @param client client to create the context for. |
420 | * @return NULL on error | 427 | * @return NULL on error |
421 | */ | 428 | */ |
422 | struct GNUNET_SERVER_TransmitContext | 429 | struct GNUNET_SERVER_TransmitContext * |
423 | *GNUNET_SERVER_transmit_context_create (struct GNUNET_SERVER_Client | 430 | GNUNET_SERVER_transmit_context_create (struct GNUNET_SERVER_Client *client); |
424 | *client); | ||
425 | 431 | ||
426 | 432 | ||
427 | /** | 433 | /** |
@@ -434,10 +440,10 @@ struct GNUNET_SERVER_TransmitContext | |||
434 | * @param length length of data | 440 | * @param length length of data |
435 | * @param type type of the message | 441 | * @param type type of the message |
436 | */ | 442 | */ |
437 | void GNUNET_SERVER_transmit_context_append_data (struct | 443 | void |
438 | GNUNET_SERVER_TransmitContext | 444 | GNUNET_SERVER_transmit_context_append_data (struct GNUNET_SERVER_TransmitContext |
439 | *tc, const void *data, | 445 | *tc, const void *data, |
440 | size_t length, uint16_t type); | 446 | size_t length, uint16_t type); |
441 | 447 | ||
442 | 448 | ||
443 | /** | 449 | /** |
@@ -448,11 +454,12 @@ void GNUNET_SERVER_transmit_context_append_data (struct | |||
448 | * @param tc context to use | 454 | * @param tc context to use |
449 | * @param msg message to append | 455 | * @param msg message to append |
450 | */ | 456 | */ |
451 | void GNUNET_SERVER_transmit_context_append_message (struct | 457 | void |
452 | GNUNET_SERVER_TransmitContext | 458 | GNUNET_SERVER_transmit_context_append_message (struct |
453 | *tc, | 459 | GNUNET_SERVER_TransmitContext |
454 | const struct | 460 | *tc, |
455 | GNUNET_MessageHeader *msg); | 461 | const struct GNUNET_MessageHeader |
462 | *msg); | ||
456 | 463 | ||
457 | 464 | ||
458 | /** | 465 | /** |
@@ -464,9 +471,9 @@ void GNUNET_SERVER_transmit_context_append_message (struct | |||
464 | * @param tc transmission context to use | 471 | * @param tc transmission context to use |
465 | * @param timeout when to time out and abort the transmission | 472 | * @param timeout when to time out and abort the transmission |
466 | */ | 473 | */ |
467 | void GNUNET_SERVER_transmit_context_run (struct GNUNET_SERVER_TransmitContext | 474 | void |
468 | *tc, | 475 | GNUNET_SERVER_transmit_context_run (struct GNUNET_SERVER_TransmitContext *tc, |
469 | struct GNUNET_TIME_Relative timeout); | 476 | struct GNUNET_TIME_Relative timeout); |
470 | 477 | ||
471 | 478 | ||
472 | 479 | ||
@@ -490,10 +497,9 @@ struct GNUNET_SERVER_NotificationContext; | |||
490 | * if the queue gets longer than this number of messages | 497 | * if the queue gets longer than this number of messages |
491 | * @return handle to the notification context | 498 | * @return handle to the notification context |
492 | */ | 499 | */ |
493 | struct GNUNET_SERVER_NotificationContext | 500 | struct GNUNET_SERVER_NotificationContext * |
494 | *GNUNET_SERVER_notification_context_create (struct GNUNET_SERVER_Handle | 501 | GNUNET_SERVER_notification_context_create (struct GNUNET_SERVER_Handle *server, |
495 | *server, | 502 | unsigned int queue_length); |
496 | unsigned int queue_length); | ||
497 | 503 | ||
498 | 504 | ||
499 | /** | 505 | /** |
@@ -501,9 +507,10 @@ struct GNUNET_SERVER_NotificationContext | |||
501 | * | 507 | * |
502 | * @param nc context to destroy. | 508 | * @param nc context to destroy. |
503 | */ | 509 | */ |
504 | void GNUNET_SERVER_notification_context_destroy (struct | 510 | void |
505 | GNUNET_SERVER_NotificationContext | 511 | GNUNET_SERVER_notification_context_destroy (struct |
506 | *nc); | 512 | GNUNET_SERVER_NotificationContext |
513 | *nc); | ||
507 | 514 | ||
508 | 515 | ||
509 | /** | 516 | /** |
@@ -512,11 +519,10 @@ void GNUNET_SERVER_notification_context_destroy (struct | |||
512 | * @param nc context to modify | 519 | * @param nc context to modify |
513 | * @param client client to add | 520 | * @param client client to add |
514 | */ | 521 | */ |
515 | void GNUNET_SERVER_notification_context_add (struct | 522 | void |
516 | GNUNET_SERVER_NotificationContext | 523 | GNUNET_SERVER_notification_context_add (struct GNUNET_SERVER_NotificationContext |
517 | *nc, | 524 | *nc, |
518 | struct GNUNET_SERVER_Client | 525 | struct GNUNET_SERVER_Client *client); |
519 | *client); | ||
520 | 526 | ||
521 | 527 | ||
522 | /** | 528 | /** |
@@ -528,14 +534,13 @@ void GNUNET_SERVER_notification_context_add (struct | |||
528 | * @param msg message to send | 534 | * @param msg message to send |
529 | * @param can_drop can this message be dropped due to queue length limitations | 535 | * @param can_drop can this message be dropped due to queue length limitations |
530 | */ | 536 | */ |
531 | void GNUNET_SERVER_notification_context_unicast (struct | 537 | void |
532 | GNUNET_SERVER_NotificationContext | 538 | GNUNET_SERVER_notification_context_unicast (struct |
533 | *nc, | 539 | GNUNET_SERVER_NotificationContext |
534 | struct GNUNET_SERVER_Client | 540 | *nc, |
535 | *client, | 541 | struct GNUNET_SERVER_Client *client, |
536 | const struct | 542 | const struct GNUNET_MessageHeader |
537 | GNUNET_MessageHeader *msg, | 543 | *msg, int can_drop); |
538 | int can_drop); | ||
539 | 544 | ||
540 | 545 | ||
541 | /** | 546 | /** |
@@ -545,12 +550,12 @@ void GNUNET_SERVER_notification_context_unicast (struct | |||
545 | * @param msg message to send | 550 | * @param msg message to send |
546 | * @param can_drop can this message be dropped due to queue length limitations | 551 | * @param can_drop can this message be dropped due to queue length limitations |
547 | */ | 552 | */ |
548 | void GNUNET_SERVER_notification_context_broadcast (struct | 553 | void |
549 | GNUNET_SERVER_NotificationContext | 554 | GNUNET_SERVER_notification_context_broadcast (struct |
550 | *nc, | 555 | GNUNET_SERVER_NotificationContext |
551 | const struct | 556 | *nc, |
552 | GNUNET_MessageHeader *msg, | 557 | const struct GNUNET_MessageHeader |
553 | int can_drop); | 558 | *msg, int can_drop); |
554 | 559 | ||
555 | 560 | ||
556 | 561 | ||
@@ -580,9 +585,9 @@ typedef void (*GNUNET_SERVER_MessageTokenizerCallback) (void *cls, void *client, | |||
580 | * @param cb_cls closure for cb | 585 | * @param cb_cls closure for cb |
581 | * @return handle to tokenizer | 586 | * @return handle to tokenizer |
582 | */ | 587 | */ |
583 | struct GNUNET_SERVER_MessageStreamTokenizer | 588 | struct GNUNET_SERVER_MessageStreamTokenizer * |
584 | *GNUNET_SERVER_mst_create (GNUNET_SERVER_MessageTokenizerCallback cb, | 589 | GNUNET_SERVER_mst_create (GNUNET_SERVER_MessageTokenizerCallback cb, |
585 | void *cb_cls); | 590 | void *cb_cls); |
586 | 591 | ||
587 | 592 | ||
588 | /** | 593 | /** |
@@ -601,9 +606,10 @@ struct GNUNET_SERVER_MessageStreamTokenizer | |||
601 | * GNUNET_NO if one_shot was set and we have another message ready | 606 | * GNUNET_NO if one_shot was set and we have another message ready |
602 | * GNUNET_SYSERR if the data stream is corrupt | 607 | * GNUNET_SYSERR if the data stream is corrupt |
603 | */ | 608 | */ |
604 | int GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst, | 609 | int |
605 | void *client_identity, const char *buf, | 610 | GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst, |
606 | size_t size, int purge, int one_shot); | 611 | void *client_identity, const char *buf, size_t size, |
612 | int purge, int one_shot); | ||
607 | 613 | ||
608 | 614 | ||
609 | /** | 615 | /** |
@@ -611,8 +617,8 @@ int GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst, | |||
611 | * | 617 | * |
612 | * @param mst tokenizer to destroy | 618 | * @param mst tokenizer to destroy |
613 | */ | 619 | */ |
614 | void GNUNET_SERVER_mst_destroy (struct GNUNET_SERVER_MessageStreamTokenizer | 620 | void |
615 | *mst); | 621 | GNUNET_SERVER_mst_destroy (struct GNUNET_SERVER_MessageStreamTokenizer *mst); |
616 | 622 | ||
617 | 623 | ||
618 | #if 0 /* keep Emacsens' auto-indent happy */ | 624 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_service_lib.h b/src/include/gnunet_service_lib.h index 79453cbf6..1641e0f93 100644 --- a/src/include/gnunet_service_lib.h +++ b/src/include/gnunet_service_lib.h | |||
@@ -59,11 +59,11 @@ extern "C" | |||
59 | * zero (in this case, '*addrs' and '*addr_lens' will be | 59 | * zero (in this case, '*addrs' and '*addr_lens' will be |
60 | * set to NULL). | 60 | * set to NULL). |
61 | */ | 61 | */ |
62 | int GNUNET_SERVICE_get_server_addresses (const char *serviceName, | 62 | int |
63 | const struct | 63 | GNUNET_SERVICE_get_server_addresses (const char *serviceName, |
64 | GNUNET_CONFIGURATION_Handle *cfg, | 64 | const struct GNUNET_CONFIGURATION_Handle |
65 | struct sockaddr ***addrs, | 65 | *cfg, struct sockaddr ***addrs, |
66 | socklen_t ** addr_lens); | 66 | socklen_t ** addr_lens); |
67 | 67 | ||
68 | 68 | ||
69 | /** | 69 | /** |
@@ -111,9 +111,10 @@ enum GNUNET_SERVICE_Options | |||
111 | * @return GNUNET_SYSERR on error, GNUNET_OK | 111 | * @return GNUNET_SYSERR on error, GNUNET_OK |
112 | * if we shutdown nicely | 112 | * if we shutdown nicely |
113 | */ | 113 | */ |
114 | int GNUNET_SERVICE_run (int argc, char *const *argv, const char *serviceName, | 114 | int |
115 | enum GNUNET_SERVICE_Options opt, | 115 | GNUNET_SERVICE_run (int argc, char *const *argv, const char *serviceName, |
116 | GNUNET_SERVICE_Main task, void *task_cls); | 116 | enum GNUNET_SERVICE_Options opt, GNUNET_SERVICE_Main task, |
117 | void *task_cls); | ||
117 | 118 | ||
118 | 119 | ||
119 | struct GNUNET_SERVICE_Context; | 120 | struct GNUNET_SERVICE_Context; |
@@ -126,10 +127,9 @@ struct GNUNET_SERVICE_Context; | |||
126 | * @param cfg configuration to use | 127 | * @param cfg configuration to use |
127 | * @return NULL on error, service handle | 128 | * @return NULL on error, service handle |
128 | */ | 129 | */ |
129 | struct GNUNET_SERVICE_Context *GNUNET_SERVICE_start (const char *serviceName, | 130 | struct GNUNET_SERVICE_Context * |
130 | const struct | 131 | GNUNET_SERVICE_start (const char *serviceName, |
131 | GNUNET_CONFIGURATION_Handle | 132 | const struct GNUNET_CONFIGURATION_Handle *cfg); |
132 | *cfg); | ||
133 | 133 | ||
134 | 134 | ||
135 | /** | 135 | /** |
@@ -139,9 +139,8 @@ struct GNUNET_SERVICE_Context *GNUNET_SERVICE_start (const char *serviceName, | |||
139 | * @param ctx the service context returned from the start function | 139 | * @param ctx the service context returned from the start function |
140 | * @return handle to the server for this service, NULL if there is none | 140 | * @return handle to the server for this service, NULL if there is none |
141 | */ | 141 | */ |
142 | struct GNUNET_SERVER_Handle *GNUNET_SERVICE_get_server (struct | 142 | struct GNUNET_SERVER_Handle * |
143 | GNUNET_SERVICE_Context | 143 | GNUNET_SERVICE_get_server (struct GNUNET_SERVICE_Context *ctx); |
144 | *ctx); | ||
145 | 144 | ||
146 | 145 | ||
147 | /** | 146 | /** |
@@ -149,7 +148,8 @@ struct GNUNET_SERVER_Handle *GNUNET_SERVICE_get_server (struct | |||
149 | * | 148 | * |
150 | * @param sctx the service context returned from the start function | 149 | * @param sctx the service context returned from the start function |
151 | */ | 150 | */ |
152 | void GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Context *sctx); | 151 | void |
152 | GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Context *sctx); | ||
153 | 153 | ||
154 | 154 | ||
155 | #if 0 /* keep Emacsens' auto-indent happy */ | 155 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_signal_lib.h b/src/include/gnunet_signal_lib.h index e386ccc0e..1597c76d0 100644 --- a/src/include/gnunet_signal_lib.h +++ b/src/include/gnunet_signal_lib.h | |||
@@ -59,9 +59,8 @@ typedef void (*GNUNET_SIGNAL_Handler) (void); | |||
59 | * @param handler the function to call | 59 | * @param handler the function to call |
60 | * @return context that can be used to restore, NULL on error | 60 | * @return context that can be used to restore, NULL on error |
61 | */ | 61 | */ |
62 | struct GNUNET_SIGNAL_Context *GNUNET_SIGNAL_handler_install (int signal, | 62 | struct GNUNET_SIGNAL_Context * |
63 | GNUNET_SIGNAL_Handler | 63 | GNUNET_SIGNAL_handler_install (int signal, GNUNET_SIGNAL_Handler handler); |
64 | handler); | ||
65 | 64 | ||
66 | /** | 65 | /** |
67 | * Uninstall a previously installed signal hander. | 66 | * Uninstall a previously installed signal hander. |
@@ -69,7 +68,8 @@ struct GNUNET_SIGNAL_Context *GNUNET_SIGNAL_handler_install (int signal, | |||
69 | * @param ctx context that was returned when the | 68 | * @param ctx context that was returned when the |
70 | * signal handler was installed | 69 | * signal handler was installed |
71 | */ | 70 | */ |
72 | void GNUNET_SIGNAL_handler_uninstall (struct GNUNET_SIGNAL_Context *ctx); | 71 | void |
72 | GNUNET_SIGNAL_handler_uninstall (struct GNUNET_SIGNAL_Context *ctx); | ||
73 | 73 | ||
74 | 74 | ||
75 | #if 0 /* keep Emacsens' auto-indent happy */ | 75 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_statistics_service.h b/src/include/gnunet_statistics_service.h index 90cc612df..c246e7cda 100644 --- a/src/include/gnunet_statistics_service.h +++ b/src/include/gnunet_statistics_service.h | |||
@@ -72,11 +72,9 @@ typedef int (*GNUNET_STATISTICS_Iterator) (void *cls, const char *subsystem, | |||
72 | * @param cfg services configuration in use | 72 | * @param cfg services configuration in use |
73 | * @return handle to use | 73 | * @return handle to use |
74 | */ | 74 | */ |
75 | struct GNUNET_STATISTICS_Handle *GNUNET_STATISTICS_create (const char | 75 | struct GNUNET_STATISTICS_Handle * |
76 | *subsystem, | 76 | GNUNET_STATISTICS_create (const char *subsystem, |
77 | const struct | 77 | const struct GNUNET_CONFIGURATION_Handle *cfg); |
78 | GNUNET_CONFIGURATION_Handle | ||
79 | *cfg); | ||
80 | 78 | ||
81 | 79 | ||
82 | /** | 80 | /** |
@@ -87,8 +85,8 @@ struct GNUNET_STATISTICS_Handle *GNUNET_STATISTICS_create (const char | |||
87 | * @param sync_first set to GNUNET_YES if pending SET requests should | 85 | * @param sync_first set to GNUNET_YES if pending SET requests should |
88 | * be completed | 86 | * be completed |
89 | */ | 87 | */ |
90 | void GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, | 88 | void |
91 | int sync_first); | 89 | GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, int sync_first); |
92 | 90 | ||
93 | 91 | ||
94 | /** | 92 | /** |
@@ -103,9 +101,10 @@ void GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, | |||
103 | * @param proc_cls closure for proc | 101 | * @param proc_cls closure for proc |
104 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 102 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
105 | */ | 103 | */ |
106 | int GNUNET_STATISTICS_watch (struct GNUNET_STATISTICS_Handle *handle, | 104 | int |
107 | const char *subsystem, const char *name, | 105 | GNUNET_STATISTICS_watch (struct GNUNET_STATISTICS_Handle *handle, |
108 | GNUNET_STATISTICS_Iterator proc, void *proc_cls); | 106 | const char *subsystem, const char *name, |
107 | GNUNET_STATISTICS_Iterator proc, void *proc_cls); | ||
109 | 108 | ||
110 | 109 | ||
111 | /** | 110 | /** |
@@ -135,19 +134,12 @@ struct GNUNET_STATISTICS_GetHandle; | |||
135 | * @param cls closure for proc and cont | 134 | * @param cls closure for proc and cont |
136 | * @return NULL on error | 135 | * @return NULL on error |
137 | */ | 136 | */ |
138 | struct GNUNET_STATISTICS_GetHandle *GNUNET_STATISTICS_get (struct | 137 | struct GNUNET_STATISTICS_GetHandle * |
139 | GNUNET_STATISTICS_Handle | 138 | GNUNET_STATISTICS_get (struct GNUNET_STATISTICS_Handle *handle, |
140 | *handle, | 139 | const char *subsystem, const char *name, |
141 | const char | 140 | struct GNUNET_TIME_Relative timeout, |
142 | *subsystem, | 141 | GNUNET_STATISTICS_Callback cont, |
143 | const char *name, | 142 | GNUNET_STATISTICS_Iterator proc, void *cls); |
144 | struct | ||
145 | GNUNET_TIME_Relative | ||
146 | timeout, | ||
147 | GNUNET_STATISTICS_Callback | ||
148 | cont, | ||
149 | GNUNET_STATISTICS_Iterator | ||
150 | proc, void *cls); | ||
151 | 143 | ||
152 | 144 | ||
153 | /** | 145 | /** |
@@ -156,7 +148,8 @@ struct GNUNET_STATISTICS_GetHandle *GNUNET_STATISTICS_get (struct | |||
156 | * | 148 | * |
157 | * @param gh handle of the request to cancel | 149 | * @param gh handle of the request to cancel |
158 | */ | 150 | */ |
159 | void GNUNET_STATISTICS_get_cancel (struct GNUNET_STATISTICS_GetHandle *gh); | 151 | void |
152 | GNUNET_STATISTICS_get_cancel (struct GNUNET_STATISTICS_GetHandle *gh); | ||
160 | 153 | ||
161 | 154 | ||
162 | /** | 155 | /** |
@@ -168,9 +161,9 @@ void GNUNET_STATISTICS_get_cancel (struct GNUNET_STATISTICS_GetHandle *gh); | |||
168 | * @param value new value to set | 161 | * @param value new value to set |
169 | * @param make_persistent should the value be kept across restarts? | 162 | * @param make_persistent should the value be kept across restarts? |
170 | */ | 163 | */ |
171 | void GNUNET_STATISTICS_set (struct GNUNET_STATISTICS_Handle *handle, | 164 | void |
172 | const char *name, uint64_t value, | 165 | GNUNET_STATISTICS_set (struct GNUNET_STATISTICS_Handle *handle, |
173 | int make_persistent); | 166 | const char *name, uint64_t value, int make_persistent); |
174 | 167 | ||
175 | /** | 168 | /** |
176 | * Set statistic value for the peer. Will always use our | 169 | * Set statistic value for the peer. Will always use our |
@@ -181,9 +174,9 @@ void GNUNET_STATISTICS_set (struct GNUNET_STATISTICS_Handle *handle, | |||
181 | * @param delta change in value (added to existing value) | 174 | * @param delta change in value (added to existing value) |
182 | * @param make_persistent should the value be kept across restarts? | 175 | * @param make_persistent should the value be kept across restarts? |
183 | */ | 176 | */ |
184 | void GNUNET_STATISTICS_update (struct GNUNET_STATISTICS_Handle *handle, | 177 | void |
185 | const char *name, int64_t delta, | 178 | GNUNET_STATISTICS_update (struct GNUNET_STATISTICS_Handle *handle, |
186 | int make_persistent); | 179 | const char *name, int64_t delta, int make_persistent); |
187 | 180 | ||
188 | 181 | ||
189 | 182 | ||
diff --git a/src/include/gnunet_strings_lib.h b/src/include/gnunet_strings_lib.h index dd78aee35..6413fb102 100644 --- a/src/include/gnunet_strings_lib.h +++ b/src/include/gnunet_strings_lib.h | |||
@@ -56,7 +56,8 @@ extern "C" | |||
56 | * @param size number of bytes | 56 | * @param size number of bytes |
57 | * @return fancy representation of the size (possibly rounded) for humans | 57 | * @return fancy representation of the size (possibly rounded) for humans |
58 | */ | 58 | */ |
59 | char *GNUNET_STRINGS_byte_size_fancy (unsigned long long size); | 59 | char * |
60 | GNUNET_STRINGS_byte_size_fancy (unsigned long long size); | ||
60 | 61 | ||
61 | 62 | ||
62 | /** | 63 | /** |
@@ -69,8 +70,8 @@ char *GNUNET_STRINGS_byte_size_fancy (unsigned long long size); | |||
69 | * @param charset character set to convert from | 70 | * @param charset character set to convert from |
70 | * @return the converted string (0-terminated) | 71 | * @return the converted string (0-terminated) |
71 | */ | 72 | */ |
72 | char *GNUNET_STRINGS_to_utf8 (const char *input, size_t len, | 73 | char * |
73 | const char *charset); | 74 | GNUNET_STRINGS_to_utf8 (const char *input, size_t len, const char *charset); |
74 | 75 | ||
75 | 76 | ||
76 | /** | 77 | /** |
@@ -81,7 +82,8 @@ char *GNUNET_STRINGS_to_utf8 (const char *input, size_t len, | |||
81 | * @return the full file name, | 82 | * @return the full file name, |
82 | * NULL is returned on error | 83 | * NULL is returned on error |
83 | */ | 84 | */ |
84 | char *GNUNET_STRINGS_filename_expand (const char *fil); | 85 | char * |
86 | GNUNET_STRINGS_filename_expand (const char *fil); | ||
85 | 87 | ||
86 | /** | 88 | /** |
87 | * Fill a buffer of the given size with | 89 | * Fill a buffer of the given size with |
@@ -104,8 +106,8 @@ char *GNUNET_STRINGS_filename_expand (const char *fil); | |||
104 | * @return number of bytes written to the buffer | 106 | * @return number of bytes written to the buffer |
105 | * (or number of bytes that would have been written) | 107 | * (or number of bytes that would have been written) |
106 | */ | 108 | */ |
107 | size_t GNUNET_STRINGS_buffer_fill (char *buffer, size_t size, | 109 | size_t |
108 | unsigned int count, ...); | 110 | GNUNET_STRINGS_buffer_fill (char *buffer, size_t size, unsigned int count, ...); |
109 | 111 | ||
110 | 112 | ||
111 | /** | 113 | /** |
@@ -122,8 +124,9 @@ size_t GNUNET_STRINGS_buffer_fill (char *buffer, size_t size, | |||
122 | * @return offset of the character after the last 0-termination | 124 | * @return offset of the character after the last 0-termination |
123 | * in the buffer, or 0 on error. | 125 | * in the buffer, or 0 on error. |
124 | */ | 126 | */ |
125 | unsigned int GNUNET_STRINGS_buffer_tokenize (const char *buffer, size_t size, | 127 | unsigned int |
126 | unsigned int count, ...); | 128 | GNUNET_STRINGS_buffer_tokenize (const char *buffer, size_t size, |
129 | unsigned int count, ...); | ||
127 | 130 | ||
128 | 131 | ||
129 | 132 | ||
@@ -134,7 +137,8 @@ unsigned int GNUNET_STRINGS_buffer_tokenize (const char *buffer, size_t size, | |||
134 | * @param t the absolute time to convert | 137 | * @param t the absolute time to convert |
135 | * @return timestamp in human-readable form | 138 | * @return timestamp in human-readable form |
136 | */ | 139 | */ |
137 | char *GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t); | 140 | char * |
141 | GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t); | ||
138 | 142 | ||
139 | 143 | ||
140 | /** | 144 | /** |
@@ -143,8 +147,8 @@ char *GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t); | |||
143 | * @param delta time in milli seconds | 147 | * @param delta time in milli seconds |
144 | * @return string in human-readable form | 148 | * @return string in human-readable form |
145 | */ | 149 | */ |
146 | char *GNUNET_STRINGS_relative_time_to_string (struct GNUNET_TIME_Relative | 150 | char * |
147 | delta); | 151 | GNUNET_STRINGS_relative_time_to_string (struct GNUNET_TIME_Relative delta); |
148 | 152 | ||
149 | #if 0 /* keep Emacsens' auto-indent happy */ | 153 | #if 0 /* keep Emacsens' auto-indent happy */ |
150 | { | 154 | { |
diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h index cd673a082..5bedc406c 100644 --- a/src/include/gnunet_testing_lib.h +++ b/src/include/gnunet_testing_lib.h | |||
@@ -466,22 +466,15 @@ typedef void (*GNUNET_TESTING_NotifyTopology) (void *cls, | |||
466 | * @param cb_cls closure for cb | 466 | * @param cb_cls closure for cb |
467 | * @return handle to the daemon (actual start will be completed asynchronously) | 467 | * @return handle to the daemon (actual start will be completed asynchronously) |
468 | */ | 468 | */ |
469 | struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_start (const struct | 469 | struct GNUNET_TESTING_Daemon * |
470 | GNUNET_CONFIGURATION_Handle | 470 | GNUNET_TESTING_daemon_start (const struct GNUNET_CONFIGURATION_Handle *cfg, |
471 | *cfg, | 471 | struct GNUNET_TIME_Relative timeout, int pretend, |
472 | struct | 472 | const char *hostname, const char *ssh_username, |
473 | GNUNET_TIME_Relative | 473 | uint16_t sshport, const char *hostkey, |
474 | timeout, int pretend, | 474 | GNUNET_TESTING_NotifyHostkeyCreated |
475 | const char *hostname, | 475 | hostkey_callback, void *hostkey_cls, |
476 | const char | 476 | GNUNET_TESTING_NotifyDaemonRunning cb, |
477 | *ssh_username, | 477 | void *cb_cls); |
478 | uint16_t sshport, | ||
479 | const char *hostkey, | ||
480 | GNUNET_TESTING_NotifyHostkeyCreated | ||
481 | hostkey_callback, | ||
482 | void *hostkey_cls, | ||
483 | GNUNET_TESTING_NotifyDaemonRunning | ||
484 | cb, void *cb_cls); | ||
485 | 478 | ||
486 | /** | 479 | /** |
487 | * Continues GNUnet daemon startup when user wanted to be notified | 480 | * Continues GNUnet daemon startup when user wanted to be notified |
@@ -490,8 +483,8 @@ struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_start (const struct | |||
490 | * | 483 | * |
491 | * @param daemon the daemon to finish starting | 484 | * @param daemon the daemon to finish starting |
492 | */ | 485 | */ |
493 | void GNUNET_TESTING_daemon_continue_startup (struct GNUNET_TESTING_Daemon | 486 | void |
494 | *daemon); | 487 | GNUNET_TESTING_daemon_continue_startup (struct GNUNET_TESTING_Daemon *daemon); |
495 | 488 | ||
496 | /** | 489 | /** |
497 | * Check whether the given daemon is running. | 490 | * Check whether the given daemon is running. |
@@ -501,7 +494,8 @@ void GNUNET_TESTING_daemon_continue_startup (struct GNUNET_TESTING_Daemon | |||
501 | * @return GNUNET_YES if the daemon is up, GNUNET_NO if the | 494 | * @return GNUNET_YES if the daemon is up, GNUNET_NO if the |
502 | * daemon is down, GNUNET_SYSERR on error. | 495 | * daemon is down, GNUNET_SYSERR on error. |
503 | */ | 496 | */ |
504 | int GNUNET_TESTING_daemon_running (struct GNUNET_TESTING_Daemon *daemon); | 497 | int |
498 | GNUNET_TESTING_daemon_running (struct GNUNET_TESTING_Daemon *daemon); | ||
505 | 499 | ||
506 | /** | 500 | /** |
507 | * Restart (stop and start) a GNUnet daemon. | 501 | * Restart (stop and start) a GNUnet daemon. |
@@ -510,9 +504,10 @@ int GNUNET_TESTING_daemon_running (struct GNUNET_TESTING_Daemon *daemon); | |||
510 | * @param cb function called once the daemon is (re)started | 504 | * @param cb function called once the daemon is (re)started |
511 | * @param cb_cls closure for cb | 505 | * @param cb_cls closure for cb |
512 | */ | 506 | */ |
513 | void GNUNET_TESTING_daemon_restart (struct GNUNET_TESTING_Daemon *d, | 507 | void |
514 | GNUNET_TESTING_NotifyDaemonRunning cb, | 508 | GNUNET_TESTING_daemon_restart (struct GNUNET_TESTING_Daemon *d, |
515 | void *cb_cls); | 509 | GNUNET_TESTING_NotifyDaemonRunning cb, |
510 | void *cb_cls); | ||
516 | 511 | ||
517 | /** | 512 | /** |
518 | * Start a peer that has previously been stopped using the daemon_stop | 513 | * Start a peer that has previously been stopped using the daemon_stop |
@@ -523,10 +518,11 @@ void GNUNET_TESTING_daemon_restart (struct GNUNET_TESTING_Daemon *d, | |||
523 | * @param cb the callback for notification when the peer is running | 518 | * @param cb the callback for notification when the peer is running |
524 | * @param cb_cls closure for the callback | 519 | * @param cb_cls closure for the callback |
525 | */ | 520 | */ |
526 | void GNUNET_TESTING_daemon_start_stopped (struct GNUNET_TESTING_Daemon *daemon, | 521 | void |
527 | struct GNUNET_TIME_Relative timeout, | 522 | GNUNET_TESTING_daemon_start_stopped (struct GNUNET_TESTING_Daemon *daemon, |
528 | GNUNET_TESTING_NotifyDaemonRunning cb, | 523 | struct GNUNET_TIME_Relative timeout, |
529 | void *cb_cls); | 524 | GNUNET_TESTING_NotifyDaemonRunning cb, |
525 | void *cb_cls); | ||
530 | 526 | ||
531 | /** | 527 | /** |
532 | * Starts a GNUnet daemon's service. | 528 | * Starts a GNUnet daemon's service. |
@@ -537,11 +533,12 @@ void GNUNET_TESTING_daemon_start_stopped (struct GNUNET_TESTING_Daemon *daemon, | |||
537 | * @param cb function called once gnunet-arm returns | 533 | * @param cb function called once gnunet-arm returns |
538 | * @param cb_cls closure for cb | 534 | * @param cb_cls closure for cb |
539 | */ | 535 | */ |
540 | void GNUNET_TESTING_daemon_start_service (struct GNUNET_TESTING_Daemon *d, | 536 | void |
541 | char *service, | 537 | GNUNET_TESTING_daemon_start_service (struct GNUNET_TESTING_Daemon *d, |
542 | struct GNUNET_TIME_Relative timeout, | 538 | char *service, |
543 | GNUNET_TESTING_NotifyDaemonRunning cb, | 539 | struct GNUNET_TIME_Relative timeout, |
544 | void *cb_cls); | 540 | GNUNET_TESTING_NotifyDaemonRunning cb, |
541 | void *cb_cls); | ||
545 | 542 | ||
546 | /** | 543 | /** |
547 | * Starts a GNUnet daemon's service which has been previously turned off. | 544 | * Starts a GNUnet daemon's service which has been previously turned off. |
@@ -552,12 +549,13 @@ void GNUNET_TESTING_daemon_start_service (struct GNUNET_TESTING_Daemon *d, | |||
552 | * @param cb function called once gnunet-arm returns | 549 | * @param cb function called once gnunet-arm returns |
553 | * @param cb_cls closure for cb | 550 | * @param cb_cls closure for cb |
554 | */ | 551 | */ |
555 | void GNUNET_TESTING_daemon_start_stopped_service (struct GNUNET_TESTING_Daemon | 552 | void |
556 | *d, char *service, | 553 | GNUNET_TESTING_daemon_start_stopped_service (struct GNUNET_TESTING_Daemon *d, |
557 | struct GNUNET_TIME_Relative | 554 | char *service, |
558 | timeout, | 555 | struct GNUNET_TIME_Relative |
559 | GNUNET_TESTING_NotifyDaemonRunning | 556 | timeout, |
560 | cb, void *cb_cls); | 557 | GNUNET_TESTING_NotifyDaemonRunning |
558 | cb, void *cb_cls); | ||
561 | 559 | ||
562 | /** | 560 | /** |
563 | * Get a certain testing daemon handle. | 561 | * Get a certain testing daemon handle. |
@@ -565,10 +563,9 @@ void GNUNET_TESTING_daemon_start_stopped_service (struct GNUNET_TESTING_Daemon | |||
565 | * @param pg handle to the set of running peers | 563 | * @param pg handle to the set of running peers |
566 | * @param position the number of the peer to return | 564 | * @param position the number of the peer to return |
567 | */ | 565 | */ |
568 | struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_get (struct | 566 | struct GNUNET_TESTING_Daemon * |
569 | GNUNET_TESTING_PeerGroup | 567 | GNUNET_TESTING_daemon_get (struct GNUNET_TESTING_PeerGroup *pg, |
570 | *pg, | 568 | unsigned int position); |
571 | unsigned int position); | ||
572 | 569 | ||
573 | /* | 570 | /* |
574 | * Get a daemon by peer identity, so callers can | 571 | * Get a daemon by peer identity, so callers can |
@@ -579,12 +576,9 @@ struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_get (struct | |||
579 | * | 576 | * |
580 | * @return the daemon on success, or NULL if no such peer identity is found | 577 | * @return the daemon on success, or NULL if no such peer identity is found |
581 | */ | 578 | */ |
582 | struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_get_by_id (struct | 579 | struct GNUNET_TESTING_Daemon * |
583 | GNUNET_TESTING_PeerGroup | 580 | GNUNET_TESTING_daemon_get_by_id (struct GNUNET_TESTING_PeerGroup *pg, |
584 | *pg, | 581 | struct GNUNET_PeerIdentity *peer_id); |
585 | struct | ||
586 | GNUNET_PeerIdentity | ||
587 | *peer_id); | ||
588 | 582 | ||
589 | /** | 583 | /** |
590 | * Stops a GNUnet daemon. | 584 | * Stops a GNUnet daemon. |
@@ -599,11 +593,11 @@ struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_get_by_id (struct | |||
599 | * @param allow_restart GNUNET_YES to restart peer later (using this API) | 593 | * @param allow_restart GNUNET_YES to restart peer later (using this API) |
600 | * GNUNET_NO to kill off and clean up for good | 594 | * GNUNET_NO to kill off and clean up for good |
601 | */ | 595 | */ |
602 | void GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d, | 596 | void |
603 | struct GNUNET_TIME_Relative timeout, | 597 | GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d, |
604 | GNUNET_TESTING_NotifyCompletion cb, | 598 | struct GNUNET_TIME_Relative timeout, |
605 | void *cb_cls, int delete_files, | 599 | GNUNET_TESTING_NotifyCompletion cb, void *cb_cls, |
606 | int allow_restart); | 600 | int delete_files, int allow_restart); |
607 | 601 | ||
608 | 602 | ||
609 | /** | 603 | /** |
@@ -614,10 +608,11 @@ void GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d, | |||
614 | * @param cb function called once the configuration was changed | 608 | * @param cb function called once the configuration was changed |
615 | * @param cb_cls closure for cb | 609 | * @param cb_cls closure for cb |
616 | */ | 610 | */ |
617 | void GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d, | 611 | void |
618 | struct GNUNET_CONFIGURATION_Handle *cfg, | 612 | GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d, |
619 | GNUNET_TESTING_NotifyCompletion cb, | 613 | struct GNUNET_CONFIGURATION_Handle *cfg, |
620 | void *cb_cls); | 614 | GNUNET_TESTING_NotifyCompletion cb, |
615 | void *cb_cls); | ||
621 | 616 | ||
622 | /** | 617 | /** |
623 | * Stops a single service of a GNUnet daemon. Used like daemon_stop, | 618 | * Stops a single service of a GNUnet daemon. Used like daemon_stop, |
@@ -631,11 +626,12 @@ void GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d, | |||
631 | * @param cb function called once the service was stopped | 626 | * @param cb function called once the service was stopped |
632 | * @param cb_cls closure for cb | 627 | * @param cb_cls closure for cb |
633 | */ | 628 | */ |
634 | void GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d, | 629 | void |
635 | char *service, | 630 | GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d, |
636 | struct GNUNET_TIME_Relative timeout, | 631 | char *service, |
637 | GNUNET_TESTING_NotifyCompletion cb, | 632 | struct GNUNET_TIME_Relative timeout, |
638 | void *cb_cls); | 633 | GNUNET_TESTING_NotifyCompletion cb, |
634 | void *cb_cls); | ||
639 | 635 | ||
640 | /** | 636 | /** |
641 | * Read a testing hosts file based on a configuration. | 637 | * Read a testing hosts file based on a configuration. |
@@ -646,9 +642,8 @@ void GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d, | |||
646 | * | 642 | * |
647 | * @return DLL of hosts on success, NULL on failure | 643 | * @return DLL of hosts on success, NULL on failure |
648 | */ | 644 | */ |
649 | struct GNUNET_TESTING_Host *GNUNET_TESTING_hosts_load (const struct | 645 | struct GNUNET_TESTING_Host * |
650 | GNUNET_CONFIGURATION_Handle | 646 | GNUNET_TESTING_hosts_load (const struct GNUNET_CONFIGURATION_Handle *cfg); |
651 | *cfg); | ||
652 | 647 | ||
653 | 648 | ||
654 | /** | 649 | /** |
@@ -678,31 +673,19 @@ struct GNUNET_TESTING_Host *GNUNET_TESTING_hosts_load (const struct | |||
678 | * | 673 | * |
679 | * @return NULL on error, otherwise handle to control peer group | 674 | * @return NULL on error, otherwise handle to control peer group |
680 | */ | 675 | */ |
681 | struct GNUNET_TESTING_PeerGroup *GNUNET_TESTING_daemons_start (const struct | 676 | struct GNUNET_TESTING_PeerGroup * |
682 | GNUNET_CONFIGURATION_Handle | 677 | GNUNET_TESTING_daemons_start (const struct GNUNET_CONFIGURATION_Handle *cfg, |
683 | *cfg, | 678 | unsigned int total, |
684 | unsigned int | 679 | unsigned int max_concurrent_connections, |
685 | total, | 680 | unsigned int max_concurrent_ssh, |
686 | unsigned int | 681 | struct GNUNET_TIME_Relative timeout, |
687 | max_concurrent_connections, | 682 | GNUNET_TESTING_NotifyHostkeyCreated |
688 | unsigned int | 683 | hostkey_callback, void *hostkey_cls, |
689 | max_concurrent_ssh, | 684 | GNUNET_TESTING_NotifyDaemonRunning cb, |
690 | struct | 685 | void *cb_cls, |
691 | GNUNET_TIME_Relative | 686 | GNUNET_TESTING_NotifyConnection connect_callback, |
692 | timeout, | 687 | void *connect_callback_cls, |
693 | GNUNET_TESTING_NotifyHostkeyCreated | 688 | const struct GNUNET_TESTING_Host *hostnames); |
694 | hostkey_callback, | ||
695 | void | ||
696 | *hostkey_cls, | ||
697 | GNUNET_TESTING_NotifyDaemonRunning | ||
698 | cb, void *cb_cls, | ||
699 | GNUNET_TESTING_NotifyConnection | ||
700 | connect_callback, | ||
701 | void | ||
702 | *connect_callback_cls, | ||
703 | const struct | ||
704 | GNUNET_TESTING_Host | ||
705 | *hostnames); | ||
706 | 689 | ||
707 | /** | 690 | /** |
708 | * Function which continues a peer group starting up | 691 | * Function which continues a peer group starting up |
@@ -710,8 +693,8 @@ struct GNUNET_TESTING_PeerGroup *GNUNET_TESTING_daemons_start (const struct | |||
710 | * | 693 | * |
711 | * @param pg the peer group to continue starting | 694 | * @param pg the peer group to continue starting |
712 | */ | 695 | */ |
713 | void GNUNET_TESTING_daemons_continue_startup (struct GNUNET_TESTING_PeerGroup | 696 | void |
714 | *pg); | 697 | GNUNET_TESTING_daemons_continue_startup (struct GNUNET_TESTING_PeerGroup *pg); |
715 | 698 | ||
716 | 699 | ||
717 | /** | 700 | /** |
@@ -728,13 +711,14 @@ void GNUNET_TESTING_daemons_continue_startup (struct GNUNET_TESTING_PeerGroup | |||
728 | * @param cb function to call at the end | 711 | * @param cb function to call at the end |
729 | * @param cb_cls closure for cb | 712 | * @param cb_cls closure for cb |
730 | */ | 713 | */ |
731 | void GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, | 714 | void |
732 | struct GNUNET_TESTING_Daemon *d2, | 715 | GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, |
733 | struct GNUNET_TIME_Relative timeout, | 716 | struct GNUNET_TESTING_Daemon *d2, |
734 | unsigned int max_connect_attempts, | 717 | struct GNUNET_TIME_Relative timeout, |
735 | int send_hello, | 718 | unsigned int max_connect_attempts, |
736 | GNUNET_TESTING_NotifyConnection cb, | 719 | int send_hello, |
737 | void *cb_cls); | 720 | GNUNET_TESTING_NotifyConnection cb, |
721 | void *cb_cls); | ||
738 | 722 | ||
739 | 723 | ||
740 | /** | 724 | /** |
@@ -744,9 +728,10 @@ void GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, | |||
744 | * @param callback function to call on completion (or failure) | 728 | * @param callback function to call on completion (or failure) |
745 | * @param callback_cls closure for the callback function | 729 | * @param callback_cls closure for the callback function |
746 | */ | 730 | */ |
747 | void GNUNET_TESTING_daemons_restart (struct GNUNET_TESTING_PeerGroup *pg, | 731 | void |
748 | GNUNET_TESTING_NotifyCompletion callback, | 732 | GNUNET_TESTING_daemons_restart (struct GNUNET_TESTING_PeerGroup *pg, |
749 | void *callback_cls); | 733 | GNUNET_TESTING_NotifyCompletion callback, |
734 | void *callback_cls); | ||
750 | 735 | ||
751 | 736 | ||
752 | /** | 737 | /** |
@@ -757,10 +742,10 @@ void GNUNET_TESTING_daemons_restart (struct GNUNET_TESTING_PeerGroup *pg, | |||
757 | * @param cb callback to notify upon success or failure | 742 | * @param cb callback to notify upon success or failure |
758 | * @param cb_cls closure for cb | 743 | * @param cb_cls closure for cb |
759 | */ | 744 | */ |
760 | void GNUNET_TESTING_daemons_stop (struct GNUNET_TESTING_PeerGroup *pg, | 745 | void |
761 | struct GNUNET_TIME_Relative timeout, | 746 | GNUNET_TESTING_daemons_stop (struct GNUNET_TESTING_PeerGroup *pg, |
762 | GNUNET_TESTING_NotifyCompletion cb, | 747 | struct GNUNET_TIME_Relative timeout, |
763 | void *cb_cls); | 748 | GNUNET_TESTING_NotifyCompletion cb, void *cb_cls); |
764 | 749 | ||
765 | 750 | ||
766 | /** | 751 | /** |
@@ -770,8 +755,8 @@ void GNUNET_TESTING_daemons_stop (struct GNUNET_TESTING_PeerGroup *pg, | |||
770 | * | 755 | * |
771 | * @return the number of currently running peers in the peer group | 756 | * @return the number of currently running peers in the peer group |
772 | */ | 757 | */ |
773 | unsigned int GNUNET_TESTING_daemons_running (struct GNUNET_TESTING_PeerGroup | 758 | unsigned int |
774 | *pg); | 759 | GNUNET_TESTING_daemons_running (struct GNUNET_TESTING_PeerGroup *pg); |
775 | 760 | ||
776 | /** | 761 | /** |
777 | * Simulate churn by stopping some peers (and possibly | 762 | * Simulate churn by stopping some peers (and possibly |
@@ -796,12 +781,12 @@ unsigned int GNUNET_TESTING_daemons_running (struct GNUNET_TESTING_PeerGroup | |||
796 | * @param cb function to call at the end | 781 | * @param cb function to call at the end |
797 | * @param cb_cls closure for cb | 782 | * @param cb_cls closure for cb |
798 | */ | 783 | */ |
799 | void GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg, | 784 | void |
800 | char *service, unsigned int voff, | 785 | GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg, |
801 | unsigned int von, | 786 | char *service, unsigned int voff, |
802 | struct GNUNET_TIME_Relative timeout, | 787 | unsigned int von, |
803 | GNUNET_TESTING_NotifyCompletion cb, | 788 | struct GNUNET_TIME_Relative timeout, |
804 | void *cb_cls); | 789 | GNUNET_TESTING_NotifyCompletion cb, void *cb_cls); |
805 | /* | 790 | /* |
806 | * Start a given service for each of the peers in the peer group. | 791 | * Start a given service for each of the peers in the peer group. |
807 | * | 792 | * |
@@ -813,11 +798,12 @@ void GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg, | |||
813 | * @param cb_cls closure for cb | 798 | * @param cb_cls closure for cb |
814 | * | 799 | * |
815 | */ | 800 | */ |
816 | void GNUNET_TESTING_daemons_start_service (struct GNUNET_TESTING_PeerGroup *pg, | 801 | void |
817 | char *service, | 802 | GNUNET_TESTING_daemons_start_service (struct GNUNET_TESTING_PeerGroup *pg, |
818 | struct GNUNET_TIME_Relative timeout, | 803 | char *service, |
819 | GNUNET_TESTING_NotifyCompletion cb, | 804 | struct GNUNET_TIME_Relative timeout, |
820 | void *cb_cls); | 805 | GNUNET_TESTING_NotifyCompletion cb, |
806 | void *cb_cls); | ||
821 | 807 | ||
822 | /** | 808 | /** |
823 | * Callback function to process statistic values. | 809 | * Callback function to process statistic values. |
@@ -847,10 +833,11 @@ typedef int (*GNUNET_TESTING_STATISTICS_Iterator) (void *cls, | |||
847 | * @param proc processing function for each statistic retrieved | 833 | * @param proc processing function for each statistic retrieved |
848 | * @param cls closure to pass to proc | 834 | * @param cls closure to pass to proc |
849 | */ | 835 | */ |
850 | void GNUNET_TESTING_get_statistics (struct GNUNET_TESTING_PeerGroup *pg, | 836 | void |
851 | GNUNET_STATISTICS_Callback cont, | 837 | GNUNET_TESTING_get_statistics (struct GNUNET_TESTING_PeerGroup *pg, |
852 | GNUNET_TESTING_STATISTICS_Iterator proc, | 838 | GNUNET_STATISTICS_Callback cont, |
853 | void *cls); | 839 | GNUNET_TESTING_STATISTICS_Iterator proc, |
840 | void *cls); | ||
854 | 841 | ||
855 | /** | 842 | /** |
856 | * Topologies supported for testbeds. | 843 | * Topologies supported for testbeds. |
@@ -965,8 +952,9 @@ enum GNUNET_TESTING_TopologyOption | |||
965 | * @return GNUNET_YES if topology string matched a | 952 | * @return GNUNET_YES if topology string matched a |
966 | * known topology, GNUNET_NO if not | 953 | * known topology, GNUNET_NO if not |
967 | */ | 954 | */ |
968 | int GNUNET_TESTING_topology_get (enum GNUNET_TESTING_Topology *topology, | 955 | int |
969 | const char *topology_string); | 956 | GNUNET_TESTING_topology_get (enum GNUNET_TESTING_Topology *topology, |
957 | const char *topology_string); | ||
970 | 958 | ||
971 | /** | 959 | /** |
972 | * Get connect topology option from string input. | 960 | * Get connect topology option from string input. |
@@ -977,9 +965,10 @@ int GNUNET_TESTING_topology_get (enum GNUNET_TESTING_Topology *topology, | |||
977 | * @return GNUNET_YES if topology string matched a | 965 | * @return GNUNET_YES if topology string matched a |
978 | * known topology, GNUNET_NO if not | 966 | * known topology, GNUNET_NO if not |
979 | */ | 967 | */ |
980 | int GNUNET_TESTING_topology_option_get (enum GNUNET_TESTING_TopologyOption | 968 | int |
981 | *topology_option, | 969 | GNUNET_TESTING_topology_option_get (enum GNUNET_TESTING_TopologyOption |
982 | const char *topology_string); | 970 | *topology_option, |
971 | const char *topology_string); | ||
983 | 972 | ||
984 | 973 | ||
985 | /** | 974 | /** |
@@ -1018,13 +1007,11 @@ int GNUNET_TESTING_topology_option_get (enum GNUNET_TESTING_TopologyOption | |||
1018 | * @return the maximum number of connections were all allowed peers | 1007 | * @return the maximum number of connections were all allowed peers |
1019 | * connected to each other | 1008 | * connected to each other |
1020 | */ | 1009 | */ |
1021 | unsigned int GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup | 1010 | unsigned int |
1022 | *pg, | 1011 | GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg, |
1023 | enum GNUNET_TESTING_Topology | 1012 | enum GNUNET_TESTING_Topology topology, |
1024 | topology, | 1013 | enum GNUNET_TESTING_Topology restrict_topology, |
1025 | enum GNUNET_TESTING_Topology | 1014 | const char *restrict_transports); |
1026 | restrict_topology, | ||
1027 | const char *restrict_transports); | ||
1028 | 1015 | ||
1029 | /** | 1016 | /** |
1030 | * Iterate over all (running) peers in the peer group, retrieve | 1017 | * Iterate over all (running) peers in the peer group, retrieve |
@@ -1034,22 +1021,25 @@ unsigned int GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup | |||
1034 | * @param cb callback for topology information | 1021 | * @param cb callback for topology information |
1035 | * @param cls closure for callback | 1022 | * @param cls closure for callback |
1036 | */ | 1023 | */ |
1037 | void GNUNET_TESTING_get_topology (struct GNUNET_TESTING_PeerGroup *pg, | 1024 | void |
1038 | GNUNET_TESTING_NotifyTopology cb, void *cls); | 1025 | GNUNET_TESTING_get_topology (struct GNUNET_TESTING_PeerGroup *pg, |
1026 | GNUNET_TESTING_NotifyTopology cb, void *cls); | ||
1039 | 1027 | ||
1040 | /** | 1028 | /** |
1041 | * Stop the connection process temporarily. | 1029 | * Stop the connection process temporarily. |
1042 | * | 1030 | * |
1043 | * @param pg the peer group to stop connecting | 1031 | * @param pg the peer group to stop connecting |
1044 | */ | 1032 | */ |
1045 | void GNUNET_TESTING_stop_connections (struct GNUNET_TESTING_PeerGroup *pg); | 1033 | void |
1034 | GNUNET_TESTING_stop_connections (struct GNUNET_TESTING_PeerGroup *pg); | ||
1046 | 1035 | ||
1047 | /** | 1036 | /** |
1048 | * Resume the connection process. | 1037 | * Resume the connection process. |
1049 | * | 1038 | * |
1050 | * @param pg the peer group to resume connecting | 1039 | * @param pg the peer group to resume connecting |
1051 | */ | 1040 | */ |
1052 | void GNUNET_TESTING_resume_connections (struct GNUNET_TESTING_PeerGroup *pg); | 1041 | void |
1042 | GNUNET_TESTING_resume_connections (struct GNUNET_TESTING_PeerGroup *pg); | ||
1053 | 1043 | ||
1054 | /** | 1044 | /** |
1055 | * There are many ways to connect peers that are supported by this function. | 1045 | * There are many ways to connect peers that are supported by this function. |
@@ -1073,15 +1063,15 @@ void GNUNET_TESTING_resume_connections (struct GNUNET_TESTING_PeerGroup *pg); | |||
1073 | * | 1063 | * |
1074 | * @return the number of connections that will be attempted, GNUNET_SYSERR on error | 1064 | * @return the number of connections that will be attempted, GNUNET_SYSERR on error |
1075 | */ | 1065 | */ |
1076 | int GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg, | 1066 | int |
1077 | enum GNUNET_TESTING_Topology topology, | 1067 | GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg, |
1078 | enum GNUNET_TESTING_TopologyOption options, | 1068 | enum GNUNET_TESTING_Topology topology, |
1079 | double option_modifier, | 1069 | enum GNUNET_TESTING_TopologyOption options, |
1080 | struct GNUNET_TIME_Relative | 1070 | double option_modifier, |
1081 | connect_timeout, | 1071 | struct GNUNET_TIME_Relative connect_timeout, |
1082 | unsigned int connect_attempts, | 1072 | unsigned int connect_attempts, |
1083 | GNUNET_TESTING_NotifyCompletion | 1073 | GNUNET_TESTING_NotifyCompletion |
1084 | notify_callback, void *notify_cls); | 1074 | notify_callback, void *notify_cls); |
1085 | 1075 | ||
1086 | /** | 1076 | /** |
1087 | * Start or stop an individual peer from the given group. | 1077 | * Start or stop an individual peer from the given group. |
@@ -1093,11 +1083,11 @@ int GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg, | |||
1093 | * @param cb function to call at the end | 1083 | * @param cb function to call at the end |
1094 | * @param cb_cls closure for cb | 1084 | * @param cb_cls closure for cb |
1095 | */ | 1085 | */ |
1096 | void GNUNET_TESTING_daemons_vary (struct GNUNET_TESTING_PeerGroup *pg, | 1086 | void |
1097 | unsigned int offset, int desired_status, | 1087 | GNUNET_TESTING_daemons_vary (struct GNUNET_TESTING_PeerGroup *pg, |
1098 | struct GNUNET_TIME_Relative timeout, | 1088 | unsigned int offset, int desired_status, |
1099 | GNUNET_TESTING_NotifyCompletion cb, | 1089 | struct GNUNET_TIME_Relative timeout, |
1100 | void *cb_cls); | 1090 | GNUNET_TESTING_NotifyCompletion cb, void *cb_cls); |
1101 | 1091 | ||
1102 | /** | 1092 | /** |
1103 | * Start a peer group with a given number of peers. Notify | 1093 | * Start a peer group with a given number of peers. Notify |
@@ -1116,23 +1106,14 @@ void GNUNET_TESTING_daemons_vary (struct GNUNET_TESTING_PeerGroup *pg, | |||
1116 | * | 1106 | * |
1117 | * @return NULL on error, otherwise handle to control peer group | 1107 | * @return NULL on error, otherwise handle to control peer group |
1118 | */ | 1108 | */ |
1119 | struct GNUNET_TESTING_PeerGroup *GNUNET_TESTING_peergroup_start (const struct | 1109 | struct GNUNET_TESTING_PeerGroup * |
1120 | GNUNET_CONFIGURATION_Handle | 1110 | GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg, |
1121 | *cfg, | 1111 | unsigned int total, |
1122 | unsigned int | 1112 | struct GNUNET_TIME_Relative timeout, |
1123 | total, | 1113 | GNUNET_TESTING_NotifyConnection connect_cb, |
1124 | struct | 1114 | GNUNET_TESTING_NotifyCompletion peergroup_cb, |
1125 | GNUNET_TIME_Relative | 1115 | void *peergroup_cls, |
1126 | timeout, | 1116 | const struct GNUNET_TESTING_Host *hostnames); |
1127 | GNUNET_TESTING_NotifyConnection | ||
1128 | connect_cb, | ||
1129 | GNUNET_TESTING_NotifyCompletion | ||
1130 | peergroup_cb, | ||
1131 | void | ||
1132 | *peergroup_cls, | ||
1133 | const struct | ||
1134 | GNUNET_TESTING_Host | ||
1135 | *hostnames); | ||
1136 | 1117 | ||
1137 | /** | 1118 | /** |
1138 | * Print current topology to a graphviz readable file. | 1119 | * Print current topology to a graphviz readable file. |
@@ -1143,11 +1124,11 @@ struct GNUNET_TESTING_PeerGroup *GNUNET_TESTING_peergroup_start (const struct | |||
1143 | * @param notify_cb_cls closure for notify_cb | 1124 | * @param notify_cb_cls closure for notify_cb |
1144 | * | 1125 | * |
1145 | */ | 1126 | */ |
1146 | void GNUNET_TESTING_peergroup_topology_to_file (struct GNUNET_TESTING_PeerGroup | 1127 | void |
1147 | *pg, | 1128 | GNUNET_TESTING_peergroup_topology_to_file (struct GNUNET_TESTING_PeerGroup *pg, |
1148 | const char *output_filename, | 1129 | const char *output_filename, |
1149 | GNUNET_TESTING_NotifyCompletion | 1130 | GNUNET_TESTING_NotifyCompletion |
1150 | notify_cb, void *notify_cb_cls); | 1131 | notify_cb, void *notify_cb_cls); |
1151 | 1132 | ||
1152 | 1133 | ||
1153 | #if 0 /* keep Emacsens' auto-indent happy */ | 1134 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_time_lib.h b/src/include/gnunet_time_lib.h index ffae1ce51..1f157631f 100644 --- a/src/include/gnunet_time_lib.h +++ b/src/include/gnunet_time_lib.h | |||
@@ -151,34 +151,40 @@ struct GNUNET_TIME_AbsoluteNBO | |||
151 | /** | 151 | /** |
152 | * Return relative time of 0ms. | 152 | * Return relative time of 0ms. |
153 | */ | 153 | */ |
154 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_zero (void); | 154 | struct GNUNET_TIME_Relative |
155 | GNUNET_TIME_relative_get_zero (void); | ||
155 | 156 | ||
156 | /** | 157 | /** |
157 | * Return absolute time of 0ms. | 158 | * Return absolute time of 0ms. |
158 | */ | 159 | */ |
159 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get_zero (void); | 160 | struct GNUNET_TIME_Absolute |
161 | GNUNET_TIME_absolute_get_zero (void); | ||
160 | 162 | ||
161 | /** | 163 | /** |
162 | * Return relative time of 1ms. | 164 | * Return relative time of 1ms. |
163 | */ | 165 | */ |
164 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_unit (void); | 166 | struct GNUNET_TIME_Relative |
167 | GNUNET_TIME_relative_get_unit (void); | ||
165 | 168 | ||
166 | /** | 169 | /** |
167 | * Return "forever". | 170 | * Return "forever". |
168 | */ | 171 | */ |
169 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_forever (void); | 172 | struct GNUNET_TIME_Relative |
173 | GNUNET_TIME_relative_get_forever (void); | ||
170 | 174 | ||
171 | /** | 175 | /** |
172 | * Return "forever". | 176 | * Return "forever". |
173 | */ | 177 | */ |
174 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get_forever (void); | 178 | struct GNUNET_TIME_Absolute |
179 | GNUNET_TIME_absolute_get_forever (void); | ||
175 | 180 | ||
176 | /** | 181 | /** |
177 | * Get the current time. | 182 | * Get the current time. |
178 | * | 183 | * |
179 | * @return the current time | 184 | * @return the current time |
180 | */ | 185 | */ |
181 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get (void); | 186 | struct GNUNET_TIME_Absolute |
187 | GNUNET_TIME_absolute_get (void); | ||
182 | 188 | ||
183 | /** | 189 | /** |
184 | * Convert relative time to an absolute time in the | 190 | * Convert relative time to an absolute time in the |
@@ -187,9 +193,8 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get (void); | |||
187 | * @param rel relative time to convert | 193 | * @param rel relative time to convert |
188 | * @return timestamp that is "rel" in the future, or FOREVER if rel==FOREVER (or if we would overflow) | 194 | * @return timestamp that is "rel" in the future, or FOREVER if rel==FOREVER (or if we would overflow) |
189 | */ | 195 | */ |
190 | struct GNUNET_TIME_Absolute GNUNET_TIME_relative_to_absolute (struct | 196 | struct GNUNET_TIME_Absolute |
191 | GNUNET_TIME_Relative | 197 | GNUNET_TIME_relative_to_absolute (struct GNUNET_TIME_Relative rel); |
192 | rel); | ||
193 | 198 | ||
194 | /** | 199 | /** |
195 | * Return the minimum of two relative time values. | 200 | * Return the minimum of two relative time values. |
@@ -198,10 +203,9 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_relative_to_absolute (struct | |||
198 | * @param t2 other timestamp | 203 | * @param t2 other timestamp |
199 | * @return timestamp that is smaller | 204 | * @return timestamp that is smaller |
200 | */ | 205 | */ |
201 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_min (struct | 206 | struct GNUNET_TIME_Relative |
202 | GNUNET_TIME_Relative t1, | 207 | GNUNET_TIME_relative_min (struct GNUNET_TIME_Relative t1, |
203 | struct | 208 | struct GNUNET_TIME_Relative t2); |
204 | GNUNET_TIME_Relative t2); | ||
205 | 209 | ||
206 | 210 | ||
207 | /** | 211 | /** |
@@ -211,10 +215,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_min (struct | |||
211 | * @param t2 other timestamp | 215 | * @param t2 other timestamp |
212 | * @return timestamp that is larger | 216 | * @return timestamp that is larger |
213 | */ | 217 | */ |
214 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_max (struct | 218 | struct GNUNET_TIME_Relative |
215 | GNUNET_TIME_Relative t1, | 219 | GNUNET_TIME_relative_max (struct GNUNET_TIME_Relative t1, |
216 | struct | 220 | struct GNUNET_TIME_Relative t2); |
217 | GNUNET_TIME_Relative t2); | ||
218 | 221 | ||
219 | /** | 222 | /** |
220 | * Return the minimum of two absolute time values. | 223 | * Return the minimum of two absolute time values. |
@@ -223,10 +226,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_max (struct | |||
223 | * @param t2 other timestamp | 226 | * @param t2 other timestamp |
224 | * @return timestamp that is smaller | 227 | * @return timestamp that is smaller |
225 | */ | 228 | */ |
226 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_min (struct | 229 | struct GNUNET_TIME_Absolute |
227 | GNUNET_TIME_Absolute t1, | 230 | GNUNET_TIME_absolute_min (struct GNUNET_TIME_Absolute t1, |
228 | struct | 231 | struct GNUNET_TIME_Absolute t2); |
229 | GNUNET_TIME_Absolute t2); | ||
230 | 232 | ||
231 | /** | 233 | /** |
232 | * Return the maximum of two absolute time values. | 234 | * Return the maximum of two absolute time values. |
@@ -235,10 +237,9 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_min (struct | |||
235 | * @param t2 other timestamp | 237 | * @param t2 other timestamp |
236 | * @return timestamp that is smaller | 238 | * @return timestamp that is smaller |
237 | */ | 239 | */ |
238 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_max (struct | 240 | struct GNUNET_TIME_Absolute |
239 | GNUNET_TIME_Absolute t1, | 241 | GNUNET_TIME_absolute_max (struct GNUNET_TIME_Absolute t1, |
240 | struct | 242 | struct GNUNET_TIME_Absolute t2); |
241 | GNUNET_TIME_Absolute t2); | ||
242 | 243 | ||
243 | /** | 244 | /** |
244 | * Given a timestamp in the future, how much time | 245 | * Given a timestamp in the future, how much time |
@@ -247,9 +248,8 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_max (struct | |||
247 | * @param future some absolute time, typically in the future | 248 | * @param future some absolute time, typically in the future |
248 | * @return future - now, or 0 if now >= future, or FOREVER if future==FOREVER. | 249 | * @return future - now, or 0 if now >= future, or FOREVER if future==FOREVER. |
249 | */ | 250 | */ |
250 | struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_remaining (struct | 251 | struct GNUNET_TIME_Relative |
251 | GNUNET_TIME_Absolute | 252 | GNUNET_TIME_absolute_get_remaining (struct GNUNET_TIME_Absolute future); |
252 | future); | ||
253 | 253 | ||
254 | 254 | ||
255 | /** | 255 | /** |
@@ -262,10 +262,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_remaining (struct | |||
262 | * @return remaining duration for the operation, | 262 | * @return remaining duration for the operation, |
263 | * assuming it continues at the same speed | 263 | * assuming it continues at the same speed |
264 | */ | 264 | */ |
265 | struct GNUNET_TIME_Relative GNUNET_TIME_calculate_eta (struct | 265 | struct GNUNET_TIME_Relative |
266 | GNUNET_TIME_Absolute | 266 | GNUNET_TIME_calculate_eta (struct GNUNET_TIME_Absolute start, uint64_t finished, |
267 | start, uint64_t finished, | 267 | uint64_t total); |
268 | uint64_t total); | ||
269 | 268 | ||
270 | 269 | ||
271 | /** | 270 | /** |
@@ -277,12 +276,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_calculate_eta (struct | |||
277 | * @param end some absolute time (typically larger or equal to start) | 276 | * @param end some absolute time (typically larger or equal to start) |
278 | * @return 0 if start >= end; FOREVER if end==FOREVER; otherwise end - start | 277 | * @return 0 if start >= end; FOREVER if end==FOREVER; otherwise end - start |
279 | */ | 278 | */ |
280 | struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_difference (struct | 279 | struct GNUNET_TIME_Relative |
281 | GNUNET_TIME_Absolute | 280 | GNUNET_TIME_absolute_get_difference (struct GNUNET_TIME_Absolute start, |
282 | start, | 281 | struct GNUNET_TIME_Absolute end); |
283 | struct | ||
284 | GNUNET_TIME_Absolute | ||
285 | end); | ||
286 | 282 | ||
287 | /** | 283 | /** |
288 | * Get the duration of an operation as the | 284 | * Get the duration of an operation as the |
@@ -291,9 +287,8 @@ struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_difference (struct | |||
291 | * @param whence some absolute time, typically in the past | 287 | * @param whence some absolute time, typically in the past |
292 | * @return aborts if hence==FOREVER, 0 if hence > now, otherwise now-hence. | 288 | * @return aborts if hence==FOREVER, 0 if hence > now, otherwise now-hence. |
293 | */ | 289 | */ |
294 | struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_duration (struct | 290 | struct GNUNET_TIME_Relative |
295 | GNUNET_TIME_Absolute | 291 | GNUNET_TIME_absolute_get_duration (struct GNUNET_TIME_Absolute whence); |
296 | whence); | ||
297 | 292 | ||
298 | 293 | ||
299 | /** | 294 | /** |
@@ -304,12 +299,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_duration (struct | |||
304 | * @param duration some relative time to add | 299 | * @param duration some relative time to add |
305 | * @return FOREVER if either argument is FOREVER or on overflow; start+duration otherwise | 300 | * @return FOREVER if either argument is FOREVER or on overflow; start+duration otherwise |
306 | */ | 301 | */ |
307 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_add (struct | 302 | struct GNUNET_TIME_Absolute |
308 | GNUNET_TIME_Absolute | 303 | GNUNET_TIME_absolute_add (struct GNUNET_TIME_Absolute start, |
309 | start, | 304 | struct GNUNET_TIME_Relative duration); |
310 | struct | ||
311 | GNUNET_TIME_Relative | ||
312 | duration); | ||
313 | 305 | ||
314 | 306 | ||
315 | /** | 307 | /** |
@@ -320,12 +312,9 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_add (struct | |||
320 | * @param duration some relative time to subtract | 312 | * @param duration some relative time to subtract |
321 | * @return ZERO if start <= duration, or FOREVER if start time is FOREVER; start-duration otherwise | 313 | * @return ZERO if start <= duration, or FOREVER if start time is FOREVER; start-duration otherwise |
322 | */ | 314 | */ |
323 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_subtract (struct | 315 | struct GNUNET_TIME_Absolute |
324 | GNUNET_TIME_Absolute | 316 | GNUNET_TIME_absolute_subtract (struct GNUNET_TIME_Absolute start, |
325 | start, | 317 | struct GNUNET_TIME_Relative duration); |
326 | struct | ||
327 | GNUNET_TIME_Relative | ||
328 | duration); | ||
329 | 318 | ||
330 | /** | 319 | /** |
331 | * Multiply relative time by a given factor. | 320 | * Multiply relative time by a given factor. |
@@ -334,10 +323,9 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_subtract (struct | |||
334 | * @param factor integer to multiply with | 323 | * @param factor integer to multiply with |
335 | * @return FOREVER if rel=FOREVER or on overflow; otherwise rel*factor | 324 | * @return FOREVER if rel=FOREVER or on overflow; otherwise rel*factor |
336 | */ | 325 | */ |
337 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply (struct | 326 | struct GNUNET_TIME_Relative |
338 | GNUNET_TIME_Relative | 327 | GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel, |
339 | rel, | 328 | unsigned int factor); |
340 | unsigned int factor); | ||
341 | 329 | ||
342 | /** | 330 | /** |
343 | * Divide relative time by a given factor. | 331 | * Divide relative time by a given factor. |
@@ -346,10 +334,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply (struct | |||
346 | * @param factor integer to divide by | 334 | * @param factor integer to divide by |
347 | * @return FOREVER if rel=FOREVER or factor==0; otherwise rel/factor | 335 | * @return FOREVER if rel=FOREVER or factor==0; otherwise rel/factor |
348 | */ | 336 | */ |
349 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_divide (struct | 337 | struct GNUNET_TIME_Relative |
350 | GNUNET_TIME_Relative | 338 | GNUNET_TIME_relative_divide (struct GNUNET_TIME_Relative rel, |
351 | rel, | 339 | unsigned int factor); |
352 | unsigned int factor); | ||
353 | 340 | ||
354 | /** | 341 | /** |
355 | * Add relative times together. | 342 | * Add relative times together. |
@@ -358,10 +345,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_divide (struct | |||
358 | * @param a2 some other relative time | 345 | * @param a2 some other relative time |
359 | * @return FOREVER if either argument is FOREVER or on overflow; a1+a2 otherwise | 346 | * @return FOREVER if either argument is FOREVER or on overflow; a1+a2 otherwise |
360 | */ | 347 | */ |
361 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_add (struct | 348 | struct GNUNET_TIME_Relative |
362 | GNUNET_TIME_Relative a1, | 349 | GNUNET_TIME_relative_add (struct GNUNET_TIME_Relative a1, |
363 | struct | 350 | struct GNUNET_TIME_Relative a2); |
364 | GNUNET_TIME_Relative a2); | ||
365 | 351 | ||
366 | /** | 352 | /** |
367 | * Subtract relative timestamp from the other. | 353 | * Subtract relative timestamp from the other. |
@@ -370,12 +356,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_add (struct | |||
370 | * @param a2 second timestamp | 356 | * @param a2 second timestamp |
371 | * @return ZERO if a2>=a1 (including both FOREVER), FOREVER if a1 is FOREVER, a1-a2 otherwise | 357 | * @return ZERO if a2>=a1 (including both FOREVER), FOREVER if a1 is FOREVER, a1-a2 otherwise |
372 | */ | 358 | */ |
373 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_subtract (struct | 359 | struct GNUNET_TIME_Relative |
374 | GNUNET_TIME_Relative | 360 | GNUNET_TIME_relative_subtract (struct GNUNET_TIME_Relative a1, |
375 | a1, | 361 | struct GNUNET_TIME_Relative a2); |
376 | struct | ||
377 | GNUNET_TIME_Relative | ||
378 | a2); | ||
379 | 362 | ||
380 | 363 | ||
381 | /** | 364 | /** |
@@ -384,9 +367,8 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_subtract (struct | |||
384 | * @param a time to convert | 367 | * @param a time to convert |
385 | * @return converted time value | 368 | * @return converted time value |
386 | */ | 369 | */ |
387 | struct GNUNET_TIME_RelativeNBO GNUNET_TIME_relative_hton (struct | 370 | struct GNUNET_TIME_RelativeNBO |
388 | GNUNET_TIME_Relative | 371 | GNUNET_TIME_relative_hton (struct GNUNET_TIME_Relative a); |
389 | a); | ||
390 | 372 | ||
391 | /** | 373 | /** |
392 | * Convert relative time from network byte order. | 374 | * Convert relative time from network byte order. |
@@ -394,9 +376,8 @@ struct GNUNET_TIME_RelativeNBO GNUNET_TIME_relative_hton (struct | |||
394 | * @param a time to convert | 376 | * @param a time to convert |
395 | * @return converted time value | 377 | * @return converted time value |
396 | */ | 378 | */ |
397 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_ntoh (struct | 379 | struct GNUNET_TIME_Relative |
398 | GNUNET_TIME_RelativeNBO | 380 | GNUNET_TIME_relative_ntoh (struct GNUNET_TIME_RelativeNBO a); |
399 | a); | ||
400 | 381 | ||
401 | /** | 382 | /** |
402 | * Convert relative time to network byte order. | 383 | * Convert relative time to network byte order. |
@@ -404,9 +385,8 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_ntoh (struct | |||
404 | * @param a time to convert | 385 | * @param a time to convert |
405 | * @return converted time value | 386 | * @return converted time value |
406 | */ | 387 | */ |
407 | struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton (struct | 388 | struct GNUNET_TIME_AbsoluteNBO |
408 | GNUNET_TIME_Absolute | 389 | GNUNET_TIME_absolute_hton (struct GNUNET_TIME_Absolute a); |
409 | a); | ||
410 | 390 | ||
411 | /** | 391 | /** |
412 | * Convert relative time from network byte order. | 392 | * Convert relative time from network byte order. |
@@ -414,9 +394,8 @@ struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton (struct | |||
414 | * @param a time to convert | 394 | * @param a time to convert |
415 | * @return converted time value | 395 | * @return converted time value |
416 | */ | 396 | */ |
417 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh (struct | 397 | struct GNUNET_TIME_Absolute |
418 | GNUNET_TIME_AbsoluteNBO | 398 | GNUNET_TIME_absolute_ntoh (struct GNUNET_TIME_AbsoluteNBO a); |
419 | a); | ||
420 | 399 | ||
421 | /** | 400 | /** |
422 | * Convert a relative time to a string. | 401 | * Convert a relative time to a string. |
@@ -426,14 +405,16 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh (struct | |||
426 | * | 405 | * |
427 | * @return string form of the time (as milliseconds) | 406 | * @return string form of the time (as milliseconds) |
428 | */ | 407 | */ |
429 | const char *GNUNET_TIME_relative_to_string (struct GNUNET_TIME_Relative time); | 408 | const char * |
409 | GNUNET_TIME_relative_to_string (struct GNUNET_TIME_Relative time); | ||
430 | 410 | ||
431 | /** | 411 | /** |
432 | * Set the timestamp offset for this instance. | 412 | * Set the timestamp offset for this instance. |
433 | * | 413 | * |
434 | * @param offset the offset to skew the locale time by | 414 | * @param offset the offset to skew the locale time by |
435 | */ | 415 | */ |
436 | void GNUNET_TIME_set_offset (long long offset); | 416 | void |
417 | GNUNET_TIME_set_offset (long long offset); | ||
437 | 418 | ||
438 | #if 0 /* keep Emacsens' auto-indent happy */ | 419 | #if 0 /* keep Emacsens' auto-indent happy */ |
439 | { | 420 | { |
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h index 7e0656956..988d55784 100644 --- a/src/include/gnunet_transport_service.h +++ b/src/include/gnunet_transport_service.h | |||
@@ -468,18 +468,12 @@ typedef void (*GNUNET_TRANSPORT_AddressLookUpCallback) (void *cls, | |||
468 | * @param nd function to call on disconnect events | 468 | * @param nd function to call on disconnect events |
469 | * @return NULL on error | 469 | * @return NULL on error |
470 | */ | 470 | */ |
471 | struct GNUNET_TRANSPORT_Handle *GNUNET_TRANSPORT_connect (const struct | 471 | struct GNUNET_TRANSPORT_Handle * |
472 | GNUNET_CONFIGURATION_Handle | 472 | GNUNET_TRANSPORT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, |
473 | *cfg, | 473 | const struct GNUNET_PeerIdentity *self, void *cls, |
474 | const struct | 474 | GNUNET_TRANSPORT_ReceiveCallback rec, |
475 | GNUNET_PeerIdentity | 475 | GNUNET_TRANSPORT_NotifyConnect nc, |
476 | *self, void *cls, | 476 | GNUNET_TRANSPORT_NotifyDisconnect nd); |
477 | GNUNET_TRANSPORT_ReceiveCallback | ||
478 | rec, | ||
479 | GNUNET_TRANSPORT_NotifyConnect | ||
480 | nc, | ||
481 | GNUNET_TRANSPORT_NotifyDisconnect | ||
482 | nd); | ||
483 | 477 | ||
484 | 478 | ||
485 | /** | 479 | /** |
@@ -487,7 +481,8 @@ struct GNUNET_TRANSPORT_Handle *GNUNET_TRANSPORT_connect (const struct | |||
487 | * | 481 | * |
488 | * @param handle handle returned from connect | 482 | * @param handle handle returned from connect |
489 | */ | 483 | */ |
490 | void GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle); | 484 | void |
485 | GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle); | ||
491 | 486 | ||
492 | 487 | ||
493 | /** | 488 | /** |
@@ -497,8 +492,9 @@ void GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle); | |||
497 | * @param handle connection to transport service | 492 | * @param handle connection to transport service |
498 | * @param target who we should try to connect to | 493 | * @param target who we should try to connect to |
499 | */ | 494 | */ |
500 | void GNUNET_TRANSPORT_try_connect (struct GNUNET_TRANSPORT_Handle *handle, | 495 | void |
501 | const struct GNUNET_PeerIdentity *target); | 496 | GNUNET_TRANSPORT_try_connect (struct GNUNET_TRANSPORT_Handle *handle, |
497 | const struct GNUNET_PeerIdentity *target); | ||
502 | 498 | ||
503 | 499 | ||
504 | /** | 500 | /** |
@@ -510,10 +506,11 @@ void GNUNET_TRANSPORT_try_connect (struct GNUNET_TRANSPORT_Handle *handle, | |||
510 | * @param quota_in incoming bandwidth quota | 506 | * @param quota_in incoming bandwidth quota |
511 | * @param quota_out outgoing bandwidth quota | 507 | * @param quota_out outgoing bandwidth quota |
512 | */ | 508 | */ |
513 | void GNUNET_TRANSPORT_set_quota (struct GNUNET_TRANSPORT_Handle *handle, | 509 | void |
514 | const struct GNUNET_PeerIdentity *target, | 510 | GNUNET_TRANSPORT_set_quota (struct GNUNET_TRANSPORT_Handle *handle, |
515 | struct GNUNET_BANDWIDTH_Value32NBO quota_in, | 511 | const struct GNUNET_PeerIdentity *target, |
516 | struct GNUNET_BANDWIDTH_Value32NBO quota_out); | 512 | struct GNUNET_BANDWIDTH_Value32NBO quota_in, |
513 | struct GNUNET_BANDWIDTH_Value32NBO quota_out); | ||
517 | 514 | ||
518 | 515 | ||
519 | /** | 516 | /** |
@@ -541,16 +538,13 @@ struct GNUNET_TRANSPORT_TransmitHandle; | |||
541 | * non-NULL if the notify callback was queued (can be used to cancel | 538 | * non-NULL if the notify callback was queued (can be used to cancel |
542 | * using GNUNET_TRANSPORT_notify_transmit_ready_cancel) | 539 | * using GNUNET_TRANSPORT_notify_transmit_ready_cancel) |
543 | */ | 540 | */ |
544 | struct GNUNET_TRANSPORT_TransmitHandle | 541 | struct GNUNET_TRANSPORT_TransmitHandle * |
545 | *GNUNET_TRANSPORT_notify_transmit_ready (struct GNUNET_TRANSPORT_Handle | 542 | GNUNET_TRANSPORT_notify_transmit_ready (struct GNUNET_TRANSPORT_Handle *handle, |
546 | *handle, | 543 | const struct GNUNET_PeerIdentity |
547 | const struct GNUNET_PeerIdentity | 544 | *target, size_t size, uint32_t priority, |
548 | *target, size_t size, | 545 | struct GNUNET_TIME_Relative timeout, |
549 | uint32_t priority, | 546 | GNUNET_CONNECTION_TransmitReadyNotify |
550 | struct GNUNET_TIME_Relative | 547 | notify, void *notify_cls); |
551 | timeout, | ||
552 | GNUNET_CONNECTION_TransmitReadyNotify | ||
553 | notify, void *notify_cls); | ||
554 | 548 | ||
555 | 549 | ||
556 | /** | 550 | /** |
@@ -558,9 +552,10 @@ struct GNUNET_TRANSPORT_TransmitHandle | |||
558 | * | 552 | * |
559 | * @param th handle of the transmission notification request to cancel | 553 | * @param th handle of the transmission notification request to cancel |
560 | */ | 554 | */ |
561 | void GNUNET_TRANSPORT_notify_transmit_ready_cancel (struct | 555 | void |
562 | GNUNET_TRANSPORT_TransmitHandle | 556 | GNUNET_TRANSPORT_notify_transmit_ready_cancel (struct |
563 | *th); | 557 | GNUNET_TRANSPORT_TransmitHandle |
558 | *th); | ||
564 | 559 | ||
565 | 560 | ||
566 | 561 | ||
@@ -584,9 +579,10 @@ typedef void (*GNUNET_TRANSPORT_HelloUpdateCallback) (void *cls, | |||
584 | * @param rec function to call with the HELLO | 579 | * @param rec function to call with the HELLO |
585 | * @param rec_cls closure for rec | 580 | * @param rec_cls closure for rec |
586 | */ | 581 | */ |
587 | void GNUNET_TRANSPORT_get_hello (struct GNUNET_TRANSPORT_Handle *handle, | 582 | void |
588 | GNUNET_TRANSPORT_HelloUpdateCallback rec, | 583 | GNUNET_TRANSPORT_get_hello (struct GNUNET_TRANSPORT_Handle *handle, |
589 | void *rec_cls); | 584 | GNUNET_TRANSPORT_HelloUpdateCallback rec, |
585 | void *rec_cls); | ||
590 | 586 | ||
591 | 587 | ||
592 | /** | 588 | /** |
@@ -596,9 +592,10 @@ void GNUNET_TRANSPORT_get_hello (struct GNUNET_TRANSPORT_Handle *handle, | |||
596 | * @param rec function previously registered to be called with the HELLOs | 592 | * @param rec function previously registered to be called with the HELLOs |
597 | * @param rec_cls closure for rec | 593 | * @param rec_cls closure for rec |
598 | */ | 594 | */ |
599 | void GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_Handle *handle, | 595 | void |
600 | GNUNET_TRANSPORT_HelloUpdateCallback | 596 | GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_Handle *handle, |
601 | rec, void *rec_cls); | 597 | GNUNET_TRANSPORT_HelloUpdateCallback rec, |
598 | void *rec_cls); | ||
602 | 599 | ||
603 | 600 | ||
604 | /** | 601 | /** |
@@ -612,9 +609,10 @@ void GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_Handle *handle, | |||
612 | * @param cls closure for continuation | 609 | * @param cls closure for continuation |
613 | * | 610 | * |
614 | */ | 611 | */ |
615 | void GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle, | 612 | void |
616 | const struct GNUNET_MessageHeader *hello, | 613 | GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle, |
617 | GNUNET_SCHEDULER_Task cont, void *cls); | 614 | const struct GNUNET_MessageHeader *hello, |
615 | GNUNET_SCHEDULER_Task cont, void *cls); | ||
618 | 616 | ||
619 | 617 | ||
620 | /** | 618 | /** |
@@ -630,13 +628,13 @@ void GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle, | |||
630 | * @param aluc function to call with the results | 628 | * @param aluc function to call with the results |
631 | * @param aluc_cls closure for aluc | 629 | * @param aluc_cls closure for aluc |
632 | */ | 630 | */ |
633 | void GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle | 631 | void |
634 | *cfg, const char *address, | 632 | GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg, |
635 | size_t addressLen, int numeric, | 633 | const char *address, size_t addressLen, |
636 | const char *nameTrans, | 634 | int numeric, const char *nameTrans, |
637 | struct GNUNET_TIME_Relative timeout, | 635 | struct GNUNET_TIME_Relative timeout, |
638 | GNUNET_TRANSPORT_AddressLookUpCallback | 636 | GNUNET_TRANSPORT_AddressLookUpCallback aluc, |
639 | aluc, void *aluc_cls); | 637 | void *aluc_cls); |
640 | 638 | ||
641 | 639 | ||
642 | /** | 640 | /** |
@@ -649,14 +647,14 @@ void GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle | |||
649 | * @param peer_address_callback function to call with the results | 647 | * @param peer_address_callback function to call with the results |
650 | * @param peer_address_callback_cls closure for peer_address_callback | 648 | * @param peer_address_callback_cls closure for peer_address_callback |
651 | */ | 649 | */ |
652 | void GNUNET_TRANSPORT_peer_address_lookup (const struct | 650 | void |
653 | GNUNET_CONFIGURATION_Handle *cfg, | 651 | GNUNET_TRANSPORT_peer_address_lookup (const struct GNUNET_CONFIGURATION_Handle |
654 | const struct GNUNET_PeerIdentity | 652 | *cfg, |
655 | *peer, | 653 | const struct GNUNET_PeerIdentity *peer, |
656 | struct GNUNET_TIME_Relative timeout, | 654 | struct GNUNET_TIME_Relative timeout, |
657 | GNUNET_TRANSPORT_AddressLookUpCallback | 655 | GNUNET_TRANSPORT_AddressLookUpCallback |
658 | peer_address_callback, | 656 | peer_address_callback, |
659 | void *peer_address_callback_cls); | 657 | void *peer_address_callback_cls); |
660 | 658 | ||
661 | 659 | ||
662 | /** | 660 | /** |
@@ -668,12 +666,12 @@ void GNUNET_TRANSPORT_peer_address_lookup (const struct | |||
668 | * @param peer_address_callback function to call with the results | 666 | * @param peer_address_callback function to call with the results |
669 | * @param peer_address_callback_cls closure for peer_address_callback | 667 | * @param peer_address_callback_cls closure for peer_address_callback |
670 | */ | 668 | */ |
671 | void GNUNET_TRANSPORT_address_iterate (const struct GNUNET_CONFIGURATION_Handle | 669 | void |
672 | *cfg, | 670 | GNUNET_TRANSPORT_address_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg, |
673 | struct GNUNET_TIME_Relative timeout, | 671 | struct GNUNET_TIME_Relative timeout, |
674 | GNUNET_TRANSPORT_AddressLookUpCallback | 672 | GNUNET_TRANSPORT_AddressLookUpCallback |
675 | peer_address_callback, | 673 | peer_address_callback, |
676 | void *peer_address_callback_cls); | 674 | void *peer_address_callback_cls); |
677 | 675 | ||
678 | 676 | ||
679 | /** | 677 | /** |
@@ -708,12 +706,10 @@ typedef int (*GNUNET_TRANSPORT_BlacklistCallback) (void *cls, | |||
708 | * @param cb_cls closure for cb | 706 | * @param cb_cls closure for cb |
709 | * @return NULL on error, otherwise handle for cancellation | 707 | * @return NULL on error, otherwise handle for cancellation |
710 | */ | 708 | */ |
711 | struct GNUNET_TRANSPORT_Blacklist *GNUNET_TRANSPORT_blacklist (const struct | 709 | struct GNUNET_TRANSPORT_Blacklist * |
712 | GNUNET_CONFIGURATION_Handle | 710 | GNUNET_TRANSPORT_blacklist (const struct GNUNET_CONFIGURATION_Handle *cfg, |
713 | *cfg, | 711 | GNUNET_TRANSPORT_BlacklistCallback cb, |
714 | GNUNET_TRANSPORT_BlacklistCallback | 712 | void *cb_cls); |
715 | cb, | ||
716 | void *cb_cls); | ||
717 | 713 | ||
718 | 714 | ||
719 | /** | 715 | /** |
@@ -722,7 +718,8 @@ struct GNUNET_TRANSPORT_Blacklist *GNUNET_TRANSPORT_blacklist (const struct | |||
722 | * | 718 | * |
723 | * @param br handle of the request that is to be cancelled | 719 | * @param br handle of the request that is to be cancelled |
724 | */ | 720 | */ |
725 | void GNUNET_TRANSPORT_blacklist_cancel (struct GNUNET_TRANSPORT_Blacklist *br); | 721 | void |
722 | GNUNET_TRANSPORT_blacklist_cancel (struct GNUNET_TRANSPORT_Blacklist *br); | ||
726 | 723 | ||
727 | 724 | ||
728 | 725 | ||
diff --git a/src/include/gnunet_upnp_service.h b/src/include/gnunet_upnp_service.h index 70e50b354..1ac2ca58e 100644 --- a/src/include/gnunet_upnp_service.h +++ b/src/include/gnunet_upnp_service.h | |||
@@ -54,10 +54,11 @@ extern "C" | |||
54 | * function will be called with NULL on error | 54 | * function will be called with NULL on error |
55 | * @param cls closure for callback | 55 | * @param cls closure for callback |
56 | */ | 56 | */ |
57 | int GNUNET_UPNP_get_ip (struct GNUNET_CONFIGURATION_Handle *cfg, int domain, | 57 | int |
58 | int type, int protocol, uint16_t port, | 58 | GNUNET_UPNP_get_ip (struct GNUNET_CONFIGURATION_Handle *cfg, int domain, |
59 | struct GNUNET_TIME_Relative timeout, | 59 | int type, int protocol, uint16_t port, |
60 | GNUNET_RESOLVER_AddressCallback callback, void *cls); | 60 | struct GNUNET_TIME_Relative timeout, |
61 | GNUNET_RESOLVER_AddressCallback callback, void *cls); | ||
61 | 62 | ||
62 | 63 | ||
63 | #if 0 /* keep Emacsens' auto-indent happy */ | 64 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/platform.h b/src/include/platform.h index 4f9eb5eda..aa2434731 100644 --- a/src/include/platform.h +++ b/src/include/platform.h | |||
@@ -226,7 +226,8 @@ | |||
226 | 226 | ||
227 | 227 | ||
228 | #if !HAVE_ATOLL | 228 | #if !HAVE_ATOLL |
229 | long long atoll (const char *nptr); | 229 | long long |
230 | atoll (const char *nptr); | ||
230 | #endif | 231 | #endif |
231 | 232 | ||
232 | #if ENABLE_NLS | 233 | #if ENABLE_NLS |
diff --git a/src/mesh/test_mesh_small.c b/src/mesh/test_mesh_small.c index fe0ca631d..0fd6b0813 100644 --- a/src/mesh/test_mesh_small.c +++ b/src/mesh/test_mesh_small.c | |||
@@ -213,8 +213,8 @@ connect_mesh_service (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
213 | } | 213 | } |
214 | 214 | ||
215 | 215 | ||
216 | static void churn_peers (void *cls, | 216 | static void |
217 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 217 | churn_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
218 | 218 | ||
219 | 219 | ||
220 | /** | 220 | /** |
diff --git a/src/nat/nat.c b/src/nat/nat.c index 6069d40ad..a037e3b20 100644 --- a/src/nat/nat.c +++ b/src/nat/nat.c | |||
@@ -361,7 +361,8 @@ struct GNUNET_NAT_Handle | |||
361 | * | 361 | * |
362 | * @param h handle to NAT | 362 | * @param h handle to NAT |
363 | */ | 363 | */ |
364 | static void start_gnunet_nat_server (struct GNUNET_NAT_Handle *h); | 364 | static void |
365 | start_gnunet_nat_server (struct GNUNET_NAT_Handle *h); | ||
365 | 366 | ||
366 | 367 | ||
367 | /** | 368 | /** |
@@ -548,8 +549,8 @@ add_ip_to_address_list (struct GNUNET_NAT_Handle *h, | |||
548 | * @param cls the NAT handle | 549 | * @param cls the NAT handle |
549 | * @param tc scheduler context | 550 | * @param tc scheduler context |
550 | */ | 551 | */ |
551 | static void resolve_dns (void *cls, | 552 | static void |
552 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 553 | resolve_dns (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
553 | 554 | ||
554 | 555 | ||
555 | /** | 556 | /** |
@@ -585,8 +586,8 @@ process_external_ip (void *cls, const struct sockaddr *addr, socklen_t addrlen) | |||
585 | * @param cls the NAT handle | 586 | * @param cls the NAT handle |
586 | * @param tc scheduler context | 587 | * @param tc scheduler context |
587 | */ | 588 | */ |
588 | static void resolve_hostname (void *cls, | 589 | static void |
589 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 590 | resolve_hostname (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
590 | 591 | ||
591 | 592 | ||
592 | /** | 593 | /** |
diff --git a/src/nat/nat_mini.c b/src/nat/nat_mini.c index e88c9ca55..1f5a83d2d 100644 --- a/src/nat/nat_mini.c +++ b/src/nat/nat_mini.c | |||
@@ -279,8 +279,8 @@ struct GNUNET_NAT_MiniHandle | |||
279 | * @param cls the 'struct GNUNET_NAT_MiniHandle' | 279 | * @param cls the 'struct GNUNET_NAT_MiniHandle' |
280 | * @param tc scheduler context | 280 | * @param tc scheduler context |
281 | */ | 281 | */ |
282 | static void do_refresh (void *cls, | 282 | static void |
283 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 283 | do_refresh (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
284 | 284 | ||
285 | 285 | ||
286 | /** | 286 | /** |
@@ -289,7 +289,8 @@ static void do_refresh (void *cls, | |||
289 | * @param cls the 'struct GNUNET_NAT_MiniHandle' | 289 | * @param cls the 'struct GNUNET_NAT_MiniHandle' |
290 | * @param line line of output, NULL at the end | 290 | * @param line line of output, NULL at the end |
291 | */ | 291 | */ |
292 | static void process_map_output (void *cls, const char *line); | 292 | static void |
293 | process_map_output (void *cls, const char *line); | ||
293 | 294 | ||
294 | 295 | ||
295 | /** | 296 | /** |
@@ -376,8 +377,7 @@ process_refresh_output (void *cls, const char *line) | |||
376 | return; /* skip */ | 377 | return; /* skip */ |
377 | if (1 != | 378 | if (1 != |
378 | sscanf (line, | 379 | sscanf (line, |
379 | (mini-> | 380 | (mini->is_tcp) ? "%*u TCP %u->%*s:%*u %*s" : |
380 | is_tcp) ? "%*u TCP %u->%*s:%*u %*s" : | ||
381 | "%*u UDP %u->%*s:%*u %*s", &nport)) | 381 | "%*u UDP %u->%*s:%*u %*s", &nport)) |
382 | return; /* skip */ | 382 | return; /* skip */ |
383 | mini->found = GNUNET_YES; | 383 | mini->found = GNUNET_YES; |
diff --git a/src/nse/gnunet-nse-profiler.c b/src/nse/gnunet-nse-profiler.c index df26280c4..4879c5916 100644 --- a/src/nse/gnunet-nse-profiler.c +++ b/src/nse/gnunet-nse-profiler.c | |||
@@ -263,8 +263,8 @@ connect_nse_service (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
263 | } | 263 | } |
264 | 264 | ||
265 | 265 | ||
266 | static void churn_peers (void *cls, | 266 | static void |
267 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 267 | churn_peers (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
268 | 268 | ||
269 | 269 | ||
270 | /** | 270 | /** |
diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c index 5f880088f..c82180dfd 100644 --- a/src/nse/gnunet-service-nse.c +++ b/src/nse/gnunet-service-nse.c | |||
@@ -498,8 +498,8 @@ get_transmit_delay (int round_offset) | |||
498 | * @param cls the 'struct NSEPeerEntry' | 498 | * @param cls the 'struct NSEPeerEntry' |
499 | * @param tc scheduler context | 499 | * @param tc scheduler context |
500 | */ | 500 | */ |
501 | static void transmit_task (void *cls, | 501 | static void |
502 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 502 | transmit_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
503 | 503 | ||
504 | 504 | ||
505 | /** | 505 | /** |
@@ -545,8 +545,9 @@ transmit_ready (void *cls, size_t size, void *buf) | |||
545 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 545 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
546 | "In round %llu, sending to `%s' estimate with %u bits\n", | 546 | "In round %llu, sending to `%s' estimate with %u bits\n", |
547 | (unsigned long long) | 547 | (unsigned long long) |
548 | GNUNET_TIME_absolute_ntoh (size_estimate_messages[idx].timestamp). | 548 | GNUNET_TIME_absolute_ntoh (size_estimate_messages[idx]. |
549 | abs_value, GNUNET_i2s (&peer_entry->id), | 549 | timestamp).abs_value, |
550 | GNUNET_i2s (&peer_entry->id), | ||
550 | (unsigned int) ntohl (size_estimate_messages[idx].matching_bits)); | 551 | (unsigned int) ntohl (size_estimate_messages[idx].matching_bits)); |
551 | #endif | 552 | #endif |
552 | if (ntohl (size_estimate_messages[idx].hop_count) == 0) | 553 | if (ntohl (size_estimate_messages[idx].hop_count) == 0) |
@@ -861,8 +862,8 @@ verify_message_crypto (const struct GNUNET_NSE_FloodMessage *incoming_flood) | |||
861 | incoming_flood->proof_of_work)) | 862 | incoming_flood->proof_of_work)) |
862 | { | 863 | { |
863 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Proof of work invalid: %llu!\n"), | 864 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, _("Proof of work invalid: %llu!\n"), |
864 | (unsigned long long) GNUNET_ntohll (incoming_flood-> | 865 | (unsigned long long) |
865 | proof_of_work)); | 866 | GNUNET_ntohll (incoming_flood->proof_of_work)); |
866 | GNUNET_break_op (0); | 867 | GNUNET_break_op (0); |
867 | return GNUNET_NO; | 868 | return GNUNET_NO; |
868 | } | 869 | } |
@@ -959,9 +960,9 @@ handle_p2p_size_estimate (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
959 | GNUNET_snprintf (pred, sizeof (pred), "%s", GNUNET_i2s (peer)); | 960 | GNUNET_snprintf (pred, sizeof (pred), "%s", GNUNET_i2s (peer)); |
960 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 961 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
961 | "Flood at %llu from `%s' via `%s' at `%s' with bits %u\n", | 962 | "Flood at %llu from `%s' via `%s' at `%s' with bits %u\n", |
962 | (unsigned long long) GNUNET_TIME_absolute_ntoh (incoming_flood-> | 963 | (unsigned long long) |
963 | timestamp). | 964 | GNUNET_TIME_absolute_ntoh (incoming_flood->timestamp).abs_value, |
964 | abs_value, origin, pred, GNUNET_i2s (&my_identity), | 965 | origin, pred, GNUNET_i2s (&my_identity), |
965 | (unsigned int) matching_bits); | 966 | (unsigned int) matching_bits); |
966 | } | 967 | } |
967 | #endif | 968 | #endif |
diff --git a/src/nse/nse_api.c b/src/nse/nse_api.c index 8ff0256b9..0eb165fe5 100644 --- a/src/nse/nse_api.c +++ b/src/nse/nse_api.c | |||
@@ -85,8 +85,8 @@ struct GNUNET_NSE_Handle | |||
85 | * @param cls the handle to the transport service | 85 | * @param cls the handle to the transport service |
86 | * @param tc scheduler context | 86 | * @param tc scheduler context |
87 | */ | 87 | */ |
88 | static void reconnect (void *cls, | 88 | static void |
89 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 89 | reconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
90 | 90 | ||
91 | 91 | ||
92 | /** | 92 | /** |
diff --git a/src/peerinfo/peerinfo_api.c b/src/peerinfo/peerinfo_api.c index 4febf2eeb..d1af01405 100644 --- a/src/peerinfo/peerinfo_api.c +++ b/src/peerinfo/peerinfo_api.c | |||
@@ -188,7 +188,8 @@ GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h) | |||
188 | * | 188 | * |
189 | * @param h handle to the service | 189 | * @param h handle to the service |
190 | */ | 190 | */ |
191 | static void trigger_transmit (struct GNUNET_PEERINFO_Handle *h); | 191 | static void |
192 | trigger_transmit (struct GNUNET_PEERINFO_Handle *h); | ||
192 | 193 | ||
193 | 194 | ||
194 | /** | 195 | /** |
@@ -196,7 +197,8 @@ static void trigger_transmit (struct GNUNET_PEERINFO_Handle *h); | |||
196 | * | 197 | * |
197 | * @param h handle to the service | 198 | * @param h handle to the service |
198 | */ | 199 | */ |
199 | static void reconnect (struct GNUNET_PEERINFO_Handle *h); | 200 | static void |
201 | reconnect (struct GNUNET_PEERINFO_Handle *h); | ||
200 | 202 | ||
201 | /** | 203 | /** |
202 | * Task scheduled to re-try connecting to the peerinfo service. | 204 | * Task scheduled to re-try connecting to the peerinfo service. |
diff --git a/src/peerinfo/peerinfo_api_notify.c b/src/peerinfo/peerinfo_api_notify.c index 4ec7b2192..9c75b1828 100644 --- a/src/peerinfo/peerinfo_api_notify.c +++ b/src/peerinfo/peerinfo_api_notify.c | |||
@@ -76,7 +76,8 @@ struct GNUNET_PEERINFO_NotifyContext | |||
76 | * | 76 | * |
77 | * @param nc our context | 77 | * @param nc our context |
78 | */ | 78 | */ |
79 | static void request_notifications (struct GNUNET_PEERINFO_NotifyContext *nc); | 79 | static void |
80 | request_notifications (struct GNUNET_PEERINFO_NotifyContext *nc); | ||
80 | 81 | ||
81 | 82 | ||
82 | /** | 83 | /** |
@@ -85,7 +86,8 @@ static void request_notifications (struct GNUNET_PEERINFO_NotifyContext *nc); | |||
85 | * | 86 | * |
86 | * @param nc our context | 87 | * @param nc our context |
87 | */ | 88 | */ |
88 | static void receive_notifications (struct GNUNET_PEERINFO_NotifyContext *nc); | 89 | static void |
90 | receive_notifications (struct GNUNET_PEERINFO_NotifyContext *nc); | ||
89 | 91 | ||
90 | 92 | ||
91 | /** | 93 | /** |
diff --git a/src/statistics/statistics_api.c b/src/statistics/statistics_api.c index f4a71cc21..e117e971c 100644 --- a/src/statistics/statistics_api.c +++ b/src/statistics/statistics_api.c | |||
@@ -242,14 +242,16 @@ struct GNUNET_STATISTICS_Handle | |||
242 | /** | 242 | /** |
243 | * Schedule the next action to be performed. | 243 | * Schedule the next action to be performed. |
244 | */ | 244 | */ |
245 | static void schedule_action (struct GNUNET_STATISTICS_Handle *h); | 245 | static void |
246 | schedule_action (struct GNUNET_STATISTICS_Handle *h); | ||
246 | 247 | ||
247 | /** | 248 | /** |
248 | * Try to (re)connect to the statistics service. | 249 | * Try to (re)connect to the statistics service. |
249 | * | 250 | * |
250 | * @return GNUNET_YES on success, GNUNET_NO on failure. | 251 | * @return GNUNET_YES on success, GNUNET_NO on failure. |
251 | */ | 252 | */ |
252 | static int try_connect (struct GNUNET_STATISTICS_Handle *ret); | 253 | static int |
254 | try_connect (struct GNUNET_STATISTICS_Handle *ret); | ||
253 | 255 | ||
254 | 256 | ||
255 | static void | 257 | static void |
@@ -500,8 +502,8 @@ receive_stats (void *cls, const struct GNUNET_MessageHeader *msg) | |||
500 | "Processing VALUE done, now reading more\n"); | 502 | "Processing VALUE done, now reading more\n"); |
501 | #endif | 503 | #endif |
502 | GNUNET_CLIENT_receive (h->client, &receive_stats, h, | 504 | GNUNET_CLIENT_receive (h->client, &receive_stats, h, |
503 | GNUNET_TIME_absolute_get_remaining (h->current-> | 505 | GNUNET_TIME_absolute_get_remaining (h-> |
504 | timeout)); | 506 | current->timeout)); |
505 | h->backoff = GNUNET_TIME_UNIT_MILLISECONDS; | 507 | h->backoff = GNUNET_TIME_UNIT_MILLISECONDS; |
506 | return; | 508 | return; |
507 | } | 509 | } |
@@ -572,8 +574,8 @@ transmit_get (struct GNUNET_STATISTICS_Handle *handle, size_t size, void *buf) | |||
572 | #endif | 574 | #endif |
573 | handle->receiving = GNUNET_YES; | 575 | handle->receiving = GNUNET_YES; |
574 | GNUNET_CLIENT_receive (handle->client, &receive_stats, handle, | 576 | GNUNET_CLIENT_receive (handle->client, &receive_stats, handle, |
575 | GNUNET_TIME_absolute_get_remaining (handle->current-> | 577 | GNUNET_TIME_absolute_get_remaining (handle-> |
576 | timeout)); | 578 | current->timeout)); |
577 | } | 579 | } |
578 | return msize; | 580 | return msize; |
579 | } | 581 | } |
diff --git a/src/testing/test_testing_reconnect.c b/src/testing/test_testing_reconnect.c index 480bafdc6..69b871303 100644 --- a/src/testing/test_testing_reconnect.c +++ b/src/testing/test_testing_reconnect.c | |||
@@ -54,7 +54,8 @@ static int phase; | |||
54 | * Run the next phase of starting daemons, connecting them and | 54 | * Run the next phase of starting daemons, connecting them and |
55 | * stopping them again. | 55 | * stopping them again. |
56 | */ | 56 | */ |
57 | static void run_phase (); | 57 | static void |
58 | run_phase (); | ||
58 | 59 | ||
59 | static void | 60 | static void |
60 | end2_cb (void *cls, const char *emsg) | 61 | end2_cb (void *cls, const char *emsg) |
diff --git a/src/testing/testing.c b/src/testing/testing.c index c107ec593..3a712f071 100644 --- a/src/testing/testing.c +++ b/src/testing/testing.c | |||
@@ -164,8 +164,8 @@ process_hello (void *cls, const struct GNUNET_MessageHeader *message) | |||
164 | #endif | 164 | #endif |
165 | } | 165 | } |
166 | 166 | ||
167 | static void start_fsm (void *cls, | 167 | static void |
168 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 168 | start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
169 | 169 | ||
170 | #if WAIT_FOR_HELLO | 170 | #if WAIT_FOR_HELLO |
171 | /** | 171 | /** |
@@ -195,10 +195,9 @@ testing_init (void *cls, struct GNUNET_CORE_Handle *server, | |||
195 | d->server = NULL; | 195 | d->server = NULL; |
196 | if (GNUNET_YES == d->dead) | 196 | if (GNUNET_YES == d->dead) |
197 | GNUNET_TESTING_daemon_stop (d, | 197 | GNUNET_TESTING_daemon_stop (d, |
198 | GNUNET_TIME_absolute_get_remaining (d-> | 198 | GNUNET_TIME_absolute_get_remaining |
199 | max_timeout), | 199 | (d->max_timeout), d->dead_cb, d->dead_cb_cls, |
200 | d->dead_cb, d->dead_cb_cls, GNUNET_YES, | 200 | GNUNET_YES, GNUNET_NO); |
201 | GNUNET_NO); | ||
202 | else if (NULL != d->cb) | 201 | else if (NULL != d->cb) |
203 | d->cb (d->cb_cls, NULL, d->cfg, d, | 202 | d->cb (d->cb_cls, NULL, d->cfg, d, |
204 | _("Failed to connect to core service\n")); | 203 | _("Failed to connect to core service\n")); |
@@ -233,10 +232,9 @@ testing_init (void *cls, struct GNUNET_CORE_Handle *server, | |||
233 | { | 232 | { |
234 | if (GNUNET_YES == d->dead) | 233 | if (GNUNET_YES == d->dead) |
235 | GNUNET_TESTING_daemon_stop (d, | 234 | GNUNET_TESTING_daemon_stop (d, |
236 | GNUNET_TIME_absolute_get_remaining (d-> | 235 | GNUNET_TIME_absolute_get_remaining |
237 | max_timeout), | 236 | (d->max_timeout), d->dead_cb, d->dead_cb_cls, |
238 | d->dead_cb, d->dead_cb_cls, GNUNET_YES, | 237 | GNUNET_YES, GNUNET_NO); |
239 | GNUNET_NO); | ||
240 | else if (NULL != d->cb) | 238 | else if (NULL != d->cb) |
241 | d->cb (d->cb_cls, &d->id, d->cfg, d, | 239 | d->cb (d->cb_cls, &d->id, d->cfg, d, |
242 | _("Failed to connect to transport service!\n")); | 240 | _("Failed to connect to transport service!\n")); |
@@ -349,8 +347,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
349 | if (NULL != cb) | 347 | if (NULL != cb) |
350 | cb (d->cb_cls, NULL, d->cfg, d, | 348 | cb (d->cb_cls, NULL, d->cfg, d, |
351 | (NULL == | 349 | (NULL == |
352 | d-> | 350 | d->hostname) ? |
353 | hostname) ? | ||
354 | _("Failed to create pipe for `gnunet-peerinfo' process.\n") : | 351 | _("Failed to create pipe for `gnunet-peerinfo' process.\n") : |
355 | _("Failed to create pipe for `ssh' process.\n")); | 352 | _("Failed to create pipe for `ssh' process.\n")); |
356 | return; | 353 | return; |
@@ -415,9 +412,8 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
415 | if (NULL != cb) | 412 | if (NULL != cb) |
416 | cb (d->cb_cls, NULL, d->cfg, d, | 413 | cb (d->cb_cls, NULL, d->cfg, d, |
417 | (NULL == | 414 | (NULL == |
418 | d-> | 415 | d->hostname) ? _("Failed to start `gnunet-peerinfo' process.\n") |
419 | hostname) ? _("Failed to start `gnunet-peerinfo' process.\n") : | 416 | : _("Failed to start `ssh' process.\n")); |
420 | _("Failed to start `ssh' process.\n")); | ||
421 | GNUNET_DISK_pipe_close (d->pipe_stdout); | 417 | GNUNET_DISK_pipe_close (d->pipe_stdout); |
422 | return; | 418 | return; |
423 | } | 419 | } |
@@ -429,9 +425,9 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
429 | d->task = | 425 | d->task = |
430 | GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_absolute_get_remaining | 426 | GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_absolute_get_remaining |
431 | (d->max_timeout), | 427 | (d->max_timeout), |
432 | GNUNET_DISK_pipe_handle (d-> | 428 | GNUNET_DISK_pipe_handle |
433 | pipe_stdout, | 429 | (d->pipe_stdout, |
434 | GNUNET_DISK_PIPE_END_READ), | 430 | GNUNET_DISK_PIPE_END_READ), |
435 | &start_fsm, d); | 431 | &start_fsm, d); |
436 | } | 432 | } |
437 | else /* Already have a hostkey! */ | 433 | else /* Already have a hostkey! */ |
@@ -464,9 +460,9 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
464 | d->task = | 460 | d->task = |
465 | GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_absolute_get_remaining | 461 | GNUNET_SCHEDULER_add_read_file (GNUNET_TIME_absolute_get_remaining |
466 | (d->max_timeout), | 462 | (d->max_timeout), |
467 | GNUNET_DISK_pipe_handle (d-> | 463 | GNUNET_DISK_pipe_handle |
468 | pipe_stdout, | 464 | (d->pipe_stdout, |
469 | GNUNET_DISK_PIPE_END_READ), | 465 | GNUNET_DISK_PIPE_END_READ), |
470 | &start_fsm, d); | 466 | &start_fsm, d); |
471 | return; | 467 | return; |
472 | } | 468 | } |
@@ -614,8 +610,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
614 | if (NULL != cb) | 610 | if (NULL != cb) |
615 | cb (d->cb_cls, NULL, d->cfg, d, | 611 | cb (d->cb_cls, NULL, d->cfg, d, |
616 | (NULL == | 612 | (NULL == |
617 | d-> | 613 | d->hostname) ? _("Failed to start `gnunet-arm' process.\n") : |
618 | hostname) ? _("Failed to start `gnunet-arm' process.\n") : | ||
619 | _("Failed to start `ssh' process.\n")); | 614 | _("Failed to start `ssh' process.\n")); |
620 | return; | 615 | return; |
621 | } | 616 | } |
@@ -639,8 +634,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
639 | if (NULL != cb) | 634 | if (NULL != cb) |
640 | cb (d->cb_cls, NULL, d->cfg, d, | 635 | cb (d->cb_cls, NULL, d->cfg, d, |
641 | (NULL == | 636 | (NULL == |
642 | d-> | 637 | d->hostname) ? _("`gnunet-arm' does not seem to terminate.\n") : |
643 | hostname) ? _("`gnunet-arm' does not seem to terminate.\n") : | ||
644 | _("`ssh' does not seem to terminate.\n")); | 638 | _("`ssh' does not seem to terminate.\n")); |
645 | GNUNET_CONFIGURATION_destroy (d->cfg); | 639 | GNUNET_CONFIGURATION_destroy (d->cfg); |
646 | GNUNET_free (d->cfgfile); | 640 | GNUNET_free (d->cfgfile); |
@@ -698,10 +692,9 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
698 | { | 692 | { |
699 | if (GNUNET_YES == d->dead) | 693 | if (GNUNET_YES == d->dead) |
700 | GNUNET_TESTING_daemon_stop (d, | 694 | GNUNET_TESTING_daemon_stop (d, |
701 | GNUNET_TIME_absolute_get_remaining (d-> | 695 | GNUNET_TIME_absolute_get_remaining |
702 | max_timeout), | 696 | (d->max_timeout), d->dead_cb, |
703 | d->dead_cb, d->dead_cb_cls, GNUNET_YES, | 697 | d->dead_cb_cls, GNUNET_YES, GNUNET_NO); |
704 | GNUNET_NO); | ||
705 | else if (NULL != d->cb) | 698 | else if (NULL != d->cb) |
706 | d->cb (d->cb_cls, &d->id, d->cfg, d, | 699 | d->cb (d->cb_cls, &d->id, d->cfg, d, |
707 | _("Failed to connect to transport service!\n")); | 700 | _("Failed to connect to transport service!\n")); |
@@ -763,8 +756,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
763 | if (NULL != cb) | 756 | if (NULL != cb) |
764 | cb (d->cb_cls, NULL, d->cfg, d, | 757 | cb (d->cb_cls, NULL, d->cfg, d, |
765 | (NULL == | 758 | (NULL == |
766 | d-> | 759 | d->hostname) ? _("`gnunet-arm' does not seem to terminate.\n") : |
767 | hostname) ? _("`gnunet-arm' does not seem to terminate.\n") : | ||
768 | _("`ssh' does not seem to terminate.\n")); | 760 | _("`ssh' does not seem to terminate.\n")); |
769 | return; | 761 | return; |
770 | } | 762 | } |
@@ -782,8 +774,7 @@ start_fsm (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
782 | if (NULL != cb) | 774 | if (NULL != cb) |
783 | cb (d->cb_cls, NULL, d->cfg, d, | 775 | cb (d->cb_cls, NULL, d->cfg, d, |
784 | (NULL == | 776 | (NULL == |
785 | d-> | 777 | d->hostname) ? |
786 | hostname) ? | ||
787 | _ | 778 | _ |
788 | ("`gnunet-arm' terminated with non-zero exit status (or timed out)!\n") | 779 | ("`gnunet-arm' terminated with non-zero exit status (or timed out)!\n") |
789 | : _("`ssh' does not seem to terminate.\n")); | 780 | : _("`ssh' does not seem to terminate.\n")); |
@@ -1946,9 +1937,9 @@ struct ConnectContext | |||
1946 | 1937 | ||
1947 | 1938 | ||
1948 | /** Forward declaration **/ | 1939 | /** Forward declaration **/ |
1949 | static void reattempt_daemons_connect (void *cls, | 1940 | static void |
1950 | const struct GNUNET_SCHEDULER_TaskContext | 1941 | reattempt_daemons_connect (void *cls, |
1951 | *tc); | 1942 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
1952 | 1943 | ||
1953 | 1944 | ||
1954 | /** | 1945 | /** |
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c index d03cb307b..88c51abe0 100644 --- a/src/testing/testing_group.c +++ b/src/testing/testing_group.c | |||
@@ -1630,19 +1630,23 @@ remove_connections (struct GNUNET_TESTING_PeerGroup *pg, unsigned int first, | |||
1630 | } | 1630 | } |
1631 | #else | 1631 | #else |
1632 | if (GNUNET_YES == | 1632 | if (GNUNET_YES == |
1633 | GNUNET_CONTAINER_multihashmap_contains (pg->peers[first]. | 1633 | GNUNET_CONTAINER_multihashmap_contains (pg-> |
1634 | blacklisted_peers, &hash_second)) | 1634 | peers[first].blacklisted_peers, |
1635 | &hash_second)) | ||
1635 | { | 1636 | { |
1636 | GNUNET_CONTAINER_multihashmap_remove_all (pg->peers[first]. | 1637 | GNUNET_CONTAINER_multihashmap_remove_all (pg-> |
1637 | blacklisted_peers, &hash_second); | 1638 | peers[first].blacklisted_peers, |
1639 | &hash_second); | ||
1638 | } | 1640 | } |
1639 | 1641 | ||
1640 | if (GNUNET_YES == | 1642 | if (GNUNET_YES == |
1641 | GNUNET_CONTAINER_multihashmap_contains (pg->peers[second]. | 1643 | GNUNET_CONTAINER_multihashmap_contains (pg-> |
1642 | blacklisted_peers, &hash_first)) | 1644 | peers[second].blacklisted_peers, |
1645 | &hash_first)) | ||
1643 | { | 1646 | { |
1644 | GNUNET_CONTAINER_multihashmap_remove_all (pg->peers[second]. | 1647 | GNUNET_CONTAINER_multihashmap_remove_all (pg-> |
1645 | blacklisted_peers, &hash_first); | 1648 | peers[second].blacklisted_peers, |
1649 | &hash_first); | ||
1646 | } | 1650 | } |
1647 | #endif | 1651 | #endif |
1648 | 1652 | ||
@@ -2864,8 +2868,8 @@ create_and_copy_friend_files (struct GNUNET_TESTING_PeerGroup *pg) | |||
2864 | conn_iter = pg->peers[pg_iter].allowed_peers_head; | 2868 | conn_iter = pg->peers[pg_iter].allowed_peers_head; |
2865 | while (conn_iter != NULL) | 2869 | while (conn_iter != NULL) |
2866 | { | 2870 | { |
2867 | GNUNET_CRYPTO_hash_to_enc (&pg->peers[conn_iter->index].daemon->id. | 2871 | GNUNET_CRYPTO_hash_to_enc (&pg->peers[conn_iter->index].daemon-> |
2868 | hashPubKey, &peer_enc); | 2872 | id.hashPubKey, &peer_enc); |
2869 | fprintf (temp_friend_handle, "%s\n", (char *) &peer_enc); | 2873 | fprintf (temp_friend_handle, "%s\n", (char *) &peer_enc); |
2870 | conn_iter = conn_iter->next; | 2874 | conn_iter = conn_iter->next; |
2871 | } | 2875 | } |
@@ -3051,15 +3055,16 @@ create_and_copy_blacklist_files (struct GNUNET_TESTING_PeerGroup *pg, | |||
3051 | conn_iter = pg->peers[pg_iter].blacklisted_peers_head; | 3055 | conn_iter = pg->peers[pg_iter].blacklisted_peers_head; |
3052 | while (conn_iter != NULL) | 3056 | while (conn_iter != NULL) |
3053 | { | 3057 | { |
3054 | GNUNET_CRYPTO_hash_to_enc (&pg->peers[conn_iter->index].daemon->id. | 3058 | GNUNET_CRYPTO_hash_to_enc (&pg->peers[conn_iter->index].daemon-> |
3055 | hashPubKey, &peer_enc); | 3059 | id.hashPubKey, &peer_enc); |
3056 | fprintf (temp_file_handle, "%s:%s\n", pos, (char *) &peer_enc); | 3060 | fprintf (temp_file_handle, "%s:%s\n", pos, (char *) &peer_enc); |
3057 | conn_iter = conn_iter->next; | 3061 | conn_iter = conn_iter->next; |
3058 | } | 3062 | } |
3059 | #else | 3063 | #else |
3060 | blacklist_ctx.transport = pos; | 3064 | blacklist_ctx.transport = pos; |
3061 | (void) GNUNET_CONTAINER_multihashmap_iterate (pg->peers[pg_iter]. | 3065 | (void) GNUNET_CONTAINER_multihashmap_iterate (pg-> |
3062 | blacklisted_peers, | 3066 | peers |
3067 | [pg_iter].blacklisted_peers, | ||
3063 | &blacklist_file_iterator, | 3068 | &blacklist_file_iterator, |
3064 | &blacklist_ctx); | 3069 | &blacklist_ctx); |
3065 | #endif | 3070 | #endif |
@@ -3176,8 +3181,8 @@ create_and_copy_blacklist_files (struct GNUNET_TESTING_PeerGroup *pg, | |||
3176 | } | 3181 | } |
3177 | 3182 | ||
3178 | /* Forward Declaration */ | 3183 | /* Forward Declaration */ |
3179 | static void schedule_connect (void *cls, | 3184 | static void |
3180 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 3185 | schedule_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
3181 | 3186 | ||
3182 | /** | 3187 | /** |
3183 | * Choose a random peer's next connection to create, and | 3188 | * Choose a random peer's next connection to create, and |
@@ -3216,9 +3221,8 @@ preschedule_connect (struct GNUNET_TESTING_PeerGroup *pg) | |||
3216 | 3221 | ||
3217 | #if USE_SEND_HELLOS | 3222 | #if USE_SEND_HELLOS |
3218 | /* Forward declaration */ | 3223 | /* Forward declaration */ |
3219 | static void schedule_send_hellos (void *cls, | 3224 | static void |
3220 | const struct GNUNET_SCHEDULER_TaskContext | 3225 | schedule_send_hellos (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
3221 | *tc); | ||
3222 | 3226 | ||
3223 | /** | 3227 | /** |
3224 | * Close connections and free the hello context. | 3228 | * Close connections and free the hello context. |
@@ -3319,19 +3323,19 @@ send_core_connect_requests (void *cls, | |||
3319 | conn = send_hello_context->peer->connect_peers_head; | 3323 | conn = send_hello_context->peer->connect_peers_head; |
3320 | while (conn != NULL) | 3324 | while (conn != NULL) |
3321 | { | 3325 | { |
3322 | GNUNET_CORE_peer_request_connect (send_hello_context->peer->daemon-> | 3326 | GNUNET_CORE_peer_request_connect (send_hello_context->peer-> |
3323 | server, | 3327 | daemon->server, |
3324 | &send_hello_context->pg->peers[conn-> | 3328 | &send_hello_context->pg-> |
3325 | index]. | 3329 | peers[conn->index].daemon->id, NULL, |
3326 | daemon->id, NULL, NULL); | 3330 | NULL); |
3327 | conn = conn->next; | 3331 | conn = conn->next; |
3328 | } | 3332 | } |
3329 | send_hello_context->core_connect_task = | 3333 | send_hello_context->core_connect_task = |
3330 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_divide | 3334 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_divide |
3331 | (send_hello_context->pg->ct_ctx. | 3335 | (send_hello_context->pg-> |
3332 | connect_timeout, | 3336 | ct_ctx.connect_timeout, |
3333 | send_hello_context->pg->ct_ctx. | 3337 | send_hello_context->pg-> |
3334 | connect_attempts), | 3338 | ct_ctx.connect_attempts), |
3335 | &send_core_connect_requests, | 3339 | &send_core_connect_requests, |
3336 | send_hello_context); | 3340 | send_hello_context); |
3337 | } | 3341 | } |
@@ -3522,10 +3526,10 @@ hello_sent_callback (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
3522 | 3526 | ||
3523 | send_hello_context->core_connect_task = | 3527 | send_hello_context->core_connect_task = |
3524 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_divide | 3528 | GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_divide |
3525 | (send_hello_context->pg->ct_ctx. | 3529 | (send_hello_context->pg-> |
3526 | connect_timeout, | 3530 | ct_ctx.connect_timeout, |
3527 | send_hello_context->pg->ct_ctx. | 3531 | send_hello_context->pg-> |
3528 | connect_attempts), | 3532 | ct_ctx.connect_attempts), |
3529 | &send_core_connect_requests, | 3533 | &send_core_connect_requests, |
3530 | send_hello_context); | 3534 | send_hello_context); |
3531 | } | 3535 | } |
@@ -3584,14 +3588,14 @@ schedule_send_hellos (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
3584 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 3588 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
3585 | _("Offering Hello of peer %s to peer %s\n"), | 3589 | _("Offering Hello of peer %s to peer %s\n"), |
3586 | send_hello_context->peer->daemon->shortname, | 3590 | send_hello_context->peer->daemon->shortname, |
3587 | pg->peers[send_hello_context->peer_pos->index].daemon-> | 3591 | pg->peers[send_hello_context->peer_pos->index]. |
3588 | shortname); | 3592 | daemon->shortname); |
3589 | #endif | 3593 | #endif |
3590 | GNUNET_TRANSPORT_offer_hello (send_hello_context->peer->daemon->th, | 3594 | GNUNET_TRANSPORT_offer_hello (send_hello_context->peer->daemon->th, |
3591 | (const struct GNUNET_MessageHeader *) pg-> | 3595 | (const struct GNUNET_MessageHeader *) |
3592 | peers[send_hello_context->peer_pos->index]. | 3596 | pg->peers[send_hello_context->peer_pos-> |
3593 | daemon->hello, &hello_sent_callback, | 3597 | index].daemon->hello, |
3594 | send_hello_context); | 3598 | &hello_sent_callback, send_hello_context); |
3595 | send_hello_context->peer_pos = send_hello_context->peer_pos->next; | 3599 | send_hello_context->peer_pos = send_hello_context->peer_pos->next; |
3596 | GNUNET_assert (send_hello_context->peer->daemon->th != NULL); | 3600 | GNUNET_assert (send_hello_context->peer->daemon->th != NULL); |
3597 | } | 3601 | } |
@@ -3647,10 +3651,12 @@ internal_connect_notify (void *cls, const struct GNUNET_PeerIdentity *first, | |||
3647 | second_cfg, first_cfg, second_daemon, first_daemon, | 3651 | second_cfg, first_cfg, second_daemon, first_daemon, |
3648 | emsg); | 3652 | emsg); |
3649 | 3653 | ||
3650 | GNUNET_CONTAINER_DLL_remove (pg->peers[connect_ctx->second_index]. | 3654 | GNUNET_CONTAINER_DLL_remove (pg-> |
3651 | connect_peers_head, | 3655 | peers[connect_ctx-> |
3652 | pg->peers[connect_ctx->second_index]. | 3656 | second_index].connect_peers_head, |
3653 | connect_peers_tail, connection); | 3657 | pg->peers[connect_ctx-> |
3658 | second_index].connect_peers_tail, | ||
3659 | connection); | ||
3654 | GNUNET_free (connection); | 3660 | GNUNET_free (connection); |
3655 | } | 3661 | } |
3656 | 3662 | ||
@@ -3711,10 +3717,10 @@ schedule_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
3711 | #endif | 3717 | #endif |
3712 | pg->outstanding_connects++; | 3718 | pg->outstanding_connects++; |
3713 | pg->total_connects_scheduled++; | 3719 | pg->total_connects_scheduled++; |
3714 | GNUNET_TESTING_daemons_connect (pg->peers[connect_context->first_index]. | 3720 | GNUNET_TESTING_daemons_connect (pg-> |
3715 | daemon, | 3721 | peers[connect_context->first_index].daemon, |
3716 | pg->peers[connect_context->second_index]. | 3722 | pg->peers[connect_context-> |
3717 | daemon, | 3723 | second_index].daemon, |
3718 | connect_context->ct_ctx->connect_timeout, | 3724 | connect_context->ct_ctx->connect_timeout, |
3719 | connect_context->ct_ctx->connect_attempts, | 3725 | connect_context->ct_ctx->connect_attempts, |
3720 | #if USE_SEND_HELLOS | 3726 | #if USE_SEND_HELLOS |
@@ -4224,8 +4230,8 @@ random_connect_iterator (void *cls, const GNUNET_HashCode * key, void *value) | |||
4224 | if (random_number < random_ctx->percentage) | 4230 | if (random_number < random_ctx->percentage) |
4225 | { | 4231 | { |
4226 | GNUNET_assert (GNUNET_OK == | 4232 | GNUNET_assert (GNUNET_OK == |
4227 | GNUNET_CONTAINER_multihashmap_put (random_ctx->first-> | 4233 | GNUNET_CONTAINER_multihashmap_put (random_ctx-> |
4228 | connect_peers_working_set, | 4234 | first->connect_peers_working_set, |
4229 | key, value, | 4235 | key, value, |
4230 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); | 4236 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); |
4231 | } | 4237 | } |
@@ -4235,12 +4241,12 @@ random_connect_iterator (void *cls, const GNUNET_HashCode * key, void *value) | |||
4235 | hash_from_uid (random_ctx->first_uid, &first_hash); | 4241 | hash_from_uid (random_ctx->first_uid, &first_hash); |
4236 | GNUNET_assert (random_ctx->pg->total > second_pos); | 4242 | GNUNET_assert (random_ctx->pg->total > second_pos); |
4237 | GNUNET_assert (GNUNET_YES == | 4243 | GNUNET_assert (GNUNET_YES == |
4238 | GNUNET_CONTAINER_multihashmap_remove (random_ctx->pg-> | 4244 | GNUNET_CONTAINER_multihashmap_remove (random_ctx-> |
4239 | peers[second_pos]. | 4245 | pg->peers |
4240 | connect_peers, | 4246 | [second_pos].connect_peers, |
4241 | &first_hash, | 4247 | &first_hash, |
4242 | random_ctx->first-> | 4248 | random_ctx-> |
4243 | daemon)); | 4249 | first->daemon)); |
4244 | 4250 | ||
4245 | return GNUNET_YES; | 4251 | return GNUNET_YES; |
4246 | } | 4252 | } |
@@ -4270,29 +4276,29 @@ minimum_connect_iterator (void *cls, const GNUNET_HashCode * key, void *value) | |||
4270 | if (min_ctx->pg_array[i] == min_ctx->current) | 4276 | if (min_ctx->pg_array[i] == min_ctx->current) |
4271 | { | 4277 | { |
4272 | GNUNET_assert (GNUNET_OK == | 4278 | GNUNET_assert (GNUNET_OK == |
4273 | GNUNET_CONTAINER_multihashmap_put (min_ctx->first-> | 4279 | GNUNET_CONTAINER_multihashmap_put (min_ctx-> |
4274 | connect_peers_working_set, | 4280 | first->connect_peers_working_set, |
4275 | key, value, | 4281 | key, value, |
4276 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); | 4282 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); |
4277 | uid_from_hash (key, &second_pos); | 4283 | uid_from_hash (key, &second_pos); |
4278 | hash_from_uid (min_ctx->first_uid, &first_hash); | 4284 | hash_from_uid (min_ctx->first_uid, &first_hash); |
4279 | GNUNET_assert (min_ctx->pg->total > second_pos); | 4285 | GNUNET_assert (min_ctx->pg->total > second_pos); |
4280 | GNUNET_assert (GNUNET_OK == | 4286 | GNUNET_assert (GNUNET_OK == |
4281 | GNUNET_CONTAINER_multihashmap_put (min_ctx->pg-> | 4287 | GNUNET_CONTAINER_multihashmap_put (min_ctx-> |
4282 | peers[second_pos]. | 4288 | pg->peers |
4283 | connect_peers_working_set, | 4289 | [second_pos].connect_peers_working_set, |
4284 | &first_hash, | 4290 | &first_hash, |
4285 | min_ctx-> | 4291 | min_ctx->first-> |
4286 | first->daemon, | 4292 | daemon, |
4287 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); | 4293 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); |
4288 | /* Now we have added this particular connection, remove it from the second peer's map so it's not double counted */ | 4294 | /* Now we have added this particular connection, remove it from the second peer's map so it's not double counted */ |
4289 | GNUNET_assert (GNUNET_YES == | 4295 | GNUNET_assert (GNUNET_YES == |
4290 | GNUNET_CONTAINER_multihashmap_remove (min_ctx->pg-> | 4296 | GNUNET_CONTAINER_multihashmap_remove (min_ctx-> |
4291 | peers[second_pos]. | 4297 | pg->peers |
4292 | connect_peers, | 4298 | [second_pos].connect_peers, |
4293 | &first_hash, | 4299 | &first_hash, |
4294 | min_ctx->first-> | 4300 | min_ctx-> |
4295 | daemon)); | 4301 | first->daemon)); |
4296 | } | 4302 | } |
4297 | } | 4303 | } |
4298 | min_ctx->current++; | 4304 | min_ctx->current++; |
@@ -4321,28 +4327,26 @@ dfs_connect_iterator (void *cls, const GNUNET_HashCode * key, void *value) | |||
4321 | if (dfs_ctx->current == dfs_ctx->chosen) | 4327 | if (dfs_ctx->current == dfs_ctx->chosen) |
4322 | { | 4328 | { |
4323 | GNUNET_assert (GNUNET_OK == | 4329 | GNUNET_assert (GNUNET_OK == |
4324 | GNUNET_CONTAINER_multihashmap_put (dfs_ctx->first-> | 4330 | GNUNET_CONTAINER_multihashmap_put (dfs_ctx-> |
4325 | connect_peers_working_set, | 4331 | first->connect_peers_working_set, |
4326 | key, value, | 4332 | key, value, |
4327 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); | 4333 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); |
4328 | uid_from_hash (key, &dfs_ctx->second_uid); | 4334 | uid_from_hash (key, &dfs_ctx->second_uid); |
4329 | hash_from_uid (dfs_ctx->first_uid, &first_hash); | 4335 | hash_from_uid (dfs_ctx->first_uid, &first_hash); |
4330 | GNUNET_assert (GNUNET_OK == | 4336 | GNUNET_assert (GNUNET_OK == |
4331 | GNUNET_CONTAINER_multihashmap_put (dfs_ctx->pg-> | 4337 | GNUNET_CONTAINER_multihashmap_put (dfs_ctx-> |
4332 | peers | 4338 | pg->peers[dfs_ctx-> |
4333 | [dfs_ctx->second_uid]. | 4339 | second_uid].connect_peers_working_set, |
4334 | connect_peers_working_set, | ||
4335 | &first_hash, | 4340 | &first_hash, |
4336 | dfs_ctx->first->daemon, | 4341 | dfs_ctx->first->daemon, |
4337 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); | 4342 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_ONLY)); |
4338 | GNUNET_assert (GNUNET_YES == | 4343 | GNUNET_assert (GNUNET_YES == |
4339 | GNUNET_CONTAINER_multihashmap_remove (dfs_ctx->pg-> | 4344 | GNUNET_CONTAINER_multihashmap_remove (dfs_ctx-> |
4340 | peers[dfs_ctx-> | 4345 | pg->peers |
4341 | second_uid]. | 4346 | [dfs_ctx->second_uid].connect_peers, |
4342 | connect_peers, | ||
4343 | &first_hash, | 4347 | &first_hash, |
4344 | dfs_ctx->first-> | 4348 | dfs_ctx-> |
4345 | daemon)); | 4349 | first->daemon)); |
4346 | /* Can't remove second from first yet because we are currently iterating, hence the return value in the DFSContext! */ | 4350 | /* Can't remove second from first yet because we are currently iterating, hence the return value in the DFSContext! */ |
4347 | return GNUNET_NO; /* We have found our peer, don't iterate more */ | 4351 | return GNUNET_NO; /* We have found our peer, don't iterate more */ |
4348 | } | 4352 | } |
@@ -4469,8 +4473,9 @@ count_workingset_connections (struct GNUNET_TESTING_PeerGroup *pg) | |||
4469 | } | 4473 | } |
4470 | #else | 4474 | #else |
4471 | count += | 4475 | count += |
4472 | GNUNET_CONTAINER_multihashmap_size (pg->peers[pg_iter]. | 4476 | GNUNET_CONTAINER_multihashmap_size (pg-> |
4473 | connect_peers_working_set); | 4477 | peers |
4478 | [pg_iter].connect_peers_working_set); | ||
4474 | #endif | 4479 | #endif |
4475 | } | 4480 | } |
4476 | 4481 | ||
@@ -4561,10 +4566,8 @@ choose_minimum (struct GNUNET_TESTING_PeerGroup *pg, unsigned int num) | |||
4561 | minimum_ctx.first_uid = pg_iter; | 4566 | minimum_ctx.first_uid = pg_iter; |
4562 | minimum_ctx.pg_array = | 4567 | minimum_ctx.pg_array = |
4563 | GNUNET_CRYPTO_random_permute (GNUNET_CRYPTO_QUALITY_WEAK, | 4568 | GNUNET_CRYPTO_random_permute (GNUNET_CRYPTO_QUALITY_WEAK, |
4564 | GNUNET_CONTAINER_multihashmap_size (pg-> | 4569 | GNUNET_CONTAINER_multihashmap_size |
4565 | peers | 4570 | (pg->peers[pg_iter].connect_peers)); |
4566 | [pg_iter]. | ||
4567 | connect_peers)); | ||
4568 | minimum_ctx.first = &pg->peers[pg_iter]; | 4571 | minimum_ctx.first = &pg->peers[pg_iter]; |
4569 | minimum_ctx.pg = pg; | 4572 | minimum_ctx.pg = pg; |
4570 | minimum_ctx.num_to_add = num; | 4573 | minimum_ctx.num_to_add = num; |
@@ -4654,13 +4657,13 @@ find_closest_peers (void *cls, const GNUNET_HashCode * key, void *value) | |||
4654 | &closest_ctx->curr_peer->daemon->id.hashPubKey) > | 4657 | &closest_ctx->curr_peer->daemon->id.hashPubKey) > |
4655 | closest_ctx->closest_dist)) && | 4658 | closest_ctx->closest_dist)) && |
4656 | (GNUNET_YES != | 4659 | (GNUNET_YES != |
4657 | GNUNET_CONTAINER_multihashmap_contains (closest_ctx->curr_peer-> | 4660 | GNUNET_CONTAINER_multihashmap_contains (closest_ctx-> |
4658 | connect_peers, key))) | 4661 | curr_peer->connect_peers, key))) |
4659 | { | 4662 | { |
4660 | closest_ctx->closest_dist = | 4663 | closest_ctx->closest_dist = |
4661 | GNUNET_CRYPTO_hash_matching_bits (&daemon->id.hashPubKey, | 4664 | GNUNET_CRYPTO_hash_matching_bits (&daemon->id.hashPubKey, |
4662 | &closest_ctx->curr_peer->daemon->id. | 4665 | &closest_ctx->curr_peer->daemon-> |
4663 | hashPubKey); | 4666 | id.hashPubKey); |
4664 | closest_ctx->closest = daemon; | 4667 | closest_ctx->closest = daemon; |
4665 | uid_from_hash (key, &closest_ctx->closest_num); | 4668 | uid_from_hash (key, &closest_ctx->closest_num); |
4666 | } | 4669 | } |
@@ -4747,8 +4750,8 @@ perform_dfs (struct GNUNET_TESTING_PeerGroup *pg, unsigned int num) | |||
4747 | for (pg_iter = 0; pg_iter < pg->total; pg_iter++) | 4750 | for (pg_iter = 0; pg_iter < pg->total; pg_iter++) |
4748 | { | 4751 | { |
4749 | temp_count = | 4752 | temp_count = |
4750 | count_connections (pg->peers[pg_iter]. | 4753 | count_connections (pg-> |
4751 | connect_peers_working_set_head); | 4754 | peers[pg_iter].connect_peers_working_set_head); |
4752 | if (temp_count < least_connections) | 4755 | if (temp_count < least_connections) |
4753 | { | 4756 | { |
4754 | starting_peer = pg_iter; | 4757 | starting_peer = pg_iter; |
@@ -4802,8 +4805,9 @@ perform_dfs (struct GNUNET_TESTING_PeerGroup *pg, unsigned int num) | |||
4802 | { | 4805 | { |
4803 | starting_peer = pg_iter; | 4806 | starting_peer = pg_iter; |
4804 | least_connections = | 4807 | least_connections = |
4805 | GNUNET_CONTAINER_multihashmap_size (pg->peers[pg_iter]. | 4808 | GNUNET_CONTAINER_multihashmap_size (pg-> |
4806 | connect_peers_working_set); | 4809 | peers |
4810 | [pg_iter].connect_peers_working_set); | ||
4807 | } | 4811 | } |
4808 | } | 4812 | } |
4809 | } | 4813 | } |
@@ -4817,28 +4821,25 @@ perform_dfs (struct GNUNET_TESTING_PeerGroup *pg, unsigned int num) | |||
4817 | /* Choose a random peer from the chosen peers set of connections to add */ | 4821 | /* Choose a random peer from the chosen peers set of connections to add */ |
4818 | dfs_ctx.chosen = | 4822 | dfs_ctx.chosen = |
4819 | GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, | 4823 | GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, |
4820 | GNUNET_CONTAINER_multihashmap_size (pg-> | 4824 | GNUNET_CONTAINER_multihashmap_size (pg->peers |
4821 | peers | 4825 | [starting_peer].connect_peers)); |
4822 | [starting_peer]. | ||
4823 | connect_peers)); | ||
4824 | dfs_ctx.first_uid = starting_peer; | 4826 | dfs_ctx.first_uid = starting_peer; |
4825 | dfs_ctx.first = &pg->peers[starting_peer]; | 4827 | dfs_ctx.first = &pg->peers[starting_peer]; |
4826 | dfs_ctx.pg = pg; | 4828 | dfs_ctx.pg = pg; |
4827 | dfs_ctx.current = 0; | 4829 | dfs_ctx.current = 0; |
4828 | 4830 | ||
4829 | GNUNET_CONTAINER_multihashmap_iterate (pg->peers[starting_peer]. | 4831 | GNUNET_CONTAINER_multihashmap_iterate (pg-> |
4830 | connect_peers, &dfs_connect_iterator, | 4832 | peers[starting_peer].connect_peers, |
4831 | &dfs_ctx); | 4833 | &dfs_connect_iterator, &dfs_ctx); |
4832 | /* Remove the second from the first, since we will be continuing the search and may encounter the first peer again! */ | 4834 | /* Remove the second from the first, since we will be continuing the search and may encounter the first peer again! */ |
4833 | hash_from_uid (dfs_ctx.second_uid, &second_hash); | 4835 | hash_from_uid (dfs_ctx.second_uid, &second_hash); |
4834 | GNUNET_assert (GNUNET_YES == | 4836 | GNUNET_assert (GNUNET_YES == |
4835 | GNUNET_CONTAINER_multihashmap_remove (pg-> | 4837 | GNUNET_CONTAINER_multihashmap_remove (pg->peers |
4836 | peers[starting_peer]. | 4838 | [starting_peer].connect_peers, |
4837 | connect_peers, | ||
4838 | &second_hash, | 4839 | &second_hash, |
4839 | pg->peers[dfs_ctx. | 4840 | pg-> |
4840 | second_uid]. | 4841 | peers |
4841 | daemon)); | 4842 | [dfs_ctx.second_uid].daemon)); |
4842 | starting_peer = dfs_ctx.second_uid; | 4843 | starting_peer = dfs_ctx.second_uid; |
4843 | } | 4844 | } |
4844 | 4845 | ||
@@ -5620,8 +5621,8 @@ schedule_churn_restart (void *cls, | |||
5620 | { | 5621 | { |
5621 | if (startup_ctx->churn_ctx->service != NULL) | 5622 | if (startup_ctx->churn_ctx->service != NULL) |
5622 | GNUNET_TESTING_daemon_start_stopped_service (peer_restart_ctx->daemon, | 5623 | GNUNET_TESTING_daemon_start_stopped_service (peer_restart_ctx->daemon, |
5623 | startup_ctx->churn_ctx-> | 5624 | startup_ctx-> |
5624 | service, | 5625 | churn_ctx->service, |
5625 | startup_ctx->timeout, | 5626 | startup_ctx->timeout, |
5626 | &churn_start_callback, | 5627 | &churn_start_callback, |
5627 | startup_ctx); | 5628 | startup_ctx); |
@@ -5880,9 +5881,8 @@ call_hostkey_callbacks (void *cls, | |||
5880 | for (i = 0; i < pg->total; i++) | 5881 | for (i = 0; i < pg->total; i++) |
5881 | { | 5882 | { |
5882 | if (pg->peers[i].internal_context.hostkey_callback != NULL) | 5883 | if (pg->peers[i].internal_context.hostkey_callback != NULL) |
5883 | pg->peers[i].internal_context.hostkey_callback (pg-> | 5884 | pg->peers[i].internal_context.hostkey_callback (pg->peers[i]. |
5884 | peers[i].internal_context. | 5885 | internal_context.hostkey_cls, |
5885 | hostkey_cls, | ||
5886 | &pg->peers[i].daemon->id, | 5886 | &pg->peers[i].daemon->id, |
5887 | pg->peers[i].daemon, | 5887 | pg->peers[i].daemon, |
5888 | NULL); | 5888 | NULL); |
diff --git a/src/testing/testing_peergroup.c b/src/testing/testing_peergroup.c index a76c7cc26..ba25a62bd 100644 --- a/src/testing/testing_peergroup.c +++ b/src/testing/testing_peergroup.c | |||
@@ -346,12 +346,12 @@ internal_topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, | |||
346 | /* Get duration in seconds */ | 346 | /* Get duration in seconds */ |
347 | duration = | 347 | duration = |
348 | GNUNET_TIME_absolute_get_difference (connect_last_time, | 348 | GNUNET_TIME_absolute_get_difference (connect_last_time, |
349 | GNUNET_TIME_absolute_get ()). | 349 | GNUNET_TIME_absolute_get |
350 | rel_value / 1000; | 350 | ()).rel_value / 1000; |
351 | total_duration = | 351 | total_duration = |
352 | GNUNET_TIME_absolute_get_difference (connect_start_time, | 352 | GNUNET_TIME_absolute_get_difference (connect_start_time, |
353 | GNUNET_TIME_absolute_get ()). | 353 | GNUNET_TIME_absolute_get |
354 | rel_value / 1000; | 354 | ()).rel_value / 1000; |
355 | 355 | ||
356 | failed_conns_per_sec_recent = (double) new_failed_connections / duration; | 356 | failed_conns_per_sec_recent = (double) new_failed_connections / duration; |
357 | failed_conns_per_sec_total = (double) failed_connections / total_duration; | 357 | failed_conns_per_sec_total = (double) failed_connections / total_duration; |
@@ -422,8 +422,8 @@ internal_topology_callback (void *cls, const struct GNUNET_PeerIdentity *first, | |||
422 | #if TIMING | 422 | #if TIMING |
423 | total_duration = | 423 | total_duration = |
424 | GNUNET_TIME_absolute_get_difference (connect_start_time, | 424 | GNUNET_TIME_absolute_get_difference (connect_start_time, |
425 | GNUNET_TIME_absolute_get ()). | 425 | GNUNET_TIME_absolute_get |
426 | rel_value / 1000; | 426 | ()).rel_value / 1000; |
427 | failed_conns_per_sec_total = (double) failed_connections / total_duration; | 427 | failed_conns_per_sec_total = (double) failed_connections / total_duration; |
428 | conns_per_sec_total = (double) total_connections / total_duration; | 428 | conns_per_sec_total = (double) total_connections / total_duration; |
429 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 429 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
@@ -493,10 +493,8 @@ internal_peers_started_callback (void *cls, | |||
493 | pg_start_ctx->expected_connections = | 493 | pg_start_ctx->expected_connections = |
494 | GNUNET_TESTING_connect_topology (pg_start_ctx->pg, | 494 | GNUNET_TESTING_connect_topology (pg_start_ctx->pg, |
495 | pg_start_ctx->connect_topology, | 495 | pg_start_ctx->connect_topology, |
496 | pg_start_ctx-> | 496 | pg_start_ctx->connect_topology_option, |
497 | connect_topology_option, | 497 | pg_start_ctx->connect_topology_option_modifier, |
498 | pg_start_ctx-> | ||
499 | connect_topology_option_modifier, | ||
500 | DEFAULT_CONNECT_TIMEOUT, | 498 | DEFAULT_CONNECT_TIMEOUT, |
501 | pg_start_ctx->connect_attempts, NULL, | 499 | pg_start_ctx->connect_attempts, NULL, |
502 | NULL); | 500 | NULL); |
@@ -736,8 +734,7 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
736 | if (GNUNET_OK != | 734 | if (GNUNET_OK != |
737 | GNUNET_CONFIGURATION_get_value_number (cfg, "testing", | 735 | GNUNET_CONFIGURATION_get_value_number (cfg, "testing", |
738 | "max_outstanding_connections", | 736 | "max_outstanding_connections", |
739 | &pg_start_ctx-> | 737 | &pg_start_ctx->max_concurrent_connections)) |
740 | max_concurrent_connections)) | ||
741 | { | 738 | { |
742 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", | 739 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Must provide option %s:%s!\n", |
743 | "testing", "max_outstanding_connections"); | 740 | "testing", "max_outstanding_connections"); |
@@ -857,8 +854,8 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
857 | "connect_topology_option", | 854 | "connect_topology_option", |
858 | &temp_str)) && | 855 | &temp_str)) && |
859 | (GNUNET_NO == | 856 | (GNUNET_NO == |
860 | GNUNET_TESTING_topology_option_get (&pg_start_ctx-> | 857 | GNUNET_TESTING_topology_option_get |
861 | connect_topology_option, temp_str))) | 858 | (&pg_start_ctx->connect_topology_option, temp_str))) |
862 | { | 859 | { |
863 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 860 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
864 | "Invalid connect topology option `%s' given for section %s option %s\n", | 861 | "Invalid connect topology option `%s' given for section %s option %s\n", |
@@ -889,8 +886,7 @@ GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
889 | if (GNUNET_YES != | 886 | if (GNUNET_YES != |
890 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", | 887 | GNUNET_CONFIGURATION_get_value_string (cfg, "testing", |
891 | "blacklist_transports", | 888 | "blacklist_transports", |
892 | &pg_start_ctx-> | 889 | &pg_start_ctx->restrict_transports)) |
893 | restrict_transports)) | ||
894 | pg_start_ctx->restrict_transports = NULL; | 890 | pg_start_ctx->restrict_transports = NULL; |
895 | 891 | ||
896 | pg_start_ctx->restrict_topology = GNUNET_TESTING_TOPOLOGY_NONE; | 892 | pg_start_ctx->restrict_topology = GNUNET_TESTING_TOPOLOGY_NONE; |
diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c index 8f86619fd..4db7ce6d2 100644 --- a/src/topology/gnunet-daemon-topology.c +++ b/src/topology/gnunet-daemon-topology.c | |||
@@ -355,9 +355,8 @@ free_peer (void *cls, const GNUNET_HashCode * pid, void *value) | |||
355 | * @param cls 'struct Peer' to greylist | 355 | * @param cls 'struct Peer' to greylist |
356 | * @param tc scheduler context | 356 | * @param tc scheduler context |
357 | */ | 357 | */ |
358 | static void remove_from_greylist (void *cls, | 358 | static void |
359 | const struct GNUNET_SCHEDULER_TaskContext | 359 | remove_from_greylist (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
360 | *tc); | ||
361 | 360 | ||
362 | 361 | ||
363 | /** | 362 | /** |
@@ -503,7 +502,8 @@ setup_filter (struct Peer *peer) | |||
503 | * @param buf where the callee should write the message | 502 | * @param buf where the callee should write the message |
504 | * @return number of bytes written to buf | 503 | * @return number of bytes written to buf |
505 | */ | 504 | */ |
506 | static size_t hello_advertising_ready (void *cls, size_t size, void *buf); | 505 | static size_t |
506 | hello_advertising_ready (void *cls, size_t size, void *buf); | ||
507 | 507 | ||
508 | 508 | ||
509 | /** | 509 | /** |
@@ -921,8 +921,8 @@ process_peer (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
921 | } | 921 | } |
922 | if ((!pos->is_connected) && (!pos->is_friend) && | 922 | if ((!pos->is_connected) && (!pos->is_friend) && |
923 | (0 == | 923 | (0 == |
924 | GNUNET_TIME_absolute_get_remaining (pos->greylisted_until). | 924 | GNUNET_TIME_absolute_get_remaining (pos-> |
925 | rel_value)) | 925 | greylisted_until).rel_value)) |
926 | free_peer (NULL, &pos->pid.hashPubKey, pos); | 926 | free_peer (NULL, &pos->pid.hashPubKey, pos); |
927 | } | 927 | } |
928 | return; | 928 | return; |
@@ -1056,8 +1056,8 @@ read_friends_file (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
1056 | { | 1056 | { |
1057 | memcpy (&enc, &data[pos], sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded)); | 1057 | memcpy (&enc, &data[pos], sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded)); |
1058 | if (!isspace | 1058 | if (!isspace |
1059 | ((unsigned char) enc. | 1059 | ((unsigned char) |
1060 | encoding[sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1])) | 1060 | enc.encoding[sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1])) |
1061 | { | 1061 | { |
1062 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1062 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1063 | _ | 1063 | _ |
diff --git a/src/transport/gnunet-service-transport-new.c b/src/transport/gnunet-service-transport-new.c index 6c2b396dc..95f181835 100644 --- a/src/transport/gnunet-service-transport-new.c +++ b/src/transport/gnunet-service-transport-new.c | |||
@@ -218,8 +218,8 @@ plugin_env_receive_callback (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
218 | ret = | 218 | ret = |
219 | GST_neighbours_calculate_receive_delay (peer, | 219 | GST_neighbours_calculate_receive_delay (peer, |
220 | (message == | 220 | (message == |
221 | NULL) ? 0 : ntohs (message-> | 221 | NULL) ? 0 : |
222 | size), | 222 | ntohs (message->size), |
223 | &do_forward); | 223 | &do_forward); |
224 | if (do_forward == GNUNET_YES) | 224 | if (do_forward == GNUNET_YES) |
225 | GST_clients_broadcast (message, GNUNET_YES); | 225 | GST_clients_broadcast (message, GNUNET_YES); |
diff --git a/src/transport/gnunet-service-transport.c b/src/transport/gnunet-service-transport.c index 5b0a58fac..d6b5ac23f 100644 --- a/src/transport/gnunet-service-transport.c +++ b/src/transport/gnunet-service-transport.c | |||
@@ -953,7 +953,8 @@ struct GNUNET_TIME_Relative ats_regular_interval; | |||
953 | * disconnected or must we ask all plugins to | 953 | * disconnected or must we ask all plugins to |
954 | * disconnect? | 954 | * disconnect? |
955 | */ | 955 | */ |
956 | static void disconnect_neighbour (struct NeighbourMapEntry *n, int check); | 956 | static void |
957 | disconnect_neighbour (struct NeighbourMapEntry *n, int check); | ||
957 | 958 | ||
958 | /** | 959 | /** |
959 | * Check the ready list for the given neighbour and if a plugin is | 960 | * Check the ready list for the given neighbour and if a plugin is |
@@ -961,10 +962,11 @@ static void disconnect_neighbour (struct NeighbourMapEntry *n, int check); | |||
961 | * | 962 | * |
962 | * @param nexi target peer for which to transmit | 963 | * @param nexi target peer for which to transmit |
963 | */ | 964 | */ |
964 | static void try_transmission_to_peer (struct NeighbourMapEntry *n); | 965 | static void |
966 | try_transmission_to_peer (struct NeighbourMapEntry *n); | ||
965 | 967 | ||
966 | struct ForeignAddressList *get_preferred_ats_address (struct NeighbourMapEntry | 968 | struct ForeignAddressList * |
967 | *n); | 969 | get_preferred_ats_address (struct NeighbourMapEntry *n); |
968 | 970 | ||
969 | /** | 971 | /** |
970 | * Find an entry in the neighbour list for a particular peer. | 972 | * Find an entry in the neighbour list for a particular peer. |
@@ -1223,8 +1225,8 @@ read_blacklist_file (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
1223 | #endif | 1225 | #endif |
1224 | memcpy (&enc, &data[pos], sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded)); | 1226 | memcpy (&enc, &data[pos], sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded)); |
1225 | if (!isspace | 1227 | if (!isspace |
1226 | ((unsigned char) enc. | 1228 | ((unsigned char) |
1227 | encoding[sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1])) | 1229 | enc.encoding[sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1])) |
1228 | { | 1230 | { |
1229 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 1231 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
1230 | _ | 1232 | _ |
@@ -1523,7 +1525,8 @@ transmit_send_ok (struct TransportClient *client, struct NeighbourMapEntry *n, | |||
1523 | * | 1525 | * |
1524 | * @param fal address to set to 'connected' | 1526 | * @param fal address to set to 'connected' |
1525 | */ | 1527 | */ |
1526 | static void mark_address_connected (struct ForeignAddressList *fal); | 1528 | static void |
1529 | mark_address_connected (struct ForeignAddressList *fal); | ||
1527 | 1530 | ||
1528 | 1531 | ||
1529 | 1532 | ||
@@ -1939,8 +1942,8 @@ mark_address_connected (struct ForeignAddressList *fal) | |||
1939 | /* Have an inbound connection to this peer which is valid; our id is lower, ignore outbound connection! */ | 1942 | /* Have an inbound connection to this peer which is valid; our id is lower, ignore outbound connection! */ |
1940 | if ((inbound != NULL) && (0 != fal->addrlen) && | 1943 | if ((inbound != NULL) && (0 != fal->addrlen) && |
1941 | (1 == | 1944 | (1 == |
1942 | GNUNET_CRYPTO_hash_xorcmp (&inbound->ready_list->neighbour-> | 1945 | GNUNET_CRYPTO_hash_xorcmp (&inbound->ready_list->neighbour->id. |
1943 | id.hashPubKey, &my_identity.hashPubKey, | 1946 | hashPubKey, &my_identity.hashPubKey, |
1944 | &null_hash))) | 1947 | &null_hash))) |
1945 | { | 1948 | { |
1946 | #if DEBUG_INBOUND | 1949 | #if DEBUG_INBOUND |
@@ -1951,8 +1954,8 @@ mark_address_connected (struct ForeignAddressList *fal) | |||
1951 | } | 1954 | } |
1952 | else if ((outbound != NULL) && (0 == fal->addrlen) && | 1955 | else if ((outbound != NULL) && (0 == fal->addrlen) && |
1953 | ((-1 == | 1956 | ((-1 == |
1954 | GNUNET_CRYPTO_hash_xorcmp (&outbound->ready_list->neighbour->id. | 1957 | GNUNET_CRYPTO_hash_xorcmp (&outbound->ready_list->neighbour-> |
1955 | hashPubKey, &my_identity.hashPubKey, | 1958 | id.hashPubKey, &my_identity.hashPubKey, |
1956 | &null_hash)))) | 1959 | &null_hash)))) |
1957 | { | 1960 | { |
1958 | #if DEBUG_INBOUND | 1961 | #if DEBUG_INBOUND |
@@ -2056,10 +2059,10 @@ find_ready_address (struct NeighbourMapEntry *neighbour) | |||
2056 | if (((best_address == NULL) || (addresses->connected == GNUNET_YES) || | 2059 | if (((best_address == NULL) || (addresses->connected == GNUNET_YES) || |
2057 | (best_address->connected == GNUNET_NO)) && | 2060 | (best_address->connected == GNUNET_NO)) && |
2058 | (addresses->in_transmit == GNUNET_NO) && ((best_address == NULL) || | 2061 | (addresses->in_transmit == GNUNET_NO) && ((best_address == NULL) || |
2059 | (addresses->latency. | 2062 | (addresses-> |
2060 | rel_value < | 2063 | latency.rel_value < |
2061 | best_address->latency. | 2064 | best_address-> |
2062 | rel_value))) | 2065 | latency.rel_value))) |
2063 | best_address = addresses; | 2066 | best_address = addresses; |
2064 | /* FIXME: also give lower-latency addresses that are not | 2067 | /* FIXME: also give lower-latency addresses that are not |
2065 | * connected a chance some times... */ | 2068 | * connected a chance some times... */ |
@@ -2960,7 +2963,8 @@ neighbour_timeout_task (void *cls, | |||
2960 | * | 2963 | * |
2961 | * @param fal address to PING | 2964 | * @param fal address to PING |
2962 | */ | 2965 | */ |
2963 | static void schedule_next_ping (struct ForeignAddressList *fal); | 2966 | static void |
2967 | schedule_next_ping (struct ForeignAddressList *fal); | ||
2964 | 2968 | ||
2965 | 2969 | ||
2966 | /** | 2970 | /** |
@@ -3295,8 +3299,8 @@ static struct BlacklistCheck *bc_tail; | |||
3295 | * @param cls the 'struct BlacklistCheck*' | 3299 | * @param cls the 'struct BlacklistCheck*' |
3296 | * @param tc unused | 3300 | * @param tc unused |
3297 | */ | 3301 | */ |
3298 | static void do_blacklist_check (void *cls, | 3302 | static void |
3299 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 3303 | do_blacklist_check (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
3300 | 3304 | ||
3301 | /** | 3305 | /** |
3302 | * Transmit blacklist query to the client. | 3306 | * Transmit blacklist query to the client. |
@@ -3633,9 +3637,8 @@ send_periodic_ping (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
3633 | "Some validation of address `%s' via `%s' for peer `%4s' already in progress.\n", | 3637 | "Some validation of address `%s' via `%s' for peer `%4s' already in progress.\n", |
3634 | (peer_address->addr != NULL) ? a2s (tp->short_name, | 3638 | (peer_address->addr != NULL) ? a2s (tp->short_name, |
3635 | peer_address->addr, | 3639 | peer_address->addr, |
3636 | peer_address-> | 3640 | peer_address->addrlen) : |
3637 | addrlen) : "<inbound>", | 3641 | "<inbound>", tp->short_name, GNUNET_i2s (&neighbour->id)); |
3638 | tp->short_name, GNUNET_i2s (&neighbour->id)); | ||
3639 | #endif | 3642 | #endif |
3640 | schedule_next_ping (peer_address); | 3643 | schedule_next_ping (peer_address); |
3641 | return; | 3644 | return; |
@@ -4065,8 +4068,9 @@ check_pending_validation (void *cls, const GNUNET_HashCode * key, void *value) | |||
4065 | GNUNET_NO); | 4068 | GNUNET_NO); |
4066 | fal->latency = GNUNET_TIME_absolute_get_duration (ve->send_time); | 4069 | fal->latency = GNUNET_TIME_absolute_get_duration (ve->send_time); |
4067 | update_addr_value (fal, | 4070 | update_addr_value (fal, |
4068 | GNUNET_TIME_absolute_get_duration (ve->send_time). | 4071 | GNUNET_TIME_absolute_get_duration (ve-> |
4069 | rel_value, GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY); | 4072 | send_time).rel_value, |
4073 | GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY); | ||
4070 | 4074 | ||
4071 | schedule_next_ping (fal); | 4075 | schedule_next_ping (fal); |
4072 | if (n->latency.rel_value == GNUNET_TIME_UNIT_FOREVER_REL.rel_value) | 4076 | if (n->latency.rel_value == GNUNET_TIME_UNIT_FOREVER_REL.rel_value) |
@@ -4571,8 +4575,8 @@ process_hello (struct TransportPlugin *plugin, | |||
4571 | chvc = chvc_head; | 4575 | chvc = chvc_head; |
4572 | while (NULL != chvc) | 4576 | while (NULL != chvc) |
4573 | { | 4577 | { |
4574 | if (GNUNET_HELLO_equals (hello, chvc->hello, GNUNET_TIME_absolute_get ()). | 4578 | if (GNUNET_HELLO_equals |
4575 | abs_value > 0) | 4579 | (hello, chvc->hello, GNUNET_TIME_absolute_get ()).abs_value > 0) |
4576 | { | 4580 | { |
4577 | #if DEBUG_TRANSPORT_HELLO > 2 | 4581 | #if DEBUG_TRANSPORT_HELLO > 2 |
4578 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 4582 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -4889,8 +4893,9 @@ handle_ping (void *cls, const struct GNUNET_MessageHeader *message, | |||
4889 | memcpy (&pong[1], plugin->short_name, slen); | 4893 | memcpy (&pong[1], plugin->short_name, slen); |
4890 | if ((sender_address != NULL) && (sender_address_len > 0)) | 4894 | if ((sender_address != NULL) && (sender_address_len > 0)) |
4891 | memcpy (&((char *) &pong[1])[slen], sender_address, sender_address_len); | 4895 | memcpy (&((char *) &pong[1])[slen], sender_address, sender_address_len); |
4892 | if (GNUNET_TIME_absolute_get_remaining (session_header->pong_sig_expires). | 4896 | if (GNUNET_TIME_absolute_get_remaining |
4893 | rel_value < PONG_SIGNATURE_LIFETIME.rel_value / 4) | 4897 | (session_header->pong_sig_expires).rel_value < |
4898 | PONG_SIGNATURE_LIFETIME.rel_value / 4) | ||
4894 | { | 4899 | { |
4895 | /* create / update cached sig */ | 4900 | /* create / update cached sig */ |
4896 | #if DEBUG_TRANSPORT | 4901 | #if DEBUG_TRANSPORT |
@@ -5235,8 +5240,8 @@ plugin_env_receive (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
5235 | #if DEBUG_TRANSPORT | 5240 | #if DEBUG_TRANSPORT |
5236 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 5241 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
5237 | "Throttling read (%llu bytes excess at %u b/s), waiting %llu ms before reading more.\n", | 5242 | "Throttling read (%llu bytes excess at %u b/s), waiting %llu ms before reading more.\n", |
5238 | (unsigned long long) n->in_tracker. | 5243 | (unsigned long long) n-> |
5239 | consumption_since_last_update__, | 5244 | in_tracker.consumption_since_last_update__, |
5240 | (unsigned int) n->in_tracker.available_bytes_per_s__, | 5245 | (unsigned int) n->in_tracker.available_bytes_per_s__, |
5241 | (unsigned long long) ret.rel_value); | 5246 | (unsigned long long) ret.rel_value); |
5242 | #endif | 5247 | #endif |
diff --git a/src/transport/gnunet-service-transport_ats.c b/src/transport/gnunet-service-transport_ats.c index 2e859f1db..87aa34bf4 100644 --- a/src/transport/gnunet-service-transport_ats.c +++ b/src/transport/gnunet-service-transport_ats.c | |||
@@ -473,7 +473,8 @@ _lp_print_sol (glp_prob *P, const char *fname) | |||
473 | * Dummy functions for CFLAGS | 473 | * Dummy functions for CFLAGS |
474 | */ | 474 | */ |
475 | 475 | ||
476 | static void _dummy2 (); | 476 | static void |
477 | _dummy2 (); | ||
477 | static void | 478 | static void |
478 | _dummy () | 479 | _dummy () |
479 | { | 480 | { |
diff --git a/src/transport/gnunet-service-transport_ats.h b/src/transport/gnunet-service-transport_ats.h index 88e4b4bbf..550f218a9 100644 --- a/src/transport/gnunet-service-transport_ats.h +++ b/src/transport/gnunet-service-transport_ats.h | |||
@@ -449,40 +449,48 @@ static struct ATS_quality_metric qm[] = { | |||
449 | /* | 449 | /* |
450 | * ATS functions | 450 | * ATS functions |
451 | */ | 451 | */ |
452 | struct ATS_Handle *ats_init (double D, double U, double R, int v_b_min, | 452 | struct ATS_Handle * |
453 | int v_n_min, int max_iterations, | 453 | ats_init (double D, double U, double R, int v_b_min, int v_n_min, |
454 | struct GNUNET_TIME_Relative max_duration, | 454 | int max_iterations, struct GNUNET_TIME_Relative max_duration, |
455 | GNUNET_TRANSPORT_ATS_AddressNotification | 455 | GNUNET_TRANSPORT_ATS_AddressNotification address_not, |
456 | address_not, | 456 | GNUNET_TRANSPORT_ATS_ResultCallback res_cb); |
457 | GNUNET_TRANSPORT_ATS_ResultCallback res_cb); | ||
458 | 457 | ||
459 | void ats_shutdown (struct ATS_Handle *ats); | 458 | void |
459 | ats_shutdown (struct ATS_Handle *ats); | ||
460 | 460 | ||
461 | void ats_delete_problem (struct ATS_Handle *ats); | 461 | void |
462 | ats_delete_problem (struct ATS_Handle *ats); | ||
462 | 463 | ||
463 | int ats_create_problem (struct ATS_Handle *ats, struct ATS_internals *stat, | 464 | int |
464 | struct ATS_peer *peers, int c_p, | 465 | ats_create_problem (struct ATS_Handle *ats, struct ATS_internals *stat, |
465 | struct ATS_mechanism *mechanisms, int c_m); | 466 | struct ATS_peer *peers, int c_p, |
467 | struct ATS_mechanism *mechanisms, int c_m); | ||
466 | 468 | ||
467 | void ats_modify_problem_state (struct ATS_Handle *ats, | 469 | void |
468 | enum ATS_problem_state s); | 470 | ats_modify_problem_state (struct ATS_Handle *ats, enum ATS_problem_state s); |
469 | 471 | ||
470 | void ats_calculate_bandwidth_distribution (struct ATS_Handle *ats); | 472 | void |
473 | ats_calculate_bandwidth_distribution (struct ATS_Handle *ats); | ||
471 | 474 | ||
472 | void ats_solve_problem (struct ATS_Handle *ats, unsigned int max_it, | 475 | void |
473 | unsigned int max_dur, unsigned int c_peers, | 476 | ats_solve_problem (struct ATS_Handle *ats, unsigned int max_it, |
474 | unsigned int c_mechs, struct ATS_internals *stat); | 477 | unsigned int max_dur, unsigned int c_peers, |
478 | unsigned int c_mechs, struct ATS_internals *stat); | ||
475 | 479 | ||
476 | int ats_evaluate_results (int result, int solution, char *problem); | 480 | int |
481 | ats_evaluate_results (int result, int solution, char *problem); | ||
477 | 482 | ||
478 | void ats_update_problem_qm (struct ATS_Handle *ats); | 483 | void |
484 | ats_update_problem_qm (struct ATS_Handle *ats); | ||
479 | 485 | ||
480 | void ats_update_problem_cr (struct ATS_Handle *ats); | 486 | void |
487 | ats_update_problem_cr (struct ATS_Handle *ats); | ||
481 | 488 | ||
482 | 489 | ||
483 | void ats_set_logging_options (struct ATS_Handle *ats, | 490 | void |
484 | struct GNUNET_STATISTICS_Handle *stats, | 491 | ats_set_logging_options (struct ATS_Handle *ats, |
485 | const struct GNUNET_CONFIGURATION_Handle *cfg); | 492 | struct GNUNET_STATISTICS_Handle *stats, |
493 | const struct GNUNET_CONFIGURATION_Handle *cfg); | ||
486 | 494 | ||
487 | #endif | 495 | #endif |
488 | /* end of file gnunet-service-transport_ats.h */ | 496 | /* end of file gnunet-service-transport_ats.h */ |
diff --git a/src/transport/gnunet-service-transport_blacklist.c b/src/transport/gnunet-service-transport_blacklist.c index abb536414..21ad49652 100644 --- a/src/transport/gnunet-service-transport_blacklist.c +++ b/src/transport/gnunet-service-transport_blacklist.c | |||
@@ -161,8 +161,8 @@ static struct GNUNET_CONTAINER_MultiHashMap *blacklist; | |||
161 | * @param cls the 'struct BlacklistCheck*' | 161 | * @param cls the 'struct BlacklistCheck*' |
162 | * @param tc unused | 162 | * @param tc unused |
163 | */ | 163 | */ |
164 | static void do_blacklist_check (void *cls, | 164 | static void |
165 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 165 | do_blacklist_check (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
166 | 166 | ||
167 | 167 | ||
168 | /** | 168 | /** |
@@ -328,8 +328,8 @@ read_blacklist_file () | |||
328 | #endif | 328 | #endif |
329 | memcpy (&enc, &data[pos], sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded)); | 329 | memcpy (&enc, &data[pos], sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded)); |
330 | if (!isspace | 330 | if (!isspace |
331 | ((unsigned char) enc. | 331 | ((unsigned char) |
332 | encoding[sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1])) | 332 | enc.encoding[sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1])) |
333 | { | 333 | { |
334 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, | 334 | GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |
335 | _ | 335 | _ |
diff --git a/src/transport/gnunet-service-transport_blacklist.h b/src/transport/gnunet-service-transport_blacklist.h index 7e88b3961..64a800664 100644 --- a/src/transport/gnunet-service-transport_blacklist.h +++ b/src/transport/gnunet-service-transport_blacklist.h | |||
@@ -34,13 +34,15 @@ | |||
34 | * | 34 | * |
35 | * @param server server used to accept clients from | 35 | * @param server server used to accept clients from |
36 | */ | 36 | */ |
37 | void GST_blacklist_start (struct GNUNET_SERVER_Handle *server); | 37 | void |
38 | GST_blacklist_start (struct GNUNET_SERVER_Handle *server); | ||
38 | 39 | ||
39 | 40 | ||
40 | /** | 41 | /** |
41 | * Stop blacklist subsystem. | 42 | * Stop blacklist subsystem. |
42 | */ | 43 | */ |
43 | void GST_blacklist_stop (void); | 44 | void |
45 | GST_blacklist_stop (void); | ||
44 | 46 | ||
45 | 47 | ||
46 | /** | 48 | /** |
@@ -52,8 +54,9 @@ void GST_blacklist_stop (void); | |||
52 | * @param client the client | 54 | * @param client the client |
53 | * @param message the blacklist-init message that was sent | 55 | * @param message the blacklist-init message that was sent |
54 | */ | 56 | */ |
55 | void GST_blacklist_handle_init (void *cls, struct GNUNET_SERVER_Client *client, | 57 | void |
56 | const struct GNUNET_MessageHeader *message); | 58 | GST_blacklist_handle_init (void *cls, struct GNUNET_SERVER_Client *client, |
59 | const struct GNUNET_MessageHeader *message); | ||
57 | 60 | ||
58 | /** | 61 | /** |
59 | * A blacklisting client has sent us reply. Process it. | 62 | * A blacklisting client has sent us reply. Process it. |
@@ -62,8 +65,9 @@ void GST_blacklist_handle_init (void *cls, struct GNUNET_SERVER_Client *client, | |||
62 | * @param client the client | 65 | * @param client the client |
63 | * @param message the blacklist-init message that was sent | 66 | * @param message the blacklist-init message that was sent |
64 | */ | 67 | */ |
65 | void GST_blacklist_handle_reply (void *cls, struct GNUNET_SERVER_Client *client, | 68 | void |
66 | const struct GNUNET_MessageHeader *message); | 69 | GST_blacklist_handle_reply (void *cls, struct GNUNET_SERVER_Client *client, |
70 | const struct GNUNET_MessageHeader *message); | ||
67 | 71 | ||
68 | /** | 72 | /** |
69 | * Add the given peer to the blacklist (for the given transport). | 73 | * Add the given peer to the blacklist (for the given transport). |
@@ -71,8 +75,9 @@ void GST_blacklist_handle_reply (void *cls, struct GNUNET_SERVER_Client *client, | |||
71 | * @param peer peer to blacklist | 75 | * @param peer peer to blacklist |
72 | * @param transport_name transport to blacklist for this peer, NULL for all | 76 | * @param transport_name transport to blacklist for this peer, NULL for all |
73 | */ | 77 | */ |
74 | void GST_blacklist_add_peer (const struct GNUNET_PeerIdentity *peer, | 78 | void |
75 | const char *transport_name); | 79 | GST_blacklist_add_peer (const struct GNUNET_PeerIdentity *peer, |
80 | const char *transport_name); | ||
76 | 81 | ||
77 | 82 | ||
78 | /** | 83 | /** |
@@ -104,13 +109,10 @@ typedef void (*GST_BlacklistTestContinuation) (void *cls, | |||
104 | * @return handle to the blacklist check, NULL if the decision | 109 | * @return handle to the blacklist check, NULL if the decision |
105 | * was made instantly and 'cont' was already called | 110 | * was made instantly and 'cont' was already called |
106 | */ | 111 | */ |
107 | struct GST_BlacklistCheck *GST_blacklist_test_allowed (const struct | 112 | struct GST_BlacklistCheck * |
108 | GNUNET_PeerIdentity | 113 | GST_blacklist_test_allowed (const struct GNUNET_PeerIdentity *peer, |
109 | *peer, | 114 | const char *transport_name, |
110 | const char | 115 | GST_BlacklistTestContinuation cont, void *cont_cls); |
111 | *transport_name, | ||
112 | GST_BlacklistTestContinuation | ||
113 | cont, void *cont_cls); | ||
114 | 116 | ||
115 | 117 | ||
116 | /** | 118 | /** |
@@ -118,7 +120,8 @@ struct GST_BlacklistCheck *GST_blacklist_test_allowed (const struct | |||
118 | * | 120 | * |
119 | * @param bc check to cancel | 121 | * @param bc check to cancel |
120 | */ | 122 | */ |
121 | void GST_blacklist_test_cancel (struct GST_BlacklistCheck *bc); | 123 | void |
124 | GST_blacklist_test_cancel (struct GST_BlacklistCheck *bc); | ||
122 | 125 | ||
123 | #endif | 126 | #endif |
124 | /* end of file gnunet-service-transport_blacklist.h */ | 127 | /* end of file gnunet-service-transport_blacklist.h */ |
diff --git a/src/transport/gnunet-service-transport_clients.h b/src/transport/gnunet-service-transport_clients.h index 6bcc18cd3..aae7ba89f 100644 --- a/src/transport/gnunet-service-transport_clients.h +++ b/src/transport/gnunet-service-transport_clients.h | |||
@@ -35,13 +35,15 @@ | |||
35 | * | 35 | * |
36 | * @param server server used to accept clients from. | 36 | * @param server server used to accept clients from. |
37 | */ | 37 | */ |
38 | void GST_clients_start (struct GNUNET_SERVER_Handle *server); | 38 | void |
39 | GST_clients_start (struct GNUNET_SERVER_Handle *server); | ||
39 | 40 | ||
40 | 41 | ||
41 | /** | 42 | /** |
42 | * Stop processing clients. | 43 | * Stop processing clients. |
43 | */ | 44 | */ |
44 | void GST_clients_stop (void); | 45 | void |
46 | GST_clients_stop (void); | ||
45 | 47 | ||
46 | 48 | ||
47 | /** | 49 | /** |
@@ -50,8 +52,8 @@ void GST_clients_stop (void); | |||
50 | * @param msg message to broadcast | 52 | * @param msg message to broadcast |
51 | * @param may_drop GNUNET_YES if the message can be dropped | 53 | * @param may_drop GNUNET_YES if the message can be dropped |
52 | */ | 54 | */ |
53 | void GST_clients_broadcast (const struct GNUNET_MessageHeader *msg, | 55 | void |
54 | int may_drop); | 56 | GST_clients_broadcast (const struct GNUNET_MessageHeader *msg, int may_drop); |
55 | 57 | ||
56 | 58 | ||
57 | /** | 59 | /** |
@@ -61,8 +63,9 @@ void GST_clients_broadcast (const struct GNUNET_MessageHeader *msg, | |||
61 | * @param msg message to transmit | 63 | * @param msg message to transmit |
62 | * @param may_drop GNUNET_YES if the message can be dropped | 64 | * @param may_drop GNUNET_YES if the message can be dropped |
63 | */ | 65 | */ |
64 | void GST_clients_unicast (struct GNUNET_SERVER_Client *client, | 66 | void |
65 | const struct GNUNET_MessageHeader *msg, int may_drop); | 67 | GST_clients_unicast (struct GNUNET_SERVER_Client *client, |
68 | const struct GNUNET_MessageHeader *msg, int may_drop); | ||
66 | 69 | ||
67 | 70 | ||
68 | 71 | ||
diff --git a/src/transport/gnunet-service-transport_hello.h b/src/transport/gnunet-service-transport_hello.h index ff817814b..153b7447e 100644 --- a/src/transport/gnunet-service-transport_hello.h +++ b/src/transport/gnunet-service-transport_hello.h | |||
@@ -55,13 +55,15 @@ typedef void (*GST_HelloCallback) (void *cls, | |||
55 | * @param cb function to call whenever our HELLO changes | 55 | * @param cb function to call whenever our HELLO changes |
56 | * @param cb_cls closure for cb | 56 | * @param cb_cls closure for cb |
57 | */ | 57 | */ |
58 | void GST_hello_start (GST_HelloCallback cb, void *cb_cls); | 58 | void |
59 | GST_hello_start (GST_HelloCallback cb, void *cb_cls); | ||
59 | 60 | ||
60 | 61 | ||
61 | /** | 62 | /** |
62 | * Shutdown the HELLO module. | 63 | * Shutdown the HELLO module. |
63 | */ | 64 | */ |
64 | void GST_hello_stop (void); | 65 | void |
66 | GST_hello_stop (void); | ||
65 | 67 | ||
66 | 68 | ||
67 | /** | 69 | /** |
@@ -69,7 +71,8 @@ void GST_hello_stop (void); | |||
69 | * | 71 | * |
70 | * @return our HELLO message | 72 | * @return our HELLO message |
71 | */ | 73 | */ |
72 | const struct GNUNET_MessageHeader *GST_hello_get (void); | 74 | const struct GNUNET_MessageHeader * |
75 | GST_hello_get (void); | ||
73 | 76 | ||
74 | 77 | ||
75 | /** | 78 | /** |
@@ -80,9 +83,10 @@ const struct GNUNET_MessageHeader *GST_hello_get (void); | |||
80 | * @param plugin_address address in a plugin-specific format | 83 | * @param plugin_address address in a plugin-specific format |
81 | * @param plugin_address_len number of bytes in plugin_address | 84 | * @param plugin_address_len number of bytes in plugin_address |
82 | */ | 85 | */ |
83 | void GST_hello_modify_addresses (int addremove, const char *plugin_name, | 86 | void |
84 | const void *plugin_address, | 87 | GST_hello_modify_addresses (int addremove, const char *plugin_name, |
85 | size_t plugin_address_len); | 88 | const void *plugin_address, |
89 | size_t plugin_address_len); | ||
86 | 90 | ||
87 | 91 | ||
88 | /** | 92 | /** |
@@ -97,10 +101,11 @@ void GST_hello_modify_addresses (int addremove, const char *plugin_name, | |||
97 | * @return GNUNET_YES if this is one of our addresses, | 101 | * @return GNUNET_YES if this is one of our addresses, |
98 | * GNUNET_NO if not | 102 | * GNUNET_NO if not |
99 | */ | 103 | */ |
100 | int GST_hello_test_address (const char *plugin_name, const void *plugin_address, | 104 | int |
101 | size_t plugin_address_len, | 105 | GST_hello_test_address (const char *plugin_name, const void *plugin_address, |
102 | struct GNUNET_CRYPTO_RsaSignature **sig, | 106 | size_t plugin_address_len, |
103 | struct GNUNET_TIME_Absolute **sig_expiration); | 107 | struct GNUNET_CRYPTO_RsaSignature **sig, |
108 | struct GNUNET_TIME_Absolute **sig_expiration); | ||
104 | 109 | ||
105 | 110 | ||
106 | #endif | 111 | #endif |
diff --git a/src/transport/gnunet-service-transport_neighbours.c b/src/transport/gnunet-service-transport_neighbours.c index 251b4c356..71539d3de 100644 --- a/src/transport/gnunet-service-transport_neighbours.c +++ b/src/transport/gnunet-service-transport_neighbours.c | |||
@@ -246,8 +246,8 @@ lookup_neighbour (const struct GNUNET_PeerIdentity *pid) | |||
246 | * @param cls the 'struct NeighbourMapEntry' | 246 | * @param cls the 'struct NeighbourMapEntry' |
247 | * @param tc scheduler context | 247 | * @param tc scheduler context |
248 | */ | 248 | */ |
249 | static void transmission_task (void *cls, | 249 | static void |
250 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 250 | transmission_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
251 | 251 | ||
252 | 252 | ||
253 | /** | 253 | /** |
@@ -770,8 +770,8 @@ GST_neighbours_calculate_receive_delay (const struct GNUNET_PeerIdentity | |||
770 | #if DEBUG_TRANSPORT | 770 | #if DEBUG_TRANSPORT |
771 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 771 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
772 | "Throttling read (%llu bytes excess at %u b/s), waiting %llu ms before reading more.\n", | 772 | "Throttling read (%llu bytes excess at %u b/s), waiting %llu ms before reading more.\n", |
773 | (unsigned long long) n->in_tracker. | 773 | (unsigned long long) n-> |
774 | consumption_since_last_update__, | 774 | in_tracker.consumption_since_last_update__, |
775 | (unsigned int) n->in_tracker.available_bytes_per_s__, | 775 | (unsigned int) n->in_tracker.available_bytes_per_s__, |
776 | (unsigned long long) ret.rel_value); | 776 | (unsigned long long) ret.rel_value); |
777 | #endif | 777 | #endif |
diff --git a/src/transport/gnunet-service-transport_neighbours.h b/src/transport/gnunet-service-transport_neighbours.h index c0cee01a6..db29d66aa 100644 --- a/src/transport/gnunet-service-transport_neighbours.h +++ b/src/transport/gnunet-service-transport_neighbours.h | |||
@@ -43,14 +43,16 @@ | |||
43 | * @param connect_cb function to call if we connect to a peer | 43 | * @param connect_cb function to call if we connect to a peer |
44 | * @param disconnect_cb function to call if we disconnect from a peer | 44 | * @param disconnect_cb function to call if we disconnect from a peer |
45 | */ | 45 | */ |
46 | void GST_neighbours_start (void *cls, GNUNET_TRANSPORT_NotifyConnect connect_cb, | 46 | void |
47 | GNUNET_TRANSPORT_NotifyDisconnect disconnect_cb); | 47 | GST_neighbours_start (void *cls, GNUNET_TRANSPORT_NotifyConnect connect_cb, |
48 | GNUNET_TRANSPORT_NotifyDisconnect disconnect_cb); | ||
48 | 49 | ||
49 | 50 | ||
50 | /** | 51 | /** |
51 | * Cleanup the neighbours subsystem. | 52 | * Cleanup the neighbours subsystem. |
52 | */ | 53 | */ |
53 | void GST_neighbours_stop (void); | 54 | void |
55 | GST_neighbours_stop (void); | ||
54 | 56 | ||
55 | 57 | ||
56 | /** | 58 | /** |
@@ -58,7 +60,8 @@ void GST_neighbours_stop (void); | |||
58 | * | 60 | * |
59 | * @param target peer to try to connect to | 61 | * @param target peer to try to connect to |
60 | */ | 62 | */ |
61 | void GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target); | 63 | void |
64 | GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target); | ||
62 | 65 | ||
63 | 66 | ||
64 | /** | 67 | /** |
@@ -67,7 +70,8 @@ void GST_neighbours_try_connect (const struct GNUNET_PeerIdentity *target); | |||
67 | * @param target peer to test | 70 | * @param target peer to test |
68 | * @return GNUNET_YES if we are connected, GNUNET_NO if not | 71 | * @return GNUNET_YES if we are connected, GNUNET_NO if not |
69 | */ | 72 | */ |
70 | int GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target); | 73 | int |
74 | GST_neighbours_test_connected (const struct GNUNET_PeerIdentity *target); | ||
71 | 75 | ||
72 | 76 | ||
73 | /** | 77 | /** |
@@ -89,10 +93,10 @@ typedef void (*GST_NeighbourSendContinuation) (void *cls, int success); | |||
89 | * @param cont function to call when done | 93 | * @param cont function to call when done |
90 | * @param cont_cls closure for 'cont' | 94 | * @param cont_cls closure for 'cont' |
91 | */ | 95 | */ |
92 | void GST_neighbours_send (const struct GNUNET_PeerIdentity *target, | 96 | void |
93 | const void *msg, size_t msg_size, | 97 | GST_neighbours_send (const struct GNUNET_PeerIdentity *target, const void *msg, |
94 | struct GNUNET_TIME_Relative timeout, | 98 | size_t msg_size, struct GNUNET_TIME_Relative timeout, |
95 | GST_NeighbourSendContinuation cont, void *cont_cls); | 99 | GST_NeighbourSendContinuation cont, void *cont_cls); |
96 | 100 | ||
97 | 101 | ||
98 | /** | 102 | /** |
@@ -106,13 +110,9 @@ void GST_neighbours_send (const struct GNUNET_PeerIdentity *target, | |||
106 | * GNUNET_NO if the neighbour is not connected or violates the quota | 110 | * GNUNET_NO if the neighbour is not connected or violates the quota |
107 | * @return how long to wait before reading more from this sender | 111 | * @return how long to wait before reading more from this sender |
108 | */ | 112 | */ |
109 | struct GNUNET_TIME_Relative GST_neighbours_calculate_receive_delay (const struct | 113 | struct GNUNET_TIME_Relative |
110 | GNUNET_PeerIdentity | 114 | GST_neighbours_calculate_receive_delay (const struct GNUNET_PeerIdentity |
111 | *sender, | 115 | *sender, ssize_t size, int *do_forward); |
112 | ssize_t | ||
113 | size, | ||
114 | int | ||
115 | *do_forward); | ||
116 | 116 | ||
117 | 117 | ||
118 | /** | 118 | /** |
@@ -121,7 +121,8 @@ struct GNUNET_TIME_Relative GST_neighbours_calculate_receive_delay (const struct | |||
121 | * | 121 | * |
122 | * @param neighbour neighbour to keep alive | 122 | * @param neighbour neighbour to keep alive |
123 | */ | 123 | */ |
124 | void GST_neighbours_keepalive (const struct GNUNET_PeerIdentity *neighbour); | 124 | void |
125 | GST_neighbours_keepalive (const struct GNUNET_PeerIdentity *neighbour); | ||
125 | 126 | ||
126 | 127 | ||
127 | /** | 128 | /** |
@@ -130,10 +131,9 @@ void GST_neighbours_keepalive (const struct GNUNET_PeerIdentity *neighbour); | |||
130 | * @param neighbour identity of peer to change qutoa for | 131 | * @param neighbour identity of peer to change qutoa for |
131 | * @param quota new quota | 132 | * @param quota new quota |
132 | */ | 133 | */ |
133 | void GST_neighbours_set_incoming_quota (const struct GNUNET_PeerIdentity | 134 | void |
134 | *neighbour, | 135 | GST_neighbours_set_incoming_quota (const struct GNUNET_PeerIdentity *neighbour, |
135 | struct GNUNET_BANDWIDTH_Value32NBO | 136 | struct GNUNET_BANDWIDTH_Value32NBO quota); |
136 | quota); | ||
137 | 137 | ||
138 | 138 | ||
139 | /** | 139 | /** |
@@ -141,7 +141,8 @@ void GST_neighbours_set_incoming_quota (const struct GNUNET_PeerIdentity | |||
141 | * | 141 | * |
142 | * @param target peer to disconnect from | 142 | * @param target peer to disconnect from |
143 | */ | 143 | */ |
144 | void GST_neighbours_force_disconnect (const struct GNUNET_PeerIdentity *target); | 144 | void |
145 | GST_neighbours_force_disconnect (const struct GNUNET_PeerIdentity *target); | ||
145 | 146 | ||
146 | 147 | ||
147 | /** | 148 | /** |
@@ -166,7 +167,8 @@ typedef void (*GST_NeighbourIterator) (void *cls, | |||
166 | * @param cb function to call | 167 | * @param cb function to call |
167 | * @param cb_cls closure for cb | 168 | * @param cb_cls closure for cb |
168 | */ | 169 | */ |
169 | void GST_neighbours_iterate (GST_NeighbourIterator cb, void *cb_cls); | 170 | void |
171 | GST_neighbours_iterate (GST_NeighbourIterator cb, void *cb_cls); | ||
170 | 172 | ||
171 | 173 | ||
172 | /** | 174 | /** |
@@ -175,8 +177,9 @@ void GST_neighbours_iterate (GST_NeighbourIterator cb, void *cb_cls); | |||
175 | * @param peer identity of the peer where the session died | 177 | * @param peer identity of the peer where the session died |
176 | * @param session session that is gone | 178 | * @param session session that is gone |
177 | */ | 179 | */ |
178 | void GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, | 180 | void |
179 | struct Session *session); | 181 | GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, |
182 | struct Session *session); | ||
180 | 183 | ||
181 | 184 | ||
182 | /** | 185 | /** |
@@ -192,13 +195,12 @@ void GST_neighbours_session_terminated (const struct GNUNET_PeerIdentity *peer, | |||
192 | * @param ats performance data | 195 | * @param ats performance data |
193 | * @param ats_count number of entries in ats (excluding 0-termination) | 196 | * @param ats_count number of entries in ats (excluding 0-termination) |
194 | */ | 197 | */ |
195 | void GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer, | 198 | void |
196 | const char *plugin_name, | 199 | GST_neighbours_switch_to_address (const struct GNUNET_PeerIdentity *peer, |
197 | const void *address, size_t address_len, | 200 | const char *plugin_name, const void *address, |
198 | struct Session *session, | 201 | size_t address_len, struct Session *session, |
199 | const struct | 202 | const struct GNUNET_TRANSPORT_ATS_Information |
200 | GNUNET_TRANSPORT_ATS_Information *ats, | 203 | *ats, uint32_t ats_count); |
201 | uint32_t ats_count); | ||
202 | 204 | ||
203 | 205 | ||
204 | #endif | 206 | #endif |
diff --git a/src/transport/gnunet-service-transport_plugins.h b/src/transport/gnunet-service-transport_plugins.h index ebc8fa451..856b594cd 100644 --- a/src/transport/gnunet-service-transport_plugins.h +++ b/src/transport/gnunet-service-transport_plugins.h | |||
@@ -42,15 +42,17 @@ | |||
42 | * @param address_cb function to call when our public addresses changed | 42 | * @param address_cb function to call when our public addresses changed |
43 | * @param session_end_cb function to call when a session was terminated | 43 | * @param session_end_cb function to call when a session was terminated |
44 | */ | 44 | */ |
45 | void GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb, | 45 | void |
46 | GNUNET_TRANSPORT_AddressNotification address_cb, | 46 | GST_plugins_load (GNUNET_TRANSPORT_PluginReceiveCallback recv_cb, |
47 | GNUNET_TRANSPORT_SessionEnd session_end_cb); | 47 | GNUNET_TRANSPORT_AddressNotification address_cb, |
48 | GNUNET_TRANSPORT_SessionEnd session_end_cb); | ||
48 | 49 | ||
49 | 50 | ||
50 | /** | 51 | /** |
51 | * Unload all plugins | 52 | * Unload all plugins |
52 | */ | 53 | */ |
53 | void GST_plugins_unload (void); | 54 | void |
55 | GST_plugins_unload (void); | ||
54 | 56 | ||
55 | 57 | ||
56 | /** | 58 | /** |
@@ -59,7 +61,8 @@ void GST_plugins_unload (void); | |||
59 | * @param name name of the plugin | 61 | * @param name name of the plugin |
60 | * @return the plugin's API, NULL if the plugin is not loaded | 62 | * @return the plugin's API, NULL if the plugin is not loaded |
61 | */ | 63 | */ |
62 | struct GNUNET_TRANSPORT_PluginFunctions *GST_plugins_find (const char *name); | 64 | struct GNUNET_TRANSPORT_PluginFunctions * |
65 | GST_plugins_find (const char *name); | ||
63 | 66 | ||
64 | 67 | ||
65 | /** | 68 | /** |
@@ -71,8 +74,8 @@ struct GNUNET_TRANSPORT_PluginFunctions *GST_plugins_find (const char *name); | |||
71 | * @param addrlen number of bytes in 'addr' | 74 | * @param addrlen number of bytes in 'addr' |
72 | * @return statically allocated (!) human-readable address | 75 | * @return statically allocated (!) human-readable address |
73 | */ | 76 | */ |
74 | const char *GST_plugins_a2s (const char *name, const void *addr, | 77 | const char * |
75 | size_t addrlen); | 78 | GST_plugins_a2s (const char *name, const void *addr, size_t addrlen); |
76 | 79 | ||
77 | 80 | ||
78 | #endif | 81 | #endif |
diff --git a/src/transport/gnunet-service-transport_validation.h b/src/transport/gnunet-service-transport_validation.h index 86ede1576..1840c0919 100644 --- a/src/transport/gnunet-service-transport_validation.h +++ b/src/transport/gnunet-service-transport_validation.h | |||
@@ -34,13 +34,15 @@ | |||
34 | /** | 34 | /** |
35 | * Start the validation subsystem. | 35 | * Start the validation subsystem. |
36 | */ | 36 | */ |
37 | void GST_validation_start (void); | 37 | void |
38 | GST_validation_start (void); | ||
38 | 39 | ||
39 | 40 | ||
40 | /** | 41 | /** |
41 | * Stop the validation subsystem. | 42 | * Stop the validation subsystem. |
42 | */ | 43 | */ |
43 | void GST_validation_stop (void); | 44 | void |
45 | GST_validation_stop (void); | ||
44 | 46 | ||
45 | 47 | ||
46 | /** | 48 | /** |
@@ -54,12 +56,12 @@ void GST_validation_stop (void); | |||
54 | * if we did not initiate the connection | 56 | * if we did not initiate the connection |
55 | * @param sender_address_len number of bytes in sender_address | 57 | * @param sender_address_len number of bytes in sender_address |
56 | */ | 58 | */ |
57 | void GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender, | 59 | void |
58 | const struct GNUNET_MessageHeader *hdr, | 60 | GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender, |
59 | const char *plugin_name, | 61 | const struct GNUNET_MessageHeader *hdr, |
60 | struct Session *session, | 62 | const char *plugin_name, struct Session *session, |
61 | const void *sender_address, | 63 | const void *sender_address, |
62 | size_t sender_address_len); | 64 | size_t sender_address_len); |
63 | 65 | ||
64 | 66 | ||
65 | /** | 67 | /** |
@@ -69,8 +71,9 @@ void GST_validation_handle_ping (const struct GNUNET_PeerIdentity *sender, | |||
69 | * @param sender peer sending the PONG | 71 | * @param sender peer sending the PONG |
70 | * @param hdr the PONG | 72 | * @param hdr the PONG |
71 | */ | 73 | */ |
72 | void GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender, | 74 | void |
73 | const struct GNUNET_MessageHeader *hdr); | 75 | GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender, |
76 | const struct GNUNET_MessageHeader *hdr); | ||
74 | 77 | ||
75 | 78 | ||
76 | /** | 79 | /** |
@@ -79,7 +82,8 @@ void GST_validation_handle_pong (const struct GNUNET_PeerIdentity *sender, | |||
79 | * | 82 | * |
80 | * @param hello the HELLO we received | 83 | * @param hello the HELLO we received |
81 | */ | 84 | */ |
82 | void GST_validation_handle_hello (const struct GNUNET_MessageHeader *hello); | 85 | void |
86 | GST_validation_handle_hello (const struct GNUNET_MessageHeader *hello); | ||
83 | 87 | ||
84 | 88 | ||
85 | /** | 89 | /** |
@@ -122,9 +126,9 @@ typedef void (*GST_ValidationAddressCallback) (void *cls, | |||
122 | * @param cb_cls closure for 'cb' | 126 | * @param cb_cls closure for 'cb' |
123 | * @return context to cancel, NULL if 'snapshot_only' is GNUNET_YES | 127 | * @return context to cancel, NULL if 'snapshot_only' is GNUNET_YES |
124 | */ | 128 | */ |
125 | void GST_validation_get_addresses (const struct GNUNET_PeerIdentity *target, | 129 | void |
126 | GST_ValidationAddressCallback cb, | 130 | GST_validation_get_addresses (const struct GNUNET_PeerIdentity *target, |
127 | void *cb_cls); | 131 | GST_ValidationAddressCallback cb, void *cb_cls); |
128 | 132 | ||
129 | 133 | ||
130 | #endif | 134 | #endif |
diff --git a/src/transport/gnunet-transport-wlan-helper.c b/src/transport/gnunet-transport-wlan-helper.c index b3468791d..3fca1f85f 100644 --- a/src/transport/gnunet-transport-wlan-helper.c +++ b/src/transport/gnunet-transport-wlan-helper.c | |||
@@ -108,7 +108,8 @@ struct Hardware_Infos | |||
108 | }; | 108 | }; |
109 | 109 | ||
110 | // FIXME: inline? | 110 | // FIXME: inline? |
111 | int getChannelFromFrequency (int frequency); | 111 | int |
112 | getChannelFromFrequency (int frequency); | ||
112 | 113 | ||
113 | // FIXME: make nice... | 114 | // FIXME: make nice... |
114 | static unsigned long | 115 | static unsigned long |
diff --git a/src/transport/plugin_transport_http.c b/src/transport/plugin_transport_http.c index a6b24e73e..5c11f1f32 100644 --- a/src/transport/plugin_transport_http.c +++ b/src/transport/plugin_transport_http.c | |||
@@ -547,24 +547,24 @@ struct PrettyPrinterContext | |||
547 | * @param addrlen length of the address | 547 | * @param addrlen length of the address |
548 | * @return string representing the same address | 548 | * @return string representing the same address |
549 | */ | 549 | */ |
550 | static const char *http_plugin_address_to_string (void *cls, const void *addr, | 550 | static const char * |
551 | size_t addrlen); | 551 | http_plugin_address_to_string (void *cls, const void *addr, size_t addrlen); |
552 | 552 | ||
553 | 553 | ||
554 | /** | 554 | /** |
555 | * Call MHD to process pending ipv4 requests and then go back | 555 | * Call MHD to process pending ipv4 requests and then go back |
556 | * and schedule the next run. | 556 | * and schedule the next run. |
557 | */ | 557 | */ |
558 | static void http_server_daemon_v4_run (void *cls, | 558 | static void |
559 | const struct GNUNET_SCHEDULER_TaskContext | 559 | http_server_daemon_v4_run (void *cls, |
560 | *tc); | 560 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
561 | /** | 561 | /** |
562 | * Call MHD to process pending ipv6 requests and then go back | 562 | * Call MHD to process pending ipv6 requests and then go back |
563 | * and schedule the next run. | 563 | * and schedule the next run. |
564 | */ | 564 | */ |
565 | static void http_server_daemon_v6_run (void *cls, | 565 | static void |
566 | const struct GNUNET_SCHEDULER_TaskContext | 566 | http_server_daemon_v6_run (void *cls, |
567 | *tc); | 567 | const struct GNUNET_SCHEDULER_TaskContext *tc); |
568 | 568 | ||
569 | /** | 569 | /** |
570 | * Function setting up curl handle and selecting message to send | 570 | * Function setting up curl handle and selecting message to send |
@@ -573,7 +573,8 @@ static void http_server_daemon_v6_run (void *cls, | |||
573 | * @param ps session | 573 | * @param ps session |
574 | * @return GNUNET_SYSERR on failure, GNUNET_NO if connecting, GNUNET_YES if ok | 574 | * @return GNUNET_SYSERR on failure, GNUNET_NO if connecting, GNUNET_YES if ok |
575 | */ | 575 | */ |
576 | static int send_check_connections (struct Plugin *plugin, struct Session *ps); | 576 | static int |
577 | send_check_connections (struct Plugin *plugin, struct Session *ps); | ||
577 | 578 | ||
578 | /** | 579 | /** |
579 | * Function setting up file descriptors and scheduling task to run | 580 | * Function setting up file descriptors and scheduling task to run |
@@ -581,7 +582,8 @@ static int send_check_connections (struct Plugin *plugin, struct Session *ps); | |||
581 | * @param plugin plugin as closure | 582 | * @param plugin plugin as closure |
582 | * @return GNUNET_SYSERR for hard failure, GNUNET_OK for ok | 583 | * @return GNUNET_SYSERR for hard failure, GNUNET_OK for ok |
583 | */ | 584 | */ |
584 | static int curl_schedule (struct Plugin *plugin); | 585 | static int |
586 | curl_schedule (struct Plugin *plugin); | ||
585 | 587 | ||
586 | /** | 588 | /** |
587 | * Task scheduled to reset the inbound quota delay for a specific peer | 589 | * Task scheduled to reset the inbound quota delay for a specific peer |
@@ -1785,10 +1787,8 @@ curl_receive_mst_cb (void *cls, void *client, | |||
1785 | "Connection %X: Forwarding message to transport service, type %u and size %u from `%s' (`%s')\n", | 1787 | "Connection %X: Forwarding message to transport service, type %u and size %u from `%s' (`%s')\n", |
1786 | ps, ntohs (message->type), ntohs (message->size), | 1788 | ps, ntohs (message->type), ntohs (message->size), |
1787 | GNUNET_i2s (&(pc->identity)), http_plugin_address_to_string (NULL, | 1789 | GNUNET_i2s (&(pc->identity)), http_plugin_address_to_string (NULL, |
1788 | ps-> | 1790 | ps->addr, |
1789 | addr, | 1791 | ps->addrlen)); |
1790 | ps-> | ||
1791 | addrlen)); | ||
1792 | #endif | 1792 | #endif |
1793 | struct GNUNET_TRANSPORT_ATS_Information distance[2]; | 1793 | struct GNUNET_TRANSPORT_ATS_Information distance[2]; |
1794 | 1794 | ||
@@ -3333,8 +3333,7 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls) | |||
3333 | GNUNET_CONFIGURATION_get_value_string (env->cfg, | 3333 | GNUNET_CONFIGURATION_get_value_string (env->cfg, |
3334 | component_name, | 3334 | component_name, |
3335 | "BINDTO4", | 3335 | "BINDTO4", |
3336 | &plugin-> | 3336 | &plugin->bind_hostname)); |
3337 | bind_hostname)); | ||
3338 | plugin->bind4_address = GNUNET_malloc (sizeof (struct sockaddr_in)); | 3337 | plugin->bind4_address = GNUNET_malloc (sizeof (struct sockaddr_in)); |
3339 | plugin->bind4_address->sin_family = AF_INET; | 3338 | plugin->bind4_address->sin_family = AF_INET; |
3340 | plugin->bind4_address->sin_port = htons (port); | 3339 | plugin->bind4_address->sin_port = htons (port); |
@@ -3494,8 +3493,8 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls) | |||
3494 | MHD_OPTION_SOCK_ADDR, | 3493 | MHD_OPTION_SOCK_ADDR, |
3495 | tmp, | 3494 | tmp, |
3496 | MHD_OPTION_CONNECTION_LIMIT, | 3495 | MHD_OPTION_CONNECTION_LIMIT, |
3497 | (unsigned int) plugin-> | 3496 | (unsigned int) |
3498 | max_connect_per_transport, | 3497 | plugin->max_connect_per_transport, |
3499 | #if BUILD_HTTPS | 3498 | #if BUILD_HTTPS |
3500 | MHD_OPTION_HTTPS_PRIORITIES, | 3499 | MHD_OPTION_HTTPS_PRIORITIES, |
3501 | plugin->crypto_init, | 3500 | plugin->crypto_init, |
@@ -3534,8 +3533,8 @@ LIBGNUNET_PLUGIN_TRANSPORT_INIT (void *cls) | |||
3534 | (struct sockaddr_in *) | 3533 | (struct sockaddr_in *) |
3535 | plugin->bind4_address, | 3534 | plugin->bind4_address, |
3536 | MHD_OPTION_CONNECTION_LIMIT, | 3535 | MHD_OPTION_CONNECTION_LIMIT, |
3537 | (unsigned int) plugin-> | 3536 | (unsigned int) |
3538 | max_connect_per_transport, | 3537 | plugin->max_connect_per_transport, |
3539 | #if BUILD_HTTPS | 3538 | #if BUILD_HTTPS |
3540 | MHD_OPTION_HTTPS_PRIORITIES, | 3539 | MHD_OPTION_HTTPS_PRIORITIES, |
3541 | plugin->crypto_init, | 3540 | plugin->crypto_init, |
diff --git a/src/transport/plugin_transport_smtp.c b/src/transport/plugin_transport_smtp.c index 1b9f5fb72..260045602 100644 --- a/src/transport/plugin_transport_smtp.c +++ b/src/transport/plugin_transport_smtp.c | |||
@@ -420,9 +420,8 @@ api_verify_hello (const GNUNET_MessageHello * hello) | |||
420 | maddr = (const EmailAddress *) &hello[1]; | 420 | maddr = (const EmailAddress *) &hello[1]; |
421 | if ((ntohs (hello->header.size) != | 421 | if ((ntohs (hello->header.size) != |
422 | sizeof (GNUNET_MessageHello) + ntohs (hello->senderAddressSize)) || | 422 | sizeof (GNUNET_MessageHello) + ntohs (hello->senderAddressSize)) || |
423 | (maddr-> | 423 | (maddr->senderAddress |
424 | senderAddress[ntohs (hello->senderAddressSize) - 1 - | 424 | [ntohs (hello->senderAddressSize) - 1 - FILTER_STRING_SIZE] != '\0')) |
425 | FILTER_STRING_SIZE] != '\0')) | ||
426 | { | 425 | { |
427 | GNUNET_GE_BREAK (ectx, 0); | 426 | GNUNET_GE_BREAK (ectx, 0); |
428 | return GNUNET_SYSERR; /* obviously invalid */ | 427 | return GNUNET_SYSERR; /* obviously invalid */ |
diff --git a/src/transport/plugin_transport_tcp.c b/src/transport/plugin_transport_tcp.c index 331203471..d6084d9f0 100644 --- a/src/transport/plugin_transport_tcp.c +++ b/src/transport/plugin_transport_tcp.c | |||
@@ -605,7 +605,8 @@ create_session (struct Plugin *plugin, const struct GNUNET_PeerIdentity *target, | |||
605 | * | 605 | * |
606 | * @param session for which session should we do this | 606 | * @param session for which session should we do this |
607 | */ | 607 | */ |
608 | static void process_pending_messages (struct Session *session); | 608 | static void |
609 | process_pending_messages (struct Session *session); | ||
609 | 610 | ||
610 | 611 | ||
611 | /** | 612 | /** |
@@ -779,8 +780,8 @@ disconnect_session (struct Session *session) | |||
779 | (session->connect_addr != | 780 | (session->connect_addr != |
780 | NULL) ? tcp_address_to_string (session->plugin, | 781 | NULL) ? tcp_address_to_string (session->plugin, |
781 | session->connect_addr, | 782 | session->connect_addr, |
782 | session-> | 783 | session->connect_alen) : |
783 | connect_alen) : "*"); | 784 | "*"); |
784 | #endif | 785 | #endif |
785 | /* remove from session list */ | 786 | /* remove from session list */ |
786 | prev = NULL; | 787 | prev = NULL; |
@@ -1455,8 +1456,8 @@ handle_tcp_nat_probe (void *cls, struct GNUNET_SERVER_Client *client, | |||
1455 | 1456 | ||
1456 | session = | 1457 | session = |
1457 | GNUNET_CONTAINER_multihashmap_get (plugin->nat_wait_conns, | 1458 | GNUNET_CONTAINER_multihashmap_get (plugin->nat_wait_conns, |
1458 | &tcp_nat_probe->clientIdentity. | 1459 | &tcp_nat_probe-> |
1459 | hashPubKey); | 1460 | clientIdentity.hashPubKey); |
1460 | if (session == NULL) | 1461 | if (session == NULL) |
1461 | { | 1462 | { |
1462 | #if DEBUG_TCP_NAT | 1463 | #if DEBUG_TCP_NAT |
@@ -1775,8 +1776,8 @@ disconnect_notify (void *cls, struct GNUNET_SERVER_Client *client) | |||
1775 | (session->connect_addr != | 1776 | (session->connect_addr != |
1776 | NULL) ? tcp_address_to_string (session->plugin, | 1777 | NULL) ? tcp_address_to_string (session->plugin, |
1777 | session->connect_addr, | 1778 | session->connect_addr, |
1778 | session-> | 1779 | session->connect_alen) : |
1779 | connect_alen) : "*"); | 1780 | "*"); |
1780 | #endif | 1781 | #endif |
1781 | GNUNET_STATISTICS_update (session->plugin->env->stats, | 1782 | GNUNET_STATISTICS_update (session->plugin->env->stats, |
1782 | gettext_noop | 1783 | gettext_noop |
@@ -1863,8 +1864,8 @@ try_connection_reversal (void *cls, const struct sockaddr *addr, | |||
1863 | tcp_probe_ctx); | 1864 | tcp_probe_ctx); |
1864 | tcp_probe_ctx->transmit_handle = | 1865 | tcp_probe_ctx->transmit_handle = |
1865 | GNUNET_CONNECTION_notify_transmit_ready (sock, | 1866 | GNUNET_CONNECTION_notify_transmit_ready (sock, |
1866 | ntohs (tcp_probe_ctx->message. | 1867 | ntohs (tcp_probe_ctx-> |
1867 | header.size), | 1868 | message.header.size), |
1868 | GNUNET_TIME_UNIT_FOREVER_REL, | 1869 | GNUNET_TIME_UNIT_FOREVER_REL, |
1869 | ¬ify_send_probe, | 1870 | ¬ify_send_probe, |
1870 | tcp_probe_ctx); | 1871 | tcp_probe_ctx); |
diff --git a/src/transport/plugin_transport_udp.c b/src/transport/plugin_transport_udp.c index f9310fb8f..07a3df362 100644 --- a/src/transport/plugin_transport_udp.c +++ b/src/transport/plugin_transport_udp.c | |||
@@ -852,8 +852,8 @@ udp_read (struct Plugin *plugin, struct GNUNET_NETWORK_Handle *rsock) | |||
852 | return; | 852 | return; |
853 | GNUNET_assert (GNUNET_OK == | 853 | GNUNET_assert (GNUNET_OK == |
854 | GNUNET_CONTAINER_multihashmap_remove (plugin->sessions, | 854 | GNUNET_CONTAINER_multihashmap_remove (plugin->sessions, |
855 | &udp->sender. | 855 | &udp-> |
856 | hashPubKey, | 856 | sender.hashPubKey, |
857 | peer_session)); | 857 | peer_session)); |
858 | plugin->last_expected_delay = | 858 | plugin->last_expected_delay = |
859 | GNUNET_FRAGMENT_context_destroy (peer_session->frag); | 859 | GNUNET_FRAGMENT_context_destroy (peer_session->frag); |
@@ -882,8 +882,8 @@ udp_read (struct Plugin *plugin, struct GNUNET_NETWORK_Handle *rsock) | |||
882 | &fragment_msg_proc, &ack_proc); | 882 | &fragment_msg_proc, &ack_proc); |
883 | rc->hnode = | 883 | rc->hnode = |
884 | GNUNET_CONTAINER_heap_insert (plugin->defrags, rc, | 884 | GNUNET_CONTAINER_heap_insert (plugin->defrags, rc, |
885 | (GNUNET_CONTAINER_HeapCostType) now. | 885 | (GNUNET_CONTAINER_HeapCostType) |
886 | abs_value); | 886 | now.abs_value); |
887 | } | 887 | } |
888 | #if DEBUG_UDP | 888 | #if DEBUG_UDP |
889 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 889 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
@@ -896,8 +896,8 @@ udp_read (struct Plugin *plugin, struct GNUNET_NETWORK_Handle *rsock) | |||
896 | { | 896 | { |
897 | /* keep this 'rc' from expiring */ | 897 | /* keep this 'rc' from expiring */ |
898 | GNUNET_CONTAINER_heap_update_cost (plugin->defrags, rc->hnode, | 898 | GNUNET_CONTAINER_heap_update_cost (plugin->defrags, rc->hnode, |
899 | (GNUNET_CONTAINER_HeapCostType) now. | 899 | (GNUNET_CONTAINER_HeapCostType) |
900 | abs_value); | 900 | now.abs_value); |
901 | } | 901 | } |
902 | if (GNUNET_CONTAINER_heap_get_size (plugin->defrags) > | 902 | if (GNUNET_CONTAINER_heap_get_size (plugin->defrags) > |
903 | UDP_MAX_SENDER_ADDRESSES_WITH_DEFRAG) | 903 | UDP_MAX_SENDER_ADDRESSES_WITH_DEFRAG) |
diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c index 7193e2e8b..59c42e1f6 100644 --- a/src/transport/plugin_transport_unix.c +++ b/src/transport/plugin_transport_unix.c | |||
@@ -419,16 +419,14 @@ find_session (struct Plugin *plugin, const struct GNUNET_PeerIdentity *peer) | |||
419 | } | 419 | } |
420 | 420 | ||
421 | /* Forward Declaration */ | 421 | /* Forward Declaration */ |
422 | static ssize_t unix_real_send (void *cls, | 422 | static ssize_t |
423 | struct RetrySendContext *incoming_retry_context, | 423 | unix_real_send (void *cls, struct RetrySendContext *incoming_retry_context, |
424 | struct GNUNET_NETWORK_Handle *send_handle, | 424 | struct GNUNET_NETWORK_Handle *send_handle, |
425 | const struct GNUNET_PeerIdentity *target, | 425 | const struct GNUNET_PeerIdentity *target, const char *msgbuf, |
426 | const char *msgbuf, size_t msgbuf_size, | 426 | size_t msgbuf_size, unsigned int priority, |
427 | unsigned int priority, | 427 | struct GNUNET_TIME_Relative timeout, const void *addr, |
428 | struct GNUNET_TIME_Relative timeout, | 428 | size_t addrlen, GNUNET_TRANSPORT_TransmitContinuation cont, |
429 | const void *addr, size_t addrlen, | 429 | void *cont_cls); |
430 | GNUNET_TRANSPORT_TransmitContinuation cont, | ||
431 | void *cont_cls); | ||
432 | 430 | ||
433 | /** | 431 | /** |
434 | * Retry sending a message. | 432 | * Retry sending a message. |
diff --git a/src/transport/plugin_transport_wlan.c b/src/transport/plugin_transport_wlan.c index ad8d9a7a1..d3bd1ef82 100644 --- a/src/transport/plugin_transport_wlan.c +++ b/src/transport/plugin_transport_wlan.c | |||
@@ -662,12 +662,13 @@ struct FragmentMessage | |||
662 | struct Radiotap_Send *radioHeader; | 662 | struct Radiotap_Send *radioHeader; |
663 | }; | 663 | }; |
664 | 664 | ||
665 | static void do_transmit (void *cls, | 665 | static void |
666 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 666 | do_transmit (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
667 | static void free_session (struct Plugin *plugin, struct Sessionqueue *queue, | 667 | static void |
668 | int do_free_macendpoint); | 668 | free_session (struct Plugin *plugin, struct Sessionqueue *queue, |
669 | static struct MacEndpoint *create_macendpoint (struct Plugin *plugin, | 669 | int do_free_macendpoint); |
670 | const struct MacAddress *addr); | 670 | static struct MacEndpoint * |
671 | create_macendpoint (struct Plugin *plugin, const struct MacAddress *addr); | ||
671 | 672 | ||
672 | /** | 673 | /** |
673 | * Generates a nice hexdump of a memory area. | 674 | * Generates a nice hexdump of a memory area. |
@@ -1860,8 +1861,9 @@ wlan_plugin_send (void *cls, const struct GNUNET_PeerIdentity *target, | |||
1860 | newmsg = session->pending_message_head; | 1861 | newmsg = session->pending_message_head; |
1861 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, PLUGIN_LOG_NAME, | 1862 | GNUNET_log_from (GNUNET_ERROR_TYPE_ERROR, PLUGIN_LOG_NAME, |
1862 | "wlan_plugin_send: a pending message is already in the queue for this client\n remaining time to send this message is %u, queued fragment messages for this mac connection %u\n", | 1863 | "wlan_plugin_send: a pending message is already in the queue for this client\n remaining time to send this message is %u, queued fragment messages for this mac connection %u\n", |
1863 | GNUNET_TIME_absolute_get_remaining (newmsg->timeout). | 1864 | GNUNET_TIME_absolute_get_remaining (newmsg-> |
1864 | rel_value, session->mac->fragment_messages_out_count); | 1865 | timeout).rel_value, |
1866 | session->mac->fragment_messages_out_count); | ||
1865 | } | 1867 | } |
1866 | 1868 | ||
1867 | newmsg = GNUNET_malloc (sizeof (struct PendingMessage)); | 1869 | newmsg = GNUNET_malloc (sizeof (struct PendingMessage)); |
@@ -2263,8 +2265,8 @@ process_data (void *cls, void *client, const struct GNUNET_MessageHeader *hdr) | |||
2263 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME, | 2265 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME, |
2264 | "Calling plugin->env->receive for session %p; %s; size: %u\n", | 2266 | "Calling plugin->env->receive for session %p; %s; size: %u\n", |
2265 | session, wlan_plugin_address_to_string (NULL, | 2267 | session, wlan_plugin_address_to_string (NULL, |
2266 | session->mac->addr. | 2268 | session->mac-> |
2267 | mac, 6), | 2269 | addr.mac, 6), |
2268 | htons (hdr->size)); | 2270 | htons (hdr->size)); |
2269 | #endif | 2271 | #endif |
2270 | 2272 | ||
@@ -2303,9 +2305,8 @@ wlan_data_helper (void *cls, struct Session_light *session_light, | |||
2303 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME, | 2305 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME, |
2304 | "Func wlan_data_helper got GNUNET_MESSAGE_TYPE_WLAN_ADVERTISEMENT size: %u; %s\n", | 2306 | "Func wlan_data_helper got GNUNET_MESSAGE_TYPE_WLAN_ADVERTISEMENT size: %u; %s\n", |
2305 | ntohs (hdr->size), wlan_plugin_address_to_string (NULL, | 2307 | ntohs (hdr->size), wlan_plugin_address_to_string (NULL, |
2306 | session_light-> | 2308 | session_light->addr. |
2307 | addr.mac, | 2309 | mac, 6)); |
2308 | 6)); | ||
2309 | #endif | 2310 | #endif |
2310 | 2311 | ||
2311 | if (session_light->macendpoint == NULL) | 2312 | if (session_light->macendpoint == NULL) |
@@ -2373,9 +2374,7 @@ wlan_data_helper (void *cls, struct Session_light *session_light, | |||
2373 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME, | 2374 | GNUNET_log_from (GNUNET_ERROR_TYPE_DEBUG, PLUGIN_LOG_NAME, |
2374 | "Macendpoint does not exist for this GNUNET_MESSAGE_TYPE_FRAGMENT_ACK size: %u; %s\n", | 2375 | "Macendpoint does not exist for this GNUNET_MESSAGE_TYPE_FRAGMENT_ACK size: %u; %s\n", |
2375 | ntohs (hdr->size), wlan_plugin_address_to_string (NULL, | 2376 | ntohs (hdr->size), wlan_plugin_address_to_string (NULL, |
2376 | session_light-> | 2377 | session_light->addr.mac, |
2377 | addr. | ||
2378 | mac, | ||
2379 | 6)); | 2378 | 6)); |
2380 | #endif | 2379 | #endif |
2381 | return; | 2380 | return; |
@@ -2477,8 +2476,8 @@ macendpoint_timeout (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
2477 | return; | 2476 | return; |
2478 | } | 2477 | } |
2479 | if (GNUNET_TIME_absolute_get_remaining | 2478 | if (GNUNET_TIME_absolute_get_remaining |
2480 | (GNUNET_TIME_absolute_add (endpoint->last_activity, MACENDPOINT_TIMEOUT)). | 2479 | (GNUNET_TIME_absolute_add |
2481 | rel_value == 0) | 2480 | (endpoint->last_activity, MACENDPOINT_TIMEOUT)).rel_value == 0) |
2482 | { | 2481 | { |
2483 | free_macendpoint (endpoint->plugin, endpoint); | 2482 | free_macendpoint (endpoint->plugin, endpoint); |
2484 | } | 2483 | } |
diff --git a/src/transport/test_plugin_transport_http.c b/src/transport/test_plugin_transport_http.c index f59edfb26..778fe4be3 100644 --- a/src/transport/test_plugin_transport_http.c +++ b/src/transport/test_plugin_transport_http.c | |||
@@ -522,7 +522,8 @@ task_send_cont (void *cls, const struct GNUNET_PeerIdentity *target, int result) | |||
522 | } | 522 | } |
523 | 523 | ||
524 | 524 | ||
525 | static void run_connection_tests (int phase, void *cls); | 525 | static void |
526 | run_connection_tests (int phase, void *cls); | ||
526 | 527 | ||
527 | /** | 528 | /** |
528 | * Recieves messages from plugin, in real world transport | 529 | * Recieves messages from plugin, in real world transport |
@@ -646,7 +647,8 @@ header_function (void *ptr, size_t size, size_t nmemb, void *stream) | |||
646 | } | 647 | } |
647 | 648 | ||
648 | 649 | ||
649 | static size_t send_prepare (struct HTTP_Transfer *result); | 650 | static size_t |
651 | send_prepare (struct HTTP_Transfer *result); | ||
650 | 652 | ||
651 | 653 | ||
652 | static void | 654 | static void |
diff --git a/src/transport/test_plugin_transport_https.c b/src/transport/test_plugin_transport_https.c index 5b78f89b4..962010c42 100644 --- a/src/transport/test_plugin_transport_https.c +++ b/src/transport/test_plugin_transport_https.c | |||
@@ -551,7 +551,8 @@ task_send_cont (void *cls, const struct GNUNET_PeerIdentity *target, int result) | |||
551 | } | 551 | } |
552 | 552 | ||
553 | 553 | ||
554 | static void run_connection_tests (int phase, void *cls); | 554 | static void |
555 | run_connection_tests (int phase, void *cls); | ||
555 | 556 | ||
556 | /** | 557 | /** |
557 | * Recieves messages from plugin, in real world transport | 558 | * Recieves messages from plugin, in real world transport |
@@ -679,7 +680,8 @@ header_function (void *ptr, size_t size, size_t nmemb, void *stream) | |||
679 | return size * nmemb; | 680 | return size * nmemb; |
680 | } | 681 | } |
681 | 682 | ||
682 | static size_t send_prepare (struct HTTP_Transfer *result); | 683 | static size_t |
684 | send_prepare (struct HTTP_Transfer *result); | ||
683 | 685 | ||
684 | 686 | ||
685 | 687 | ||
diff --git a/src/transport/test_quota_compliance.c b/src/transport/test_quota_compliance.c index bc2aca31b..71332bf36 100644 --- a/src/transport/test_quota_compliance.c +++ b/src/transport/test_quota_compliance.c | |||
@@ -315,7 +315,8 @@ notify_ready (void *cls, size_t size, void *buf) | |||
315 | } | 315 | } |
316 | 316 | ||
317 | 317 | ||
318 | static void measure (unsigned long long quota_p1, unsigned long long quota_p2); | 318 | static void |
319 | measure (unsigned long long quota_p1, unsigned long long quota_p2); | ||
319 | 320 | ||
320 | static void | 321 | static void |
321 | measurement_counter (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 322 | measurement_counter (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
diff --git a/src/transport/test_transport_api_disconnect.c b/src/transport/test_transport_api_disconnect.c index daae553b7..a9cf0b4de 100644 --- a/src/transport/test_transport_api_disconnect.c +++ b/src/transport/test_transport_api_disconnect.c | |||
@@ -80,7 +80,8 @@ struct GNUNET_TRANSPORT_TransmitHandle *th; | |||
80 | #endif | 80 | #endif |
81 | 81 | ||
82 | 82 | ||
83 | static void peers_connect (); | 83 | static void |
84 | peers_connect (); | ||
84 | 85 | ||
85 | static void | 86 | static void |
86 | end () | 87 | end () |
@@ -200,8 +201,8 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer, | |||
200 | msgs_recv++; | 201 | msgs_recv++; |
201 | } | 202 | } |
202 | 203 | ||
203 | static void peers_disconnect (void *cls, | 204 | static void |
204 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 205 | peers_disconnect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
205 | 206 | ||
206 | static size_t | 207 | static size_t |
207 | notify_ready (void *cls, size_t size, void *buf) | 208 | notify_ready (void *cls, size_t size, void *buf) |
diff --git a/src/transport/transport-testing.c b/src/transport/transport-testing.c index 62544584c..0c628a731 100644 --- a/src/transport/transport-testing.c +++ b/src/transport/transport-testing.c | |||
@@ -41,10 +41,10 @@ struct ConnectingContext | |||
41 | int p2_c; | 41 | int p2_c; |
42 | }; | 42 | }; |
43 | 43 | ||
44 | static void exchange_hello_last (void *cb_cls, | 44 | static void |
45 | const struct GNUNET_MessageHeader *message); | 45 | exchange_hello_last (void *cb_cls, const struct GNUNET_MessageHeader *message); |
46 | static void exchange_hello (void *cb_cls, | 46 | static void |
47 | const struct GNUNET_MessageHeader *message); | 47 | exchange_hello (void *cb_cls, const struct GNUNET_MessageHeader *message); |
48 | 48 | ||
49 | static void | 49 | static void |
50 | notify_connect_internal (void *cls, const struct GNUNET_PeerIdentity *peer, | 50 | notify_connect_internal (void *cls, const struct GNUNET_PeerIdentity *peer, |
diff --git a/src/transport/transport-testing.h b/src/transport/transport-testing.h index a21ccc11f..d5a75d143 100644 --- a/src/transport/transport-testing.h +++ b/src/transport/transport-testing.h | |||
@@ -76,13 +76,12 @@ typedef void (*GNUNET_TRANSPORT_TESTING_connect_cb) (struct PeerContext * p1, | |||
76 | * if NULL passed the PeerContext * will be used! | 76 | * if NULL passed the PeerContext * will be used! |
77 | * @return the peer context | 77 | * @return the peer context |
78 | */ | 78 | */ |
79 | struct PeerContext *GNUNET_TRANSPORT_TESTING_start_peer (const char *cfgname, | 79 | struct PeerContext * |
80 | GNUNET_TRANSPORT_ReceiveCallback | 80 | GNUNET_TRANSPORT_TESTING_start_peer (const char *cfgname, |
81 | rec, | 81 | GNUNET_TRANSPORT_ReceiveCallback rec, |
82 | GNUNET_TRANSPORT_NotifyConnect | 82 | GNUNET_TRANSPORT_NotifyConnect nc, |
83 | nc, | 83 | GNUNET_TRANSPORT_NotifyDisconnect nd, |
84 | GNUNET_TRANSPORT_NotifyDisconnect | 84 | void *cb_cls); |
85 | nd, void *cb_cls); | ||
86 | 85 | ||
87 | 86 | ||
88 | /** | 87 | /** |
@@ -90,7 +89,8 @@ struct PeerContext *GNUNET_TRANSPORT_TESTING_start_peer (const char *cfgname, | |||
90 | * @param p the peer | 89 | * @param p the peer |
91 | */ | 90 | */ |
92 | 91 | ||
93 | void GNUNET_TRANSPORT_TESTING_stop_peer (struct PeerContext *pc); | 92 | void |
93 | GNUNET_TRANSPORT_TESTING_stop_peer (struct PeerContext *pc); | ||
94 | 94 | ||
95 | 95 | ||
96 | /** | 96 | /** |
@@ -102,9 +102,10 @@ void GNUNET_TRANSPORT_TESTING_stop_peer (struct PeerContext *pc); | |||
102 | * @param cb the callback to call | 102 | * @param cb the callback to call |
103 | * @param cb_cls callback cls | 103 | * @param cb_cls callback cls |
104 | */ | 104 | */ |
105 | void GNUNET_TRANSPORT_TESTING_connect_peers (struct PeerContext *p1, | 105 | void |
106 | struct PeerContext *p2, | 106 | GNUNET_TRANSPORT_TESTING_connect_peers (struct PeerContext *p1, |
107 | GNUNET_TRANSPORT_TESTING_connect_cb | 107 | struct PeerContext *p2, |
108 | cb, void *cls); | 108 | GNUNET_TRANSPORT_TESTING_connect_cb cb, |
109 | void *cls); | ||
109 | 110 | ||
110 | /* end of transport_testing.h */ | 111 | /* end of transport_testing.h */ |
diff --git a/src/transport/transport_api.c b/src/transport/transport_api.c index b732871ca..fed611e49 100644 --- a/src/transport/transport_api.c +++ b/src/transport/transport_api.c | |||
@@ -295,7 +295,8 @@ struct GNUNET_TRANSPORT_Handle | |||
295 | * | 295 | * |
296 | * @param h transport service to schedule a transmission for | 296 | * @param h transport service to schedule a transmission for |
297 | */ | 297 | */ |
298 | static void schedule_transmission (struct GNUNET_TRANSPORT_Handle *h); | 298 | static void |
299 | schedule_transmission (struct GNUNET_TRANSPORT_Handle *h); | ||
299 | 300 | ||
300 | 301 | ||
301 | /** | 302 | /** |
@@ -304,8 +305,8 @@ static void schedule_transmission (struct GNUNET_TRANSPORT_Handle *h); | |||
304 | * | 305 | * |
305 | * @param h transport service to reconnect | 306 | * @param h transport service to reconnect |
306 | */ | 307 | */ |
307 | static void disconnect_and_schedule_reconnect (struct GNUNET_TRANSPORT_Handle | 308 | static void |
308 | *h); | 309 | disconnect_and_schedule_reconnect (struct GNUNET_TRANSPORT_Handle *h); |
309 | 310 | ||
310 | 311 | ||
311 | /** | 312 | /** |
@@ -659,8 +660,8 @@ transport_notify_ready (void *cls, size_t size, void *buf) | |||
659 | th = n->th; | 660 | th = n->th; |
660 | if (th->notify_size + sizeof (struct OutboundMessage) > size) | 661 | if (th->notify_size + sizeof (struct OutboundMessage) > size) |
661 | break; /* does not fit */ | 662 | break; /* does not fit */ |
662 | if (GNUNET_BANDWIDTH_tracker_get_delay (&n->out_tracker, th->notify_size). | 663 | if (GNUNET_BANDWIDTH_tracker_get_delay |
663 | rel_value > 0) | 664 | (&n->out_tracker, th->notify_size).rel_value > 0) |
664 | break; /* too early */ | 665 | break; /* too early */ |
665 | GNUNET_assert (n == GNUNET_CONTAINER_heap_remove_root (h->ready_heap)); | 666 | GNUNET_assert (n == GNUNET_CONTAINER_heap_remove_root (h->ready_heap)); |
666 | n->hn = NULL; | 667 | n->hn = NULL; |
diff --git a/src/transport/transport_api_blacklist.c b/src/transport/transport_api_blacklist.c index f6852ff01..d6387b144 100644 --- a/src/transport/transport_api_blacklist.c +++ b/src/transport/transport_api_blacklist.c | |||
@@ -78,7 +78,8 @@ struct GNUNET_TRANSPORT_Blacklist | |||
78 | * | 78 | * |
79 | * @param br overall handle | 79 | * @param br overall handle |
80 | */ | 80 | */ |
81 | static void reconnect (struct GNUNET_TRANSPORT_Blacklist *br); | 81 | static void |
82 | reconnect (struct GNUNET_TRANSPORT_Blacklist *br); | ||
82 | 83 | ||
83 | 84 | ||
84 | /** | 85 | /** |
@@ -86,7 +87,8 @@ static void reconnect (struct GNUNET_TRANSPORT_Blacklist *br); | |||
86 | * | 87 | * |
87 | * @param br our overall context | 88 | * @param br our overall context |
88 | */ | 89 | */ |
89 | static void reply (struct GNUNET_TRANSPORT_Blacklist *br); | 90 | static void |
91 | reply (struct GNUNET_TRANSPORT_Blacklist *br); | ||
90 | 92 | ||
91 | 93 | ||
92 | /** | 94 | /** |
diff --git a/src/transport/wlan/byteorder.h b/src/transport/wlan/byteorder.h index b09328320..9fc58c8d8 100644 --- a/src/transport/wlan/byteorder.h +++ b/src/transport/wlan/byteorder.h | |||
@@ -1,37 +1,37 @@ | |||
1 | /* | 1 | /* |
2 | * Compatibility header | 2 | * Compatibility header |
3 | * | 3 | * |
4 | * Copyright (C) 2009 Thomas d'Otreppe | 4 | * Copyright (C) 2009 Thomas d'Otreppe |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by | 7 | * it under the terms of the GNU General Public License as published by |
8 | * the Free Software Foundation; either version 2 of the License, or | 8 | * the Free Software Foundation; either version 2 of the License, or |
9 | * (at your option) any later version. | 9 | * (at your option) any later version. |
10 | * | 10 | * |
11 | * This program is distributed in the hope that it will be useful, | 11 | * This program is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | * GNU General Public License for more details. | 14 | * GNU General Public License for more details. |
15 | * | 15 | * |
16 | * You should have received a copy of the GNU General Public License | 16 | * You should have received a copy of the GNU General Public License |
17 | * along with this program; if not, write to the Free Software | 17 | * along with this program; if not, write to the Free Software |
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 | */ | 19 | */ |
20 | 20 | ||
21 | #ifndef _AIRCRACK_NG_BYTEORDER_H_ | 21 | #ifndef _AIRCRACK_NG_BYTEORDER_H_ |
22 | #define _AIRCRACK_NG_BYTEORDER_H_ | 22 | #define _AIRCRACK_NG_BYTEORDER_H_ |
23 | 23 | ||
24 | #define ___my_swab16(x) \ | 24 | #define ___my_swab16(x) \ |
25 | ((u_int16_t) | 25 | ((u_int16_t) |
26 | (\ (((u_int16_t) (x) & (u_int16_t) 0x00ffU) << 8) | | 26 | (\ (((u_int16_t) (x) & (u_int16_t) 0x00ffU) << 8) | |
27 | \ (((u_int16_t) (x) & (u_int16_t) 0xff00U) >> 8))) | 27 | \ (((u_int16_t) (x) & (u_int16_t) 0xff00U) >> 8))) |
28 | #define ___my_swab32(x) \ | 28 | #define ___my_swab32(x) \ |
29 | ((u_int32_t) | 29 | ((u_int32_t) |
30 | (\ (((u_int32_t) (x) & (u_int32_t) 0x000000ffUL) << 24) | | 30 | (\ (((u_int32_t) (x) & (u_int32_t) 0x000000ffUL) << 24) | |
31 | \ (((u_int32_t) (x) & (u_int32_t) 0x0000ff00UL) << 8) | | 31 | \ (((u_int32_t) (x) & (u_int32_t) 0x0000ff00UL) << 8) | |
32 | \ (((u_int32_t) (x) & (u_int32_t) 0x00ff0000UL) >> 8) | | 32 | \ (((u_int32_t) (x) & (u_int32_t) 0x00ff0000UL) >> 8) | |
33 | \ (((u_int32_t) (x) & (u_int32_t) 0xff000000UL) >> 24))) | 33 | \ (((u_int32_t) (x) & (u_int32_t) 0xff000000UL) >> 24))) |
34 | #define ___my_swab64(x) \ | 34 | #define ___my_swab64(x) \ |
35 | ((u_int64_t) | 35 | ((u_int64_t) |
36 | (\ (u_int64_t) | 36 | (\ (u_int64_t) |
37 | (((u_int64_t) (x) & (u_int64_t) 0x00000000000000ffULL) << 56) | | 37 | (((u_int64_t) (x) & (u_int64_t) 0x00000000000000ffULL) << 56) | |
@@ -44,389 +44,389 @@ | |||
44 | 0x0000ff0000000000ULL) >> 24) | | 44 | 0x0000ff0000000000ULL) >> 24) | |
45 | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) 0x00ff000000000000ULL) >> | 45 | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) 0x00ff000000000000ULL) >> |
46 | 40) | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) | 46 | 40) | \ (u_int64_t) (((u_int64_t) (x) & (u_int64_t) |
47 | 0xff00000000000000ULL) >> 56))) | 47 | 0xff00000000000000ULL) >> 56))) |
48 | /* | 48 | /* |
49 | * Linux | 49 | * Linux |
50 | */ | 50 | */ |
51 | #if defined(linux) || defined(Linux) || defined(__linux__) || defined(__linux) || defined(__gnu_linux__) | 51 | #if defined(linux) || defined(Linux) || defined(__linux__) || defined(__linux) || defined(__gnu_linux__) |
52 | #include <endian.h> | 52 | #include <endian.h> |
53 | #include <unistd.h> | 53 | #include <unistd.h> |
54 | #include <stdint.h> | 54 | #include <stdint.h> |
55 | 55 | ||
56 | #ifndef __int8_t_defined | 56 | #ifndef __int8_t_defined |
57 | typedef uint64_t u_int64_t; | 57 | typedef uint64_t u_int64_t; |
58 | typedef uint32_t u_int32_t; | 58 | typedef uint32_t u_int32_t; |
59 | typedef uint16_t u_int16_t; | 59 | typedef uint16_t u_int16_t; |
60 | typedef uint8_t u_int8_t; | 60 | typedef uint8_t u_int8_t; |
61 | 61 | ||
62 | 62 | ||
63 | #endif /* */ | 63 | #endif /* */ |
64 | 64 | ||
65 | #ifndef htole16 | 65 | #ifndef htole16 |
66 | #if __BYTE_ORDER == __LITTLE_ENDIAN | 66 | #if __BYTE_ORDER == __LITTLE_ENDIAN |
67 | #define htobe16(x) ___my_swab16 (x) | 67 | #define htobe16(x) ___my_swab16 (x) |
68 | #define htole16(x) (x) | 68 | #define htole16(x) (x) |
69 | #define be16toh(x) ___my_swab16 (x) | 69 | #define be16toh(x) ___my_swab16 (x) |
70 | #define le16toh(x) (x) | 70 | #define le16toh(x) (x) |
71 | 71 | ||
72 | #define htobe32(x) ___my_swab32 (x) | 72 | #define htobe32(x) ___my_swab32 (x) |
73 | #define htole32(x) (x) | 73 | #define htole32(x) (x) |
74 | #define be32toh(x) ___my_swab32 (x) | 74 | #define be32toh(x) ___my_swab32 (x) |
75 | #define le32toh(x) (x) | 75 | #define le32toh(x) (x) |
76 | 76 | ||
77 | #define htobe64(x) ___my_swab64 (x) | 77 | #define htobe64(x) ___my_swab64 (x) |
78 | #define htole64(x) (x) | 78 | #define htole64(x) (x) |
79 | #define be64toh(x) ___my_swab64 (x) | 79 | #define be64toh(x) ___my_swab64 (x) |
80 | #define le64toh(x) (x) | 80 | #define le64toh(x) (x) |
81 | #else /* */ | 81 | #else /* */ |
82 | #define htobe16(x) (x) | 82 | #define htobe16(x) (x) |
83 | #define htole16(x) ___my_swab16 (x) | 83 | #define htole16(x) ___my_swab16 (x) |
84 | #define be16toh(x) (x) | 84 | #define be16toh(x) (x) |
85 | #define le16toh(x) ___my_swab16 (x) | 85 | #define le16toh(x) ___my_swab16 (x) |
86 | 86 | ||
87 | #define htobe32(x) (x) | 87 | #define htobe32(x) (x) |
88 | #define htole32(x) ___my_swab32 (x) | 88 | #define htole32(x) ___my_swab32 (x) |
89 | #define be32toh(x) (x) | 89 | #define be32toh(x) (x) |
90 | #define le32toh(x) ___my_swab32 (x) | 90 | #define le32toh(x) ___my_swab32 (x) |
91 | 91 | ||
92 | #define htobe64(x) (x) | 92 | #define htobe64(x) (x) |
93 | #define htole64(x) ___my_swab64 (x) | 93 | #define htole64(x) ___my_swab64 (x) |
94 | #define be64toh(x) (x) | 94 | #define be64toh(x) (x) |
95 | #define le64toh(x) ___my_swab64 (x) | 95 | #define le64toh(x) ___my_swab64 (x) |
96 | #endif /* */ | 96 | #endif /* */ |
97 | #endif /* */ | 97 | #endif /* */ |
98 | 98 | ||
99 | #endif /* */ | 99 | #endif /* */ |
100 | 100 | ||
101 | /* | 101 | /* |
102 | * Cygwin | 102 | * Cygwin |
103 | */ | 103 | */ |
104 | #if defined(__CYGWIN32__) | 104 | #if defined(__CYGWIN32__) |
105 | #include <asm/byteorder.h> | 105 | #include <asm/byteorder.h> |
106 | #include <unistd.h> | 106 | #include <unistd.h> |
107 | 107 | ||
108 | #define __be64_to_cpu(x) ___my_swab64(x) | 108 | #define __be64_to_cpu(x) ___my_swab64(x) |
109 | #define __be32_to_cpu(x) ___my_swab32(x) | 109 | #define __be32_to_cpu(x) ___my_swab32(x) |
110 | #define __be16_to_cpu(x) ___my_swab16(x) | 110 | #define __be16_to_cpu(x) ___my_swab16(x) |
111 | #define __cpu_to_be64(x) ___my_swab64(x) | 111 | #define __cpu_to_be64(x) ___my_swab64(x) |
112 | #define __cpu_to_be32(x) ___my_swab32(x) | 112 | #define __cpu_to_be32(x) ___my_swab32(x) |
113 | #define __cpu_to_be16(x) ___my_swab16(x) | 113 | #define __cpu_to_be16(x) ___my_swab16(x) |
114 | #define __le64_to_cpu(x) (x) | 114 | #define __le64_to_cpu(x) (x) |
115 | #define __le32_to_cpu(x) (x) | 115 | #define __le32_to_cpu(x) (x) |
116 | #define __le16_to_cpu(x) (x) | 116 | #define __le16_to_cpu(x) (x) |
117 | #define __cpu_to_le64(x) (x) | 117 | #define __cpu_to_le64(x) (x) |
118 | #define __cpu_to_le32(x) (x) | 118 | #define __cpu_to_le32(x) (x) |
119 | #define __cpu_to_le16(x) (x) | 119 | #define __cpu_to_le16(x) (x) |
120 | 120 | ||
121 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED | 121 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED |
122 | 122 | ||
123 | #endif /* */ | 123 | #endif /* */ |
124 | 124 | ||
125 | /* | 125 | /* |
126 | * Windows (DDK) | 126 | * Windows (DDK) |
127 | */ | 127 | */ |
128 | #if defined(__WIN__) | 128 | #if defined(__WIN__) |
129 | 129 | ||
130 | #include <io.h> | 130 | #include <io.h> |
131 | 131 | ||
132 | #define __be64_to_cpu(x) ___my_swab64(x) | 132 | #define __be64_to_cpu(x) ___my_swab64(x) |
133 | #define __be32_to_cpu(x) ___my_swab32(x) | 133 | #define __be32_to_cpu(x) ___my_swab32(x) |
134 | #define __be16_to_cpu(x) ___my_swab16(x) | 134 | #define __be16_to_cpu(x) ___my_swab16(x) |
135 | #define __cpu_to_be64(x) ___my_swab64(x) | 135 | #define __cpu_to_be64(x) ___my_swab64(x) |
136 | #define __cpu_to_be32(x) ___my_swab32(x) | 136 | #define __cpu_to_be32(x) ___my_swab32(x) |
137 | #define __cpu_to_be16(x) ___my_swab16(x) | 137 | #define __cpu_to_be16(x) ___my_swab16(x) |
138 | #define __le64_to_cpu(x) (x) | 138 | #define __le64_to_cpu(x) (x) |
139 | #define __le32_to_cpu(x) (x) | 139 | #define __le32_to_cpu(x) (x) |
140 | #define __le16_to_cpu(x) (x) | 140 | #define __le16_to_cpu(x) (x) |
141 | #define __cpu_to_le64(x) (x) | 141 | #define __cpu_to_le64(x) (x) |
142 | #define __cpu_to_le32(x) (x) | 142 | #define __cpu_to_le32(x) (x) |
143 | #define __cpu_to_le16(x) (x) | 143 | #define __cpu_to_le16(x) (x) |
144 | 144 | ||
145 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED | 145 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED |
146 | 146 | ||
147 | #endif /* */ | 147 | #endif /* */ |
148 | 148 | ||
149 | /* | 149 | /* |
150 | * MAC (Darwin) | 150 | * MAC (Darwin) |
151 | */ | 151 | */ |
152 | #if defined(__APPLE_CC__) | 152 | #if defined(__APPLE_CC__) |
153 | #if defined(__x86_64__) && defined(__APPLE__) | 153 | #if defined(__x86_64__) && defined(__APPLE__) |
154 | 154 | ||
155 | #include <libkern/OSByteOrder.h> | 155 | #include <libkern/OSByteOrder.h> |
156 | 156 | ||
157 | #define __swab64(x) (unsigned long long) OSSwapInt64((uint64_t)x) | 157 | #define __swab64(x) (unsigned long long) OSSwapInt64((uint64_t)x) |
158 | #define __swab32(x) (unsigned long) OSSwapInt32((uint32_t)x) | 158 | #define __swab32(x) (unsigned long) OSSwapInt32((uint32_t)x) |
159 | #define __swab16(x) (unsigned short) OSSwapInt16((uint16_t)x) | 159 | #define __swab16(x) (unsigned short) OSSwapInt16((uint16_t)x) |
160 | #define __be64_to_cpu(x) (unsigned long long) OSSwapBigToHostInt64((uint64_t)x) | 160 | #define __be64_to_cpu(x) (unsigned long long) OSSwapBigToHostInt64((uint64_t)x) |
161 | #define __be32_to_cpu(x) (unsigned long) OSSwapBigToHostInt32((uint32_t)x) | 161 | #define __be32_to_cpu(x) (unsigned long) OSSwapBigToHostInt32((uint32_t)x) |
162 | #define __be16_to_cpu(x) (unsigned short) OSSwapBigToHostInt16((uint16_t)x) | 162 | #define __be16_to_cpu(x) (unsigned short) OSSwapBigToHostInt16((uint16_t)x) |
163 | #define __le64_to_cpu(x) (unsigned long long) OSSwapLittleToHostInt64((uint64_t)x) | 163 | #define __le64_to_cpu(x) (unsigned long long) OSSwapLittleToHostInt64((uint64_t)x) |
164 | #define __le32_to_cpu(x) (unsigned long) OSSwapLittleToHostInt32((uint32_t)x) | 164 | #define __le32_to_cpu(x) (unsigned long) OSSwapLittleToHostInt32((uint32_t)x) |
165 | #define __le16_to_cpu(x) (unsigned short) OSSwapLittleToHostInt16((uint16_t)x) | 165 | #define __le16_to_cpu(x) (unsigned short) OSSwapLittleToHostInt16((uint16_t)x) |
166 | #define __cpu_to_be64(x) (unsigned long long) OSSwapHostToBigInt64((uint64_t)x) | 166 | #define __cpu_to_be64(x) (unsigned long long) OSSwapHostToBigInt64((uint64_t)x) |
167 | #define __cpu_to_be32(x) (unsigned long) OSSwapHostToBigInt32((uint32_t)x) | 167 | #define __cpu_to_be32(x) (unsigned long) OSSwapHostToBigInt32((uint32_t)x) |
168 | #define __cpu_to_be16(x) (unsigned short) OSSwapHostToBigInt16((uint16_t)x) | 168 | #define __cpu_to_be16(x) (unsigned short) OSSwapHostToBigInt16((uint16_t)x) |
169 | #define __cpu_to_le64(x) (unsigned long long) OSSwapHostToLittleInt64((uint64_t)x) | 169 | #define __cpu_to_le64(x) (unsigned long long) OSSwapHostToLittleInt64((uint64_t)x) |
170 | #define __cpu_to_le32(x) (unsigned long) OSSwapHostToLittleInt32((uint32_t)x) | 170 | #define __cpu_to_le32(x) (unsigned long) OSSwapHostToLittleInt32((uint32_t)x) |
171 | #define __cpu_to_le16(x) (unsigned short) OSSwapHostToLittleInt16((uint16_t)x) | 171 | #define __cpu_to_le16(x) (unsigned short) OSSwapHostToLittleInt16((uint16_t)x) |
172 | 172 | ||
173 | #else /* */ | 173 | #else /* */ |
174 | 174 | ||
175 | #include <architecture/byte_order.h> | 175 | #include <architecture/byte_order.h> |
176 | 176 | ||
177 | #define __swab64(x) NXSwapLongLong(x) | 177 | #define __swab64(x) NXSwapLongLong(x) |
178 | #define __swab32(x) NXSwapLong(x) | 178 | #define __swab32(x) NXSwapLong(x) |
179 | #define __swab16(x) NXSwapShort(x) | 179 | #define __swab16(x) NXSwapShort(x) |
180 | #define __be64_to_cpu(x) NXSwapBigLongLongToHost(x) | 180 | #define __be64_to_cpu(x) NXSwapBigLongLongToHost(x) |
181 | #define __be32_to_cpu(x) NXSwapBigLongToHost(x) | 181 | #define __be32_to_cpu(x) NXSwapBigLongToHost(x) |
182 | #define __be16_to_cpu(x) NXSwapBigShortToHost(x) | 182 | #define __be16_to_cpu(x) NXSwapBigShortToHost(x) |
183 | #define __le64_to_cpu(x) NXSwapLittleLongLongToHost(x) | 183 | #define __le64_to_cpu(x) NXSwapLittleLongLongToHost(x) |
184 | #define __le32_to_cpu(x) NXSwapLittleLongToHost(x) | 184 | #define __le32_to_cpu(x) NXSwapLittleLongToHost(x) |
185 | #define __le16_to_cpu(x) NXSwapLittleShortToHost(x) | 185 | #define __le16_to_cpu(x) NXSwapLittleShortToHost(x) |
186 | #define __cpu_to_be64(x) NXSwapHostLongLongToBig(x) | 186 | #define __cpu_to_be64(x) NXSwapHostLongLongToBig(x) |
187 | #define __cpu_to_be32(x) NXSwapHostLongToBig(x) | 187 | #define __cpu_to_be32(x) NXSwapHostLongToBig(x) |
188 | #define __cpu_to_be16(x) NXSwapHostShortToBig(x) | 188 | #define __cpu_to_be16(x) NXSwapHostShortToBig(x) |
189 | #define __cpu_to_le64(x) NXSwapHostLongLongToLittle(x) | 189 | #define __cpu_to_le64(x) NXSwapHostLongLongToLittle(x) |
190 | #define __cpu_to_le32(x) NXSwapHostLongToLittle(x) | 190 | #define __cpu_to_le32(x) NXSwapHostLongToLittle(x) |
191 | #define __cpu_to_le16(x) NXSwapHostShortToLittle(x) | 191 | #define __cpu_to_le16(x) NXSwapHostShortToLittle(x) |
192 | 192 | ||
193 | #endif /* */ | 193 | #endif /* */ |
194 | 194 | ||
195 | #define __LITTLE_ENDIAN 1234 | 195 | #define __LITTLE_ENDIAN 1234 |
196 | #define __BIG_ENDIAN 4321 | 196 | #define __BIG_ENDIAN 4321 |
197 | #define __PDP_ENDIAN 3412 | 197 | #define __PDP_ENDIAN 3412 |
198 | #define __BYTE_ORDER __BIG_ENDIAN | 198 | #define __BYTE_ORDER __BIG_ENDIAN |
199 | 199 | ||
200 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED | 200 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED |
201 | 201 | ||
202 | #endif /* */ | 202 | #endif /* */ |
203 | 203 | ||
204 | /* | 204 | /* |
205 | * Solaris | 205 | * Solaris |
206 | * ------- | 206 | * ------- |
207 | */ | 207 | */ |
208 | #if defined(__sparc__) && defined(__sun__) | 208 | #if defined(__sparc__) && defined(__sun__) |
209 | #include <sys/byteorder.h> | 209 | #include <sys/byteorder.h> |
210 | #include <sys/types.h> | 210 | #include <sys/types.h> |
211 | #include <unistd.h> | 211 | #include <unistd.h> |
212 | 212 | ||
213 | #define __be64_to_cpu(x) (x) | 213 | #define __be64_to_cpu(x) (x) |
214 | #define __be32_to_cpu(x) (x) | 214 | #define __be32_to_cpu(x) (x) |
215 | #define __be16_to_cpu(x) (x) | 215 | #define __be16_to_cpu(x) (x) |
216 | #define __cpu_to_be64(x) (x) | 216 | #define __cpu_to_be64(x) (x) |
217 | #define __cpu_to_be32(x) (x) | 217 | #define __cpu_to_be32(x) (x) |
218 | #define __cpu_to_be16(x) (x) | 218 | #define __cpu_to_be16(x) (x) |
219 | #define __le64_to_cpu(x) ___my_swab64(x) | 219 | #define __le64_to_cpu(x) ___my_swab64(x) |
220 | #define __le32_to_cpu(x) ___my_swab32(x) | 220 | #define __le32_to_cpu(x) ___my_swab32(x) |
221 | #define __le16_to_cpu(x) ___my_swab16(x) | 221 | #define __le16_to_cpu(x) ___my_swab16(x) |
222 | #define __cpu_to_le64(x) ___my_swab64(x) | 222 | #define __cpu_to_le64(x) ___my_swab64(x) |
223 | #define __cpu_to_le32(x) ___my_swab32(x) | 223 | #define __cpu_to_le32(x) ___my_swab32(x) |
224 | #define __cpu_to_le16(x) ___my_swab16(x) | 224 | #define __cpu_to_le16(x) ___my_swab16(x) |
225 | typedef uint64_t u_int64_t; | 225 | typedef uint64_t u_int64_t; |
226 | typedef uint32_t u_int32_t; | 226 | typedef uint32_t u_int32_t; |
227 | typedef uint16_t u_int16_t; | 227 | typedef uint16_t u_int16_t; |
228 | typedef uint8_t u_int8_t; | 228 | typedef uint8_t u_int8_t; |
229 | 229 | ||
230 | 230 | ||
231 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED | 231 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED |
232 | 232 | ||
233 | #endif /* */ | 233 | #endif /* */ |
234 | 234 | ||
235 | /* | 235 | /* |
236 | * Custom stuff | 236 | * Custom stuff |
237 | */ | 237 | */ |
238 | #if defined(__MACH__) && !defined(__APPLE_CC__) | 238 | #if defined(__MACH__) && !defined(__APPLE_CC__) |
239 | #include <libkern/OSByteOrder.h> | 239 | #include <libkern/OSByteOrder.h> |
240 | #define __cpu_to_be64(x) = OSSwapHostToBigInt64(x) | 240 | #define __cpu_to_be64(x) = OSSwapHostToBigInt64(x) |
241 | #define __cpu_to_be32(x) = OSSwapHostToBigInt32(x) | 241 | #define __cpu_to_be32(x) = OSSwapHostToBigInt32(x) |
242 | 242 | ||
243 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED | 243 | #define AIRCRACK_NG_BYTE_ORDER_DEFINED |
244 | 244 | ||
245 | #endif /* */ | 245 | #endif /* */ |
246 | 246 | ||
247 | // FreeBSD | 247 | // FreeBSD |
248 | #ifdef __FreeBSD__ | 248 | #ifdef __FreeBSD__ |
249 | #include <machine/endian.h> | 249 | #include <machine/endian.h> |
250 | #endif /* */ | 250 | #endif /* */ |
251 | 251 | ||
252 | // XXX: Is there anything to include on OpenBSD/NetBSD/DragonFlyBSD/...? | 252 | // XXX: Is there anything to include on OpenBSD/NetBSD/DragonFlyBSD/...? |
253 | 253 | ||
254 | // XXX: Mac: Check http://www.opensource.apple.com/source/CF/CF-476.18/CFByteOrder.h | 254 | // XXX: Mac: Check http://www.opensource.apple.com/source/CF/CF-476.18/CFByteOrder.h |
255 | // http://developer.apple.com/DOCUMENTATION/CoreFoundation/Reference/CFByteOrderUtils/Reference/reference.html | 255 | // http://developer.apple.com/DOCUMENTATION/CoreFoundation/Reference/CFByteOrderUtils/Reference/reference.html |
256 | // Write to apple to ask what should be used. | 256 | // Write to apple to ask what should be used. |
257 | 257 | ||
258 | #if defined(LITTLE_ENDIAN) | 258 | #if defined(LITTLE_ENDIAN) |
259 | #define AIRCRACK_NG_LITTLE_ENDIAN LITTLE_ENDIAN | 259 | #define AIRCRACK_NG_LITTLE_ENDIAN LITTLE_ENDIAN |
260 | #elif defined(__LITTLE_ENDIAN) | 260 | #elif defined(__LITTLE_ENDIAN) |
261 | #define AIRCRACK_NG_LITTLE_ENDIAN __LITTLE_ENDIAN | 261 | #define AIRCRACK_NG_LITTLE_ENDIAN __LITTLE_ENDIAN |
262 | #elif defined(_LITTLE_ENDIAN) | 262 | #elif defined(_LITTLE_ENDIAN) |
263 | #define AIRCRACK_NG_LITTLE_ENDIAN _LITTLE_ENDIAN | 263 | #define AIRCRACK_NG_LITTLE_ENDIAN _LITTLE_ENDIAN |
264 | #endif /* */ | 264 | #endif /* */ |
265 | 265 | ||
266 | #if defined(BIG_ENDIAN) | 266 | #if defined(BIG_ENDIAN) |
267 | #define AIRCRACK_NG_BIG_ENDIAN BIG_ENDIAN | 267 | #define AIRCRACK_NG_BIG_ENDIAN BIG_ENDIAN |
268 | #elif defined(__BIG_ENDIAN) | 268 | #elif defined(__BIG_ENDIAN) |
269 | #define AIRCRACK_NG_BIG_ENDIAN __BIG_ENDIAN | 269 | #define AIRCRACK_NG_BIG_ENDIAN __BIG_ENDIAN |
270 | #elif defined(_BIG_ENDIAN) | 270 | #elif defined(_BIG_ENDIAN) |
271 | #define AIRCRACK_NG_BIG_ENDIAN _BIG_ENDIAN | 271 | #define AIRCRACK_NG_BIG_ENDIAN _BIG_ENDIAN |
272 | #endif /* */ | 272 | #endif /* */ |
273 | 273 | ||
274 | #if !defined(AIRCRACK_NG_LITTLE_ENDIAN) && !defined(AIRCRACK_NG_BIG_ENDIAN) | 274 | #if !defined(AIRCRACK_NG_LITTLE_ENDIAN) && !defined(AIRCRACK_NG_BIG_ENDIAN) |
275 | #error Impossible to determine endianness (Little or Big endian), please contact the author. | 275 | #error Impossible to determine endianness (Little or Big endian), please contact the author. |
276 | #endif /* */ | 276 | #endif /* */ |
277 | 277 | ||
278 | #if defined(BYTE_ORDER) | 278 | #if defined(BYTE_ORDER) |
279 | #if (BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN) | 279 | #if (BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN) |
280 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_LITTLE_ENDIAN | 280 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_LITTLE_ENDIAN |
281 | #elif (BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN) | 281 | #elif (BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN) |
282 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_BIG_ENDIAN | 282 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_BIG_ENDIAN |
283 | #endif /* */ | 283 | #endif /* */ |
284 | #elif defined(__BYTE_ORDER) | 284 | #elif defined(__BYTE_ORDER) |
285 | #if (__BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN) | 285 | #if (__BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN) |
286 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_LITTLE_ENDIAN | 286 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_LITTLE_ENDIAN |
287 | #elif (__BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN) | 287 | #elif (__BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN) |
288 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_BIG_ENDIAN | 288 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_BIG_ENDIAN |
289 | #endif /* */ | 289 | #endif /* */ |
290 | #elif defined(_BYTE_ORDER) | 290 | #elif defined(_BYTE_ORDER) |
291 | #if (_BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN) | 291 | #if (_BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN) |
292 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_LITTLE_ENDIAN | 292 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_LITTLE_ENDIAN |
293 | #elif (_BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN) | 293 | #elif (_BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN) |
294 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_BIG_ENDIAN | 294 | #define AIRCRACK_NG_BYTE_ORDER AIRCRACK_NG_BIG_ENDIAN |
295 | #endif /* */ | 295 | #endif /* */ |
296 | #endif /* */ | 296 | #endif /* */ |
297 | 297 | ||
298 | #ifndef AIRCRACK_NG_BYTE_ORDER | 298 | #ifndef AIRCRACK_NG_BYTE_ORDER |
299 | #error Impossible to determine endianness (Little or Big endian), please contact the author. | 299 | #error Impossible to determine endianness (Little or Big endian), please contact the author. |
300 | #endif /* */ | 300 | #endif /* */ |
301 | 301 | ||
302 | #if (AIRCRACK_NG_BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN) | 302 | #if (AIRCRACK_NG_BYTE_ORDER == AIRCRACK_NG_LITTLE_ENDIAN) |
303 | 303 | ||
304 | #ifndef AIRCRACK_NG_BYTE_ORDER_DEFINED | 304 | #ifndef AIRCRACK_NG_BYTE_ORDER_DEFINED |
305 | #define __be64_to_cpu(x) ___my_swab64(x) | 305 | #define __be64_to_cpu(x) ___my_swab64(x) |
306 | #define __be32_to_cpu(x) ___my_swab32(x) | 306 | #define __be32_to_cpu(x) ___my_swab32(x) |
307 | #define __be16_to_cpu(x) ___my_swab16(x) | 307 | #define __be16_to_cpu(x) ___my_swab16(x) |
308 | #define __cpu_to_be64(x) ___my_swab64(x) | 308 | #define __cpu_to_be64(x) ___my_swab64(x) |
309 | #define __cpu_to_be32(x) ___my_swab32(x) | 309 | #define __cpu_to_be32(x) ___my_swab32(x) |
310 | #define __cpu_to_be16(x) ___my_swab16(x) | 310 | #define __cpu_to_be16(x) ___my_swab16(x) |
311 | #define __le64_to_cpu(x) (x) | 311 | #define __le64_to_cpu(x) (x) |
312 | #define __le32_to_cpu(x) (x) | 312 | #define __le32_to_cpu(x) (x) |
313 | #define __le16_to_cpu(x) (x) | 313 | #define __le16_to_cpu(x) (x) |
314 | #define __cpu_to_le64(x) (x) | 314 | #define __cpu_to_le64(x) (x) |
315 | #define __cpu_to_le32(x) (x) | 315 | #define __cpu_to_le32(x) (x) |
316 | #define __cpu_to_le16(x) (x) | 316 | #define __cpu_to_le16(x) (x) |
317 | #endif /* */ | 317 | #endif /* */ |
318 | 318 | ||
319 | #ifndef htobe16 | 319 | #ifndef htobe16 |
320 | #define htobe16 ___my_swab16 | 320 | #define htobe16 ___my_swab16 |
321 | #endif /* */ | 321 | #endif /* */ |
322 | #ifndef htobe32 | 322 | #ifndef htobe32 |
323 | #define htobe32 ___my_swab32 | 323 | #define htobe32 ___my_swab32 |
324 | #endif /* */ | 324 | #endif /* */ |
325 | #ifndef betoh16 | 325 | #ifndef betoh16 |
326 | #define betoh16 ___my_swab16 | 326 | #define betoh16 ___my_swab16 |
327 | #endif /* */ | 327 | #endif /* */ |
328 | #ifndef betoh32 | 328 | #ifndef betoh32 |
329 | #define betoh32 ___my_swab32 | 329 | #define betoh32 ___my_swab32 |
330 | #endif /* */ | 330 | #endif /* */ |
331 | 331 | ||
332 | #ifndef htole16 | 332 | #ifndef htole16 |
333 | #define htole16(x) (x) | 333 | #define htole16(x) (x) |
334 | #endif /* */ | 334 | #endif /* */ |
335 | #ifndef htole32 | 335 | #ifndef htole32 |
336 | #define htole32(x) (x) | 336 | #define htole32(x) (x) |
337 | #endif /* */ | 337 | #endif /* */ |
338 | #ifndef letoh16 | 338 | #ifndef letoh16 |
339 | #define letoh16(x) (x) | 339 | #define letoh16(x) (x) |
340 | #endif /* */ | 340 | #endif /* */ |
341 | #ifndef letoh32 | 341 | #ifndef letoh32 |
342 | #define letoh32(x) (x) | 342 | #define letoh32(x) (x) |
343 | #endif /* */ | 343 | #endif /* */ |
344 | 344 | ||
345 | #endif /* */ | 345 | #endif /* */ |
346 | 346 | ||
347 | #if (AIRCRACK_NG_BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN) | 347 | #if (AIRCRACK_NG_BYTE_ORDER == AIRCRACK_NG_BIG_ENDIAN) |
348 | 348 | ||
349 | #ifndef AIRCRACK_NG_BYTE_ORDER_DEFINED | 349 | #ifndef AIRCRACK_NG_BYTE_ORDER_DEFINED |
350 | #define __be64_to_cpu(x) (x) | 350 | #define __be64_to_cpu(x) (x) |
351 | #define __be32_to_cpu(x) (x) | 351 | #define __be32_to_cpu(x) (x) |
352 | #define __be16_to_cpu(x) (x) | 352 | #define __be16_to_cpu(x) (x) |
353 | #define __cpu_to_be64(x) (x) | 353 | #define __cpu_to_be64(x) (x) |
354 | #define __cpu_to_be32(x) (x) | 354 | #define __cpu_to_be32(x) (x) |
355 | #define __cpu_to_be16(x) (x) | 355 | #define __cpu_to_be16(x) (x) |
356 | #define __le64_to_cpu(x) ___my_swab64(x) | 356 | #define __le64_to_cpu(x) ___my_swab64(x) |
357 | #define __le32_to_cpu(x) ___my_swab32(x) | 357 | #define __le32_to_cpu(x) ___my_swab32(x) |
358 | #define __le16_to_cpu(x) ___my_swab16(x) | 358 | #define __le16_to_cpu(x) ___my_swab16(x) |
359 | #define __cpu_to_le64(x) ___my_swab64(x) | 359 | #define __cpu_to_le64(x) ___my_swab64(x) |
360 | #define __cpu_to_le32(x) ___my_swab32(x) | 360 | #define __cpu_to_le32(x) ___my_swab32(x) |
361 | #define __cpu_to_le16(x) ___my_swab16(x) | 361 | #define __cpu_to_le16(x) ___my_swab16(x) |
362 | #endif /* */ | 362 | #endif /* */ |
363 | 363 | ||
364 | #ifndef htobe16 | 364 | #ifndef htobe16 |
365 | #define htobe16(x) (x) | 365 | #define htobe16(x) (x) |
366 | #endif /* */ | 366 | #endif /* */ |
367 | #ifndef htobe32 | 367 | #ifndef htobe32 |
368 | #define htobe32(x) (x) | 368 | #define htobe32(x) (x) |
369 | #endif /* */ | 369 | #endif /* */ |
370 | #ifndef betoh16 | 370 | #ifndef betoh16 |
371 | #define betoh16(x) (x) | 371 | #define betoh16(x) (x) |
372 | #endif /* */ | 372 | #endif /* */ |
373 | #ifndef betoh32 | 373 | #ifndef betoh32 |
374 | #define betoh32(x) (x) | 374 | #define betoh32(x) (x) |
375 | #endif /* */ | 375 | #endif /* */ |
376 | 376 | ||
377 | #ifndef htole16 | 377 | #ifndef htole16 |
378 | #define htole16 ___my_swab16 | 378 | #define htole16 ___my_swab16 |
379 | #endif /* */ | 379 | #endif /* */ |
380 | #ifndef htole32 | 380 | #ifndef htole32 |
381 | #define htole32 ___my_swab32 | 381 | #define htole32 ___my_swab32 |
382 | #endif /* */ | 382 | #endif /* */ |
383 | #ifndef letoh16 | 383 | #ifndef letoh16 |
384 | #define letoh16 ___my_swab16 | 384 | #define letoh16 ___my_swab16 |
385 | #endif /* */ | 385 | #endif /* */ |
386 | #ifndef letoh32 | 386 | #ifndef letoh32 |
387 | #define letoh32 ___my_swab32 | 387 | #define letoh32 ___my_swab32 |
388 | #endif /* */ | 388 | #endif /* */ |
389 | 389 | ||
390 | #endif /* */ | 390 | #endif /* */ |
391 | 391 | ||
392 | // Common defines | 392 | // Common defines |
393 | #define cpu_to_le64 __cpu_to_le64 | 393 | #define cpu_to_le64 __cpu_to_le64 |
394 | #define le64_to_cpu __le64_to_cpu | 394 | #define le64_to_cpu __le64_to_cpu |
395 | #define cpu_to_le32 __cpu_to_le32 | 395 | #define cpu_to_le32 __cpu_to_le32 |
396 | #define le32_to_cpu __le32_to_cpu | 396 | #define le32_to_cpu __le32_to_cpu |
397 | #define cpu_to_le16 __cpu_to_le16 | 397 | #define cpu_to_le16 __cpu_to_le16 |
398 | #define le16_to_cpu __le16_to_cpu | 398 | #define le16_to_cpu __le16_to_cpu |
399 | #define cpu_to_be64 __cpu_to_be64 | 399 | #define cpu_to_be64 __cpu_to_be64 |
400 | #define be64_to_cpu __be64_to_cpu | 400 | #define be64_to_cpu __be64_to_cpu |
401 | #define cpu_to_be32 __cpu_to_be32 | 401 | #define cpu_to_be32 __cpu_to_be32 |
402 | #define be32_to_cpu __be32_to_cpu | 402 | #define be32_to_cpu __be32_to_cpu |
403 | #define cpu_to_be16 __cpu_to_be16 | 403 | #define cpu_to_be16 __cpu_to_be16 |
404 | #define be16_to_cpu __be16_to_cpu | 404 | #define be16_to_cpu __be16_to_cpu |
405 | 405 | ||
406 | #ifndef le16toh | 406 | #ifndef le16toh |
407 | #define le16toh le16_to_cpu | 407 | #define le16toh le16_to_cpu |
408 | #endif /* */ | 408 | #endif /* */ |
409 | #ifndef be16toh | 409 | #ifndef be16toh |
410 | #define be16toh be16_to_cpu | 410 | #define be16toh be16_to_cpu |
411 | #endif /* */ | 411 | #endif /* */ |
412 | #ifndef le32toh | 412 | #ifndef le32toh |
413 | #define le32toh le32_to_cpu | 413 | #define le32toh le32_to_cpu |
414 | #endif /* */ | 414 | #endif /* */ |
415 | #ifndef be32toh | 415 | #ifndef be32toh |
416 | #define be32toh be32_to_cpu | 416 | #define be32toh be32_to_cpu |
417 | #endif /* */ | 417 | #endif /* */ |
418 | 418 | ||
419 | #ifndef htons | 419 | #ifndef htons |
420 | #define htons be16_to_cpu | 420 | #define htons be16_to_cpu |
421 | #endif /* */ | 421 | #endif /* */ |
422 | #ifndef htonl | 422 | #ifndef htonl |
423 | #define htonl cpu_to_be16 | 423 | #define htonl cpu_to_be16 |
424 | #endif /* */ | 424 | #endif /* */ |
425 | #ifndef ntohs | 425 | #ifndef ntohs |
426 | #define ntohs cpu_to_be16 | 426 | #define ntohs cpu_to_be16 |
427 | #endif /* */ | 427 | #endif /* */ |
428 | #ifndef ntohl | 428 | #ifndef ntohl |
429 | #define ntohl cpu_to_be32 | 429 | #define ntohl cpu_to_be32 |
430 | #endif /* */ | 430 | #endif /* */ |
431 | 431 | ||
432 | #endif /* */ | 432 | #endif /* */ |
diff --git a/src/transport/wlan/helper_common.h b/src/transport/wlan/helper_common.h index 550ebda6f..3c33887d1 100644 --- a/src/transport/wlan/helper_common.h +++ b/src/transport/wlan/helper_common.h | |||
@@ -8,8 +8,11 @@ | |||
8 | #ifndef HELPER_COMMON_H_ | 8 | #ifndef HELPER_COMMON_H_ |
9 | #define HELPER_COMMON_H_ | 9 | #define HELPER_COMMON_H_ |
10 | 10 | ||
11 | int getFrequencyFromChannel (int channel); | 11 | int |
12 | int getChannelFromFrequency (int frequency); | 12 | getFrequencyFromChannel (int channel); |
13 | int send_mac_to_plugin (char *buffer, uint8_t * mac); | 13 | int |
14 | getChannelFromFrequency (int frequency); | ||
15 | int | ||
16 | send_mac_to_plugin (char *buffer, uint8_t * mac); | ||
14 | 17 | ||
15 | #endif /* HELPER_COMMON_H_ */ | 18 | #endif /* HELPER_COMMON_H_ */ |
diff --git a/src/transport/wlan/loopback_helper.h b/src/transport/wlan/loopback_helper.h index d6afb1129..81cc66f22 100644 --- a/src/transport/wlan/loopback_helper.h +++ b/src/transport/wlan/loopback_helper.h | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | //static void file_in_send(void *cls, void *client, const struct GNUNET_MessageHeader *hdr); | 15 | //static void file_in_send(void *cls, void *client, const struct GNUNET_MessageHeader *hdr); |
16 | 16 | ||
17 | int testmode (int argc, char *argv[]); | 17 | int |
18 | testmode (int argc, char *argv[]); | ||
18 | 19 | ||
19 | #endif /* LOOPBACK_HELPER_H_ */ | 20 | #endif /* LOOPBACK_HELPER_H_ */ |
diff --git a/src/transport/wlan/radiotap-parser.c b/src/transport/wlan/radiotap-parser.c index ab75524f2..9cc992728 100644 --- a/src/transport/wlan/radiotap-parser.c +++ b/src/transport/wlan/radiotap-parser.c | |||
@@ -191,13 +191,13 @@ ieee80211_radiotap_iterator_next (struct ieee80211_radiotap_iterator *iterator) | |||
191 | */ | 191 | */ |
192 | 192 | ||
193 | if ((((void *) iterator->arg) - | 193 | if ((((void *) iterator->arg) - |
194 | ((void *) iterator-> | 194 | ((void *) iterator->rtheader)) & ((rt_sizes[iterator->arg_index] >> 4) |
195 | rtheader)) & ((rt_sizes[iterator->arg_index] >> 4) - 1)) | 195 | - 1)) |
196 | iterator->arg_index += | 196 | iterator->arg_index += |
197 | (rt_sizes[iterator->arg_index] >> 4) - | 197 | (rt_sizes[iterator->arg_index] >> 4) - |
198 | ((((void *) iterator->arg) - | 198 | ((((void *) iterator->arg) - |
199 | ((void *) iterator-> | 199 | ((void *) iterator->rtheader)) & ((rt_sizes[iterator->arg_index] >> |
200 | rtheader)) & ((rt_sizes[iterator->arg_index] >> 4) - 1)); | 200 | 4) - 1)); |
201 | 201 | ||
202 | /* | 202 | /* |
203 | * this is what we will return to user, but we need to | 203 | * this is what we will return to user, but we need to |
diff --git a/src/transport/wlan/radiotap-parser.h b/src/transport/wlan/radiotap-parser.h index fb6d8e2af..6c88175ec 100644 --- a/src/transport/wlan/radiotap-parser.h +++ b/src/transport/wlan/radiotap-parser.h | |||
@@ -70,10 +70,10 @@ struct ieee80211_radiotap_iterator | |||
70 | u32 bitmap_shifter; | 70 | u32 bitmap_shifter; |
71 | }; | 71 | }; |
72 | 72 | ||
73 | int ieee80211_radiotap_iterator_init (struct ieee80211_radiotap_iterator | 73 | int |
74 | *iterator, | 74 | ieee80211_radiotap_iterator_init (struct ieee80211_radiotap_iterator *iterator, |
75 | struct ieee80211_radiotap_header | 75 | struct ieee80211_radiotap_header |
76 | *radiotap_header, int max_length); | 76 | *radiotap_header, int max_length); |
77 | 77 | ||
78 | int ieee80211_radiotap_iterator_next (struct ieee80211_radiotap_iterator | 78 | int |
79 | *iterator); | 79 | ieee80211_radiotap_iterator_next (struct ieee80211_radiotap_iterator *iterator); |
diff --git a/src/util/client.c b/src/util/client.c index 59cd26ad1..2b866e6f8 100644 --- a/src/util/client.c +++ b/src/util/client.c | |||
@@ -452,8 +452,8 @@ check_complete (struct GNUNET_CLIENT_Connection *conn) | |||
452 | { | 452 | { |
453 | if ((conn->received_pos >= sizeof (struct GNUNET_MessageHeader)) && | 453 | if ((conn->received_pos >= sizeof (struct GNUNET_MessageHeader)) && |
454 | (conn->received_pos >= | 454 | (conn->received_pos >= |
455 | ntohs (((const struct GNUNET_MessageHeader *) conn-> | 455 | ntohs (((const struct GNUNET_MessageHeader *) conn->received_buf)-> |
456 | received_buf)->size))) | 456 | size))) |
457 | conn->msg_complete = GNUNET_YES; | 457 | conn->msg_complete = GNUNET_YES; |
458 | } | 458 | } |
459 | 459 | ||
@@ -679,8 +679,8 @@ write_test (void *cls, size_t size, void *buf) | |||
679 | msg->type = htons (GNUNET_MESSAGE_TYPE_TEST); | 679 | msg->type = htons (GNUNET_MESSAGE_TYPE_TEST); |
680 | msg->size = htons (sizeof (struct GNUNET_MessageHeader)); | 680 | msg->size = htons (sizeof (struct GNUNET_MessageHeader)); |
681 | GNUNET_CLIENT_receive (conn, &confirm_handler, conn, | 681 | GNUNET_CLIENT_receive (conn, &confirm_handler, conn, |
682 | GNUNET_TIME_absolute_get_remaining (conn-> | 682 | GNUNET_TIME_absolute_get_remaining |
683 | test_deadline)); | 683 | (conn->test_deadline)); |
684 | return sizeof (struct GNUNET_MessageHeader); | 684 | return sizeof (struct GNUNET_MessageHeader); |
685 | } | 685 | } |
686 | 686 | ||
@@ -902,7 +902,8 @@ GNUNET_CLIENT_service_test (const char *service, | |||
902 | * @param buf where to write them | 902 | * @param buf where to write them |
903 | * @return number of bytes written to buf | 903 | * @return number of bytes written to buf |
904 | */ | 904 | */ |
905 | static size_t client_notify (void *cls, size_t size, void *buf); | 905 | static size_t |
906 | client_notify (void *cls, size_t size, void *buf); | ||
906 | 907 | ||
907 | 908 | ||
908 | /** | 909 | /** |
diff --git a/src/util/connection.c b/src/util/connection.c index 39cb1dde2..9aeca9096 100644 --- a/src/util/connection.c +++ b/src/util/connection.c | |||
@@ -506,8 +506,8 @@ GNUNET_CONNECTION_get_address (struct GNUNET_CONNECTION_Handle *sock, | |||
506 | * @param cls our connection handle | 506 | * @param cls our connection handle |
507 | * @param tc task context describing why we are here | 507 | * @param tc task context describing why we are here |
508 | */ | 508 | */ |
509 | static void receive_again (void *cls, | 509 | static void |
510 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 510 | receive_again (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
511 | 511 | ||
512 | 512 | ||
513 | /** | 513 | /** |
@@ -619,8 +619,8 @@ destroy_continuation (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
619 | * @param cls our connection handle | 619 | * @param cls our connection handle |
620 | * @param tc task context describing why we are here | 620 | * @param tc task context describing why we are here |
621 | */ | 621 | */ |
622 | static void transmit_ready (void *cls, | 622 | static void |
623 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 623 | transmit_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
624 | 624 | ||
625 | 625 | ||
626 | /** | 626 | /** |
@@ -867,13 +867,13 @@ try_connect_using_address (void *cls, const struct sockaddr *addr, | |||
867 | if (h->nth.notify_ready != NULL) | 867 | if (h->nth.notify_ready != NULL) |
868 | delay = | 868 | delay = |
869 | GNUNET_TIME_relative_min (delay, | 869 | GNUNET_TIME_relative_min (delay, |
870 | GNUNET_TIME_absolute_get_remaining (h->nth. | 870 | GNUNET_TIME_absolute_get_remaining (h-> |
871 | transmit_timeout)); | 871 | nth.transmit_timeout)); |
872 | if (h->receiver != NULL) | 872 | if (h->receiver != NULL) |
873 | delay = | 873 | delay = |
874 | GNUNET_TIME_relative_min (delay, | 874 | GNUNET_TIME_relative_min (delay, |
875 | GNUNET_TIME_absolute_get_remaining (h-> | 875 | GNUNET_TIME_absolute_get_remaining |
876 | receive_timeout)); | 876 | (h->receive_timeout)); |
877 | ap->task = | 877 | ap->task = |
878 | GNUNET_SCHEDULER_add_write_net (delay, ap->sock, | 878 | GNUNET_SCHEDULER_add_write_net (delay, ap->sock, |
879 | &connect_probe_continuation, ap); | 879 | &connect_probe_continuation, ap); |
@@ -1152,9 +1152,8 @@ receive_ready (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
1152 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 1152 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
1153 | "Receive from `%s' encounters error: time out by %llums... (%p)\n", | 1153 | "Receive from `%s' encounters error: time out by %llums... (%p)\n", |
1154 | GNUNET_a2s (sh->addr, sh->addrlen), | 1154 | GNUNET_a2s (sh->addr, sh->addrlen), |
1155 | GNUNET_TIME_absolute_get_duration (sh-> | 1155 | GNUNET_TIME_absolute_get_duration (sh->receive_timeout). |
1156 | receive_timeout).rel_value, | 1156 | rel_value, sh); |
1157 | sh); | ||
1158 | #endif | 1157 | #endif |
1159 | signal_timeout (sh); | 1158 | signal_timeout (sh); |
1160 | return; | 1159 | return; |
diff --git a/src/util/container_heap.c b/src/util/container_heap.c index ef6bcc892..059a5b253 100644 --- a/src/util/container_heap.c +++ b/src/util/container_heap.c | |||
@@ -292,11 +292,8 @@ insert_node (struct GNUNET_CONTAINER_Heap *heap, | |||
292 | 292 | ||
293 | GNUNET_assert (node->parent == NULL); | 293 | GNUNET_assert (node->parent == NULL); |
294 | while ((heap->order == GNUNET_CONTAINER_HEAP_ORDER_MAX) ? (pos->cost >= | 294 | while ((heap->order == GNUNET_CONTAINER_HEAP_ORDER_MAX) ? (pos->cost >= |
295 | node-> | 295 | node->cost) |
296 | cost) : (pos-> | 296 | : (pos->cost <= node->cost)) |
297 | cost <= | ||
298 | node-> | ||
299 | cost)) | ||
300 | { | 297 | { |
301 | /* node is descendent of pos */ | 298 | /* node is descendent of pos */ |
302 | pos->tree_size += (1 + node->tree_size); | 299 | pos->tree_size += (1 + node->tree_size); |
diff --git a/src/util/container_meta_data.c b/src/util/container_meta_data.c index c67e96dac..eb515e8fb 100644 --- a/src/util/container_meta_data.c +++ b/src/util/container_meta_data.c | |||
@@ -1165,9 +1165,9 @@ GNUNET_CONTAINER_meta_data_deserialize (const char *input, size_t size) | |||
1165 | else | 1165 | else |
1166 | mime_type = &mdata[left]; | 1166 | mime_type = &mdata[left]; |
1167 | GNUNET_CONTAINER_meta_data_insert (md, plugin_name, | 1167 | GNUNET_CONTAINER_meta_data_insert (md, plugin_name, |
1168 | (enum EXTRACTOR_MetaType) ntohl (ent. | 1168 | (enum EXTRACTOR_MetaType) |
1169 | type), | 1169 | ntohl (ent.type), format, mime_type, |
1170 | format, mime_type, meta_data, dlen); | 1170 | meta_data, dlen); |
1171 | } | 1171 | } |
1172 | GNUNET_free_non_null (data); | 1172 | GNUNET_free_non_null (data); |
1173 | return md; | 1173 | return md; |
diff --git a/src/util/crypto_rsa.c b/src/util/crypto_rsa.c index 3607998e4..ec46b486c 100644 --- a/src/util/crypto_rsa.c +++ b/src/util/crypto_rsa.c | |||
@@ -218,9 +218,9 @@ GNUNET_CRYPTO_rsa_key_get_public (const struct GNUNET_CRYPTO_RsaPrivateKey | |||
218 | size = GNUNET_CRYPTO_RSA_KEY_LENGTH - GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH; | 218 | size = GNUNET_CRYPTO_RSA_KEY_LENGTH - GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH; |
219 | GNUNET_assert (0 == | 219 | GNUNET_assert (0 == |
220 | gcry_mpi_print (GCRYMPI_FMT_USG, | 220 | gcry_mpi_print (GCRYMPI_FMT_USG, |
221 | &pub-> | 221 | &pub->key |
222 | key[GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH], | 222 | [GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH], size, |
223 | size, &size, skey[1])); | 223 | &size, skey[1])); |
224 | adjust (&pub->key[GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH], size, | 224 | adjust (&pub->key[GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH], size, |
225 | GNUNET_CRYPTO_RSA_KEY_LENGTH - | 225 | GNUNET_CRYPTO_RSA_KEY_LENGTH - |
226 | GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH); | 226 | GNUNET_CRYPTO_RSA_DATA_ENCODING_LENGTH); |
diff --git a/src/util/disk.h b/src/util/disk.h index b60150f3a..2c128745f 100644 --- a/src/util/disk.h +++ b/src/util/disk.h | |||
@@ -37,7 +37,8 @@ | |||
37 | * @param dst_len length of dst | 37 | * @param dst_len length of dst |
38 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 38 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
39 | */ | 39 | */ |
40 | int GNUNET_DISK_internal_file_handle_ (const struct GNUNET_DISK_FileHandle *fh, | 40 | int |
41 | void *dst, size_t dst_len); | 41 | GNUNET_DISK_internal_file_handle_ (const struct GNUNET_DISK_FileHandle *fh, |
42 | void *dst, size_t dst_len); | ||
42 | 43 | ||
43 | #endif /* GNUNET_DISK_H_ */ | 44 | #endif /* GNUNET_DISK_H_ */ |
diff --git a/src/util/getopt.c b/src/util/getopt.c index db81d1c3d..eb79db757 100644 --- a/src/util/getopt.c +++ b/src/util/getopt.c | |||
@@ -194,7 +194,8 @@ static char *posixly_correct; | |||
194 | /* Avoid depending on library functions or files | 194 | /* Avoid depending on library functions or files |
195 | whose names are inconsistent. */ | 195 | whose names are inconsistent. */ |
196 | 196 | ||
197 | char *getenv (); | 197 | char * |
198 | getenv (); | ||
198 | 199 | ||
199 | static char * | 200 | static char * |
200 | my_index (str, chr) | 201 | my_index (str, chr) |
@@ -218,7 +219,8 @@ my_index (str, chr) | |||
218 | #if !defined (__STDC__) || !__STDC__ | 219 | #if !defined (__STDC__) || !__STDC__ |
219 | /* gcc with -traditional declares the built-in strlen to return int, | 220 | /* gcc with -traditional declares the built-in strlen to return int, |
220 | and has done so at least since version 2.4.5. -- rms. */ | 221 | and has done so at least since version 2.4.5. -- rms. */ |
221 | extern int strlen (const char *); | 222 | extern int |
223 | strlen (const char *); | ||
222 | #endif /* not __STDC__ */ | 224 | #endif /* not __STDC__ */ |
223 | #endif /* __GNUC__ */ | 225 | #endif /* __GNUC__ */ |
224 | 226 | ||
@@ -283,7 +285,8 @@ text_set_element (__libc_subinit, store_args_and_env); | |||
283 | the new indices of the non-options in ARGV after they are moved. */ | 285 | the new indices of the non-options in ARGV after they are moved. */ |
284 | 286 | ||
285 | #if defined (__STDC__) && __STDC__ | 287 | #if defined (__STDC__) && __STDC__ |
286 | static void exchange (char **); | 288 | static void |
289 | exchange (char **); | ||
287 | #endif | 290 | #endif |
288 | 291 | ||
289 | static void | 292 | static void |
@@ -370,7 +373,8 @@ exchange (argv) | |||
370 | /* Initialize the internal data when the first call is made. */ | 373 | /* Initialize the internal data when the first call is made. */ |
371 | 374 | ||
372 | #if defined (__STDC__) && __STDC__ | 375 | #if defined (__STDC__) && __STDC__ |
373 | static const char *_getopt_initialize (int, char *const *, const char *); | 376 | static const char * |
377 | _getopt_initialize (int, char *const *, const char *); | ||
374 | #endif | 378 | #endif |
375 | static const char * | 379 | static const char * |
376 | _getopt_initialize (argc, argv, optstring) | 380 | _getopt_initialize (argc, argv, optstring) |
diff --git a/src/util/os_network.c b/src/util/os_network.c index 21376f94c..b55789c99 100644 --- a/src/util/os_network.c +++ b/src/util/os_network.c | |||
@@ -135,8 +135,9 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc, | |||
135 | pTable->table[dwIfIdx].dwPhysAddrLen); | 135 | pTable->table[dwIfIdx].dwPhysAddrLen); |
136 | 136 | ||
137 | snprintf (szEntry, 1000, "%s (%s - %I64u)", | 137 | snprintf (szEntry, 1000, "%s (%s - %I64u)", |
138 | pszIfName ? pszIfName : (char *) pTable->table[dwIfIdx]. | 138 | pszIfName ? pszIfName : (char *) pTable-> |
139 | bDescr, inet_ntop (AF_INET, &dwIP, dst, INET_ADDRSTRLEN), | 139 | table[dwIfIdx].bDescr, inet_ntop (AF_INET, &dwIP, dst, |
140 | INET_ADDRSTRLEN), | ||
140 | *((unsigned long long *) bPhysAddr)); | 141 | *((unsigned long long *) bPhysAddr)); |
141 | szEntry[1000] = 0; | 142 | szEntry[1000] = 0; |
142 | 143 | ||
diff --git a/src/util/os_priority.c b/src/util/os_priority.c index d27642a58..55a728ce6 100644 --- a/src/util/os_priority.c +++ b/src/util/os_priority.c | |||
@@ -63,10 +63,9 @@ parent_control_handler (void *cls, | |||
63 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' invoked because of %d\n", | 63 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "`%s' invoked because of %d\n", |
64 | __FUNCTION__, tc->reason); | 64 | __FUNCTION__, tc->reason); |
65 | #endif | 65 | #endif |
66 | if (tc-> | 66 | if (tc->reason & |
67 | reason & (GNUNET_SCHEDULER_REASON_SHUTDOWN | | 67 | (GNUNET_SCHEDULER_REASON_SHUTDOWN | GNUNET_SCHEDULER_REASON_TIMEOUT | |
68 | GNUNET_SCHEDULER_REASON_TIMEOUT | | 68 | GNUNET_SCHEDULER_REASON_PREREQ_DONE)) |
69 | GNUNET_SCHEDULER_REASON_PREREQ_DONE)) | ||
70 | { | 69 | { |
71 | GNUNET_DISK_npipe_close (control_pipe); | 70 | GNUNET_DISK_npipe_close (control_pipe); |
72 | } | 71 | } |
diff --git a/src/util/peer.c b/src/util/peer.c index 62fa0e2f2..cd5444a19 100644 --- a/src/util/peer.c +++ b/src/util/peer.c | |||
@@ -181,8 +181,8 @@ GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id *ids, unsigned int count) | |||
181 | { | 181 | { |
182 | GNUNET_break (GNUNET_OK == | 182 | GNUNET_break (GNUNET_OK == |
183 | GNUNET_CONTAINER_multihashmap_remove (map, | 183 | GNUNET_CONTAINER_multihashmap_remove (map, |
184 | &table[id].id. | 184 | &table[id]. |
185 | hashPubKey, | 185 | id.hashPubKey, |
186 | (void *) (long) id)); | 186 | (void *) (long) id)); |
187 | table[id].pid = free_list_start; | 187 | table[id].pid = free_list_start; |
188 | free_list_start = id; | 188 | free_list_start = id; |
@@ -210,8 +210,8 @@ GNUNET_PEER_change_rc (GNUNET_PEER_Id id, int delta) | |||
210 | { | 210 | { |
211 | GNUNET_break (GNUNET_OK == | 211 | GNUNET_break (GNUNET_OK == |
212 | GNUNET_CONTAINER_multihashmap_remove (map, | 212 | GNUNET_CONTAINER_multihashmap_remove (map, |
213 | &table[id].id. | 213 | &table[id]. |
214 | hashPubKey, | 214 | id.hashPubKey, |
215 | (void *) (long) id)); | 215 | (void *) (long) id)); |
216 | table[id].pid = free_list_start; | 216 | table[id].pid = free_list_start; |
217 | free_list_start = id; | 217 | free_list_start = id; |
diff --git a/src/util/perf_crypto_hash.c b/src/util/perf_crypto_hash.c index 689781835..d883776b4 100644 --- a/src/util/perf_crypto_hash.c +++ b/src/util/perf_crypto_hash.c | |||
@@ -58,12 +58,12 @@ main (int argc, char *argv[]) | |||
58 | start = GNUNET_TIME_absolute_get (); | 58 | start = GNUNET_TIME_absolute_get (); |
59 | perfHash (); | 59 | perfHash (); |
60 | printf ("Hash perf took %llu ms\n", | 60 | printf ("Hash perf took %llu ms\n", |
61 | (unsigned long long) GNUNET_TIME_absolute_get_duration (start). | 61 | (unsigned long long) |
62 | rel_value); | 62 | GNUNET_TIME_absolute_get_duration (start).rel_value); |
63 | GAUGER ("UTIL", "Cryptographic hashing", | 63 | GAUGER ("UTIL", "Cryptographic hashing", |
64 | 1024 * 64 * 1024 / (1 + | 64 | 1024 * 64 * 1024 / (1 + |
65 | GNUNET_TIME_absolute_get_duration (start). | 65 | GNUNET_TIME_absolute_get_duration |
66 | rel_value), "kb/s"); | 66 | (start).rel_value), "kb/s"); |
67 | return 0; | 67 | return 0; |
68 | } | 68 | } |
69 | 69 | ||
diff --git a/src/util/resolver_api.c b/src/util/resolver_api.c index 3aa8bff9c..3607ce67f 100644 --- a/src/util/resolver_api.c +++ b/src/util/resolver_api.c | |||
@@ -318,7 +318,8 @@ no_resolve (const struct sockaddr *sa, socklen_t salen) | |||
318 | /** | 318 | /** |
319 | * Adjust exponential back-off and reconnect to the service. | 319 | * Adjust exponential back-off and reconnect to the service. |
320 | */ | 320 | */ |
321 | static void reconnect (); | 321 | static void |
322 | reconnect (); | ||
322 | 323 | ||
323 | 324 | ||
324 | /** | 325 | /** |
@@ -326,7 +327,8 @@ static void reconnect (); | |||
326 | * | 327 | * |
327 | * @param h handle to the resolver | 328 | * @param h handle to the resolver |
328 | */ | 329 | */ |
329 | static void process_requests (); | 330 | static void |
331 | process_requests (); | ||
330 | 332 | ||
331 | 333 | ||
332 | /** | 334 | /** |
diff --git a/src/util/scheduler.c b/src/util/scheduler.c index 844531b37..52824d8b3 100644 --- a/src/util/scheduler.c +++ b/src/util/scheduler.c | |||
@@ -656,9 +656,9 @@ run_ready (struct GNUNET_NETWORK_FDSet *rs, struct GNUNET_NETWORK_FDSet *ws) | |||
656 | { | 656 | { |
657 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, | 657 | GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |
658 | "Task %llu took %llums to be scheduled\n", pos->id, | 658 | "Task %llu took %llums to be scheduled\n", pos->id, |
659 | (unsigned long long) GNUNET_TIME_absolute_get_duration (pos-> | 659 | (unsigned long long) |
660 | start_time). | 660 | GNUNET_TIME_absolute_get_duration |
661 | rel_value); | 661 | (pos->start_time).rel_value); |
662 | } | 662 | } |
663 | #endif | 663 | #endif |
664 | tc.reason = pos->reason; | 664 | tc.reason = pos->reason; |
diff --git a/src/util/server.c b/src/util/server.c index 504391bc7..31d298e3a 100644 --- a/src/util/server.c +++ b/src/util/server.c | |||
@@ -611,9 +611,9 @@ warn_no_receive_done (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
611 | _ | 611 | _ |
612 | ("Processing code for message of type %u did not call GNUNET_SERVER_receive_done after %llums\n"), | 612 | ("Processing code for message of type %u did not call GNUNET_SERVER_receive_done after %llums\n"), |
613 | (unsigned int) client->warn_type, | 613 | (unsigned int) client->warn_type, |
614 | (unsigned long long) GNUNET_TIME_absolute_get_duration (client-> | 614 | (unsigned long long) |
615 | warn_start). | 615 | GNUNET_TIME_absolute_get_duration |
616 | rel_value); | 616 | (client->warn_start).rel_value); |
617 | } | 617 | } |
618 | 618 | ||
619 | 619 | ||
@@ -730,9 +730,9 @@ GNUNET_SERVER_inject (struct GNUNET_SERVER_Handle *server, | |||
730 | * @param addrlen length of addr | 730 | * @param addrlen length of addr |
731 | * @param errCode code indicating errors receiving, 0 for success | 731 | * @param errCode code indicating errors receiving, 0 for success |
732 | */ | 732 | */ |
733 | static void process_incoming (void *cls, const void *buf, size_t available, | 733 | static void |
734 | const struct sockaddr *addr, socklen_t addrlen, | 734 | process_incoming (void *cls, const void *buf, size_t available, |
735 | int errCode); | 735 | const struct sockaddr *addr, socklen_t addrlen, int errCode); |
736 | 736 | ||
737 | 737 | ||
738 | /** | 738 | /** |
diff --git a/src/util/server_nc.c b/src/util/server_nc.c index a1cb43f00..a5ee7e0d6 100644 --- a/src/util/server_nc.c +++ b/src/util/server_nc.c | |||
@@ -381,8 +381,8 @@ do_unicast (struct GNUNET_SERVER_NotificationContext *nc, | |||
381 | if (client->th == NULL) | 381 | if (client->th == NULL) |
382 | client->th = | 382 | client->th = |
383 | GNUNET_SERVER_notify_transmit_ready (client->client, | 383 | GNUNET_SERVER_notify_transmit_ready (client->client, |
384 | ntohs (client->pending_head->msg-> | 384 | ntohs (client->pending_head-> |
385 | size), | 385 | msg->size), |
386 | GNUNET_TIME_UNIT_FOREVER_REL, | 386 | GNUNET_TIME_UNIT_FOREVER_REL, |
387 | &transmit_message, client); | 387 | &transmit_message, client); |
388 | } | 388 | } |
diff --git a/src/util/test_crypto_ksk.c b/src/util/test_crypto_ksk.c index d4340f3ea..2789f5edb 100644 --- a/src/util/test_crypto_ksk.c +++ b/src/util/test_crypto_ksk.c | |||
@@ -168,8 +168,8 @@ testEncryptDecrypt (struct GNUNET_CRYPTO_RsaPrivateKey *hostkey) | |||
168 | } | 168 | } |
169 | } | 169 | } |
170 | printf ("%d RSA encrypt/decrypt operations %llums (%d failures)\n", ITER, | 170 | printf ("%d RSA encrypt/decrypt operations %llums (%d failures)\n", ITER, |
171 | (unsigned long long) GNUNET_TIME_absolute_get_duration (start). | 171 | (unsigned long long) |
172 | rel_value, ok); | 172 | GNUNET_TIME_absolute_get_duration (start).rel_value, ok); |
173 | if (ok == 0) | 173 | if (ok == 0) |
174 | return GNUNET_OK; | 174 | return GNUNET_OK; |
175 | else | 175 | else |
@@ -218,8 +218,8 @@ testSignVerify (struct GNUNET_CRYPTO_RsaPrivateKey *hostkey) | |||
218 | } | 218 | } |
219 | } | 219 | } |
220 | printf ("%d RSA sign/verify operations %llums\n", ITER, | 220 | printf ("%d RSA sign/verify operations %llums\n", ITER, |
221 | (unsigned long long) GNUNET_TIME_absolute_get_duration (start). | 221 | (unsigned long long) |
222 | rel_value); | 222 | GNUNET_TIME_absolute_get_duration (start).rel_value); |
223 | return ok; | 223 | return ok; |
224 | } | 224 | } |
225 | 225 | ||
diff --git a/src/util/test_crypto_rsa.c b/src/util/test_crypto_rsa.c index bf058d285..f26a76a38 100644 --- a/src/util/test_crypto_rsa.c +++ b/src/util/test_crypto_rsa.c | |||
@@ -82,8 +82,8 @@ testEncryptDecrypt () | |||
82 | } | 82 | } |
83 | } | 83 | } |
84 | printf ("%d RSA encrypt/decrypt operations %llums (%d failures)\n", ITER, | 84 | printf ("%d RSA encrypt/decrypt operations %llums (%d failures)\n", ITER, |
85 | (unsigned long long) GNUNET_TIME_absolute_get_duration (start). | 85 | (unsigned long long) |
86 | rel_value, ok); | 86 | GNUNET_TIME_absolute_get_duration (start).rel_value, ok); |
87 | GNUNET_CRYPTO_rsa_key_free (hostkey); | 87 | GNUNET_CRYPTO_rsa_key_free (hostkey); |
88 | if (ok == 0) | 88 | if (ok == 0) |
89 | return GNUNET_OK; | 89 | return GNUNET_OK; |
@@ -121,8 +121,8 @@ testEncryptPerformance () | |||
121 | } | 121 | } |
122 | } | 122 | } |
123 | printf ("%d RSA encrypt operations %llu ms (%d failures)\n", ITER, | 123 | printf ("%d RSA encrypt operations %llu ms (%d failures)\n", ITER, |
124 | (unsigned long long) GNUNET_TIME_absolute_get_duration (start). | 124 | (unsigned long long) |
125 | rel_value, ok); | 125 | GNUNET_TIME_absolute_get_duration (start).rel_value, ok); |
126 | GNUNET_CRYPTO_rsa_key_free (hostkey); | 126 | GNUNET_CRYPTO_rsa_key_free (hostkey); |
127 | if (ok != 0) | 127 | if (ok != 0) |
128 | return GNUNET_SYSERR; | 128 | return GNUNET_SYSERR; |
@@ -178,8 +178,8 @@ testEncryptDecryptSK () | |||
178 | } | 178 | } |
179 | } | 179 | } |
180 | printf ("%d RSA encrypt/decrypt SK operations %llums (%d failures)\n", ITER, | 180 | printf ("%d RSA encrypt/decrypt SK operations %llums (%d failures)\n", ITER, |
181 | (unsigned long long) GNUNET_TIME_absolute_get_duration (start). | 181 | (unsigned long long) |
182 | rel_value, ok); | 182 | GNUNET_TIME_absolute_get_duration (start).rel_value, ok); |
183 | GNUNET_CRYPTO_rsa_key_free (hostkey); | 183 | GNUNET_CRYPTO_rsa_key_free (hostkey); |
184 | if (ok != 0) | 184 | if (ok != 0) |
185 | return GNUNET_SYSERR; | 185 | return GNUNET_SYSERR; |
@@ -232,8 +232,8 @@ testSignVerify () | |||
232 | } | 232 | } |
233 | } | 233 | } |
234 | printf ("%d RSA sign/verify operations %llums\n", ITER, | 234 | printf ("%d RSA sign/verify operations %llums\n", ITER, |
235 | (unsigned long long) GNUNET_TIME_absolute_get_duration (start). | 235 | (unsigned long long) |
236 | rel_value); | 236 | GNUNET_TIME_absolute_get_duration (start).rel_value); |
237 | GNUNET_CRYPTO_rsa_key_free (hostkey); | 237 | GNUNET_CRYPTO_rsa_key_free (hostkey); |
238 | return ok; | 238 | return ok; |
239 | } | 239 | } |
@@ -268,8 +268,8 @@ testSignPerformance () | |||
268 | } | 268 | } |
269 | } | 269 | } |
270 | printf ("%d RSA sign operations %llu ms\n", ITER, | 270 | printf ("%d RSA sign operations %llu ms\n", ITER, |
271 | (unsigned long long) GNUNET_TIME_absolute_get_duration (start). | 271 | (unsigned long long) |
272 | rel_value); | 272 | GNUNET_TIME_absolute_get_duration (start).rel_value); |
273 | GNUNET_CRYPTO_rsa_key_free (hostkey); | 273 | GNUNET_CRYPTO_rsa_key_free (hostkey); |
274 | return ok; | 274 | return ok; |
275 | } | 275 | } |
diff --git a/src/util/test_os_network.c b/src/util/test_os_network.c index 583a5fb82..315f97d97 100644 --- a/src/util/test_os_network.c +++ b/src/util/test_os_network.c | |||
@@ -45,9 +45,9 @@ proc (void *cls, const char *name, int isDefault, const struct sockaddr *addr, | |||
45 | 45 | ||
46 | inet_ntop (addr->sa_family, | 46 | inet_ntop (addr->sa_family, |
47 | (addr->sa_family == | 47 | (addr->sa_family == |
48 | AF_INET) ? (void *) &((struct sockaddr_in *) addr)-> | 48 | AF_INET) ? (void *) &((struct sockaddr_in *) addr)->sin_addr |
49 | sin_addr : (void *) &((struct sockaddr_in6 *) addr)->sin6_addr, | 49 | : (void *) &((struct sockaddr_in6 *) addr)->sin6_addr, buf, |
50 | buf, sizeof (buf)); | 50 | sizeof (buf)); |
51 | if ((0 == strcmp ("::1", buf)) || (0 == strcmp ("127.0.0.1", buf))) | 51 | if ((0 == strcmp ("::1", buf)) || (0 == strcmp ("127.0.0.1", buf))) |
52 | *ok = 0; | 52 | *ok = 0; |
53 | return GNUNET_OK; | 53 | return GNUNET_OK; |
diff --git a/src/util/test_time.c b/src/util/test_time.c index 6a05b698c..788884fcc 100644 --- a/src/util/test_time.c +++ b/src/util/test_time.c | |||
@@ -108,8 +108,8 @@ check () | |||
108 | GNUNET_assert (GNUNET_TIME_absolute_get_difference (future, now).rel_value == | 108 | GNUNET_assert (GNUNET_TIME_absolute_get_difference (future, now).rel_value == |
109 | 0); | 109 | 0); |
110 | 110 | ||
111 | GNUNET_assert (GNUNET_TIME_absolute_get_difference (zero, forever). | 111 | GNUNET_assert (GNUNET_TIME_absolute_get_difference (zero, forever).rel_value |
112 | rel_value == forever.abs_value); | 112 | == forever.abs_value); |
113 | 113 | ||
114 | past.abs_value = now.abs_value - 1000000; | 114 | past.abs_value = now.abs_value - 1000000; |
115 | rel = GNUNET_TIME_absolute_get_duration (future); | 115 | rel = GNUNET_TIME_absolute_get_duration (future); |
@@ -153,8 +153,7 @@ check () | |||
153 | 153 | ||
154 | GNUNET_assert (forever.abs_value == | 154 | GNUNET_assert (forever.abs_value == |
155 | GNUNET_TIME_absolute_subtract (forever, | 155 | GNUNET_TIME_absolute_subtract (forever, |
156 | GNUNET_TIME_UNIT_MINUTES). | 156 | GNUNET_TIME_UNIT_MINUTES).abs_value); |
157 | abs_value); | ||
158 | /*check absolute subtract */ | 157 | /*check absolute subtract */ |
159 | now.abs_value = 50000; | 158 | now.abs_value = 50000; |
160 | rel.rel_value = 100000; | 159 | rel.rel_value = 100000; |
diff --git a/src/vpn/gnunet-daemon-vpn-dns.h b/src/vpn/gnunet-daemon-vpn-dns.h index 2882969e5..0cd0d8b26 100644 --- a/src/vpn/gnunet-daemon-vpn-dns.h +++ b/src/vpn/gnunet-daemon-vpn-dns.h | |||
@@ -40,19 +40,22 @@ extern struct query_packet_list *tail; | |||
40 | * Callback called by notify_transmit_ready; sends dns-queries or rehijack-messages | 40 | * Callback called by notify_transmit_ready; sends dns-queries or rehijack-messages |
41 | * to the service-dns | 41 | * to the service-dns |
42 | */ | 42 | */ |
43 | size_t send_query (void *cls, size_t size, void *buf); | 43 | size_t |
44 | send_query (void *cls, size_t size, void *buf); | ||
44 | 45 | ||
45 | /** | 46 | /** |
46 | * Connect to the service-dns | 47 | * Connect to the service-dns |
47 | */ | 48 | */ |
48 | void connect_to_service_dns (void *cls, | 49 | void |
49 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 50 | connect_to_service_dns (void *cls, |
51 | const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
50 | 52 | ||
51 | /** | 53 | /** |
52 | * This receives packets from the service-dns and schedules process_answer to | 54 | * This receives packets from the service-dns and schedules process_answer to |
53 | * handle it | 55 | * handle it |
54 | */ | 56 | */ |
55 | void dns_answer_handler (void *cls, const struct GNUNET_MessageHeader *msg); | 57 | void |
58 | dns_answer_handler (void *cls, const struct GNUNET_MessageHeader *msg); | ||
56 | 59 | ||
57 | /** | 60 | /** |
58 | * The connection to the service-dns | 61 | * The connection to the service-dns |
diff --git a/src/vpn/gnunet-daemon-vpn-helper.c b/src/vpn/gnunet-daemon-vpn-helper.c index 71fdefc0a..ef2833f87 100644 --- a/src/vpn/gnunet-daemon-vpn-helper.c +++ b/src/vpn/gnunet-daemon-vpn-helper.c | |||
@@ -497,9 +497,9 @@ message_token (void *cls __attribute__ ((unused)), void *client | |||
497 | 497 | ||
498 | } | 498 | } |
499 | else if (0x06 == pkt->ip_hdr.proto && | 499 | else if (0x06 == pkt->ip_hdr.proto && |
500 | (me->desc. | 500 | (me-> |
501 | service_type & htonl (GNUNET_DNS_SERVICE_TYPE_TCP)) && | 501 | desc.service_type & htonl (GNUNET_DNS_SERVICE_TYPE_TCP)) |
502 | (port_in_ports (me->desc.ports, pkt_tcp->tcp_hdr.dpt))) | 502 | && (port_in_ports (me->desc.ports, pkt_tcp->tcp_hdr.dpt))) |
503 | { | 503 | { |
504 | hdr->type = ntohs (GNUNET_MESSAGE_TYPE_VPN_SERVICE_TCP); | 504 | hdr->type = ntohs (GNUNET_MESSAGE_TYPE_VPN_SERVICE_TCP); |
505 | 505 | ||
diff --git a/src/vpn/gnunet-daemon-vpn-helper.h b/src/vpn/gnunet-daemon-vpn-helper.h index 8e0ee5a0f..7329e45ff 100644 --- a/src/vpn/gnunet-daemon-vpn-helper.h +++ b/src/vpn/gnunet-daemon-vpn-helper.h | |||
@@ -38,35 +38,39 @@ extern GNUNET_SCHEDULER_TaskIdentifier shs_task; | |||
38 | /** | 38 | /** |
39 | * Start the helper-process | 39 | * Start the helper-process |
40 | */ | 40 | */ |
41 | void start_helper_and_schedule (void *cls, | 41 | void |
42 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 42 | start_helper_and_schedule (void *cls, |
43 | const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
43 | 44 | ||
44 | /** | 45 | /** |
45 | * Restart the helper-process | 46 | * Restart the helper-process |
46 | */ | 47 | */ |
47 | void restart_helper (void *cls, | 48 | void |
48 | const struct GNUNET_SCHEDULER_TaskContext *tskctx); | 49 | restart_helper (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tskctx); |
49 | 50 | ||
50 | /** | 51 | /** |
51 | * Read from the helper-process | 52 | * Read from the helper-process |
52 | */ | 53 | */ |
53 | void helper_read (void *cls, | 54 | void |
54 | const struct GNUNET_SCHEDULER_TaskContext *tsdkctx); | 55 | helper_read (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tsdkctx); |
55 | 56 | ||
56 | /** | 57 | /** |
57 | * Send an dns-answer-packet to the helper | 58 | * Send an dns-answer-packet to the helper |
58 | */ | 59 | */ |
59 | void helper_write (void *cls, | 60 | void |
60 | const struct GNUNET_SCHEDULER_TaskContext *tsdkctx); | 61 | helper_write (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tsdkctx); |
61 | 62 | ||
62 | /** | 63 | /** |
63 | * Receive packets from the helper-process | 64 | * Receive packets from the helper-process |
64 | */ | 65 | */ |
65 | void message_token (void *cls, void *client, | 66 | void |
66 | const struct GNUNET_MessageHeader *message); | 67 | message_token (void *cls, void *client, |
68 | const struct GNUNET_MessageHeader *message); | ||
67 | 69 | ||
68 | void write_to_helper (void *buf, size_t len); | 70 | void |
71 | write_to_helper (void *buf, size_t len); | ||
69 | 72 | ||
70 | void schedule_helper_write (struct GNUNET_TIME_Relative, void *cls); | 73 | void |
74 | schedule_helper_write (struct GNUNET_TIME_Relative, void *cls); | ||
71 | 75 | ||
72 | #endif /* end of include guard: GNUNET-DAEMON-VPN-HELPER_H */ | 76 | #endif /* end of include guard: GNUNET-DAEMON-VPN-HELPER_H */ |
diff --git a/src/vpn/gnunet-daemon-vpn.c b/src/vpn/gnunet-daemon-vpn.c index 301ba90be..06cade482 100644 --- a/src/vpn/gnunet-daemon-vpn.c +++ b/src/vpn/gnunet-daemon-vpn.c | |||
@@ -931,8 +931,8 @@ receive_udp_back (void *cls | |||
931 | GNUNET_assert (me != NULL); | 931 | GNUNET_assert (me != NULL); |
932 | if (ntohs (message->type) == GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP_BACK) | 932 | if (ntohs (message->type) == GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP_BACK) |
933 | { | 933 | { |
934 | GNUNET_assert (me-> | 934 | GNUNET_assert (me->desc. |
935 | desc.service_type & htonl (GNUNET_DNS_SERVICE_TYPE_UDP)); | 935 | service_type & htonl (GNUNET_DNS_SERVICE_TYPE_UDP)); |
936 | if (!port_in_ports (me->desc.ports, pkt6->udp_hdr.spt) && | 936 | if (!port_in_ports (me->desc.ports, pkt6->udp_hdr.spt) && |
937 | !testBit (me->additional_ports, ntohs (pkt6->udp_hdr.spt))) | 937 | !testBit (me->additional_ports, ntohs (pkt6->udp_hdr.spt))) |
938 | { | 938 | { |
@@ -1109,8 +1109,8 @@ receive_tcp_back (void *cls | |||
1109 | 1109 | ||
1110 | GNUNET_assert (me != NULL); | 1110 | GNUNET_assert (me != NULL); |
1111 | if (ntohs (message->type) == GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP_BACK) | 1111 | if (ntohs (message->type) == GNUNET_MESSAGE_TYPE_VPN_SERVICE_UDP_BACK) |
1112 | GNUNET_assert (me-> | 1112 | GNUNET_assert (me->desc. |
1113 | desc.service_type & htonl (GNUNET_DNS_SERVICE_TYPE_TCP)); | 1113 | service_type & htonl (GNUNET_DNS_SERVICE_TYPE_TCP)); |
1114 | 1114 | ||
1115 | pkt6->tcp_hdr.crc = 0; | 1115 | pkt6->tcp_hdr.crc = 0; |
1116 | uint32_t sum = 0; | 1116 | uint32_t sum = 0; |
diff --git a/src/vpn/gnunet-daemon-vpn.h b/src/vpn/gnunet-daemon-vpn.h index 4f4cf5a0f..701a88d63 100644 --- a/src/vpn/gnunet-daemon-vpn.h +++ b/src/vpn/gnunet-daemon-vpn.h | |||
@@ -35,23 +35,28 @@ | |||
35 | * At the moment this means "inventing" and IPv6-Address for .gnunet-services and | 35 | * At the moment this means "inventing" and IPv6-Address for .gnunet-services and |
36 | * doing nothing for "real" services. | 36 | * doing nothing for "real" services. |
37 | */ | 37 | */ |
38 | void process_answer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | 38 | void |
39 | process_answer (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); | ||
39 | 40 | ||
40 | void send_icmp6_response (void *cls, | 41 | void |
41 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 42 | send_icmp6_response (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
42 | void send_icmp4_response (void *cls, | 43 | void |
43 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 44 | send_icmp4_response (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
44 | 45 | ||
45 | size_t send_udp_service (void *cls, size_t size, | 46 | size_t |
46 | void *buf); | 47 | send_udp_service (void *cls, size_t size, void *buf); |
47 | 48 | ||
48 | GNUNET_HashCode *address6_mapping_exists (unsigned char addr[]); | 49 | GNUNET_HashCode * |
49 | GNUNET_HashCode *address4_mapping_exists (uint32_t addr); | 50 | address6_mapping_exists (unsigned char addr[]); |
51 | GNUNET_HashCode * | ||
52 | address4_mapping_exists (uint32_t addr); | ||
50 | 53 | ||
51 | unsigned int port_in_ports (uint64_t ports, uint16_t port); | 54 | unsigned int |
55 | port_in_ports (uint64_t ports, uint16_t port); | ||
52 | 56 | ||
53 | void send_pkt_to_peer (void *cls, const struct GNUNET_PeerIdentity *peer, | 57 | void |
54 | const struct GNUNET_TRANSPORT_ATS_Information *atsi); | 58 | send_pkt_to_peer (void *cls, const struct GNUNET_PeerIdentity *peer, |
59 | const struct GNUNET_TRANSPORT_ATS_Information *atsi); | ||
55 | 60 | ||
56 | /** | 61 | /** |
57 | * The configuration to use | 62 | * The configuration to use |
@@ -94,7 +99,8 @@ struct map_entry | |||
94 | * @param bitArray memory area to set the bit in | 99 | * @param bitArray memory area to set the bit in |
95 | * @param bitIdx which bit to set | 100 | * @param bitIdx which bit to set |
96 | */ | 101 | */ |
97 | void setBit (char *bitArray, unsigned int bitIdx); | 102 | void |
103 | setBit (char *bitArray, unsigned int bitIdx); | ||
98 | 104 | ||
99 | /** | 105 | /** |
100 | * Clears a bit from bitArray. | 106 | * Clears a bit from bitArray. |
@@ -102,7 +108,8 @@ void setBit (char *bitArray, unsigned int bitIdx); | |||
102 | * @param bitArray memory area to set the bit in | 108 | * @param bitArray memory area to set the bit in |
103 | * @param bitIdx which bit to unset | 109 | * @param bitIdx which bit to unset |
104 | */ | 110 | */ |
105 | void clearBit (char *bitArray, unsigned int bitIdx); | 111 | void |
112 | clearBit (char *bitArray, unsigned int bitIdx); | ||
106 | 113 | ||
107 | /** | 114 | /** |
108 | * Checks if a bit is active in the bitArray | 115 | * Checks if a bit is active in the bitArray |
@@ -111,7 +118,8 @@ void clearBit (char *bitArray, unsigned int bitIdx); | |||
111 | * @param bitIdx which bit to test | 118 | * @param bitIdx which bit to test |
112 | * @return GNUNET_YES if the bit is set, GNUNET_NO if not. | 119 | * @return GNUNET_YES if the bit is set, GNUNET_NO if not. |
113 | */ | 120 | */ |
114 | int testBit (char *bitArray, unsigned int bitIdx); | 121 | int |
122 | testBit (char *bitArray, unsigned int bitIdx); | ||
115 | 123 | ||
116 | struct remote_addr | 124 | struct remote_addr |
117 | { | 125 | { |
diff --git a/src/vpn/gnunet-dns-parser.h b/src/vpn/gnunet-dns-parser.h index cf9d55e8a..70a1e4b9e 100644 --- a/src/vpn/gnunet-dns-parser.h +++ b/src/vpn/gnunet-dns-parser.h | |||
@@ -4,8 +4,10 @@ | |||
4 | #include "platform.h" | 4 | #include "platform.h" |
5 | #include "gnunet-vpn-packet.h" | 5 | #include "gnunet-vpn-packet.h" |
6 | 6 | ||
7 | struct dns_pkt_parsed *parse_dns_packet (struct dns_pkt *pkt); | 7 | struct dns_pkt_parsed * |
8 | parse_dns_packet (struct dns_pkt *pkt); | ||
8 | 9 | ||
9 | void free_parsed_dns_packet (struct dns_pkt_parsed *ppkt); | 10 | void |
11 | free_parsed_dns_packet (struct dns_pkt_parsed *ppkt); | ||
10 | 12 | ||
11 | #endif | 13 | #endif |
diff --git a/src/vpn/gnunet-helper-vpn-api.h b/src/vpn/gnunet-helper-vpn-api.h index 4e8f76611..964beb23c 100644 --- a/src/vpn/gnunet-helper-vpn-api.h +++ b/src/vpn/gnunet-helper-vpn-api.h | |||
@@ -95,20 +95,16 @@ struct GNUNET_VPN_HELPER_Handle | |||
95 | * | 95 | * |
96 | * @return A pointer to the new Handle, NULL on error | 96 | * @return A pointer to the new Handle, NULL on error |
97 | */ | 97 | */ |
98 | struct GNUNET_VPN_HELPER_Handle *start_helper (const char *ifname, | 98 | struct GNUNET_VPN_HELPER_Handle * |
99 | const char *ipv6addr, | 99 | start_helper (const char *ifname, const char *ipv6addr, const char *ipv6prefix, |
100 | const char *ipv6prefix, | 100 | const char *ipv4addr, const char *ipv4mask, |
101 | const char *ipv4addr, | 101 | const char *process_name, GNUNET_SCHEDULER_Task restart_task, |
102 | const char *ipv4mask, | 102 | GNUNET_SERVER_MessageTokenizerCallback cb, void *cb_cls); |
103 | const char *process_name, | ||
104 | GNUNET_SCHEDULER_Task | ||
105 | restart_task, | ||
106 | GNUNET_SERVER_MessageTokenizerCallback | ||
107 | cb, void *cb_cls); | ||
108 | 103 | ||
109 | /** | 104 | /** |
110 | * @brief Kills the helper, closes the pipe and free()s the handle | 105 | * @brief Kills the helper, closes the pipe and free()s the handle |
111 | */ | 106 | */ |
112 | void cleanup_helper (struct GNUNET_VPN_HELPER_Handle *); | 107 | void |
108 | cleanup_helper (struct GNUNET_VPN_HELPER_Handle *); | ||
113 | 109 | ||
114 | #endif /* end of include guard: GNUNET_HELPER_VPN_API_H */ | 110 | #endif /* end of include guard: GNUNET_HELPER_VPN_API_H */ |
diff --git a/src/vpn/gnunet-service-dns.c b/src/vpn/gnunet-service-dns.c index a267cab0d..ba7fa65d7 100644 --- a/src/vpn/gnunet-service-dns.c +++ b/src/vpn/gnunet-service-dns.c | |||
@@ -927,8 +927,8 @@ out: | |||
927 | GNUNET_SERVER_receive_done (client, GNUNET_OK); | 927 | GNUNET_SERVER_receive_done (client, GNUNET_OK); |
928 | } | 928 | } |
929 | 929 | ||
930 | static void read_response (void *cls, | 930 | static void |
931 | const struct GNUNET_SCHEDULER_TaskContext *tc); | 931 | read_response (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc); |
932 | 932 | ||
933 | static int | 933 | static int |
934 | open_port () | 934 | open_port () |
diff --git a/src/vpn/gnunet-vpn-checksum.h b/src/vpn/gnunet-vpn-checksum.h index 82f4954ca..b6af8c56e 100644 --- a/src/vpn/gnunet-vpn-checksum.h +++ b/src/vpn/gnunet-vpn-checksum.h | |||
@@ -4,13 +4,16 @@ | |||
4 | 4 | ||
5 | #include <platform.h> | 5 | #include <platform.h> |
6 | 6 | ||
7 | uint32_t calculate_checksum_update (uint32_t sum, uint16_t * hdr, short len); | 7 | uint32_t |
8 | calculate_checksum_update (uint32_t sum, uint16_t * hdr, short len); | ||
8 | 9 | ||
9 | uint16_t calculate_checksum_end (uint32_t sum); | 10 | uint16_t |
11 | calculate_checksum_end (uint32_t sum); | ||
10 | 12 | ||
11 | /** | 13 | /** |
12 | * Calculate the checksum of an IPv4-Header | 14 | * Calculate the checksum of an IPv4-Header |
13 | */ | 15 | */ |
14 | uint16_t calculate_ip_checksum (uint16_t * hdr, short len); | 16 | uint16_t |
17 | calculate_ip_checksum (uint16_t * hdr, short len); | ||
15 | 18 | ||
16 | #endif /* end of include guard: GNUNET-VPN-CHECKSUM_H */ | 19 | #endif /* end of include guard: GNUNET-VPN-CHECKSUM_H */ |