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/core | |
parent | 4d7904c62bb867c44e90b8e9f7cdbb4b283abc44 (diff) | |
download | gnunet-16a6919a9f98ee9fa1fee9dd262906c321004a19.tar.gz gnunet-16a6919a9f98ee9fa1fee9dd262906c321004a19.zip |
even nicer indentation, thanks to LRN's indent patch
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/core_api.c | 16 | ||||
-rw-r--r-- | src/core/gnunet-service-core.c | 60 | ||||
-rw-r--r-- | src/core/test_core_api_preferences.c | 13 | ||||
-rw-r--r-- | src/core/test_core_api_reliability.c | 7 | ||||
-rw-r--r-- | src/core/test_core_quota_compliance.c | 7 |
5 files changed, 54 insertions, 49 deletions
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, |