gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r17677 - in gnunet/src: core dht fs hostlist include mesh n


From: gnunet
Subject: [GNUnet-SVN] r17677 - in gnunet/src: core dht fs hostlist include mesh nse testing topology vpn
Date: Sat, 22 Oct 2011 23:59:28 +0200

Author: grothoff
Date: 2011-10-22 23:59:27 +0200 (Sat, 22 Oct 2011)
New Revision: 17677

Modified:
   gnunet/src/core/core.h
   gnunet/src/core/core_api.c
   gnunet/src/core/core_api_iterate_peers.c
   gnunet/src/core/gnunet-core-list-connections.c
   gnunet/src/core/gnunet-service-core_clients.c
   gnunet/src/core/gnunet-service-core_sessions.c
   gnunet/src/core/test_core_api.c
   gnunet/src/core/test_core_api_reliability.c
   gnunet/src/core/test_core_api_send_to_self.c
   gnunet/src/core/test_core_api_start_only.c
   gnunet/src/core/test_core_quota_compliance.c
   gnunet/src/dht/gnunet-service-dht_neighbours.c
   gnunet/src/fs/gnunet-service-fs.c
   gnunet/src/fs/gnunet-service-fs_cp.c
   gnunet/src/fs/gnunet-service-fs_cp.h
   gnunet/src/hostlist/gnunet-daemon-hostlist.c
   gnunet/src/hostlist/hostlist-client.c
   gnunet/src/hostlist/hostlist-server.c
   gnunet/src/hostlist/test_gnunet_daemon_hostlist_learning.c
   gnunet/src/include/gnunet_core_service.h
   gnunet/src/include/gnunet_mesh_service.h
   gnunet/src/mesh/gnunet-service-mesh.c
   gnunet/src/mesh/mesh_api.c
   gnunet/src/nse/gnunet-service-nse.c
   gnunet/src/testing/test_testing_topology.c
   gnunet/src/testing/testing.c
   gnunet/src/testing/testing_group.c
   gnunet/src/topology/gnunet-daemon-topology.c
   gnunet/src/vpn/gnunet-daemon-exit.c
   gnunet/src/vpn/gnunet-daemon-vpn-helper.c
   gnunet/src/vpn/gnunet-daemon-vpn.c
   gnunet/src/vpn/gnunet-daemon-vpn.h
   gnunet/src/vpn/gnunet-service-dns.c
Log:
replacing 0-terminated atsi-array with array+length in core API (and the 
core-connect IPC)

Modified: gnunet/src/core/core.h
===================================================================
--- gnunet/src/core/core.h      2011-10-22 21:20:14 UTC (rev 17676)
+++ gnunet/src/core/core.h      2011-10-22 21:59:27 UTC (rev 17677)
@@ -119,12 +119,6 @@
    */
   struct GNUNET_PeerIdentity peer;
 
-  /**
-   * First of the ATS information blocks (we must have at least
-   * one due to the 0-termination requirement).
-   */
-  struct GNUNET_ATS_Information ats;
-
 };
 
 

Modified: gnunet/src/core/core_api.c
===================================================================
--- gnunet/src/core/core_api.c  2011-10-22 21:20:14 UTC (rev 17676)
+++ gnunet/src/core/core_api.c  2011-10-22 21:59:27 UTC (rev 17677)
@@ -781,6 +781,7 @@
   const struct GNUNET_MessageHeader *em;
   const struct SendMessageReady *smr;
   const struct GNUNET_CORE_MessageHandler *mh;
+  const struct GNUNET_ATS_Information* ats;
   GNUNET_CORE_StartupCallback init;
   struct PeerRecord *pr;
   struct GNUNET_CORE_TransmitHandle *th;
@@ -851,7 +852,7 @@
                                                       &h->me.hashPubKey, pr,
                                                       
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST));
     if (NULL != h->connects)
-      h->connects (h->cls, &h->me, NULL);
+      h->connects (h->cls, &h->me, NULL, 0);
     break;
   case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT:
     if (msize < sizeof (struct ConnectNotifyMessage))
@@ -862,11 +863,9 @@
     }
     cnm = (const struct ConnectNotifyMessage *) msg;
     ats_count = ntohl (cnm->ats_count);
-    if ((msize !=
-         sizeof (struct ConnectNotifyMessage) +
-         ats_count * sizeof (struct GNUNET_ATS_Information)) ||
-        (GNUNET_ATS_ARRAY_TERMINATOR !=
-         ntohl ((&cnm->ats)[ats_count].type)))
+    if (msize !=
+       sizeof (struct ConnectNotifyMessage) +
+       ats_count * sizeof (struct GNUNET_ATS_Information))
     {
       GNUNET_break (0);
       reconnect_later (h);
@@ -897,8 +896,11 @@
                    GNUNET_CONTAINER_multihashmap_put (h->peers,
                                                       &cnm->peer.hashPubKey, 
pr,
                                                       
GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST));
+    ats = (const struct GNUNET_ATS_Information*) &cnm[1];
     if (NULL != h->connects)
-      h->connects (h->cls, &cnm->peer, &cnm->ats);
+      h->connects (h->cls, &cnm->peer, 
+                  ats,
+                  ats_count);
     break;
   case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_DISCONNECT:
     if (msize != sizeof (struct DisconnectNotifyMessage))
@@ -988,14 +990,16 @@
         continue;
       }
       if (GNUNET_OK !=
-          h->handlers[hpos].callback (h->cls, &ntm->peer, em, &ntm->ats))
+          h->handlers[hpos].callback (h->cls, &ntm->peer, em, &ntm->ats,
+                                     ats_count))
       {
         /* error in processing, do not process other messages! */
         break;
       }
     }
     if (NULL != h->inbound_notify)
-      h->inbound_notify (h->cls, &ntm->peer, em, &ntm->ats);
+      h->inbound_notify (h->cls, &ntm->peer, em, &ntm->ats,
+                        ats_count);
     break;
   case GNUNET_MESSAGE_TYPE_CORE_NOTIFY_OUTBOUND:
     if (msize < sizeof (struct NotifyTrafficMessage))
@@ -1050,7 +1054,7 @@
       GNUNET_break (0);
       break;
     }
-    h->outbound_notify (h->cls, &ntm->peer, em, &ntm->ats);
+    h->outbound_notify (h->cls, &ntm->peer, em, &ntm->ats, ats_count);
     break;
   case GNUNET_MESSAGE_TYPE_CORE_SEND_READY:
     if (msize != sizeof (struct SendMessageReady))

Modified: gnunet/src/core/core_api_iterate_peers.c
===================================================================
--- gnunet/src/core/core_api_iterate_peers.c    2011-10-22 21:20:14 UTC (rev 
17676)
+++ gnunet/src/core/core_api_iterate_peers.c    2011-10-22 21:59:27 UTC (rev 
17677)
@@ -79,7 +79,7 @@
        (ntohs (msg->size) == sizeof (struct GNUNET_MessageHeader))))
   {
     if (request_context->peer_cb != NULL)
-      request_context->peer_cb (request_context->cb_cls, NULL, NULL);
+      request_context->peer_cb (request_context->cb_cls, NULL, NULL, 0);
     GNUNET_CLIENT_disconnect (request_context->client, GNUNET_NO);
     GNUNET_free (request_context);
     return;
@@ -92,22 +92,20 @@
   {
     GNUNET_break (0);
     if (request_context->peer_cb != NULL)
-      request_context->peer_cb (request_context->cb_cls, NULL, NULL);
+      request_context->peer_cb (request_context->cb_cls, NULL, NULL, 0);
     GNUNET_CLIENT_disconnect (request_context->client, GNUNET_NO);
     GNUNET_free (request_context);
     return;
   }
   connect_message = (const struct ConnectNotifyMessage *) msg;
   ats_count = ntohl (connect_message->ats_count);
-  if ((msize !=
-       sizeof (struct ConnectNotifyMessage) +
-       ats_count * sizeof (struct GNUNET_ATS_Information)) ||
-      (GNUNET_ATS_ARRAY_TERMINATOR !=
-       ntohl ((&connect_message->ats)[ats_count].type)))
+  if (msize !=
+      sizeof (struct ConnectNotifyMessage) +
+      ats_count * sizeof (struct GNUNET_ATS_Information)) 
   {
     GNUNET_break (0);
     if (request_context->peer_cb != NULL)
-      request_context->peer_cb (request_context->cb_cls, NULL, NULL);
+      request_context->peer_cb (request_context->cb_cls, NULL, NULL, 0);
     GNUNET_CLIENT_disconnect (request_context->client, GNUNET_NO);
     GNUNET_free (request_context);
     return;
@@ -115,7 +113,8 @@
   /* Normal case */
   if (request_context->peer_cb != NULL)
     request_context->peer_cb (request_context->cb_cls, &connect_message->peer,
-                              &connect_message->ats);
+                              (const struct GNUNET_ATS_Information *) 
&connect_message[1],
+                             ats_count);
   GNUNET_CLIENT_receive (request_context->client, &receive_info,
                          request_context, GNUNET_TIME_UNIT_FOREVER_REL);
 }

Modified: gnunet/src/core/gnunet-core-list-connections.c
===================================================================
--- gnunet/src/core/gnunet-core-list-connections.c      2011-10-22 21:20:14 UTC 
(rev 17676)
+++ gnunet/src/core/gnunet-core-list-connections.c      2011-10-22 21:59:27 UTC 
(rev 17677)
@@ -123,7 +123,8 @@
  */
 static void
 connected_peer_callback (void *cls, const struct GNUNET_PeerIdentity *peer,
-                         const struct GNUNET_ATS_Information *atsi)
+                         const struct GNUNET_ATS_Information *atsi,
+                        unsigned int atsi_count)
 {
   struct PrintContext *pc;
 

Modified: gnunet/src/core/gnunet-service-core_clients.c
===================================================================
--- gnunet/src/core/gnunet-service-core_clients.c       2011-10-22 21:20:14 UTC 
(rev 17676)
+++ gnunet/src/core/gnunet-service-core_clients.c       2011-10-22 21:59:27 UTC 
(rev 17677)
@@ -658,11 +658,9 @@
     cnm->header.size = htons (size);
     cnm->header.type = htons (GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT);
     cnm->ats_count = htonl (atsi_count);
-    a = &cnm->ats;
+    a = (struct GNUNET_ATS_Information* ) &cnm[1];
     memcpy (a, atsi,
            sizeof (struct GNUNET_ATS_Information) * atsi_count);
-    a[atsi_count].type = htonl (GNUNET_ATS_ARRAY_TERMINATOR);
-    a[atsi_count].value = htonl (0);
 #if DEBUG_CORE
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 
                "Sending `%s' message to client.\n",

Modified: gnunet/src/core/gnunet-service-core_sessions.c
===================================================================
--- gnunet/src/core/gnunet-service-core_sessions.c      2011-10-22 21:20:14 UTC 
(rev 17676)
+++ gnunet/src/core/gnunet-service-core_sessions.c      2011-10-22 21:59:27 UTC 
(rev 17677)
@@ -672,17 +672,13 @@
   struct GNUNET_SERVER_TransmitContext *tc = cls;
   struct Session *session = value;
   struct ConnectNotifyMessage cnm;
-  struct GNUNET_ATS_Information *a;
  
   /* FIXME: code duplication with clients... */
   cnm.header.size = htons (sizeof (struct ConnectNotifyMessage));
   cnm.header.type = htons (GNUNET_MESSAGE_TYPE_CORE_NOTIFY_CONNECT);
+  // FIXME: full ats...
   cnm.ats_count = htonl (0);
   cnm.peer = session->peer;
-  a = &cnm.ats;
-  // FIXME: full ats...
-  a[0].type = htonl (GNUNET_ATS_ARRAY_TERMINATOR);
-  a[0].value = htonl (0);
   GNUNET_SERVER_transmit_context_append_message (tc, &cnm.header);
   return GNUNET_OK;
 }

Modified: gnunet/src/core/test_core_api.c
===================================================================
--- gnunet/src/core/test_core_api.c     2011-10-22 21:20:14 UTC (rev 17676)
+++ gnunet/src/core/test_core_api.c     2011-10-22 21:59:27 UTC (rev 17677)
@@ -165,7 +165,7 @@
 
 static void
 connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
-                const struct GNUNET_ATS_Information *atsi)
+                const struct GNUNET_ATS_Information *atsi, unsigned int 
atsi_count)
 {
   struct PeerContext *pc = cls;
 
@@ -218,7 +218,7 @@
 static int
 inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
                 const struct GNUNET_MessageHeader *message,
-                const struct GNUNET_ATS_Information *atsi)
+                const struct GNUNET_ATS_Information *atsi, unsigned int 
atsi_count)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Core provides inbound data from `%4s'.\n", GNUNET_i2s (other));
@@ -229,7 +229,7 @@
 static int
 outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
                  const struct GNUNET_MessageHeader *message,
-                 const struct GNUNET_ATS_Information *atsi)
+                 const struct GNUNET_ATS_Information *atsi, unsigned int 
atsi_count)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "Core notifies about outbound data for `%4s'.\n",
@@ -242,7 +242,7 @@
 static int
 process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
                const struct GNUNET_MessageHeader *message,
-               const struct GNUNET_ATS_Information *atsi)
+               const struct GNUNET_ATS_Information *atsi, unsigned int 
atsi_count)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving message from `%4s'.\n",
               GNUNET_i2s (peer));

Modified: gnunet/src/core/test_core_api_reliability.c
===================================================================
--- gnunet/src/core/test_core_api_reliability.c 2011-10-22 21:20:14 UTC (rev 
17676)
+++ gnunet/src/core/test_core_api_reliability.c 2011-10-22 21:59:27 UTC (rev 
17677)
@@ -239,7 +239,7 @@
 
 static void
 connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
-                const struct GNUNET_ATS_Information *atsi)
+                const struct GNUNET_ATS_Information *atsi, unsigned int 
atsi_count)
 {
   struct PeerContext *pc = cls;
 
@@ -284,7 +284,7 @@
 static int
 inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
                 const struct GNUNET_MessageHeader *message,
-                const struct GNUNET_ATS_Information *atsi)
+                const struct GNUNET_ATS_Information *atsi, unsigned int 
atsi_count)
 {
 #if VERBOSE
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -297,7 +297,7 @@
 static int
 outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
                  const struct GNUNET_MessageHeader *message,
-                 const struct GNUNET_ATS_Information *atsi)
+                 const struct GNUNET_ATS_Information *atsi, unsigned int 
atsi_count)
 {
 #if VERBOSE
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -314,7 +314,7 @@
 static int
 process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
                const struct GNUNET_MessageHeader *message,
-               const struct GNUNET_ATS_Information *atsi)
+               const struct GNUNET_ATS_Information *atsi, unsigned int 
atsi_count)
 {
   static int n;
   unsigned int s;

Modified: gnunet/src/core/test_core_api_send_to_self.c
===================================================================
--- gnunet/src/core/test_core_api_send_to_self.c        2011-10-22 21:20:14 UTC 
(rev 17676)
+++ gnunet/src/core/test_core_api_send_to_self.c        2011-10-22 21:59:27 UTC 
(rev 17677)
@@ -90,7 +90,7 @@
 static int
 receive (void *cls, const struct GNUNET_PeerIdentity *other,
          const struct GNUNET_MessageHeader *message,
-         const struct GNUNET_ATS_Information *atsi)
+         const struct GNUNET_ATS_Information *atsi, unsigned int atsi_count)
 {
   if (die_task != GNUNET_SCHEDULER_NO_TASK)
     GNUNET_SCHEDULER_cancel (die_task);
@@ -134,7 +134,7 @@
 
 static void
 connect_cb (void *cls, const struct GNUNET_PeerIdentity *peer,
-            const struct GNUNET_ATS_Information *atsi)
+            const struct GNUNET_ATS_Information *atsi, unsigned int atsi_count)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Connected to peer %s.\n",
               GNUNET_i2s (peer));

Modified: gnunet/src/core/test_core_api_start_only.c
===================================================================
--- gnunet/src/core/test_core_api_start_only.c  2011-10-22 21:20:14 UTC (rev 
17676)
+++ gnunet/src/core/test_core_api_start_only.c  2011-10-22 21:59:27 UTC (rev 
17677)
@@ -67,7 +67,8 @@
 
 static void
 connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
-                const struct GNUNET_ATS_Information *atsi)
+                const struct GNUNET_ATS_Information *atsi,
+               unsigned int atsi_count)
 {
 }
 
@@ -81,7 +82,8 @@
 static int
 inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
                 const struct GNUNET_MessageHeader *message,
-                const struct GNUNET_ATS_Information *atsi)
+                const struct GNUNET_ATS_Information *atsi,
+               unsigned int atsi_count)
 {
   return GNUNET_OK;
 }
@@ -90,7 +92,8 @@
 static int
 outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
                  const struct GNUNET_MessageHeader *message,
-                 const struct GNUNET_ATS_Information *atsi)
+                 const struct GNUNET_ATS_Information *atsi,
+                unsigned int atsi_count)
 {
   return GNUNET_OK;
 }

Modified: gnunet/src/core/test_core_quota_compliance.c
===================================================================
--- gnunet/src/core/test_core_quota_compliance.c        2011-10-22 21:20:14 UTC 
(rev 17676)
+++ gnunet/src/core/test_core_quota_compliance.c        2011-10-22 21:59:27 UTC 
(rev 17677)
@@ -364,7 +364,7 @@
 
 static void
 connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
-                const struct GNUNET_ATS_Information *atsi)
+                const struct GNUNET_ATS_Information *atsi, unsigned int 
atsi_count)
 {
   struct PeerContext *pc = cls;
 
@@ -431,7 +431,7 @@
 static int
 inbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
                 const struct GNUNET_MessageHeader *message,
-                const struct GNUNET_ATS_Information *atsi)
+                const struct GNUNET_ATS_Information *atsi, unsigned int 
atsi_count)
 {
 #if DEBUG_TRANSMISSION
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -446,7 +446,7 @@
 static int
 outbound_notify (void *cls, const struct GNUNET_PeerIdentity *other,
                  const struct GNUNET_MessageHeader *message,
-                 const struct GNUNET_ATS_Information *atsi)
+                 const struct GNUNET_ATS_Information *atsi, unsigned int 
atsi_count)
 {
 #if DEBUG_TRANSMISSION
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -463,7 +463,7 @@
 static int
 process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
                const struct GNUNET_MessageHeader *message,
-               const struct GNUNET_ATS_Information *atsi)
+               const struct GNUNET_ATS_Information *atsi, unsigned int 
atsi_count)
 {
   static int n;
   const struct TestMessage *hdr;

Modified: gnunet/src/dht/gnunet-service-dht_neighbours.c
===================================================================
--- gnunet/src/dht/gnunet-service-dht_neighbours.c      2011-10-22 21:20:14 UTC 
(rev 17676)
+++ gnunet/src/dht/gnunet-service-dht_neighbours.c      2011-10-22 21:59:27 UTC 
(rev 17677)
@@ -600,10 +600,12 @@
  * @param cls closure
  * @param peer peer identity this notification is about
  * @param atsi performance data
+ * @param atsi_count number of records in 'atsi'
  */
 static void
 handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
-                     const struct GNUNET_ATS_Information *atsi)
+                     const struct GNUNET_ATS_Information *atsi,
+                    unsigned int atsi_count)
 {
   struct PeerInfo *ret;
   int peer_bucket;
@@ -1508,6 +1510,7 @@
  * @param message message
  * @param peer peer identity this notification is about
  * @param atsi performance data
+ * @param atsi_count number of records in 'atsi'
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
  */
@@ -1516,7 +1519,8 @@
                    const struct GNUNET_PeerIdentity *peer,
                    const struct GNUNET_MessageHeader *message,
                    const struct GNUNET_ATS_Information
-                   *atsi)
+                   *atsi,
+                   unsigned int atsi_count)
 {
   const struct PeerPutMessage *put;
   const struct GNUNET_PeerIdentity *put_path;
@@ -1729,6 +1733,7 @@
  * @param message message
  * @param peer peer identity this notification is about
  * @param atsi performance data
+ * @param atsi_count number of records in 'atsi'
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
  */
@@ -1736,7 +1741,8 @@
 handle_dht_p2p_get (void *cls, const struct GNUNET_PeerIdentity *peer,
                    const struct GNUNET_MessageHeader *message,
                    const struct GNUNET_ATS_Information
-                   *atsi)
+                   *atsi,
+                   unsigned int atsi_count)
 {
   struct PeerGetMessage *get;
   uint32_t xquery_size;
@@ -1865,13 +1871,15 @@
  * @param message message
  * @param peer peer identity this notification is about
  * @param atsi performance data
+ * @param atsi_count number of records in 'atsi'
  * @return GNUNET_YES (do not cut p2p connection)
  */
 static int
 handle_dht_p2p_result (void *cls, const struct GNUNET_PeerIdentity *peer,
                       const struct GNUNET_MessageHeader *message,
                       const struct GNUNET_ATS_Information
-                      *atsi)
+                      *atsi,
+                      unsigned int atsi_count)
 {
   const struct PeerResultMessage *prm;
   const struct GNUNET_PeerIdentity *put_path;

Modified: gnunet/src/fs/gnunet-service-fs.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs.c   2011-10-22 21:20:14 UTC (rev 17676)
+++ gnunet/src/fs/gnunet-service-fs.c   2011-10-22 21:59:27 UTC (rev 17677)
@@ -220,13 +220,15 @@
  *        for loopback messages where we are both sender and receiver)
  * @param message the actual message
  * @param atsi performance information
+ * @param atsi_count number of records in 'atsi'
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
  */
 static int
 handle_p2p_put (void *cls, const struct GNUNET_PeerIdentity *other,
                 const struct GNUNET_MessageHeader *message,
-                const struct GNUNET_ATS_Information *atsi)
+                const struct GNUNET_ATS_Information *atsi,
+               unsigned int atsi_count)
 {
   struct GSF_ConnectedPeer *cp;
 
@@ -299,13 +301,15 @@
  *        for loopback messages where we are both sender and receiver)
  * @param message the actual message
  * @param atsi performance information
+ * @param atsi_count number of records in 'atsi'
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
  */
 static int
 handle_p2p_get (void *cls, const struct GNUNET_PeerIdentity *other,
                 const struct GNUNET_MessageHeader *message,
-                const struct GNUNET_ATS_Information *atsi)
+                const struct GNUNET_ATS_Information *atsi,
+               unsigned int atsi_count)
 {
   struct GSF_PendingRequest *pr;
 
@@ -456,16 +460,18 @@
  * @param cls closure, not used
  * @param peer peer identity this notification is about
  * @param atsi performance information
+ * @param atsi_count number of records in 'atsi'
  */
 static void
 peer_connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
-                      const struct GNUNET_ATS_Information *atsi)
+                      const struct GNUNET_ATS_Information *atsi,
+                     unsigned int atsi_count)
 {
   struct GSF_ConnectedPeer *cp;
 
   if (0 == memcmp (&my_id, peer, sizeof (struct GNUNET_PeerIdentity)))
     return;
-  cp = GSF_peer_connect_handler_ (peer, atsi);
+  cp = GSF_peer_connect_handler_ (peer, atsi, atsi_count);
   if (NULL == cp)
     return;
   GSF_iterate_pending_requests_ (&consider_peer_for_forwarding, cp);

Modified: gnunet/src/fs/gnunet-service-fs_cp.c
===================================================================
--- gnunet/src/fs/gnunet-service-fs_cp.c        2011-10-22 21:20:14 UTC (rev 
17676)
+++ gnunet/src/fs/gnunet-service-fs_cp.c        2011-10-22 21:59:27 UTC (rev 
17677)
@@ -328,25 +328,20 @@
  * Find latency information in 'atsi'.
  *
  * @param atsi performance data
+ * @param atsi_count number of records in 'atsi'
  * @return connection latency
  */
 static struct GNUNET_TIME_Relative
-get_latency (const struct GNUNET_ATS_Information *atsi)
+get_latency (const struct GNUNET_ATS_Information *atsi,
+            unsigned int atsi_count)
 {
-  if (atsi == NULL)
-    return GNUNET_TIME_UNIT_SECONDS;
-  while ((ntohl (atsi->type) != GNUNET_ATS_ARRAY_TERMINATOR) &&
-         (ntohl (atsi->type) != GNUNET_ATS_QUALITY_NET_DELAY))
-    atsi++;
-  if (ntohl (atsi->type) == GNUNET_ATS_ARRAY_TERMINATOR)
-  {
-    /* We sometime have no latency data, i.e. if the address came from 
-       peerinfo and we never had a chance to play transport-level 
-       PING/PONG yet. Assume 1s in that case. */
-    return GNUNET_TIME_UNIT_SECONDS;
-  }
-  return GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS,
-                                        ntohl (atsi->value));
+  unsigned int i;
+
+  for (i=0;i<atsi_count;i++)
+    if (ntohl (atsi->type) == GNUNET_ATS_QUALITY_NET_DELAY)
+      return GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_MILLISECONDS,
+                                           ntohl (atsi->value));
+  return GNUNET_TIME_UNIT_SECONDS;
 }
 
 
@@ -355,14 +350,16 @@
  *
  * @param cp peer record to update
  * @param atsi transport performance data
+ * @param atsi_count number of records in 'atsi'
  */
 static void
 update_atsi (struct GSF_ConnectedPeer *cp,
-             const struct GNUNET_ATS_Information *atsi)
+             const struct GNUNET_ATS_Information *atsi,
+            unsigned int atsi_count)
 {
   struct GNUNET_TIME_Relative latency;
 
-  latency = get_latency (atsi);
+  latency = get_latency (atsi, atsi_count);
   GNUNET_LOAD_value_set_decline (cp->ppd.transmission_delay, latency);
   /* LATER: merge atsi into cp's performance data (if we ever care...) */
 }
@@ -584,11 +581,13 @@
  *
  * @param peer identity of peer that connected
  * @param atsi performance data for the connection
+ * @param atsi_count number of records in 'atsi'
  * @return handle to connected peer entry
  */
 struct GSF_ConnectedPeer *
 GSF_peer_connect_handler_ (const struct GNUNET_PeerIdentity *peer,
-                           const struct GNUNET_ATS_Information *atsi)
+                           const struct GNUNET_ATS_Information *atsi,
+                          unsigned int atsi_count)
 {
   struct GSF_ConnectedPeer *cp;
   char *fn;
@@ -619,7 +618,7 @@
                         ("# peers connected"), 
                         GNUNET_CONTAINER_multihashmap_size (cp_map),
                         GNUNET_NO);
-  update_atsi (cp, atsi);
+  update_atsi (cp, atsi, atsi_count);
   GSF_push_start_ (cp);
   return cp;
 }
@@ -674,6 +673,7 @@
  *        for loopback messages where we are both sender and receiver)
  * @param message the actual message
  * @param atsi performance information
+ * @param atsi_count number of records in 'atsi'
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
  */
@@ -682,7 +682,8 @@
                                 const struct GNUNET_PeerIdentity *other,
                                 const struct GNUNET_MessageHeader *message,
                                 const struct GNUNET_ATS_Information
-                                *atsi)
+                                *atsi,
+                               unsigned int atsi_count)
 {
   struct GSF_ConnectedPeer *cp;
   const struct MigrationStopMessage *msm;
@@ -710,7 +711,7 @@
     cp->mig_revive_task =
         GNUNET_SCHEDULER_add_delayed (bt, &revive_migration, cp);
   }
-  update_atsi (cp, atsi);
+  update_atsi (cp, atsi, atsi_count);
   return GNUNET_OK;
 }
 

Modified: gnunet/src/fs/gnunet-service-fs_cp.h
===================================================================
--- gnunet/src/fs/gnunet-service-fs_cp.h        2011-10-22 21:20:14 UTC (rev 
17676)
+++ gnunet/src/fs/gnunet-service-fs_cp.h        2011-10-22 21:59:27 UTC (rev 
17677)
@@ -168,11 +168,13 @@
  *
  * @param peer identity of peer that connected
  * @param atsi performance data for the connection
+ * @param atsi_count number of records in 'atsi'
  * @return handle to connected peer entry
  */
 struct GSF_ConnectedPeer *
 GSF_peer_connect_handler_ (const struct GNUNET_PeerIdentity *peer,
-                           const struct GNUNET_ATS_Information *atsi);
+                           const struct GNUNET_ATS_Information *atsi,
+                          unsigned int atsi_count);
 
 
 /**
@@ -260,6 +262,7 @@
  *        for loopback messages where we are both sender and receiver)
  * @param message the actual message
  * @param atsi performance information
+ * @param atsi_count number of records in 'atsi'
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
  */
@@ -268,7 +271,8 @@
                                 const struct GNUNET_PeerIdentity *other,
                                 const struct GNUNET_MessageHeader *message,
                                 const struct GNUNET_ATS_Information
-                                *atsi);
+                                *atsi,
+                               unsigned int atsi_count);
 
 
 /**

Modified: gnunet/src/hostlist/gnunet-daemon-hostlist.c
===================================================================
--- gnunet/src/hostlist/gnunet-daemon-hostlist.c        2011-10-22 21:20:14 UTC 
(rev 17676)
+++ gnunet/src/hostlist/gnunet-daemon-hostlist.c        2011-10-22 21:59:27 UTC 
(rev 17677)
@@ -136,14 +136,17 @@
 
 /**
  * Core handler for p2p hostlist advertisements
+ *
+ * @param atsi_count number of records in 'atsi'
  */
 static int
 advertisement_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
                        const struct GNUNET_MessageHeader *message,
-                       const struct GNUNET_ATS_Information *atsi)
+                       const struct GNUNET_ATS_Information *atsi,
+                      unsigned int atsi_count)
 {
   GNUNET_assert (NULL != client_adv_handler);
-  return (*client_adv_handler) (cls, peer, message, atsi);
+  return (*client_adv_handler) (cls, peer, message, atsi, atsi_count);
 }
 
 
@@ -153,20 +156,22 @@
  * @param cls closure
  * @param peer peer identity this notification is about
  * @param atsi performance data
+ * @param atsi_count number of records in 'atsi'
  */
 static void
 connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
-                 const struct GNUNET_ATS_Information *atsi)
+                 const struct GNUNET_ATS_Information *atsi,
+                unsigned int atsi_count)
 {
   if (0 == memcmp (&me, peer, sizeof (struct GNUNET_PeerIdentity)))
     return;
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "A new peer connected, notifying client and server\n");
   if (NULL != client_ch)
-    (*client_ch) (cls, peer, atsi);
+    (*client_ch) (cls, peer, atsi, atsi_count);
 #if HAVE_MHD
   if (NULL != server_ch)
-    (*server_ch) (cls, peer, atsi);
+    (*server_ch) (cls, peer, atsi, atsi_count);
 #endif
 }
 

Modified: gnunet/src/hostlist/hostlist-client.c
===================================================================
--- gnunet/src/hostlist/hostlist-client.c       2011-10-22 21:20:14 UTC (rev 
17676)
+++ gnunet/src/hostlist/hostlist-client.c       2011-10-22 21:59:27 UTC (rev 
17677)
@@ -1107,10 +1107,12 @@
  * @param cls closure
  * @param peer peer identity this notification is about
  * @param atsi performance data
+ * @param atsi_count number of records in 'atsi'
  */
 static void
 handler_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
-                 const struct GNUNET_ATS_Information *atsi)
+                 const struct GNUNET_ATS_Information *atsi,
+                unsigned int atsi_count)
 {
   GNUNET_assert (stat_connection_count < UINT_MAX);
   stat_connection_count++;
@@ -1142,13 +1144,15 @@
  * @param peer the peer sending the message
  * @param message the actual message
  * @param atsi performance data
+ * @param atsi_count number of records in 'atsi'
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
  */
 static int
 handler_advertisement (void *cls, const struct GNUNET_PeerIdentity *peer,
                        const struct GNUNET_MessageHeader *message,
-                       const struct GNUNET_ATS_Information *atsi)
+                       const struct GNUNET_ATS_Information *atsi,
+                      unsigned int atsi_count)
 {
   size_t size;
   size_t uri_size;

Modified: gnunet/src/hostlist/hostlist-server.c
===================================================================
--- gnunet/src/hostlist/hostlist-server.c       2011-10-22 21:20:14 UTC (rev 
17676)
+++ gnunet/src/hostlist/hostlist-server.c       2011-10-22 21:59:27 UTC (rev 
17677)
@@ -362,10 +362,12 @@
  * @param cls closure
  * @param peer peer identity this notification is about
  * @param atsi performance data
+ * @param atsi_count number of records in 'atsi'
  */
 static void
 connect_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
-                 const struct GNUNET_ATS_Information *atsi)
+                 const struct GNUNET_ATS_Information *atsi,
+                unsigned int atsi_count)
 {
   size_t size;
 

Modified: gnunet/src/hostlist/test_gnunet_daemon_hostlist_learning.c
===================================================================
--- gnunet/src/hostlist/test_gnunet_daemon_hostlist_learning.c  2011-10-22 
21:20:14 UTC (rev 17676)
+++ gnunet/src/hostlist/test_gnunet_daemon_hostlist_learning.c  2011-10-22 
21:59:27 UTC (rev 17677)
@@ -298,7 +298,8 @@
 static int
 ad_arrive_handler (void *cls, const struct GNUNET_PeerIdentity *peer,
                    const struct GNUNET_MessageHeader *message,
-                   const struct GNUNET_ATS_Information *atsi)
+                   const struct GNUNET_ATS_Information *atsi,
+                  unsigned int atsi_count)
 {
   char *hostname;
   char *expected_uri;

Modified: gnunet/src/include/gnunet_core_service.h
===================================================================
--- gnunet/src/include/gnunet_core_service.h    2011-10-22 21:20:14 UTC (rev 
17676)
+++ gnunet/src/include/gnunet_core_service.h    2011-10-22 21:59:27 UTC (rev 
17677)
@@ -57,13 +57,15 @@
  * @param cls closure
  * @param peer peer identity this notification is about
  * @param atsi performance data for the connection
+ * @param atsi_count number of records in 'atsi'
  */
 typedef void (*GNUNET_CORE_ConnectEventHandler) (void *cls,
                                                  const struct
                                                  GNUNET_PeerIdentity * peer,
                                                  const struct
                                                  GNUNET_ATS_Information
-                                                 * atsi);
+                                                 * atsi,
+                                                unsigned int atsi_count);
 
 
 /**
@@ -86,6 +88,7 @@
  *        for loopback messages where we are both sender and receiver)
  * @param message the actual message
  * @param atsi performance data for the connection
+ * @param atsi_count number of records in 'atsi'
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
  */
@@ -96,7 +99,8 @@
                                             message,
                                             const struct
                                             GNUNET_ATS_Information *
-                                            atsi);
+                                            atsi,
+                                           unsigned int atsi_count);
 
 
 /**

Modified: gnunet/src/include/gnunet_mesh_service.h
===================================================================
--- gnunet/src/include/gnunet_mesh_service.h    2011-10-22 21:20:14 UTC (rev 
17676)
+++ gnunet/src/include/gnunet_mesh_service.h    2011-10-22 21:59:27 UTC (rev 
17677)
@@ -64,6 +64,7 @@
  * @param sender who sent the message
  * @param message the actual message
  * @param atsi performance data for the connection
+ * @param atsi_count number of records in 'atsi'
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
  */
@@ -76,7 +77,8 @@
                                             message,
                                             const struct
                                             GNUNET_ATS_Information *
-                                            atsi);
+                                            atsi,
+                                           unsigned int atsi_count);
 
 
 /**
@@ -184,13 +186,15 @@
  * @param cls closure
  * @param peer peer identity the tunnel was created to, NULL on timeout
  * @param atsi performance data for the connection
+ * @param atsi_count number of records in 'atsi'
  */
 typedef void (*GNUNET_MESH_TunnelConnectHandler) (void *cls,
                                                   const struct
                                                   GNUNET_PeerIdentity * peer,
                                                   const struct
                                                   GNUNET_ATS_Information
-                                                  * atsi);
+                                                  * atsi,
+                                                 unsigned int atsi_count);
 
 
 

Modified: gnunet/src/mesh/gnunet-service-mesh.c
===================================================================
--- gnunet/src/mesh/gnunet-service-mesh.c       2011-10-22 21:20:14 UTC (rev 
17676)
+++ gnunet/src/mesh/gnunet-service-mesh.c       2011-10-22 21:59:27 UTC (rev 
17677)
@@ -2265,6 +2265,7 @@
  * @param message message
  * @param peer peer identity this notification is about
  * @param atsi performance data
+ * @param atsi_count number of records in 'atsi'
  * 
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
@@ -2272,7 +2273,8 @@
 static int
 handle_mesh_path_create (void *cls, const struct GNUNET_PeerIdentity *peer,
                          const struct GNUNET_MessageHeader *message,
-                         const struct GNUNET_ATS_Information *atsi)
+                         const struct GNUNET_ATS_Information *atsi,
+                        unsigned int atsi_count)
 {
   unsigned int own_pos;
   uint16_t size;
@@ -2462,6 +2464,7 @@
  * @param message message
  * @param peer peer identity this notification is about
  * @param atsi performance data
+ * @param atsi_count number of records in 'atsi'
  *
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
@@ -2469,7 +2472,8 @@
 static int
 handle_mesh_path_destroy (void *cls, const struct GNUNET_PeerIdentity *peer,
                           const struct GNUNET_MessageHeader *message,
-                          const struct GNUNET_ATS_Information *atsi)
+                          const struct GNUNET_ATS_Information *atsi,
+                         unsigned int atsi_count)
 {
   struct GNUNET_MESH_ManipulatePath *msg;
   struct GNUNET_PeerIdentity *pi;
@@ -2546,6 +2550,7 @@
  * @param message message
  * @param peer peer identity this notification is about
  * @param atsi performance data
+ * @param atsi_count number of records in 'atsi'
  *
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
@@ -2553,7 +2558,8 @@
 static int
 handle_mesh_tunnel_destroy (void *cls, const struct GNUNET_PeerIdentity *peer,
                             const struct GNUNET_MessageHeader *message,
-                            const struct GNUNET_ATS_Information *atsi)
+                            const struct GNUNET_ATS_Information *atsi,
+                           unsigned int atsi_count)
 {
   struct GNUNET_MESH_TunnelDestroy *msg;
   struct MeshTunnel *t;
@@ -2596,13 +2602,15 @@
  * @param peer peer identity this notification is about
  * @param message message
  * @param atsi performance data
+ * @param atsi_count number of records in 'atsi'
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
  */
 static int
 handle_mesh_data_unicast (void *cls, const struct GNUNET_PeerIdentity *peer,
                           const struct GNUNET_MessageHeader *message,
-                          const struct GNUNET_ATS_Information *atsi)
+                          const struct GNUNET_ATS_Information *atsi,
+                         unsigned int atsi_count)
 {
   struct GNUNET_MESH_Unicast *msg;
   struct MeshTunnel *t;
@@ -2654,6 +2662,7 @@
  * @param message message
  * @param peer peer identity this notification is about
  * @param atsi performance data
+ * @param atsi_count number of records in 'atsi'
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
  *
@@ -2662,7 +2671,8 @@
 static int
 handle_mesh_data_multicast (void *cls, const struct GNUNET_PeerIdentity *peer,
                             const struct GNUNET_MessageHeader *message,
-                            const struct GNUNET_ATS_Information *atsi)
+                            const struct GNUNET_ATS_Information *atsi,
+                           unsigned int atsi_count)
 {
   struct GNUNET_MESH_Multicast *msg;
   struct MeshTunnel *t;
@@ -2707,6 +2717,7 @@
  * @param message message
  * @param peer peer identity this notification is about
  * @param atsi performance data
+ * @param atsi_count number of records in 'atsi'
  *
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
@@ -2714,7 +2725,8 @@
 static int
 handle_mesh_data_to_orig (void *cls, const struct GNUNET_PeerIdentity *peer,
                           const struct GNUNET_MessageHeader *message,
-                          const struct GNUNET_ATS_Information *atsi)
+                          const struct GNUNET_ATS_Information *atsi,
+                         unsigned int atsi_count)
 {
   struct GNUNET_MESH_ToOrigin *msg;
   struct GNUNET_PeerIdentity id;
@@ -2794,6 +2806,7 @@
  * @param message message
  * @param peer peer identity this notification is about
  * @param atsi performance data
+ * @param atsi_count number of records in 'atsi'
  *
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
@@ -2801,7 +2814,8 @@
 static int
 handle_mesh_path_ack (void *cls, const struct GNUNET_PeerIdentity *peer,
                       const struct GNUNET_MessageHeader *message,
-                      const struct GNUNET_ATS_Information *atsi)
+                      const struct GNUNET_ATS_Information *atsi,
+                     unsigned int atsi_count)
 {
   struct GNUNET_MESH_PathACK *msg;
   struct GNUNET_PeerIdentity id;
@@ -3739,7 +3753,7 @@
     copy->tid = htonl (t->id.tid);
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "MESH:   calling generic handler...\n");
-    handle_mesh_data_unicast (NULL, &my_full_id, &copy->header, NULL);
+    handle_mesh_data_unicast (NULL, &my_full_id, &copy->header, NULL, 0);
   }
   GNUNET_SERVER_receive_done (client, GNUNET_OK);
   return;
@@ -3825,7 +3839,7 @@
     copy->sender = my_full_id;
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "MESH:   calling generic handler...\n");
-    handle_mesh_data_to_orig (NULL, &my_full_id, &copy->header, NULL);
+    handle_mesh_data_to_orig (NULL, &my_full_id, &copy->header, NULL, 0);
   }
   GNUNET_SERVER_receive_done (client, GNUNET_OK);
   return;
@@ -3896,7 +3910,7 @@
     copy->tid = htonl(t->id.tid);
     GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                 "MESH:   calling generic handler...\n");
-    handle_mesh_data_multicast(client, &my_full_id, &copy->header, NULL);
+    handle_mesh_data_multicast(client, &my_full_id, &copy->header, NULL, 0);
   }
 
   /* receive done gets called when last copy is sent to a neighbor */
@@ -3961,10 +3975,12 @@
  * @param cls closure
  * @param peer peer identity this notification is about
  * @param atsi performance data for the connection
+ * @param atsi_count number of records in 'atsi'
  */
 static void
 core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
-              const struct GNUNET_ATS_Information *atsi)
+              const struct GNUNET_ATS_Information *atsi,
+             unsigned int atsi_count)
 {
   struct MeshPeerInfo *peer_info;
   struct MeshPeerPath *path;

Modified: gnunet/src/mesh/mesh_api.c
===================================================================
--- gnunet/src/mesh/mesh_api.c  2011-10-22 21:20:14 UTC (rev 17676)
+++ gnunet/src/mesh/mesh_api.c  2011-10-22 21:59:27 UTC (rev 17677)
@@ -113,7 +113,6 @@
   /* list of application-types */
   struct type_list_element *type_head, *type_tail;
 
-  struct GNUNET_ATS_Information atsi;
   struct peer_list_element *next, *prev;
 
   /* The handle that sends the hellos to this peer */
@@ -154,7 +153,7 @@
 
   struct GNUNET_MESH_Tunnel *tunnel = cls;
 
-  tunnel->connect_handler (tunnel->handler_cls, NULL, NULL);
+  tunnel->connect_handler (tunnel->handler_cls, NULL, NULL, 0);
 }
 
 static void
@@ -165,7 +164,7 @@
 
   struct GNUNET_MESH_Tunnel *tunnel = cls;
 
-  tunnel->connect_handler (tunnel->handler_cls, &tunnel->handle->myself, NULL);
+  tunnel->connect_handler (tunnel->handler_cls, &tunnel->handle->myself, NULL, 
0);
   GNUNET_SCHEDULER_add_now (send_end_connect, tunnel);
 }
 
@@ -177,7 +176,7 @@
 
   struct GNUNET_MESH_Tunnel *tunnel = cls;
 
-  tunnel->connect_handler (tunnel->handler_cls, &tunnel->peer, NULL);
+  tunnel->connect_handler (tunnel->handler_cls, &tunnel->peer, NULL, 0);
   GNUNET_SCHEDULER_add_now (send_end_connect, tunnel);
 }
 
@@ -254,7 +253,8 @@
  */
 static void
 core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
-              const struct GNUNET_ATS_Information *atsi)
+              const struct GNUNET_ATS_Information *atsi,
+             unsigned int atsi_count)
 {
   struct GNUNET_MESH_Handle *handle = cls;
 
@@ -269,11 +269,6 @@
 
   /* Send a hello to this peer */
   element->sched = GNUNET_SCHEDULER_add_now (schedule_hello_message, element);
-
-  if (NULL != atsi)
-    memcpy (&element->atsi, atsi,
-            sizeof (struct GNUNET_ATS_Information));
-
   GNUNET_CONTAINER_DLL_insert_after (handle->connected_peers.head,
                                      handle->connected_peers.tail,
                                      handle->connected_peers.tail, element);
@@ -294,7 +289,7 @@
                                          handle->established_tunnels.tail,
                                          handle->established_tunnels.tail,
                                          tunnel);
-      tunnel->tunnel.connect_handler (tunnel->tunnel.handler_cls, peer, atsi);
+      tunnel->tunnel.connect_handler (tunnel->tunnel.handler_cls, peer, atsi, 
atsi_count);
       GNUNET_SCHEDULER_add_now (send_end_connect, tunnel);
       tunnel = next;
     }
@@ -383,7 +378,8 @@
 static int
 receive_hello (void *cls, const struct GNUNET_PeerIdentity *other,
                const struct GNUNET_MessageHeader *message,
-               const struct GNUNET_ATS_Information *atsi)
+               const struct GNUNET_ATS_Information *atsi,
+              unsigned int atsi_count)
 {
   struct GNUNET_MESH_Handle *handle = cls;
   uint16_t *num = (uint16_t *) (message + 1);
@@ -450,7 +446,7 @@
         memcpy (&tunnel->tunnel.peer, other,
                 sizeof (struct GNUNET_PeerIdentity));
         tunnel->tunnel.connect_handler (tunnel->tunnel.handler_cls,
-                                        &tunnel->tunnel.peer, atsi);
+                                        &tunnel->tunnel.peer, atsi, 
atsi_count);
         GNUNET_SCHEDULER_add_now (send_end_connect, tunnel);
         break;
       }
@@ -469,7 +465,8 @@
 static int
 core_receive (void *cls, const struct GNUNET_PeerIdentity *other,
               const struct GNUNET_MessageHeader *message,
-              const struct GNUNET_ATS_Information *atsi)
+              const struct GNUNET_ATS_Information *atsi,
+             unsigned int atsi_count)
 {
   struct GNUNET_MESH_Handle *handle = cls;
   struct tunnel_message *tmessage = (struct tunnel_message *) message;
@@ -539,7 +536,7 @@
          GNUNET_i2s (other), ntohs (rmessage->type));
 
   return handler->callback (handle->cls, &tunnel->tunnel, &tunnel->tunnel.ctx,
-                            other, rmessage, atsi);
+                            other, rmessage, atsi, atsi_count);
 }
 
 struct GNUNET_MESH_Tunnel *

Modified: gnunet/src/nse/gnunet-service-nse.c
===================================================================
--- gnunet/src/nse/gnunet-service-nse.c 2011-10-22 21:20:14 UTC (rev 17676)
+++ gnunet/src/nse/gnunet-service-nse.c 2011-10-22 21:59:27 UTC (rev 17677)
@@ -938,12 +938,13 @@
  * @param message message
  * @param peer peer identity this message is from (ignored)
  * @param atsi performance data (ignored)
- *
+ * @param atsi_count number of records in 'atsi'
  */
 static int
 handle_p2p_size_estimate (void *cls, const struct GNUNET_PeerIdentity *peer,
                           const struct GNUNET_MessageHeader *message,
-                          const struct GNUNET_ATS_Information *atsi)
+                          const struct GNUNET_ATS_Information *atsi,
+                         unsigned int atsi_count)
 {
   const struct GNUNET_NSE_FloodMessage *incoming_flood;
   struct GNUNET_TIME_Absolute ts;
@@ -1094,10 +1095,12 @@
  * @param cls closure
  * @param peer peer identity this notification is about
  * @param atsi performance data
+ * @param atsi_count number of records in 'atsi'
  */
 static void
 handle_core_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
-                     const struct GNUNET_ATS_Information *atsi)
+                     const struct GNUNET_ATS_Information *atsi,
+                    unsigned int atsi_count)
 {
   struct NSEPeerEntry *peer_entry;
 

Modified: gnunet/src/testing/test_testing_topology.c
===================================================================
--- gnunet/src/testing/test_testing_topology.c  2011-10-22 21:20:14 UTC (rev 
17676)
+++ gnunet/src/testing/test_testing_topology.c  2011-10-22 21:59:27 UTC (rev 
17677)
@@ -348,7 +348,8 @@
 static int
 process_mtype (void *cls, const struct GNUNET_PeerIdentity *peer,
                const struct GNUNET_MessageHeader *message,
-               const struct GNUNET_ATS_Information *atsi)
+               const struct GNUNET_ATS_Information *atsi,
+              unsigned int atsi_count)
 {
   char *dotOutFileNameFinished;
   FILE *dotOutFileFinished;
@@ -537,10 +538,12 @@
  * @param cls closure
  * @param peer peer identity this notification is about
  * @param atsi performance data for the connection
+ * @param atsi_count number of records in 'atsi'
  */
 static void
 connect_notify_peers (void *cls, const struct GNUNET_PeerIdentity *peer,
-                      const struct GNUNET_ATS_Information *atsi)
+                      const struct GNUNET_ATS_Information *atsi,
+                     unsigned int atsi_count)
 {
   struct TestMessageContext *pos = cls;
 

Modified: gnunet/src/testing/testing.c
===================================================================
--- gnunet/src/testing/testing.c        2011-10-22 21:20:14 UTC (rev 17676)
+++ gnunet/src/testing/testing.c        2011-10-22 21:59:27 UTC (rev 17677)
@@ -1882,11 +1882,13 @@
  * @param cls our "struct GNUNET_TESTING_ConnectContext"
  * @param peer identity of the peer that has connected
  * @param atsi performance information
+ * @param atsi_count number of records in 'atsi'
  *
  */
 static void
 connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
-                const struct GNUNET_ATS_Information *atsi)
+                const struct GNUNET_ATS_Information *atsi,
+               unsigned int atsi_count)
 {
   struct GNUNET_TESTING_ConnectContext *ctx = cls;
 
@@ -2080,11 +2082,13 @@
  * @param peer identity of the peer that has connected,
  *        NULL when iteration has finished
  * @param atsi performance information
+ * @param atsi_count number of records in 'atsi'
  *
  */
 static void
 core_initial_iteration (void *cls, const struct GNUNET_PeerIdentity *peer,
-                        const struct GNUNET_ATS_Information *atsi)
+                        const struct GNUNET_ATS_Information *atsi,
+                       unsigned int atsi_count)
 {
   struct GNUNET_TESTING_ConnectContext *ctx = cls;
 

Modified: gnunet/src/testing/testing_group.c
===================================================================
--- gnunet/src/testing/testing_group.c  2011-10-22 21:20:14 UTC (rev 17676)
+++ gnunet/src/testing/testing_group.c  2011-10-22 21:59:27 UTC (rev 17677)
@@ -4877,7 +4877,8 @@
  */
 static void
 internal_topology_callback (void *cls, const struct GNUNET_PeerIdentity *peer,
-                            const struct GNUNET_ATS_Information *atsi)
+                            const struct GNUNET_ATS_Information *atsi,
+                           unsigned int atsi_count)
 {
   struct CoreContext *core_ctx = cls;
   struct TopologyIterateContext *iter_ctx = core_ctx->iter_context;
@@ -4941,7 +4942,7 @@
                                    &internal_topology_callback, core_context))
     {
       GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Topology iteration failed.\n");
-      internal_topology_callback (core_context, NULL, NULL);
+      internal_topology_callback (core_context, NULL, NULL, 0);
     }
   }
 }

Modified: gnunet/src/topology/gnunet-daemon-topology.c
===================================================================
--- gnunet/src/topology/gnunet-daemon-topology.c        2011-10-22 21:20:14 UTC 
(rev 17676)
+++ gnunet/src/topology/gnunet-daemon-topology.c        2011-10-22 21:59:27 UTC 
(rev 17677)
@@ -632,10 +632,12 @@
  * @param cls closure
  * @param peer peer identity this notification is about
  * @param atsi performance data
+ * @param atsi_count number of records in 'atsi'
  */
 static void
 connect_notify (void *cls, const struct GNUNET_PeerIdentity *peer,
-                const struct GNUNET_ATS_Information *atsi)
+                const struct GNUNET_ATS_Information *atsi,
+               unsigned int atsi_count)
 {
   struct Peer *pos;
 
@@ -1100,13 +1102,15 @@
  *        for loopback messages where we are both sender and receiver)
  * @param message the actual HELLO message
  * @param atsi performance data
+ * @param atsi_count number of records in 'atsi'
  * @return GNUNET_OK to keep the connection open,
  *         GNUNET_SYSERR to close it (signal serious error)
  */
 static int
 handle_encrypted_hello (void *cls, const struct GNUNET_PeerIdentity *other,
                         const struct GNUNET_MessageHeader *message,
-                        const struct GNUNET_ATS_Information *atsi)
+                        const struct GNUNET_ATS_Information *atsi,
+                       unsigned int atsi_count)
 {
   struct Peer *peer;
   struct GNUNET_PeerIdentity pid;

Modified: gnunet/src/vpn/gnunet-daemon-exit.c
===================================================================
--- gnunet/src/vpn/gnunet-daemon-exit.c 2011-10-22 21:20:14 UTC (rev 17676)
+++ gnunet/src/vpn/gnunet-daemon-exit.c 2011-10-22 21:59:27 UTC (rev 17677)
@@ -1025,7 +1025,9 @@
                      __attribute__ ((unused)),
                      const struct GNUNET_MessageHeader *message,
                      const struct GNUNET_ATS_Information *atsi
-                     __attribute__ ((unused)))
+                     __attribute__ ((unused)),
+                    unsigned int atsi_count
+                    __attribute__ ((unused)))
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Received TCP-Packet\n");
   GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
@@ -1133,7 +1135,9 @@
                     __attribute__ ((unused)),
                     const struct GNUNET_MessageHeader *message,
                     const struct GNUNET_ATS_Information *atsi
-                    __attribute__ ((unused)))
+                    __attribute__ ((unused)),
+                   unsigned int atsi_count
+                   __attribute__ ((unused)))
 {
   GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
   struct tcp_pkt *pkt = (struct tcp_pkt *) (desc + 1);
@@ -1209,7 +1213,9 @@
                     __attribute__ ((unused)),
                     const struct GNUNET_MessageHeader *message,
                     const struct GNUNET_ATS_Information *atsi
-                    __attribute__ ((unused)))
+                    __attribute__ ((unused)),
+                   unsigned int atsi_count
+                   __attribute__ ((unused)))
 {
   GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
   struct udp_pkt *pkt = (struct udp_pkt *) (desc + 1);
@@ -1289,7 +1295,9 @@
                      __attribute__ ((unused)),
                      const struct GNUNET_MessageHeader *message,
                      const struct GNUNET_ATS_Information *atsi
-                     __attribute__ ((unused)))
+                     __attribute__ ((unused)),
+                    unsigned int atsi_count
+                    __attribute__ ((unused)))
 {
   GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
   struct udp_pkt *pkt = (struct udp_pkt *) (desc + 1);

Modified: gnunet/src/vpn/gnunet-daemon-vpn-helper.c
===================================================================
--- gnunet/src/vpn/gnunet-daemon-vpn-helper.c   2011-10-22 21:20:14 UTC (rev 
17676)
+++ gnunet/src/vpn/gnunet-daemon-vpn-helper.c   2011-10-22 21:59:27 UTC (rev 
17677)
@@ -333,7 +333,7 @@
           else if (NULL != cls)
           {
             *cls = me->tunnel;
-            send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL);
+            send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL, 0);
             GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                         "Queued to send IPv6 to peer %x, type %d\n",
                         *((unsigned int *) &me->desc.peer), ntohs (hdr->type));
@@ -384,7 +384,7 @@
           else if (NULL != cls)
           {
             *cls = me->tunnel;
-            send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL);
+            send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL, 0);
           }
         }
       }
@@ -535,7 +535,7 @@
             else if (NULL != cls)
             {
               *cls = me->tunnel;
-              send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL);
+              send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL, 
0);
               GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
                           "Queued to send IPv4 to peer %x, type %d\n",
                           *((unsigned int *) &me->desc.peer),
@@ -577,7 +577,7 @@
             else if (NULL != cls)
             {
               *cls = me->tunnel;
-              send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL);
+              send_pkt_to_peer (cls, (struct GNUNET_PeerIdentity *) 1, NULL, 
0);
             }
           }
         }

Modified: gnunet/src/vpn/gnunet-daemon-vpn.c
===================================================================
--- gnunet/src/vpn/gnunet-daemon-vpn.c  2011-10-22 21:20:14 UTC (rev 17676)
+++ gnunet/src/vpn/gnunet-daemon-vpn.c  2011-10-22 21:59:27 UTC (rev 17677)
@@ -341,7 +341,9 @@
 void
 send_pkt_to_peer (void *cls, const struct GNUNET_PeerIdentity *peer,
                   const struct GNUNET_ATS_Information *atsi
-                  __attribute__ ((unused)))
+                  __attribute__ ((unused)),
+                 unsigned int atsi_count
+                 __attribute__ ((unused)))
 {
   /* peer == NULL means that all peers in this request are connected */
   if (peer == NULL)
@@ -872,7 +874,9 @@
                   __attribute__ ((unused)),
                   const struct GNUNET_MessageHeader *message,
                   const struct GNUNET_ATS_Information *atsi
-                  __attribute__ ((unused)))
+                  __attribute__ ((unused)),
+                 unsigned int atsi_count
+                 __attribute__ ((unused)))
 {
   GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
   struct remote_addr *s = (struct remote_addr *) desc;
@@ -1051,7 +1055,9 @@
                   __attribute__ ((unused)),
                   const struct GNUNET_MessageHeader *message,
                   const struct GNUNET_ATS_Information *atsi
-                  __attribute__ ((unused)))
+                  __attribute__ ((unused)),
+                 unsigned int atsi_count
+                 __attribute__ ((unused)))
 {
   GNUNET_HashCode *desc = (GNUNET_HashCode *) (message + 1);
   struct remote_addr *s = (struct remote_addr *) desc;

Modified: gnunet/src/vpn/gnunet-daemon-vpn.h
===================================================================
--- gnunet/src/vpn/gnunet-daemon-vpn.h  2011-10-22 21:20:14 UTC (rev 17676)
+++ gnunet/src/vpn/gnunet-daemon-vpn.h  2011-10-22 21:59:27 UTC (rev 17677)
@@ -56,7 +56,8 @@
 
 void
 send_pkt_to_peer (void *cls, const struct GNUNET_PeerIdentity *peer,
-                  const struct GNUNET_ATS_Information *atsi);
+                  const struct GNUNET_ATS_Information *atsi,
+                 unsigned int atsi_count);
 
 /**
  * The configuration to use

Modified: gnunet/src/vpn/gnunet-service-dns.c
===================================================================
--- gnunet/src/vpn/gnunet-service-dns.c 2011-10-22 21:20:14 UTC (rev 17676)
+++ gnunet/src/vpn/gnunet-service-dns.c 2011-10-22 21:59:27 UTC (rev 17677)
@@ -325,7 +325,9 @@
 void
 mesh_connect (void *cls, const struct GNUNET_PeerIdentity *peer,
               const struct GNUNET_ATS_Information *atsi
-              __attribute__ ((unused)))
+              __attribute__ ((unused)),
+             unsigned int atsi_count
+             __attribute__ ((unused)))
 {
   if (NULL == peer)
     return;
@@ -395,7 +397,9 @@
                     __attribute__ ((unused)),
                     const struct GNUNET_MessageHeader *message,
                     const struct GNUNET_ATS_Information *atsi
-                    __attribute__ ((unused)))
+                    __attribute__ ((unused)),
+                   unsigned int atsi_count
+                   __attribute__ ((unused)))
 {
   struct dns_pkt *dns = (struct dns_pkt *) (message + 1);
 
@@ -429,7 +433,9 @@
                      const struct GNUNET_PeerIdentity *sender,
                      const struct GNUNET_MessageHeader *message,
                      const struct GNUNET_ATS_Information *atsi
-                     __attribute__ ((unused)))
+                     __attribute__ ((unused)),
+                    unsigned int atsi_count
+                    __attribute__ ((unused)))
 {
   /* TODo: size check */
   struct dns_pkt *dns = (struct dns_pkt *) (message + 1);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]