aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/core.h6
-rw-r--r--src/core/core_api.c24
-rw-r--r--src/core/core_api_iterate_peers.c17
-rw-r--r--src/core/gnunet-core-list-connections.c3
-rw-r--r--src/core/gnunet-service-core_clients.c4
-rw-r--r--src/core/gnunet-service-core_sessions.c6
-rw-r--r--src/core/test_core_api.c8
-rw-r--r--src/core/test_core_api_reliability.c8
-rw-r--r--src/core/test_core_api_send_to_self.c4
-rw-r--r--src/core/test_core_api_start_only.c9
-rw-r--r--src/core/test_core_quota_compliance.c8
-rw-r--r--src/dht/gnunet-service-dht_neighbours.c16
-rw-r--r--src/fs/gnunet-service-fs.c14
-rw-r--r--src/fs/gnunet-service-fs_cp.c43
-rw-r--r--src/fs/gnunet-service-fs_cp.h8
-rw-r--r--src/hostlist/gnunet-daemon-hostlist.c15
-rw-r--r--src/hostlist/hostlist-client.c8
-rw-r--r--src/hostlist/hostlist-server.c4
-rw-r--r--src/hostlist/test_gnunet_daemon_hostlist_learning.c3
-rw-r--r--src/include/gnunet_core_service.h8
-rw-r--r--src/include/gnunet_mesh_service.h8
-rw-r--r--src/mesh/gnunet-service-mesh.c38
-rw-r--r--src/mesh/mesh_api.c27
-rw-r--r--src/nse/gnunet-service-nse.c9
-rw-r--r--src/testing/test_testing_topology.c7
-rw-r--r--src/testing/testing.c8
-rw-r--r--src/testing/testing_group.c5
-rw-r--r--src/topology/gnunet-daemon-topology.c8
-rw-r--r--src/vpn/gnunet-daemon-exit.c16
-rw-r--r--src/vpn/gnunet-daemon-vpn-helper.c8
-rw-r--r--src/vpn/gnunet-daemon-vpn.c12
-rw-r--r--src/vpn/gnunet-daemon-vpn.h3
-rw-r--r--src/vpn/gnunet-service-dns.c12
33 files changed, 230 insertions, 147 deletions
diff --git a/src/core/core.h b/src/core/core.h
index 71969c3e0..b76528a8e 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -119,12 +119,6 @@ struct ConnectNotifyMessage
119 */ 119 */
120 struct GNUNET_PeerIdentity peer; 120 struct GNUNET_PeerIdentity peer;
121 121
122 /**
123 * First of the ATS information blocks (we must have at least
124 * one due to the 0-termination requirement).
125 */
126 struct GNUNET_ATS_Information ats;
127
128}; 122};
129 123
130 124
diff --git a/src/core/core_api.c b/src/core/core_api.c
index b903d73bb..3349f79ab 100644
--- a/src/core/core_api.c
+++ b/src/core/core_api.c
@@ -781,6 +781,7 @@ main_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg)
781 const struct GNUNET_MessageHeader *em; 781 const struct GNUNET_MessageHeader *em;
782 const struct SendMessageReady *smr; 782 const struct SendMessageReady *smr;
783 const struct GNUNET_CORE_MessageHandler *mh; 783 const struct GNUNET_CORE_MessageHandler *mh;
784 const struct GNUNET_ATS_Information* ats;
784 GNUNET_CORE_StartupCallback init; 785 GNUNET_CORE_StartupCallback init;
785 struct PeerRecord *pr; 786 struct PeerRecord *pr;
786 struct GNUNET_CORE_TransmitHandle *th; 787 struct GNUNET_CORE_TransmitHandle *th;
@@ -851,7 +852,7 @@ main_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg)
851 &h->me.hashPubKey, pr, 852 &h->me.hashPubKey, pr,
852 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST)); 853 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST));
853 if (NULL != h->connects) 854 if (NULL != h->connects)
854 h->connects (h->cls, &h->me, NULL); 855 h->connects (h->cls, &h->me, NULL, 0);
855 break; 856 break;
856 case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT: 857 case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT:
857 if (msize < sizeof (struct ConnectNotifyMessage)) 858 if (msize < sizeof (struct ConnectNotifyMessage))
@@ -862,11 +863,9 @@ main_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg)
862 } 863 }
863 cnm = (const struct ConnectNotifyMessage *) msg; 864 cnm = (const struct ConnectNotifyMessage *) msg;
864 ats_count = ntohl (cnm->ats_count); 865 ats_count = ntohl (cnm->ats_count);
865 if ((msize != 866 if (msize !=
866 sizeof (struct ConnectNotifyMessage) + 867 sizeof (struct ConnectNotifyMessage) +
867 ats_count * sizeof (struct GNUNET_ATS_Information)) || 868 ats_count * sizeof (struct GNUNET_ATS_Information))
868 (GNUNET_ATS_ARRAY_TERMINATOR !=
869 ntohl ((&cnm->ats)[ats_count].type)))
870 { 869 {
871 GNUNET_break (0); 870 GNUNET_break (0);
872 reconnect_later (h); 871 reconnect_later (h);
@@ -897,8 +896,11 @@ main_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg)
897 GNUNET_CONTAINER_multihashmap_put (h->peers, 896 GNUNET_CONTAINER_multihashmap_put (h->peers,
898 &cnm->peer.hashPubKey, pr, 897 &cnm->peer.hashPubKey, pr,
899 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST)); 898 GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST));
899 ats = (const struct GNUNET_ATS_Information*) &cnm[1];
900 if (NULL != h->connects) 900 if (NULL != h->connects)
901 h->connects (h->cls, &cnm->peer, &cnm->ats); 901 h->connects (h->cls, &cnm->peer,
902 ats,
903 ats_count);
902 break; 904 break;
903 case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT: 905 case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT:
904 if (msize != sizeof (struct DisconnectNotifyMessage)) 906 if (msize != sizeof (struct DisconnectNotifyMessage))
@@ -988,14 +990,16 @@ main_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg)
988 continue; 990 continue;
989 } 991 }
990 if (GNUNET_OK != 992 if (GNUNET_OK !=
991 h->handlers[hpos].callback (h->cls, &ntm->peer, em, &ntm->ats)) 993 h->handlers[hpos].callback (h->cls, &ntm->peer, em, &ntm->ats,
994 ats_count))
992 { 995 {
993 /* error in processing, do not process other messages! */ 996 /* error in processing, do not process other messages! */
994 break; 997 break;
995 } 998 }
996 } 999 }
997 if (NULL != h->inbound_notify) 1000 if (NULL != h->inbound_notify)
998 h->inbound_notify (h->cls, &ntm->peer, em, &ntm->ats); 1001 h->inbound_notify (h->cls, &ntm->peer, em, &ntm->ats,
1002 ats_count);
999 break; 1003 break;
1000 case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_OUTBOUND: 1004 case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_OUTBOUND:
1001 if (msize < sizeof (struct NotifyTrafficMessage)) 1005 if (msize < sizeof (struct NotifyTrafficMessage))
@@ -1050,7 +1054,7 @@ main_notify_handler (void *cls, const struct GNUNET_MessageHeader *msg)
1050 GNUNET_break (0); 1054 GNUNET_break (0);
1051 break; 1055 break;
1052 } 1056 }
1053 h->outbound_notify (h->cls, &ntm->peer, em, &ntm->ats); 1057 h->outbound_notify (h->cls, &ntm->peer, em, &ntm->ats, ats_count);
1054 break; 1058 break;
1055 case GNUNET_MESSAGE_TYPE_CORE_SEND_READY: 1059 case GNUNET_MESSAGE_TYPE_CORE_SEND_READY:
1056 if (msize != sizeof (struct SendMessageReady)) 1060 if (msize != sizeof (struct SendMessageReady))
diff --git a/src/core/core_api_iterate_peers.c b/src/core/core_api_iterate_peers.c
index ed9ea175e..7bf40a678 100644
--- a/src/core/core_api_iterate_peers.c
+++ b/src/core/core_api_iterate_peers.c
@@ -79,7 +79,7 @@ receive_info (void *cls, const struct GNUNET_MessageHeader *msg)
79 (ntohs (msg->size) == sizeof (struct GNUNET_MessageHeader)))) 79 (ntohs (msg->size) == sizeof (struct GNUNET_MessageHeader))))
80 { 80 {
81 if (request_context->peer_cb != NULL) 81 if (request_context->peer_cb != NULL)
82 request_context->peer_cb (request_context->cb_cls, NULL, NULL); 82 request_context->peer_cb (request_context->cb_cls, NULL, NULL, 0);
83 GNUNET_CLIENT_disconnect (request_context->client, GNUNET_NO); 83 GNUNET_CLIENT_disconnect (request_context->client, GNUNET_NO);
84 GNUNET_free (request_context); 84 GNUNET_free (request_context);
85 return; 85 return;
@@ -92,22 +92,20 @@ receive_info (void *cls, const struct GNUNET_MessageHeader *msg)
92 { 92 {
93 GNUNET_break (0); 93 GNUNET_break (0);
94 if (request_context->peer_cb != NULL) 94 if (request_context->peer_cb != NULL)
95 request_context->peer_cb (request_context->cb_cls, NULL, NULL); 95 request_context->peer_cb (request_context->cb_cls, NULL, NULL, 0);
96 GNUNET_CLIENT_disconnect (request_context->client, GNUNET_NO); 96 GNUNET_CLIENT_disconnect (request_context->client, GNUNET_NO);
97 GNUNET_free (request_context); 97 GNUNET_free (request_context);
98 return; 98 return;
99 } 99 }
100 connect_message = (const struct ConnectNotifyMessage *) msg; 100 connect_message = (const struct ConnectNotifyMessage *) msg;
101 ats_count = ntohl (connect_message->ats_count); 101 ats_count = ntohl (connect_message->ats_count);
102 if ((msize != 102 if (msize !=
103 sizeof (struct ConnectNotifyMessage) + 103 sizeof (struct ConnectNotifyMessage) +
104 ats_count * sizeof (struct GNUNET_ATS_Information)) || 104 ats_count * sizeof (struct GNUNET_ATS_Information))
105 (GNUNET_ATS_ARRAY_TERMINATOR !=
106 ntohl ((&connect_message->ats)[ats_count].type)))
107 { 105 {
108 GNUNET_break (0); 106 GNUNET_break (0);
109 if (request_context->peer_cb != NULL) 107 if (request_context->peer_cb != NULL)
110 request_context->peer_cb (request_context->cb_cls, NULL, NULL); 108 request_context->peer_cb (request_context->cb_cls, NULL, NULL, 0);
111 GNUNET_CLIENT_disconnect (request_context->client, GNUNET_NO); 109 GNUNET_CLIENT_disconnect (request_context->client, GNUNET_NO);
112 GNUNET_free (request_context); 110 GNUNET_free (request_context);
113 return; 111 return;
@@ -115,7 +113,8 @@ receive_info (void *cls, const struct GNUNET_MessageHeader *msg)
115 /* Normal case */ 113 /* Normal case */
116 if (request_context->peer_cb != NULL) 114 if (request_context->peer_cb != NULL)
117 request_context->peer_cb (request_context->cb_cls, &connect_message->peer, 115 request_context->peer_cb (request_context->cb_cls, &connect_message->peer,
118 &connect_message->ats); 116 (const struct GNUNET_ATS_Information *) &connect_message[1],
117 ats_count);
119 GNUNET_CLIENT_receive (request_context->client, &receive_info, 118 GNUNET_CLIENT_receive (request_context->client, &receive_info,
120 request_context, GNUNET_TIME_UNIT_FOREVER_REL); 119 request_context, GNUNET_TIME_UNIT_FOREVER_REL);
121} 120}
diff --git a/src/core/gnunet-core-list-connections.c b/src/core/gnunet-core-list-connections.c
index ae7feb915..9665110a3 100644
--- a/src/core/gnunet-core-list-connections.c
+++ b/src/core/gnunet-core-list-connections.c
@@ -123,7 +123,8 @@ process_resolved_address (void *cls, const char *address)
123 */ 123 */
124static void 124static void
125connected_peer_callback (void *cls, const struct GNUNET_PeerIdentity *peer, 125connected_peer_callback (void *cls, const struct GNUNET_PeerIdentity *peer,
126 const struct GNUNET_ATS_Information *atsi) 126 const struct GNUNET_ATS_Information *atsi,
127 unsigned int atsi_count)
127{ 128{
128 struct PrintContext *pc; 129 struct PrintContext *pc;
129 130
diff --git a/src/core/gnunet-service-core_clients.c b/src/core/gnunet-service-core_clients.c
index 146b251be..47bbd98db 100644
--- a/src/core/gnunet-service-core_clients.c
+++ b/src/core/gnunet-service-core_clients.c
@@ -658,11 +658,9 @@ GSC_CLIENTS_notify_client_about_neighbour (struct GSC_Client *client,
658 cnm->header.size = htons (size); 658 cnm->header.size = htons (size);
659 cnm->header.type = htons (GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT); 659 cnm->header.type = htons (GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT);
660 cnm->ats_count = htonl (atsi_count); 660 cnm->ats_count = htonl (atsi_count);
661 a = &cnm->ats; 661 a = (struct GNUNET_ATS_Information* ) &cnm[1];
662 memcpy (a, atsi, 662 memcpy (a, atsi,
663 sizeof (struct GNUNET_ATS_Information) * atsi_count); 663 sizeof (struct GNUNET_ATS_Information) * atsi_count);
664 a[atsi_count].type = htonl (GNUNET_ATS_ARRAY_TERMINATOR);
665 a[atsi_count].value = htonl (0);
666#if DEBUG_CORE 664#if DEBUG_CORE
667 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 665 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
668 "Sending `%s' message to client.\n", 666 "Sending `%s' message to client.\n",
diff --git a/src/core/gnunet-service-core_sessions.c b/src/core/gnunet-service-core_sessions.c
index fc9576a93..61532ac9c 100644
--- a/src/core/gnunet-service-core_sessions.c
+++ b/src/core/gnunet-service-core_sessions.c
@@ -672,17 +672,13 @@ queue_connect_message (void *cls, const GNUNET_HashCode * key, void *value)
672 struct GNUNET_SERVER_TransmitContext *tc = cls; 672 struct GNUNET_SERVER_TransmitContext *tc = cls;
673 struct Session *session = value; 673 struct Session *session = value;
674 struct ConnectNotifyMessage cnm; 674 struct ConnectNotifyMessage cnm;
675 struct GNUNET_ATS_Information *a;
676 675
677 /* FIXME: code duplication with clients... */ 676 /* FIXME: code duplication with clients... */
678 cnm.header.size = htons (sizeof (struct ConnectNotifyMessage)); 677 cnm.header.size = htons (sizeof (struct ConnectNotifyMessage));
679 cnm.header.type = htons (GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT); 678 cnm.header.type = htons (GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT);
679 // FIXME: full ats...
680 cnm.ats_count = htonl (0); 680 cnm.ats_count = htonl (0);
681 cnm.peer = session->peer; 681 cnm.peer = session->peer;
682 a = &cnm.ats;
683 // FIXME: full ats...
684 a[0].type = htonl (GNUNET_ATS_ARRAY_TERMINATOR);
685 a[0].value = htonl (0);
686 GNUNET_SERVER_transmit_context_append_message (tc, &cnm.header); 682 GNUNET_SERVER_transmit_context_append_message (tc, &cnm.header);
687 return GNUNET_OK; 683 return GNUNET_OK;
688} 684}
diff --git a/src/core/test_core_api.c b/src/core/test_core_api.c
index 56b7412c3..be3edf974 100644
--- a/src/core/test_core_api.c
+++ b/src/core/test_core_api.c
@@ -165,7 +165,7 @@ transmit_ready (void *cls, size_t size, void *buf)
165 165
166static void 166static void
167connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer, 167connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
168 const struct GNUNET_ATS_Information *atsi) 168 const struct GNUNET_ATS_Information *atsi, unsigned int atsi_count)
169{ 169{
170 struct PeerContext *pc = cls; 170 struct PeerContext *pc = cls;
171 171
@@ -218,7 +218,7 @@ disconnect_notify (void *cls, const struct GNUNET_PeerIdentity *peer)
218static int 218static int
219inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, 219inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
220 const struct GNUNET_MessageHeader *message, 220 const struct GNUNET_MessageHeader *message,
221 const struct GNUNET_ATS_Information *atsi) 221 const struct GNUNET_ATS_Information *atsi, unsigned int atsi_count)
222{ 222{
223 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 223 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
224 "Core provides inbound data from `%4s'.\n", GNUNET_i2s (other)); 224 "Core provides inbound data from `%4s'.\n", GNUNET_i2s (other));
@@ -229,7 +229,7 @@ inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
229static int 229static int
230outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, 230outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
231 const struct GNUNET_MessageHeader *message, 231 const struct GNUNET_MessageHeader *message,
232 const struct GNUNET_ATS_Information *atsi) 232 const struct GNUNET_ATS_Information *atsi, unsigned int atsi_count)
233{ 233{
234 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 234 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
235 "Core notifies about outbound data for `%4s'.\n", 235 "Core notifies about outbound data for `%4s'.\n",
@@ -242,7 +242,7 @@ outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
242static int 242static int
243process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, 243process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
244 const struct GNUNET_MessageHeader *message, 244 const struct GNUNET_MessageHeader *message,
245 const struct GNUNET_ATS_Information *atsi) 245 const struct GNUNET_ATS_Information *atsi, unsigned int atsi_count)
246{ 246{
247 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving message from `%4s'.\n", 247 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving message from `%4s'.\n",
248 GNUNET_i2s (peer)); 248 GNUNET_i2s (peer));
diff --git a/src/core/test_core_api_reliability.c b/src/core/test_core_api_reliability.c
index f40b61660..6a764c126 100644
--- a/src/core/test_core_api_reliability.c
+++ b/src/core/test_core_api_reliability.c
@@ -239,7 +239,7 @@ transmit_ready (void *cls, size_t size, void *buf)
239 239
240static void 240static void
241connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer, 241connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
242 const struct GNUNET_ATS_Information *atsi) 242 const struct GNUNET_ATS_Information *atsi, unsigned int atsi_count)
243{ 243{
244 struct PeerContext *pc = cls; 244 struct PeerContext *pc = cls;
245 245
@@ -284,7 +284,7 @@ disconnect_notify (void *cls, const struct GNUNET_PeerIdentity *peer)
284static int 284static int
285inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, 285inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
286 const struct GNUNET_MessageHeader *message, 286 const struct GNUNET_MessageHeader *message,
287 const struct GNUNET_ATS_Information *atsi) 287 const struct GNUNET_ATS_Information *atsi, unsigned int atsi_count)
288{ 288{
289#if VERBOSE 289#if VERBOSE
290 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 290 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -297,7 +297,7 @@ inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
297static int 297static int
298outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, 298outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
299 const struct GNUNET_MessageHeader *message, 299 const struct GNUNET_MessageHeader *message,
300 const struct GNUNET_ATS_Information *atsi) 300 const struct GNUNET_ATS_Information *atsi, unsigned int atsi_count)
301{ 301{
302#if VERBOSE 302#if VERBOSE
303 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 303 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -314,7 +314,7 @@ transmit_ready (void *cls, size_t size, void *buf);
314static int 314static int
315process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, 315process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
316 const struct GNUNET_MessageHeader *message, 316 const struct GNUNET_MessageHeader *message,
317 const struct GNUNET_ATS_Information *atsi) 317 const struct GNUNET_ATS_Information *atsi, unsigned int atsi_count)
318{ 318{
319 static int n; 319 static int n;
320 unsigned int s; 320 unsigned int s;
diff --git a/src/core/test_core_api_send_to_self.c b/src/core/test_core_api_send_to_self.c
index a1c361376..cf9608ede 100644
--- a/src/core/test_core_api_send_to_self.c
+++ b/src/core/test_core_api_send_to_self.c
@@ -90,7 +90,7 @@ cleanup (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tskctx)
90static int 90static int
91receive (void *cls, const struct GNUNET_PeerIdentity *other, 91receive (void *cls, const struct GNUNET_PeerIdentity *other,
92 const struct GNUNET_MessageHeader *message, 92 const struct GNUNET_MessageHeader *message,
93 const struct GNUNET_ATS_Information *atsi) 93 const struct GNUNET_ATS_Information *atsi, unsigned int atsi_count)
94{ 94{
95 if (die_task != GNUNET_SCHEDULER_NO_TASK) 95 if (die_task != GNUNET_SCHEDULER_NO_TASK)
96 GNUNET_SCHEDULER_cancel (die_task); 96 GNUNET_SCHEDULER_cancel (die_task);
@@ -134,7 +134,7 @@ init (void *cls, struct GNUNET_CORE_Handle *core,
134 134
135static void 135static void
136connect_cb (void *cls, const struct GNUNET_PeerIdentity *peer, 136connect_cb (void *cls, const struct GNUNET_PeerIdentity *peer,
137 const struct GNUNET_ATS_Information *atsi) 137 const struct GNUNET_ATS_Information *atsi, unsigned int atsi_count)
138{ 138{
139 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connected to peer %s.\n", 139 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connected to peer %s.\n",
140 GNUNET_i2s (peer)); 140 GNUNET_i2s (peer));
diff --git a/src/core/test_core_api_start_only.c b/src/core/test_core_api_start_only.c
index 9825131be..f27866c19 100644
--- a/src/core/test_core_api_start_only.c
+++ b/src/core/test_core_api_start_only.c
@@ -67,7 +67,8 @@ static int ok;
67 67
68static void 68static void
69connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer, 69connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
70 const struct GNUNET_ATS_Information *atsi) 70 const struct GNUNET_ATS_Information *atsi,
71 unsigned int atsi_count)
71{ 72{
72} 73}
73 74
@@ -81,7 +82,8 @@ disconnect_notify (void *cls, const struct GNUNET_PeerIdentity *peer)
81static int 82static int
82inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, 83inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
83 const struct GNUNET_MessageHeader *message, 84 const struct GNUNET_MessageHeader *message,
84 const struct GNUNET_ATS_Information *atsi) 85 const struct GNUNET_ATS_Information *atsi,
86 unsigned int atsi_count)
85{ 87{
86 return GNUNET_OK; 88 return GNUNET_OK;
87} 89}
@@ -90,7 +92,8 @@ inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
90static int 92static int
91outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, 93outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
92 const struct GNUNET_MessageHeader *message, 94 const struct GNUNET_MessageHeader *message,
93 const struct GNUNET_ATS_Information *atsi) 95 const struct GNUNET_ATS_Information *atsi,
96 unsigned int atsi_count)
94{ 97{
95 return GNUNET_OK; 98 return GNUNET_OK;
96} 99}
diff --git a/src/core/test_core_quota_compliance.c b/src/core/test_core_quota_compliance.c
index c8dcfad86..be875c235 100644
--- a/src/core/test_core_quota_compliance.c
+++ b/src/core/test_core_quota_compliance.c
@@ -364,7 +364,7 @@ transmit_ready (void *cls, size_t size, void *buf)
364 364
365static void 365static void
366connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer, 366connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
367 const struct GNUNET_ATS_Information *atsi) 367 const struct GNUNET_ATS_Information *atsi, unsigned int atsi_count)
368{ 368{
369 struct PeerContext *pc = cls; 369 struct PeerContext *pc = cls;
370 370
@@ -431,7 +431,7 @@ disconnect_notify (void *cls, const struct GNUNET_PeerIdentity *peer)
431static int 431static int
432inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, 432inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
433 const struct GNUNET_MessageHeader *message, 433 const struct GNUNET_MessageHeader *message,
434 const struct GNUNET_ATS_Information *atsi) 434 const struct GNUNET_ATS_Information *atsi, unsigned int atsi_count)
435{ 435{
436#if DEBUG_TRANSMISSION 436#if DEBUG_TRANSMISSION
437 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 437 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -446,7 +446,7 @@ inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
446static int 446static int
447outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other, 447outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
448 const struct GNUNET_MessageHeader *message, 448 const struct GNUNET_MessageHeader *message,
449 const struct GNUNET_ATS_Information *atsi) 449 const struct GNUNET_ATS_Information *atsi, unsigned int atsi_count)
450{ 450{
451#if DEBUG_TRANSMISSION 451#if DEBUG_TRANSMISSION
452 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 452 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -463,7 +463,7 @@ transmit_ready (void *cls, size_t size, void *buf);
463static int 463static int
464process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, 464process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
465 const struct GNUNET_MessageHeader *message, 465 const struct GNUNET_MessageHeader *message,
466 const struct GNUNET_ATS_Information *atsi) 466 const struct GNUNET_ATS_Information *atsi, unsigned int atsi_count)
467{ 467{
468 static int n; 468 static int n;
469 const struct TestMessage *hdr; 469 const struct TestMessage *hdr;
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c
index 9d0bd996d..45df22b89 100644
--- a/src/dht/gnunet-service-dht_neighbours.c
+++ b/src/dht/gnunet-service-dht_neighbours.c
@@ -600,10 +600,12 @@ send_find_peer_message (void *cls,
600 * @param cls closure 600 * @param cls closure
601 * @param peer peer identity this notification is about 601 * @param peer peer identity this notification is about
602 * @param atsi performance data 602 * @param atsi performance data
603 * @param atsi_count number of records in 'atsi'
603 */ 604 */
604static void 605static void
605handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer, 606handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
606 const struct GNUNET_ATS_Information *atsi) 607 const struct GNUNET_ATS_Information *atsi,
608 unsigned int atsi_count)
607{ 609{
608 struct PeerInfo *ret; 610 struct PeerInfo *ret;
609 int peer_bucket; 611 int peer_bucket;
@@ -1508,6 +1510,7 @@ core_init (void *cls, struct GNUNET_CORE_Handle *server,
1508 * @param message message 1510 * @param message message
1509 * @param peer peer identity this notification is about 1511 * @param peer peer identity this notification is about
1510 * @param atsi performance data 1512 * @param atsi performance data
1513 * @param atsi_count number of records in 'atsi'
1511 * @return GNUNET_OK to keep the connection open, 1514 * @return GNUNET_OK to keep the connection open,
1512 * GNUNET_SYSERR to close it (signal serious error) 1515 * GNUNET_SYSERR to close it (signal serious error)
1513 */ 1516 */
@@ -1516,7 +1519,8 @@ handle_dht_p2p_put (void *cls,
1516 const struct GNUNET_PeerIdentity *peer, 1519 const struct GNUNET_PeerIdentity *peer,
1517 const struct GNUNET_MessageHeader *message, 1520 const struct GNUNET_MessageHeader *message,
1518 const struct GNUNET_ATS_Information 1521 const struct GNUNET_ATS_Information
1519 *atsi) 1522 *atsi,
1523 unsigned int atsi_count)
1520{ 1524{
1521 const struct PeerPutMessage *put; 1525 const struct PeerPutMessage *put;
1522 const struct GNUNET_PeerIdentity *put_path; 1526 const struct GNUNET_PeerIdentity *put_path;
@@ -1729,6 +1733,7 @@ handle_find_peer (const struct GNUNET_PeerIdentity *sender,
1729 * @param message message 1733 * @param message message
1730 * @param peer peer identity this notification is about 1734 * @param peer peer identity this notification is about
1731 * @param atsi performance data 1735 * @param atsi performance data
1736 * @param atsi_count number of records in 'atsi'
1732 * @return GNUNET_OK to keep the connection open, 1737 * @return GNUNET_OK to keep the connection open,
1733 * GNUNET_SYSERR to close it (signal serious error) 1738 * GNUNET_SYSERR to close it (signal serious error)
1734 */ 1739 */
@@ -1736,7 +1741,8 @@ static int
1736handle_dht_p2p_get (void *cls, const struct GNUNET_PeerIdentity *peer, 1741handle_dht_p2p_get (void *cls, const struct GNUNET_PeerIdentity *peer,
1737 const struct GNUNET_MessageHeader *message, 1742 const struct GNUNET_MessageHeader *message,
1738 const struct GNUNET_ATS_Information 1743 const struct GNUNET_ATS_Information
1739 *atsi) 1744 *atsi,
1745 unsigned int atsi_count)
1740{ 1746{
1741 struct PeerGetMessage *get; 1747 struct PeerGetMessage *get;
1742 uint32_t xquery_size; 1748 uint32_t xquery_size;
@@ -1865,13 +1871,15 @@ handle_dht_p2p_get (void *cls, const struct GNUNET_PeerIdentity *peer,
1865 * @param message message 1871 * @param message message
1866 * @param peer peer identity this notification is about 1872 * @param peer peer identity this notification is about
1867 * @param atsi performance data 1873 * @param atsi performance data
1874 * @param atsi_count number of records in 'atsi'
1868 * @return GNUNET_YES (do not cut p2p connection) 1875 * @return GNUNET_YES (do not cut p2p connection)
1869 */ 1876 */
1870static int 1877static int
1871handle_dht_p2p_result (void *cls, const struct GNUNET_PeerIdentity *peer, 1878handle_dht_p2p_result (void *cls, const struct GNUNET_PeerIdentity *peer,
1872 const struct GNUNET_MessageHeader *message, 1879 const struct GNUNET_MessageHeader *message,
1873 const struct GNUNET_ATS_Information 1880 const struct GNUNET_ATS_Information
1874 *atsi) 1881 *atsi,
1882 unsigned int atsi_count)
1875{ 1883{
1876 const struct PeerResultMessage *prm; 1884 const struct PeerResultMessage *prm;
1877 const struct GNUNET_PeerIdentity *put_path; 1885 const struct GNUNET_PeerIdentity *put_path;
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c
index 6ea47c2e2..c5933d989 100644
--- a/src/fs/gnunet-service-fs.c
+++ b/src/fs/gnunet-service-fs.c
@@ -220,13 +220,15 @@ GSF_test_get_load_too_high_ (uint32_t priority)
220 * for loopback messages where we are both sender and receiver) 220 * for loopback messages where we are both sender and receiver)
221 * @param message the actual message 221 * @param message the actual message
222 * @param atsi performance information 222 * @param atsi performance information
223 * @param atsi_count number of records in 'atsi'
223 * @return GNUNET_OK to keep the connection open, 224 * @return GNUNET_OK to keep the connection open,
224 * GNUNET_SYSERR to close it (signal serious error) 225 * GNUNET_SYSERR to close it (signal serious error)
225 */ 226 */
226static int 227static int
227handle_p2p_put (void *cls, const struct GNUNET_PeerIdentity *other, 228handle_p2p_put (void *cls, const struct GNUNET_PeerIdentity *other,
228 const struct GNUNET_MessageHeader *message, 229 const struct GNUNET_MessageHeader *message,
229 const struct GNUNET_ATS_Information *atsi) 230 const struct GNUNET_ATS_Information *atsi,
231 unsigned int atsi_count)
230{ 232{
231 struct GSF_ConnectedPeer *cp; 233 struct GSF_ConnectedPeer *cp;
232 234
@@ -299,13 +301,15 @@ consider_forwarding (void *cls, struct GSF_PendingRequest *pr,
299 * for loopback messages where we are both sender and receiver) 301 * for loopback messages where we are both sender and receiver)
300 * @param message the actual message 302 * @param message the actual message
301 * @param atsi performance information 303 * @param atsi performance information
304 * @param atsi_count number of records in 'atsi'
302 * @return GNUNET_OK to keep the connection open, 305 * @return GNUNET_OK to keep the connection open,
303 * GNUNET_SYSERR to close it (signal serious error) 306 * GNUNET_SYSERR to close it (signal serious error)
304 */ 307 */
305static int 308static int
306handle_p2p_get (void *cls, const struct GNUNET_PeerIdentity *other, 309handle_p2p_get (void *cls, const struct GNUNET_PeerIdentity *other,
307 const struct GNUNET_MessageHeader *message, 310 const struct GNUNET_MessageHeader *message,
308 const struct GNUNET_ATS_Information *atsi) 311 const struct GNUNET_ATS_Information *atsi,
312 unsigned int atsi_count)
309{ 313{
310 struct GSF_PendingRequest *pr; 314 struct GSF_PendingRequest *pr;
311 315
@@ -456,16 +460,18 @@ consider_peer_for_forwarding (void *cls, const GNUNET_HashCode * key,
456 * @param cls closure, not used 460 * @param cls closure, not used
457 * @param peer peer identity this notification is about 461 * @param peer peer identity this notification is about
458 * @param atsi performance information 462 * @param atsi performance information
463 * @param atsi_count number of records in 'atsi'
459 */ 464 */
460static void 465static void
461peer_connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer, 466peer_connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
462 const struct GNUNET_ATS_Information *atsi) 467 const struct GNUNET_ATS_Information *atsi,
468 unsigned int atsi_count)
463{ 469{
464 struct GSF_ConnectedPeer *cp; 470 struct GSF_ConnectedPeer *cp;
465 471
466 if (0 == memcmp (&my_id, peer, sizeof (struct GNUNET_PeerIdentity))) 472 if (0 == memcmp (&my_id, peer, sizeof (struct GNUNET_PeerIdentity)))
467 return; 473 return;
468 cp = GSF_peer_connect_handler_ (peer, atsi); 474 cp = GSF_peer_connect_handler_ (peer, atsi, atsi_count);
469 if (NULL == cp) 475 if (NULL == cp)
470 return; 476 return;
471 GSF_iterate_pending_requests_ (&consider_peer_for_forwarding, cp); 477 GSF_iterate_pending_requests_ (&consider_peer_for_forwarding, cp);
diff --git a/src/fs/gnunet-service-fs_cp.c b/src/fs/gnunet-service-fs_cp.c
index b9302e645..fc9c44785 100644
--- a/src/fs/gnunet-service-fs_cp.c
+++ b/src/fs/gnunet-service-fs_cp.c
@@ -328,25 +328,20 @@ get_trust_filename (const struct GNUNET_PeerIdentity *id)
328 * Find latency information in 'atsi'. 328 * Find latency information in 'atsi'.
329 * 329 *
330 * @param atsi performance data 330 * @param atsi performance data
331 * @param atsi_count number of records in 'atsi'
331 * @return connection latency 332 * @return connection latency
332 */ 333 */
333static struct GNUNET_TIME_Relative 334static struct GNUNET_TIME_Relative
334get_latency (const struct GNUNET_ATS_Information *atsi) 335get_latency (const struct GNUNET_ATS_Information *atsi,
336 unsigned int atsi_count)
335{ 337{
336 if (atsi == NULL) 338 unsigned int i;
337 return GNUNET_TIME_UNIT_SECONDS; 339
338 while ((ntohl (atsi->type) != GNUNET_ATS_ARRAY_TERMINATOR) && 340 for (i=0;i<atsi_count;i++)
339 (ntohl (atsi->type) != GNUNET_ATS_QUALITY_NET_DELAY)) 341 if (ntohl (atsi->type) == GNUNET_ATS_QUALITY_NET_DELAY)
340 atsi++; 342 return GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS,
341 if (ntohl (atsi->type) == GNUNET_ATS_ARRAY_TERMINATOR) 343 ntohl (atsi->value));
342 { 344 return GNUNET_TIME_UNIT_SECONDS;
343 /* We sometime have no latency data, i.e. if the address came from
344 peerinfo and we never had a chance to play transport-level
345 PING/PONG yet. Assume 1s in that case. */
346 return GNUNET_TIME_UNIT_SECONDS;
347 }
348 return GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS,
349 ntohl (atsi->value));
350} 345}
351 346
352 347
@@ -355,14 +350,16 @@ get_latency (const struct GNUNET_ATS_Information *atsi)
355 * 350 *
356 * @param cp peer record to update 351 * @param cp peer record to update
357 * @param atsi transport performance data 352 * @param atsi transport performance data
353 * @param atsi_count number of records in 'atsi'
358 */ 354 */
359static void 355static void
360update_atsi (struct GSF_ConnectedPeer *cp, 356update_atsi (struct GSF_ConnectedPeer *cp,
361 const struct GNUNET_ATS_Information *atsi) 357 const struct GNUNET_ATS_Information *atsi,
358 unsigned int atsi_count)
362{ 359{
363 struct GNUNET_TIME_Relative latency; 360 struct GNUNET_TIME_Relative latency;
364 361
365 latency = get_latency (atsi); 362 latency = get_latency (atsi, atsi_count);
366 GNUNET_LOAD_value_set_decline (cp->ppd.transmission_delay, latency); 363 GNUNET_LOAD_value_set_decline (cp->ppd.transmission_delay, latency);
367 /* LATER: merge atsi into cp's performance data (if we ever care...) */ 364 /* LATER: merge atsi into cp's performance data (if we ever care...) */
368} 365}
@@ -584,11 +581,13 @@ ats_reserve_callback (void *cls, const struct GNUNET_PeerIdentity *peer,
584 * 581 *
585 * @param peer identity of peer that connected 582 * @param peer identity of peer that connected
586 * @param atsi performance data for the connection 583 * @param atsi performance data for the connection
584 * @param atsi_count number of records in 'atsi'
587 * @return handle to connected peer entry 585 * @return handle to connected peer entry
588 */ 586 */
589struct GSF_ConnectedPeer * 587struct GSF_ConnectedPeer *
590GSF_peer_connect_handler_ (const struct GNUNET_PeerIdentity *peer, 588GSF_peer_connect_handler_ (const struct GNUNET_PeerIdentity *peer,
591 const struct GNUNET_ATS_Information *atsi) 589 const struct GNUNET_ATS_Information *atsi,
590 unsigned int atsi_count)
592{ 591{
593 struct GSF_ConnectedPeer *cp; 592 struct GSF_ConnectedPeer *cp;
594 char *fn; 593 char *fn;
@@ -619,7 +618,7 @@ GSF_peer_connect_handler_ (const struct GNUNET_PeerIdentity *peer,
619 ("# peers connected"), 618 ("# peers connected"),
620 GNUNET_CONTAINER_multihashmap_size (cp_map), 619 GNUNET_CONTAINER_multihashmap_size (cp_map),
621 GNUNET_NO); 620 GNUNET_NO);
622 update_atsi (cp, atsi); 621 update_atsi (cp, atsi, atsi_count);
623 GSF_push_start_ (cp); 622 GSF_push_start_ (cp);
624 return cp; 623 return cp;
625} 624}
@@ -674,6 +673,7 @@ GSF_peer_get_ (const struct GNUNET_PeerIdentity *peer)
674 * for loopback messages where we are both sender and receiver) 673 * for loopback messages where we are both sender and receiver)
675 * @param message the actual message 674 * @param message the actual message
676 * @param atsi performance information 675 * @param atsi performance information
676 * @param atsi_count number of records in 'atsi'
677 * @return GNUNET_OK to keep the connection open, 677 * @return GNUNET_OK to keep the connection open,
678 * GNUNET_SYSERR to close it (signal serious error) 678 * GNUNET_SYSERR to close it (signal serious error)
679 */ 679 */
@@ -682,7 +682,8 @@ GSF_handle_p2p_migration_stop_ (void *cls,
682 const struct GNUNET_PeerIdentity *other, 682 const struct GNUNET_PeerIdentity *other,
683 const struct GNUNET_MessageHeader *message, 683 const struct GNUNET_MessageHeader *message,
684 const struct GNUNET_ATS_Information 684 const struct GNUNET_ATS_Information
685 *atsi) 685 *atsi,
686 unsigned int atsi_count)
686{ 687{
687 struct GSF_ConnectedPeer *cp; 688 struct GSF_ConnectedPeer *cp;
688 const struct MigrationStopMessage *msm; 689 const struct MigrationStopMessage *msm;
@@ -710,7 +711,7 @@ GSF_handle_p2p_migration_stop_ (void *cls,
710 cp->mig_revive_task = 711 cp->mig_revive_task =
711 GNUNET_SCHEDULER_add_delayed (bt, &revive_migration, cp); 712 GNUNET_SCHEDULER_add_delayed (bt, &revive_migration, cp);
712 } 713 }
713 update_atsi (cp, atsi); 714 update_atsi (cp, atsi, atsi_count);
714 return GNUNET_OK; 715 return GNUNET_OK;
715} 716}
716 717
diff --git a/src/fs/gnunet-service-fs_cp.h b/src/fs/gnunet-service-fs_cp.h
index c725dee75..8923513c7 100644
--- a/src/fs/gnunet-service-fs_cp.h
+++ b/src/fs/gnunet-service-fs_cp.h
@@ -168,11 +168,13 @@ struct GSF_PeerTransmitHandle;
168 * 168 *
169 * @param peer identity of peer that connected 169 * @param peer identity of peer that connected
170 * @param atsi performance data for the connection 170 * @param atsi performance data for the connection
171 * @param atsi_count number of records in 'atsi'
171 * @return handle to connected peer entry 172 * @return handle to connected peer entry
172 */ 173 */
173struct GSF_ConnectedPeer * 174struct GSF_ConnectedPeer *
174GSF_peer_connect_handler_ (const struct GNUNET_PeerIdentity *peer, 175GSF_peer_connect_handler_ (const struct GNUNET_PeerIdentity *peer,
175 const struct GNUNET_ATS_Information *atsi); 176 const struct GNUNET_ATS_Information *atsi,
177 unsigned int atsi_count);
176 178
177 179
178/** 180/**
@@ -260,6 +262,7 @@ GSF_peer_update_responder_peer_ (struct GSF_ConnectedPeer *cp,
260 * for loopback messages where we are both sender and receiver) 262 * for loopback messages where we are both sender and receiver)
261 * @param message the actual message 263 * @param message the actual message
262 * @param atsi performance information 264 * @param atsi performance information
265 * @param atsi_count number of records in 'atsi'
263 * @return GNUNET_OK to keep the connection open, 266 * @return GNUNET_OK to keep the connection open,
264 * GNUNET_SYSERR to close it (signal serious error) 267 * GNUNET_SYSERR to close it (signal serious error)
265 */ 268 */
@@ -268,7 +271,8 @@ GSF_handle_p2p_migration_stop_ (void *cls,
268 const struct GNUNET_PeerIdentity *other, 271 const struct GNUNET_PeerIdentity *other,
269 const struct GNUNET_MessageHeader *message, 272 const struct GNUNET_MessageHeader *message,
270 const struct GNUNET_ATS_Information 273 const struct GNUNET_ATS_Information
271 *atsi); 274 *atsi,
275 unsigned int atsi_count);
272 276
273 277
274/** 278/**
diff --git a/src/hostlist/gnunet-daemon-hostlist.c b/src/hostlist/gnunet-daemon-hostlist.c
index fb23d2345..2ef807444 100644
--- a/src/hostlist/gnunet-daemon-hostlist.c
+++ b/src/hostlist/gnunet-daemon-hostlist.c
@@ -136,14 +136,17 @@ core_init (void *cls, struct GNUNET_CORE_Handle *server,
136 136
137/** 137/**
138 * Core handler for p2p hostlist advertisements 138 * Core handler for p2p hostlist advertisements
139 *
140 * @param atsi_count number of records in 'atsi'
139 */ 141 */
140static int 142static int
141advertisement_handler (void *cls, const struct GNUNET_PeerIdentity *peer, 143advertisement_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
142 const struct GNUNET_MessageHeader *message, 144 const struct GNUNET_MessageHeader *message,
143 const struct GNUNET_ATS_Information *atsi) 145 const struct GNUNET_ATS_Information *atsi,
146 unsigned int atsi_count)
144{ 147{
145 GNUNET_assert (NULL != client_adv_handler); 148 GNUNET_assert (NULL != client_adv_handler);
146 return (*client_adv_handler) (cls, peer, message, atsi); 149 return (*client_adv_handler) (cls, peer, message, atsi, atsi_count);
147} 150}
148 151
149 152
@@ -153,20 +156,22 @@ advertisement_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
153 * @param cls closure 156 * @param cls closure
154 * @param peer peer identity this notification is about 157 * @param peer peer identity this notification is about
155 * @param atsi performance data 158 * @param atsi performance data
159 * @param atsi_count number of records in 'atsi'
156 */ 160 */
157static void 161static void
158connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer, 162connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
159 const struct GNUNET_ATS_Information *atsi) 163 const struct GNUNET_ATS_Information *atsi,
164 unsigned int atsi_count)
160{ 165{
161 if (0 == memcmp (&me, peer, sizeof (struct GNUNET_PeerIdentity))) 166 if (0 == memcmp (&me, peer, sizeof (struct GNUNET_PeerIdentity)))
162 return; 167 return;
163 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 168 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
164 "A new peer connected, notifying client and server\n"); 169 "A new peer connected, notifying client and server\n");
165 if (NULL != client_ch) 170 if (NULL != client_ch)
166 (*client_ch) (cls, peer, atsi); 171 (*client_ch) (cls, peer, atsi, atsi_count);
167#if HAVE_MHD 172#if HAVE_MHD
168 if (NULL != server_ch) 173 if (NULL != server_ch)
169 (*server_ch) (cls, peer, atsi); 174 (*server_ch) (cls, peer, atsi, atsi_count);
170#endif 175#endif
171} 176}
172 177
diff --git a/src/hostlist/hostlist-client.c b/src/hostlist/hostlist-client.c
index 1f3ad2a7c..ba5093779 100644
--- a/src/hostlist/hostlist-client.c
+++ b/src/hostlist/hostlist-client.c
@@ -1107,10 +1107,12 @@ task_hostlist_saving (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1107 * @param cls closure 1107 * @param cls closure
1108 * @param peer peer identity this notification is about 1108 * @param peer peer identity this notification is about
1109 * @param atsi performance data 1109 * @param atsi performance data
1110 * @param atsi_count number of records in 'atsi'
1110 */ 1111 */
1111static void 1112static void
1112handler_connect (void *cls, const struct GNUNET_PeerIdentity *peer, 1113handler_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
1113 const struct GNUNET_ATS_Information *atsi) 1114 const struct GNUNET_ATS_Information *atsi,
1115 unsigned int atsi_count)
1114{ 1116{
1115 GNUNET_assert (stat_connection_count < UINT_MAX); 1117 GNUNET_assert (stat_connection_count < UINT_MAX);
1116 stat_connection_count++; 1118 stat_connection_count++;
@@ -1142,13 +1144,15 @@ handler_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
1142 * @param peer the peer sending the message 1144 * @param peer the peer sending the message
1143 * @param message the actual message 1145 * @param message the actual message
1144 * @param atsi performance data 1146 * @param atsi performance data
1147 * @param atsi_count number of records in 'atsi'
1145 * @return GNUNET_OK to keep the connection open, 1148 * @return GNUNET_OK to keep the connection open,
1146 * GNUNET_SYSERR to close it (signal serious error) 1149 * GNUNET_SYSERR to close it (signal serious error)
1147 */ 1150 */
1148static int 1151static int
1149handler_advertisement (void *cls, const struct GNUNET_PeerIdentity *peer, 1152handler_advertisement (void *cls, const struct GNUNET_PeerIdentity *peer,
1150 const struct GNUNET_MessageHeader *message, 1153 const struct GNUNET_MessageHeader *message,
1151 const struct GNUNET_ATS_Information *atsi) 1154 const struct GNUNET_ATS_Information *atsi,
1155 unsigned int atsi_count)
1152{ 1156{
1153 size_t size; 1157 size_t size;
1154 size_t uri_size; 1158 size_t uri_size;
diff --git a/src/hostlist/hostlist-server.c b/src/hostlist/hostlist-server.c
index fb4c1b1b9..a6d9c126c 100644
--- a/src/hostlist/hostlist-server.c
+++ b/src/hostlist/hostlist-server.c
@@ -362,10 +362,12 @@ adv_transmit_ready (void *cls, size_t size, void *buf)
362 * @param cls closure 362 * @param cls closure
363 * @param peer peer identity this notification is about 363 * @param peer peer identity this notification is about
364 * @param atsi performance data 364 * @param atsi performance data
365 * @param atsi_count number of records in 'atsi'
365 */ 366 */
366static void 367static void
367connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer, 368connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
368 const struct GNUNET_ATS_Information *atsi) 369 const struct GNUNET_ATS_Information *atsi,
370 unsigned int atsi_count)
369{ 371{
370 size_t size; 372 size_t size;
371 373
diff --git a/src/hostlist/test_gnunet_daemon_hostlist_learning.c b/src/hostlist/test_gnunet_daemon_hostlist_learning.c
index 9d72433ce..dfeca8d57 100644
--- a/src/hostlist/test_gnunet_daemon_hostlist_learning.c
+++ b/src/hostlist/test_gnunet_daemon_hostlist_learning.c
@@ -298,7 +298,8 @@ check_statistics (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
298static int 298static int
299ad_arrive_handler (void *cls, const struct GNUNET_PeerIdentity *peer, 299ad_arrive_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
300 const struct GNUNET_MessageHeader *message, 300 const struct GNUNET_MessageHeader *message,
301 const struct GNUNET_ATS_Information *atsi) 301 const struct GNUNET_ATS_Information *atsi,
302 unsigned int atsi_count)
302{ 303{
303 char *hostname; 304 char *hostname;
304 char *expected_uri; 305 char *expected_uri;
diff --git a/src/include/gnunet_core_service.h b/src/include/gnunet_core_service.h
index d0adf127b..24c9aa598 100644
--- a/src/include/gnunet_core_service.h
+++ b/src/include/gnunet_core_service.h
@@ -57,13 +57,15 @@ struct GNUNET_CORE_Handle;
57 * @param cls closure 57 * @param cls closure
58 * @param peer peer identity this notification is about 58 * @param peer peer identity this notification is about
59 * @param atsi performance data for the connection 59 * @param atsi performance data for the connection
60 * @param atsi_count number of records in 'atsi'
60 */ 61 */
61typedef void (*GNUNET_CORE_ConnectEventHandler) (void *cls, 62typedef void (*GNUNET_CORE_ConnectEventHandler) (void *cls,
62 const struct 63 const struct
63 GNUNET_PeerIdentity * peer, 64 GNUNET_PeerIdentity * peer,
64 const struct 65 const struct
65 GNUNET_ATS_Information 66 GNUNET_ATS_Information
66 * atsi); 67 * atsi,
68 unsigned int atsi_count);
67 69
68 70
69/** 71/**
@@ -86,6 +88,7 @@ typedef void (*GNUNET_CORE_DisconnectEventHandler) (void *cls,
86 * for loopback messages where we are both sender and receiver) 88 * for loopback messages where we are both sender and receiver)
87 * @param message the actual message 89 * @param message the actual message
88 * @param atsi performance data for the connection 90 * @param atsi performance data for the connection
91 * @param atsi_count number of records in 'atsi'
89 * @return GNUNET_OK to keep the connection open, 92 * @return GNUNET_OK to keep the connection open,
90 * GNUNET_SYSERR to close it (signal serious error) 93 * GNUNET_SYSERR to close it (signal serious error)
91 */ 94 */
@@ -96,7 +99,8 @@ typedef int (*GNUNET_CORE_MessageCallback) (void *cls,
96 message, 99 message,
97 const struct 100 const struct
98 GNUNET_ATS_Information * 101 GNUNET_ATS_Information *
99 atsi); 102 atsi,
103 unsigned int atsi_count);
100 104
101 105
102/** 106/**
diff --git a/src/include/gnunet_mesh_service.h b/src/include/gnunet_mesh_service.h
index ab573557c..914bc2dc6 100644
--- a/src/include/gnunet_mesh_service.h
+++ b/src/include/gnunet_mesh_service.h
@@ -64,6 +64,7 @@ struct GNUNET_MESH_Tunnel;
64 * @param sender who sent the message 64 * @param sender who sent the message
65 * @param message the actual message 65 * @param message the actual message
66 * @param atsi performance data for the connection 66 * @param atsi performance data for the connection
67 * @param atsi_count number of records in 'atsi'
67 * @return GNUNET_OK to keep the connection open, 68 * @return GNUNET_OK to keep the connection open,
68 * GNUNET_SYSERR to close it (signal serious error) 69 * GNUNET_SYSERR to close it (signal serious error)
69 */ 70 */
@@ -76,7 +77,8 @@ typedef int (*GNUNET_MESH_MessageCallback) (void *cls,
76 message, 77 message,
77 const struct 78 const struct
78 GNUNET_ATS_Information * 79 GNUNET_ATS_Information *
79 atsi); 80 atsi,
81 unsigned int atsi_count);
80 82
81 83
82/** 84/**
@@ -184,13 +186,15 @@ typedef void (*GNUNET_MESH_TunnelDisconnectHandler) (void *cls,
184 * @param cls closure 186 * @param cls closure
185 * @param peer peer identity the tunnel was created to, NULL on timeout 187 * @param peer peer identity the tunnel was created to, NULL on timeout
186 * @param atsi performance data for the connection 188 * @param atsi performance data for the connection
189 * @param atsi_count number of records in 'atsi'
187 */ 190 */
188typedef void (*GNUNET_MESH_TunnelConnectHandler) (void *cls, 191typedef void (*GNUNET_MESH_TunnelConnectHandler) (void *cls,
189 const struct 192 const struct
190 GNUNET_PeerIdentity * peer, 193 GNUNET_PeerIdentity * peer,
191 const struct 194 const struct
192 GNUNET_ATS_Information 195 GNUNET_ATS_Information
193 * atsi); 196 * atsi,
197 unsigned int atsi_count);
194 198
195 199
196 200
diff --git a/src/mesh/gnunet-service-mesh.c b/src/mesh/gnunet-service-mesh.c
index 94196be84..19650dcb6 100644
--- a/src/mesh/gnunet-service-mesh.c
+++ b/src/mesh/gnunet-service-mesh.c
@@ -2265,6 +2265,7 @@ send_core_path_ack (void *cls, size_t size, void *buf)
2265 * @param message message 2265 * @param message message
2266 * @param peer peer identity this notification is about 2266 * @param peer peer identity this notification is about
2267 * @param atsi performance data 2267 * @param atsi performance data
2268 * @param atsi_count number of records in 'atsi'
2268 * 2269 *
2269 * @return GNUNET_OK to keep the connection open, 2270 * @return GNUNET_OK to keep the connection open,
2270 * GNUNET_SYSERR to close it (signal serious error) 2271 * GNUNET_SYSERR to close it (signal serious error)
@@ -2272,7 +2273,8 @@ send_core_path_ack (void *cls, size_t size, void *buf)
2272static int 2273static int
2273handle_mesh_path_create (void *cls, const struct GNUNET_PeerIdentity *peer, 2274handle_mesh_path_create (void *cls, const struct GNUNET_PeerIdentity *peer,
2274 const struct GNUNET_MessageHeader *message, 2275 const struct GNUNET_MessageHeader *message,
2275 const struct GNUNET_ATS_Information *atsi) 2276 const struct GNUNET_ATS_Information *atsi,
2277 unsigned int atsi_count)
2276{ 2278{
2277 unsigned int own_pos; 2279 unsigned int own_pos;
2278 uint16_t size; 2280 uint16_t size;
@@ -2462,6 +2464,7 @@ handle_mesh_path_create (void *cls, const struct GNUNET_PeerIdentity *peer,
2462 * @param message message 2464 * @param message message
2463 * @param peer peer identity this notification is about 2465 * @param peer peer identity this notification is about
2464 * @param atsi performance data 2466 * @param atsi performance data
2467 * @param atsi_count number of records in 'atsi'
2465 * 2468 *
2466 * @return GNUNET_OK to keep the connection open, 2469 * @return GNUNET_OK to keep the connection open,
2467 * GNUNET_SYSERR to close it (signal serious error) 2470 * GNUNET_SYSERR to close it (signal serious error)
@@ -2469,7 +2472,8 @@ handle_mesh_path_create (void *cls, const struct GNUNET_PeerIdentity *peer,
2469static int 2472static int
2470handle_mesh_path_destroy (void *cls, const struct GNUNET_PeerIdentity *peer, 2473handle_mesh_path_destroy (void *cls, const struct GNUNET_PeerIdentity *peer,
2471 const struct GNUNET_MessageHeader *message, 2474 const struct GNUNET_MessageHeader *message,
2472 const struct GNUNET_ATS_Information *atsi) 2475 const struct GNUNET_ATS_Information *atsi,
2476 unsigned int atsi_count)
2473{ 2477{
2474 struct GNUNET_MESH_ManipulatePath *msg; 2478 struct GNUNET_MESH_ManipulatePath *msg;
2475 struct GNUNET_PeerIdentity *pi; 2479 struct GNUNET_PeerIdentity *pi;
@@ -2546,6 +2550,7 @@ handle_mesh_path_destroy (void *cls, const struct GNUNET_PeerIdentity *peer,
2546 * @param message message 2550 * @param message message
2547 * @param peer peer identity this notification is about 2551 * @param peer peer identity this notification is about
2548 * @param atsi performance data 2552 * @param atsi performance data
2553 * @param atsi_count number of records in 'atsi'
2549 * 2554 *
2550 * @return GNUNET_OK to keep the connection open, 2555 * @return GNUNET_OK to keep the connection open,
2551 * GNUNET_SYSERR to close it (signal serious error) 2556 * GNUNET_SYSERR to close it (signal serious error)
@@ -2553,7 +2558,8 @@ handle_mesh_path_destroy (void *cls, const struct GNUNET_PeerIdentity *peer,
2553static int 2558static int
2554handle_mesh_tunnel_destroy (void *cls, const struct GNUNET_PeerIdentity *peer, 2559handle_mesh_tunnel_destroy (void *cls, const struct GNUNET_PeerIdentity *peer,
2555 const struct GNUNET_MessageHeader *message, 2560 const struct GNUNET_MessageHeader *message,
2556 const struct GNUNET_ATS_Information *atsi) 2561 const struct GNUNET_ATS_Information *atsi,
2562 unsigned int atsi_count)
2557{ 2563{
2558 struct GNUNET_MESH_TunnelDestroy *msg; 2564 struct GNUNET_MESH_TunnelDestroy *msg;
2559 struct MeshTunnel *t; 2565 struct MeshTunnel *t;
@@ -2596,13 +2602,15 @@ handle_mesh_tunnel_destroy (void *cls, const struct GNUNET_PeerIdentity *peer,
2596 * @param peer peer identity this notification is about 2602 * @param peer peer identity this notification is about
2597 * @param message message 2603 * @param message message
2598 * @param atsi performance data 2604 * @param atsi performance data
2605 * @param atsi_count number of records in 'atsi'
2599 * @return GNUNET_OK to keep the connection open, 2606 * @return GNUNET_OK to keep the connection open,
2600 * GNUNET_SYSERR to close it (signal serious error) 2607 * GNUNET_SYSERR to close it (signal serious error)
2601 */ 2608 */
2602static int 2609static int
2603handle_mesh_data_unicast (void *cls, const struct GNUNET_PeerIdentity *peer, 2610handle_mesh_data_unicast (void *cls, const struct GNUNET_PeerIdentity *peer,
2604 const struct GNUNET_MessageHeader *message, 2611 const struct GNUNET_MessageHeader *message,
2605 const struct GNUNET_ATS_Information *atsi) 2612 const struct GNUNET_ATS_Information *atsi,
2613 unsigned int atsi_count)
2606{ 2614{
2607 struct GNUNET_MESH_Unicast *msg; 2615 struct GNUNET_MESH_Unicast *msg;
2608 struct MeshTunnel *t; 2616 struct MeshTunnel *t;
@@ -2654,6 +2662,7 @@ handle_mesh_data_unicast (void *cls, const struct GNUNET_PeerIdentity *peer,
2654 * @param message message 2662 * @param message message
2655 * @param peer peer identity this notification is about 2663 * @param peer peer identity this notification is about
2656 * @param atsi performance data 2664 * @param atsi performance data
2665 * @param atsi_count number of records in 'atsi'
2657 * @return GNUNET_OK to keep the connection open, 2666 * @return GNUNET_OK to keep the connection open,
2658 * GNUNET_SYSERR to close it (signal serious error) 2667 * GNUNET_SYSERR to close it (signal serious error)
2659 * 2668 *
@@ -2662,7 +2671,8 @@ handle_mesh_data_unicast (void *cls, const struct GNUNET_PeerIdentity *peer,
2662static int 2671static int
2663handle_mesh_data_multicast (void *cls, const struct GNUNET_PeerIdentity *peer, 2672handle_mesh_data_multicast (void *cls, const struct GNUNET_PeerIdentity *peer,
2664 const struct GNUNET_MessageHeader *message, 2673 const struct GNUNET_MessageHeader *message,
2665 const struct GNUNET_ATS_Information *atsi) 2674 const struct GNUNET_ATS_Information *atsi,
2675 unsigned int atsi_count)
2666{ 2676{
2667 struct GNUNET_MESH_Multicast *msg; 2677 struct GNUNET_MESH_Multicast *msg;
2668 struct MeshTunnel *t; 2678 struct MeshTunnel *t;
@@ -2707,6 +2717,7 @@ handle_mesh_data_multicast (void *cls, const struct GNUNET_PeerIdentity *peer,
2707 * @param message message 2717 * @param message message
2708 * @param peer peer identity this notification is about 2718 * @param peer peer identity this notification is about
2709 * @param atsi performance data 2719 * @param atsi performance data
2720 * @param atsi_count number of records in 'atsi'
2710 * 2721 *
2711 * @return GNUNET_OK to keep the connection open, 2722 * @return GNUNET_OK to keep the connection open,
2712 * GNUNET_SYSERR to close it (signal serious error) 2723 * GNUNET_SYSERR to close it (signal serious error)
@@ -2714,7 +2725,8 @@ handle_mesh_data_multicast (void *cls, const struct GNUNET_PeerIdentity *peer,
2714static int 2725static int
2715handle_mesh_data_to_orig (void *cls, const struct GNUNET_PeerIdentity *peer, 2726handle_mesh_data_to_orig (void *cls, const struct GNUNET_PeerIdentity *peer,
2716 const struct GNUNET_MessageHeader *message, 2727 const struct GNUNET_MessageHeader *message,
2717 const struct GNUNET_ATS_Information *atsi) 2728 const struct GNUNET_ATS_Information *atsi,
2729 unsigned int atsi_count)
2718{ 2730{
2719 struct GNUNET_MESH_ToOrigin *msg; 2731 struct GNUNET_MESH_ToOrigin *msg;
2720 struct GNUNET_PeerIdentity id; 2732 struct GNUNET_PeerIdentity id;
@@ -2794,6 +2806,7 @@ handle_mesh_data_to_orig (void *cls, const struct GNUNET_PeerIdentity *peer,
2794 * @param message message 2806 * @param message message
2795 * @param peer peer identity this notification is about 2807 * @param peer peer identity this notification is about
2796 * @param atsi performance data 2808 * @param atsi performance data
2809 * @param atsi_count number of records in 'atsi'
2797 * 2810 *
2798 * @return GNUNET_OK to keep the connection open, 2811 * @return GNUNET_OK to keep the connection open,
2799 * GNUNET_SYSERR to close it (signal serious error) 2812 * GNUNET_SYSERR to close it (signal serious error)
@@ -2801,7 +2814,8 @@ handle_mesh_data_to_orig (void *cls, const struct GNUNET_PeerIdentity *peer,
2801static int 2814static int
2802handle_mesh_path_ack (void *cls, const struct GNUNET_PeerIdentity *peer, 2815handle_mesh_path_ack (void *cls, const struct GNUNET_PeerIdentity *peer,
2803 const struct GNUNET_MessageHeader *message, 2816 const struct GNUNET_MessageHeader *message,
2804 const struct GNUNET_ATS_Information *atsi) 2817 const struct GNUNET_ATS_Information *atsi,
2818 unsigned int atsi_count)
2805{ 2819{
2806 struct GNUNET_MESH_PathACK *msg; 2820 struct GNUNET_MESH_PathACK *msg;
2807 struct GNUNET_PeerIdentity id; 2821 struct GNUNET_PeerIdentity id;
@@ -3739,7 +3753,7 @@ handle_local_unicast (void *cls, struct GNUNET_SERVER_Client *client,
3739 copy->tid = htonl (t->id.tid); 3753 copy->tid = htonl (t->id.tid);
3740 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3754 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3741 "MESH: calling generic handler...\n"); 3755 "MESH: calling generic handler...\n");
3742 handle_mesh_data_unicast (NULL, &my_full_id, &copy->header, NULL); 3756 handle_mesh_data_unicast (NULL, &my_full_id, &copy->header, NULL, 0);
3743 } 3757 }
3744 GNUNET_SERVER_receive_done (client, GNUNET_OK); 3758 GNUNET_SERVER_receive_done (client, GNUNET_OK);
3745 return; 3759 return;
@@ -3825,7 +3839,7 @@ handle_local_to_origin (void *cls, struct GNUNET_SERVER_Client *client,
3825 copy->sender = my_full_id; 3839 copy->sender = my_full_id;
3826 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3840 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3827 "MESH: calling generic handler...\n"); 3841 "MESH: calling generic handler...\n");
3828 handle_mesh_data_to_orig (NULL, &my_full_id, &copy->header, NULL); 3842 handle_mesh_data_to_orig (NULL, &my_full_id, &copy->header, NULL, 0);
3829 } 3843 }
3830 GNUNET_SERVER_receive_done (client, GNUNET_OK); 3844 GNUNET_SERVER_receive_done (client, GNUNET_OK);
3831 return; 3845 return;
@@ -3896,7 +3910,7 @@ handle_local_multicast (void *cls, struct GNUNET_SERVER_Client *client,
3896 copy->tid = htonl(t->id.tid); 3910 copy->tid = htonl(t->id.tid);
3897 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 3911 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
3898 "MESH: calling generic handler...\n"); 3912 "MESH: calling generic handler...\n");
3899 handle_mesh_data_multicast(client, &my_full_id, &copy->header, NULL); 3913 handle_mesh_data_multicast(client, &my_full_id, &copy->header, NULL, 0);
3900 } 3914 }
3901 3915
3902 /* receive done gets called when last copy is sent to a neighbor */ 3916 /* receive done gets called when last copy is sent to a neighbor */
@@ -3961,10 +3975,12 @@ core_init (void *cls, struct GNUNET_CORE_Handle *server,
3961 * @param cls closure 3975 * @param cls closure
3962 * @param peer peer identity this notification is about 3976 * @param peer peer identity this notification is about
3963 * @param atsi performance data for the connection 3977 * @param atsi performance data for the connection
3978 * @param atsi_count number of records in 'atsi'
3964 */ 3979 */
3965static void 3980static void
3966core_connect (void *cls, const struct GNUNET_PeerIdentity *peer, 3981core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
3967 const struct GNUNET_ATS_Information *atsi) 3982 const struct GNUNET_ATS_Information *atsi,
3983 unsigned int atsi_count)
3968{ 3984{
3969 struct MeshPeerInfo *peer_info; 3985 struct MeshPeerInfo *peer_info;
3970 struct MeshPeerPath *path; 3986 struct MeshPeerPath *path;
diff --git a/src/mesh/mesh_api.c b/src/mesh/mesh_api.c
index 2067b7b6c..0f7592056 100644
--- a/src/mesh/mesh_api.c
+++ b/src/mesh/mesh_api.c
@@ -113,7 +113,6 @@ struct peer_list_element
113 /* list of application-types */ 113 /* list of application-types */
114 struct type_list_element *type_head, *type_tail; 114 struct type_list_element *type_head, *type_tail;
115 115
116 struct GNUNET_ATS_Information atsi;
117 struct peer_list_element *next, *prev; 116 struct peer_list_element *next, *prev;
118 117
119 /* The handle that sends the hellos to this peer */ 118 /* The handle that sends the hellos to this peer */
@@ -154,7 +153,7 @@ send_end_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
154 153
155 struct GNUNET_MESH_Tunnel *tunnel = cls; 154 struct GNUNET_MESH_Tunnel *tunnel = cls;
156 155
157 tunnel->connect_handler (tunnel->handler_cls, NULL, NULL); 156 tunnel->connect_handler (tunnel->handler_cls, NULL, NULL, 0);
158} 157}
159 158
160static void 159static void
@@ -165,7 +164,7 @@ send_self_connect (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
165 164
166 struct GNUNET_MESH_Tunnel *tunnel = cls; 165 struct GNUNET_MESH_Tunnel *tunnel = cls;
167 166
168 tunnel->connect_handler (tunnel->handler_cls, &tunnel->handle->myself, NULL); 167 tunnel->connect_handler (tunnel->handler_cls, &tunnel->handle->myself, NULL, 0);
169 GNUNET_SCHEDULER_add_now (send_end_connect, tunnel); 168 GNUNET_SCHEDULER_add_now (send_end_connect, tunnel);
170} 169}
171 170
@@ -177,7 +176,7 @@ call_connect_handler (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
177 176
178 struct GNUNET_MESH_Tunnel *tunnel = cls; 177 struct GNUNET_MESH_Tunnel *tunnel = cls;
179 178
180 tunnel->connect_handler (tunnel->handler_cls, &tunnel->peer, NULL); 179 tunnel->connect_handler (tunnel->handler_cls, &tunnel->peer, NULL, 0);
181 GNUNET_SCHEDULER_add_now (send_end_connect, tunnel); 180 GNUNET_SCHEDULER_add_now (send_end_connect, tunnel);
182} 181}
183 182
@@ -254,7 +253,8 @@ schedule_hello_message (void *cls,
254 */ 253 */
255static void 254static void
256core_connect (void *cls, const struct GNUNET_PeerIdentity *peer, 255core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
257 const struct GNUNET_ATS_Information *atsi) 256 const struct GNUNET_ATS_Information *atsi,
257 unsigned int atsi_count)
258{ 258{
259 struct GNUNET_MESH_Handle *handle = cls; 259 struct GNUNET_MESH_Handle *handle = cls;
260 260
@@ -269,11 +269,6 @@ core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
269 269
270 /* Send a hello to this peer */ 270 /* Send a hello to this peer */
271 element->sched = GNUNET_SCHEDULER_add_now (schedule_hello_message, element); 271 element->sched = GNUNET_SCHEDULER_add_now (schedule_hello_message, element);
272
273 if (NULL != atsi)
274 memcpy (&element->atsi, atsi,
275 sizeof (struct GNUNET_ATS_Information));
276
277 GNUNET_CONTAINER_DLL_insert_after (handle->connected_peers.head, 272 GNUNET_CONTAINER_DLL_insert_after (handle->connected_peers.head,
278 handle->connected_peers.tail, 273 handle->connected_peers.tail,
279 handle->connected_peers.tail, element); 274 handle->connected_peers.tail, element);
@@ -294,7 +289,7 @@ core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
294 handle->established_tunnels.tail, 289 handle->established_tunnels.tail,
295 handle->established_tunnels.tail, 290 handle->established_tunnels.tail,
296 tunnel); 291 tunnel);
297 tunnel->tunnel.connect_handler (tunnel->tunnel.handler_cls, peer, atsi); 292 tunnel->tunnel.connect_handler (tunnel->tunnel.handler_cls, peer, atsi, atsi_count);
298 GNUNET_SCHEDULER_add_now (send_end_connect, tunnel); 293 GNUNET_SCHEDULER_add_now (send_end_connect, tunnel);
299 tunnel = next; 294 tunnel = next;
300 } 295 }
@@ -383,7 +378,8 @@ core_disconnect (void *cls, const struct GNUNET_PeerIdentity *peer)
383static int 378static int
384receive_hello (void *cls, const struct GNUNET_PeerIdentity *other, 379receive_hello (void *cls, const struct GNUNET_PeerIdentity *other,
385 const struct GNUNET_MessageHeader *message, 380 const struct GNUNET_MessageHeader *message,
386 const struct GNUNET_ATS_Information *atsi) 381 const struct GNUNET_ATS_Information *atsi,
382 unsigned int atsi_count)
387{ 383{
388 struct GNUNET_MESH_Handle *handle = cls; 384 struct GNUNET_MESH_Handle *handle = cls;
389 uint16_t *num = (uint16_t *) (message + 1); 385 uint16_t *num = (uint16_t *) (message + 1);
@@ -450,7 +446,7 @@ receive_hello (void *cls, const struct GNUNET_PeerIdentity *other,
450 memcpy (&tunnel->tunnel.peer, other, 446 memcpy (&tunnel->tunnel.peer, other,
451 sizeof (struct GNUNET_PeerIdentity)); 447 sizeof (struct GNUNET_PeerIdentity));
452 tunnel->tunnel.connect_handler (tunnel->tunnel.handler_cls, 448 tunnel->tunnel.connect_handler (tunnel->tunnel.handler_cls,
453 &tunnel->tunnel.peer, atsi); 449 &tunnel->tunnel.peer, atsi, atsi_count);
454 GNUNET_SCHEDULER_add_now (send_end_connect, tunnel); 450 GNUNET_SCHEDULER_add_now (send_end_connect, tunnel);
455 break; 451 break;
456 } 452 }
@@ -469,7 +465,8 @@ receive_hello (void *cls, const struct GNUNET_PeerIdentity *other,
469static int 465static int
470core_receive (void *cls, const struct GNUNET_PeerIdentity *other, 466core_receive (void *cls, const struct GNUNET_PeerIdentity *other,
471 const struct GNUNET_MessageHeader *message, 467 const struct GNUNET_MessageHeader *message,
472 const struct GNUNET_ATS_Information *atsi) 468 const struct GNUNET_ATS_Information *atsi,
469 unsigned int atsi_count)
473{ 470{
474 struct GNUNET_MESH_Handle *handle = cls; 471 struct GNUNET_MESH_Handle *handle = cls;
475 struct tunnel_message *tmessage = (struct tunnel_message *) message; 472 struct tunnel_message *tmessage = (struct tunnel_message *) message;
@@ -539,7 +536,7 @@ core_receive (void *cls, const struct GNUNET_PeerIdentity *other,
539 GNUNET_i2s (other), ntohs (rmessage->type)); 536 GNUNET_i2s (other), ntohs (rmessage->type));
540 537
541 return handler->callback (handle->cls, &tunnel->tunnel, &tunnel->tunnel.ctx, 538 return handler->callback (handle->cls, &tunnel->tunnel, &tunnel->tunnel.ctx,
542 other, rmessage, atsi); 539 other, rmessage, atsi, atsi_count);
543} 540}
544 541
545struct GNUNET_MESH_Tunnel * 542struct GNUNET_MESH_Tunnel *
diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c
index ce48ecfc4..d9687acd2 100644
--- a/src/nse/gnunet-service-nse.c
+++ b/src/nse/gnunet-service-nse.c
@@ -938,12 +938,13 @@ update_flood_times (void *cls, const GNUNET_HashCode * key, void *value)
938 * @param message message 938 * @param message message
939 * @param peer peer identity this message is from (ignored) 939 * @param peer peer identity this message is from (ignored)
940 * @param atsi performance data (ignored) 940 * @param atsi performance data (ignored)
941 * 941 * @param atsi_count number of records in 'atsi'
942 */ 942 */
943static int 943static int
944handle_p2p_size_estimate (void *cls, const struct GNUNET_PeerIdentity *peer, 944handle_p2p_size_estimate (void *cls, const struct GNUNET_PeerIdentity *peer,
945 const struct GNUNET_MessageHeader *message, 945 const struct GNUNET_MessageHeader *message,
946 const struct GNUNET_ATS_Information *atsi) 946 const struct GNUNET_ATS_Information *atsi,
947 unsigned int atsi_count)
947{ 948{
948 const struct GNUNET_NSE_FloodMessage *incoming_flood; 949 const struct GNUNET_NSE_FloodMessage *incoming_flood;
949 struct GNUNET_TIME_Absolute ts; 950 struct GNUNET_TIME_Absolute ts;
@@ -1094,10 +1095,12 @@ handle_p2p_size_estimate (void *cls, const struct GNUNET_PeerIdentity *peer,
1094 * @param cls closure 1095 * @param cls closure
1095 * @param peer peer identity this notification is about 1096 * @param peer peer identity this notification is about
1096 * @param atsi performance data 1097 * @param atsi performance data
1098 * @param atsi_count number of records in 'atsi'
1097 */ 1099 */
1098static void 1100static void
1099handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer, 1101handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
1100 const struct GNUNET_ATS_Information *atsi) 1102 const struct GNUNET_ATS_Information *atsi,
1103 unsigned int atsi_count)
1101{ 1104{
1102 struct NSEPeerEntry *peer_entry; 1105 struct NSEPeerEntry *peer_entry;
1103 1106
diff --git a/src/testing/test_testing_topology.c b/src/testing/test_testing_topology.c
index b83a8cf3c..e563f4d64 100644
--- a/src/testing/test_testing_topology.c
+++ b/src/testing/test_testing_topology.c
@@ -348,7 +348,8 @@ topology_cb (void *cls, const struct GNUNET_PeerIdentity *first,
348static int 348static int
349process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer, 349process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
350 const struct GNUNET_MessageHeader *message, 350 const struct GNUNET_MessageHeader *message,
351 const struct GNUNET_ATS_Information *atsi) 351 const struct GNUNET_ATS_Information *atsi,
352 unsigned int atsi_count)
352{ 353{
353 char *dotOutFileNameFinished; 354 char *dotOutFileNameFinished;
354 FILE *dotOutFileFinished; 355 FILE *dotOutFileFinished;
@@ -537,10 +538,12 @@ init_notify_peer2 (void *cls, struct GNUNET_CORE_Handle *server,
537 * @param cls closure 538 * @param cls closure
538 * @param peer peer identity this notification is about 539 * @param peer peer identity this notification is about
539 * @param atsi performance data for the connection 540 * @param atsi performance data for the connection
541 * @param atsi_count number of records in 'atsi'
540 */ 542 */
541static void 543static void
542connect_notify_peers (void *cls, const struct GNUNET_PeerIdentity *peer, 544connect_notify_peers (void *cls, const struct GNUNET_PeerIdentity *peer,
543 const struct GNUNET_ATS_Information *atsi) 545 const struct GNUNET_ATS_Information *atsi,
546 unsigned int atsi_count)
544{ 547{
545 struct TestMessageContext *pos = cls; 548 struct TestMessageContext *pos = cls;
546 549
diff --git a/src/testing/testing.c b/src/testing/testing.c
index 1798a1af6..e81a92fb5 100644
--- a/src/testing/testing.c
+++ b/src/testing/testing.c
@@ -1882,11 +1882,13 @@ notify_connect_result (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
1882 * @param cls our "struct GNUNET_TESTING_ConnectContext" 1882 * @param cls our "struct GNUNET_TESTING_ConnectContext"
1883 * @param peer identity of the peer that has connected 1883 * @param peer identity of the peer that has connected
1884 * @param atsi performance information 1884 * @param atsi performance information
1885 * @param atsi_count number of records in 'atsi'
1885 * 1886 *
1886 */ 1887 */
1887static void 1888static void
1888connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer, 1889connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
1889 const struct GNUNET_ATS_Information *atsi) 1890 const struct GNUNET_ATS_Information *atsi,
1891 unsigned int atsi_count)
1890{ 1892{
1891 struct GNUNET_TESTING_ConnectContext *ctx = cls; 1893 struct GNUNET_TESTING_ConnectContext *ctx = cls;
1892 1894
@@ -2080,11 +2082,13 @@ reattempt_daemons_connect (void *cls,
2080 * @param peer identity of the peer that has connected, 2082 * @param peer identity of the peer that has connected,
2081 * NULL when iteration has finished 2083 * NULL when iteration has finished
2082 * @param atsi performance information 2084 * @param atsi performance information
2085 * @param atsi_count number of records in 'atsi'
2083 * 2086 *
2084 */ 2087 */
2085static void 2088static void
2086core_initial_iteration (void *cls, const struct GNUNET_PeerIdentity *peer, 2089core_initial_iteration (void *cls, const struct GNUNET_PeerIdentity *peer,
2087 const struct GNUNET_ATS_Information *atsi) 2090 const struct GNUNET_ATS_Information *atsi,
2091 unsigned int atsi_count)
2088{ 2092{
2089 struct GNUNET_TESTING_ConnectContext *ctx = cls; 2093 struct GNUNET_TESTING_ConnectContext *ctx = cls;
2090 2094
diff --git a/src/testing/testing_group.c b/src/testing/testing_group.c
index a2c68c93c..04c2cfd00 100644
--- a/src/testing/testing_group.c
+++ b/src/testing/testing_group.c
@@ -4877,7 +4877,8 @@ perform_dfs (struct GNUNET_TESTING_PeerGroup *pg, unsigned int num)
4877 */ 4877 */
4878static void 4878static void
4879internal_topology_callback (void *cls, const struct GNUNET_PeerIdentity *peer, 4879internal_topology_callback (void *cls, const struct GNUNET_PeerIdentity *peer,
4880 const struct GNUNET_ATS_Information *atsi) 4880 const struct GNUNET_ATS_Information *atsi,
4881 unsigned int atsi_count)
4881{ 4882{
4882 struct CoreContext *core_ctx = cls; 4883 struct CoreContext *core_ctx = cls;
4883 struct TopologyIterateContext *iter_ctx = core_ctx->iter_context; 4884 struct TopologyIterateContext *iter_ctx = core_ctx->iter_context;
@@ -4941,7 +4942,7 @@ schedule_get_topology (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
4941 &internal_topology_callback, core_context)) 4942 &internal_topology_callback, core_context))
4942 { 4943 {
4943 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Topology iteration failed.\n"); 4944 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Topology iteration failed.\n");
4944 internal_topology_callback (core_context, NULL, NULL); 4945 internal_topology_callback (core_context, NULL, NULL, 0);
4945 } 4946 }
4946 } 4947 }
4947} 4948}
diff --git a/src/topology/gnunet-daemon-topology.c b/src/topology/gnunet-daemon-topology.c
index 453c9d924..625923cdf 100644
--- a/src/topology/gnunet-daemon-topology.c
+++ b/src/topology/gnunet-daemon-topology.c
@@ -632,10 +632,12 @@ reschedule_hellos (void *cls, const GNUNET_HashCode * pid, void *value)
632 * @param cls closure 632 * @param cls closure
633 * @param peer peer identity this notification is about 633 * @param peer peer identity this notification is about
634 * @param atsi performance data 634 * @param atsi performance data
635 * @param atsi_count number of records in 'atsi'
635 */ 636 */
636static void 637static void
637connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer, 638connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
638 const struct GNUNET_ATS_Information *atsi) 639 const struct GNUNET_ATS_Information *atsi,
640 unsigned int atsi_count)
639{ 641{
640 struct Peer *pos; 642 struct Peer *pos;
641 643
@@ -1100,13 +1102,15 @@ read_friends_file (const struct GNUNET_CONFIGURATION_Handle *cfg)
1100 * for loopback messages where we are both sender and receiver) 1102 * for loopback messages where we are both sender and receiver)
1101 * @param message the actual HELLO message 1103 * @param message the actual HELLO message
1102 * @param atsi performance data 1104 * @param atsi performance data
1105 * @param atsi_count number of records in 'atsi'
1103 * @return GNUNET_OK to keep the connection open, 1106 * @return GNUNET_OK to keep the connection open,
1104 * GNUNET_SYSERR to close it (signal serious error) 1107 * GNUNET_SYSERR to close it (signal serious error)
1105 */ 1108 */
1106static int 1109static int
1107handle_encrypted_hello (void *cls, const struct GNUNET_PeerIdentity *other, 1110handle_encrypted_hello (void *cls, const struct GNUNET_PeerIdentity *other,
1108 const struct GNUNET_MessageHeader *message, 1111 const struct GNUNET_MessageHeader *message,
1109 const struct GNUNET_ATS_Information *atsi) 1112 const struct GNUNET_ATS_Information *atsi,
1113 unsigned int atsi_count)
1110{ 1114{
1111 struct Peer *peer; 1115 struct Peer *peer;
1112 struct GNUNET_PeerIdentity pid; 1116 struct GNUNET_PeerIdentity pid;
diff --git a/src/vpn/gnunet-daemon-exit.c b/src/vpn/gnunet-daemon-exit.c
index b88dd0f08..8b7a8cff3 100644
--- a/src/vpn/gnunet-daemon-exit.c
+++ b/src/vpn/gnunet-daemon-exit.c
@@ -1025,7 +1025,9 @@ receive_tcp_service (void *cls
1025 __attribute__ ((unused)), 1025 __attribute__ ((unused)),
1026 const struct GNUNET_MessageHeader *message, 1026 const struct GNUNET_MessageHeader *message,
1027 const struct GNUNET_ATS_Information *atsi 1027 const struct GNUNET_ATS_Information *atsi
1028 __attribute__ ((unused))) 1028 __attribute__ ((unused)),
1029 unsigned int atsi_count
1030 __attribute__ ((unused)))
1029{ 1031{
1030 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received TCP-Packet\n"); 1032 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received TCP-Packet\n");
1031 GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1); 1033 GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
@@ -1133,7 +1135,9 @@ receive_tcp_remote (void *cls
1133 __attribute__ ((unused)), 1135 __attribute__ ((unused)),
1134 const struct GNUNET_MessageHeader *message, 1136 const struct GNUNET_MessageHeader *message,
1135 const struct GNUNET_ATS_Information *atsi 1137 const struct GNUNET_ATS_Information *atsi
1136 __attribute__ ((unused))) 1138 __attribute__ ((unused)),
1139 unsigned int atsi_count
1140 __attribute__ ((unused)))
1137{ 1141{
1138 GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1); 1142 GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
1139 struct tcp_pkt *pkt = (struct tcp_pkt *) (desc + 1); 1143 struct tcp_pkt *pkt = (struct tcp_pkt *) (desc + 1);
@@ -1209,7 +1213,9 @@ receive_udp_remote (void *cls
1209 __attribute__ ((unused)), 1213 __attribute__ ((unused)),
1210 const struct GNUNET_MessageHeader *message, 1214 const struct GNUNET_MessageHeader *message,
1211 const struct GNUNET_ATS_Information *atsi 1215 const struct GNUNET_ATS_Information *atsi
1212 __attribute__ ((unused))) 1216 __attribute__ ((unused)),
1217 unsigned int atsi_count
1218 __attribute__ ((unused)))
1213{ 1219{
1214 GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1); 1220 GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
1215 struct udp_pkt *pkt = (struct udp_pkt *) (desc + 1); 1221 struct udp_pkt *pkt = (struct udp_pkt *) (desc + 1);
@@ -1289,7 +1295,9 @@ receive_udp_service (void *cls
1289 __attribute__ ((unused)), 1295 __attribute__ ((unused)),
1290 const struct GNUNET_MessageHeader *message, 1296 const struct GNUNET_MessageHeader *message,
1291 const struct GNUNET_ATS_Information *atsi 1297 const struct GNUNET_ATS_Information *atsi
1292 __attribute__ ((unused))) 1298 __attribute__ ((unused)),
1299 unsigned int atsi_count
1300 __attribute__ ((unused)))
1293{ 1301{
1294 GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1); 1302 GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
1295 struct udp_pkt *pkt = (struct udp_pkt *) (desc + 1); 1303 struct udp_pkt *pkt = (struct udp_pkt *) (desc + 1);
diff --git a/src/vpn/gnunet-daemon-vpn-helper.c b/src/vpn/gnunet-daemon-vpn-helper.c
index d91b00416..4d2bbf819 100644
--- a/src/vpn/gnunet-daemon-vpn-helper.c
+++ b/src/vpn/gnunet-daemon-vpn-helper.c
@@ -333,7 +333,7 @@ message_token (void *cls __attribute__ ((unused)), void *client
333 else if (NULL != cls) 333 else if (NULL != cls)
334 { 334 {
335 *cls = me->tunnel; 335 *cls = me->tunnel;
336 send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL); 336 send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL, 0);
337 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 337 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
338 "Queued to send IPv6 to peer %x, type %d\n", 338 "Queued to send IPv6 to peer %x, type %d\n",
339 *((unsigned int *) &me->desc.peer), ntohs (hdr->type)); 339 *((unsigned int *) &me->desc.peer), ntohs (hdr->type));
@@ -384,7 +384,7 @@ message_token (void *cls __attribute__ ((unused)), void *client
384 else if (NULL != cls) 384 else if (NULL != cls)
385 { 385 {
386 *cls = me->tunnel; 386 *cls = me->tunnel;
387 send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL); 387 send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL, 0);
388 } 388 }
389 } 389 }
390 } 390 }
@@ -535,7 +535,7 @@ message_token (void *cls __attribute__ ((unused)), void *client
535 else if (NULL != cls) 535 else if (NULL != cls)
536 { 536 {
537 *cls = me->tunnel; 537 *cls = me->tunnel;
538 send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL); 538 send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL, 0);
539 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 539 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
540 "Queued to send IPv4 to peer %x, type %d\n", 540 "Queued to send IPv4 to peer %x, type %d\n",
541 *((unsigned int *) &me->desc.peer), 541 *((unsigned int *) &me->desc.peer),
@@ -577,7 +577,7 @@ message_token (void *cls __attribute__ ((unused)), void *client
577 else if (NULL != cls) 577 else if (NULL != cls)
578 { 578 {
579 *cls = me->tunnel; 579 *cls = me->tunnel;
580 send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL); 580 send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL, 0);
581 } 581 }
582 } 582 }
583 } 583 }
diff --git a/src/vpn/gnunet-daemon-vpn.c b/src/vpn/gnunet-daemon-vpn.c
index 0f7bdff70..a6d051e9c 100644
--- a/src/vpn/gnunet-daemon-vpn.c
+++ b/src/vpn/gnunet-daemon-vpn.c
@@ -341,7 +341,9 @@ port_in_ports (uint64_t ports, uint16_t port)
341void 341void
342send_pkt_to_peer (void *cls, const struct GNUNET_PeerIdentity *peer, 342send_pkt_to_peer (void *cls, const struct GNUNET_PeerIdentity *peer,
343 const struct GNUNET_ATS_Information *atsi 343 const struct GNUNET_ATS_Information *atsi
344 __attribute__ ((unused))) 344 __attribute__ ((unused)),
345 unsigned int atsi_count
346 __attribute__ ((unused)))
345{ 347{
346 /* peer == NULL means that all peers in this request are connected */ 348 /* peer == NULL means that all peers in this request are connected */
347 if (peer == NULL) 349 if (peer == NULL)
@@ -872,7 +874,9 @@ receive_udp_back (void *cls
872 __attribute__ ((unused)), 874 __attribute__ ((unused)),
873 const struct GNUNET_MessageHeader *message, 875 const struct GNUNET_MessageHeader *message,
874 const struct GNUNET_ATS_Information *atsi 876 const struct GNUNET_ATS_Information *atsi
875 __attribute__ ((unused))) 877 __attribute__ ((unused)),
878 unsigned int atsi_count
879 __attribute__ ((unused)))
876{ 880{
877 GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1); 881 GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
878 struct remote_addr *s = (struct remote_addr *) desc; 882 struct remote_addr *s = (struct remote_addr *) desc;
@@ -1051,7 +1055,9 @@ receive_tcp_back (void *cls
1051 __attribute__ ((unused)), 1055 __attribute__ ((unused)),
1052 const struct GNUNET_MessageHeader *message, 1056 const struct GNUNET_MessageHeader *message,
1053 const struct GNUNET_ATS_Information *atsi 1057 const struct GNUNET_ATS_Information *atsi
1054 __attribute__ ((unused))) 1058 __attribute__ ((unused)),
1059 unsigned int atsi_count
1060 __attribute__ ((unused)))
1055{ 1061{
1056 GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1); 1062 GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
1057 struct remote_addr *s = (struct remote_addr *) desc; 1063 struct remote_addr *s = (struct remote_addr *) desc;
diff --git a/src/vpn/gnunet-daemon-vpn.h b/src/vpn/gnunet-daemon-vpn.h
index c0dba360e..7d3b0e68a 100644
--- a/src/vpn/gnunet-daemon-vpn.h
+++ b/src/vpn/gnunet-daemon-vpn.h
@@ -56,7 +56,8 @@ port_in_ports (uint64_t ports, uint16_t port);
56 56
57void 57void
58send_pkt_to_peer (void *cls, const struct GNUNET_PeerIdentity *peer, 58send_pkt_to_peer (void *cls, const struct GNUNET_PeerIdentity *peer,
59 const struct GNUNET_ATS_Information *atsi); 59 const struct GNUNET_ATS_Information *atsi,
60 unsigned int atsi_count);
60 61
61/** 62/**
62 * The configuration to use 63 * The configuration to use
diff --git a/src/vpn/gnunet-service-dns.c b/src/vpn/gnunet-service-dns.c
index 49e774dc2..4aa04ddfa 100644
--- a/src/vpn/gnunet-service-dns.c
+++ b/src/vpn/gnunet-service-dns.c
@@ -325,7 +325,9 @@ mesh_send (void *cls, size_t size, void *buf)
325void 325void
326mesh_connect (void *cls, const struct GNUNET_PeerIdentity *peer, 326mesh_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
327 const struct GNUNET_ATS_Information *atsi 327 const struct GNUNET_ATS_Information *atsi
328 __attribute__ ((unused))) 328 __attribute__ ((unused)),
329 unsigned int atsi_count
330 __attribute__ ((unused)))
329{ 331{
330 if (NULL == peer) 332 if (NULL == peer)
331 return; 333 return;
@@ -395,7 +397,9 @@ receive_mesh_query (void *cls
395 __attribute__ ((unused)), 397 __attribute__ ((unused)),
396 const struct GNUNET_MessageHeader *message, 398 const struct GNUNET_MessageHeader *message,
397 const struct GNUNET_ATS_Information *atsi 399 const struct GNUNET_ATS_Information *atsi
398 __attribute__ ((unused))) 400 __attribute__ ((unused)),
401 unsigned int atsi_count
402 __attribute__ ((unused)))
399{ 403{
400 struct dns_pkt *dns = (struct dns_pkt *) (message + 1); 404 struct dns_pkt *dns = (struct dns_pkt *) (message + 1);
401 405
@@ -429,7 +433,9 @@ receive_mesh_answer (void *cls
429 const struct GNUNET_PeerIdentity *sender, 433 const struct GNUNET_PeerIdentity *sender,
430 const struct GNUNET_MessageHeader *message, 434 const struct GNUNET_MessageHeader *message,
431 const struct GNUNET_ATS_Information *atsi 435 const struct GNUNET_ATS_Information *atsi
432 __attribute__ ((unused))) 436 __attribute__ ((unused)),
437 unsigned int atsi_count
438 __attribute__ ((unused)))
433{ 439{
434 /* TODo: size check */ 440 /* TODo: size check */
435 struct dns_pkt *dns = (struct dns_pkt *) (message + 1); 441 struct dns_pkt *dns = (struct dns_pkt *) (message + 1);