aboutsummaryrefslogtreecommitdiff
path: root/src/dv
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-11-04 14:00:32 +0000
committerChristian Grothoff <christian@grothoff.org>2011-11-04 14:00:32 +0000
commit83b19539f4d322b43683f5838b72e9ec2c8e6073 (patch)
treed0ab9329fcbefe360d9d14e2ace21a6b3396dfe9 /src/dv
parent28a2eb43281a1f08a67954f07beb9af3a9bc9a35 (diff)
downloadgnunet-83b19539f4d322b43683f5838b72e9ec2c8e6073.tar.gz
gnunet-83b19539f4d322b43683f5838b72e9ec2c8e6073.zip
curly wars / auto-indentation
Diffstat (limited to 'src/dv')
-rw-r--r--src/dv/gnunet-service-dv.c40
-rw-r--r--src/dv/plugin_transport_dv.c4
-rw-r--r--src/dv/test_transport_api_dv.c12
3 files changed, 27 insertions, 29 deletions
diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c
index 7d86fc24c..60745070c 100644
--- a/src/dv/gnunet-service-dv.c
+++ b/src/dv/gnunet-service-dv.c
@@ -1349,13 +1349,13 @@ send_message_delayed (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1349 */ 1349 */
1350static uint32_t 1350static uint32_t
1351get_atsi_distance (const struct GNUNET_ATS_Information *atsi, 1351get_atsi_distance (const struct GNUNET_ATS_Information *atsi,
1352 unsigned int atsi_count) 1352 unsigned int atsi_count)
1353{ 1353{
1354 unsigned int i; 1354 unsigned int i;
1355 1355
1356 for (i=0;i<atsi_count;i++) 1356 for (i = 0; i < atsi_count; i++)
1357 if (ntohl (atsi[i].type) == GNUNET_ATS_QUALITY_NET_DISTANCE) 1357 if (ntohl (atsi[i].type) == GNUNET_ATS_QUALITY_NET_DISTANCE)
1358 return ntohl (atsi->value); 1358 return ntohl (atsi->value);
1359 /* FIXME: we do not have distance data? Assume direct neighbor. */ 1359 /* FIXME: we do not have distance data? Assume direct neighbor. */
1360 return DIRECT_NEIGHBOR_COST; 1360 return DIRECT_NEIGHBOR_COST;
1361} 1361}
@@ -1369,14 +1369,14 @@ get_atsi_distance (const struct GNUNET_ATS_Information *atsi,
1369 */ 1369 */
1370static struct GNUNET_TIME_Relative 1370static struct GNUNET_TIME_Relative
1371get_atsi_latency (const struct GNUNET_ATS_Information *atsi, 1371get_atsi_latency (const struct GNUNET_ATS_Information *atsi,
1372 unsigned int atsi_count) 1372 unsigned int atsi_count)
1373{ 1373{
1374 unsigned int i; 1374 unsigned int i;
1375 1375
1376 for (i=0;i<atsi_count;i++) 1376 for (i = 0; i < atsi_count; i++)
1377 if (ntohl (atsi[i].type) == GNUNET_ATS_QUALITY_NET_DELAY) 1377 if (ntohl (atsi[i].type) == GNUNET_ATS_QUALITY_NET_DELAY)
1378 return GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS, 1378 return GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS,
1379 ntohl (atsi->value)); 1379 ntohl (atsi->value));
1380 GNUNET_break (0); 1380 GNUNET_break (0);
1381 /* how can we not have latency data? */ 1381 /* how can we not have latency data? */
1382 return GNUNET_TIME_UNIT_SECONDS; 1382 return GNUNET_TIME_UNIT_SECONDS;
@@ -1398,7 +1398,7 @@ static int
1398handle_dv_data_message (void *cls, const struct GNUNET_PeerIdentity *peer, 1398handle_dv_data_message (void *cls, const struct GNUNET_PeerIdentity *peer,
1399 const struct GNUNET_MessageHeader *message, 1399 const struct GNUNET_MessageHeader *message,
1400 const struct GNUNET_ATS_Information *atsi, 1400 const struct GNUNET_ATS_Information *atsi,
1401 unsigned int atsi_count) 1401 unsigned int atsi_count)
1402{ 1402{
1403 const p2p_dv_MESSAGE_Data *incoming = (const p2p_dv_MESSAGE_Data *) message; 1403 const p2p_dv_MESSAGE_Data *incoming = (const p2p_dv_MESSAGE_Data *) message;
1404 const struct GNUNET_MessageHeader *packed_message; 1404 const struct GNUNET_MessageHeader *packed_message;
@@ -2076,14 +2076,13 @@ static int
2076handle_dv_gossip_message (void *cls, const struct GNUNET_PeerIdentity *peer, 2076handle_dv_gossip_message (void *cls, const struct GNUNET_PeerIdentity *peer,
2077 const struct GNUNET_MessageHeader *message, 2077 const struct GNUNET_MessageHeader *message,
2078 const struct GNUNET_ATS_Information *atsi, 2078 const struct GNUNET_ATS_Information *atsi,
2079 unsigned int atsi_count); 2079 unsigned int atsi_count);
2080 2080
2081static int 2081static int
2082handle_dv_disconnect_message (void *cls, const struct GNUNET_PeerIdentity *peer, 2082handle_dv_disconnect_message (void *cls, const struct GNUNET_PeerIdentity *peer,
2083 const struct GNUNET_MessageHeader *message, 2083 const struct GNUNET_MessageHeader *message,
2084 const struct GNUNET_ATS_Information 2084 const struct GNUNET_ATS_Information *atsi,
2085 *atsi, 2085 unsigned int atsi_count);
2086 unsigned int atsi_count);
2087/** End forward declarations **/ 2086/** End forward declarations **/
2088 2087
2089 2088
@@ -2658,10 +2657,10 @@ addUpdateNeighbor (const struct GNUNET_PeerIdentity *peer,
2658 atsi[1].type = htonl (GNUNET_ATS_QUALITY_NET_DELAY); 2657 atsi[1].type = htonl (GNUNET_ATS_QUALITY_NET_DELAY);
2659 atsi[1].value = 2658 atsi[1].value =
2660 htonl ((uint32_t) referrer->pending_messages[i]. 2659 htonl ((uint32_t) referrer->pending_messages[i].
2661 latency.rel_value); 2660 latency.rel_value);
2662 handle_dv_data_message (NULL, &referrer->pending_messages[i].sender, 2661 handle_dv_data_message (NULL, &referrer->pending_messages[i].sender,
2663 referrer->pending_messages[i].message, 2662 referrer->pending_messages[i].message, atsi,
2664 atsi, 2); 2663 2);
2665 GNUNET_free (referrer->pending_messages[i].message); 2664 GNUNET_free (referrer->pending_messages[i].message);
2666 referrer->pending_messages[i].sender_id = 0; 2665 referrer->pending_messages[i].sender_id = 0;
2667 } 2666 }
@@ -2732,9 +2731,8 @@ addUpdateNeighbor (const struct GNUNET_PeerIdentity *peer,
2732static int 2731static int
2733handle_dv_disconnect_message (void *cls, const struct GNUNET_PeerIdentity *peer, 2732handle_dv_disconnect_message (void *cls, const struct GNUNET_PeerIdentity *peer,
2734 const struct GNUNET_MessageHeader *message, 2733 const struct GNUNET_MessageHeader *message,
2735 const struct GNUNET_ATS_Information 2734 const struct GNUNET_ATS_Information *atsi,
2736 *atsi, 2735 unsigned int atsi_count)
2737 unsigned int atsi_count)
2738{ 2736{
2739 struct DirectNeighbor *referrer; 2737 struct DirectNeighbor *referrer;
2740 struct DistantNeighbor *distant; 2738 struct DistantNeighbor *distant;
@@ -2784,7 +2782,7 @@ static int
2784handle_dv_gossip_message (void *cls, const struct GNUNET_PeerIdentity *peer, 2782handle_dv_gossip_message (void *cls, const struct GNUNET_PeerIdentity *peer,
2785 const struct GNUNET_MessageHeader *message, 2783 const struct GNUNET_MessageHeader *message,
2786 const struct GNUNET_ATS_Information *atsi, 2784 const struct GNUNET_ATS_Information *atsi,
2787 unsigned int atsi_count) 2785 unsigned int atsi_count)
2788{ 2786{
2789 struct DirectNeighbor *referrer; 2787 struct DirectNeighbor *referrer;
2790 p2p_dv_MESSAGE_NeighborInfo *enc_message = 2788 p2p_dv_MESSAGE_NeighborInfo *enc_message =
@@ -3087,7 +3085,7 @@ process_peerinfo (void *cls, const struct GNUNET_PeerIdentity *peer,
3087static void 3085static void
3088handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer, 3086handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
3089 const struct GNUNET_ATS_Information *atsi, 3087 const struct GNUNET_ATS_Information *atsi,
3090 unsigned int atsi_count) 3088 unsigned int atsi_count)
3091{ 3089{
3092 struct DirectNeighbor *neighbor; 3090 struct DirectNeighbor *neighbor;
3093 struct DistantNeighbor *about; 3091 struct DistantNeighbor *about;
@@ -3294,8 +3292,8 @@ run (void *cls, struct GNUNET_SERVER_Handle *server,
3294 GNUNET_SERVER_add_handlers (server, plugin_handlers); 3292 GNUNET_SERVER_add_handlers (server, plugin_handlers);
3295 coreAPI = GNUNET_CORE_connect (cfg, 1, NULL, /* FIXME: anything we want to pass around? */ 3293 coreAPI = GNUNET_CORE_connect (cfg, 1, NULL, /* FIXME: anything we want to pass around? */
3296 &core_init, &handle_core_connect, 3294 &core_init, &handle_core_connect,
3297 &handle_core_disconnect, NULL, GNUNET_NO, 3295 &handle_core_disconnect, NULL, GNUNET_NO, NULL,
3298 NULL, GNUNET_NO, core_handlers); 3296 GNUNET_NO, core_handlers);
3299 3297
3300 if (coreAPI == NULL) 3298 if (coreAPI == NULL)
3301 return; 3299 return;
diff --git a/src/dv/plugin_transport_dv.c b/src/dv/plugin_transport_dv.c
index 5e2a6bd6c..6b585f6cc 100644
--- a/src/dv/plugin_transport_dv.c
+++ b/src/dv/plugin_transport_dv.c
@@ -171,8 +171,8 @@ handle_dv_message_received (void *cls, struct GNUNET_PeerIdentity *sender,
171 171
172 plugin->env->receive (plugin->env->cls, sender, 172 plugin->env->receive (plugin->env->cls, sender,
173 (struct GNUNET_MessageHeader *) msg, 173 (struct GNUNET_MessageHeader *) msg,
174 (const struct GNUNET_ATS_Information *) &ats, 174 (const struct GNUNET_ATS_Information *) &ats, 2, NULL,
175 2, NULL, sender_address, sender_address_len); 175 sender_address, sender_address_len);
176 176
177} 177}
178 178
diff --git a/src/dv/test_transport_api_dv.c b/src/dv/test_transport_api_dv.c
index 82b3cb235..0a3bbaa51 100644
--- a/src/dv/test_transport_api_dv.c
+++ b/src/dv/test_transport_api_dv.c
@@ -596,8 +596,8 @@ connect_notify_peer1 (void *cls, const struct GNUNET_PeerIdentity *peer,
596 */ 596 */
597 pos->peer2handle = 597 pos->peer2handle =
598 GNUNET_CORE_connect (pos->peer2->cfg, 1, pos, &init_notify_peer2, 598 GNUNET_CORE_connect (pos->peer2->cfg, 1, pos, &init_notify_peer2,
599 &connect_notify_peer2, NULL, NULL, 599 &connect_notify_peer2, NULL, NULL, GNUNET_YES,
600 GNUNET_YES, NULL, GNUNET_YES, handlers); 600 NULL, GNUNET_YES, handlers);
601 } 601 }
602} 602}
603 603
@@ -646,8 +646,8 @@ send_test_messages (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
646 */ 646 */
647 pos->peer1handle = 647 pos->peer1handle =
648 GNUNET_CORE_connect (pos->peer1->cfg, 1, pos, &init_notify_peer1, 648 GNUNET_CORE_connect (pos->peer1->cfg, 1, pos, &init_notify_peer1,
649 &connect_notify_peer1, NULL, NULL, GNUNET_NO, 649 &connect_notify_peer1, NULL, NULL, GNUNET_NO, NULL,
650 NULL, GNUNET_NO, no_handlers); 650 GNUNET_NO, no_handlers);
651 651
652 GNUNET_assert (pos->peer1handle != NULL); 652 GNUNET_assert (pos->peer1handle != NULL);
653 653
@@ -936,8 +936,8 @@ peers_started_callback (void *cls, const struct GNUNET_PeerIdentity *id,
936 936
937 new_peer = GNUNET_malloc (sizeof (struct PeerContext)); 937 new_peer = GNUNET_malloc (sizeof (struct PeerContext));
938 new_peer->peer_handle = 938 new_peer->peer_handle =
939 GNUNET_CORE_connect (cfg, 1, d, NULL, &all_connect_handler, NULL, 939 GNUNET_CORE_connect (cfg, 1, d, NULL, &all_connect_handler, NULL, NULL,
940 NULL, GNUNET_NO, NULL, GNUNET_NO, no_handlers); 940 GNUNET_NO, NULL, GNUNET_NO, no_handlers);
941 new_peer->daemon = d; 941 new_peer->daemon = d;
942 new_peer->next = all_peers; 942 new_peer->next = all_peers;
943 all_peers = new_peer; 943 all_peers = new_peer;