gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r26541 - gnunet/src/transport


From: gnunet
Subject: [GNUnet-SVN] r26541 - gnunet/src/transport
Date: Thu, 21 Mar 2013 14:45:09 +0100

Author: wachs
Date: 2013-03-21 14:45:09 +0100 (Thu, 21 Mar 2013)
New Revision: 26541

Modified:
   gnunet/src/transport/gnunet-service-transport.c
   gnunet/src/transport/gnunet-service-transport_blacklist.c
   gnunet/src/transport/gnunet-service-transport_clients.c
   gnunet/src/transport/gnunet-service-transport_neighbours.c
   gnunet/src/transport/gnunet-service-transport_neighbours.h
   gnunet/src/transport/test_transport_startonly.c
   gnunet/src/transport/transport.h
   gnunet/src/transport/transport_api.c
Log:
changes to connect_cb


Modified: gnunet/src/transport/gnunet-service-transport.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport.c     2013-03-21 13:33:26 UTC 
(rev 26540)
+++ gnunet/src/transport/gnunet-service-transport.c     2013-03-21 13:45:09 UTC 
(rev 26541)
@@ -111,8 +111,6 @@
  */
 static void
 transmit_our_hello (void *cls, const struct GNUNET_PeerIdentity *target,
-                    const struct GNUNET_ATS_Information *ats,
-                    uint32_t ats_count,
                     const struct GNUNET_HELLO_Address *address,
                     struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
                     struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
@@ -499,17 +497,12 @@
 static void
 neighbours_connect_notification (void *cls,
                                  const struct GNUNET_PeerIdentity *peer,
-                                 const struct GNUNET_ATS_Information *ats,
-                                 uint32_t ats_count,
                                  struct GNUNET_BANDWIDTH_Value32NBO 
bandwidth_in,
                                  struct GNUNET_BANDWIDTH_Value32NBO 
bandwidth_out)
 {
-  size_t len =
-      sizeof (struct ConnectInfoMessage) +
-      ats_count * sizeof (struct GNUNET_ATS_Information);
+  size_t len = sizeof (struct ConnectInfoMessage);
   char buf[len] GNUNET_ALIGN;
   struct ConnectInfoMessage *connect_msg = (struct ConnectInfoMessage *) buf;
-  struct GNUNET_ATS_Information *ap;
 
   connections++;
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -518,12 +511,9 @@
 
   connect_msg->header.size = htons (sizeof (buf));
   connect_msg->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_CONNECT);
-  connect_msg->ats_count = htonl (ats_count);
   connect_msg->id = *peer;
   connect_msg->quota_in = bandwidth_in;
   connect_msg->quota_out = bandwidth_out;
-  ap = (struct GNUNET_ATS_Information *) &connect_msg[1];
-  memcpy (ap, ats, ats_count * sizeof (struct GNUNET_ATS_Information));
   GST_clients_broadcast (&connect_msg->header, GNUNET_NO);
 }
 

Modified: gnunet/src/transport/gnunet-service-transport_blacklist.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_blacklist.c   2013-03-21 
13:33:26 UTC (rev 26540)
+++ gnunet/src/transport/gnunet-service-transport_blacklist.c   2013-03-21 
13:45:09 UTC (rev 26541)
@@ -548,8 +548,6 @@
  */
 static void
 test_connection_ok (void *cls, const struct GNUNET_PeerIdentity *neighbour,
-                    const struct GNUNET_ATS_Information *ats,
-                    uint32_t ats_count,
                     const struct GNUNET_HELLO_Address *address,
                     struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
                     struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)

Modified: gnunet/src/transport/gnunet-service-transport_clients.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_clients.c     2013-03-21 
13:33:26 UTC (rev 26540)
+++ gnunet/src/transport/gnunet-service-transport_clients.c     2013-03-21 
13:45:09 UTC (rev 26541)
@@ -474,30 +474,22 @@
 static void
 notify_client_about_neighbour (void *cls,
                                const struct GNUNET_PeerIdentity *peer,
-                               const struct GNUNET_ATS_Information *ats,
-                               uint32_t ats_count,
                                const struct GNUNET_HELLO_Address *address,
                                struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
                                struct GNUNET_BANDWIDTH_Value32NBO 
bandwidth_out)
 {
   struct TransportClient *tc = cls;
   struct ConnectInfoMessage *cim;
-  struct GNUNET_ATS_Information *ap;
-  size_t size =
-      sizeof (struct ConnectInfoMessage) +
-      ats_count * sizeof (struct GNUNET_ATS_Information);
+  size_t size = sizeof (struct ConnectInfoMessage);
   char buf[size] GNUNET_ALIGN;
 
   GNUNET_assert (size < GNUNET_SERVER_MAX_MESSAGE_SIZE);
   cim = (struct ConnectInfoMessage *) buf;
   cim->header.size = htons (size);
   cim->header.type = htons (GNUNET_MESSAGE_TYPE_TRANSPORT_CONNECT);
-  cim->ats_count = htonl (ats_count);
   cim->id = *peer;
   cim->quota_in = bandwidth_in;
   cim->quota_out = bandwidth_out;
-  ap = (struct GNUNET_ATS_Information *) &cim[1];
-  memcpy (ap, ats, ats_count * sizeof (struct GNUNET_ATS_Information));
   unicast (tc, &cim->header, GNUNET_NO);
 }
 
@@ -898,7 +890,6 @@
  */
 static void
 output_address (void *cls, const struct GNUNET_PeerIdentity *peer,
-                const struct GNUNET_ATS_Information *ats, uint32_t ats_count,
                 const struct GNUNET_HELLO_Address *address,
                 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
                 struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out)
@@ -965,7 +956,7 @@
     /* just return one neighbour */
     address = GST_neighbour_get_current_address (&msg->peer);
     if (address != NULL)
-      output_address (tc, &msg->peer, NULL, 0, address,
+      output_address (tc, &msg->peer, address,
                       GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT,
                       GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT);
   }

Modified: gnunet/src/transport/gnunet-service-transport_neighbours.c
===================================================================
--- gnunet/src/transport/gnunet-service-transport_neighbours.c  2013-03-21 
13:33:26 UTC (rev 26540)
+++ gnunet/src/transport/gnunet-service-transport_neighbours.c  2013-03-21 
13:45:09 UTC (rev 26541)
@@ -2800,7 +2800,7 @@
                           gettext_noop ("# peers connected"), 
                           ++neighbours_connected,
                           GNUNET_NO);
-    connect_notify_cb (callback_cls, &n->id, NULL, 0,
+    connect_notify_cb (callback_cls, &n->id,
                        n->primary_address.bandwidth_in,
                        n->primary_address.bandwidth_out);
     /* Tell ATS that the outbound session we created to send CONNECT was 
successfull */
@@ -3059,7 +3059,7 @@
                         gettext_noop ("# peers connected"), 
                         ++neighbours_connected,
                         GNUNET_NO);
-  connect_notify_cb (callback_cls, &n->id, NULL, 0,
+  connect_notify_cb (callback_cls, &n->id,
                      n->primary_address.bandwidth_in,
                      n->primary_address.bandwidth_out);
   GNUNET_ATS_address_add(GST_ats,
@@ -3244,7 +3244,7 @@
       bandwidth_out = GNUNET_CONSTANTS_DEFAULT_BW_IN_OUT;
     }
 
-    ic->cb (ic->cb_cls, &n->id, NULL, 0,
+    ic->cb (ic->cb_cls, &n->id,
             n->primary_address.address,
             bandwidth_in, bandwidth_out);
   }

Modified: gnunet/src/transport/gnunet-service-transport_neighbours.h
===================================================================
--- gnunet/src/transport/gnunet-service-transport_neighbours.h  2013-03-21 
13:33:26 UTC (rev 26540)
+++ gnunet/src/transport/gnunet-service-transport_neighbours.h  2013-03-21 
13:45:09 UTC (rev 26541)
@@ -177,8 +177,6 @@
 typedef void (*GST_NeighbourIterator) (void *cls,
                                        const struct GNUNET_PeerIdentity *
                                        neighbour,
-                                       const struct GNUNET_ATS_Information *
-                                       ats, uint32_t ats_count,
                                        const struct GNUNET_HELLO_Address *
                                        address,
                                        struct GNUNET_BANDWIDTH_Value32NBO 
bandwidth_in,

Modified: gnunet/src/transport/test_transport_startonly.c
===================================================================
--- gnunet/src/transport/test_transport_startonly.c     2013-03-21 13:33:26 UTC 
(rev 26540)
+++ gnunet/src/transport/test_transport_startonly.c     2013-03-21 13:45:09 UTC 
(rev 26541)
@@ -97,8 +97,7 @@
 
 static void
 notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
-                const struct GNUNET_MessageHeader *message,
-                const struct GNUNET_ATS_Information *ats, uint32_t ats_count)
+                const struct GNUNET_MessageHeader *message)
 {
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Receiving\n");
 }

Modified: gnunet/src/transport/transport.h
===================================================================
--- gnunet/src/transport/transport.h    2013-03-21 13:33:26 UTC (rev 26540)
+++ gnunet/src/transport/transport.h    2013-03-21 13:45:09 UTC (rev 26541)
@@ -68,8 +68,6 @@
  *
  * @param cls closure
  * @param peer the peer that connected
- * @param ats performance data
- * @param ats_count number of entries in ats (excluding 0-termination)
  * @param bandwidth_in inbound bandwidth in NBO
  * @param bandwidth_out outbound bandwidth in NBO
  *
@@ -77,8 +75,6 @@
 
 typedef void (*NotifyConnect) (void *cls,
                               const struct GNUNET_PeerIdentity *peer,
-                              const struct GNUNET_ATS_Information *ats,
-                              uint32_t ats_count,
                               struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
                               struct GNUNET_BANDWIDTH_Value32NBO 
bandwidth_out);
 
@@ -126,12 +122,6 @@
   struct GNUNET_MessageHeader header;
 
   /**
-   * Number of ATS key-value pairs that follow this struct
-   * (excluding the 0-terminator).
-   */
-  uint32_t ats_count GNUNET_PACKED;
-
-  /**
    * Identity of the new neighbour.
    */
   struct GNUNET_PeerIdentity id;

Modified: gnunet/src/transport/transport_api.c
===================================================================
--- gnunet/src/transport/transport_api.c        2013-03-21 13:33:26 UTC (rev 
26540)
+++ gnunet/src/transport/transport_api.c        2013-03-21 13:45:09 UTC (rev 
26541)
@@ -475,13 +475,11 @@
   const struct GNUNET_MessageHeader *imm;
   const struct SendOkMessage *okm;
   const struct QuotaSetMessage *qm;
-  const struct GNUNET_ATS_Information *ats;
   struct GNUNET_TRANSPORT_GetHelloHandle *hwl;
   struct GNUNET_TRANSPORT_GetHelloHandle *next_hwl;
   struct Neighbour *n;
   struct GNUNET_PeerIdentity me;
   uint16_t size;
-  uint32_t ats_count;
   uint32_t bytes_msg;
   uint32_t bytes_physical;
 
@@ -533,15 +531,12 @@
       break;
     }
     cim = (const struct ConnectInfoMessage *) msg;
-    ats_count = ntohl (cim->ats_count);
     if (size !=
-        sizeof (struct ConnectInfoMessage) +
-        ats_count * sizeof (struct GNUNET_ATS_Information))
+        sizeof (struct ConnectInfoMessage))
     {
       GNUNET_break (0);
       break;
     }
-    ats = (const struct GNUNET_ATS_Information *) &cim[1];
     LOG (GNUNET_ERROR_TYPE_DEBUG, "Receiving `%s' message for `%4s'.\n",
          "CONNECT", GNUNET_i2s (&cim->id));
     n = neighbour_find (h, &cim->id);
@@ -555,7 +550,7 @@
          "CONNECT", GNUNET_i2s (&cim->id), ntohl (cim->quota_out.value__));
     GNUNET_BANDWIDTH_tracker_update_quota (&n->out_tracker, cim->quota_out);
     if (h->nc_cb != NULL)
-      h->nc_cb (h->cls, &n->id, ats, ats_count);
+      h->nc_cb (h->cls, &n->id, NULL, 0);
     break;
   case GNUNET_MESSAGE_TYPE_TRANSPORT_DISCONNECT:
     if (size != sizeof (struct DisconnectInfoMessage))




reply via email to

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