aboutsummaryrefslogtreecommitdiff
path: root/src/dv
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-10-17 07:55:41 +0000
committerChristian Grothoff <christian@grothoff.org>2011-10-17 07:55:41 +0000
commita2d9b4434076254811584a4a0ffa8881d0903db8 (patch)
tree4f5a2ee5daaabdedb45aa5e7e1d03e3c0f28ed0e /src/dv
parent4b5e8dcb8d6f0d29fffb823e600c73be404d9b39 (diff)
downloadgnunet-a2d9b4434076254811584a4a0ffa8881d0903db8.tar.gz
gnunet-a2d9b4434076254811584a4a0ffa8881d0903db8.zip
move GNUNET_TRANSPORT_ATS_ to GNUNET_ATS_
Diffstat (limited to 'src/dv')
-rw-r--r--src/dv/gnunet-service-dv.c38
-rw-r--r--src/dv/plugin_transport_dv.c8
-rw-r--r--src/dv/test_transport_api_dv.c16
3 files changed, 31 insertions, 31 deletions
diff --git a/src/dv/gnunet-service-dv.c b/src/dv/gnunet-service-dv.c
index 44fa9dee5..3882ed36f 100644
--- a/src/dv/gnunet-service-dv.c
+++ b/src/dv/gnunet-service-dv.c
@@ -1347,12 +1347,12 @@ send_message_delayed (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1347 * @return connected transport distance 1347 * @return connected transport distance
1348 */ 1348 */
1349static uint32_t 1349static uint32_t
1350get_atsi_distance (const struct GNUNET_TRANSPORT_ATS_Information *atsi) 1350get_atsi_distance (const struct GNUNET_ATS_Information *atsi)
1351{ 1351{
1352 while ((ntohl (atsi->type) != GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR) && 1352 while ((ntohl (atsi->type) != GNUNET_ATS_ARRAY_TERMINATOR) &&
1353 (ntohl (atsi->type) != GNUNET_TRANSPORT_ATS_QUALITY_NET_DISTANCE)) 1353 (ntohl (atsi->type) != GNUNET_ATS_QUALITY_NET_DISTANCE))
1354 atsi++; 1354 atsi++;
1355 if (ntohl (atsi->type) == GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR) 1355 if (ntohl (atsi->type) == GNUNET_ATS_ARRAY_TERMINATOR)
1356 { 1356 {
1357 GNUNET_break (0); 1357 GNUNET_break (0);
1358 /* FIXME: we do not have distance data? Assume direct neighbor. */ 1358 /* FIXME: we do not have distance data? Assume direct neighbor. */
@@ -1368,12 +1368,12 @@ get_atsi_distance (const struct GNUNET_TRANSPORT_ATS_Information *atsi)
1368 * @return connection latency 1368 * @return connection latency
1369 */ 1369 */
1370static struct GNUNET_TIME_Relative 1370static struct GNUNET_TIME_Relative
1371get_atsi_latency (const struct GNUNET_TRANSPORT_ATS_Information *atsi) 1371get_atsi_latency (const struct GNUNET_ATS_Information *atsi)
1372{ 1372{
1373 while ((ntohl (atsi->type) != GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR) && 1373 while ((ntohl (atsi->type) != GNUNET_ATS_ARRAY_TERMINATOR) &&
1374 (ntohl (atsi->type) != GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY)) 1374 (ntohl (atsi->type) != GNUNET_ATS_QUALITY_NET_DELAY))
1375 atsi++; 1375 atsi++;
1376 if (ntohl (atsi->type) == GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR) 1376 if (ntohl (atsi->type) == GNUNET_ATS_ARRAY_TERMINATOR)
1377 { 1377 {
1378 GNUNET_break (0); 1378 GNUNET_break (0);
1379 /* how can we not have latency data? */ 1379 /* how can we not have latency data? */
@@ -1398,7 +1398,7 @@ get_atsi_latency (const struct GNUNET_TRANSPORT_ATS_Information *atsi)
1398static int 1398static int
1399handle_dv_data_message (void *cls, const struct GNUNET_PeerIdentity *peer, 1399handle_dv_data_message (void *cls, const struct GNUNET_PeerIdentity *peer,
1400 const struct GNUNET_MessageHeader *message, 1400 const struct GNUNET_MessageHeader *message,
1401 const struct GNUNET_TRANSPORT_ATS_Information *atsi) 1401 const struct GNUNET_ATS_Information *atsi)
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;
@@ -2075,12 +2075,12 @@ handle_dv_send_message (void *cls, struct GNUNET_SERVER_Client *client,
2075static int 2075static 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_TRANSPORT_ATS_Information *atsi); 2078 const struct GNUNET_ATS_Information *atsi);
2079 2079
2080static int 2080static int
2081handle_dv_disconnect_message (void *cls, const struct GNUNET_PeerIdentity *peer, 2081handle_dv_disconnect_message (void *cls, const struct GNUNET_PeerIdentity *peer,
2082 const struct GNUNET_MessageHeader *message, 2082 const struct GNUNET_MessageHeader *message,
2083 const struct GNUNET_TRANSPORT_ATS_Information 2083 const struct GNUNET_ATS_Information
2084 *atsi); 2084 *atsi);
2085/** End forward declarations **/ 2085/** End forward declarations **/
2086 2086
@@ -2649,19 +2649,19 @@ addUpdateNeighbor (const struct GNUNET_PeerIdentity *peer,
2649 "%s: learned about peer %llu from which we have a previous unknown message, processing!\n", 2649 "%s: learned about peer %llu from which we have a previous unknown message, processing!\n",
2650 my_short_id, referrer_peer_id); 2650 my_short_id, referrer_peer_id);
2651#endif 2651#endif
2652 struct GNUNET_TRANSPORT_ATS_Information atsi[3]; 2652 struct GNUNET_ATS_Information atsi[3];
2653 2653
2654 atsi[0].type = htonl (GNUNET_TRANSPORT_ATS_QUALITY_NET_DISTANCE); 2654 atsi[0].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE);
2655 atsi[0].value = htonl (referrer->pending_messages[i].distance); 2655 atsi[0].value = htonl (referrer->pending_messages[i].distance);
2656 atsi[1].type = htonl (GNUNET_TRANSPORT_ATS_QUALITY_NET_DELAY); 2656 atsi[1].type = htonl (GNUNET_ATS_QUALITY_NET_DELAY);
2657 atsi[1].value = 2657 atsi[1].value =
2658 htonl ((uint32_t) referrer->pending_messages[i]. 2658 htonl ((uint32_t) referrer->pending_messages[i].
2659 latency.rel_value); 2659 latency.rel_value);
2660 atsi[2].type = htonl (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR); 2660 atsi[2].type = htonl (GNUNET_ATS_ARRAY_TERMINATOR);
2661 atsi[2].value = htonl (0); 2661 atsi[2].value = htonl (0);
2662 handle_dv_data_message (NULL, &referrer->pending_messages[i].sender, 2662 handle_dv_data_message (NULL, &referrer->pending_messages[i].sender,
2663 referrer->pending_messages[i].message, 2663 referrer->pending_messages[i].message,
2664 (const struct GNUNET_TRANSPORT_ATS_Information 2664 (const struct GNUNET_ATS_Information
2665 *) &atsi); 2665 *) &atsi);
2666 GNUNET_free (referrer->pending_messages[i].message); 2666 GNUNET_free (referrer->pending_messages[i].message);
2667 referrer->pending_messages[i].sender_id = 0; 2667 referrer->pending_messages[i].sender_id = 0;
@@ -2732,7 +2732,7 @@ addUpdateNeighbor (const struct GNUNET_PeerIdentity *peer,
2732static int 2732static int
2733handle_dv_disconnect_message (void *cls, const struct GNUNET_PeerIdentity *peer, 2733handle_dv_disconnect_message (void *cls, const struct GNUNET_PeerIdentity *peer,
2734 const struct GNUNET_MessageHeader *message, 2734 const struct GNUNET_MessageHeader *message,
2735 const struct GNUNET_TRANSPORT_ATS_Information 2735 const struct GNUNET_ATS_Information
2736 *atsi) 2736 *atsi)
2737{ 2737{
2738 struct DirectNeighbor *referrer; 2738 struct DirectNeighbor *referrer;
@@ -2781,7 +2781,7 @@ handle_dv_disconnect_message (void *cls, const struct GNUNET_PeerIdentity *peer,
2781static int 2781static int
2782handle_dv_gossip_message (void *cls, const struct GNUNET_PeerIdentity *peer, 2782handle_dv_gossip_message (void *cls, const struct GNUNET_PeerIdentity *peer,
2783 const struct GNUNET_MessageHeader *message, 2783 const struct GNUNET_MessageHeader *message,
2784 const struct GNUNET_TRANSPORT_ATS_Information *atsi) 2784 const struct GNUNET_ATS_Information *atsi)
2785{ 2785{
2786 struct DirectNeighbor *referrer; 2786 struct DirectNeighbor *referrer;
2787 p2p_dv_MESSAGE_NeighborInfo *enc_message = 2787 p2p_dv_MESSAGE_NeighborInfo *enc_message =
@@ -3082,7 +3082,7 @@ process_peerinfo (void *cls, const struct GNUNET_PeerIdentity *peer,
3082 */ 3082 */
3083static void 3083static void
3084handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer, 3084handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
3085 const struct GNUNET_TRANSPORT_ATS_Information *atsi) 3085 const struct GNUNET_ATS_Information *atsi)
3086{ 3086{
3087 struct DirectNeighbor *neighbor; 3087 struct DirectNeighbor *neighbor;
3088 struct DistantNeighbor *about; 3088 struct DistantNeighbor *about;
diff --git a/src/dv/plugin_transport_dv.c b/src/dv/plugin_transport_dv.c
index feb8a2e57..5e2a6bd6c 100644
--- a/src/dv/plugin_transport_dv.c
+++ b/src/dv/plugin_transport_dv.c
@@ -162,16 +162,16 @@ handle_dv_message_received (void *cls, struct GNUNET_PeerIdentity *sender,
162 distance); 162 distance);
163 GNUNET_free_non_null (my_id); 163 GNUNET_free_non_null (my_id);
164#endif 164#endif
165 struct GNUNET_TRANSPORT_ATS_Information ats[2]; 165 struct GNUNET_ATS_Information ats[2];
166 166
167 ats[0].type = htonl (GNUNET_TRANSPORT_ATS_QUALITY_NET_DISTANCE); 167 ats[0].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE);
168 ats[0].value = htonl (distance); 168 ats[0].value = htonl (distance);
169 ats[1].type = htonl (GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR); 169 ats[1].type = htonl (GNUNET_ATS_ARRAY_TERMINATOR);
170 ats[1].value = htonl (0); 170 ats[1].value = htonl (0);
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_TRANSPORT_ATS_Information *) &ats, 174 (const struct GNUNET_ATS_Information *) &ats,
175 2, NULL, sender_address, sender_address_len); 175 2, NULL, sender_address, sender_address_len);
176 176
177} 177}
diff --git a/src/dv/test_transport_api_dv.c b/src/dv/test_transport_api_dv.c
index a38e2fa29..82b3cb235 100644
--- a/src/dv/test_transport_api_dv.c
+++ b/src/dv/test_transport_api_dv.c
@@ -394,12 +394,12 @@ send_other_messages (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
394 * @return connected transport distance 394 * @return connected transport distance
395 */ 395 */
396static uint32_t 396static uint32_t
397get_atsi_distance (const struct GNUNET_TRANSPORT_ATS_Information *atsi) 397get_atsi_distance (const struct GNUNET_ATS_Information *atsi)
398{ 398{
399 while ((ntohl (atsi->type) != GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR) && 399 while ((ntohl (atsi->type) != GNUNET_ATS_ARRAY_TERMINATOR) &&
400 (ntohl (atsi->type) != GNUNET_TRANSPORT_ATS_QUALITY_NET_DISTANCE)) 400 (ntohl (atsi->type) != GNUNET_ATS_QUALITY_NET_DISTANCE))
401 atsi++; 401 atsi++;
402 if (ntohl (atsi->type) == GNUNET_TRANSPORT_ATS_ARRAY_TERMINATOR) 402 if (ntohl (atsi->type) == GNUNET_ATS_ARRAY_TERMINATOR)
403 { 403 {
404 GNUNET_break (0); 404 GNUNET_break (0);
405 /* FIXME: we do not have distance data? Assume direct neighbor. */ 405 /* FIXME: we do not have distance data? Assume direct neighbor. */
@@ -411,7 +411,7 @@ get_atsi_distance (const struct GNUNET_TRANSPORT_ATS_Information *atsi)
411static int 411static int
412process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, 412process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
413 const struct GNUNET_MessageHeader *message, 413 const struct GNUNET_MessageHeader *message,
414 const struct GNUNET_TRANSPORT_ATS_Information *atsi) 414 const struct GNUNET_ATS_Information *atsi)
415{ 415{
416 struct TestMessageContext *pos = cls; 416 struct TestMessageContext *pos = cls;
417 struct GNUNET_TestMessage *msg = (struct GNUNET_TestMessage *) message; 417 struct GNUNET_TestMessage *msg = (struct GNUNET_TestMessage *) message;
@@ -527,7 +527,7 @@ static struct GNUNET_CORE_MessageHandler handlers[] = {
527 */ 527 */
528static void 528static void
529connect_notify_peer2 (void *cls, const struct GNUNET_PeerIdentity *peer, 529connect_notify_peer2 (void *cls, const struct GNUNET_PeerIdentity *peer,
530 const struct GNUNET_TRANSPORT_ATS_Information *atsi) 530 const struct GNUNET_ATS_Information *atsi)
531{ 531{
532 struct TestMessageContext *pos = cls; 532 struct TestMessageContext *pos = cls;
533 533
@@ -580,7 +580,7 @@ init_notify_peer2 (void *cls, struct GNUNET_CORE_Handle *server,
580 */ 580 */
581static void 581static void
582connect_notify_peer1 (void *cls, const struct GNUNET_PeerIdentity *peer, 582connect_notify_peer1 (void *cls, const struct GNUNET_PeerIdentity *peer,
583 const struct GNUNET_TRANSPORT_ATS_Information *atsi) 583 const struct GNUNET_ATS_Information *atsi)
584{ 584{
585 struct TestMessageContext *pos = cls; 585 struct TestMessageContext *pos = cls;
586 586
@@ -840,7 +840,7 @@ topology_callback (void *cls, const struct GNUNET_PeerIdentity *first,
840 */ 840 */
841static void 841static void
842all_connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer, 842all_connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
843 const struct GNUNET_TRANSPORT_ATS_Information *atsi) 843 const struct GNUNET_ATS_Information *atsi)
844{ 844{
845 struct GNUNET_TESTING_Daemon *d = cls; 845 struct GNUNET_TESTING_Daemon *d = cls;
846 struct GNUNET_TESTING_Daemon *second_daemon; 846 struct GNUNET_TESTING_Daemon *second_daemon;